velo-plot 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/README.md +22 -15
  2. package/dist/ChartCore-AnR_3Xkb.js +7338 -0
  3. package/dist/ChartCore-AnR_3Xkb.js.map +1 -0
  4. package/dist/GpuChartRenderer-Dxc0hrQA.js +75 -0
  5. package/dist/GpuChartRenderer-Dxc0hrQA.js.map +1 -0
  6. package/dist/{index.core-BmZe2jRQ.js → PluginRegistry-CzMHebYP.js} +19 -33
  7. package/dist/PluginRegistry-CzMHebYP.js.map +1 -0
  8. package/dist/angular-hooks.js +1 -1
  9. package/dist/angular.js +8 -8
  10. package/dist/{axisFormat-CzumxpCL.js → axisFormat-Sz4WIJfQ.js} +2 -2
  11. package/dist/{axisFormat-CzumxpCL.js.map → axisFormat-Sz4WIJfQ.js.map} +1 -1
  12. package/dist/{chartSyncBridge-DbWrwtyP.js → chartSyncBridge-D_rCtbFq.js} +12 -11
  13. package/dist/{chartSyncBridge-DbWrwtyP.js.map → chartSyncBridge-D_rCtbFq.js.map} +1 -1
  14. package/dist/core/ChartStatistics.d.ts +1 -1
  15. package/dist/core/chart/ChartCore.d.ts +12 -17
  16. package/dist/core/chart/ChartFeatureHooks.d.ts +7 -0
  17. package/dist/core/chart/chartExportPatch.d.ts +2 -0
  18. package/dist/core/chart/overlaySeriesRegistry.d.ts +7 -0
  19. package/dist/core/chart/series/SeriesActions.d.ts +1 -0
  20. package/dist/core/chart/series/SeriesBufferLite.d.ts +13 -0
  21. package/dist/core/chart/series/seriesOptionsRegistry.d.ts +8 -0
  22. package/dist/core/chart/series/seriesTypeRegistry.d.ts +5 -0
  23. package/dist/createStackedChart-DqcLCFGS.js +1338 -0
  24. package/dist/createStackedChart-DqcLCFGS.js.map +1 -0
  25. package/dist/{hooks-CYPCxoZx.js → hooks-DH-3bewj.js} +7 -7
  26. package/dist/{hooks-CYPCxoZx.js.map → hooks-DH-3bewj.js.map} +1 -1
  27. package/dist/{index-qunX30Xu.js → index-B7PTX94B.js} +2133 -2133
  28. package/dist/index-B7PTX94B.js.map +1 -0
  29. package/dist/{index-BMiZoKmm.js → index-BgrvqltV.js} +67 -67
  30. package/dist/index-BgrvqltV.js.map +1 -0
  31. package/dist/index-Cv6ZDLWf.js +521 -0
  32. package/dist/index-Cv6ZDLWf.js.map +1 -0
  33. package/dist/index-qhscKTDy.js.map +1 -1
  34. package/dist/index.core.d.ts +8 -6
  35. package/dist/index.d.ts +1 -14
  36. package/dist/plugins/3d.js +3 -1
  37. package/dist/plugins/3d.js.map +1 -1
  38. package/dist/plugins/analysis.js.map +1 -1
  39. package/dist/plugins/createPlugin.d.ts +8 -0
  40. package/dist/plugins/debug.js +32 -32
  41. package/dist/plugins/debug.js.map +1 -1
  42. package/dist/plugins/gpu.js +2033 -209
  43. package/dist/plugins/gpu.js.map +1 -1
  44. package/dist/plugins/i18n.js +286 -23
  45. package/dist/plugins/i18n.js.map +1 -1
  46. package/dist/plugins/latex.js +766 -207
  47. package/dist/plugins/latex.js.map +1 -1
  48. package/dist/plugins/loading/index.d.ts +1 -2
  49. package/dist/plugins/loading.js +3 -4
  50. package/dist/plugins/offscreen.js +11 -10
  51. package/dist/plugins/offscreen.js.map +1 -1
  52. package/dist/plugins/regression.js +254 -256
  53. package/dist/plugins/regression.js.map +1 -1
  54. package/dist/plugins/streaming.js +1 -1
  55. package/dist/plugins/tools.js +1 -1
  56. package/dist/react.js +55 -58
  57. package/dist/react.js.map +1 -1
  58. package/dist/renderer/NativeWebGLRenderer.d.ts +2 -1
  59. package/dist/renderer/native/NativeWebGLRenderer.d.ts +5 -1
  60. package/dist/renderer/native/draw.d.ts +2 -47
  61. package/dist/renderer/native/drawCore.d.ts +27 -0
  62. package/dist/renderer/native/drawExtended.d.ts +29 -0
  63. package/dist/renderer/native/frameRenderExtended.d.ts +1 -0
  64. package/dist/renderer/native/frameRenderRegistry.d.ts +27 -0
  65. package/dist/renderer/native/programFactoryCore.d.ts +6 -0
  66. package/dist/renderer/native/programFactoryExtended.d.ts +4 -0
  67. package/dist/renderer/native/utils.d.ts +3 -29
  68. package/dist/renderer/native/utilsCore.d.ts +14 -0
  69. package/dist/renderer/native/utilsExtended.d.ts +17 -0
  70. package/dist/renderer/overlaySeriesExtended.d.ts +1 -0
  71. package/dist/renderer/registerExtendedSeries.d.ts +1 -0
  72. package/dist/renderer/registerWebGPU.d.ts +2 -0
  73. package/dist/renderer/seriesBufferExtended.d.ts +4 -0
  74. package/dist/scientific/index.d.ts +1 -5
  75. package/dist/scientific/registerScientific.d.ts +1 -0
  76. package/dist/scientific.js +41 -41
  77. package/dist/solid.js +56 -59
  78. package/dist/solid.js.map +1 -1
  79. package/dist/svelte.js +26 -29
  80. package/dist/svelte.js.map +1 -1
  81. package/dist/trading/index.d.ts +1 -4
  82. package/dist/trading/registerTrading.d.ts +3 -0
  83. package/dist/trading.js +42 -42
  84. package/dist/types.d.ts +3 -3
  85. package/dist/velo-plot.full.js +2212 -1351
  86. package/dist/velo-plot.full.js.map +1 -1
  87. package/dist/velo-plot.js +33 -28
  88. package/dist/velo-plot.js.map +1 -1
  89. package/dist/vue/index.d.ts +2 -2
  90. package/dist/vue.js +17 -20
  91. package/dist/vue.js.map +1 -1
  92. package/package.json +9 -1
  93. package/dist/ChartCore-BpzRvN4Y.js +0 -8467
  94. package/dist/ChartCore-BpzRvN4Y.js.map +0 -1
  95. package/dist/createStackedChart-Dm-YqUT7.js +0 -756
  96. package/dist/createStackedChart-Dm-YqUT7.js.map +0 -1
  97. package/dist/gpuRenderer-BpaMYz-k.js +0 -1848
  98. package/dist/gpuRenderer-BpaMYz-k.js.map +0 -1
  99. package/dist/index-BMiZoKmm.js.map +0 -1
  100. package/dist/index-qunX30Xu.js.map +0 -1
  101. package/dist/index-x4stH3jD.js +0 -282
  102. package/dist/index-x4stH3jD.js.map +0 -1
  103. package/dist/index.core-BmZe2jRQ.js.map +0 -1
  104. package/dist/mockDatafeed-DHIDPcpX.js +0 -515
  105. package/dist/mockDatafeed-DHIDPcpX.js.map +0 -1
  106. package/dist/symbols-DT0eLlpW.js +0 -568
  107. package/dist/symbols-DT0eLlpW.js.map +0 -1
package/dist/react.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"react.js","sources":["../src/react/useVeloPlot.ts","../src/react/VeloPlot.tsx","../src/react/useStackedPlot.ts","../src/react/StackedPlot.tsx","../src/react/useIndicator.ts","../src/react/useChartSync.ts","../src/react/index.ts"],"sourcesContent":["/**\n * useVeloPlot - React hook for Velo Plot\n */\n\nimport {\n useEffect,\n useRef,\n useState,\n useCallback,\n type RefObject,\n} from \"react\";\nimport type { Chart } from \"../core/Chart\";\nimport type {\n SeriesOptions,\n SeriesUpdateData,\n ZoomOptions,\n Bounds,\n} from \"../types\";\nimport {\n createChartLifecycle,\n type ChartBindingOptions,\n optionsChanged,\n syncChartOptions,\n pickSyncableOptions,\n} from \"../bindings/shared\";\n\nexport interface UseVeloPlotOptions extends ChartBindingOptions {}\n\nexport interface UseVeloPlotReturn {\n chart: Chart | null;\n isReady: boolean;\n error: Error | null;\n bounds: Bounds | null;\n addSeries: (options: SeriesOptions) => void;\n updateSeries: (id: string, data: SeriesUpdateData) => void;\n removeSeries: (id: string) => void;\n zoom: (options: ZoomOptions) => void;\n resetZoom: () => void;\n}\n\nexport function useVeloPlot(\n containerRef: RefObject<HTMLDivElement>,\n options: UseVeloPlotOptions = {},\n): UseVeloPlotReturn {\n const [chart, setChart] = useState<Chart | null>(null);\n const [isReady, setIsReady] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const [bounds, setBounds] = useState<Bounds | null>(null);\n\n const chartRef = useRef<Chart | null>(null);\n const destroyRef = useRef<(() => void) | null>(null);\n const optionsRef = useRef(options);\n const prevSyncOptionsRef = useRef(pickSyncableOptions(options));\n optionsRef.current = options;\n\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n\n try {\n const handle = createChartLifecycle(\n container,\n optionsRef.current,\n {\n onBoundsChange: setBounds,\n onError: setError,\n },\n );\n chartRef.current = handle.chart;\n destroyRef.current = handle.destroy;\n setChart(handle.chart);\n setIsReady(true);\n setBounds(handle.getBounds());\n setError(null);\n prevSyncOptionsRef.current = pickSyncableOptions(optionsRef.current);\n } catch (err) {\n console.error(\"[useVeloPlot] Failed to initialize chart:\", err);\n setError(err instanceof Error ? err : new Error(String(err)));\n setIsReady(false);\n }\n\n return () => {\n destroyRef.current?.();\n destroyRef.current = null;\n chartRef.current = null;\n setChart(null);\n setIsReady(false);\n };\n }, [containerRef]);\n\n useEffect(() => {\n const currentChart = chartRef.current;\n if (!currentChart || !isReady) return;\n\n const next = pickSyncableOptions(options);\n const prev = prevSyncOptionsRef.current;\n if (optionsChanged(prev, next)) {\n syncChartOptions(currentChart, prev, next);\n prevSyncOptionsRef.current = next;\n }\n });\n\n const addSeries = useCallback((seriesOptions: SeriesOptions) => {\n const c = chartRef.current;\n if (c) {\n c.addSeries(seriesOptions);\n setBounds(c.getViewBounds());\n }\n }, []);\n\n const updateSeries = useCallback((id: string, data: SeriesUpdateData) => {\n chartRef.current?.updateSeries(id, data);\n }, []);\n\n const removeSeries = useCallback((id: string) => {\n chartRef.current?.removeSeries(id);\n }, []);\n\n const zoom = useCallback((zoomOptions: ZoomOptions) => {\n chartRef.current?.zoom(zoomOptions);\n }, []);\n\n const resetZoom = useCallback(() => {\n const c = chartRef.current;\n if (c) {\n c.resetZoom();\n setBounds(c.getViewBounds());\n }\n }, []);\n\n return {\n chart,\n isReady,\n error,\n bounds,\n addSeries,\n updateSeries,\n removeSeries,\n zoom,\n resetZoom,\n };\n}\n","/**\n * VeloPlot - React Component for Scientific Charts\n */\n\nimport {\n useRef,\n useEffect,\n useImperativeHandle,\n forwardRef,\n useMemo,\n type CSSProperties,\n} from \"react\";\nimport { useVeloPlot, type UseVeloPlotOptions } from \"./useVeloPlot\";\nimport type { ZoomOptions, CursorOptions, Bounds } from \"../types\";\nimport type { Chart } from \"../core/Chart\";\nimport {\n diffSeries,\n applyChartA11y,\n updateA11y,\n type VeloPlotSeries,\n} from \"../bindings/shared\";\n\nexport type { VeloPlotSeries } from \"../bindings/shared\";\n\nexport interface VeloPlotProps extends UseVeloPlotOptions {\n series?: VeloPlotSeries[];\n zoom?: ZoomOptions;\n onZoomChange?: (bounds: Bounds) => void;\n cursor?: CursorOptions;\n width?: number | string;\n height?: number | string;\n className?: string;\n style?: CSSProperties;\n debug?: boolean;\n /** Custom aria-label for accessibility */\n ariaLabel?: string;\n /** Enable keyboard navigation (default: true) */\n keyboardNav?: boolean;\n}\n\nexport interface VeloPlotRef {\n getChart: () => Chart | null;\n resetZoom: () => void;\n getBounds: () => Bounds | null;\n}\n\nexport const VeloPlot = forwardRef<VeloPlotRef, VeloPlotProps>(\n function VeloPlot(\n {\n series = [],\n zoom: zoomProp,\n onZoomChange,\n cursor,\n width = \"100%\",\n height = 400,\n className = \"\",\n style = {},\n debug = false,\n ariaLabel,\n keyboardNav = true,\n ...chartOptions\n },\n ref,\n ) {\n const containerRef = useRef<HTMLDivElement>(null);\n const previousSeriesRef = useRef<Map<string, VeloPlotSeries>>(new Map());\n const a11yRef = useRef<ReturnType<typeof applyChartA11y> | null>(null);\n\n const {\n chart,\n isReady,\n bounds,\n addSeries,\n updateSeries,\n removeSeries,\n resetZoom,\n } = useVeloPlot(containerRef, chartOptions);\n\n useImperativeHandle(\n ref,\n () => ({\n getChart: () => chart,\n resetZoom,\n getBounds: () => bounds,\n }),\n [chart, resetZoom, bounds],\n );\n\n useEffect(() => {\n if (!isReady || !chart) return;\n previousSeriesRef.current = diffSeries(\n { addSeries, updateSeries, removeSeries, autoScale: () => chart.autoScale() },\n series,\n previousSeriesRef.current,\n );\n }, [series, isReady, chart, addSeries, updateSeries, removeSeries]);\n\n useEffect(() => {\n if (!isReady || !chart || !zoomProp) return;\n chart.zoom(zoomProp);\n }, [isReady, chart, zoomProp]);\n\n useEffect(() => {\n if (!isReady || !chart || !onZoomChange) return;\n const handler = (event: { x: [number, number]; y: [number, number] }) => {\n onZoomChange({\n xMin: event.x[0],\n xMax: event.x[1],\n yMin: event.y[0],\n yMax: event.y[1],\n });\n };\n chart.on(\"zoom\", handler);\n return () => chart.off(\"zoom\", handler);\n }, [isReady, chart, onZoomChange]);\n\n useEffect(() => {\n if (!isReady || !chart) return;\n if (cursor?.enabled) {\n chart.enableCursor(cursor);\n } else {\n chart.disableCursor();\n }\n }, [isReady, chart, cursor]);\n\n useEffect(() => {\n const el = containerRef.current;\n if (!isReady || !chart || !el) return;\n\n a11yRef.current = applyChartA11y(el, chart, {\n label: ariaLabel,\n series,\n bounds,\n enableKeyboard: keyboardNav,\n });\n\n return () => {\n a11yRef.current?.cleanup();\n a11yRef.current = null;\n };\n }, [isReady, chart, keyboardNav, ariaLabel]);\n\n useEffect(() => {\n const el = containerRef.current;\n if (!el || !a11yRef.current) return;\n updateA11y(el, a11yRef.current.srTable, {\n label: ariaLabel,\n series,\n bounds,\n });\n }, [series, bounds, ariaLabel]);\n\n const containerStyle = useMemo<CSSProperties>(\n () => ({\n position: \"relative\",\n width: typeof width === \"number\" ? `${width}px` : width,\n height: typeof height === \"number\" ? `${height}px` : height,\n outline: \"none\",\n ...style,\n }),\n [width, height, style],\n );\n\n return (\n <div\n ref={containerRef}\n className={`velo-plot-container ${className}`}\n style={containerStyle}\n >\n {debug && bounds && (\n <div\n style={{\n position: \"absolute\",\n top: 8,\n right: 8,\n background: \"rgba(0,0,0,0.7)\",\n color: \"#0f0\",\n padding: \"4px 8px\",\n borderRadius: 4,\n fontSize: 11,\n fontFamily: \"monospace\",\n pointerEvents: \"none\",\n }}\n >\n <div>\n X: [{bounds.xMin.toFixed(3)}, {bounds.xMax.toFixed(3)}]\n </div>\n <div>\n Y: [{bounds.yMin.toExponential(2)}, {bounds.yMax.toExponential(2)}]\n </div>\n <div>Series: {series.length}</div>\n </div>\n )}\n </div>\n );\n },\n);\n\nexport default VeloPlot;\n","/**\n * useStackedPlot - React hook for multi-pane stacked charts\n */\n\nimport {\n useEffect,\n useRef,\n useState,\n useCallback,\n type RefObject,\n} from \"react\";\nimport { createStackedChart } from \"../core/stacked\";\nimport type { StackedChart, StackedChartOptions } from \"../core/stacked\";\nimport type { Range } from \"../types\";\nimport {\n stackedStructureKey,\n syncStackedOptions,\n syncStackedPaneSeries,\n} from \"../bindings/shared\";\nimport type { VeloPlotSeries } from \"../bindings/shared\";\n\nexport interface UseStackedPlotOptions\n extends Omit<StackedChartOptions, \"container\"> {}\n\nexport interface UseStackedPlotReturn {\n containerRef: RefObject<HTMLDivElement>;\n stack: StackedChart | null;\n isReady: boolean;\n fitAll: (options?: { x?: Range; padding?: number }) => void;\n resetAll: () => void;\n}\n\nexport function useStackedPlot(\n options: UseStackedPlotOptions,\n): UseStackedPlotReturn {\n const containerRef = useRef<HTMLDivElement>(null);\n const stackRef = useRef<StackedChart | null>(null);\n const destroyRef = useRef<(() => void) | null>(null);\n const [stack, setStack] = useState<StackedChart | null>(null);\n const [isReady, setIsReady] = useState(false);\n\n const optionsRef = useRef(options);\n const structureKeyRef = useRef(stackedStructureKey(options.panes));\n const paneSeriesRef = useRef(new Map<string, Map<string, VeloPlotSeries>>());\n optionsRef.current = options;\n\n const mountStack = useCallback(() => {\n const el = containerRef.current;\n if (!el) return;\n\n destroyRef.current?.();\n const created = createStackedChart({\n ...optionsRef.current,\n container: el,\n });\n stackRef.current = created;\n destroyRef.current = () => {\n created.destroy();\n stackRef.current = null;\n };\n setStack(created);\n structureKeyRef.current = stackedStructureKey(optionsRef.current.panes);\n paneSeriesRef.current = syncStackedPaneSeries(\n created,\n optionsRef.current.panes,\n new Map(),\n );\n\n created.whenReady().then(() => setIsReady(true));\n }, []);\n\n useEffect(() => {\n mountStack();\n return () => {\n setIsReady(false);\n destroyRef.current?.();\n destroyRef.current = null;\n setStack(null);\n };\n }, [mountStack]);\n\n useEffect(() => {\n const current = stackRef.current;\n if (!current || !isReady) return;\n\n const nextKey = stackedStructureKey(options.panes);\n if (nextKey !== structureKeyRef.current) {\n mountStack();\n return;\n }\n\n syncStackedOptions(current, options);\n paneSeriesRef.current = syncStackedPaneSeries(\n current,\n options.panes,\n paneSeriesRef.current,\n );\n });\n\n const fitAll = useCallback((opts?: { x?: Range; padding?: number }) => {\n stackRef.current?.fitAll(opts);\n }, []);\n\n const resetAll = useCallback(() => {\n stackRef.current?.resetAll();\n }, []);\n\n return { containerRef, stack, isReady, fitAll, resetAll };\n}\n","/**\n * StackedPlot - Declarative React component for multi-pane charts\n */\n\nimport {\n forwardRef,\n useImperativeHandle,\n useMemo,\n type CSSProperties,\n} from \"react\";\nimport { useStackedPlot, type UseStackedPlotOptions } from \"./useStackedPlot\";\nimport type { StackedChart } from \"../core/stacked\";\nimport type { Bounds } from \"../types\";\nimport type { AddIndicatorOptions } from \"../core/indicator/addIndicator\";\nimport type { IndicatorPresetName } from \"../core/indicator/indicatorPresets\";\n\nexport interface StackedPlotIndicator extends AddIndicatorOptions {\n type: IndicatorPresetName;\n}\n\nexport interface StackedPlotProps extends UseStackedPlotOptions {\n width?: number | string;\n height?: number | string;\n className?: string;\n style?: CSSProperties;\n indicators?: StackedPlotIndicator[];\n onCrosshairMove?: (event: { price?: number; x: number }) => void;\n drawingTools?: string[];\n ariaLabel?: string;\n}\n\nexport interface StackedPlotRef {\n getStack: () => StackedChart | null;\n fitAll: () => void;\n resetAll: () => void;\n getBounds: () => Bounds | null;\n}\n\nexport const StackedPlot = forwardRef<StackedPlotRef, StackedPlotProps>(\n function StackedPlot(\n {\n width = \"100%\",\n height = 480,\n className = \"\",\n style = {},\n indicators: _indicators,\n onCrosshairMove: _onCrosshairMove,\n drawingTools: _drawingTools,\n ariaLabel,\n panes,\n ...stackOptions\n },\n ref,\n ) {\n const { containerRef, stack, isReady, fitAll, resetAll } = useStackedPlot({\n panes,\n ...stackOptions,\n });\n\n useImperativeHandle(\n ref,\n () => ({\n getStack: () => stack,\n fitAll: () => fitAll(),\n resetAll,\n getBounds: () => stack?.getMaster().getViewBounds() ?? null,\n }),\n [stack, fitAll, resetAll],\n );\n\n const containerStyle = useMemo<CSSProperties>(\n () => ({\n position: \"relative\",\n width: typeof width === \"number\" ? `${width}px` : width,\n height: typeof height === \"number\" ? `${height}px` : height,\n ...style,\n }),\n [width, height, style],\n );\n\n return (\n <div\n ref={containerRef as React.RefObject<HTMLDivElement>}\n className={`velo-plot-stacked ${className}`}\n style={containerStyle}\n role=\"img\"\n aria-label={ariaLabel ?? `Stacked chart with ${panes.length} panes`}\n data-ready={isReady ? \"true\" : \"false\"}\n />\n );\n },\n);\n\nexport default StackedPlot;\n","/**\n * useIndicator - React hook for trading indicators\n */\n\nimport { useEffect, useRef, useState } from \"react\";\nimport type { Chart } from \"../core/chart/types\";\nimport type { AddIndicatorOptions, AddIndicatorResult } from \"../core/indicator/addIndicator\";\nimport type { IndicatorPresetName } from \"../core/indicator/indicatorPresets\";\nimport {\n addIndicatorToHost,\n isStackedChart,\n removeIndicatorFromChart,\n type IndicatorHost,\n} from \"../bindings/shared\";\n\nexport interface UseIndicatorReturn {\n result: (AddIndicatorResult & { paneId?: string }) | null;\n isLoading: boolean;\n error: Error | null;\n}\n\nexport function useIndicator(\n host: IndicatorHost,\n preset: IndicatorPresetName,\n options: AddIndicatorOptions = {},\n): UseIndicatorReturn {\n const [result, setResult] = useState<\n (AddIndicatorResult & { paneId?: string }) | null\n >(null);\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const resultRef = useRef(result);\n resultRef.current = result;\n\n useEffect(() => {\n if (!host) return;\n\n let cancelled = false;\n setIsLoading(true);\n setError(null);\n\n addIndicatorToHost(host, preset, options)\n .then((res) => {\n if (!cancelled) {\n setResult(res);\n setIsLoading(false);\n }\n })\n .catch((err) => {\n if (!cancelled) {\n setError(err instanceof Error ? err : new Error(String(err)));\n setIsLoading(false);\n }\n });\n\n return () => {\n cancelled = true;\n const res = resultRef.current;\n if (res && !isStackedChart(host)) {\n removeIndicatorFromChart(host as Chart, res.id);\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [host, preset, JSON.stringify(options)]);\n\n return { result, isLoading, error };\n}\n","/**\n * useChartSync - React hook for synchronizing multiple charts\n */\n\nimport { useEffect, useState } from \"react\";\nimport type { ChartLike, SyncOptions } from \"../core/sync\";\nimport { ChartGroup } from \"../core/sync\";\nimport { createChartSync } from \"../bindings/shared\";\n\nexport interface UseChartSyncReturn {\n group: ChartGroup | null;\n}\n\nexport function useChartSync(\n charts: ChartLike[],\n options?: SyncOptions,\n): UseChartSyncReturn {\n const [group, setGroup] = useState<ChartGroup | null>(null);\n\n useEffect(() => {\n if (charts.length < 2) {\n setGroup(null);\n return;\n }\n\n const handle = createChartSync(charts, options);\n setGroup(handle.group);\n\n return () => {\n handle.destroy();\n setGroup(null);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [charts, JSON.stringify(options)]);\n\n return { group };\n}\n\n/** Alias matching roadmap naming (`useChartGroup` ≡ `useChartSync`). */\nexport const useChartGroup = useChartSync;\n","/**\n * React bindings for Velo Plot\n */\n\nexport {\n VeloPlot,\n type VeloPlotProps,\n type VeloPlotRef,\n type VeloPlotSeries,\n} from \"./VeloPlot\";\nexport {\n StackedPlot,\n type StackedPlotProps,\n type StackedPlotRef,\n type StackedPlotIndicator,\n} from \"./StackedPlot\";\nexport {\n useVeloPlot,\n type UseVeloPlotOptions,\n type UseVeloPlotReturn,\n} from \"./useVeloPlot\";\nexport {\n useStackedPlot,\n type UseStackedPlotOptions,\n type UseStackedPlotReturn,\n} from \"./useStackedPlot\";\nexport {\n useIndicator,\n type UseIndicatorReturn,\n} from \"./useIndicator\";\nexport {\n useChartSync,\n useChartGroup,\n type UseChartSyncReturn,\n} from \"./useChartSync\";\n\n// ---------------------------------------------------------------------------\n// Backward-compatible aliases (SciPlot / SciChart branding → VeloPlot)\n// Removed in v4.0.\n// ---------------------------------------------------------------------------\nimport { VeloPlot as VeloPlotImpl } from \"./VeloPlot\";\nimport { useVeloPlot as useVeloPlotImpl } from \"./useVeloPlot\";\n\n/**\n * @deprecated Use `VeloPlot` instead. **Removed in v4.0.**\n */\nexport const SciPlot = VeloPlotImpl;\n/**\n * @deprecated Use `VeloPlot` instead. **Removed in v4.0.**\n */\nexport const SciChart = VeloPlotImpl;\n/**\n * @deprecated Use `useVeloPlot` instead. **Removed in v4.0.**\n */\nexport const useSciPlot = useVeloPlotImpl;\n/**\n * @deprecated Use `useVeloPlot` instead. **Removed in v4.0.**\n */\nexport const useSciChart = useVeloPlotImpl;\n\nexport type {\n VeloPlotProps as SciPlotProps,\n VeloPlotRef as SciPlotRef,\n VeloPlotSeries as SciPlotSeries,\n VeloPlotProps as SciChartProps,\n VeloPlotRef as SciChartRef,\n VeloPlotSeries as SciChartSeries,\n} from \"./VeloPlot\";\nexport type {\n UseVeloPlotOptions as UseSciPlotOptions,\n UseVeloPlotReturn as UseSciPlotReturn,\n UseVeloPlotOptions as UseSciChartOptions,\n UseVeloPlotReturn as UseSciChartReturn,\n} from \"./useVeloPlot\";\n"],"names":["useVeloPlot","containerRef","options","chart","setChart","useState","isReady","setIsReady","error","setError","bounds","setBounds","chartRef","useRef","destroyRef","optionsRef","prevSyncOptionsRef","pickSyncableOptions","useEffect","container","handle","createChartLifecycle","err","_a","currentChart","next","prev","optionsChanged","syncChartOptions","addSeries","useCallback","seriesOptions","c","updateSeries","id","data","removeSeries","zoom","zoomOptions","resetZoom","VeloPlot","forwardRef","series","zoomProp","onZoomChange","cursor","width","height","className","style","debug","ariaLabel","keyboardNav","chartOptions","ref","previousSeriesRef","a11yRef","useImperativeHandle","diffSeries","handler","event","el","applyChartA11y","updateA11y","containerStyle","useMemo","jsx","jsxs","useStackedPlot","stackRef","stack","setStack","structureKeyRef","stackedStructureKey","paneSeriesRef","mountStack","created","createStackedChart","syncStackedPaneSeries","current","syncStackedOptions","fitAll","opts","resetAll","StackedPlot","_indicators","_onCrosshairMove","_drawingTools","panes","stackOptions","useIndicator","host","preset","result","setResult","isLoading","setIsLoading","resultRef","cancelled","addIndicatorToHost","res","isStackedChart","removeIndicatorFromChart","useChartSync","charts","group","setGroup","createChartSync","useChartGroup","SciPlot","VeloPlotImpl","SciChart","useSciPlot","useVeloPlotImpl","useSciChart"],"mappings":";;;;;;;;;;AAwCO,SAASA,EACdC,GACAC,IAA8B,IACX;AACnB,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAuB,IAAI,GAC/C,CAACC,GAASC,CAAU,IAAIF,EAAS,EAAK,GACtC,CAACG,GAAOC,CAAQ,IAAIJ,EAAuB,IAAI,GAC/C,CAACK,GAAQC,CAAS,IAAIN,EAAwB,IAAI,GAElDO,IAAWC,EAAqB,IAAI,GACpCC,IAAaD,EAA4B,IAAI,GAC7CE,IAAaF,EAAOX,CAAO,GAC3Bc,IAAqBH,EAAOI,EAAoBf,CAAO,CAAC;AAC9D,EAAAa,EAAW,UAAUb,GAErBgB,EAAU,MAAM;AACd,UAAMC,IAAYlB,EAAa;AAC/B,QAAKkB,GAEL;AAAA,UAAI;AACF,cAAMC,IAASC;AAAA,UACbF;AAAA,UACAJ,EAAW;AAAA,UACX;AAAA,YACE,gBAAgBJ;AAAA,YAChB,SAASF;AAAA,UAAA;AAAA,QACX;AAEF,QAAAG,EAAS,UAAUQ,EAAO,OAC1BN,EAAW,UAAUM,EAAO,SAC5BhB,EAASgB,EAAO,KAAK,GACrBb,EAAW,EAAI,GACfI,EAAUS,EAAO,WAAW,GAC5BX,EAAS,IAAI,GACbO,EAAmB,UAAUC,EAAoBF,EAAW,OAAO;AAAA,MACrE,SAASO,GAAK;AACZ,gBAAQ,MAAM,6CAA6CA,CAAG,GAC9Db,EAASa,aAAe,QAAQA,IAAM,IAAI,MAAM,OAAOA,CAAG,CAAC,CAAC,GAC5Df,EAAW,EAAK;AAAA,MAClB;AAEA,aAAO,MAAM;;AACX,SAAAgB,IAAAT,EAAW,YAAX,QAAAS,EAAA,KAAAT,IACAA,EAAW,UAAU,MACrBF,E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AAMH,EAAU;AACtB,MAAIG,KAAO,CAACC,EAAeV,CAAI,KAC7BW,EAAyBX,GAAeS,EAAI,EAAE;AAAA,IAElD;AAAA,EAEF,GAAG,CAACT,GAAMC,GAAQ,KAAK,UAAU1F,CAAO,CAAC,CAAC,GAEnC,EAAE,QAAA2F,GAAQ,WAAAE,GAAW,OAAAvF,EAAA;AAC9B;ACrDO,SAAS+F,GACdC,GACAtG,GACoB;AACpB,QAAM,CAACuG,GAAOC,CAAQ,IAAIrG,EAA4B,IAAI;AAE1D,SAAAa,EAAU,MAAM;AACd,QAAIsF,EAAO,SAAS,GAAG;AACrB,MAAAE,EAAS,IAAI;AACb;AAAA,IACF;AAEA,UAAMtF,IAASuF,EAAgBH,GAAQtG,CAAO;AAC9C,WAAAwG,EAAStF,EAAO,KAAK,GAEd,MAAM;AACX,MAAAA,EAAO,QAAA,GACPsF,EAAS,IAAI;AAAA,IACf;AAAA,EAEF,GAAG,CAACF,GAAQ,KAAK,UAAUtG,CAAO,CAAC,CAAC,GAE7B,EAAE,OAAAuG,EAAA;AACX;AAGO,MAAMG,KAAgBL,ICOhBM,KAAUC,GAIVC,KAAWD,GAIXE,KAAaC,GAIbC,KAAcD;"}
1
+ {"version":3,"file":"react.js","sources":["../src/react/useVeloPlot.ts","../src/react/VeloPlot.tsx","../src/react/useStackedPlot.ts","../src/react/StackedPlot.tsx","../src/react/useIndicator.ts","../src/react/useChartSync.ts","../src/react/index.ts"],"sourcesContent":["/**\n * useVeloPlot - React hook for Velo Plot\n */\n\nimport {\n useEffect,\n useRef,\n useState,\n useCallback,\n type RefObject,\n} from \"react\";\nimport type { Chart } from \"../core/Chart\";\nimport type {\n SeriesOptions,\n SeriesUpdateData,\n ZoomOptions,\n Bounds,\n} from \"../types\";\nimport {\n createChartLifecycle,\n type ChartBindingOptions,\n optionsChanged,\n syncChartOptions,\n pickSyncableOptions,\n} from \"../bindings/shared\";\n\nexport interface UseVeloPlotOptions extends ChartBindingOptions {}\n\nexport interface UseVeloPlotReturn {\n chart: Chart | null;\n isReady: boolean;\n error: Error | null;\n bounds: Bounds | null;\n addSeries: (options: SeriesOptions) => void;\n updateSeries: (id: string, data: SeriesUpdateData) => void;\n removeSeries: (id: string) => void;\n zoom: (options: ZoomOptions) => void;\n resetZoom: () => void;\n}\n\nexport function useVeloPlot(\n containerRef: RefObject<HTMLDivElement>,\n options: UseVeloPlotOptions = {},\n): UseVeloPlotReturn {\n const [chart, setChart] = useState<Chart | null>(null);\n const [isReady, setIsReady] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const [bounds, setBounds] = useState<Bounds | null>(null);\n\n const chartRef = useRef<Chart | null>(null);\n const destroyRef = useRef<(() => void) | null>(null);\n const optionsRef = useRef(options);\n const prevSyncOptionsRef = useRef(pickSyncableOptions(options));\n optionsRef.current = options;\n\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n\n try {\n const handle = createChartLifecycle(\n container,\n optionsRef.current,\n {\n onBoundsChange: setBounds,\n onError: setError,\n },\n );\n chartRef.current = handle.chart;\n destroyRef.current = handle.destroy;\n setChart(handle.chart);\n setIsReady(true);\n setBounds(handle.getBounds());\n setError(null);\n prevSyncOptionsRef.current = pickSyncableOptions(optionsRef.current);\n } catch (err) {\n console.error(\"[useVeloPlot] Failed to initialize chart:\", err);\n setError(err instanceof Error ? err : new Error(String(err)));\n setIsReady(false);\n }\n\n return () => {\n destroyRef.current?.();\n destroyRef.current = null;\n chartRef.current = null;\n setChart(null);\n setIsReady(false);\n };\n }, [containerRef]);\n\n useEffect(() => {\n const currentChart = chartRef.current;\n if (!currentChart || !isReady) return;\n\n const next = pickSyncableOptions(options);\n const prev = prevSyncOptionsRef.current;\n if (optionsChanged(prev, next)) {\n syncChartOptions(currentChart, prev, next);\n prevSyncOptionsRef.current = next;\n }\n });\n\n const addSeries = useCallback((seriesOptions: SeriesOptions) => {\n const c = chartRef.current;\n if (c) {\n c.addSeries(seriesOptions);\n setBounds(c.getViewBounds());\n }\n }, []);\n\n const updateSeries = useCallback((id: string, data: SeriesUpdateData) => {\n chartRef.current?.updateSeries(id, data);\n }, []);\n\n const removeSeries = useCallback((id: string) => {\n chartRef.current?.removeSeries(id);\n }, []);\n\n const zoom = useCallback((zoomOptions: ZoomOptions) => {\n chartRef.current?.zoom(zoomOptions);\n }, []);\n\n const resetZoom = useCallback(() => {\n const c = chartRef.current;\n if (c) {\n c.resetZoom();\n setBounds(c.getViewBounds());\n }\n }, []);\n\n return {\n chart,\n isReady,\n error,\n bounds,\n addSeries,\n updateSeries,\n removeSeries,\n zoom,\n resetZoom,\n };\n}\n","/**\n * VeloPlot - React Component for Scientific Charts\n */\n\nimport {\n useRef,\n useEffect,\n useImperativeHandle,\n forwardRef,\n useMemo,\n type CSSProperties,\n} from \"react\";\nimport { useVeloPlot, type UseVeloPlotOptions } from \"./useVeloPlot\";\nimport type { ZoomOptions, CursorOptions, Bounds } from \"../types\";\nimport type { Chart } from \"../core/Chart\";\nimport {\n diffSeries,\n applyChartA11y,\n updateA11y,\n type VeloPlotSeries,\n} from \"../bindings/shared\";\n\nexport type { VeloPlotSeries } from \"../bindings/shared\";\n\nexport interface VeloPlotProps extends UseVeloPlotOptions {\n series?: VeloPlotSeries[];\n zoom?: ZoomOptions;\n onZoomChange?: (bounds: Bounds) => void;\n cursor?: CursorOptions;\n width?: number | string;\n height?: number | string;\n className?: string;\n style?: CSSProperties;\n debug?: boolean;\n /** Custom aria-label for accessibility */\n ariaLabel?: string;\n /** Enable keyboard navigation (default: true) */\n keyboardNav?: boolean;\n}\n\nexport interface VeloPlotRef {\n getChart: () => Chart | null;\n resetZoom: () => void;\n getBounds: () => Bounds | null;\n}\n\nexport const VeloPlot = forwardRef<VeloPlotRef, VeloPlotProps>(\n function VeloPlot(\n {\n series = [],\n zoom: zoomProp,\n onZoomChange,\n cursor,\n width = \"100%\",\n height = 400,\n className = \"\",\n style = {},\n debug = false,\n ariaLabel,\n keyboardNav = true,\n ...chartOptions\n },\n ref,\n ) {\n const containerRef = useRef<HTMLDivElement>(null);\n const previousSeriesRef = useRef<Map<string, VeloPlotSeries>>(new Map());\n const a11yRef = useRef<ReturnType<typeof applyChartA11y> | null>(null);\n\n const {\n chart,\n isReady,\n bounds,\n addSeries,\n updateSeries,\n removeSeries,\n resetZoom,\n } = useVeloPlot(containerRef, chartOptions);\n\n useImperativeHandle(\n ref,\n () => ({\n getChart: () => chart,\n resetZoom,\n getBounds: () => bounds,\n }),\n [chart, resetZoom, bounds],\n );\n\n useEffect(() => {\n if (!isReady || !chart) return;\n previousSeriesRef.current = diffSeries(\n { addSeries, updateSeries, removeSeries, autoScale: () => chart.autoScale() },\n series,\n previousSeriesRef.current,\n );\n }, [series, isReady, chart, addSeries, updateSeries, removeSeries]);\n\n useEffect(() => {\n if (!isReady || !chart || !zoomProp) return;\n chart.zoom(zoomProp);\n }, [isReady, chart, zoomProp]);\n\n useEffect(() => {\n if (!isReady || !chart || !onZoomChange) return;\n const handler = (event: { x: [number, number]; y: [number, number] }) => {\n onZoomChange({\n xMin: event.x[0],\n xMax: event.x[1],\n yMin: event.y[0],\n yMax: event.y[1],\n });\n };\n chart.on(\"zoom\", handler);\n return () => chart.off(\"zoom\", handler);\n }, [isReady, chart, onZoomChange]);\n\n useEffect(() => {\n if (!isReady || !chart) return;\n if (cursor?.enabled) {\n chart.enableCursor(cursor);\n } else {\n chart.disableCursor();\n }\n }, [isReady, chart, cursor]);\n\n useEffect(() => {\n const el = containerRef.current;\n if (!isReady || !chart || !el) return;\n\n a11yRef.current = applyChartA11y(el, chart, {\n label: ariaLabel,\n series,\n bounds,\n enableKeyboard: keyboardNav,\n });\n\n return () => {\n a11yRef.current?.cleanup();\n a11yRef.current = null;\n };\n }, [isReady, chart, keyboardNav, ariaLabel, bounds, series]);\n\n useEffect(() => {\n const el = containerRef.current;\n if (!el || !a11yRef.current) return;\n updateA11y(el, a11yRef.current.srTable, {\n label: ariaLabel,\n series,\n bounds,\n });\n }, [series, bounds, ariaLabel]);\n\n const containerStyle = useMemo<CSSProperties>(\n () => ({\n position: \"relative\",\n width: typeof width === \"number\" ? `${width}px` : width,\n height: typeof height === \"number\" ? `${height}px` : height,\n outline: \"none\",\n ...style,\n }),\n [width, height, style],\n );\n\n return (\n <div\n ref={containerRef}\n className={`velo-plot-container ${className}`}\n style={containerStyle}\n >\n {debug && bounds && (\n <div\n style={{\n position: \"absolute\",\n top: 8,\n right: 8,\n background: \"rgba(0,0,0,0.7)\",\n color: \"#0f0\",\n padding: \"4px 8px\",\n borderRadius: 4,\n fontSize: 11,\n fontFamily: \"monospace\",\n pointerEvents: \"none\",\n }}\n >\n <div>\n X: [{bounds.xMin.toFixed(3)}, {bounds.xMax.toFixed(3)}]\n </div>\n <div>\n Y: [{bounds.yMin.toExponential(2)}, {bounds.yMax.toExponential(2)}]\n </div>\n <div>Series: {series.length}</div>\n </div>\n )}\n </div>\n );\n },\n);\n\nexport default VeloPlot;\n","/**\n * useStackedPlot - React hook for multi-pane stacked charts\n */\n\nimport {\n useEffect,\n useRef,\n useState,\n useCallback,\n type RefObject,\n} from \"react\";\nimport { createStackedChart } from \"../core/stacked\";\nimport type { StackedChart, StackedChartOptions } from \"../core/stacked\";\nimport type { Range } from \"../types\";\nimport {\n stackedStructureKey,\n syncStackedOptions,\n syncStackedPaneSeries,\n} from \"../bindings/shared\";\nimport type { VeloPlotSeries } from \"../bindings/shared\";\n\nexport interface UseStackedPlotOptions\n extends Omit<StackedChartOptions, \"container\"> {}\n\nexport interface UseStackedPlotReturn {\n containerRef: RefObject<HTMLDivElement>;\n stack: StackedChart | null;\n isReady: boolean;\n fitAll: (options?: { x?: Range; padding?: number }) => void;\n resetAll: () => void;\n}\n\nexport function useStackedPlot(\n options: UseStackedPlotOptions,\n): UseStackedPlotReturn {\n const containerRef = useRef<HTMLDivElement>(null);\n const stackRef = useRef<StackedChart | null>(null);\n const destroyRef = useRef<(() => void) | null>(null);\n const [stack, setStack] = useState<StackedChart | null>(null);\n const [isReady, setIsReady] = useState(false);\n\n const optionsRef = useRef(options);\n const structureKeyRef = useRef(stackedStructureKey(options.panes));\n const paneSeriesRef = useRef(new Map<string, Map<string, VeloPlotSeries>>());\n optionsRef.current = options;\n\n const mountStack = useCallback(() => {\n const el = containerRef.current;\n if (!el) return;\n\n destroyRef.current?.();\n const created = createStackedChart({\n ...optionsRef.current,\n container: el,\n });\n stackRef.current = created;\n destroyRef.current = () => {\n created.destroy();\n stackRef.current = null;\n };\n setStack(created);\n structureKeyRef.current = stackedStructureKey(optionsRef.current.panes);\n paneSeriesRef.current = syncStackedPaneSeries(\n created,\n optionsRef.current.panes,\n new Map(),\n );\n\n created.whenReady().then(() => setIsReady(true));\n }, []);\n\n useEffect(() => {\n mountStack();\n return () => {\n setIsReady(false);\n destroyRef.current?.();\n destroyRef.current = null;\n setStack(null);\n };\n }, [mountStack]);\n\n useEffect(() => {\n const current = stackRef.current;\n if (!current || !isReady) return;\n\n const nextKey = stackedStructureKey(options.panes);\n if (nextKey !== structureKeyRef.current) {\n mountStack();\n return;\n }\n\n syncStackedOptions(current, options);\n paneSeriesRef.current = syncStackedPaneSeries(\n current,\n options.panes,\n paneSeriesRef.current,\n );\n });\n\n const fitAll = useCallback((opts?: { x?: Range; padding?: number }) => {\n stackRef.current?.fitAll(opts);\n }, []);\n\n const resetAll = useCallback(() => {\n stackRef.current?.resetAll();\n }, []);\n\n return { containerRef, stack, isReady, fitAll, resetAll };\n}\n","/**\n * StackedPlot - Declarative React component for multi-pane charts\n */\n\nimport {\n forwardRef,\n useImperativeHandle,\n useMemo,\n type CSSProperties,\n} from \"react\";\nimport { useStackedPlot, type UseStackedPlotOptions } from \"./useStackedPlot\";\nimport type { StackedChart } from \"../core/stacked\";\nimport type { Bounds } from \"../types\";\nimport type { AddIndicatorOptions } from \"../core/indicator/addIndicator\";\nimport type { IndicatorPresetName } from \"../core/indicator/indicatorPresets\";\n\nexport interface StackedPlotIndicator extends AddIndicatorOptions {\n type: IndicatorPresetName;\n}\n\nexport interface StackedPlotProps extends UseStackedPlotOptions {\n width?: number | string;\n height?: number | string;\n className?: string;\n style?: CSSProperties;\n indicators?: StackedPlotIndicator[];\n onCrosshairMove?: (event: { price?: number; x: number }) => void;\n drawingTools?: string[];\n ariaLabel?: string;\n}\n\nexport interface StackedPlotRef {\n getStack: () => StackedChart | null;\n fitAll: () => void;\n resetAll: () => void;\n getBounds: () => Bounds | null;\n}\n\nexport const StackedPlot = forwardRef<StackedPlotRef, StackedPlotProps>(\n function StackedPlot(\n {\n width = \"100%\",\n height = 480,\n className = \"\",\n style = {},\n indicators: _indicators,\n onCrosshairMove: _onCrosshairMove,\n drawingTools: _drawingTools,\n ariaLabel,\n panes,\n ...stackOptions\n },\n ref,\n ) {\n const { containerRef, stack, isReady, fitAll, resetAll } = useStackedPlot({\n panes,\n ...stackOptions,\n });\n\n useImperativeHandle(\n ref,\n () => ({\n getStack: () => stack,\n fitAll: () => fitAll(),\n resetAll,\n getBounds: () => stack?.getMaster().getViewBounds() ?? null,\n }),\n [stack, fitAll, resetAll],\n );\n\n const containerStyle = useMemo<CSSProperties>(\n () => ({\n position: \"relative\",\n width: typeof width === \"number\" ? `${width}px` : width,\n height: typeof height === \"number\" ? `${height}px` : height,\n ...style,\n }),\n [width, height, style],\n );\n\n return (\n <div\n ref={containerRef as React.RefObject<HTMLDivElement>}\n className={`velo-plot-stacked ${className}`}\n style={containerStyle}\n role=\"img\"\n aria-label={ariaLabel ?? `Stacked chart with ${panes.length} panes`}\n data-ready={isReady ? \"true\" : \"false\"}\n />\n );\n },\n);\n\nexport default StackedPlot;\n","/**\n * useIndicator - React hook for trading indicators\n */\n\nimport { useEffect, useRef, useState } from \"react\";\nimport type { Chart } from \"../core/chart/types\";\nimport type { AddIndicatorOptions, AddIndicatorResult } from \"../core/indicator/addIndicator\";\nimport type { IndicatorPresetName } from \"../core/indicator/indicatorPresets\";\nimport {\n addIndicatorToHost,\n isStackedChart,\n removeIndicatorFromChart,\n type IndicatorHost,\n} from \"../bindings/shared\";\n\nexport interface UseIndicatorReturn {\n result: (AddIndicatorResult & { paneId?: string }) | null;\n isLoading: boolean;\n error: Error | null;\n}\n\nexport function useIndicator(\n host: IndicatorHost,\n preset: IndicatorPresetName,\n options: AddIndicatorOptions = {},\n): UseIndicatorReturn {\n const [result, setResult] = useState<\n (AddIndicatorResult & { paneId?: string }) | null\n >(null);\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const resultRef = useRef(result);\n resultRef.current = result;\n\n useEffect(() => {\n if (!host) return;\n\n let cancelled = false;\n setIsLoading(true);\n setError(null);\n\n addIndicatorToHost(host, preset, options)\n .then((res) => {\n if (!cancelled) {\n setResult(res);\n setIsLoading(false);\n }\n })\n .catch((err) => {\n if (!cancelled) {\n setError(err instanceof Error ? err : new Error(String(err)));\n setIsLoading(false);\n }\n });\n\n return () => {\n cancelled = true;\n const res = resultRef.current;\n if (res && !isStackedChart(host)) {\n removeIndicatorFromChart(host as Chart, res.id);\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [host, preset, JSON.stringify(options)]);\n\n return { result, isLoading, error };\n}\n","/**\n * useChartSync - React hook for synchronizing multiple charts\n */\n\nimport { useEffect, useState } from \"react\";\nimport type { ChartLike, SyncOptions } from \"../core/sync\";\nimport { ChartGroup } from \"../core/sync\";\nimport { createChartSync } from \"../bindings/shared\";\n\nexport interface UseChartSyncReturn {\n group: ChartGroup | null;\n}\n\nexport function useChartSync(\n charts: ChartLike[],\n options?: SyncOptions,\n): UseChartSyncReturn {\n const [group, setGroup] = useState<ChartGroup | null>(null);\n\n useEffect(() => {\n if (charts.length < 2) {\n setGroup(null);\n return;\n }\n\n const handle = createChartSync(charts, options);\n setGroup(handle.group);\n\n return () => {\n handle.destroy();\n setGroup(null);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [charts, JSON.stringify(options)]);\n\n return { group };\n}\n\n/** Alias matching roadmap naming (`useChartGroup` ≡ `useChartSync`). */\nexport const useChartGroup = useChartSync;\n","/**\n * React bindings for Velo Plot\n */\n\nexport {\n VeloPlot,\n type VeloPlotProps,\n type VeloPlotRef,\n type VeloPlotSeries,\n} from \"./VeloPlot\";\nexport {\n StackedPlot,\n type StackedPlotProps,\n type StackedPlotRef,\n type StackedPlotIndicator,\n} from \"./StackedPlot\";\nexport {\n useVeloPlot,\n type UseVeloPlotOptions,\n type UseVeloPlotReturn,\n} from \"./useVeloPlot\";\nexport {\n useStackedPlot,\n type UseStackedPlotOptions,\n type UseStackedPlotReturn,\n} from \"./useStackedPlot\";\nexport {\n useIndicator,\n type UseIndicatorReturn,\n} from \"./useIndicator\";\nexport {\n useChartSync,\n useChartGroup,\n type UseChartSyncReturn,\n} from \"./useChartSync\";\n\n// ---------------------------------------------------------------------------\n// Backward-compatible aliases (SciPlot / SciChart branding → VeloPlot)\n// Removed in v4.0.\n// ---------------------------------------------------------------------------\nimport { VeloPlot as VeloPlotImpl } from \"./VeloPlot\";\nimport { useVeloPlot as useVeloPlotImpl } from \"./useVeloPlot\";\n\n/**\n * @deprecated Use `VeloPlot` instead. **Removed in v4.0.**\n */\nexport const SciPlot = VeloPlotImpl;\n/**\n * @deprecated Use `VeloPlot` instead. **Removed in v4.0.**\n */\nexport const SciChart = VeloPlotImpl;\n/**\n * @deprecated Use `useVeloPlot` instead. **Removed in v4.0.**\n */\nexport const useSciPlot = useVeloPlotImpl;\n/**\n * @deprecated Use `useVeloPlot` instead. **Removed in v4.0.**\n */\nexport const useSciChart = useVeloPlotImpl;\n\nexport type {\n VeloPlotProps as SciPlotProps,\n VeloPlotRef as SciPlotRef,\n VeloPlotSeries as SciPlotSeries,\n VeloPlotProps as SciChartProps,\n VeloPlotRef as SciChartRef,\n VeloPlotSeries as SciChartSeries,\n} from \"./VeloPlot\";\nexport type {\n UseVeloPlotOptions as UseSciPlotOptions,\n UseVeloPlotReturn as UseSciPlotReturn,\n UseVeloPlotOptions as UseSciChartOptions,\n UseVeloPlotReturn as UseSciChartReturn,\n} from \"./useVeloPlot\";\n"],"names":["useVeloPlot","containerRef","options","chart","setChart","useState","isReady","setIsReady","error","setError","bounds","setBounds","chartRef","useRef","destroyRef","optionsRef","prevSyncOptionsRef","pickSyncableOptions","useEffect","container","handle","createChartLifecycle","err","_a","currentChart","next","prev","optionsChanged","syncChartOptions","addSeries","useCallback","seriesOptions","c","updateSeries","id","data","removeSeries","zoom","zoomOptions","resetZoom","VeloPlot","forwardRef","series","zoomProp","onZoomChange","cursor","width","height","className","style","debug","ariaLabel","keyboardNav","chartOptions","ref","previousSeriesRef","a11yRef","useImperativeHandle","diffSeries","handler","event","el","applyChartA11y","updateA11y","containerStyle","useMemo","jsx","jsxs","useStackedPlot","stackRef","stack","setStack","structureKeyRef","stackedStructureKey","paneSeriesRef","mountStack","created","createStackedChart","syncStackedPaneSeries","current","syncStackedOptions","fitAll","opts","resetAll","StackedPlot","_indicators","_onCrosshairMove","_drawingTools","panes","stackOptions","useIndicator","host","preset","result","setResult","isLoading","setIsLoading","resultRef","cancelled","addIndicatorToHost","res","isStackedChart","removeIndicatorFromChart","useChartSync","charts","group","setGroup","createChartSync","useChartGroup","SciPlot","VeloPlotImpl","SciChart","useSciPlot","useVeloPlotImpl","useSciChart"],"mappings":";;;;;;;AAwCO,SAASA,EACdC,GACAC,IAA8B,IACX;AACnB,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAuB,IAAI,GAC/C,CAACC,GAASC,CAAU,IAAIF,EAAS,EAAK,GACtC,CAACG,GAAOC,CAAQ,IAAIJ,EAAuB,IAAI,GAC/C,CAACK,GAAQC,CAAS,IAAIN,EAAwB,IAAI,GAElDO,IAAWC,EAAqB,IAAI,GACpCC,IAAaD,EAA4B,IAAI,GAC7CE,IAAaF,EAAOX,CAAO,GAC3Bc,IAAqBH,EAAOI,EAAoBf,CAAO,CAAC;AAC9D,EAAAa,EAAW,UAAUb,GAErBgB,EAAU,MAAM;AACd,UAAMC,IAAYlB,EAAa;AAC/B,QAAKkB,GAEL;AAAA,UAAI;AACF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,EAAE,OAAAuG,EAAA;AACX;AAGO,MAAMG,KAAgBL,ICOhBM,KAAUC,GAIVC,KAAWD,GAIXE,KAAaC,GAIbC,KAAcD;"}
@@ -12,5 +12,6 @@
12
12
  * - Minimal state changes per frame
13
13
  */
14
14
  export { NativeWebGLRenderer } from './native/NativeWebGLRenderer';
15
- export { interleaveBandData, interleaveData, interleaveStepData, interleaveErrorData, interleaveBoxPlotData, interleaveWaterfallData, parseColor, brightenColor, } from './native/utils';
15
+ export { interleaveBandData, interleaveData, interleaveStepData, interleaveErrorData, parseColor, brightenColor, } from './native/utilsCore';
16
+ export { interleaveBoxPlotData, interleaveWaterfallData, } from './native/utils';
16
17
  export type { NativeRenderOptions, NativeSeriesRenderData } from './native/types';
@@ -1,4 +1,4 @@
1
- import { NativeRenderOptions, NativeSeriesRenderData } from './types';
1
+ import { NativeRenderOptions, NativeSeriesRenderData, ProgramBundle } from './types';
2
2
 
3
3
  export declare class NativeWebGLRenderer {
4
4
  private canvas;
@@ -8,6 +8,10 @@ export declare class NativeWebGLRenderer {
8
8
  private buffers;
9
9
  private textures;
10
10
  private isInitialized;
11
+ private heatmapShaderReady;
12
+ /** Optional hook for extended bundles to install the heatmap shader program. */
13
+ static heatmapProgramInstaller: ((gl: WebGLRenderingContext, bundle: ProgramBundle) => void) | null;
14
+ installHeatmapProgram(): void;
11
15
  setDPR(dpr: number): void;
12
16
  constructor(canvas: HTMLCanvasElement);
13
17
  get available(): boolean;
@@ -1,47 +1,2 @@
1
- import { Bounds } from '../../types';
2
- import { ShaderProgram } from './types';
3
-
4
- export declare function calculateUniforms(bounds: Bounds, invertX?: boolean): {
5
- scale: [number, number];
6
- translate: [number, number];
7
- };
8
- export declare function renderLine(gl: WebGLRenderingContext, prog: ShaderProgram, buffer: WebGLBuffer, count: number, uniforms: {
9
- scale: [number, number];
10
- translate: [number, number];
11
- }, color: [number, number, number, number], width?: number): void;
12
- export declare function renderBand(gl: WebGLRenderingContext, prog: ShaderProgram, buffer: WebGLBuffer, count: number, uniforms: {
13
- scale: [number, number];
14
- translate: [number, number];
15
- }, color: [number, number, number, number]): void;
16
- export declare function renderPoints(gl: WebGLRenderingContext, prog: ShaderProgram, buffer: WebGLBuffer, count: number, uniforms: {
17
- scale: [number, number];
18
- translate: [number, number];
19
- }, color: [number, number, number, number], pointSize: number, symbol?: string): void;
20
- export declare function renderHeatmap(gl: WebGLRenderingContext, prog: ShaderProgram, buffer: WebGLBuffer, count: number, uniforms: {
21
- scale: [number, number];
22
- translate: [number, number];
23
- }, zBounds?: {
24
- min: number;
25
- max: number;
26
- }, texture?: WebGLTexture): void;
27
- export declare function renderBar(gl: WebGLRenderingContext, prog: ShaderProgram, buffer: WebGLBuffer, count: number, uniforms: {
28
- scale: [number, number];
29
- translate: [number, number];
30
- }, color: [number, number, number, number]): void;
31
- export declare function renderErrorBars(gl: WebGLRenderingContext, prog: ShaderProgram, buffer: WebGLBuffer, count: number, uniforms: {
32
- scale: [number, number];
33
- translate: [number, number];
34
- }, color: [number, number, number, number], width?: number): void;
35
- export declare function renderBoxPlot(gl: WebGLRenderingContext, programs: {
36
- line: ShaderProgram;
37
- point: ShaderProgram;
38
- }, data: {
39
- boxBuffer: WebGLBuffer;
40
- boxCount: number;
41
- linesBuffer: WebGLBuffer;
42
- linesCount: number;
43
- }, uniforms: {
44
- scale: [number, number];
45
- translate: [number, number];
46
- }, style: any): void;
47
- export declare function computeSeriesColor(style: any): [number, number, number, number];
1
+ export { calculateUniforms, renderLine, renderBand, renderPoints, renderErrorBars, computeSeriesColor, } from './drawCore';
2
+ export { renderHeatmap, renderBar, renderBoxPlot } from './drawExtended';
@@ -0,0 +1,27 @@
1
+ import { Bounds } from '../../types';
2
+ import { ShaderProgram } from './types';
3
+
4
+ export declare function calculateUniforms(bounds: Bounds, invertX?: boolean): {
5
+ scale: [number, number];
6
+ translate: [number, number];
7
+ };
8
+ export declare function renderLine(gl: WebGLRenderingContext, prog: ShaderProgram, buffer: WebGLBuffer, count: number, uniforms: {
9
+ scale: [number, number];
10
+ translate: [number, number];
11
+ }, color: [number, number, number, number], width?: number): void;
12
+ export declare function renderBand(gl: WebGLRenderingContext, prog: ShaderProgram, buffer: WebGLBuffer, count: number, uniforms: {
13
+ scale: [number, number];
14
+ translate: [number, number];
15
+ }, color: [number, number, number, number]): void;
16
+ export declare function renderPoints(gl: WebGLRenderingContext, prog: ShaderProgram, buffer: WebGLBuffer, count: number, uniforms: {
17
+ scale: [number, number];
18
+ translate: [number, number];
19
+ }, color: [number, number, number, number], pointSize: number, symbol?: string): void;
20
+ export declare function renderErrorBars(gl: WebGLRenderingContext, prog: ShaderProgram, buffer: WebGLBuffer, count: number, uniforms: {
21
+ scale: [number, number];
22
+ translate: [number, number];
23
+ }, color: [number, number, number, number], width?: number): void;
24
+ export declare function computeSeriesColor(style: {
25
+ color?: string;
26
+ opacity?: number;
27
+ }): [number, number, number, number];
@@ -0,0 +1,29 @@
1
+ import { ShaderProgram } from './types';
2
+
3
+ export declare function renderHeatmap(gl: WebGLRenderingContext, prog: ShaderProgram, buffer: WebGLBuffer, count: number, uniforms: {
4
+ scale: [number, number];
5
+ translate: [number, number];
6
+ }, zBounds?: {
7
+ min: number;
8
+ max: number;
9
+ }, texture?: WebGLTexture): void;
10
+ export declare function renderBar(gl: WebGLRenderingContext, prog: ShaderProgram, buffer: WebGLBuffer, count: number, uniforms: {
11
+ scale: [number, number];
12
+ translate: [number, number];
13
+ }, color: [number, number, number, number]): void;
14
+ export declare function renderBoxPlot(gl: WebGLRenderingContext, programs: {
15
+ line: ShaderProgram;
16
+ point: ShaderProgram;
17
+ }, data: {
18
+ boxBuffer: WebGLBuffer;
19
+ boxCount: number;
20
+ linesBuffer: WebGLBuffer;
21
+ linesCount: number;
22
+ }, uniforms: {
23
+ scale: [number, number];
24
+ translate: [number, number];
25
+ }, style: {
26
+ color?: string;
27
+ opacity?: number;
28
+ width?: number;
29
+ }): void;
@@ -0,0 +1 @@
1
+ export declare function registerExtendedFrameRenderers(): void;
@@ -0,0 +1,27 @@
1
+ import { NativeSeriesRenderData, ProgramBundle, NativeRenderOptions } from './types';
2
+
3
+ export interface FrameRenderContext {
4
+ gl: WebGLRenderingContext;
5
+ canvas: HTMLCanvasElement;
6
+ dpr: number;
7
+ programs: ProgramBundle;
8
+ options: NativeRenderOptions;
9
+ bounds: {
10
+ xMin: number;
11
+ xMax: number;
12
+ yMin: number;
13
+ yMax: number;
14
+ };
15
+ pa: {
16
+ x: number;
17
+ y: number;
18
+ width: number;
19
+ height: number;
20
+ };
21
+ }
22
+ export type ExtendedFrameRenderer = (ctx: FrameRenderContext, s: NativeSeriesRenderData, seriesUniforms: {
23
+ scale: [number, number];
24
+ translate: [number, number];
25
+ }, color: [number, number, number, number]) => void;
26
+ export declare function registerFrameRenderer(type: string, fn: ExtendedFrameRenderer): void;
27
+ export declare function getFrameRenderer(type: string): ExtendedFrameRenderer | undefined;
@@ -0,0 +1,6 @@
1
+ import { ProgramBundle, ProgramMode, ShaderProgram } from './types';
2
+
3
+ declare function createProgram(gl: WebGLRenderingContext, vertSource: string, fragSource: string, mode: ProgramMode): ShaderProgram;
4
+ /** Core WebGL programs (line + scatter). Heatmap is registered by extended bundles. */
5
+ export declare function createCoreProgramBundle(gl: WebGLRenderingContext): ProgramBundle;
6
+ export { createProgram };
@@ -0,0 +1,4 @@
1
+ import { ProgramBundle } from './types';
2
+
3
+ /** Compile the heatmap shader program (scientific/trading/full bundles). */
4
+ export declare function registerHeatmapProgram(gl: WebGLRenderingContext, bundle: ProgramBundle): void;
@@ -1,31 +1,5 @@
1
- export declare function parseColor(color: string): [number, number, number, number];
2
- export declare function brightenColor(color: string, isDarkTheme?: boolean): string;
3
- export declare function interleaveData(x: Float32Array | Float64Array | number[], y: Float32Array | Float64Array | number[]): Float32Array;
4
- export declare function interleaveStepData(x: Float32Array | Float64Array | number[], y: Float32Array | Float64Array | number[], mode?: "before" | "after" | "center"): Float32Array;
5
- export declare function interleaveBandData(x: Float32Array | Float64Array | number[], y1: Float32Array | Float64Array | number[], y2: Float32Array | Float64Array | number[]): Float32Array;
6
- export declare function interleaveErrorData(x: Float32Array | Float64Array | number[], y: Float32Array | Float64Array | number[], yErr?: {
7
- yError?: Float32Array | Float64Array;
8
- yErrorMinus?: Float32Array | Float64Array;
9
- yErrorPlus?: Float32Array | Float64Array;
10
- }, xErr?: {
11
- xError?: Float32Array | Float64Array;
12
- xErrorMinus?: Float32Array | Float64Array;
13
- xErrorPlus?: Float32Array | Float64Array;
14
- }): Float32Array;
15
- export declare function interleaveBoxPlotData(x: Float32Array | Float64Array | number[], min: Float32Array | Float64Array | number[], q1: Float32Array | Float64Array | number[], median: Float32Array | Float64Array | number[], q3: Float32Array | Float64Array | number[], max: Float32Array | Float64Array | number[], width: number): {
16
- lines: Float32Array;
17
- boxes: Float32Array;
18
- };
19
1
  /**
20
- * Interleave data for Waterfall charts
21
- * Creates rectangles that show cumulative changes from a running total
2
+ * Native WebGL utilities — re-exports core + extended for backward compatibility.
22
3
  */
23
- export declare function interleaveWaterfallData(x: Float32Array | Float64Array | number[], y: Float32Array | Float64Array | number[], width: number, isSubtotal?: boolean[]): {
24
- positiveData: Float32Array;
25
- negativeData: Float32Array;
26
- subtotalData: Float32Array;
27
- connectorData: Float32Array;
28
- positiveCount: number;
29
- negativeCount: number;
30
- subtotalCount: number;
31
- };
4
+ export { parseColor, brightenColor, interleaveData, interleaveStepData, interleaveBandData, interleaveErrorData, } from './utilsCore';
5
+ export { interleaveBoxPlotData, interleaveWaterfallData, } from './utilsExtended';
@@ -0,0 +1,14 @@
1
+ export declare function parseColor(color: string): [number, number, number, number];
2
+ export declare function brightenColor(color: string, isDarkTheme?: boolean): string;
3
+ export declare function interleaveData(x: Float32Array | Float64Array | number[], y: Float32Array | Float64Array | number[]): Float32Array;
4
+ export declare function interleaveStepData(x: Float32Array | Float64Array | number[], y: Float32Array | Float64Array | number[], mode?: "before" | "after" | "center"): Float32Array;
5
+ export declare function interleaveBandData(x: Float32Array | Float64Array | number[], y1: Float32Array | Float64Array | number[], y2: Float32Array | Float64Array | number[]): Float32Array;
6
+ export declare function interleaveErrorData(x: Float32Array | Float64Array | number[], y: Float32Array | Float64Array | number[], yErr?: {
7
+ yError?: Float32Array | Float64Array;
8
+ yErrorMinus?: Float32Array | Float64Array;
9
+ yErrorPlus?: Float32Array | Float64Array;
10
+ }, xErr?: {
11
+ xError?: Float32Array | Float64Array;
12
+ xErrorMinus?: Float32Array | Float64Array;
13
+ xErrorPlus?: Float32Array | Float64Array;
14
+ }): Float32Array;
@@ -0,0 +1,17 @@
1
+ export declare function interleaveBoxPlotData(x: Float32Array | Float64Array | number[], min: Float32Array | Float64Array | number[], q1: Float32Array | Float64Array | number[], median: Float32Array | Float64Array | number[], q3: Float32Array | Float64Array | number[], max: Float32Array | Float64Array | number[], width: number): {
2
+ lines: Float32Array;
3
+ boxes: Float32Array;
4
+ };
5
+ /**
6
+ * Interleave data for Waterfall charts
7
+ * Creates rectangles that show cumulative changes from a running total
8
+ */
9
+ export declare function interleaveWaterfallData(x: Float32Array | Float64Array | number[], y: Float32Array | Float64Array | number[], width: number, isSubtotal?: boolean[]): {
10
+ positiveData: Float32Array;
11
+ negativeData: Float32Array;
12
+ subtotalData: Float32Array;
13
+ connectorData: Float32Array;
14
+ positiveCount: number;
15
+ negativeCount: number;
16
+ subtotalCount: number;
17
+ };
@@ -0,0 +1 @@
1
+ export declare function registerExtendedOverlayDrawers(): void;
@@ -0,0 +1 @@
1
+ export declare function registerExtendedSeries(): void;
@@ -0,0 +1,2 @@
1
+ /** Enable `renderer: 'webgpu'` for charts (extended bundles only). */
2
+ export declare function registerWebGPURenderer(): void;
@@ -0,0 +1,4 @@
1
+ declare const CORE_LITE_TYPES: Set<string>;
2
+ /** Register extended series buffer handlers (call from trading/scientific/full entries). */
3
+ export declare function registerExtendedSeriesBuffers(): void;
4
+ export { CORE_LITE_TYPES };
@@ -1,8 +1,4 @@
1
- /**
2
- * velo-plot/scientific — focused scientific visualization bundle (Stage 5).
3
- * Tree-shakes trading-only plugins; includes analysis, FFT, regression,
4
- * forecasting, LaTeX, 3D, and related scientific tooling.
5
- */
1
+
6
2
  export { createChart } from '../core/Chart';
7
3
  export type { Chart, ChartOptions, ExportOptions } from '../core/Chart';
8
4
  export { Series } from '../core/Series';
@@ -0,0 +1 @@
1
+ export declare function registerScientificBundle(): void;
@@ -1,12 +1,12 @@
1
- import { D as r, e as o, E as t, d as s, L as n, a as i, M as m, S as l, i as c, c as f, b as p, f as g, j as u, h as x, g as P, m as d, r as y, s as E } from "./ChartCore-BpzRvN4Y.js";
2
- import { E as A } from "./axisFormat-CzumxpCL.js";
3
- import { c as S } from "./createStackedChart-Dm-YqUT7.js";
4
- import { PluginAnalysis as D, analyzeComplexSpectrum as L, analyzeSpectrum as v, blackmanWindow as M, dominantFrequency as w, fft as H, fftFromComplexInput as I, hammingWindow as B, hanningWindow as R, ifft as b, powerSpectrum as _ } from "./plugins/analysis.js";
1
+ import { E as r } from "./axisFormat-Sz4WIJfQ.js";
2
+ import { b as t, c as s, d as n, e as i, m, r as l, s as c } from "./createStackedChart-DqcLCFGS.js";
3
+ import { D as p, e as g, E as u, d as x, L as P, a as d, M as y, S as E, c as T, b as A, f as S, g as h } from "./ChartCore-AnR_3Xkb.js";
4
+ import { PluginAnalysis as D, analyzeComplexSpectrum as L, analyzeSpectrum as v, blackmanWindow as M, dominantFrequency as w, fft as H, fftFromComplexInput as I, hammingWindow as b, hanningWindow as B, ifft as R, powerSpectrum as _ } from "./plugins/analysis.js";
5
5
  import { P as F, a as G, d as W, o as z } from "./index-0InEyj0q.js";
6
6
  import { PluginRegression as V } from "./plugins/regression.js";
7
- import { PluginForecasting as q } from "./plugins/forecasting.js";
8
- import { PluginLaTeX as O } from "./plugins/latex.js";
9
- import { Plugin3D as X } from "./plugins/3d.js";
7
+ import { PluginForecasting as K } from "./plugins/forecasting.js";
8
+ import { PluginLaTeX as U } from "./plugins/latex.js";
9
+ import { Plugin3D as j } from "./plugins/3d.js";
10
10
  import { PluginAnomalyDetection as Q } from "./plugins/anomaly-detection.js";
11
11
  import { PluginPatternRecognition as Z } from "./plugins/pattern-recognition.js";
12
12
  import { PluginMLIntegration as aa } from "./plugins/ml-integration.js";
@@ -15,28 +15,28 @@ import { PluginRadar as ta } from "./plugins/radar.js";
15
15
  import { PluginDataTransform as na } from "./plugins/data-transform.js";
16
16
  import { PluginSnapshot as ma } from "./plugins/snapshot.js";
17
17
  import { PluginAnnotations as ca } from "./plugins/annotations.js";
18
- import { P as pa } from "./index-qunX30Xu.js";
18
+ import { P as pa } from "./index-B7PTX94B.js";
19
19
  import { C as ua, c as xa } from "./index-CaXWSOTk.js";
20
- import { h as da, d as ya, e as Ea, i as Ta, b as Aa, a as ha, f as Sa, c as Ca, g as Da, m as La, s as va, v as Ma } from "./utils-Dx0h0bgQ.js";
21
- import { a as Ha, c as Ia, d as Ba, i as Ra, s as ba } from "./math-Ddm2EZjj.js";
20
+ import { h as da, d as ya, e as Ea, i as Ta, b as Aa, a as Sa, f as ha, c as Ca, g as Da, m as La, s as va, v as Ma } from "./utils-Dx0h0bgQ.js";
21
+ import { a as Ha, c as Ia, d as ba, i as Ba, s as Ra } from "./math-Ddm2EZjj.js";
22
22
  export {
23
23
  ua as ChartGroup,
24
- r as DARK_THEME,
25
- o as DEFAULT_THEME,
26
- t as ELECTROCHEM_THEME,
27
- A as EventEmitter,
28
- s as LIGHT_THEME,
29
- n as LinearScale,
30
- i as LogScale,
31
- m as MIDNIGHT_THEME,
32
- X as Plugin3D,
24
+ p as DARK_THEME,
25
+ g as DEFAULT_THEME,
26
+ u as ELECTROCHEM_THEME,
27
+ r as EventEmitter,
28
+ x as LIGHT_THEME,
29
+ P as LinearScale,
30
+ d as LogScale,
31
+ y as MIDNIGHT_THEME,
32
+ j as Plugin3D,
33
33
  D as PluginAnalysis,
34
34
  ca as PluginAnnotations,
35
35
  Q as PluginAnomalyDetection,
36
36
  ra as PluginBrokenAxis,
37
37
  na as PluginDataTransform,
38
- q as PluginForecasting,
39
- O as PluginLaTeX,
38
+ K as PluginForecasting,
39
+ U as PluginLaTeX,
40
40
  aa as PluginMLIntegration,
41
41
  Z as PluginPatternRecognition,
42
42
  ta as PluginRadar,
@@ -44,47 +44,47 @@ export {
44
44
  ma as PluginSnapshot,
45
45
  pa as PluginTools,
46
46
  F as PluginVirtualization,
47
- l as Series,
47
+ E as Series,
48
48
  L as analyzeComplexSpectrum,
49
49
  v as analyzeSpectrum,
50
50
  M as blackmanWindow,
51
- c as bollingerBandsAsync,
51
+ t as bollingerBandsAsync,
52
52
  Ha as calculateR2,
53
53
  da as calculateStats,
54
- f as createChart,
54
+ T as createChart,
55
55
  xa as createChartGroup,
56
- p as createScale,
57
- S as createStackedChart,
58
- g as createTheme,
56
+ A as createScale,
57
+ s as createStackedChart,
58
+ S as createTheme,
59
59
  Ia as cumulativeIntegral,
60
- Ba as derivative,
60
+ ba as derivative,
61
61
  G as destroyDownsamplePool,
62
- u as destroyIndicatorPool,
62
+ n as destroyIndicatorPool,
63
63
  ya as detectCycles,
64
64
  Ea as detectPeaks,
65
65
  w as dominantFrequency,
66
66
  W as downsampleAsync,
67
67
  Ta as downsampleLTTB,
68
- x as emaAsync,
68
+ i as emaAsync,
69
69
  H as fft,
70
70
  I as fftFromComplexInput,
71
71
  Aa as formatScientific,
72
- ha as formatValue,
73
- Sa as formatWithPrefix,
72
+ Sa as formatValue,
73
+ ha as formatWithPrefix,
74
74
  Ca as generateCycleColors,
75
75
  Da as getBestPrefix,
76
- P as getThemeByName,
77
- B as hammingWindow,
78
- R as hanningWindow,
79
- b as ifft,
80
- Ra as integrate,
81
- d as macdAsync,
76
+ h as getThemeByName,
77
+ b as hammingWindow,
78
+ B as hanningWindow,
79
+ R as ifft,
80
+ Ba as integrate,
81
+ m as macdAsync,
82
82
  La as movingAverage,
83
83
  z as ohlcDownsampleAsync,
84
84
  _ as powerSpectrum,
85
- y as rsiAsync,
86
- E as smaAsync,
87
- ba as solveLinearSystem,
85
+ l as rsiAsync,
86
+ c as smaAsync,
87
+ Ra as solveLinearSystem,
88
88
  va as subtractBaseline,
89
89
  Ma as validateData
90
90
  };