velo-plot 2.20.0 → 3.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/README.md +15 -8
- package/dist/{ChartCore-ivzLqxVb.js → ChartCore-BpzRvN4Y.js} +978 -861
- package/dist/ChartCore-BpzRvN4Y.js.map +1 -0
- package/dist/a11y-Bw6urYpr.js +105 -0
- package/dist/a11y-Bw6urYpr.js.map +1 -0
- package/dist/angular/hooks-entry.d.ts +1 -0
- package/dist/angular/hooks.d.ts +26 -0
- package/dist/angular/index.d.ts +8 -0
- package/dist/angular/velo-plot.component.d.ts +46 -0
- package/dist/angular-hooks.d.ts +1 -0
- package/dist/angular-hooks.js +9 -0
- package/dist/angular-hooks.js.map +1 -0
- package/dist/angular.d.ts +1 -0
- package/dist/angular.js +166 -0
- package/dist/angular.js.map +1 -0
- package/dist/assets/indicator.worker-bv0zC4EX.js.map +1 -1
- package/dist/astro/StackedPlot.astro +19 -0
- package/dist/astro/VeloPlot.astro +23 -0
- package/dist/bindings/shared/a11y.d.ts +26 -0
- package/dist/bindings/shared/chartLifecycle.d.ts +16 -0
- package/dist/bindings/shared/chartSyncBridge.d.ts +8 -0
- package/dist/bindings/shared/dimensions.d.ts +1 -0
- package/dist/bindings/shared/index.d.ts +9 -0
- package/dist/bindings/shared/indicatorBridge.d.ts +11 -0
- package/dist/bindings/shared/optionsSync.d.ts +7 -0
- package/dist/bindings/shared/seriesDiff.d.ts +8 -0
- package/dist/bindings/shared/stackedSync.d.ts +9 -0
- package/dist/bindings/shared/types.d.ts +46 -0
- package/dist/bindings/test-utils/index.d.ts +35 -0
- package/dist/bindings/test-utils/mockLifecycle.d.ts +120 -0
- package/dist/bindings/test-utils/vitestSveltePlugin.d.ts +3 -0
- package/dist/chartSyncBridge-DbWrwtyP.js +57 -0
- package/dist/chartSyncBridge-DbWrwtyP.js.map +1 -0
- package/dist/core/Chart.d.ts +1 -1
- package/dist/core/InteractionManager.d.ts +7 -1
- package/dist/core/OverlayRenderer.d.ts +5 -0
- package/dist/core/annotations/types.d.ts +1 -1
- package/dist/core/chart/ChartCore.d.ts +2 -2
- package/dist/core/chart/types.d.ts +1 -1
- package/dist/core/clipboard/index.d.ts +1 -1
- package/dist/core/debug/index.d.ts +1 -1
- package/dist/core/keybindings/index.d.ts +1 -1
- package/dist/core/loading/index.d.ts +1 -1
- package/dist/core/locale/index.d.ts +1 -1
- package/dist/core/stacked/paneResize.d.ts +3 -0
- package/dist/core/stacked/types.d.ts +10 -0
- package/dist/core/theme-editor/index.d.ts +1 -1
- package/dist/createStackedChart-Dm-YqUT7.js +756 -0
- package/dist/createStackedChart-Dm-YqUT7.js.map +1 -0
- package/dist/examples/PluginDemonstration.d.ts +1 -1
- package/dist/gpuRenderer-BpaMYz-k.js.map +1 -1
- package/dist/hooks-CYPCxoZx.js +69 -0
- package/dist/hooks-CYPCxoZx.js.map +1 -0
- package/dist/{index-BBpJwOct.js → index-0InEyj0q.js} +119 -121
- package/dist/index-0InEyj0q.js.map +1 -0
- package/dist/index-BMiZoKmm.js.map +1 -1
- package/dist/{index-DoYxf1cV.js → index-CWxIHdwX.js} +38 -98
- package/dist/index-CWxIHdwX.js.map +1 -0
- package/dist/index-CaXWSOTk.js.map +1 -1
- package/dist/index-Dag88bW4.js.map +1 -1
- package/dist/index-qhscKTDy.js.map +1 -1
- package/dist/index-qunX30Xu.js.map +1 -1
- package/dist/index-x4stH3jD.js.map +1 -1
- package/dist/{index.core-COREBDNq.js → index.core-BmZe2jRQ.js} +9 -9
- package/dist/index.core-BmZe2jRQ.js.map +1 -0
- package/dist/index.core.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/indicators--eJGmVox.js.map +1 -1
- package/dist/{mockDatafeed-927foCM4.js → mockDatafeed-DHIDPcpX.js} +150 -146
- package/dist/mockDatafeed-DHIDPcpX.js.map +1 -0
- package/dist/optionsSync-QUiN4Inw.js +119 -0
- package/dist/optionsSync-QUiN4Inw.js.map +1 -0
- package/dist/plugins/3d/index.d.ts +2 -2
- package/dist/plugins/3d.d.ts +2 -2
- package/dist/plugins/3d.js.map +1 -1
- package/dist/plugins/analysis/index.d.ts +1 -1
- package/dist/plugins/analysis/indicators.d.ts +1 -1
- package/dist/plugins/analysis.d.ts +2 -2
- package/dist/plugins/analysis.js +2 -2
- package/dist/plugins/analysis.js.map +1 -1
- package/dist/plugins/annotations/index.d.ts +1 -1
- package/dist/plugins/annotations.d.ts +2 -2
- package/dist/plugins/annotations.js.map +1 -1
- package/dist/plugins/anomaly-detection.js +1 -1
- package/dist/plugins/anomaly-detection.js.map +1 -1
- package/dist/plugins/broken-axis.d.ts +2 -2
- package/dist/plugins/builtins/crosshair/CrosshairPlugin.d.ts +1 -1
- package/dist/plugins/builtins/index.d.ts +1 -1
- package/dist/plugins/caching.d.ts +2 -2
- package/dist/plugins/clipboard/index.d.ts +2 -2
- package/dist/plugins/clipboard.d.ts +2 -2
- package/dist/plugins/clipboard.js.map +1 -1
- package/dist/plugins/context-menu/index.d.ts +1 -1
- package/dist/plugins/context-menu.d.ts +2 -2
- package/dist/plugins/context-menu.js +1 -1
- package/dist/plugins/context-menu.js.map +1 -1
- package/dist/plugins/data-export/index.d.ts +1 -1
- package/dist/plugins/data-export.d.ts +2 -2
- package/dist/plugins/data-export.js +2 -2
- package/dist/plugins/data-export.js.map +1 -1
- package/dist/plugins/data-transform.d.ts +2 -2
- package/dist/plugins/data-transform.js +19 -19
- package/dist/plugins/data-transform.js.map +1 -1
- package/dist/plugins/debug/index.d.ts +2 -2
- package/dist/plugins/debug.d.ts +2 -2
- package/dist/plugins/debug.js +2 -2
- package/dist/plugins/debug.js.map +1 -1
- package/dist/plugins/forecasting/index.d.ts +1 -1
- package/dist/plugins/forecasting.js.map +1 -1
- package/dist/plugins/gpu/index.d.ts +2 -2
- package/dist/plugins/gpu.d.ts +2 -2
- package/dist/plugins/gpu.js.map +1 -1
- package/dist/plugins/i18n/index.d.ts +2 -2
- package/dist/plugins/i18n.d.ts +2 -2
- package/dist/plugins/i18n.js.map +1 -1
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/keyboard.d.ts +2 -2
- package/dist/plugins/keyboard.js +65 -5
- package/dist/plugins/keyboard.js.map +1 -1
- package/dist/plugins/latex.js.map +1 -1
- package/dist/plugins/lazy-load.d.ts +2 -2
- package/dist/plugins/loading/index.d.ts +1 -1
- package/dist/plugins/loading.d.ts +2 -2
- package/dist/plugins/ml-integration.d.ts +2 -2
- package/dist/plugins/ml-integration.js +5 -5
- package/dist/plugins/ml-integration.js.map +1 -1
- package/dist/plugins/offscreen.d.ts +2 -2
- package/dist/plugins/pattern-recognition.d.ts +2 -2
- package/dist/plugins/pattern-recognition.js +1 -1
- package/dist/plugins/pattern-recognition.js.map +1 -1
- package/dist/plugins/radar.d.ts +2 -2
- package/dist/plugins/regression.d.ts +2 -2
- package/dist/plugins/regression.js +1 -1
- package/dist/plugins/regression.js.map +1 -1
- package/dist/plugins/roi.js +9 -9
- package/dist/plugins/roi.js.map +1 -1
- package/dist/plugins/snapshot/index.d.ts +1 -1
- package/dist/plugins/snapshot/types.d.ts +1 -1
- package/dist/plugins/snapshot.d.ts +2 -2
- package/dist/plugins/snapshot.js.map +1 -1
- package/dist/plugins/streaming/index.d.ts +2 -2
- package/dist/plugins/streaming.d.ts +2 -2
- package/dist/plugins/sync/index.d.ts +3 -2
- package/dist/plugins/sync.d.ts +2 -2
- package/dist/plugins/sync.js.map +1 -1
- package/dist/plugins/theme-editor/index.d.ts +1 -1
- package/dist/plugins/theme-editor.d.ts +2 -2
- package/dist/plugins/tools/index.d.ts +1 -1
- package/dist/plugins/tools/tooltip/index.d.ts +1 -1
- package/dist/plugins/tools.d.ts +2 -2
- package/dist/plugins/types.d.ts +1 -1
- package/dist/plugins/video-recorder.d.ts +2 -2
- package/dist/plugins/virtualization.d.ts +2 -2
- package/dist/plugins/virtualization.js +1 -1
- package/dist/pool-DZ8shSqv.js +109 -0
- package/dist/pool-DZ8shSqv.js.map +1 -0
- package/dist/react/StackedPlot.d.ts +31 -0
- package/dist/react/VeloPlot.d.ts +29 -0
- package/dist/react/index.d.ts +25 -3
- package/dist/react/useChartSync.d.ts +8 -0
- package/dist/react/useIndicator.d.ts +12 -0
- package/dist/react/useVeloPlot.d.ts +19 -0
- package/dist/react.js +328 -24
- package/dist/react.js.map +1 -1
- package/dist/scientific/index.d.ts +48 -0
- package/dist/scientific.d.ts +1 -0
- package/dist/scientific.js +91 -0
- package/dist/scientific.js.map +1 -0
- package/dist/solid/VeloPlot.d.ts +16 -0
- package/dist/solid/index.d.ts +13 -0
- package/dist/solid/useChartSync.d.ts +6 -0
- package/dist/solid/useIndicator.d.ts +11 -0
- package/dist/solid/useStackedPlot.d.ts +14 -0
- package/dist/solid/useVeloPlot.d.ts +18 -0
- package/dist/solid.d.ts +1 -0
- package/dist/solid.js +172 -0
- package/dist/solid.js.map +1 -0
- package/dist/stackedSync-tnrunZMt.js +100 -0
- package/dist/stackedSync-tnrunZMt.js.map +1 -0
- package/dist/svelte/StackedPlot.svelte +29 -0
- package/dist/svelte/StackedPlot.test.ts +114 -0
- package/dist/svelte/VeloPlot.svelte +44 -0
- package/dist/svelte/VeloPlot.test.ts +105 -0
- package/dist/svelte/index.d.ts +11 -0
- package/dist/svelte/index.test.ts +20 -0
- package/dist/svelte/index.ts +15 -0
- package/dist/svelte/useChartSync.d.ts +8 -0
- package/dist/svelte/useChartSync.test.ts +49 -0
- package/dist/svelte/useChartSync.ts +29 -0
- package/dist/svelte/useIndicator.d.ts +13 -0
- package/dist/svelte/useIndicator.test.ts +67 -0
- package/dist/svelte/useIndicator.ts +43 -0
- package/dist/svelte/useStackedPlot.d.ts +16 -0
- package/dist/svelte/useStackedPlot.test.ts +76 -0
- package/dist/svelte/useStackedPlot.ts +54 -0
- package/dist/svelte/useVeloPlot.d.ts +21 -0
- package/dist/svelte/useVeloPlot.test.ts +100 -0
- package/dist/svelte/useVeloPlot.ts +81 -0
- package/dist/svelte.d.ts +1 -0
- package/dist/svelte.js +143 -0
- package/dist/svelte.js.map +1 -0
- package/dist/testing/index.d.ts +1 -1
- package/dist/theme/index.d.ts +2 -1
- package/dist/trading.js +6 -6
- package/dist/types.d.ts +1 -1
- package/dist/{utils-BK5UUXxj.js → utils-Dx0h0bgQ.js} +9 -9
- package/dist/{utils-BK5UUXxj.js.map → utils-Dx0h0bgQ.js.map} +1 -1
- package/dist/velo-plot.full.js +452 -443
- package/dist/velo-plot.full.js.map +1 -1
- package/dist/velo-plot.js +15 -15
- package/dist/vue/StackedPlot.vue.d.ts +48 -0
- package/dist/vue/VeloPlot.vue.d.ts +64 -0
- package/dist/vue/index.d.ts +250 -0
- package/dist/vue/useChartSync.d.ts +52 -0
- package/dist/vue/useIndicator.d.ts +23 -0
- package/dist/vue/useStackedPlot.d.ts +15 -0
- package/dist/vue/useVeloPlot.d.ts +20 -0
- package/dist/vue.d.ts +1 -0
- package/dist/vue.js +312 -0
- package/dist/vue.js.map +1 -0
- package/dist/workers/indicatorsAsync.d.ts +2 -0
- package/dist/workers/pool.d.ts +9 -0
- package/package.json +88 -10
- package/dist/ChartCore-ivzLqxVb.js.map +0 -1
- package/dist/SciPlot-CEU4ApgD.js +0 -463
- package/dist/SciPlot-CEU4ApgD.js.map +0 -1
- package/dist/createStackedChart-DxNW0VkF.js +0 -705
- package/dist/createStackedChart-DxNW0VkF.js.map +0 -1
- package/dist/index-BBpJwOct.js.map +0 -1
- package/dist/index-DoYxf1cV.js.map +0 -1
- package/dist/index.core-COREBDNq.js.map +0 -1
- package/dist/mockDatafeed-927foCM4.js.map +0 -1
- package/dist/pool-15HMCNv8.js +0 -88
- package/dist/pool-15HMCNv8.js.map +0 -1
- package/dist/react/SciPlot.d.ts +0 -60
- package/dist/react/useSciPlot.d.ts +0 -56
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Bounds } from '../../types';
|
|
2
|
+
import { VeloPlotSeries } from './types';
|
|
3
|
+
import { KeyBindingManager } from '../../core/keybindings';
|
|
4
|
+
|
|
5
|
+
export interface A11yOptions {
|
|
6
|
+
label?: string;
|
|
7
|
+
series?: VeloPlotSeries[];
|
|
8
|
+
bounds?: Bounds | null;
|
|
9
|
+
enableKeyboard?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface A11yHandle {
|
|
12
|
+
keyboard?: KeyBindingManager;
|
|
13
|
+
srTable?: HTMLTableElement;
|
|
14
|
+
cleanup: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function buildAriaLabel(series?: VeloPlotSeries[], bounds?: Bounds | null, customLabel?: string): string;
|
|
17
|
+
export declare function applyChartA11y(container: HTMLElement, chart: {
|
|
18
|
+
resetZoom?: () => void;
|
|
19
|
+
zoom?: (opts: {
|
|
20
|
+
x?: [number, number];
|
|
21
|
+
y?: [number, number];
|
|
22
|
+
}) => void;
|
|
23
|
+
pan?: (dx: number, dy: number) => void;
|
|
24
|
+
getViewBounds?: () => Bounds;
|
|
25
|
+
}, options?: A11yOptions): A11yHandle;
|
|
26
|
+
export declare function updateA11y(container: HTMLElement, srTable: HTMLTableElement | undefined, options: A11yOptions): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Chart } from '../../core/Chart';
|
|
2
|
+
import { ChartOptions, Bounds } from '../../types';
|
|
3
|
+
import { BindingChartOptions } from './types';
|
|
4
|
+
|
|
5
|
+
export type ChartBindingOptions = Omit<ChartOptions, "container"> & BindingChartOptions;
|
|
6
|
+
export interface ChartLifecycleHandle {
|
|
7
|
+
chart: Chart;
|
|
8
|
+
destroy: () => void;
|
|
9
|
+
getBounds: () => Bounds | null;
|
|
10
|
+
}
|
|
11
|
+
export interface ChartLifecycleCallbacks {
|
|
12
|
+
onBoundsChange?: (bounds: Bounds) => void;
|
|
13
|
+
onError?: (error: Error) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function createChartLifecycle(container: HTMLDivElement, options: ChartBindingOptions, callbacks?: ChartLifecycleCallbacks): ChartLifecycleHandle;
|
|
16
|
+
export declare function attachZoomListener(chart: Chart, onBoundsChange: (bounds: Bounds) => void): () => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChartGroup, ChartLike, SyncOptions } from '../../core/sync';
|
|
2
|
+
|
|
3
|
+
export interface ChartSyncHandle {
|
|
4
|
+
group: ChartGroup;
|
|
5
|
+
destroy: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function createChartSync(charts: ChartLike[], options?: SyncOptions): ChartSyncHandle;
|
|
8
|
+
export declare function updateChartSync(handle: ChartSyncHandle | null, charts: ChartLike[], options?: SyncOptions): ChartSyncHandle;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatBindingDimension(value: number | string): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './chartLifecycle';
|
|
3
|
+
export * from './seriesDiff';
|
|
4
|
+
export * from './optionsSync';
|
|
5
|
+
export * from './stackedSync';
|
|
6
|
+
export * from './indicatorBridge';
|
|
7
|
+
export * from './chartSyncBridge';
|
|
8
|
+
export * from './a11y';
|
|
9
|
+
export * from './dimensions';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Chart } from '../../core/chart/types';
|
|
2
|
+
import { StackedChart } from '../../core/stacked/types';
|
|
3
|
+
import { AddIndicatorOptions, AddIndicatorResult } from '../../core/indicator/addIndicator';
|
|
4
|
+
import { IndicatorPresetName } from '../../core/indicator/indicatorPresets';
|
|
5
|
+
|
|
6
|
+
export type IndicatorHost = Chart | StackedChart | null;
|
|
7
|
+
export declare function isStackedChart(host: IndicatorHost): host is StackedChart;
|
|
8
|
+
export declare function addIndicatorToHost(host: IndicatorHost, preset: IndicatorPresetName, options?: AddIndicatorOptions): Promise<AddIndicatorResult & {
|
|
9
|
+
paneId?: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function removeIndicatorFromChart(chart: Chart, rootId: string): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Chart } from '../../core/chart/types';
|
|
2
|
+
import { ChartOptions } from '../../types';
|
|
3
|
+
|
|
4
|
+
export type SyncableChartOptions = Omit<ChartOptions, "container">;
|
|
5
|
+
export declare function optionsChanged(prev: SyncableChartOptions, next: SyncableChartOptions): boolean;
|
|
6
|
+
export declare function syncChartOptions(chart: Chart, prev: SyncableChartOptions, next: SyncableChartOptions): void;
|
|
7
|
+
export declare function pickSyncableOptions(options: SyncableChartOptions): SyncableChartOptions;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SeriesOptions } from '../../types';
|
|
2
|
+
import { ChartSeriesActions, VeloPlotSeries } from './types';
|
|
3
|
+
|
|
4
|
+
export declare function veloPlotSeriesToOptions(series: VeloPlotSeries): SeriesOptions;
|
|
5
|
+
export declare function diffSeries(chart: ChartSeriesActions, current: VeloPlotSeries[], previous: Map<string, VeloPlotSeries>): Map<string, VeloPlotSeries>;
|
|
6
|
+
export declare function serializePaneIds(panes: {
|
|
7
|
+
id: string;
|
|
8
|
+
}[]): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StackedChart, StackedChartOptions, StackedPaneConfig } from '../../core/stacked/types';
|
|
2
|
+
import { VeloPlotSeries } from './types';
|
|
3
|
+
|
|
4
|
+
export type SyncableStackedOptions = Omit<StackedChartOptions, "container">;
|
|
5
|
+
export declare function stackedStructureKey(panes: StackedPaneConfig[]): string;
|
|
6
|
+
export declare function syncStackedTheme(stack: StackedChart, theme: StackedChartOptions["theme"]): void;
|
|
7
|
+
export declare function syncStackedSyncOptions(stack: StackedChart, sync: StackedChartOptions["sync"]): void;
|
|
8
|
+
export declare function syncStackedPaneSeries(stack: StackedChart, panes: StackedPaneConfig[], previousSeries: Map<string, Map<string, VeloPlotSeries>>): Map<string, Map<string, VeloPlotSeries>>;
|
|
9
|
+
export declare function syncStackedOptions(stack: StackedChart, options: SyncableStackedOptions): void;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { SeriesOptions, SeriesUpdateData, HeatmapData } from '../../types';
|
|
2
|
+
|
|
3
|
+
export type VeloPlotSeriesType = "line" | "candlestick" | "bar" | "heatmap";
|
|
4
|
+
export interface VeloPlotSeriesBase {
|
|
5
|
+
id: string;
|
|
6
|
+
type?: VeloPlotSeriesType;
|
|
7
|
+
color?: string;
|
|
8
|
+
width?: number;
|
|
9
|
+
visible?: boolean;
|
|
10
|
+
name?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface VeloPlotLineSeries extends VeloPlotSeriesBase {
|
|
13
|
+
type?: "line";
|
|
14
|
+
x: Float32Array | Float64Array;
|
|
15
|
+
y: Float32Array | Float64Array;
|
|
16
|
+
}
|
|
17
|
+
export interface VeloPlotCandlestickSeries extends VeloPlotSeriesBase {
|
|
18
|
+
type: "candlestick";
|
|
19
|
+
x: Float32Array | Float64Array;
|
|
20
|
+
open: Float32Array | Float64Array;
|
|
21
|
+
high: Float32Array | Float64Array;
|
|
22
|
+
low: Float32Array | Float64Array;
|
|
23
|
+
close: Float32Array | Float64Array;
|
|
24
|
+
}
|
|
25
|
+
export interface VeloPlotBarSeries extends VeloPlotSeriesBase {
|
|
26
|
+
type: "bar";
|
|
27
|
+
x: Float32Array | Float64Array;
|
|
28
|
+
y: Float32Array | Float64Array;
|
|
29
|
+
}
|
|
30
|
+
export interface VeloPlotHeatmapSeries extends VeloPlotSeriesBase {
|
|
31
|
+
type: "heatmap";
|
|
32
|
+
data: HeatmapData;
|
|
33
|
+
}
|
|
34
|
+
export type VeloPlotSeries = VeloPlotLineSeries | VeloPlotCandlestickSeries | VeloPlotBarSeries | VeloPlotHeatmapSeries;
|
|
35
|
+
export interface ChartSeriesActions {
|
|
36
|
+
addSeries: (options: SeriesOptions) => void;
|
|
37
|
+
updateSeries: (id: string, data: SeriesUpdateData) => void;
|
|
38
|
+
removeSeries: (id: string) => void;
|
|
39
|
+
autoScale?: () => void;
|
|
40
|
+
}
|
|
41
|
+
export interface BindingChartOptions {
|
|
42
|
+
autoResize?: boolean;
|
|
43
|
+
responsive?: boolean | {
|
|
44
|
+
reducedMotion?: boolean | "auto";
|
|
45
|
+
};
|
|
46
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { vi } from 'vitest';
|
|
2
|
+
import { Chart } from '../../core/chart/types';
|
|
3
|
+
|
|
4
|
+
export declare function createMockContainer(): HTMLDivElement;
|
|
5
|
+
export declare function sampleLineData(n?: number): {
|
|
6
|
+
x: Float32Array;
|
|
7
|
+
y: Float32Array;
|
|
8
|
+
};
|
|
9
|
+
export declare function sampleOhlcData(n?: number): {
|
|
10
|
+
x: Float32Array;
|
|
11
|
+
open: Float32Array;
|
|
12
|
+
high: Float32Array;
|
|
13
|
+
low: Float32Array;
|
|
14
|
+
close: Float32Array;
|
|
15
|
+
};
|
|
16
|
+
export declare function buildMockChart(id?: string): Chart & {
|
|
17
|
+
destroy: ReturnType<typeof vi.fn>;
|
|
18
|
+
addSeries: ReturnType<typeof vi.fn>;
|
|
19
|
+
updateSeries: ReturnType<typeof vi.fn>;
|
|
20
|
+
removeSeries: ReturnType<typeof vi.fn>;
|
|
21
|
+
on: ReturnType<typeof vi.fn>;
|
|
22
|
+
off: ReturnType<typeof vi.fn>;
|
|
23
|
+
zoom: ReturnType<typeof vi.fn>;
|
|
24
|
+
resetZoom: ReturnType<typeof vi.fn>;
|
|
25
|
+
autoScale: ReturnType<typeof vi.fn>;
|
|
26
|
+
enableCursor: ReturnType<typeof vi.fn>;
|
|
27
|
+
disableCursor: ReturnType<typeof vi.fn>;
|
|
28
|
+
setTheme: ReturnType<typeof vi.fn>;
|
|
29
|
+
updateXAxis: ReturnType<typeof vi.fn>;
|
|
30
|
+
updateYAxis: ReturnType<typeof vi.fn>;
|
|
31
|
+
resize: ReturnType<typeof vi.fn>;
|
|
32
|
+
getViewBounds: ReturnType<typeof vi.fn>;
|
|
33
|
+
getAllSeries: ReturnType<typeof vi.fn>;
|
|
34
|
+
};
|
|
35
|
+
export declare function expectDestroyCalled(destroyFn: ReturnType<typeof vi.fn>): void;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { vi } from 'vitest';
|
|
2
|
+
|
|
3
|
+
export declare function createMockChartLifecycle(): {
|
|
4
|
+
chart: import('../..').Chart & {
|
|
5
|
+
destroy: ReturnType<typeof vi.fn>;
|
|
6
|
+
addSeries: ReturnType<typeof vi.fn>;
|
|
7
|
+
updateSeries: ReturnType<typeof vi.fn>;
|
|
8
|
+
removeSeries: ReturnType<typeof vi.fn>;
|
|
9
|
+
on: ReturnType<typeof vi.fn>;
|
|
10
|
+
off: ReturnType<typeof vi.fn>;
|
|
11
|
+
zoom: ReturnType<typeof vi.fn>;
|
|
12
|
+
resetZoom: ReturnType<typeof vi.fn>;
|
|
13
|
+
autoScale: ReturnType<typeof vi.fn>;
|
|
14
|
+
enableCursor: ReturnType<typeof vi.fn>;
|
|
15
|
+
disableCursor: ReturnType<typeof vi.fn>;
|
|
16
|
+
setTheme: ReturnType<typeof vi.fn>;
|
|
17
|
+
updateXAxis: ReturnType<typeof vi.fn>;
|
|
18
|
+
updateYAxis: ReturnType<typeof vi.fn>;
|
|
19
|
+
resize: ReturnType<typeof vi.fn>;
|
|
20
|
+
getViewBounds: ReturnType<typeof vi.fn>;
|
|
21
|
+
getAllSeries: ReturnType<typeof vi.fn>;
|
|
22
|
+
};
|
|
23
|
+
destroy: import('vitest').Mock<(...args: any[]) => any>;
|
|
24
|
+
handle: {
|
|
25
|
+
chart: import('../..').Chart & {
|
|
26
|
+
destroy: ReturnType<typeof vi.fn>;
|
|
27
|
+
addSeries: ReturnType<typeof vi.fn>;
|
|
28
|
+
updateSeries: ReturnType<typeof vi.fn>;
|
|
29
|
+
removeSeries: ReturnType<typeof vi.fn>;
|
|
30
|
+
on: ReturnType<typeof vi.fn>;
|
|
31
|
+
off: ReturnType<typeof vi.fn>;
|
|
32
|
+
zoom: ReturnType<typeof vi.fn>;
|
|
33
|
+
resetZoom: ReturnType<typeof vi.fn>;
|
|
34
|
+
autoScale: ReturnType<typeof vi.fn>;
|
|
35
|
+
enableCursor: ReturnType<typeof vi.fn>;
|
|
36
|
+
disableCursor: ReturnType<typeof vi.fn>;
|
|
37
|
+
setTheme: ReturnType<typeof vi.fn>;
|
|
38
|
+
updateXAxis: ReturnType<typeof vi.fn>;
|
|
39
|
+
updateYAxis: ReturnType<typeof vi.fn>;
|
|
40
|
+
resize: ReturnType<typeof vi.fn>;
|
|
41
|
+
getViewBounds: ReturnType<typeof vi.fn>;
|
|
42
|
+
getAllSeries: ReturnType<typeof vi.fn>;
|
|
43
|
+
};
|
|
44
|
+
getBounds: () => import('../..').Bounds;
|
|
45
|
+
destroy: import('vitest').Mock<(...args: any[]) => any>;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export declare function mockChartLifecycleModule(): {
|
|
49
|
+
createChartLifecycle: import('vitest').Mock<() => {
|
|
50
|
+
chart: import('../..').Chart & {
|
|
51
|
+
destroy: ReturnType<typeof vi.fn>;
|
|
52
|
+
addSeries: ReturnType<typeof vi.fn>;
|
|
53
|
+
updateSeries: ReturnType<typeof vi.fn>;
|
|
54
|
+
removeSeries: ReturnType<typeof vi.fn>;
|
|
55
|
+
on: ReturnType<typeof vi.fn>;
|
|
56
|
+
off: ReturnType<typeof vi.fn>;
|
|
57
|
+
zoom: ReturnType<typeof vi.fn>;
|
|
58
|
+
resetZoom: ReturnType<typeof vi.fn>;
|
|
59
|
+
autoScale: ReturnType<typeof vi.fn>;
|
|
60
|
+
enableCursor: ReturnType<typeof vi.fn>;
|
|
61
|
+
disableCursor: ReturnType<typeof vi.fn>;
|
|
62
|
+
setTheme: ReturnType<typeof vi.fn>;
|
|
63
|
+
updateXAxis: ReturnType<typeof vi.fn>;
|
|
64
|
+
updateYAxis: ReturnType<typeof vi.fn>;
|
|
65
|
+
resize: ReturnType<typeof vi.fn>;
|
|
66
|
+
getViewBounds: ReturnType<typeof vi.fn>;
|
|
67
|
+
getAllSeries: ReturnType<typeof vi.fn>;
|
|
68
|
+
};
|
|
69
|
+
getBounds: () => import('../..').Bounds;
|
|
70
|
+
destroy: import('vitest').Mock<(...args: any[]) => any>;
|
|
71
|
+
}>;
|
|
72
|
+
pickSyncableOptions: (o: object) => object;
|
|
73
|
+
optionsChanged: () => boolean;
|
|
74
|
+
syncChartOptions: import('vitest').Mock<(...args: any[]) => any>;
|
|
75
|
+
lifecycle: {
|
|
76
|
+
chart: import('../..').Chart & {
|
|
77
|
+
destroy: ReturnType<typeof vi.fn>;
|
|
78
|
+
addSeries: ReturnType<typeof vi.fn>;
|
|
79
|
+
updateSeries: ReturnType<typeof vi.fn>;
|
|
80
|
+
removeSeries: ReturnType<typeof vi.fn>;
|
|
81
|
+
on: ReturnType<typeof vi.fn>;
|
|
82
|
+
off: ReturnType<typeof vi.fn>;
|
|
83
|
+
zoom: ReturnType<typeof vi.fn>;
|
|
84
|
+
resetZoom: ReturnType<typeof vi.fn>;
|
|
85
|
+
autoScale: ReturnType<typeof vi.fn>;
|
|
86
|
+
enableCursor: ReturnType<typeof vi.fn>;
|
|
87
|
+
disableCursor: ReturnType<typeof vi.fn>;
|
|
88
|
+
setTheme: ReturnType<typeof vi.fn>;
|
|
89
|
+
updateXAxis: ReturnType<typeof vi.fn>;
|
|
90
|
+
updateYAxis: ReturnType<typeof vi.fn>;
|
|
91
|
+
resize: ReturnType<typeof vi.fn>;
|
|
92
|
+
getViewBounds: ReturnType<typeof vi.fn>;
|
|
93
|
+
getAllSeries: ReturnType<typeof vi.fn>;
|
|
94
|
+
};
|
|
95
|
+
destroy: import('vitest').Mock<(...args: any[]) => any>;
|
|
96
|
+
handle: {
|
|
97
|
+
chart: import('../..').Chart & {
|
|
98
|
+
destroy: ReturnType<typeof vi.fn>;
|
|
99
|
+
addSeries: ReturnType<typeof vi.fn>;
|
|
100
|
+
updateSeries: ReturnType<typeof vi.fn>;
|
|
101
|
+
removeSeries: ReturnType<typeof vi.fn>;
|
|
102
|
+
on: ReturnType<typeof vi.fn>;
|
|
103
|
+
off: ReturnType<typeof vi.fn>;
|
|
104
|
+
zoom: ReturnType<typeof vi.fn>;
|
|
105
|
+
resetZoom: ReturnType<typeof vi.fn>;
|
|
106
|
+
autoScale: ReturnType<typeof vi.fn>;
|
|
107
|
+
enableCursor: ReturnType<typeof vi.fn>;
|
|
108
|
+
disableCursor: ReturnType<typeof vi.fn>;
|
|
109
|
+
setTheme: ReturnType<typeof vi.fn>;
|
|
110
|
+
updateXAxis: ReturnType<typeof vi.fn>;
|
|
111
|
+
updateYAxis: ReturnType<typeof vi.fn>;
|
|
112
|
+
resize: ReturnType<typeof vi.fn>;
|
|
113
|
+
getViewBounds: ReturnType<typeof vi.fn>;
|
|
114
|
+
getAllSeries: ReturnType<typeof vi.fn>;
|
|
115
|
+
};
|
|
116
|
+
getBounds: () => import('../..').Bounds;
|
|
117
|
+
destroy: import('vitest').Mock<(...args: any[]) => any>;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { c as a, k as d } from "./ChartCore-BpzRvN4Y.js";
|
|
2
|
+
import { c as u } from "./index-CaXWSOTk.js";
|
|
3
|
+
function c(e) {
|
|
4
|
+
const r = e.responsive ?? { reducedMotion: "auto" };
|
|
5
|
+
return { ...e, responsive: r };
|
|
6
|
+
}
|
|
7
|
+
function y(e, r, o = {}) {
|
|
8
|
+
const t = a({
|
|
9
|
+
...c(r),
|
|
10
|
+
container: e
|
|
11
|
+
}), i = () => {
|
|
12
|
+
var s;
|
|
13
|
+
(s = o.onBoundsChange) == null || s.call(o, t.getViewBounds());
|
|
14
|
+
};
|
|
15
|
+
t.on("zoom", i);
|
|
16
|
+
let n;
|
|
17
|
+
return r.autoResize !== !1 && (n = new ResizeObserver(() => {
|
|
18
|
+
t.resize();
|
|
19
|
+
}), n.observe(e)), {
|
|
20
|
+
chart: t,
|
|
21
|
+
getBounds: () => t.getViewBounds(),
|
|
22
|
+
destroy: () => {
|
|
23
|
+
n == null || n.disconnect(), t.off("zoom", i), t.destroy();
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function f(e) {
|
|
28
|
+
return e != null && "getPanes" in e && typeof e.getPanes == "function";
|
|
29
|
+
}
|
|
30
|
+
async function C(e, r, o = {}) {
|
|
31
|
+
if (!e)
|
|
32
|
+
throw new Error(
|
|
33
|
+
"[useIndicator] Chart is not ready. Wait for isReady before adding indicators."
|
|
34
|
+
);
|
|
35
|
+
return f(e) ? await e.addIndicator(r, o) : d(e, r, o);
|
|
36
|
+
}
|
|
37
|
+
function h(e, r) {
|
|
38
|
+
for (const o of [...e.getAllSeries()]) {
|
|
39
|
+
const t = o.getId();
|
|
40
|
+
(t === r || t.startsWith(`${r}-`)) && e.removeSeries(t);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function v(e, r) {
|
|
44
|
+
const o = u(e, r);
|
|
45
|
+
return {
|
|
46
|
+
group: o,
|
|
47
|
+
destroy: () => o.destroy()
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
C as a,
|
|
52
|
+
v as b,
|
|
53
|
+
y as c,
|
|
54
|
+
f as i,
|
|
55
|
+
h as r
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=chartSyncBridge-DbWrwtyP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chartSyncBridge-DbWrwtyP.js","sources":["../src/bindings/shared/chartLifecycle.ts","../src/bindings/shared/indicatorBridge.ts","../src/bindings/shared/chartSyncBridge.ts"],"sourcesContent":["/**\n * Framework-agnostic chart lifecycle helpers.\n */\n\nimport { createChart, type Chart } from \"../../core/Chart\";\nimport type { ChartOptions, Bounds } from \"../../types\";\nimport type { BindingChartOptions } from \"./types\";\n\nexport type ChartBindingOptions = Omit<ChartOptions, \"container\"> &\n BindingChartOptions;\n\nexport interface ChartLifecycleHandle {\n chart: Chart;\n destroy: () => void;\n getBounds: () => Bounds | null;\n}\n\nexport interface ChartLifecycleCallbacks {\n onBoundsChange?: (bounds: Bounds) => void;\n onError?: (error: Error) => void;\n}\n\nfunction defaultResponsive(\n options: ChartBindingOptions,\n): ChartBindingOptions {\n const responsive = options.responsive ?? { reducedMotion: \"auto\" as const };\n return { ...options, responsive };\n}\n\nexport function createChartLifecycle(\n container: HTMLDivElement,\n options: ChartBindingOptions,\n callbacks: ChartLifecycleCallbacks = {},\n): ChartLifecycleHandle {\n const chart = createChart({\n ...defaultResponsive(options),\n container,\n });\n\n const onZoom = () => {\n callbacks.onBoundsChange?.(chart.getViewBounds());\n };\n chart.on(\"zoom\", onZoom);\n\n let resizeObserver: ResizeObserver | undefined;\n if (options.autoResize !== false) {\n resizeObserver = new ResizeObserver(() => {\n chart.resize();\n });\n resizeObserver.observe(container);\n }\n\n return {\n chart,\n getBounds: () => chart.getViewBounds(),\n destroy: () => {\n resizeObserver?.disconnect();\n chart.off(\"zoom\", onZoom);\n chart.destroy();\n },\n };\n}\n\nexport function attachZoomListener(\n chart: Chart,\n onBoundsChange: (bounds: Bounds) => void,\n): () => void {\n const handler = () => onBoundsChange(chart.getViewBounds());\n chart.on(\"zoom\", handler);\n return () => chart.off(\"zoom\", handler);\n}\n","/**\n * Indicator bridge for framework bindings.\n */\n\nimport type { Chart } from \"../../core/chart/types\";\nimport type { StackedChart } from \"../../core/stacked/types\";\nimport {\n addIndicatorToChart,\n type AddIndicatorOptions,\n type AddIndicatorResult,\n} from \"../../core/indicator/addIndicator\";\nimport type { IndicatorPresetName } from \"../../core/indicator/indicatorPresets\";\n\nexport type IndicatorHost = Chart | StackedChart | null;\n\nexport function isStackedChart(host: IndicatorHost): host is StackedChart {\n return (\n host != null &&\n \"getPanes\" in host &&\n typeof (host as StackedChart).getPanes === \"function\"\n );\n}\n\nexport async function addIndicatorToHost(\n host: IndicatorHost,\n preset: IndicatorPresetName,\n options: AddIndicatorOptions = {},\n): Promise<AddIndicatorResult & { paneId?: string }> {\n if (!host) {\n throw new Error(\n \"[useIndicator] Chart is not ready. Wait for isReady before adding indicators.\",\n );\n }\n\n if (isStackedChart(host)) {\n const result = await host.addIndicator(preset, options);\n return result;\n }\n\n return addIndicatorToChart(host, preset, options);\n}\n\nexport function removeIndicatorFromChart(\n chart: Chart,\n rootId: string,\n): void {\n for (const s of [...chart.getAllSeries()]) {\n const sid = s.getId();\n if (sid === rootId || sid.startsWith(`${rootId}-`)) {\n chart.removeSeries(sid);\n }\n }\n}\n","/**\n * Chart sync bridge for framework bindings.\n */\n\nimport {\n ChartGroup,\n createChartGroup,\n type ChartLike,\n type SyncOptions,\n} from \"../../core/sync\";\n\nexport interface ChartSyncHandle {\n group: ChartGroup;\n destroy: () => void;\n}\n\nexport function createChartSync(\n charts: ChartLike[],\n options?: SyncOptions,\n): ChartSyncHandle {\n const group = createChartGroup(charts, options);\n return {\n group,\n destroy: () => group.destroy(),\n };\n}\n\nexport function updateChartSync(\n handle: ChartSyncHandle | null,\n charts: ChartLike[],\n options?: SyncOptions,\n): ChartSyncHandle {\n handle?.destroy();\n if (charts.length < 2) {\n return { group: new ChartGroup(options), destroy: () => {} };\n }\n return createChartSync(charts, options);\n}\n"],"names":["defaultResponsive","options","responsive","createChartLifecycle","container","callbacks","chart","createChart","onZoom","_a","resizeObserver","isStackedChart","host","addIndicatorToHost","preset","addIndicatorToChart","removeIndicatorFromChart","rootId","s","sid","createChartSync","charts","group","createChartGroup"],"mappings":";;AAsBA,SAASA,EACPC,GACqB;AACrB,QAAMC,IAAaD,EAAQ,cAAc,EAAE,eAAe,OAAA;AAC1D,SAAO,EAAE,GAAGA,GAAS,YAAAC,EAAA;AACvB;AAEO,SAASC,EACdC,GACAH,GACAI,IAAqC,CAAA,GACf;AACtB,QAAMC,IAAQC,EAAY;AAAA,IACxB,GAAGP,EAAkBC,CAAO;AAAA,IAC5B,WAAAG;AAAA,EAAA,CACD,GAEKI,IAAS,MAAM;;AACnB,KAAAC,IAAAJ,EAAU,mBAAV,QAAAI,EAAA,KAAAJ,GAA2BC,EAAM;EACnC;AACA,EAAAA,EAAM,GAAG,QAAQE,CAAM;AAEvB,MAAIE;AACJ,SAAIT,EAAQ,eAAe,OACzBS,IAAiB,IAAI,eAAe,MAAM;AACxC,IAAAJ,EAAM,OAAA;AAAA,EACR,CAAC,GACDI,EAAe,QAAQN,CAAS,IAG3B;AAAA,IACL,OAAAE;AAAA,IACA,WAAW,MAAMA,EAAM,cAAA;AAAA,IACvB,SAAS,MAAM;AACb,MAAAI,KAAA,QAAAA,EAAgB,cAChBJ,EAAM,IAAI,QAAQE,CAAM,GACxBF,EAAM,QAAA;AAAA,IACR;AAAA,EAAA;AAEJ;AC9CO,SAASK,EAAeC,GAA2C;AACxE,SACEA,KAAQ,QACR,cAAcA,KACd,OAAQA,EAAsB,YAAa;AAE/C;AAEA,eAAsBC,EACpBD,GACAE,GACAb,IAA+B,CAAA,GACoB;AACnD,MAAI,CAACW;AACH,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAIJ,SAAID,EAAeC,CAAI,IACN,MAAMA,EAAK,aAAaE,GAAQb,CAAO,IAIjDc,EAAoBH,GAAME,GAAQb,CAAO;AAClD;AAEO,SAASe,EACdV,GACAW,GACM;AACN,aAAWC,KAAK,CAAC,GAAGZ,EAAM,aAAA,CAAc,GAAG;AACzC,UAAMa,IAAMD,EAAE,MAAA;AACd,KAAIC,MAAQF,KAAUE,EAAI,WAAW,GAAGF,CAAM,GAAG,MAC/CX,EAAM,aAAaa,CAAG;AAAA,EAE1B;AACF;ACpCO,SAASC,EACdC,GACApB,GACiB;AACjB,QAAMqB,IAAQC,EAAiBF,GAAQpB,CAAO;AAC9C,SAAO;AAAA,IACL,OAAAqB;AAAA,IACA,SAAS,MAAMA,EAAM,QAAA;AAAA,EAAQ;AAEjC;"}
|
package/dist/core/Chart.d.ts
CHANGED
|
@@ -29,6 +29,8 @@ export interface InteractionCallbacks {
|
|
|
29
29
|
onDragStart?: () => void;
|
|
30
30
|
/** Called when any drag operation ends */
|
|
31
31
|
onDragEnd?: () => void;
|
|
32
|
+
/** Called on double-tap (mobile reset zoom) */
|
|
33
|
+
onDoubleTap?: () => void;
|
|
32
34
|
/** Called for all raw interaction events for plugin processing */
|
|
33
35
|
onInteraction?: (event: import('../plugins/types').InteractionEvent) => void;
|
|
34
36
|
}
|
|
@@ -61,6 +63,10 @@ export declare class InteractionManager {
|
|
|
61
63
|
private lastMousePos;
|
|
62
64
|
private mouseDownPos;
|
|
63
65
|
private mode;
|
|
66
|
+
private pinchStartDistance;
|
|
67
|
+
private pinchStartBounds;
|
|
68
|
+
private lastTapTime;
|
|
69
|
+
private readonly doubleTapMs;
|
|
64
70
|
private boundWheel;
|
|
65
71
|
private boundMouseDown;
|
|
66
72
|
private boundMouseMove;
|
|
@@ -74,7 +80,7 @@ export declare class InteractionManager {
|
|
|
74
80
|
private detachListeners;
|
|
75
81
|
/**
|
|
76
82
|
* Set the interaction mode
|
|
77
|
-
* @deprecated Use setMode instead
|
|
83
|
+
* @deprecated Use setMode instead. **Removed in v4.0.**
|
|
78
84
|
*/
|
|
79
85
|
setPanMode(enabled: boolean): void;
|
|
80
86
|
/**
|
|
@@ -15,6 +15,11 @@ export declare class OverlayRenderer {
|
|
|
15
15
|
/** Filter X ticks to valid business-day indices (unique integers in range). */
|
|
16
16
|
private filterBusinessDayXTicks;
|
|
17
17
|
private resolveXTicks;
|
|
18
|
+
/**
|
|
19
|
+
* Grid X lines use the full viewport domain (nice even spacing), including
|
|
20
|
+
* regions past the loaded series. Axis labels stay filtered to real data.
|
|
21
|
+
*/
|
|
22
|
+
private resolveGridXTicks;
|
|
18
23
|
/**
|
|
19
24
|
* Set LaTeX API for rendering mathematical expressions
|
|
20
25
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Annotation Types
|
|
3
3
|
*
|
|
4
|
-
* Type definitions for all annotation types supported by
|
|
4
|
+
* Type definitions for all annotation types supported by Velo Plot.
|
|
5
5
|
*/
|
|
6
6
|
export type AnnotationType = 'horizontal-line' | 'vertical-line' | 'rectangle' | 'band' | 'text' | 'arrow';
|
|
7
7
|
export interface BaseAnnotation {
|
|
@@ -308,7 +308,7 @@ export declare class ChartImpl implements Chart {
|
|
|
308
308
|
configureSelection(config: Partial<SelectionConfig>): void;
|
|
309
309
|
/**
|
|
310
310
|
* Set pan mode (true = pan, false = selection)
|
|
311
|
-
* @deprecated Use setMode('pan') or setMode('select') instead
|
|
311
|
+
* @deprecated Use setMode('pan') or setMode('select') instead. **Removed in v4.0.**
|
|
312
312
|
*/
|
|
313
313
|
setPanMode(enabled: boolean): void;
|
|
314
314
|
/**
|
|
@@ -365,7 +365,7 @@ export declare class ChartImpl implements Chart {
|
|
|
365
365
|
* Suspend canvas backing-store resize (inactive panes during stacked drag).
|
|
366
366
|
*/
|
|
367
367
|
setResizeSuspended(suspended: boolean): void;
|
|
368
|
-
/** @deprecated Use CSS transform on pane wrapper during drag; canvas stays untouched. */
|
|
368
|
+
/** @deprecated Use CSS transform on pane wrapper during drag; canvas stays untouched. **Removed in v4.0.** */
|
|
369
369
|
syncDragLayout(width?: number, height?: number): void;
|
|
370
370
|
isResizeSuspended(): boolean;
|
|
371
371
|
resize(): void;
|
|
@@ -144,7 +144,7 @@ export interface Chart {
|
|
|
144
144
|
configureSelection(config: any): void;
|
|
145
145
|
/**
|
|
146
146
|
* Set pan mode (true = pan, false = selection)
|
|
147
|
-
* @deprecated Use setMode('pan') or setMode('select') instead
|
|
147
|
+
* @deprecated Use setMode('pan') or setMode('select') instead. **Removed in v4.0.**
|
|
148
148
|
*/
|
|
149
149
|
setPanMode(enabled: boolean): void;
|
|
150
150
|
/**
|
|
@@ -14,6 +14,9 @@ export interface PaneResizeOptions {
|
|
|
14
14
|
onDragMove?: (sizesPx: number[], leadingIdx: number, trailingIdx: number) => void;
|
|
15
15
|
onDragEnd?: (finalSizesPx: number[]) => void;
|
|
16
16
|
}
|
|
17
|
+
export declare function injectDividerStyles(direction: StackDirection): void;
|
|
18
|
+
export declare function measurePaneSizes(paneWrappers: HTMLDivElement[], isHorizontal: boolean): number[];
|
|
19
|
+
export declare function resolveDragStartSizes(onDragStart: PaneResizeOptions["onDragStart"], leadingIdx: number, trailingIdx: number, paneWrappers: HTMLDivElement[], isHorizontal: boolean): number[];
|
|
17
20
|
export interface PaneResizeController {
|
|
18
21
|
dividers: HTMLDivElement[];
|
|
19
22
|
destroy: () => void;
|
|
@@ -37,6 +37,12 @@ export interface StackedChartOptions {
|
|
|
37
37
|
sharedXAxis?: "bottom" | "none";
|
|
38
38
|
/** Shared Y axis on left pane only (horizontal layout) */
|
|
39
39
|
sharedYAxis?: "left" | "none";
|
|
40
|
+
/**
|
|
41
|
+
* Shared X-axis defaults applied to every pane (e.g. `type: 'time'`, timeScale).
|
|
42
|
+
* Per-pane `chart.xAxis` overrides these. Visibility (labels/ticks/line) is still
|
|
43
|
+
* controlled by `sharedXAxis` / `showXAxis`.
|
|
44
|
+
*/
|
|
45
|
+
xAxis?: Omit<NonNullable<RootChartOptions["xAxis"]>, "showLabels" | "showTicks" | "showLine">;
|
|
40
46
|
/** Shared theme applied to every pane */
|
|
41
47
|
theme?: string | object;
|
|
42
48
|
devicePixelRatio?: number;
|
|
@@ -64,6 +70,10 @@ export interface StackedChartOptions {
|
|
|
64
70
|
export interface StackedChart {
|
|
65
71
|
readonly container: HTMLDivElement;
|
|
66
72
|
getPane(id: string): Chart | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* @deprecated Prefer `getPane(id)`. Alias kept for docs / Trading Experience. **Removed in v4.0.**
|
|
75
|
+
*/
|
|
76
|
+
getChart(id: string): Chart | undefined;
|
|
67
77
|
getPanes(): Chart[];
|
|
68
78
|
getMaster(): Chart;
|
|
69
79
|
getGroup(): ChartGroup;
|