velo-plot 1.12.0 → 1.15.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 (101) hide show
  1. package/README.md +14 -0
  2. package/dist/{index.core-xiNcuFfJ.js → ChartCore-BimVvUEg.js} +922 -929
  3. package/dist/ChartCore-BimVvUEg.js.map +1 -0
  4. package/dist/core/chart/ChartCore.d.ts +1 -0
  5. package/dist/core/chart/exporter/SVGExporter.d.ts +7 -2
  6. package/dist/core/chart/types.d.ts +2 -0
  7. package/dist/core/render/pixelSnap.d.ts +8 -0
  8. package/dist/core/stacked/index.d.ts +3 -1
  9. package/dist/core/stacked/paneResize.d.ts +15 -18
  10. package/dist/core/stacked/stackExport.d.ts +18 -0
  11. package/dist/core/stacked/types.d.ts +34 -5
  12. package/dist/createStackedChart-CjsKcOvX.js +1088 -0
  13. package/dist/createStackedChart-CjsKcOvX.js.map +1 -0
  14. package/dist/index-CUGS98p4.js +277 -0
  15. package/dist/index-CUGS98p4.js.map +1 -0
  16. package/dist/index-ChgIdk3N.js +229 -0
  17. package/dist/index-ChgIdk3N.js.map +1 -0
  18. package/dist/index.core-C_-CFftD.js +167 -0
  19. package/dist/index.core-C_-CFftD.js.map +1 -0
  20. package/dist/math-Ddm2EZjj.js +85 -0
  21. package/dist/math-Ddm2EZjj.js.map +1 -0
  22. package/dist/plugins/analysis.js +132 -130
  23. package/dist/plugins/analysis.js.map +1 -1
  24. package/dist/plugins/anomaly-detection.d.ts +1 -0
  25. package/dist/plugins/anomaly-detection.js +221 -0
  26. package/dist/plugins/anomaly-detection.js.map +1 -0
  27. package/dist/plugins/broken-axis.d.ts +3 -0
  28. package/dist/plugins/broken-axis.js +262 -0
  29. package/dist/plugins/broken-axis.js.map +1 -0
  30. package/dist/plugins/caching.d.ts +3 -0
  31. package/dist/plugins/caching.js +182 -0
  32. package/dist/plugins/caching.js.map +1 -0
  33. package/dist/plugins/data-transform.d.ts +3 -0
  34. package/dist/plugins/data-transform.js +146 -0
  35. package/dist/plugins/data-transform.js.map +1 -0
  36. package/dist/plugins/debug.js +12 -11
  37. package/dist/plugins/debug.js.map +1 -1
  38. package/dist/plugins/forecasting.d.ts +1 -0
  39. package/dist/plugins/forecasting.js +236 -0
  40. package/dist/plugins/forecasting.js.map +1 -0
  41. package/dist/plugins/latex.d.ts +1 -0
  42. package/dist/plugins/latex.js +454 -0
  43. package/dist/plugins/latex.js.map +1 -0
  44. package/dist/plugins/lazy-load.d.ts +3 -0
  45. package/dist/plugins/lazy-load.js +189 -0
  46. package/dist/plugins/lazy-load.js.map +1 -0
  47. package/dist/plugins/ml-integration.d.ts +3 -0
  48. package/dist/plugins/ml-integration.js +355 -0
  49. package/dist/plugins/ml-integration.js.map +1 -0
  50. package/dist/plugins/offscreen.d.ts +3 -0
  51. package/dist/plugins/offscreen.js +169 -0
  52. package/dist/plugins/offscreen.js.map +1 -0
  53. package/dist/plugins/pattern-recognition.d.ts +3 -0
  54. package/dist/plugins/pattern-recognition.js +690 -0
  55. package/dist/plugins/pattern-recognition.js.map +1 -0
  56. package/dist/plugins/radar.d.ts +3 -0
  57. package/dist/plugins/radar.js +103 -0
  58. package/dist/plugins/radar.js.map +1 -0
  59. package/dist/plugins/regression.d.ts +3 -0
  60. package/dist/plugins/regression.js +634 -0
  61. package/dist/plugins/regression.js.map +1 -0
  62. package/dist/plugins/roi.d.ts +1 -0
  63. package/dist/plugins/roi.js +223 -0
  64. package/dist/plugins/roi.js.map +1 -0
  65. package/dist/plugins/snapshot/types.d.ts +1 -1
  66. package/dist/plugins/snapshot.d.ts +3 -0
  67. package/dist/plugins/snapshot.js +90 -0
  68. package/dist/plugins/snapshot.js.map +1 -0
  69. package/dist/plugins/sync/index.d.ts +2 -1
  70. package/dist/plugins/sync.js +13 -269
  71. package/dist/plugins/sync.js.map +1 -1
  72. package/dist/plugins/video-recorder.d.ts +3 -0
  73. package/dist/plugins/video-recorder.js +104 -0
  74. package/dist/plugins/video-recorder.js.map +1 -0
  75. package/dist/plugins/virtualization.d.ts +3 -0
  76. package/dist/plugins/virtualization.js +6 -0
  77. package/dist/plugins/virtualization.js.map +1 -0
  78. package/dist/react.d.ts +1 -0
  79. package/dist/react.js +31 -0
  80. package/dist/react.js.map +1 -0
  81. package/dist/utils-BK5UUXxj.js +172 -0
  82. package/dist/utils-BK5UUXxj.js.map +1 -0
  83. package/dist/velo-plot.full.js +920 -6003
  84. package/dist/velo-plot.full.js.map +1 -1
  85. package/dist/velo-plot.js +23 -22
  86. package/dist/velo-plot.js.map +1 -1
  87. package/package.json +9 -2
  88. package/dist/core/OverlayRenderer.test.d.ts +0 -1
  89. package/dist/core/chart/ChartScaling.test.d.ts +0 -1
  90. package/dist/core/chart/NavigationUtils.test.d.ts +0 -1
  91. package/dist/core/format/axisFormat.test.d.ts +0 -1
  92. package/dist/core/indicator/buildIndicatorSeries.test.d.ts +0 -1
  93. package/dist/core/series/SeriesBounds.test.d.ts +0 -1
  94. package/dist/core/stacked/createStackedChart.test.d.ts +0 -1
  95. package/dist/core/stacked/paneAxis.test.d.ts +0 -1
  96. package/dist/core/stacked/paneResize.test.d.ts +0 -1
  97. package/dist/core/sync/index.test.d.ts +0 -1
  98. package/dist/index.core-xiNcuFfJ.js.map +0 -1
  99. package/dist/plugins/tools/tooltip/format.test.d.ts +0 -1
  100. package/dist/utils-Dbro9-qM.js +0 -254
  101. package/dist/utils-Dbro9-qM.js.map +0 -1
@@ -126,6 +126,7 @@ export declare class ChartImpl implements Chart {
126
126
  };
127
127
  private getInteractedBounds;
128
128
  exportImage(type?: "png" | "jpeg"): string;
129
+ exportSVG(): string;
129
130
  private getSeriesContext;
130
131
  addSeries(options: SeriesOptions | HeatmapOptions): void;
131
132
  addBar(options: Omit<SeriesOptions, "type">): void;
@@ -1,6 +1,11 @@
1
1
  import { Series } from '../../Series';
2
- import { Bounds, PlotArea } from '../../../types';
2
+ import { AxisOptions, Bounds, PlotArea } from '../../../types';
3
3
  import { Scale } from '../../../scales';
4
4
  import { ChartTheme } from '../../../theme';
5
5
 
6
- export declare function exportToSVG(series: Series[], _viewBounds: Bounds, plotArea: PlotArea, xAxis: Scale, yAxes: Map<string, Scale>, theme: ChartTheme, width: number, height: number): string;
6
+ export interface SVGExportOptions {
7
+ xAxis?: AxisOptions;
8
+ yAxis?: AxisOptions;
9
+ primaryYAxisId?: string;
10
+ }
11
+ export declare function exportToSVG(series: Series[], _viewBounds: Bounds, plotArea: PlotArea, xAxis: Scale, yAxes: Map<string, Scale>, theme: ChartTheme, width: number, height: number, axisOptions?: SVGExportOptions): string;
@@ -44,6 +44,8 @@ export interface Chart {
44
44
  off<K extends keyof ChartEventMap>(event: K, handler: (data: ChartEventMap[K]) => void): void;
45
45
  destroy(): void;
46
46
  exportImage(type?: "png" | "jpeg"): string;
47
+ /** Vector export of series, axes, grid, and tick labels */
48
+ exportSVG(): string;
47
49
  autoScale(animate?: boolean): void;
48
50
  setTheme(theme: string | object): void;
49
51
  /** Access to data analysis utilities */
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Canvas pixel-alignment helpers for crisp 1px lines and sharper text.
3
+ * Coordinates are in CSS/logical space (before or after setTransform(dpr)).
4
+ */
5
+ /** Snap a coordinate to the center of a physical pixel (crisp 1px strokes). */
6
+ export declare function snapLineCoord(value: number): number;
7
+ /** Snap label positions to whole pixels (reduces sub-pixel blur on fillText). */
8
+ export declare function snapLabelCoord(value: number): number;
@@ -1,4 +1,6 @@
1
1
  export { createStackedChart } from './createStackedChart';
2
- export type { StackedChart, StackedChartOptions, StackedPaneConfig, StackedSyncOptions } from './types';
2
+ export type { StackedChart, StackedChartOptions, StackedPaneConfig, StackedSyncOptions, StackDirection, StackSnapshotOptions, } from './types';
3
3
  export { STACKED_MAX_PANES, STACKED_DEFAULT_MIN_PANE_RATIO, } from './types';
4
+ export { exportStackImage } from './stackExport';
5
+ export type { StackExportOptions } from './stackExport';
4
6
  export { normalizePaneHeights, resolveMinPaneHeightPx, } from './paneResize';
@@ -1,32 +1,29 @@
1
- /**
2
- * VS Code–style drag dividers between stacked chart panes.
3
- */
1
+ import { StackDirection } from './types';
2
+
4
3
  export interface PaneResizeOptions {
5
- /** Min pane height as fraction of available height (default 1/6) */
4
+ /** Stack layout direction */
5
+ direction?: StackDirection;
6
+ /** Min pane size as fraction of available stack dimension (default 1/6) */
6
7
  minPaneRatio?: number;
7
- /** Absolute min pane height in px — used when larger than ratio-based min */
8
+ /** Absolute min pane size in px */
8
9
  minPanePx?: number;
9
- /** Divider hit area height (default 6) */
10
+ /** Divider hit area size (default 6) */
10
11
  dividerSize?: number;
11
- /** Called while dragging with normalized flex ratios keyed by pane id */
12
12
  onResize?: (ratiosById: Record<string, number>) => void;
13
- /** Called when divider drag starts — return initial pane heights for this drag session */
14
- onDragStart?: (topIdx: number, bottomIdx: number) => number[];
15
- /** Called each pointer move (batched to rAF by consumer) with updated heights */
16
- onDragMove?: (heightsPx: number[], topIdx: number, bottomIdx: number) => void;
17
- /** Called when divider drag ends — perform chart resize here */
18
- onDragEnd?: (finalHeightsPx: number[]) => void;
13
+ onDragStart?: (leadingIdx: number, trailingIdx: number) => number[];
14
+ onDragMove?: (sizesPx: number[], leadingIdx: number, trailingIdx: number) => void;
15
+ onDragEnd?: (finalSizesPx: number[]) => void;
19
16
  }
20
17
  export interface PaneResizeController {
21
18
  dividers: HTMLDivElement[];
22
19
  destroy: () => void;
23
20
  }
24
- /** Resolve per-pane minimum height in px for the current available stack height. */
21
+ declare function paneFlexStyle(ratio: number | string, direction: StackDirection): string;
25
22
  export declare function resolveMinPaneHeightPx(availHeight: number, paneCount: number, minPaneRatio?: number, minPanePx?: number): number;
26
- /**
27
- * Scale pane heights to exactly fill available space (fixes sub-pixel gaps during drag).
28
- */
23
+ export declare function resolveMinPaneWidthPx(availWidth: number, paneCount: number, minPaneRatio?: number, minPanePx?: number): number;
29
24
  export declare function normalizePaneHeights(heightsPx: number[], targetTotal: number): number[];
25
+ export declare const normalizePaneWidths: typeof normalizePaneHeights;
30
26
  export declare function attachPaneResize(container: HTMLDivElement, paneWrappers: HTMLDivElement[], paneIds: string[], ratios: number[], options?: PaneResizeOptions): PaneResizeController;
31
- export declare function applyPaneFlexRatios(paneWrappers: HTMLDivElement[], ratios: number[]): void;
27
+ export declare function applyPaneFlexRatios(paneWrappers: HTMLDivElement[], ratios: number[], direction?: StackDirection): void;
32
28
  export declare function initialPaneRatio(height: number | string): number;
29
+ export { paneFlexStyle };
@@ -0,0 +1,18 @@
1
+ import { Chart } from '../chart/types';
2
+
3
+ export type StackExportFormat = "png" | "jpeg" | "webp";
4
+ export type StackExportResolution = "standard" | "2k" | "4k" | "8k" | number;
5
+ export interface StackExportOptions {
6
+ format?: StackExportFormat;
7
+ quality?: number;
8
+ resolution?: StackExportResolution;
9
+ includeBackground?: boolean;
10
+ includeDividers?: boolean;
11
+ transparent?: boolean;
12
+ }
13
+ /** @internal Exported for unit tests */
14
+ export declare function stackResolutionScale(res: StackExportResolution): number;
15
+ /**
16
+ * Compose every pane chart into one raster image matching the on-screen stack layout.
17
+ */
18
+ export declare function exportStackImage(container: HTMLDivElement, paneWrappers: HTMLDivElement[], paneCharts: Chart[], dividers: HTMLDivElement[], backgroundColor: string, options?: StackExportOptions): Promise<string>;
@@ -3,17 +3,21 @@ import { ChartGroup, SyncAxis, SyncOptions } from '../sync';
3
3
  import { ChartOptions as RootChartOptions, Range, SeriesOptions } from '../../types';
4
4
  import { LayoutOptions } from '../layout';
5
5
 
6
+ /** Stack layout direction */
7
+ export type StackDirection = "vertical" | "horizontal";
6
8
  /** Per-pane configuration (max 5 panes per stack) */
7
9
  export interface StackedPaneConfig {
8
10
  id: string;
9
- /** Flex ratio (e.g. 0.6) or CSS length ("24%", "80px") */
11
+ /** Flex ratio (e.g. 0.6) or CSS length ("24%", "80px") — height ratio when vertical, width ratio when horizontal */
10
12
  height: number | string;
11
13
  /** Chart options excluding container/id (series added via chart API or `series`) */
12
14
  chart?: Omit<RootChartOptions, "container" | "id">;
13
15
  /** Series to add immediately after pane chart is created */
14
16
  series?: SeriesOptions[];
15
- /** Show native X axis (default: only bottom pane when sharedXAxis is bottom) */
17
+ /** Show native X axis (default: only bottom pane when vertical + sharedXAxis; each pane when horizontal) */
16
18
  showXAxis?: boolean;
19
+ /** Show native Y axis (default: only first pane when horizontal + sharedYAxis) */
20
+ showYAxis?: boolean;
17
21
  /** Receive pan/zoom (default: true on every pane) */
18
22
  interactive?: boolean;
19
23
  /** Lock Y range — skips auto fit on Y for this pane */
@@ -22,12 +26,16 @@ export interface StackedPaneConfig {
22
26
  export interface StackedChartOptions {
23
27
  /** Root container (will be cleared and filled with pane layout) */
24
28
  container: HTMLDivElement;
25
- /** 1–5 stacked panes, top to bottom */
29
+ /** 1–5 stacked panes */
26
30
  panes: StackedPaneConfig[];
27
- /** Pane that drives X sync (default: first pane) */
31
+ /** Layout direction (default: vertical — panes top to bottom) */
32
+ direction?: StackDirection;
33
+ /** Pane that drives sync (default: first pane) */
28
34
  masterPaneId?: string;
29
- /** Shared date/time row on bottom pane only */
35
+ /** Shared date/time row on bottom pane only (vertical layout) */
30
36
  sharedXAxis?: "bottom" | "none";
37
+ /** Shared Y axis on left pane only (horizontal layout) */
38
+ sharedYAxis?: "left" | "none";
31
39
  /** Shared theme applied to every pane */
32
40
  theme?: string | object;
33
41
  devicePixelRatio?: number;
@@ -75,6 +83,10 @@ export interface StackedChart {
75
83
  setSyncOptions(options: Partial<StackedSyncOptions>): void;
76
84
  /** Resolves when all pane charts have started rendering */
77
85
  whenReady(): Promise<void>;
86
+ /** Export the entire stack as one PNG/JPEG/WebP image (WYSIWYG layout) */
87
+ exportImage(options?: StackSnapshotOptions): Promise<string>;
88
+ /** Alias for exportImage */
89
+ snapshot(options?: StackSnapshotOptions): Promise<string>;
78
90
  destroy(): void;
79
91
  }
80
92
  export declare const STACKED_MAX_PANES = 5;
@@ -83,9 +95,26 @@ export declare const STACKED_DEFAULT_MIN_PANE_RATIO: number;
83
95
  export declare const STACKED_COMPACT_MARGIN: {
84
96
  top: number;
85
97
  bottom: number;
98
+ left: number;
86
99
  };
87
100
  export declare const STACKED_FULL_X_MARGIN: {
88
101
  bottom: number;
89
102
  };
103
+ export declare const STACKED_FULL_Y_MARGIN: {
104
+ left: number;
105
+ };
106
+ /** Options for full-stack image export */
107
+ export type StackSnapshotFormat = "png" | "jpeg" | "webp";
108
+ export type StackSnapshotResolution = "standard" | "2k" | "4k" | "8k" | number;
109
+ export interface StackSnapshotOptions {
110
+ format?: StackSnapshotFormat;
111
+ quality?: number;
112
+ resolution?: StackSnapshotResolution;
113
+ includeBackground?: boolean;
114
+ includeDividers?: boolean;
115
+ transparent?: boolean;
116
+ download?: boolean;
117
+ fileName?: string;
118
+ }
90
119
  /** Pan/zoom sync between stacked panes (Y stays independent when axis is `x`). */
91
120
  export type StackedSyncOptions = Pick<SyncOptions, "axis" | "syncCursor" | "syncSelection" | "syncZoom" | "syncPan" | "bidirectional" | "debounce">;