Skip to content

Stage 3: Scientific Depth

Target versions: v2.1.0 → v2.2.0
Prerequisite: Stage 0 complete
Parallel with: 02-trading-experience.md


Goal

Honor velo-plot's scientific roots. Complete partially implemented analysis plugins, polish specialized chart types, and deliver end-to-end scientific workflows — not just API reference pages.

Scientific and trading tracks are equal priority; this stage runs in parallel with Stage 2.


Current state

Scientific strengths (v1.12.0)

AreaStatusLocation
FFT, filters, peaks, cycles✅ Stablesrc/plugins/analysis/
Curve fitting / regression (8 methods)src/plugins/regression/
3D renderers (surface, voxel, ribbon, etc.)src/plugins/3d/
Polar, radar, ternary, gauge, sankeyDedicated renderers
LaTeX axis labels (native parser)✅ Limitedsrc/plugins/latex/ (~100 commands)
Contour / spectrogramContour3DData, analysis plugin
Anomaly detectionsrc/plugins/anomaly-detection/
ML integration (native NN, regression)✅ Hardenedsrc/plugins/ml-integration/ — inference NN + trainable regression (general N×N inverse)
Pattern recognitionBuilt-in patterns + named custom-pattern API + trading signals
ForecastingSMA/WMA/EMA/SES/Holt/Holt-Winters/ARIMA + confidence bands; no throwing methods
Python Jupyter bindings⚠️ Reclassifiedpython/ is a JSON config generator, not a live Jupyter widget (see audit)
WASM shared memory bridge❌ Not presentNo WebAssembly/SharedArrayBuffer in src/ — removed from "complete" (see audit)
Video recording plugin✅ Verifiedsrc/plugins/video-recorder/webm via MediaRecorder (Chrome/Firefox)

Documentation gaps

  • Scientific workflows are fragmented across 60+ example pages
  • No single "electrochemical analysis" or "signal processing pipeline" guide
  • LaTeX limitations documented only in AGENT.md
  • Ternary/contour edge cases in docs/examples/ternary-charts.md limitations section

Work items

P0 — Complete or cut forecasting

IDTaskPriorityComplexityDefinition of done
3.1Forecasting auditP0LowList each method in algorithms.ts → implement / remove / experimental
3.2Implement native ARIMA (simple)P0Highchart.forecast('s1', { method: 'arima', horizon: 50 }) works
3.3Implement exponential smoothingP1MediumAlternative to ARIMA for smooth series
3.4Confidence bands on forecast seriesP1MediumShaded band via band series type
3.5Update forecasting example + API docsP0LowRemove references to throwing methods

P0 — Pattern recognition completion

IDTaskPriorityComplexityDefinition of done
3.6Custom pattern registration APIP1Highchart.patterns.register('my-pattern', template)
3.7Visual overlay for detected patternsP1MediumHighlight regions on chart overlay
3.8Bridge to trading: chart pattern signalsP2MediumEmit events consumable by Stage 2 alert system

P1 — LaTeX expansion

IDTaskPriorityComplexityDefinition of done
3.9Expand command vocabulary to 300+P1HighMatrices, fractions, common operators
3.10LaTeX in legend and annotationsP1Mediumannotation.latex: true
3.11Performance: cache rendered glyphsP1LowAlready partial — verify no leak

P1 — Specialized chart polish

IDTaskPriorityComplexityDefinition of done
3.12Ternary chart edge casesP1MediumBoundary points, label overlap, docs update
3.13Contour isoline labelsP1MediumReadable labels at zoom levels
3.14Polar grid enhancement verificationP2LowConfirm legacy "Phase 2" item truly complete
3.15Broken axis (xAxis.broken)P2HighListed in legacy roadmap — audit if exists or implement

P1 — ML plugin hardening

IDTaskPriorityComplexityDefinition of done
3.16ML plugin auditP1LowDocument supported model types and limits
3.17Training API for small datasetsP2HighOn-chart fit with visualized residuals
3.18Prediction overlay seriesP1Mediumchart.ml.visualizePredictions() renders correctly

P2 — External bindings audit

IDTaskPriorityComplexityDefinition of done
3.19Python bindings: verify or reclassifyP2HighWorking Jupyter widget demo, or remove from "complete"
3.20WASM bridge: verify or reclassifyP2HighSharedArrayBuffer demo, or mark experimental
3.21Video recording plugin auditP2Mediumwebm export works in Chrome/Firefox

P1 — Scientific workflow guides

IDTaskPriorityComplexityDefinition of done
3.22Guide: signal processing pipelineP1Mediumdocs/guide/signal-processing.md — FFT → filter → peaks
3.23Guide: cyclic voltammetry analysisP1MediumEnd-to-end polar chart workflow
3.24Guide: publication-ready exportP1LowTheme + LaTeX + PluginSnapshot 8K workflow
3.25Example: forecasting with confidence bandsP1LowInteractive demo

Scientific + trading convergence points

Scientific featureTrading use
Pattern recognitionChart pattern alerts
ForecastingPrice projection overlay
Anomaly detectionUnusual volume/price alerts
FFT / filtersNoise reduction on indicators
RegressionTrend line fitting (complements drawing tools)

Risks

RiskMitigation
ARIMA implementation complexityStart with AR(1) and MA(1); expand iteratively
LaTeX scope unboundedTarget 300 commands covering 95% of scientific notation
Python/WASM may not existHonest reclassification beats false "complete" status
3D + trading bundle bloatKeep 3D in velo-plot/full and velo-plot/scientific only

Exit checklist (v2.2.0)

  • [x] PluginForecasting: zero throwing public methods
  • [x] ARIMA forecast with confidence bands shipped
  • [x] Custom pattern API or explicitly removed
  • [x] LaTeX vocabulary ≥300 commands documented
  • [x] Ternary + contour limitations addressed or documented
  • [x] ML plugin audit published
  • [x] Python/WASM status honestly documented (complete, experimental, or removed)
  • [x] 3 new scientific workflow guides in docs
  • [x] Vitest coverage: added forecasting, pattern, LaTeX, contour, broken-axis and ML tests

Audit results (v2.2.0)

Forecasting (3.1)

All eight methods (sma, wma, ema, expSmoothing, holt, holtWinters, linear, arima) are implemented and return confidence bands from in-sample residuals. arima uses a two-stage Hannan-Rissanen fit and integrates the forecast back after differencing; it falls back to Holt for short histories. No public method throws for a supported method.

ML plugin (3.16)

Native models: linear-regression (OLS via general N×N Gauss-Jordan inverse, now trainable with residual diagnostics), neural-network (inference only — no native backprop), signal-processor (first-order EMA-based filters). External frameworks bridge via registerModel. Published in ML Integration API.

Python bindings (3.19)

python/velo_plot is a configuration builder that emits velo-plot-compatible JSON (PythonChart.to_json() / .save()). It is not a live Jupyter widget and does not render. Reclassified from "complete" to experimental config generator.

WASM bridge (3.20)

No WebAssembly or SharedArrayBuffer usage exists in src/. The legacy "complete" claim was inaccurate; removed. Revisit as a future performance track if a concrete need arises.

Video recorder (3.21)

PluginVideoRecorder composites the WebGL + overlay canvases and records via MediaRecorder.captureStream. webm (VP9) works in Chromium and Firefox; mp4/h264 depends on browser codec support and falls back to webm.

Broken axis (3.15) & Polar grid (3.14)

BrokenAxisScale exists and is verified (unit tests cover transform, monotonicity, gap compression, invert round-trip, ticks). Polar grid rendering from the legacy "Phase 2" item is confirmed present in the polar renderer.

Released under the MIT License.