velo-plot 1.15.0 → 2.0.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/dist/{ChartCore-BimVvUEg.js → ChartCore-BhQ4j7f5.js} +2213 -1489
- package/dist/ChartCore-BhQ4j7f5.js.map +1 -0
- package/dist/SciPlot-GJvw7GJo.js +463 -0
- package/dist/SciPlot-GJvw7GJo.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/axisFormat-SPX-CD5s.js +200 -0
- package/dist/axisFormat-SPX-CD5s.js.map +1 -0
- package/dist/core/InteractionManager.d.ts +1 -0
- package/dist/core/OverlayRenderer.d.ts +13 -0
- package/dist/core/chart/ChartAlerts.d.ts +42 -0
- package/dist/core/chart/ChartCore.d.ts +24 -1
- package/dist/core/chart/ChartRenderLoop.d.ts +9 -2
- package/dist/core/chart/ChartRenderer.d.ts +8 -2
- package/dist/core/chart/candlestickMarkers.d.ts +23 -0
- package/dist/core/chart/heikinAshi.d.ts +10 -0
- package/dist/core/chart/positionLines.d.ts +12 -0
- package/dist/core/chart/series/types.d.ts +2 -2
- package/dist/core/chart/types.d.ts +9 -0
- package/dist/core/format/axisFormat.d.ts +2 -1
- 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 +45 -0
- package/dist/core/series/Series.d.ts +3 -0
- package/dist/core/stacked/types.d.ts +8 -0
- package/dist/core/time/TimeScale.d.ts +31 -0
- package/dist/core/time/applyTimeScale.d.ts +10 -0
- package/dist/createStackedChart-DJSmqerD.js +706 -0
- package/dist/createStackedChart-DJSmqerD.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-DjeWClO9.js → index-CWipqOLP.js} +2 -2
- package/dist/{index-DjeWClO9.js.map → index-CWipqOLP.js.map} +1 -1
- 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-C_-CFftD.js → index.core-fpZ1dYN0.js} +3 -3
- package/dist/{index.core-C_-CFftD.js.map → index.core-fpZ1dYN0.js.map} +1 -1
- package/dist/index.d.ts +17 -4
- package/dist/indicators--eJGmVox.js +302 -0
- package/dist/indicators--eJGmVox.js.map +1 -0
- package/dist/mockDatafeed-Cdg5hKEo.js +511 -0
- package/dist/mockDatafeed-Cdg5hKEo.js.map +1 -0
- package/dist/plugins/analysis.js +530 -807
- package/dist/plugins/analysis.js.map +1 -1
- package/dist/plugins/caching.js +26 -21
- package/dist/plugins/caching.js.map +1 -1
- package/dist/plugins/drawing-tools/index.d.ts +29 -0
- package/dist/plugins/drawing-tools/measure.d.ts +21 -0
- package/dist/plugins/drawing-tools/snapToCandle.d.ts +21 -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/lazy-load/types.d.ts +7 -0
- package/dist/plugins/lazy-load.js +131 -108
- package/dist/plugins/lazy-load.js.map +1 -1
- package/dist/plugins/replay/index.d.ts +19 -0
- package/dist/plugins/tools.js +1 -1
- package/dist/plugins/virtualization/types.d.ts +12 -0
- package/dist/plugins/virtualization.js +1 -1
- package/dist/pool-15HMCNv8.js +88 -0
- package/dist/pool-15HMCNv8.js.map +1 -0
- package/dist/react.js +5 -5
- 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/trading/datafeed.d.ts +48 -0
- package/dist/trading/index.d.ts +29 -0
- package/dist/trading/mockDatafeed.d.ts +9 -0
- package/dist/trading/ohlcvGenerator.d.ts +25 -0
- package/dist/trading.d.ts +1 -0
- package/dist/trading.js +95 -0
- package/dist/trading.js.map +1 -0
- package/dist/types.d.ts +22 -2
- package/dist/velo-plot.full.js +1088 -776
- package/dist/velo-plot.full.js.map +1 -1
- package/dist/velo-plot.js +15 -15
- 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 +23 -1
- package/dist/ChartCore-BimVvUEg.js.map +0 -1
- package/dist/axisFormat-B7o_uIEA.js +0 -127
- package/dist/axisFormat-B7o_uIEA.js.map +0 -1
- package/dist/createStackedChart-CjsKcOvX.js +0 -1088
- package/dist/createStackedChart-CjsKcOvX.js.map +0 -1
- package/dist/index-ChgIdk3N.js +0 -229
- package/dist/index-ChgIdk3N.js.map +0 -1
package/dist/react.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { S as x, u as C } from "./SciPlot-GJvw7GJo.js";
|
|
2
|
+
import { useRef as n, useState as a, useEffect as k, useCallback as f } from "react";
|
|
3
|
+
import { c as m } from "./createStackedChart-DJSmqerD.js";
|
|
4
4
|
function A(c) {
|
|
5
5
|
const s = n(null), r = n(null), [i, l] = a(null), [d, u] = a(!1), o = n(c);
|
|
6
|
-
o.current = c,
|
|
6
|
+
o.current = c, k(() => {
|
|
7
7
|
const t = s.current;
|
|
8
8
|
if (!t) return;
|
|
9
|
-
const e =
|
|
9
|
+
const e = m({
|
|
10
10
|
...o.current,
|
|
11
11
|
container: t
|
|
12
12
|
});
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Each candle is represented by a body (box) and a wick (line/thin box)
|
|
7
7
|
* Returns a Float32Array of interleaved [x, y] coordinates for TRIANGLES
|
|
8
8
|
*/
|
|
9
|
-
export declare function interleaveCandlestickData(x: Float32Array | Float64Array, open: Float32Array | Float64Array, high: Float32Array | Float64Array, low: Float32Array | Float64Array, close: Float32Array | Float64Array, width: number): {
|
|
9
|
+
export declare function interleaveCandlestickData(x: Float32Array | Float64Array, open: Float32Array | Float64Array, high: Float32Array | Float64Array, low: Float32Array | Float64Array, close: Float32Array | Float64Array, width: number, hollow?: boolean): {
|
|
10
10
|
bullish: Float32Array;
|
|
11
11
|
bearish: Float32Array;
|
|
12
12
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NativeWebGLRenderer } from './NativeWebGLRenderer';
|
|
2
|
+
import { GpuChartRenderer } from './GpuChartRenderer';
|
|
3
|
+
|
|
4
|
+
export type ChartSeriesRenderer = NativeWebGLRenderer | GpuChartRenderer;
|
|
5
|
+
export type ChartRendererBackend = "webgl" | "webgpu";
|
|
6
|
+
export declare function getRendererBackend(renderer: ChartSeriesRenderer): ChartRendererBackend;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { GpuRenderer, GpuRendererOptions } from '../gpu/adapter/gpuRenderer';
|
|
2
|
+
import { NativeRenderOptions, NativeSeriesRenderData } from './native/types';
|
|
3
|
+
|
|
4
|
+
export declare class GpuChartRenderer {
|
|
5
|
+
private gpu;
|
|
6
|
+
private dpr;
|
|
7
|
+
private readonly canvas;
|
|
8
|
+
constructor(gpu: GpuRenderer, canvas: HTMLCanvasElement);
|
|
9
|
+
get available(): boolean;
|
|
10
|
+
get backend(): "webgpu" | "webgl";
|
|
11
|
+
setDPR(dpr: number): void;
|
|
12
|
+
createBuffer(id: string, data: Float32Array): void;
|
|
13
|
+
updateBuffer(id: string, data: Float32Array, offsetInBytes: number): boolean;
|
|
14
|
+
getBuffer(id: string): WebGLBuffer | undefined;
|
|
15
|
+
deleteBuffer(id: string): void;
|
|
16
|
+
createColormapTexture(id: string, data: Uint8Array): void;
|
|
17
|
+
getTexture(id: string): WebGLTexture | undefined;
|
|
18
|
+
render(series: NativeSeriesRenderData[], options: NativeRenderOptions): void;
|
|
19
|
+
resize(): void;
|
|
20
|
+
getLimits(): Record<string, unknown>;
|
|
21
|
+
destroy(): void;
|
|
22
|
+
}
|
|
23
|
+
export declare function createGpuChartRenderer(canvas: HTMLCanvasElement, options?: GpuRendererOptions): Promise<GpuChartRenderer | null>;
|
package/dist/renderer/index.d.ts
CHANGED
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export { NativeWebGLRenderer, interleaveData, interleaveStepData, interleaveBandData, interleaveErrorData, interleaveBoxPlotData, interleaveWaterfallData, parseColor, type NativeSeriesRenderData, type NativeRenderOptions, } from './NativeWebGLRenderer';
|
|
5
5
|
export { type IWebGLRenderer, type SeriesRenderData, type RenderOptions, createRenderer, createNativeRenderer, } from './RendererInterface';
|
|
6
|
+
export { GpuChartRenderer, createGpuChartRenderer } from './GpuChartRenderer';
|
|
6
7
|
export { WebGPURenderer, type WebGPURendererOptions } from './WebGPURenderer';
|
|
8
|
+
export type { ChartSeriesRenderer, ChartRendererBackend } from './ChartSeriesRenderer';
|
|
9
|
+
export { getRendererBackend } from './ChartSeriesRenderer';
|
|
7
10
|
export * from './shaders';
|
|
8
11
|
export * from './radar';
|
|
9
12
|
export { interleaveBarData, calculateBarWidth } from './BarRenderer';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WebGL grid spike — batched GL_LINES renderer for axis grid lines.
|
|
3
|
+
* Labels remain on Canvas 2D; this spike covers grid lines only.
|
|
4
|
+
* @module renderer/spike/WebGLGridSpike
|
|
5
|
+
*/
|
|
6
|
+
export interface GridLineSpec {
|
|
7
|
+
/** Plot area in CSS pixels */
|
|
8
|
+
plotArea: {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
};
|
|
14
|
+
/** Pixel X positions for vertical grid lines */
|
|
15
|
+
xLines: number[];
|
|
16
|
+
/** Pixel Y positions for horizontal grid lines */
|
|
17
|
+
yLines: number[];
|
|
18
|
+
/** Canvas width (physical pixels) */
|
|
19
|
+
width: number;
|
|
20
|
+
/** Canvas height (physical pixels) */
|
|
21
|
+
height: number;
|
|
22
|
+
/** Line color RGBA 0–1 */
|
|
23
|
+
color?: [number, number, number, number];
|
|
24
|
+
/** Line width in pixels */
|
|
25
|
+
lineWidth?: number;
|
|
26
|
+
}
|
|
27
|
+
/** Build interleaved [x,y] vertex pairs for GL_LINES from tick pixel positions */
|
|
28
|
+
export declare function buildGridLineVertices(spec: GridLineSpec): Float32Array;
|
|
29
|
+
export declare class WebGLGridSpike {
|
|
30
|
+
private gl;
|
|
31
|
+
private program;
|
|
32
|
+
private buffer;
|
|
33
|
+
private aPosition;
|
|
34
|
+
private uResolution;
|
|
35
|
+
private uColor;
|
|
36
|
+
constructor(canvas: HTMLCanvasElement);
|
|
37
|
+
/** Upload vertices and draw grid lines */
|
|
38
|
+
draw(spec: GridLineSpec): number;
|
|
39
|
+
destroy(): void;
|
|
40
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"version": "1.17.0",
|
|
3
|
+
"recordedAt": "2026-07-05",
|
|
4
|
+
"notes": "Stage 1 baselines. Headless CI uses effective FPS (render throughput when rAF throttled) via scripts/benchmark-scenario-eval.mjs smoke floors.",
|
|
5
|
+
"regressionThreshold": 0.10,
|
|
6
|
+
"webgpuMinFpsRatio": 0.95,
|
|
7
|
+
"scenarios": {
|
|
8
|
+
"line-1m-pan": {
|
|
9
|
+
"minAvgFps": 50,
|
|
10
|
+
"maxAvgFrameTimeMs": 20,
|
|
11
|
+
"points": 1000000,
|
|
12
|
+
"description": "1M line points, continuous pan/zoom simulation"
|
|
13
|
+
},
|
|
14
|
+
"candlestick-500k": {
|
|
15
|
+
"minAvgFps": 45,
|
|
16
|
+
"maxAvgFrameTimeMs": 22,
|
|
17
|
+
"points": 500000,
|
|
18
|
+
"description": "500k OHLC bars with PluginVirtualization"
|
|
19
|
+
},
|
|
20
|
+
"stack-5pane-resize": {
|
|
21
|
+
"minAvgFps": 48,
|
|
22
|
+
"maxAvgFrameTimeMs": 21,
|
|
23
|
+
"description": "5-pane stack divider drag (batched overlay redraw)"
|
|
24
|
+
},
|
|
25
|
+
"line-200k-webgl": {
|
|
26
|
+
"minAvgFps": 45,
|
|
27
|
+
"description": "200k line WebGL baseline for renderer compare"
|
|
28
|
+
},
|
|
29
|
+
"line-200k-webgpu": {
|
|
30
|
+
"minAvgFps": 42,
|
|
31
|
+
"description": "200k line WebGPU — target ≥95% of WebGL FPS"
|
|
32
|
+
},
|
|
33
|
+
"boxplot-5k-webgpu": {
|
|
34
|
+
"minAvgFps": 50,
|
|
35
|
+
"description": "5k boxplot series on WebGPU chart path"
|
|
36
|
+
},
|
|
37
|
+
"grid-canvas2d-dpr2": {
|
|
38
|
+
"maxAvgFrameUs": 1200,
|
|
39
|
+
"dpr": 2,
|
|
40
|
+
"description": "Canvas 2D grid+minor at 1920×1080 @2x"
|
|
41
|
+
},
|
|
42
|
+
"grid-webgl-dpr2": {
|
|
43
|
+
"maxAvgFrameUs": 400,
|
|
44
|
+
"dpr": 2,
|
|
45
|
+
"description": "WebGL grid spike lines only @2x"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
;
|
|
50
|
+
|
|
51
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grid rendering benchmark — Canvas 2D vs WebGL spike comparison.
|
|
3
|
+
* @module testing/gridSpikeBenchmark
|
|
4
|
+
*/
|
|
5
|
+
export interface GridBenchmarkResult {
|
|
6
|
+
backend: "canvas2d" | "webgl";
|
|
7
|
+
dpr: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
xTicks: number;
|
|
11
|
+
yTicks: number;
|
|
12
|
+
lineSegments: number;
|
|
13
|
+
avgFrameUs: number;
|
|
14
|
+
p95FrameUs: number;
|
|
15
|
+
frames: number;
|
|
16
|
+
}
|
|
17
|
+
export interface GridCompareResult {
|
|
18
|
+
canvas2d: GridBenchmarkResult;
|
|
19
|
+
webgl: GridBenchmarkResult | null;
|
|
20
|
+
/** Positive = WebGL faster */
|
|
21
|
+
gainPercent: number;
|
|
22
|
+
recommendation: "implement" | "defer";
|
|
23
|
+
}
|
|
24
|
+
/** Benchmark Canvas 2D grid via OverlayRenderer.drawGrid */
|
|
25
|
+
export declare function benchmarkCanvasGrid(options?: {
|
|
26
|
+
width?: number;
|
|
27
|
+
height?: number;
|
|
28
|
+
dpr?: number;
|
|
29
|
+
xTickCount?: number;
|
|
30
|
+
yTickCount?: number;
|
|
31
|
+
frames?: number;
|
|
32
|
+
showMinor?: boolean;
|
|
33
|
+
}): GridBenchmarkResult;
|
|
34
|
+
/** Benchmark WebGL grid spike (returns null if WebGL unavailable) */
|
|
35
|
+
export declare function benchmarkWebGLGrid(options?: {
|
|
36
|
+
width?: number;
|
|
37
|
+
height?: number;
|
|
38
|
+
dpr?: number;
|
|
39
|
+
xTickCount?: number;
|
|
40
|
+
yTickCount?: number;
|
|
41
|
+
frames?: number;
|
|
42
|
+
}): GridBenchmarkResult | null;
|
|
43
|
+
/** Compare backends; recommends implement if WebGL ≥20% faster */
|
|
44
|
+
export declare function compareGridBackends(options?: {
|
|
45
|
+
dpr?: number;
|
|
46
|
+
frames?: number;
|
|
47
|
+
}): GridCompareResult;
|
|
48
|
+
/** Vertex builder smoke test (no GL required) */
|
|
49
|
+
export declare function countGridVertices(xTickCount: number, yTickCount: number): number;
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -68,6 +68,8 @@ export interface BenchmarkResult {
|
|
|
68
68
|
pointsRendered: number;
|
|
69
69
|
/** Points per second throughput */
|
|
70
70
|
throughput: number;
|
|
71
|
+
/** Render-only throughput (1000 / avgFrameTime); can exceed wall FPS */
|
|
72
|
+
renderFps?: number;
|
|
71
73
|
}
|
|
72
74
|
export interface BenchmarkOptions {
|
|
73
75
|
/** Duration of benchmark in ms (default: 5000) */
|
|
@@ -223,3 +225,6 @@ export declare function waitForFrames(count?: number): Promise<void>;
|
|
|
223
225
|
* Wait for a specified duration
|
|
224
226
|
*/
|
|
225
227
|
export declare function waitFor(ms: number): Promise<void>;
|
|
228
|
+
export { benchmarkCanvasGrid, benchmarkWebGLGrid, compareGridBackends, countGridVertices, type GridBenchmarkResult, type GridCompareResult, } from './gridSpikeBenchmark';
|
|
229
|
+
export { getBaseline, compareScenarioToBaseline, buildStage1Report, effectiveBenchmarkFps, HEADLESS_LOW_FRAME_THRESHOLD, SMOKE_FLOORS, type Stage1ScenarioResult, type Stage1BrowserReport, } from './stage1BrowserBench';
|
|
230
|
+
export { evaluateRendererCompare, type RendererCompareResult, } from './rendererBenchmark';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BenchmarkResult } from './index';
|
|
2
|
+
|
|
3
|
+
export interface RendererCompareResult {
|
|
4
|
+
webgl: BenchmarkResult;
|
|
5
|
+
webgpu: BenchmarkResult | null;
|
|
6
|
+
webgpuActive: boolean;
|
|
7
|
+
/** webgpuFps / webglFps — ≥1 means WebGPU is faster or equal */
|
|
8
|
+
fpsRatio: number;
|
|
9
|
+
/** Meets ADR target: WebGPU ≥ 95% of WebGL FPS */
|
|
10
|
+
meetsTarget: boolean;
|
|
11
|
+
recommendation: "webgpu-ready" | "webgl-faster" | "webgpu-unavailable";
|
|
12
|
+
}
|
|
13
|
+
export declare function evaluateRendererCompare(webgl: BenchmarkResult, webgpu: BenchmarkResult | null, webgpuActive: boolean, minRatio?: number): RendererCompareResult;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { BenchmarkResult } from './index';
|
|
2
|
+
import { default as baseline } from './baselines/v1.15.0.json';
|
|
3
|
+
|
|
4
|
+
export interface Stage1ScenarioResult {
|
|
5
|
+
id: string;
|
|
6
|
+
benchmark: BenchmarkResult;
|
|
7
|
+
passed: boolean;
|
|
8
|
+
failures: string[];
|
|
9
|
+
baselineMinFps?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface Stage1BrowserReport {
|
|
12
|
+
timestamp: number;
|
|
13
|
+
version: string;
|
|
14
|
+
scenarios: Stage1ScenarioResult[];
|
|
15
|
+
allPassed: boolean;
|
|
16
|
+
regressionThreshold: number;
|
|
17
|
+
}
|
|
18
|
+
export interface BaselineScenario {
|
|
19
|
+
minAvgFps?: number;
|
|
20
|
+
maxAvgFrameTimeMs?: number;
|
|
21
|
+
maxAvgFrameUs?: number;
|
|
22
|
+
dpr?: number;
|
|
23
|
+
points?: number;
|
|
24
|
+
description?: string;
|
|
25
|
+
}
|
|
26
|
+
/** When wall-clock frame count is below this, headless rAF is unreliable — use renderFps. */
|
|
27
|
+
export declare const HEADLESS_LOW_FRAME_THRESHOLD = 30;
|
|
28
|
+
/** Headless smoke floors (renderFps or effective FPS). Desktop uses baseline minAvgFps. */
|
|
29
|
+
export declare const SMOKE_FLOORS: Record<string, number>;
|
|
30
|
+
/** Pick wall or render FPS depending on headless throttling artifacts. */
|
|
31
|
+
export declare function effectiveBenchmarkFps(result: Pick<BenchmarkResult, "avgFps" | "renderFps" | "frameCount">, isHeadless: boolean): number;
|
|
32
|
+
export declare function getBaseline(): typeof baseline;
|
|
33
|
+
/** Compare a benchmark result against v1.15 baseline for a scenario */
|
|
34
|
+
export declare function compareScenarioToBaseline(scenarioId: string, result: BenchmarkResult | {
|
|
35
|
+
avgFrameUs: number;
|
|
36
|
+
backend?: string;
|
|
37
|
+
}): {
|
|
38
|
+
passed: boolean;
|
|
39
|
+
failures: string[];
|
|
40
|
+
};
|
|
41
|
+
/** Build a full Stage 1 report from scenario results */
|
|
42
|
+
export declare function buildStage1Report(scenarios: Stage1ScenarioResult[]): Stage1BrowserReport;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UDF-inspired datafeed contract for trading charts (Stage 2.24).
|
|
3
|
+
*/
|
|
4
|
+
export interface SymbolInfo {
|
|
5
|
+
symbol: string;
|
|
6
|
+
name: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
timezone?: string;
|
|
9
|
+
session?: string;
|
|
10
|
+
pricescale?: number;
|
|
11
|
+
minmov?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface Bar {
|
|
14
|
+
time: number;
|
|
15
|
+
open: number;
|
|
16
|
+
high: number;
|
|
17
|
+
low: number;
|
|
18
|
+
close: number;
|
|
19
|
+
volume?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface HistoryRequest {
|
|
22
|
+
symbol: string;
|
|
23
|
+
resolution: string;
|
|
24
|
+
from: number;
|
|
25
|
+
to: number;
|
|
26
|
+
}
|
|
27
|
+
export interface SubscribeBarsRequest {
|
|
28
|
+
symbol: string;
|
|
29
|
+
resolution: string;
|
|
30
|
+
onBar: (bar: Bar) => void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* TradingView UDF-style adapter surface.
|
|
34
|
+
*/
|
|
35
|
+
export interface DatafeedAdapter {
|
|
36
|
+
resolveSymbol(symbol: string): Promise<SymbolInfo>;
|
|
37
|
+
getBars(request: HistoryRequest): Promise<Bar[]>;
|
|
38
|
+
subscribeBars(request: SubscribeBarsRequest): () => void;
|
|
39
|
+
}
|
|
40
|
+
/** Convert bars to typed OHLC arrays for velo-plot series. */
|
|
41
|
+
export declare function barsToOhlc(bars: Bar[]): {
|
|
42
|
+
x: Float64Array;
|
|
43
|
+
open: Float32Array;
|
|
44
|
+
high: Float32Array;
|
|
45
|
+
low: Float32Array;
|
|
46
|
+
close: Float32Array;
|
|
47
|
+
volume: Float32Array;
|
|
48
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* velo-plot/trading — focused trading dashboard bundle (Stage 2).
|
|
3
|
+
* Tree-shakes scientific/3D plugins; includes stacked charts, indicators, drawings, replay.
|
|
4
|
+
*/
|
|
5
|
+
export { createChart } from '../core/Chart';
|
|
6
|
+
export { createStackedChart } from '../core/stacked/createStackedChart';
|
|
7
|
+
export type { Chart, ChartOptions } from '../core/Chart';
|
|
8
|
+
export type { StackedChart, StackedChartOptions, StackedPaneConfig, } from '../core/stacked/types';
|
|
9
|
+
export { mapToBusinessDayScale, isBusinessDay, businessDaySpanMs, type TimeScaleOptions, type BusinessDayMapping, } from '../core/time/TimeScale';
|
|
10
|
+
export { isBusinessDayScaleActive, applyBusinessDayX, formatBusinessDayTick, } from '../core/time/applyTimeScale';
|
|
11
|
+
export { addIndicatorToChart, buildIndicatorPaneFromPreset, computeIndicatorFromSeries, type AddIndicatorOptions, type AddIndicatorResult, type IndicatorPresetName, } from '../core/indicator/addIndicator';
|
|
12
|
+
export { computeHeikinAshi } from '../core/chart/heikinAshi';
|
|
13
|
+
export type { CandlestickMarker, CandlestickMarkerPosition, CandlestickMarkerShape, } from '../core/chart/candlestickMarkers';
|
|
14
|
+
export type { PriceAlertOptions } from '../core/chart/ChartAlerts';
|
|
15
|
+
export type { PositionLineOptions } from '../core/chart/positionLines';
|
|
16
|
+
export { PluginAnnotations } from '../plugins/annotations';
|
|
17
|
+
export type { Annotation, AnnotationType } from '../plugins/annotations';
|
|
18
|
+
export { PluginDrawingTools } from '../plugins/drawing-tools';
|
|
19
|
+
export type { DrawingMode, DrawingToolsAPI } from '../plugins/drawing-tools';
|
|
20
|
+
export { PluginReplay } from '../plugins/replay';
|
|
21
|
+
export type { ReplayAPI } from '../plugins/replay';
|
|
22
|
+
export { PluginKeyboard } from '../plugins/keyboard';
|
|
23
|
+
export { PluginStreaming } from '../plugins/streaming';
|
|
24
|
+
export { ChartGroup } from '../core/sync';
|
|
25
|
+
export { barsToOhlc, type DatafeedAdapter, type SymbolInfo, type Bar, type HistoryRequest, } from './datafeed';
|
|
26
|
+
export { createMockDatafeed } from './mockDatafeed';
|
|
27
|
+
export { generateBusinessDayOhlcv, generateContinuousOhlcv, findLowestBarIndex, findHighestBarIndex, type OhlcvData, type OhlcvOptions, } from './ohlcvGenerator';
|
|
28
|
+
export type { SeriesOptions, SeriesData, AxisOptions, Bounds, } from '../types';
|
|
29
|
+
export { DARK_THEME, LIGHT_THEME, DEFAULT_THEME } from '../theme';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Seeded OHLCV generators for trading demos and tests.
|
|
3
|
+
*/
|
|
4
|
+
export interface OhlcvData {
|
|
5
|
+
x: Float64Array;
|
|
6
|
+
open: Float32Array;
|
|
7
|
+
high: Float32Array;
|
|
8
|
+
low: Float32Array;
|
|
9
|
+
close: Float32Array;
|
|
10
|
+
volume: Float32Array;
|
|
11
|
+
}
|
|
12
|
+
export interface OhlcvOptions {
|
|
13
|
+
startMs?: number;
|
|
14
|
+
seed?: number;
|
|
15
|
+
}
|
|
16
|
+
/** Mulberry32 PRNG — deterministic when seed is provided. */
|
|
17
|
+
export declare function mulberry32(seed: number): () => number;
|
|
18
|
+
/** OHLCV with business-day timestamps (weekends skipped in data). */
|
|
19
|
+
export declare function generateBusinessDayOhlcv(n: number, startMsOrOptions?: number | OhlcvOptions, legacySeed?: number): OhlcvData;
|
|
20
|
+
/** OHLCV with consecutive calendar days (includes weekends). */
|
|
21
|
+
export declare function generateContinuousOhlcv(n: number, startMsOrOptions?: number | OhlcvOptions, legacySeed?: number): OhlcvData;
|
|
22
|
+
/** Index of the bar with the lowest low. */
|
|
23
|
+
export declare function findLowestBarIndex(low: Float32Array): number;
|
|
24
|
+
/** Index of the bar with the highest high. */
|
|
25
|
+
export declare function findHighestBarIndex(high: Float32Array): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './trading/index'
|
package/dist/trading.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { D as P, f as b, L as v, a as B, b as E, e as S, d as U, c as H } from "./ChartCore-BhQ4j7f5.js";
|
|
2
|
+
import { c as k } from "./createStackedChart-DJSmqerD.js";
|
|
3
|
+
import { c as _, b as R, f as G, i as K, a as j, m as X } from "./axisFormat-SPX-CD5s.js";
|
|
4
|
+
import { PluginAnnotations as q } from "./plugins/annotations.js";
|
|
5
|
+
import { P as J, a as N, b as O, c as Q } from "./mockDatafeed-Cdg5hKEo.js";
|
|
6
|
+
import { P as W } from "./index-DoYxf1cV.js";
|
|
7
|
+
import { P as $ } from "./index-BMiZoKmm.js";
|
|
8
|
+
import { C as te } from "./index-CUGS98p4.js";
|
|
9
|
+
const p = 864e5;
|
|
10
|
+
function w(e) {
|
|
11
|
+
let a = e >>> 0;
|
|
12
|
+
return () => {
|
|
13
|
+
a = a + 1831565813 >>> 0;
|
|
14
|
+
let t = Math.imul(a ^ a >>> 15, 1 | a);
|
|
15
|
+
return t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t, ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function h(e) {
|
|
19
|
+
return e !== void 0 ? w(e) : Math.random;
|
|
20
|
+
}
|
|
21
|
+
function D(e, a, t = Date.UTC(2024, 0, 2)) {
|
|
22
|
+
const l = typeof e == "object" ? e : { startMs: e, seed: a };
|
|
23
|
+
return {
|
|
24
|
+
startMs: l.startMs ?? t,
|
|
25
|
+
seed: l.seed
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function x(e, a = Date.UTC(2024, 0, 2), t) {
|
|
29
|
+
const { startMs: l, seed: d } = D(a, t), n = h(d), u = new Float64Array(e), c = new Float32Array(e), f = new Float32Array(e), m = new Float32Array(e), s = new Float32Array(e), y = new Float32Array(e);
|
|
30
|
+
let i = l, r = 100;
|
|
31
|
+
for (let o = 0; o < e; o++) {
|
|
32
|
+
for (; new Date(i).getUTCDay() === 0 || new Date(i).getUTCDay() === 6; )
|
|
33
|
+
i += p;
|
|
34
|
+
u[o] = i, c[o] = r;
|
|
35
|
+
const A = (n() - 0.48) * 3;
|
|
36
|
+
s[o] = r + A, f[o] = Math.max(c[o], s[o]) + n() * 1.5, m[o] = Math.min(c[o], s[o]) - n() * 1.5, y[o] = 5e5 + n() * 2e6, r = s[o], i += p;
|
|
37
|
+
}
|
|
38
|
+
return { x: u, open: c, high: f, low: m, close: s, volume: y };
|
|
39
|
+
}
|
|
40
|
+
function g(e, a = Date.UTC(2024, 0, 1), t) {
|
|
41
|
+
const { startMs: l, seed: d } = D(
|
|
42
|
+
a,
|
|
43
|
+
t,
|
|
44
|
+
Date.UTC(2024, 0, 1)
|
|
45
|
+
), n = h(d), u = new Float64Array(e), c = new Float32Array(e), f = new Float32Array(e), m = new Float32Array(e), s = new Float32Array(e), y = new Float32Array(e);
|
|
46
|
+
let i = 100;
|
|
47
|
+
for (let r = 0; r < e; r++) {
|
|
48
|
+
u[r] = l + r * p, c[r] = i;
|
|
49
|
+
const o = (n() - 0.48) * 3;
|
|
50
|
+
s[r] = i + o, f[r] = Math.max(c[r], s[r]) + n() * 1.5, m[r] = Math.min(c[r], s[r]) - n() * 1.5, y[r] = 5e5 + n() * 2e6, i = s[r];
|
|
51
|
+
}
|
|
52
|
+
return { x: u, open: c, high: f, low: m, close: s, volume: y };
|
|
53
|
+
}
|
|
54
|
+
function M(e) {
|
|
55
|
+
let a = 0;
|
|
56
|
+
for (let t = 1; t < e.length; t++)
|
|
57
|
+
e[t] < e[a] && (a = t);
|
|
58
|
+
return a;
|
|
59
|
+
}
|
|
60
|
+
function T(e) {
|
|
61
|
+
let a = 0;
|
|
62
|
+
for (let t = 1; t < e.length; t++)
|
|
63
|
+
e[t] > e[a] && (a = t);
|
|
64
|
+
return a;
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
te as ChartGroup,
|
|
68
|
+
P as DARK_THEME,
|
|
69
|
+
b as DEFAULT_THEME,
|
|
70
|
+
v as LIGHT_THEME,
|
|
71
|
+
q as PluginAnnotations,
|
|
72
|
+
J as PluginDrawingTools,
|
|
73
|
+
W as PluginKeyboard,
|
|
74
|
+
N as PluginReplay,
|
|
75
|
+
$ as PluginStreaming,
|
|
76
|
+
B as addIndicatorToChart,
|
|
77
|
+
_ as applyBusinessDayX,
|
|
78
|
+
O as barsToOhlc,
|
|
79
|
+
E as buildIndicatorPaneFromPreset,
|
|
80
|
+
R as businessDaySpanMs,
|
|
81
|
+
S as computeHeikinAshi,
|
|
82
|
+
U as computeIndicatorFromSeries,
|
|
83
|
+
H as createChart,
|
|
84
|
+
Q as createMockDatafeed,
|
|
85
|
+
k as createStackedChart,
|
|
86
|
+
T as findHighestBarIndex,
|
|
87
|
+
M as findLowestBarIndex,
|
|
88
|
+
G as formatBusinessDayTick,
|
|
89
|
+
x as generateBusinessDayOhlcv,
|
|
90
|
+
g as generateContinuousOhlcv,
|
|
91
|
+
K as isBusinessDay,
|
|
92
|
+
j as isBusinessDayScaleActive,
|
|
93
|
+
X as mapToBusinessDayScale
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=trading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trading.js","sources":["../src/trading/ohlcvGenerator.ts"],"sourcesContent":["/**\n * Seeded OHLCV generators for trading demos and tests.\n */\n\nexport interface OhlcvData {\n x: Float64Array;\n open: Float32Array;\n high: Float32Array;\n low: Float32Array;\n close: Float32Array;\n volume: Float32Array;\n}\n\nexport interface OhlcvOptions {\n startMs?: number;\n seed?: number;\n}\n\nconst MS_DAY = 86_400_000;\n\n/** Mulberry32 PRNG — deterministic when seed is provided. */\nexport function mulberry32(seed: number): () => number {\n let s = seed >>> 0;\n return () => {\n s = (s + 0x6d2b79f5) >>> 0;\n let t = Math.imul(s ^ (s >>> 15), 1 | s);\n t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n };\n}\n\nfunction resolveRand(seed?: number): () => number {\n return seed !== undefined ? mulberry32(seed) : Math.random;\n}\n\nfunction resolveOptions(\n startMsOrOptions: number | OhlcvOptions,\n legacySeed?: number,\n defaultStartMs = Date.UTC(2024, 0, 2),\n): { startMs: number; seed?: number } {\n const opts: OhlcvOptions =\n typeof startMsOrOptions === \"object\"\n ? startMsOrOptions\n : { startMs: startMsOrOptions, seed: legacySeed };\n return {\n startMs: opts.startMs ?? defaultStartMs,\n seed: opts.seed,\n };\n}\n\n/** OHLCV with business-day timestamps (weekends skipped in data). */\nexport function generateBusinessDayOhlcv(\n n: number,\n startMsOrOptions: number | OhlcvOptions = Date.UTC(2024, 0, 2),\n legacySeed?: number,\n): OhlcvData {\n const { startMs, seed } = resolveOptions(startMsOrOptions, legacySeed);\n const rand = resolveRand(seed);\n\n const x = new Float64Array(n);\n const open = new Float32Array(n);\n const high = new Float32Array(n);\n const low = new Float32Array(n);\n const close = new Float32Array(n);\n const volume = new Float32Array(n);\n\n let t = startMs;\n let price = 100;\n\n for (let i = 0; i < n; i++) {\n while (new Date(t).getUTCDay() === 0 || new Date(t).getUTCDay() === 6) {\n t += MS_DAY;\n }\n x[i] = t;\n open[i] = price;\n const change = (rand() - 0.48) * 3;\n close[i] = price + change;\n high[i] = Math.max(open[i], close[i]) + rand() * 1.5;\n low[i] = Math.min(open[i], close[i]) - rand() * 1.5;\n volume[i] = 500_000 + rand() * 2_000_000;\n price = close[i];\n t += MS_DAY;\n }\n\n return { x, open, high, low, close, volume };\n}\n\n/** OHLCV with consecutive calendar days (includes weekends). */\nexport function generateContinuousOhlcv(\n n: number,\n startMsOrOptions: number | OhlcvOptions = Date.UTC(2024, 0, 1),\n legacySeed?: number,\n): OhlcvData {\n const { startMs, seed } = resolveOptions(\n startMsOrOptions,\n legacySeed,\n Date.UTC(2024, 0, 1),\n );\n const rand = resolveRand(seed);\n\n const x = new Float64Array(n);\n const open = new Float32Array(n);\n const high = new Float32Array(n);\n const low = new Float32Array(n);\n const close = new Float32Array(n);\n const volume = new Float32Array(n);\n\n let price = 100;\n for (let i = 0; i < n; i++) {\n x[i] = startMs + i * MS_DAY;\n open[i] = price;\n const change = (rand() - 0.48) * 3;\n close[i] = price + change;\n high[i] = Math.max(open[i], close[i]) + rand() * 1.5;\n low[i] = Math.min(open[i], close[i]) - rand() * 1.5;\n volume[i] = 500_000 + rand() * 2_000_000;\n price = close[i];\n }\n\n return { x, open, high, low, close, volume };\n}\n\n/** Index of the bar with the lowest low. */\nexport function findLowestBarIndex(low: Float32Array): number {\n let idx = 0;\n for (let i = 1; i < low.length; i++) {\n if (low[i] < low[idx]) idx = i;\n }\n return idx;\n}\n\n/** Index of the bar with the highest high. */\nexport function findHighestBarIndex(high: Float32Array): number {\n let idx = 0;\n for (let i = 1; i < high.length; i++) {\n if (high[i] > high[idx]) idx = i;\n }\n return idx;\n}\n"],"names":["MS_DAY","mulberry32","seed","s","resolveRand","resolveOptions","startMsOrOptions","legacySeed","defaultStartMs","opts","generateBusinessDayOhlcv","n","startMs","rand","x","open","high","low","close","volume","t","price","i","change","generateContinuousOhlcv","findLowestBarIndex","idx","findHighestBarIndex"],"mappings":"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"}
|
package/dist/types.d.ts
CHANGED
|
@@ -69,8 +69,10 @@ export interface AxisOptions {
|
|
|
69
69
|
labelRotation?: number;
|
|
70
70
|
/** Target number of tick divisions on this axis (default: 8 for X, 6 for Y) */
|
|
71
71
|
tickCount?: number;
|
|
72
|
+
/** Trading time scale (Stage 2) — business-day gaps, session presets */
|
|
73
|
+
timeScale?: import('./core/time/TimeScale').TimeScaleOptions;
|
|
72
74
|
}
|
|
73
|
-
export type SeriesType = "line" | "scatter" | "line+scatter" | "step" | "step+scatter" | "band" | "area" | "bar" | "heatmap" | "candlestick" | "polar" | "radar" | "boxplot" | "waterfall" | "gauge" | "sankey" | "ternary" | "indicator";
|
|
75
|
+
export type SeriesType = "line" | "scatter" | "line+scatter" | "step" | "step+scatter" | "band" | "area" | "bar" | "heatmap" | "candlestick" | "heikin-ashi" | "polar" | "radar" | "boxplot" | "waterfall" | "gauge" | "sankey" | "ternary" | "indicator";
|
|
74
76
|
/** Step mode defines where the step occurs */
|
|
75
77
|
export type StepMode = "before" | "after" | "center";
|
|
76
78
|
/** Error bar direction */
|
|
@@ -202,6 +204,8 @@ export interface SeriesOptions {
|
|
|
202
204
|
maxPoints?: number;
|
|
203
205
|
/** Identifier for stacking series (same ID will be stacked together) */
|
|
204
206
|
stackId?: string;
|
|
207
|
+
/** Buy/sell markers on candlestick series (Stage 2.14) */
|
|
208
|
+
markers?: import('./core/chart/candlestickMarkers').CandlestickMarker[];
|
|
205
209
|
}
|
|
206
210
|
export interface SeriesUpdateData {
|
|
207
211
|
/** New X values */
|
|
@@ -509,7 +513,14 @@ export interface ChartOptions {
|
|
|
509
513
|
container: HTMLDivElement;
|
|
510
514
|
/** Stable chart id (used by sync groups; auto-generated if omitted) */
|
|
511
515
|
id?: string;
|
|
512
|
-
/**
|
|
516
|
+
/**
|
|
517
|
+
* Renderer backend selection (default: `'webgl'`).
|
|
518
|
+
* `'webgl'` uses WebGL2 via `NativeWebGLRenderer`.
|
|
519
|
+
* `'webgpu'` uses the GPU abstraction layer (WebGPU when available, otherwise
|
|
520
|
+
* falls back to WebGL2 with a console warning). Use `chart.getActiveRenderer()`
|
|
521
|
+
* to inspect the runtime backend. Boxplot/waterfall series render on WebGL only.
|
|
522
|
+
* @see docs/adr/001-webgpu-renderer-strategy.md
|
|
523
|
+
*/
|
|
513
524
|
renderer?: "webgl" | "webgpu";
|
|
514
525
|
/** X-axis configuration */
|
|
515
526
|
xAxis?: AxisOptions;
|
|
@@ -752,6 +763,15 @@ export interface ChartEventMap {
|
|
|
752
763
|
dataLoading: DataLoadingEvent;
|
|
753
764
|
deltaMeasure: DeltaMeasurement;
|
|
754
765
|
peakMeasure: PeakMeasurement;
|
|
766
|
+
/** Price alert triggered (Stage 2.18) */
|
|
767
|
+
alert: {
|
|
768
|
+
id: string;
|
|
769
|
+
price: number;
|
|
770
|
+
direction: "above" | "below" | "cross";
|
|
771
|
+
seriesId?: string;
|
|
772
|
+
triggeredAt: number;
|
|
773
|
+
triggerPrice: number;
|
|
774
|
+
};
|
|
755
775
|
}
|
|
756
776
|
/** GPU uniform values */
|
|
757
777
|
export interface Uniforms {
|