How pactolis/pactolis-chart-engine works
Pactolis Chart Engine is a framework-independent canvas charting library: a host supplies market data, settings, locale and callbacks; chart components turn that input into footprint/candlestick views with indicators, heatmaps and drawing tools. The principal workflow is host-provided history and trades, aggregation and repair into chart series, then view/rendering. Analysis, replay, indicators and user interaction are distinct capabilities. Relationships below follow README statements and indexed imports/calls; unsampled subsystems are represented without asserting undocumented wiring.
Main entry points: footprint.ts Footprint Series · view.ts Chart View Model · ChartDataPipeline.ts Data Pipeline · chartDataSource.ts Data Source Port
Components 21
Chart Data
- Chart Runtime
src/features/chart/ChartRuntime.ts - History Controller
src/features/chart/ChartHistoryController.ts - Data Pipeline
src/features/chart/ChartDataPipeline.ts - Data Source Port
src/features/chart/chartDataSource.ts - Live Trade Repair
src/features/chart/LiveTradeRepairController.ts
Market Analysis
- Footprint Series
src/core/model/footprint.ts - Market Analysis
src/core/analysis - Analysis Context
src/core/analysisContext.ts
Chart Visualization
- Chart View Model
src/core/engine/view.ts - Canvas Renderer
src/core/render/overlay.ts - Chart Scene
src/core/render/scene/chartScene.ts - GPU Rendering
src/core/gpu/gpuBackend.ts
Chart Features
- Indicator Manager
src/features/indicators/IndicatorManager.ts - Built-in Indicators
src/features/indicators/builtins - Orderbook Heatmap
src/features/orderbook/heatmapModel.ts - Drawing Tools
src/features/drawings/drawingManager.ts - Replay Controller
src/features/replay/replayController.ts - Viewport Controller
src/features/controllers/timeScaleViewportController.ts - Performance Telemetry
src/core/performanceTelemetry.ts
Other components
- Host Application
- Market Data Services
Connections 24
- Host Application → Data Source Port: configures data
README.md - Host Application → Chart Runtime: mounts charts
README.md - Host Application → Market Data Services: supplies data
README.md - History Controller → Data Pipeline: uses pipeline
src/features/chart/ChartHistoryController.ts - History Controller → Data Source Port: reads history
src/features/chart/ChartHistoryController.ts - Data Pipeline → Data Source Port: fetches history
src/features/chart/ChartDataPipeline.ts - Live Trade Repair → Data Source Port: fetches repairs
src/features/chart/LiveTradeRepairController.ts - Data Pipeline → Footprint Series: updates series
src/features/chart/ChartDataPipeline.ts - Footprint Series → Market Analysis: provides bars
src/core/model/footprint.ts - Analysis Context → Market Analysis: types analysis
src/core/analysisContext.ts - Chart View Model → Footprint Series: maps chart data
- Canvas Renderer → Chart View Model: renders view
src/core/render/overlay.ts - Canvas Renderer → Footprint Series: renders bars
src/core/render/overlay.ts - Chart Scene → Canvas Renderer: composes rendering
- Indicator Manager → Chart View Model: uses view
src/features/indicators/IndicatorManager.ts - Indicator Manager → Built-in Indicators: loads registry
src/features/indicators/IndicatorManager.ts - Orderbook Heatmap → GPU Rendering: renders heatmap
- Drawing Tools → Chart View Model: draws objects
src/features/drawings/drawingManager.ts - Drawing Tools → Market Analysis: draws analysis
src/features/drawings/drawingManager.ts - Replay Controller → Footprint Series: controls replay data
- Viewport Controller → Chart View Model: adjusts viewport
src/features/controllers/timeScaleViewportController.ts - Chart Runtime → History Controller: coordinates history
- Chart Runtime → Chart Scene: coordinates rendering
- Performance Telemetry → Data Pipeline: measures work
src/features/chart/ChartDataPipeline.ts