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
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Chart } from '../chart/types';
|
|
2
|
+
import { StackedPaneConfig } from '../stacked/types';
|
|
3
|
+
import { BuildIndicatorPaneOptions } from './buildIndicatorPane';
|
|
4
|
+
import { ComputedIndicatorPreset, IndicatorPresetName, IndicatorPresetOptions } from './indicatorPresets';
|
|
5
|
+
|
|
6
|
+
export interface AddIndicatorOptions extends IndicatorPresetOptions {
|
|
7
|
+
/** Series to derive prices from (default: first line/candlestick/bar) */
|
|
8
|
+
sourceSeriesId?: string;
|
|
9
|
+
/** Y axis for overlay lines (default: same as source series) */
|
|
10
|
+
yAxisId?: string;
|
|
11
|
+
/** For stacked charts — build a new pane config instead of mutating chart */
|
|
12
|
+
pane?: "inline" | "new";
|
|
13
|
+
/** Pane flex ratio when pane: 'new' (default 0.25) */
|
|
14
|
+
paneHeight?: number | string;
|
|
15
|
+
showXAxis?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface AddIndicatorResult {
|
|
18
|
+
id: string;
|
|
19
|
+
preset: IndicatorPresetName;
|
|
20
|
+
placement: "overlay" | "oscillator";
|
|
21
|
+
seriesIds: string[];
|
|
22
|
+
}
|
|
23
|
+
type ChartIndicatorHost = Pick<Chart, "getSeries" | "getAllSeries" | "addSeries" | "removeSeries">;
|
|
24
|
+
/**
|
|
25
|
+
* Calculate indicator preset from a source series (no render).
|
|
26
|
+
*/
|
|
27
|
+
export declare function computeIndicatorFromSeries(chart: ChartIndicatorHost, preset: IndicatorPresetName, options?: AddIndicatorOptions): Promise<ComputedIndicatorPreset>;
|
|
28
|
+
/**
|
|
29
|
+
* Add a trading indicator to an existing chart (overlay or inline oscillator layers).
|
|
30
|
+
*/
|
|
31
|
+
export declare function addIndicatorToChart(chart: ChartIndicatorHost, preset: IndicatorPresetName, options?: AddIndicatorOptions): Promise<AddIndicatorResult>;
|
|
32
|
+
/**
|
|
33
|
+
* Build a stacked pane config for an indicator (use when creating or extending stacks).
|
|
34
|
+
*/
|
|
35
|
+
export declare function buildIndicatorPaneFromPreset(preset: IndicatorPresetName, x: Float32Array | Float64Array, prices: Float32Array | Float64Array, options: IndicatorPresetOptions & Pick<BuildIndicatorPaneOptions, "id" | "height" | "label" | "yRange" | "tickCount" | "showXAxis" | "seriesId" | "style">, source?: import('../Series').Series): Promise<StackedPaneConfig>;
|
|
36
|
+
export type { IndicatorPresetName, IndicatorPresetOptions, ComputedIndicatorPreset };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export type { IndicatorData, IndicatorFillLayer, IndicatorHistogramLayer, IndicatorLineColorZones, IndicatorLineLayer, IndicatorMarker, IndicatorMarkerKind, IndicatorReferenceLine, IndicatorSeriesOptions, IndicatorStyle, } from './types';
|
|
2
2
|
export { buildIndicatorSeries, createIndicatorSeries, detectIndicatorMarkers, } from './buildIndicatorSeries';
|
|
3
3
|
export { buildIndicatorPane, type BuildIndicatorPaneOptions } from './buildIndicatorPane';
|
|
4
|
+
export { addIndicatorToChart, buildIndicatorPaneFromPreset, computeIndicatorFromSeries, type AddIndicatorOptions, type AddIndicatorResult, type IndicatorPresetName, type IndicatorPresetOptions, } from './addIndicator';
|
|
5
|
+
export { computeIndicatorPreset, extractPriceSeries, resolveSourceSeries, isOverlayPreset, type ComputedIndicatorPreset, } from './indicatorPresets';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IndicatorData } from './types';
|
|
2
|
+
import { Series } from '../Series';
|
|
3
|
+
|
|
4
|
+
export type IndicatorPresetName = "rsi" | "macd" | "bollinger" | "bollingerBands" | "ema" | "sma" | "stochastic";
|
|
5
|
+
export interface IndicatorPresetOptions {
|
|
6
|
+
period?: number;
|
|
7
|
+
fastPeriod?: number;
|
|
8
|
+
slowPeriod?: number;
|
|
9
|
+
signalPeriod?: number;
|
|
10
|
+
stdDev?: number;
|
|
11
|
+
/** Root id for generated series (default: preset name) */
|
|
12
|
+
id?: string;
|
|
13
|
+
label?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ComputedIndicatorPreset {
|
|
16
|
+
id: string;
|
|
17
|
+
preset: IndicatorPresetName;
|
|
18
|
+
/** overlay = price chart bands/lines; oscillator = separate pane layers */
|
|
19
|
+
placement: "overlay" | "oscillator";
|
|
20
|
+
yRange?: [number, number];
|
|
21
|
+
data: IndicatorData;
|
|
22
|
+
}
|
|
23
|
+
/** Extract X and close/price array from a source series. */
|
|
24
|
+
export declare function extractPriceSeries(source: Series): {
|
|
25
|
+
x: Float32Array | Float64Array;
|
|
26
|
+
prices: Float32Array | Float64Array;
|
|
27
|
+
};
|
|
28
|
+
/** Extract OHLC from candlestick series for stochastic and similar presets. */
|
|
29
|
+
export declare function extractOhlcSeries(source: Series): {
|
|
30
|
+
x: Float32Array | Float64Array;
|
|
31
|
+
open: Float32Array | Float64Array;
|
|
32
|
+
high: Float32Array | Float64Array;
|
|
33
|
+
low: Float32Array | Float64Array;
|
|
34
|
+
close: Float32Array | Float64Array;
|
|
35
|
+
};
|
|
36
|
+
/** Resolve source series from chart API surface. */
|
|
37
|
+
export declare function resolveSourceSeries(chart: {
|
|
38
|
+
getSeries(id: string): Series | undefined;
|
|
39
|
+
getAllSeries(): Series[];
|
|
40
|
+
}, sourceSeriesId?: string): Series;
|
|
41
|
+
/**
|
|
42
|
+
* Compute composite indicator layers for a preset (async worker path when available).
|
|
43
|
+
*/
|
|
44
|
+
export declare function computeIndicatorPreset(preset: IndicatorPresetName, x: Float32Array | Float64Array, prices: Float32Array | Float64Array, options?: IndicatorPresetOptions, source?: Series): Promise<ComputedIndicatorPreset>;
|
|
45
|
+
export declare function isOverlayPreset(preset: IndicatorPresetName): boolean;
|
|
@@ -11,6 +11,7 @@ export declare class Series {
|
|
|
11
11
|
private stackId?;
|
|
12
12
|
private cycle?;
|
|
13
13
|
private maxPoints?;
|
|
14
|
+
private markers;
|
|
14
15
|
bullishCount: number;
|
|
15
16
|
bearishCount: number;
|
|
16
17
|
waterfallCounts?: {
|
|
@@ -42,6 +43,8 @@ export declare class Series {
|
|
|
42
43
|
getVisible: () => boolean;
|
|
43
44
|
isVisible: () => boolean;
|
|
44
45
|
getStyle: () => SeriesStyle;
|
|
46
|
+
getMarkers: () => import('../..').CandlestickMarker[];
|
|
47
|
+
setMarkers: (markers: import('../chart/candlestickMarkers').CandlestickMarker[]) => void;
|
|
45
48
|
getHeatmapData: () => HeatmapData | undefined;
|
|
46
49
|
getHeatmapStyle: () => HeatmapStyle | undefined;
|
|
47
50
|
getPolarData: () => PolarData | undefined;
|
|
@@ -2,6 +2,7 @@ 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
|
|
|
6
7
|
/** Stack layout direction */
|
|
7
8
|
export type StackDirection = "vertical" | "horizontal";
|
|
@@ -83,6 +84,13 @@ export interface StackedChart {
|
|
|
83
84
|
setSyncOptions(options: Partial<StackedSyncOptions>): void;
|
|
84
85
|
/** Resolves when all pane charts have started rendering */
|
|
85
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
|
+
}>;
|
|
86
94
|
/** Export the entire stack as one PNG/JPEG/WebP image (WYSIWYG layout) */
|
|
87
95
|
exportImage(options?: StackSnapshotOptions): Promise<string>;
|
|
88
96
|
/** Alias for exportImage */
|
|
@@ -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: Float64Array;
|
|
16
|
+
/** Original timestamp per scaled index (for tooltips / ticks) */
|
|
17
|
+
timeByIndex: Float64Array;
|
|
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;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AxisOptions } from '../../types';
|
|
2
|
+
import { BusinessDayMapping, TimeScaleOptions } from './TimeScale';
|
|
3
|
+
|
|
4
|
+
export declare function isBusinessDayScaleActive(xAxis: AxisOptions): boolean;
|
|
5
|
+
export declare function resolveTimeScaleOpts(xAxis: AxisOptions): TimeScaleOptions;
|
|
6
|
+
export declare function applyBusinessDayX(x: Float32Array | Float64Array, xAxis: AxisOptions): {
|
|
7
|
+
displayX: Float64Array;
|
|
8
|
+
mapping: BusinessDayMapping;
|
|
9
|
+
};
|
|
10
|
+
export declare function formatBusinessDayTick(logicalIndex: number, mapping: BusinessDayMapping): string | null;
|