velo-plot 1.12.0 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/README.md +14 -0
  2. package/dist/{index.core-xiNcuFfJ.js → ChartCore-DQ691eXH.js} +1807 -1287
  3. package/dist/ChartCore-DQ691eXH.js.map +1 -0
  4. package/dist/assets/downsample.worker-C70QJ04y.js +2 -0
  5. package/dist/assets/downsample.worker-C70QJ04y.js.map +1 -0
  6. package/dist/assets/indicator.worker-bv0zC4EX.js +2 -0
  7. package/dist/assets/indicator.worker-bv0zC4EX.js.map +1 -0
  8. package/dist/core/OverlayRenderer.d.ts +2 -0
  9. package/dist/core/chart/ChartAlerts.d.ts +42 -0
  10. package/dist/core/chart/ChartCore.d.ts +20 -1
  11. package/dist/core/chart/ChartRenderLoop.d.ts +4 -2
  12. package/dist/core/chart/ChartRenderer.d.ts +3 -2
  13. package/dist/core/chart/candlestickMarkers.d.ts +23 -0
  14. package/dist/core/chart/exporter/SVGExporter.d.ts +7 -2
  15. package/dist/core/chart/heikinAshi.d.ts +10 -0
  16. package/dist/core/chart/series/types.d.ts +2 -2
  17. package/dist/core/chart/types.d.ts +9 -0
  18. package/dist/core/indicator/addIndicator.d.ts +36 -0
  19. package/dist/core/indicator/index.d.ts +2 -0
  20. package/dist/core/indicator/indicatorPresets.d.ts +37 -0
  21. package/dist/core/render/pixelSnap.d.ts +8 -0
  22. package/dist/core/series/Series.d.ts +3 -0
  23. package/dist/core/stacked/index.d.ts +3 -1
  24. package/dist/core/stacked/paneResize.d.ts +15 -18
  25. package/dist/core/stacked/stackExport.d.ts +18 -0
  26. package/dist/core/stacked/types.d.ts +42 -5
  27. package/dist/core/time/TimeScale.d.ts +31 -0
  28. package/dist/createStackedChart-BPooTQ9z.js +1164 -0
  29. package/dist/createStackedChart-BPooTQ9z.js.map +1 -0
  30. package/dist/gpu/adapter/gpuRenderer.d.ts +21 -0
  31. package/dist/gpu/backends/webgpu/WebGPUBackend.d.ts +2 -1
  32. package/dist/gpuRenderer-BpaMYz-k.js +1848 -0
  33. package/dist/gpuRenderer-BpaMYz-k.js.map +1 -0
  34. package/dist/index-CUGS98p4.js +277 -0
  35. package/dist/index-CUGS98p4.js.map +1 -0
  36. package/dist/index-D7dTq6VB.js +503 -0
  37. package/dist/index-D7dTq6VB.js.map +1 -0
  38. package/dist/{index-Ce2JgkH_.js → index-DoYxf1cV.js} +86 -43
  39. package/dist/{index-Ce2JgkH_.js.map → index-DoYxf1cV.js.map} +1 -1
  40. package/dist/index.core-BtGFYMOu.js +167 -0
  41. package/dist/index.core-BtGFYMOu.js.map +1 -0
  42. package/dist/index.d.ts +12 -4
  43. package/dist/indicators--eJGmVox.js +302 -0
  44. package/dist/indicators--eJGmVox.js.map +1 -0
  45. package/dist/math-Ddm2EZjj.js +85 -0
  46. package/dist/math-Ddm2EZjj.js.map +1 -0
  47. package/dist/plugins/analysis.js +543 -818
  48. package/dist/plugins/analysis.js.map +1 -1
  49. package/dist/plugins/anomaly-detection.d.ts +1 -0
  50. package/dist/plugins/anomaly-detection.js +221 -0
  51. package/dist/plugins/anomaly-detection.js.map +1 -0
  52. package/dist/plugins/broken-axis.d.ts +3 -0
  53. package/dist/plugins/broken-axis.js +262 -0
  54. package/dist/plugins/broken-axis.js.map +1 -0
  55. package/dist/plugins/caching.d.ts +3 -0
  56. package/dist/plugins/caching.js +187 -0
  57. package/dist/plugins/caching.js.map +1 -0
  58. package/dist/plugins/data-transform.d.ts +3 -0
  59. package/dist/plugins/data-transform.js +146 -0
  60. package/dist/plugins/data-transform.js.map +1 -0
  61. package/dist/plugins/debug.js +12 -11
  62. package/dist/plugins/debug.js.map +1 -1
  63. package/dist/plugins/drawing-tools/index.d.ts +16 -0
  64. package/dist/plugins/forecasting.d.ts +1 -0
  65. package/dist/plugins/forecasting.js +236 -0
  66. package/dist/plugins/forecasting.js.map +1 -0
  67. package/dist/plugins/gpu.js +202 -1895
  68. package/dist/plugins/gpu.js.map +1 -1
  69. package/dist/plugins/index.d.ts +2 -0
  70. package/dist/plugins/keyboard/index.d.ts +1 -7
  71. package/dist/plugins/keyboard.js +1 -1
  72. package/dist/plugins/latex.d.ts +1 -0
  73. package/dist/plugins/latex.js +454 -0
  74. package/dist/plugins/latex.js.map +1 -0
  75. package/dist/plugins/lazy-load/types.d.ts +7 -0
  76. package/dist/plugins/lazy-load.d.ts +3 -0
  77. package/dist/plugins/lazy-load.js +212 -0
  78. package/dist/plugins/lazy-load.js.map +1 -0
  79. package/dist/plugins/ml-integration.d.ts +3 -0
  80. package/dist/plugins/ml-integration.js +355 -0
  81. package/dist/plugins/ml-integration.js.map +1 -0
  82. package/dist/plugins/offscreen.d.ts +3 -0
  83. package/dist/plugins/offscreen.js +169 -0
  84. package/dist/plugins/offscreen.js.map +1 -0
  85. package/dist/plugins/pattern-recognition.d.ts +3 -0
  86. package/dist/plugins/pattern-recognition.js +690 -0
  87. package/dist/plugins/pattern-recognition.js.map +1 -0
  88. package/dist/plugins/radar.d.ts +3 -0
  89. package/dist/plugins/radar.js +103 -0
  90. package/dist/plugins/radar.js.map +1 -0
  91. package/dist/plugins/regression.d.ts +3 -0
  92. package/dist/plugins/regression.js +634 -0
  93. package/dist/plugins/regression.js.map +1 -0
  94. package/dist/plugins/replay/index.d.ts +19 -0
  95. package/dist/plugins/roi.d.ts +1 -0
  96. package/dist/plugins/roi.js +223 -0
  97. package/dist/plugins/roi.js.map +1 -0
  98. package/dist/plugins/snapshot/types.d.ts +1 -1
  99. package/dist/plugins/snapshot.d.ts +3 -0
  100. package/dist/plugins/snapshot.js +90 -0
  101. package/dist/plugins/snapshot.js.map +1 -0
  102. package/dist/plugins/sync/index.d.ts +2 -1
  103. package/dist/plugins/sync.js +13 -269
  104. package/dist/plugins/sync.js.map +1 -1
  105. package/dist/plugins/video-recorder.d.ts +3 -0
  106. package/dist/plugins/video-recorder.js +104 -0
  107. package/dist/plugins/video-recorder.js.map +1 -0
  108. package/dist/plugins/virtualization/types.d.ts +12 -0
  109. package/dist/plugins/virtualization.d.ts +3 -0
  110. package/dist/plugins/virtualization.js +6 -0
  111. package/dist/plugins/virtualization.js.map +1 -0
  112. package/dist/pool-15HMCNv8.js +88 -0
  113. package/dist/pool-15HMCNv8.js.map +1 -0
  114. package/dist/react.d.ts +1 -0
  115. package/dist/react.js +31 -0
  116. package/dist/react.js.map +1 -0
  117. package/dist/renderer/CandlestickRenderer.d.ts +1 -1
  118. package/dist/renderer/ChartSeriesRenderer.d.ts +6 -0
  119. package/dist/renderer/GpuChartRenderer.d.ts +23 -0
  120. package/dist/renderer/index.d.ts +3 -0
  121. package/dist/renderer/spike/WebGLGridSpike.d.ts +40 -0
  122. package/dist/testing/baselines/v1.15.0.json.d.ts +51 -0
  123. package/dist/testing/gridSpikeBenchmark.d.ts +49 -0
  124. package/dist/testing/index.d.ts +5 -0
  125. package/dist/testing/rendererBenchmark.d.ts +13 -0
  126. package/dist/testing/stage1BrowserBench.d.ts +42 -0
  127. package/dist/types.d.ts +21 -1
  128. package/dist/utils-BK5UUXxj.js +172 -0
  129. package/dist/utils-BK5UUXxj.js.map +1 -0
  130. package/dist/velo-plot.full.js +1382 -5932
  131. package/dist/velo-plot.full.js.map +1 -1
  132. package/dist/velo-plot.js +26 -25
  133. package/dist/velo-plot.js.map +1 -1
  134. package/dist/workers/downsample.d.ts +38 -0
  135. package/dist/workers/downsampleAsync.d.ts +6 -0
  136. package/dist/workers/indicator.worker.d.ts +32 -0
  137. package/dist/workers/indicatorsAsync.d.ts +26 -0
  138. package/dist/workers/pool.d.ts +36 -0
  139. package/package.json +19 -2
  140. package/dist/core/OverlayRenderer.test.d.ts +0 -1
  141. package/dist/core/chart/ChartScaling.test.d.ts +0 -1
  142. package/dist/core/chart/NavigationUtils.test.d.ts +0 -1
  143. package/dist/core/format/axisFormat.test.d.ts +0 -1
  144. package/dist/core/indicator/buildIndicatorSeries.test.d.ts +0 -1
  145. package/dist/core/series/SeriesBounds.test.d.ts +0 -1
  146. package/dist/core/stacked/createStackedChart.test.d.ts +0 -1
  147. package/dist/core/stacked/paneAxis.test.d.ts +0 -1
  148. package/dist/core/stacked/paneResize.test.d.ts +0 -1
  149. package/dist/core/sync/index.test.d.ts +0 -1
  150. package/dist/index.core-xiNcuFfJ.js.map +0 -1
  151. package/dist/plugins/tools/tooltip/format.test.d.ts +0 -1
  152. package/dist/utils-Dbro9-qM.js +0 -254
  153. package/dist/utils-Dbro9-qM.js.map +0 -1
@@ -2,18 +2,23 @@ import { Chart } from '../chart/types';
2
2
  import { ChartGroup, SyncAxis, SyncOptions } from '../sync';
3
3
  import { ChartOptions as RootChartOptions, Range, SeriesOptions } from '../../types';
4
4
  import { LayoutOptions } from '../layout';
5
+ import { AddIndicatorResult } from '../indicator/addIndicator';
5
6
 
7
+ /** Stack layout direction */
8
+ export type StackDirection = "vertical" | "horizontal";
6
9
  /** Per-pane configuration (max 5 panes per stack) */
7
10
  export interface StackedPaneConfig {
8
11
  id: string;
9
- /** Flex ratio (e.g. 0.6) or CSS length ("24%", "80px") */
12
+ /** Flex ratio (e.g. 0.6) or CSS length ("24%", "80px") — height ratio when vertical, width ratio when horizontal */
10
13
  height: number | string;
11
14
  /** Chart options excluding container/id (series added via chart API or `series`) */
12
15
  chart?: Omit<RootChartOptions, "container" | "id">;
13
16
  /** Series to add immediately after pane chart is created */
14
17
  series?: SeriesOptions[];
15
- /** Show native X axis (default: only bottom pane when sharedXAxis is bottom) */
18
+ /** Show native X axis (default: only bottom pane when vertical + sharedXAxis; each pane when horizontal) */
16
19
  showXAxis?: boolean;
20
+ /** Show native Y axis (default: only first pane when horizontal + sharedYAxis) */
21
+ showYAxis?: boolean;
17
22
  /** Receive pan/zoom (default: true on every pane) */
18
23
  interactive?: boolean;
19
24
  /** Lock Y range — skips auto fit on Y for this pane */
@@ -22,12 +27,16 @@ export interface StackedPaneConfig {
22
27
  export interface StackedChartOptions {
23
28
  /** Root container (will be cleared and filled with pane layout) */
24
29
  container: HTMLDivElement;
25
- /** 1–5 stacked panes, top to bottom */
30
+ /** 1–5 stacked panes */
26
31
  panes: StackedPaneConfig[];
27
- /** Pane that drives X sync (default: first pane) */
32
+ /** Layout direction (default: vertical — panes top to bottom) */
33
+ direction?: StackDirection;
34
+ /** Pane that drives sync (default: first pane) */
28
35
  masterPaneId?: string;
29
- /** Shared date/time row on bottom pane only */
36
+ /** Shared date/time row on bottom pane only (vertical layout) */
30
37
  sharedXAxis?: "bottom" | "none";
38
+ /** Shared Y axis on left pane only (horizontal layout) */
39
+ sharedYAxis?: "left" | "none";
31
40
  /** Shared theme applied to every pane */
32
41
  theme?: string | object;
33
42
  devicePixelRatio?: number;
@@ -75,6 +84,17 @@ export interface StackedChart {
75
84
  setSyncOptions(options: Partial<StackedSyncOptions>): void;
76
85
  /** Resolves when all pane charts have started rendering */
77
86
  whenReady(): Promise<void>;
87
+ /** Append a pane at runtime (max 5 panes) */
88
+ addPane(pane: StackedPaneConfig): Chart;
89
+ /** Calculate + mount indicator pane or overlay on master price chart */
90
+ addIndicator(preset: import('../indicator/addIndicator').IndicatorPresetName, options?: import('../indicator/addIndicator').AddIndicatorOptions): Promise<AddIndicatorResult & {
91
+ paneId?: string;
92
+ chart?: Chart;
93
+ }>;
94
+ /** Export the entire stack as one PNG/JPEG/WebP image (WYSIWYG layout) */
95
+ exportImage(options?: StackSnapshotOptions): Promise<string>;
96
+ /** Alias for exportImage */
97
+ snapshot(options?: StackSnapshotOptions): Promise<string>;
78
98
  destroy(): void;
79
99
  }
80
100
  export declare const STACKED_MAX_PANES = 5;
@@ -83,9 +103,26 @@ export declare const STACKED_DEFAULT_MIN_PANE_RATIO: number;
83
103
  export declare const STACKED_COMPACT_MARGIN: {
84
104
  top: number;
85
105
  bottom: number;
106
+ left: number;
86
107
  };
87
108
  export declare const STACKED_FULL_X_MARGIN: {
88
109
  bottom: number;
89
110
  };
111
+ export declare const STACKED_FULL_Y_MARGIN: {
112
+ left: number;
113
+ };
114
+ /** Options for full-stack image export */
115
+ export type StackSnapshotFormat = "png" | "jpeg" | "webp";
116
+ export type StackSnapshotResolution = "standard" | "2k" | "4k" | "8k" | number;
117
+ export interface StackSnapshotOptions {
118
+ format?: StackSnapshotFormat;
119
+ quality?: number;
120
+ resolution?: StackSnapshotResolution;
121
+ includeBackground?: boolean;
122
+ includeDividers?: boolean;
123
+ transparent?: boolean;
124
+ download?: boolean;
125
+ fileName?: string;
126
+ }
90
127
  /** Pan/zoom sync between stacked panes (Y stays independent when axis is `x`). */
91
128
  export type StackedSyncOptions = Pick<SyncOptions, "axis" | "syncCursor" | "syncSelection" | "syncZoom" | "syncPan" | "bidirectional" | "debounce">;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * TimeScale — business-day / session-aware X mapping for trading charts.
3
+ * Stage 2.1–2.3
4
+ */
5
+ export type TimeScaleCalendar = "continuous" | "business-day";
6
+ export type MarketSession = "24x7" | "NYSE";
7
+ export interface TimeScaleOptions {
8
+ calendar?: TimeScaleCalendar;
9
+ session?: MarketSession;
10
+ /** IANA timezone (reserved for future session-hour filtering) */
11
+ timezone?: string;
12
+ }
13
+ export interface BusinessDayMapping {
14
+ /** X values for chart (consecutive indices on business days) */
15
+ scaledX: Float32Array;
16
+ /** Original timestamp per scaled index (for tooltips / ticks) */
17
+ timeByIndex: Float32Array;
18
+ /** Original index → scaled index (-1 if skipped) */
19
+ sourceToScaled: Int32Array;
20
+ }
21
+ /** Weekend check (NYSE calendar MVP — UTC weekends). */
22
+ export declare function isBusinessDay(ts: number, _opts?: TimeScaleOptions): boolean;
23
+ /**
24
+ * Map timestamp series to consecutive business-day indices (skips Sat/Sun bars).
25
+ * NaN in scaledX marks non-business bars (hidden gap).
26
+ */
27
+ export declare function mapToBusinessDayScale(times: Float32Array | Float64Array, opts?: TimeScaleOptions): BusinessDayMapping;
28
+ /** Resolve timestamp at a scaled business-day index (for axis ticks). */
29
+ export declare function timeAtBusinessIndex(mapping: BusinessDayMapping, index: number): number | undefined;
30
+ /** Visible span in ms using business-day mapping. */
31
+ export declare function businessDaySpanMs(mapping: BusinessDayMapping, xMin: number, xMax: number): number;