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.
- package/README.md +14 -0
- package/dist/{index.core-xiNcuFfJ.js → ChartCore-DQ691eXH.js} +1807 -1287
- package/dist/ChartCore-DQ691eXH.js.map +1 -0
- package/dist/assets/downsample.worker-C70QJ04y.js +2 -0
- package/dist/assets/downsample.worker-C70QJ04y.js.map +1 -0
- package/dist/assets/indicator.worker-bv0zC4EX.js +2 -0
- package/dist/assets/indicator.worker-bv0zC4EX.js.map +1 -0
- package/dist/core/OverlayRenderer.d.ts +2 -0
- package/dist/core/chart/ChartAlerts.d.ts +42 -0
- package/dist/core/chart/ChartCore.d.ts +20 -1
- package/dist/core/chart/ChartRenderLoop.d.ts +4 -2
- package/dist/core/chart/ChartRenderer.d.ts +3 -2
- package/dist/core/chart/candlestickMarkers.d.ts +23 -0
- package/dist/core/chart/exporter/SVGExporter.d.ts +7 -2
- package/dist/core/chart/heikinAshi.d.ts +10 -0
- package/dist/core/chart/series/types.d.ts +2 -2
- package/dist/core/chart/types.d.ts +9 -0
- package/dist/core/indicator/addIndicator.d.ts +36 -0
- package/dist/core/indicator/index.d.ts +2 -0
- package/dist/core/indicator/indicatorPresets.d.ts +37 -0
- package/dist/core/render/pixelSnap.d.ts +8 -0
- package/dist/core/series/Series.d.ts +3 -0
- package/dist/core/stacked/index.d.ts +3 -1
- package/dist/core/stacked/paneResize.d.ts +15 -18
- package/dist/core/stacked/stackExport.d.ts +18 -0
- package/dist/core/stacked/types.d.ts +42 -5
- package/dist/core/time/TimeScale.d.ts +31 -0
- package/dist/createStackedChart-BPooTQ9z.js +1164 -0
- package/dist/createStackedChart-BPooTQ9z.js.map +1 -0
- package/dist/gpu/adapter/gpuRenderer.d.ts +21 -0
- package/dist/gpu/backends/webgpu/WebGPUBackend.d.ts +2 -1
- package/dist/gpuRenderer-BpaMYz-k.js +1848 -0
- package/dist/gpuRenderer-BpaMYz-k.js.map +1 -0
- package/dist/index-CUGS98p4.js +277 -0
- package/dist/index-CUGS98p4.js.map +1 -0
- package/dist/index-D7dTq6VB.js +503 -0
- package/dist/index-D7dTq6VB.js.map +1 -0
- package/dist/{index-Ce2JgkH_.js → index-DoYxf1cV.js} +86 -43
- package/dist/{index-Ce2JgkH_.js.map → index-DoYxf1cV.js.map} +1 -1
- package/dist/index.core-BtGFYMOu.js +167 -0
- package/dist/index.core-BtGFYMOu.js.map +1 -0
- package/dist/index.d.ts +12 -4
- package/dist/indicators--eJGmVox.js +302 -0
- package/dist/indicators--eJGmVox.js.map +1 -0
- package/dist/math-Ddm2EZjj.js +85 -0
- package/dist/math-Ddm2EZjj.js.map +1 -0
- package/dist/plugins/analysis.js +543 -818
- package/dist/plugins/analysis.js.map +1 -1
- package/dist/plugins/anomaly-detection.d.ts +1 -0
- package/dist/plugins/anomaly-detection.js +221 -0
- package/dist/plugins/anomaly-detection.js.map +1 -0
- package/dist/plugins/broken-axis.d.ts +3 -0
- package/dist/plugins/broken-axis.js +262 -0
- package/dist/plugins/broken-axis.js.map +1 -0
- package/dist/plugins/caching.d.ts +3 -0
- package/dist/plugins/caching.js +187 -0
- package/dist/plugins/caching.js.map +1 -0
- package/dist/plugins/data-transform.d.ts +3 -0
- package/dist/plugins/data-transform.js +146 -0
- package/dist/plugins/data-transform.js.map +1 -0
- package/dist/plugins/debug.js +12 -11
- package/dist/plugins/debug.js.map +1 -1
- package/dist/plugins/drawing-tools/index.d.ts +16 -0
- package/dist/plugins/forecasting.d.ts +1 -0
- package/dist/plugins/forecasting.js +236 -0
- package/dist/plugins/forecasting.js.map +1 -0
- package/dist/plugins/gpu.js +202 -1895
- package/dist/plugins/gpu.js.map +1 -1
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/keyboard/index.d.ts +1 -7
- package/dist/plugins/keyboard.js +1 -1
- package/dist/plugins/latex.d.ts +1 -0
- package/dist/plugins/latex.js +454 -0
- package/dist/plugins/latex.js.map +1 -0
- package/dist/plugins/lazy-load/types.d.ts +7 -0
- package/dist/plugins/lazy-load.d.ts +3 -0
- package/dist/plugins/lazy-load.js +212 -0
- package/dist/plugins/lazy-load.js.map +1 -0
- package/dist/plugins/ml-integration.d.ts +3 -0
- package/dist/plugins/ml-integration.js +355 -0
- package/dist/plugins/ml-integration.js.map +1 -0
- package/dist/plugins/offscreen.d.ts +3 -0
- package/dist/plugins/offscreen.js +169 -0
- package/dist/plugins/offscreen.js.map +1 -0
- package/dist/plugins/pattern-recognition.d.ts +3 -0
- package/dist/plugins/pattern-recognition.js +690 -0
- package/dist/plugins/pattern-recognition.js.map +1 -0
- package/dist/plugins/radar.d.ts +3 -0
- package/dist/plugins/radar.js +103 -0
- package/dist/plugins/radar.js.map +1 -0
- package/dist/plugins/regression.d.ts +3 -0
- package/dist/plugins/regression.js +634 -0
- package/dist/plugins/regression.js.map +1 -0
- package/dist/plugins/replay/index.d.ts +19 -0
- package/dist/plugins/roi.d.ts +1 -0
- package/dist/plugins/roi.js +223 -0
- package/dist/plugins/roi.js.map +1 -0
- package/dist/plugins/snapshot/types.d.ts +1 -1
- package/dist/plugins/snapshot.d.ts +3 -0
- package/dist/plugins/snapshot.js +90 -0
- package/dist/plugins/snapshot.js.map +1 -0
- package/dist/plugins/sync/index.d.ts +2 -1
- package/dist/plugins/sync.js +13 -269
- package/dist/plugins/sync.js.map +1 -1
- package/dist/plugins/video-recorder.d.ts +3 -0
- package/dist/plugins/video-recorder.js +104 -0
- package/dist/plugins/video-recorder.js.map +1 -0
- package/dist/plugins/virtualization/types.d.ts +12 -0
- package/dist/plugins/virtualization.d.ts +3 -0
- package/dist/plugins/virtualization.js +6 -0
- package/dist/plugins/virtualization.js.map +1 -0
- package/dist/pool-15HMCNv8.js +88 -0
- package/dist/pool-15HMCNv8.js.map +1 -0
- package/dist/react.d.ts +1 -0
- package/dist/react.js +31 -0
- package/dist/react.js.map +1 -0
- package/dist/renderer/CandlestickRenderer.d.ts +1 -1
- package/dist/renderer/ChartSeriesRenderer.d.ts +6 -0
- package/dist/renderer/GpuChartRenderer.d.ts +23 -0
- package/dist/renderer/index.d.ts +3 -0
- package/dist/renderer/spike/WebGLGridSpike.d.ts +40 -0
- package/dist/testing/baselines/v1.15.0.json.d.ts +51 -0
- package/dist/testing/gridSpikeBenchmark.d.ts +49 -0
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/rendererBenchmark.d.ts +13 -0
- package/dist/testing/stage1BrowserBench.d.ts +42 -0
- package/dist/types.d.ts +21 -1
- package/dist/utils-BK5UUXxj.js +172 -0
- package/dist/utils-BK5UUXxj.js.map +1 -0
- package/dist/velo-plot.full.js +1382 -5932
- package/dist/velo-plot.full.js.map +1 -1
- package/dist/velo-plot.js +26 -25
- package/dist/velo-plot.js.map +1 -1
- package/dist/workers/downsample.d.ts +38 -0
- package/dist/workers/downsampleAsync.d.ts +6 -0
- package/dist/workers/indicator.worker.d.ts +32 -0
- package/dist/workers/indicatorsAsync.d.ts +26 -0
- package/dist/workers/pool.d.ts +36 -0
- package/package.json +19 -2
- package/dist/core/OverlayRenderer.test.d.ts +0 -1
- package/dist/core/chart/ChartScaling.test.d.ts +0 -1
- package/dist/core/chart/NavigationUtils.test.d.ts +0 -1
- package/dist/core/format/axisFormat.test.d.ts +0 -1
- package/dist/core/indicator/buildIndicatorSeries.test.d.ts +0 -1
- package/dist/core/series/SeriesBounds.test.d.ts +0 -1
- package/dist/core/stacked/createStackedChart.test.d.ts +0 -1
- package/dist/core/stacked/paneAxis.test.d.ts +0 -1
- package/dist/core/stacked/paneResize.test.d.ts +0 -1
- package/dist/core/sync/index.test.d.ts +0 -1
- package/dist/index.core-xiNcuFfJ.js.map +0 -1
- package/dist/plugins/tools/tooltip/format.test.d.ts +0 -1
- package/dist/utils-Dbro9-qM.js +0 -254
- 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
|
|
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
|
|
30
|
+
/** 1–5 stacked panes */
|
|
26
31
|
panes: StackedPaneConfig[];
|
|
27
|
-
/**
|
|
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;
|