scichart-engine 0.4.1
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/LICENSE +21 -0
- package/README.md +81 -0
- package/dist/analysis/contours.d.ts +20 -0
- package/dist/analysis/fitting.d.ts +24 -0
- package/dist/analysis/index.d.ts +12 -0
- package/dist/analysis/math.d.ts +32 -0
- package/dist/analysis/utils.d.ts +150 -0
- package/dist/core/Chart.d.ts +15 -0
- package/dist/core/ChartControls.d.ts +30 -0
- package/dist/core/ChartLegend.d.ts +35 -0
- package/dist/core/ChartStatistics.d.ts +18 -0
- package/dist/core/EventEmitter.d.ts +30 -0
- package/dist/core/InteractionManager.d.ts +67 -0
- package/dist/core/OverlayRenderer.d.ts +67 -0
- package/dist/core/Series.d.ts +4 -0
- package/dist/core/annotations/AnnotationManager.d.ts +57 -0
- package/dist/core/annotations/index.d.ts +5 -0
- package/dist/core/annotations/types.d.ts +157 -0
- package/dist/core/chart/ChartCore.d.ts +103 -0
- package/dist/core/chart/ChartExporter.d.ts +18 -0
- package/dist/core/chart/ChartNavigation.d.ts +33 -0
- package/dist/core/chart/ChartRenderer.d.ts +53 -0
- package/dist/core/chart/ChartScaling.d.ts +26 -0
- package/dist/core/chart/ChartSeries.d.ts +4 -0
- package/dist/core/chart/ChartSetup.d.ts +64 -0
- package/dist/core/chart/ChartUI.d.ts +22 -0
- package/dist/core/chart/exporter/SVGExporter.d.ts +6 -0
- package/dist/core/chart/exporter/index.d.ts +5 -0
- package/dist/core/chart/index.d.ts +14 -0
- package/dist/core/chart/plugins/PluginManager.d.ts +13 -0
- package/dist/core/chart/plugins/types.d.ts +13 -0
- package/dist/core/chart/series/SeriesActions.d.ts +7 -0
- package/dist/core/chart/series/SeriesBuffer.d.ts +4 -0
- package/dist/core/chart/series/SeriesFit.d.ts +3 -0
- package/dist/core/chart/series/index.d.ts +7 -0
- package/dist/core/chart/series/types.d.ts +22 -0
- package/dist/core/chart/types.d.ts +72 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/series/Series.d.ts +52 -0
- package/dist/core/series/SeriesBounds.d.ts +3 -0
- package/dist/core/series/SeriesDataUtils.d.ts +7 -0
- package/dist/core/series/index.d.ts +6 -0
- package/dist/core/tooltip/TooltipManager.d.ts +203 -0
- package/dist/core/tooltip/TooltipPositioner.d.ts +83 -0
- package/dist/core/tooltip/TooltipRenderer.d.ts +64 -0
- package/dist/core/tooltip/index.d.ts +18 -0
- package/dist/core/tooltip/templates/AnnotationTemplate.d.ts +18 -0
- package/dist/core/tooltip/templates/CrosshairTemplate.d.ts +30 -0
- package/dist/core/tooltip/templates/DefaultTemplate.d.ts +30 -0
- package/dist/core/tooltip/templates/HeatmapTemplate.d.ts +34 -0
- package/dist/core/tooltip/templates/MinimalTemplate.d.ts +26 -0
- package/dist/core/tooltip/templates/RangeTemplate.d.ts +18 -0
- package/dist/core/tooltip/templates/ScientificTemplate.d.ts +34 -0
- package/dist/core/tooltip/templates/index.d.ts +27 -0
- package/dist/core/tooltip/themes.d.ts +48 -0
- package/dist/core/tooltip/types.d.ts +396 -0
- package/dist/examples.d.ts +19 -0
- package/dist/gpu/adapter/gpuRenderer.d.ts +135 -0
- package/dist/gpu/adapter/index.d.ts +7 -0
- package/dist/gpu/adapter/seriesAdapter.d.ts +88 -0
- package/dist/gpu/backends/webgl/WebGLBackend.d.ts +42 -0
- package/dist/gpu/backends/webgl/index.d.ts +5 -0
- package/dist/gpu/backends/webgl/programFactory.d.ts +30 -0
- package/dist/gpu/backends/webgl/shaders.d.ts +14 -0
- package/dist/gpu/backends/webgpu/MassiveDataRenderer.d.ts +111 -0
- package/dist/gpu/backends/webgpu/WebGPUBackend.d.ts +58 -0
- package/dist/gpu/backends/webgpu/pipelines/bandPipeline.d.ts +24 -0
- package/dist/gpu/backends/webgpu/pipelines/heatmapPipeline.d.ts +28 -0
- package/dist/gpu/backends/webgpu/pipelines/index.d.ts +10 -0
- package/dist/gpu/backends/webgpu/pipelines/instancedLinePipeline.d.ts +23 -0
- package/dist/gpu/backends/webgpu/pipelines/instancedPointPipeline.d.ts +25 -0
- package/dist/gpu/backends/webgpu/pipelines/linePipeline.d.ts +23 -0
- package/dist/gpu/backends/webgpu/pipelines/pointPipeline.d.ts +28 -0
- package/dist/gpu/backends/webgpu/pipelines/trianglePipeline.d.ts +5 -0
- package/dist/gpu/backends/webgpu/pipelines/triangleShader.d.ts +1 -0
- package/dist/gpu/backends/webgpu/shaders/heatmap.wgsl.d.ts +8 -0
- package/dist/gpu/backends/webgpu/shaders/index.d.ts +8 -0
- package/dist/gpu/backends/webgpu/shaders/instanced.wgsl.d.ts +16 -0
- package/dist/gpu/backends/webgpu/shaders/line.wgsl.d.ts +8 -0
- package/dist/gpu/backends/webgpu/shaders/point.wgsl.d.ts +9 -0
- package/dist/gpu/benchmark/benchmark.d.ts +74 -0
- package/dist/gpu/benchmark/index.d.ts +5 -0
- package/dist/gpu/compute/gpuCompute.d.ts +72 -0
- package/dist/gpu/compute/index.d.ts +6 -0
- package/dist/gpu/compute/shaders.d.ts +9 -0
- package/dist/gpu/drawList.d.ts +77 -0
- package/dist/gpu/examples/gallery.d.ts +20 -0
- package/dist/gpu/examples/index.d.ts +3 -0
- package/dist/gpu/examples/webgpu-line-demo.d.ts +8 -0
- package/dist/gpu/examples/webgpu-triangle.d.ts +1 -0
- package/dist/gpu/frame.d.ts +25 -0
- package/dist/gpu/index.d.ts +24 -0
- package/dist/gpu/resources/bufferStore.d.ts +40 -0
- package/dist/gpu/resources/index.d.ts +9 -0
- package/dist/gpu/resources/pipelineCache.d.ts +33 -0
- package/dist/gpu/resources/textureStore.d.ts +41 -0
- package/dist/gpu/types.d.ts +47 -0
- package/dist/index.d.ts +34 -0
- package/dist/overlay/CanvasOverlay.d.ts +102 -0
- package/dist/overlay/index.d.ts +4 -0
- package/dist/react/SciChart.d.ts +60 -0
- package/dist/react/index.d.ts +5 -0
- package/dist/react/useSciChart.d.ts +56 -0
- package/dist/renderer/BarRenderer.d.ts +14 -0
- package/dist/renderer/CandlestickRenderer.d.ts +12 -0
- package/dist/renderer/HeatmapRenderer.d.ts +15 -0
- package/dist/renderer/NativeWebGLRenderer.d.ts +16 -0
- package/dist/renderer/RendererInterface.d.ts +70 -0
- package/dist/renderer/WebGPURenderer.d.ts +16 -0
- package/dist/renderer/index.d.ts +10 -0
- package/dist/renderer/native/NativeWebGLRenderer.d.ts +30 -0
- package/dist/renderer/native/bufferStore.d.ts +11 -0
- package/dist/renderer/native/draw.d.ts +31 -0
- package/dist/renderer/native/programFactory.d.ts +3 -0
- package/dist/renderer/native/renderFrame.d.ts +3 -0
- package/dist/renderer/native/shaderSources.d.ts +6 -0
- package/dist/renderer/native/textureStore.d.ts +8 -0
- package/dist/renderer/native/types.d.ts +58 -0
- package/dist/renderer/native/utils.d.ts +4 -0
- package/dist/renderer/shaders.d.ts +77 -0
- package/dist/scales/index.d.ts +54 -0
- package/dist/scichart-engine.es.js +8408 -0
- package/dist/scichart-engine.es.js.map +1 -0
- package/dist/scichart-engine.umd.js +871 -0
- package/dist/scichart-engine.umd.js.map +1 -0
- package/dist/streaming/index.d.ts +7 -0
- package/dist/streaming/mock.d.ts +12 -0
- package/dist/streaming/types.d.ts +57 -0
- package/dist/streaming/utils.d.ts +19 -0
- package/dist/streaming/websocket.d.ts +6 -0
- package/dist/theme/index.d.ts +123 -0
- package/dist/types.d.ts +333 -0
- package/dist/workers/downsample.d.ts +34 -0
- package/dist/workers/downsample.worker.d.ts +46 -0
- package/package.json +59 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core module exports
|
|
3
|
+
*/
|
|
4
|
+
export { createChart, type Chart, type ChartOptions, type ExportOptions } from './Chart';
|
|
5
|
+
export { Series } from './Series';
|
|
6
|
+
export { EventEmitter } from './EventEmitter';
|
|
7
|
+
export { OverlayRenderer } from './OverlayRenderer';
|
|
8
|
+
export { InteractionManager } from './InteractionManager';
|
|
9
|
+
export * from './annotations';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { SeriesOptions, SeriesData, SeriesStyle, SeriesUpdateData, Bounds, SeriesType, HeatmapOptions, HeatmapData, HeatmapStyle } from '../../types';
|
|
2
|
+
|
|
3
|
+
export declare class Series {
|
|
4
|
+
private id;
|
|
5
|
+
private type;
|
|
6
|
+
private yAxisId?;
|
|
7
|
+
private data;
|
|
8
|
+
private style;
|
|
9
|
+
private visible;
|
|
10
|
+
private name?;
|
|
11
|
+
private stackId?;
|
|
12
|
+
private cycle?;
|
|
13
|
+
private maxPoints?;
|
|
14
|
+
bullishCount: number;
|
|
15
|
+
bearishCount: number;
|
|
16
|
+
private heatmapData?;
|
|
17
|
+
private heatmapStyle?;
|
|
18
|
+
private lastAppendCount;
|
|
19
|
+
private cachedBounds;
|
|
20
|
+
private boundsNeedsUpdate;
|
|
21
|
+
private _needsBufferUpdate;
|
|
22
|
+
private smoothedData;
|
|
23
|
+
private smoothingNeedsUpdate;
|
|
24
|
+
constructor(options: SeriesOptions | HeatmapOptions);
|
|
25
|
+
getId: () => string;
|
|
26
|
+
getName: () => string;
|
|
27
|
+
getType: () => SeriesType;
|
|
28
|
+
getYAxisId: () => string | undefined;
|
|
29
|
+
getStackId: () => string | undefined;
|
|
30
|
+
getVisible: () => boolean;
|
|
31
|
+
isVisible: () => boolean;
|
|
32
|
+
getStyle: () => SeriesStyle;
|
|
33
|
+
getHeatmapData: () => HeatmapData | undefined;
|
|
34
|
+
getHeatmapStyle: () => HeatmapStyle | undefined;
|
|
35
|
+
getCycle: () => number | undefined;
|
|
36
|
+
getPointCount: () => number;
|
|
37
|
+
getLastAppendCount: () => number;
|
|
38
|
+
resetLastAppendCount: () => void;
|
|
39
|
+
hasErrorData: () => boolean;
|
|
40
|
+
getYError: (i: number) => [number, number] | null;
|
|
41
|
+
getXError: (i: number) => [number, number] | null;
|
|
42
|
+
getData(): SeriesData;
|
|
43
|
+
getBounds(): Bounds | null;
|
|
44
|
+
updateData(update: SeriesUpdateData): void;
|
|
45
|
+
setStyle(style: Partial<SeriesStyle>): void;
|
|
46
|
+
setType(type: SeriesType): void;
|
|
47
|
+
setVisible(visible: boolean): void;
|
|
48
|
+
get needsBufferUpdate(): boolean;
|
|
49
|
+
set needsBufferUpdate(val: boolean);
|
|
50
|
+
setMaxPoints(maxPoints: number | undefined): void;
|
|
51
|
+
destroy(): void;
|
|
52
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SeriesData } from '../../types';
|
|
2
|
+
|
|
3
|
+
export declare function ensureTypedArray(data: Float32Array | Float64Array | number[] | undefined): Float32Array | Float64Array;
|
|
4
|
+
export declare function appendTypedArray(existing: Float32Array | Float64Array, newData: Float32Array | Float64Array): Float32Array | Float64Array;
|
|
5
|
+
export declare function applySmoothing(data: SeriesData, windowSize: number): SeriesData;
|
|
6
|
+
export declare function getYError(data: SeriesData, i: number): [number, number] | null;
|
|
7
|
+
export declare function getXError(data: SeriesData, i: number): [number, number] | null;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { PlotArea, Bounds } from '../../types';
|
|
2
|
+
import { Scale } from '../../scales';
|
|
3
|
+
import { Series } from '../Series';
|
|
4
|
+
import { TooltipData, TooltipOptions, TooltipTheme, TooltipTemplate, ShowTooltipOptions, TooltipEventMap } from './types';
|
|
5
|
+
import { ChartTheme } from '../../theme';
|
|
6
|
+
|
|
7
|
+
export interface TooltipManagerConfig {
|
|
8
|
+
/** Canvas 2D context for rendering */
|
|
9
|
+
overlayCtx: CanvasRenderingContext2D;
|
|
10
|
+
/** Chart theme (for auto-selecting tooltip theme) */
|
|
11
|
+
chartTheme: ChartTheme;
|
|
12
|
+
/** Function to get current plot area */
|
|
13
|
+
getPlotArea: () => PlotArea;
|
|
14
|
+
/** Function to get all series */
|
|
15
|
+
getSeries: () => Series[];
|
|
16
|
+
/** Function to convert pixel X to data X */
|
|
17
|
+
pixelToDataX: (px: number) => number;
|
|
18
|
+
/** Function to convert pixel Y to data Y */
|
|
19
|
+
pixelToDataY: (py: number) => number;
|
|
20
|
+
/** Function to get X scale */
|
|
21
|
+
getXScale: () => Scale;
|
|
22
|
+
/** Function to get Y scales */
|
|
23
|
+
getYScales: () => Map<string, Scale>;
|
|
24
|
+
/** Function to get view bounds */
|
|
25
|
+
getViewBounds: () => Bounds;
|
|
26
|
+
/** Initial options */
|
|
27
|
+
options?: TooltipOptions;
|
|
28
|
+
}
|
|
29
|
+
export declare class TooltipManager {
|
|
30
|
+
private ctx;
|
|
31
|
+
private getPlotArea;
|
|
32
|
+
private getSeries;
|
|
33
|
+
private pixelToDataX;
|
|
34
|
+
private pixelToDataY;
|
|
35
|
+
private getXScale;
|
|
36
|
+
private getYScales;
|
|
37
|
+
private options;
|
|
38
|
+
private theme;
|
|
39
|
+
private positioner;
|
|
40
|
+
private renderer;
|
|
41
|
+
private templates;
|
|
42
|
+
private events;
|
|
43
|
+
private activeTooltips;
|
|
44
|
+
private tooltipIdCounter;
|
|
45
|
+
private showTimeoutId;
|
|
46
|
+
private hideTimeoutId;
|
|
47
|
+
private lastCursorX;
|
|
48
|
+
private lastCursorY;
|
|
49
|
+
private hoveredSeriesId;
|
|
50
|
+
private hoveredDataIndex;
|
|
51
|
+
private cachedNearestResult;
|
|
52
|
+
private snapMode;
|
|
53
|
+
private largeDatasetThreshold;
|
|
54
|
+
private lastKnownDataSize;
|
|
55
|
+
private hysteresisRatio;
|
|
56
|
+
constructor(config: TooltipManagerConfig);
|
|
57
|
+
/**
|
|
58
|
+
* Register built-in templates
|
|
59
|
+
*/
|
|
60
|
+
private registerBuiltinTemplates;
|
|
61
|
+
/**
|
|
62
|
+
* Configure tooltip options
|
|
63
|
+
*/
|
|
64
|
+
configure(options: TooltipOptions): void;
|
|
65
|
+
/**
|
|
66
|
+
* Get current options
|
|
67
|
+
*/
|
|
68
|
+
getOptions(): TooltipOptions;
|
|
69
|
+
/**
|
|
70
|
+
* Enable/disable tooltips
|
|
71
|
+
*/
|
|
72
|
+
setEnabled(enabled: boolean): void;
|
|
73
|
+
/**
|
|
74
|
+
* Check if tooltips are enabled
|
|
75
|
+
*/
|
|
76
|
+
isEnabled(): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Set tooltip theme
|
|
79
|
+
*/
|
|
80
|
+
setTheme(theme: TooltipTheme | string): void;
|
|
81
|
+
/**
|
|
82
|
+
* Update theme based on chart theme
|
|
83
|
+
*/
|
|
84
|
+
updateChartTheme(chartTheme: ChartTheme): void;
|
|
85
|
+
/**
|
|
86
|
+
* Get current theme
|
|
87
|
+
*/
|
|
88
|
+
getTheme(): TooltipTheme;
|
|
89
|
+
/**
|
|
90
|
+
* Register a custom template
|
|
91
|
+
*/
|
|
92
|
+
registerTemplate<T extends TooltipData>(template: TooltipTemplate<T>): void;
|
|
93
|
+
/**
|
|
94
|
+
* Get a template by ID
|
|
95
|
+
*/
|
|
96
|
+
getTemplate(id: string): TooltipTemplate<TooltipData> | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* Handle cursor movement - main entry point for hover detection
|
|
99
|
+
* Optimized with hysteresis to prevent jumping between nearby points
|
|
100
|
+
*/
|
|
101
|
+
handleCursorMove(pixelX: number, pixelY: number): void;
|
|
102
|
+
/**
|
|
103
|
+
* Handle cursor leave
|
|
104
|
+
*/
|
|
105
|
+
handleCursorLeave(): void;
|
|
106
|
+
/**
|
|
107
|
+
* Get total number of data points across all visible series
|
|
108
|
+
*/
|
|
109
|
+
private getTotalDataPoints;
|
|
110
|
+
/**
|
|
111
|
+
* Determine the effective snap mode based on configuration and data size
|
|
112
|
+
*/
|
|
113
|
+
private getEffectiveSnapMode;
|
|
114
|
+
/**
|
|
115
|
+
* Perform tooltip update with hysteresis to prevent jumping.
|
|
116
|
+
* The tooltip "sticks" to the current point unless the cursor is
|
|
117
|
+
* significantly closer to a new point.
|
|
118
|
+
*/
|
|
119
|
+
private performTooltipUpdateWithHysteresis;
|
|
120
|
+
/**
|
|
121
|
+
* Handle heatmap and crosshair tooltip types (fallback)
|
|
122
|
+
*/
|
|
123
|
+
private performFallbackTooltipUpdate;
|
|
124
|
+
/**
|
|
125
|
+
* Find data point by X coordinate only (O(log n) - fastest method)
|
|
126
|
+
* Best for very large datasets where precision is less important than speed
|
|
127
|
+
*/
|
|
128
|
+
private findDataPointByXOnly;
|
|
129
|
+
/**
|
|
130
|
+
* Optimized nearest data point finder
|
|
131
|
+
*/
|
|
132
|
+
private findNearestDataPointOptimized;
|
|
133
|
+
/**
|
|
134
|
+
* Find heatmap cell under cursor
|
|
135
|
+
*/
|
|
136
|
+
private findHeatmapCell;
|
|
137
|
+
/**
|
|
138
|
+
* Binary search for closest value
|
|
139
|
+
*/
|
|
140
|
+
private binarySearchClosest;
|
|
141
|
+
/**
|
|
142
|
+
* Build crosshair tooltip data
|
|
143
|
+
*/
|
|
144
|
+
private buildCrosshairTooltip;
|
|
145
|
+
/**
|
|
146
|
+
* Schedule showing a tooltip
|
|
147
|
+
*/
|
|
148
|
+
private scheduleShow;
|
|
149
|
+
/**
|
|
150
|
+
* Schedule hiding tooltips
|
|
151
|
+
*/
|
|
152
|
+
private scheduleHide;
|
|
153
|
+
private clearShowTimeout;
|
|
154
|
+
private clearHideTimeout;
|
|
155
|
+
/**
|
|
156
|
+
* Show a tooltip with the given data
|
|
157
|
+
*/
|
|
158
|
+
private showTooltip;
|
|
159
|
+
/**
|
|
160
|
+
* Update tooltip position
|
|
161
|
+
*/
|
|
162
|
+
private updateTooltipPosition;
|
|
163
|
+
/**
|
|
164
|
+
* Get template ID for a tooltip type
|
|
165
|
+
*/
|
|
166
|
+
private getTemplateIdForType;
|
|
167
|
+
/**
|
|
168
|
+
* Show a tooltip programmatically
|
|
169
|
+
*/
|
|
170
|
+
show(data: TooltipData, options?: ShowTooltipOptions): string;
|
|
171
|
+
/**
|
|
172
|
+
* Hide a specific tooltip
|
|
173
|
+
*/
|
|
174
|
+
hide(tooltipId: string): void;
|
|
175
|
+
/**
|
|
176
|
+
* Hide all tooltips immediately
|
|
177
|
+
*/
|
|
178
|
+
hideAll(): void;
|
|
179
|
+
/**
|
|
180
|
+
* Render all active tooltips
|
|
181
|
+
*/
|
|
182
|
+
render(): void;
|
|
183
|
+
/**
|
|
184
|
+
* Check if any tooltip is currently visible
|
|
185
|
+
*/
|
|
186
|
+
hasActiveTooltip(): boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Subscribe to tooltip events
|
|
189
|
+
*/
|
|
190
|
+
on<K extends keyof TooltipEventMap>(event: K, handler: (data: TooltipEventMap[K]) => void): void;
|
|
191
|
+
/**
|
|
192
|
+
* Unsubscribe from tooltip events
|
|
193
|
+
*/
|
|
194
|
+
off<K extends keyof TooltipEventMap>(event: K, handler: (data: TooltipEventMap[K]) => void): void;
|
|
195
|
+
/**
|
|
196
|
+
* Destroy the tooltip manager
|
|
197
|
+
*/
|
|
198
|
+
destroy(): void;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Create a tooltip manager
|
|
202
|
+
*/
|
|
203
|
+
export declare function createTooltipManager(config: TooltipManagerConfig): TooltipManager;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { PlotArea } from '../../types';
|
|
2
|
+
import { TooltipPosition, TooltipMeasurement, TooltipPlacement } from './types';
|
|
3
|
+
|
|
4
|
+
export interface PositionerConfig {
|
|
5
|
+
/** Offset from target point */
|
|
6
|
+
offset: {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
};
|
|
10
|
+
/** Preferred placement */
|
|
11
|
+
preferredPosition: TooltipPlacement;
|
|
12
|
+
/** Keep within plot area */
|
|
13
|
+
constrainToPlotArea: boolean;
|
|
14
|
+
/** Keep within container */
|
|
15
|
+
constrainToContainer: boolean;
|
|
16
|
+
/** Flip if not enough space */
|
|
17
|
+
autoFlip: boolean;
|
|
18
|
+
/** Show arrow pointing to target */
|
|
19
|
+
showArrow: boolean;
|
|
20
|
+
/** Arrow size */
|
|
21
|
+
arrowSize: number;
|
|
22
|
+
}
|
|
23
|
+
export declare const DEFAULT_POSITIONER_CONFIG: PositionerConfig;
|
|
24
|
+
/**
|
|
25
|
+
* TooltipPositioner calculates optimal tooltip positions
|
|
26
|
+
*/
|
|
27
|
+
export declare class TooltipPositioner {
|
|
28
|
+
private config;
|
|
29
|
+
private containerWidth;
|
|
30
|
+
private containerHeight;
|
|
31
|
+
private plotArea;
|
|
32
|
+
constructor(config?: Partial<PositionerConfig>);
|
|
33
|
+
/**
|
|
34
|
+
* Update container dimensions
|
|
35
|
+
*/
|
|
36
|
+
setContainerSize(width: number, height: number): void;
|
|
37
|
+
/**
|
|
38
|
+
* Update plot area bounds
|
|
39
|
+
*/
|
|
40
|
+
setPlotArea(plotArea: PlotArea): void;
|
|
41
|
+
/**
|
|
42
|
+
* Update configuration
|
|
43
|
+
*/
|
|
44
|
+
configure(config: Partial<PositionerConfig>): void;
|
|
45
|
+
/**
|
|
46
|
+
* Calculate optimal tooltip position
|
|
47
|
+
*
|
|
48
|
+
* @param targetX - Target X coordinate (where tooltip points to)
|
|
49
|
+
* @param targetY - Target Y coordinate
|
|
50
|
+
* @param measurement - Tooltip dimensions
|
|
51
|
+
* @returns Calculated position with arrow configuration
|
|
52
|
+
*/
|
|
53
|
+
calculatePosition(targetX: number, targetY: number, measurement: TooltipMeasurement): TooltipPosition;
|
|
54
|
+
/**
|
|
55
|
+
* Determine best position based on available space
|
|
56
|
+
*/
|
|
57
|
+
private determinePosition;
|
|
58
|
+
/**
|
|
59
|
+
* Calculate tooltip coordinates for a given position
|
|
60
|
+
*/
|
|
61
|
+
private calculateCoordinates;
|
|
62
|
+
/**
|
|
63
|
+
* Get the opposite position for flipping
|
|
64
|
+
*/
|
|
65
|
+
private flipPosition;
|
|
66
|
+
/**
|
|
67
|
+
* Check if tooltip fits within bounds
|
|
68
|
+
*/
|
|
69
|
+
private fitsInBounds;
|
|
70
|
+
/**
|
|
71
|
+
* Constrain position to stay within bounds
|
|
72
|
+
*/
|
|
73
|
+
private constrainToBounds;
|
|
74
|
+
/**
|
|
75
|
+
* Get the bounds to constrain tooltip within
|
|
76
|
+
*/
|
|
77
|
+
private getConstraintBounds;
|
|
78
|
+
/**
|
|
79
|
+
* Calculate position for crosshair tooltip (follows cursor vertically)
|
|
80
|
+
*/
|
|
81
|
+
calculateCrosshairPosition(cursorX: number, cursorY: number, measurement: TooltipMeasurement): TooltipPosition;
|
|
82
|
+
}
|
|
83
|
+
export declare function createTooltipPositioner(config?: Partial<PositionerConfig>): TooltipPositioner;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { TooltipData, TooltipPosition, TooltipTheme, TooltipTemplate } from './types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* TooltipRenderer handles all Canvas 2D rendering for tooltips
|
|
5
|
+
*/
|
|
6
|
+
export declare class TooltipRenderer {
|
|
7
|
+
private ctx;
|
|
8
|
+
private theme;
|
|
9
|
+
constructor(ctx: CanvasRenderingContext2D, theme: TooltipTheme);
|
|
10
|
+
/**
|
|
11
|
+
* Update the theme
|
|
12
|
+
*/
|
|
13
|
+
setTheme(theme: TooltipTheme): void;
|
|
14
|
+
/**
|
|
15
|
+
* Render a tooltip with the given template
|
|
16
|
+
*/
|
|
17
|
+
render<T extends TooltipData>(data: T, position: TooltipPosition, template: TooltipTemplate<T>): void;
|
|
18
|
+
/**
|
|
19
|
+
* Draw tooltip background with all effects
|
|
20
|
+
*/
|
|
21
|
+
private drawBackground;
|
|
22
|
+
/**
|
|
23
|
+
* Draw arrow pointing to target
|
|
24
|
+
*/
|
|
25
|
+
private drawArrow;
|
|
26
|
+
/**
|
|
27
|
+
* Draw a rounded rectangle path
|
|
28
|
+
*/
|
|
29
|
+
private roundRect;
|
|
30
|
+
/**
|
|
31
|
+
* Draw a horizontal separator line
|
|
32
|
+
*/
|
|
33
|
+
drawSeparator(x: number, y: number, width: number): void;
|
|
34
|
+
/**
|
|
35
|
+
* Draw a series color indicator (small circle or square)
|
|
36
|
+
*/
|
|
37
|
+
drawSeriesIndicator(x: number, y: number, color: string): void;
|
|
38
|
+
/**
|
|
39
|
+
* Measure text width
|
|
40
|
+
*/
|
|
41
|
+
measureText(text: string, fontSize: number, fontWeight?: number | string): number;
|
|
42
|
+
/**
|
|
43
|
+
* Draw text with theme styling
|
|
44
|
+
*/
|
|
45
|
+
drawText(text: string, x: number, y: number, options?: {
|
|
46
|
+
fontSize?: number;
|
|
47
|
+
fontWeight?: number | string;
|
|
48
|
+
color?: string;
|
|
49
|
+
align?: CanvasTextAlign;
|
|
50
|
+
baseline?: CanvasTextBaseline;
|
|
51
|
+
}): void;
|
|
52
|
+
/**
|
|
53
|
+
* Draw a label-value pair
|
|
54
|
+
*/
|
|
55
|
+
drawLabelValue(x: number, y: number, label: string, value: string, maxWidth: number): void;
|
|
56
|
+
/**
|
|
57
|
+
* Get theme for external use
|
|
58
|
+
*/
|
|
59
|
+
getTheme(): TooltipTheme;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Create a tooltip renderer
|
|
63
|
+
*/
|
|
64
|
+
export declare function createTooltipRenderer(ctx: CanvasRenderingContext2D, theme: TooltipTheme): TooltipRenderer;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tooltip System - High-performance, customizable tooltips for SciChart Engine
|
|
3
|
+
*
|
|
4
|
+
* This module provides a comprehensive tooltip system with:
|
|
5
|
+
* - Multiple tooltip types (datapoint, crosshair, heatmap, etc.)
|
|
6
|
+
* - Customizable templates
|
|
7
|
+
* - Beautiful predefined themes
|
|
8
|
+
* - Smooth animations
|
|
9
|
+
* - Optimal performance
|
|
10
|
+
*
|
|
11
|
+
* @module tooltip
|
|
12
|
+
*/
|
|
13
|
+
export type { TooltipType, TooltipData, DataPointTooltip, CrosshairTooltip, CrosshairSeriesValue, RangeTooltip, RangeStatistics, AnnotationTooltip, HeatmapTooltip, AxisTooltip, ArrowPosition, TooltipPlacement, TooltipPosition, TooltipMeasurement, TooltipTheme, TooltipShadow, TooltipOptions, DataPointTooltipOptions, CrosshairTooltipOptions, RangeTooltipOptions, AnnotationTooltipOptions, HeatmapTooltipOptions, TooltipFormatter, TooltipFormattedContent, TooltipLine, TooltipTemplate, TooltipEventMap, TooltipShowEvent, TooltipHideEvent, TooltipVisibilityEvent, TooltipUpdateEvent, TooltipMoveEvent, ShowTooltipOptions } from './types';
|
|
14
|
+
export { TOOLTIP_DARK_THEME, TOOLTIP_LIGHT_THEME, TOOLTIP_GLASS_THEME, TOOLTIP_MIDNIGHT_THEME, TOOLTIP_ELECTROCHEM_THEME, TOOLTIP_NEON_THEME, TOOLTIP_MINIMAL_THEME, DEFAULT_TOOLTIP_THEME, TOOLTIP_THEMES, getTooltipTheme, createTooltipTheme, getTooltipThemeForChartTheme, type TooltipThemeName } from './themes';
|
|
15
|
+
export { TooltipPositioner, createTooltipPositioner, DEFAULT_POSITIONER_CONFIG, type PositionerConfig } from './TooltipPositioner';
|
|
16
|
+
export { TooltipRenderer, createTooltipRenderer } from './TooltipRenderer';
|
|
17
|
+
export { TooltipManager, createTooltipManager, type TooltipManagerConfig } from './TooltipManager';
|
|
18
|
+
export { DefaultTooltipTemplate, MinimalTooltipTemplate, CrosshairTooltipTemplate, HeatmapTooltipTemplate, ScientificTooltipTemplate, defaultTooltipTemplate, minimalTooltipTemplate, crosshairTooltipTemplate, heatmapTooltipTemplate, scientificTooltipTemplate, BUILTIN_TEMPLATES, getBuiltinTemplate, getDefaultTemplateForType, type BuiltinTemplateId } from './templates';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AnnotationTooltip, TooltipTemplate, TooltipMeasurement, TooltipPosition, TooltipTheme, TooltipType } from '../types';
|
|
2
|
+
|
|
3
|
+
export declare class AnnotationTooltipTemplate implements TooltipTemplate<AnnotationTooltip> {
|
|
4
|
+
readonly id = "annotation";
|
|
5
|
+
readonly name = "Annotation Info";
|
|
6
|
+
readonly supportedTypes: TooltipType[];
|
|
7
|
+
private cachedKey;
|
|
8
|
+
private cachedMeasurement;
|
|
9
|
+
/**
|
|
10
|
+
* Measure tooltip dimensions
|
|
11
|
+
*/
|
|
12
|
+
measure(ctx: CanvasRenderingContext2D, data: AnnotationTooltip, theme: TooltipTheme): TooltipMeasurement;
|
|
13
|
+
/**
|
|
14
|
+
* Render the tooltip
|
|
15
|
+
*/
|
|
16
|
+
render(ctx: CanvasRenderingContext2D, data: AnnotationTooltip, position: TooltipPosition, theme: TooltipTheme): void;
|
|
17
|
+
}
|
|
18
|
+
export declare const annotationTooltipTemplate: AnnotationTooltipTemplate;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CrosshairTooltip, TooltipTemplate, TooltipMeasurement, TooltipPosition, TooltipTheme, TooltipType } from '../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Crosshair Multi-Series Template
|
|
5
|
+
*
|
|
6
|
+
* Visual layout:
|
|
7
|
+
* ┌──────────────────────────────────╮
|
|
8
|
+
* │ ⌖ X = 0.234 │
|
|
9
|
+
* ├──────────────────────────────────┤
|
|
10
|
+
* │ ● Forward: 45.67 µA │
|
|
11
|
+
* │ ● Reverse: -32.10 µA │
|
|
12
|
+
* │ ○ Baseline: 0.05 µA │
|
|
13
|
+
* ╰──────────────────────────────────╯
|
|
14
|
+
*/
|
|
15
|
+
export declare class CrosshairTooltipTemplate implements TooltipTemplate<CrosshairTooltip> {
|
|
16
|
+
readonly id = "crosshair";
|
|
17
|
+
readonly name = "Multi-Series Crosshair";
|
|
18
|
+
readonly supportedTypes: TooltipType[];
|
|
19
|
+
private cachedKey;
|
|
20
|
+
private cachedMeasurement;
|
|
21
|
+
/**
|
|
22
|
+
* Measure tooltip dimensions
|
|
23
|
+
*/
|
|
24
|
+
measure(ctx: CanvasRenderingContext2D, data: CrosshairTooltip, theme: TooltipTheme): TooltipMeasurement;
|
|
25
|
+
/**
|
|
26
|
+
* Render the tooltip
|
|
27
|
+
*/
|
|
28
|
+
render(ctx: CanvasRenderingContext2D, data: CrosshairTooltip, position: TooltipPosition, theme: TooltipTheme): void;
|
|
29
|
+
}
|
|
30
|
+
export declare const crosshairTooltipTemplate: CrosshairTooltipTemplate;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DataPointTooltip, TooltipTemplate, TooltipMeasurement, TooltipPosition, TooltipTheme, TooltipType } from '../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Default Data Point Template
|
|
5
|
+
*
|
|
6
|
+
* Visual layout:
|
|
7
|
+
* ┌──────────────────────────┐
|
|
8
|
+
* │ ● Series Name │
|
|
9
|
+
* │ ─────────────────────── │
|
|
10
|
+
* │ X: 0.500 │
|
|
11
|
+
* │ Y: 1.234 │
|
|
12
|
+
* │ ± Error: 0.05 │
|
|
13
|
+
* └──────────────────────────┘
|
|
14
|
+
*/
|
|
15
|
+
export declare class DefaultTooltipTemplate implements TooltipTemplate<DataPointTooltip> {
|
|
16
|
+
readonly id = "default";
|
|
17
|
+
readonly name = "Default Data Point";
|
|
18
|
+
readonly supportedTypes: TooltipType[];
|
|
19
|
+
private cachedKey;
|
|
20
|
+
private cachedMeasurement;
|
|
21
|
+
/**
|
|
22
|
+
* Measure tooltip dimensions
|
|
23
|
+
*/
|
|
24
|
+
measure(ctx: CanvasRenderingContext2D, data: DataPointTooltip, theme: TooltipTheme): TooltipMeasurement;
|
|
25
|
+
/**
|
|
26
|
+
* Render the tooltip
|
|
27
|
+
*/
|
|
28
|
+
render(ctx: CanvasRenderingContext2D, data: DataPointTooltip, position: TooltipPosition, theme: TooltipTheme): void;
|
|
29
|
+
}
|
|
30
|
+
export declare const defaultTooltipTemplate: DefaultTooltipTemplate;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { HeatmapTooltip, TooltipTemplate, TooltipMeasurement, TooltipPosition, TooltipTheme, TooltipType } from '../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Heatmap Template
|
|
5
|
+
*
|
|
6
|
+
* Visual layout:
|
|
7
|
+
* ┌────────────────────────────╮
|
|
8
|
+
* │ Grid [45, 128] │
|
|
9
|
+
* │ ──────────────────────────│
|
|
10
|
+
* │ ████ Value: 0.847 │
|
|
11
|
+
* │ Min: 0.0 Max: 1.0 │
|
|
12
|
+
* │ │
|
|
13
|
+
* │ X: 100.0 Hz │
|
|
14
|
+
* │ Y: 2.50 s │
|
|
15
|
+
* ╰────────────────────────────╯
|
|
16
|
+
*/
|
|
17
|
+
export declare class HeatmapTooltipTemplate implements TooltipTemplate<HeatmapTooltip> {
|
|
18
|
+
readonly id = "heatmap";
|
|
19
|
+
readonly name = "Heatmap Value";
|
|
20
|
+
readonly supportedTypes: TooltipType[];
|
|
21
|
+
private readonly swatchSize;
|
|
22
|
+
private readonly swatchGap;
|
|
23
|
+
private cachedKey;
|
|
24
|
+
private cachedMeasurement;
|
|
25
|
+
/**
|
|
26
|
+
* Measure tooltip dimensions
|
|
27
|
+
*/
|
|
28
|
+
measure(ctx: CanvasRenderingContext2D, data: HeatmapTooltip, theme: TooltipTheme): TooltipMeasurement;
|
|
29
|
+
/**
|
|
30
|
+
* Render the tooltip
|
|
31
|
+
*/
|
|
32
|
+
render(ctx: CanvasRenderingContext2D, data: HeatmapTooltip, position: TooltipPosition, theme: TooltipTheme): void;
|
|
33
|
+
}
|
|
34
|
+
export declare const heatmapTooltipTemplate: HeatmapTooltipTemplate;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DataPointTooltip, TooltipTemplate, TooltipMeasurement, TooltipPosition, TooltipTheme, TooltipType } from '../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Minimal Template
|
|
5
|
+
*
|
|
6
|
+
* Visual layout:
|
|
7
|
+
* ┌───────────────────╮
|
|
8
|
+
* │ 0.500 ▪ 1.23µA │
|
|
9
|
+
* ╰───────────────────╯
|
|
10
|
+
*/
|
|
11
|
+
export declare class MinimalTooltipTemplate implements TooltipTemplate<DataPointTooltip> {
|
|
12
|
+
readonly id = "minimal";
|
|
13
|
+
readonly name = "Minimal";
|
|
14
|
+
readonly supportedTypes: TooltipType[];
|
|
15
|
+
private cachedKey;
|
|
16
|
+
private cachedMeasurement;
|
|
17
|
+
/**
|
|
18
|
+
* Measure tooltip dimensions
|
|
19
|
+
*/
|
|
20
|
+
measure(ctx: CanvasRenderingContext2D, data: DataPointTooltip, theme: TooltipTheme): TooltipMeasurement;
|
|
21
|
+
/**
|
|
22
|
+
* Render the tooltip
|
|
23
|
+
*/
|
|
24
|
+
render(ctx: CanvasRenderingContext2D, data: DataPointTooltip, position: TooltipPosition, theme: TooltipTheme): void;
|
|
25
|
+
}
|
|
26
|
+
export declare const minimalTooltipTemplate: MinimalTooltipTemplate;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RangeTooltip, TooltipTemplate, TooltipMeasurement, TooltipPosition, TooltipTheme, TooltipType } from '../types';
|
|
2
|
+
|
|
3
|
+
export declare class RangeTooltipTemplate implements TooltipTemplate<RangeTooltip> {
|
|
4
|
+
readonly id = "range";
|
|
5
|
+
readonly name = "Range Statistics";
|
|
6
|
+
readonly supportedTypes: TooltipType[];
|
|
7
|
+
private cachedKey;
|
|
8
|
+
private cachedMeasurement;
|
|
9
|
+
/**
|
|
10
|
+
* Measure tooltip dimensions
|
|
11
|
+
*/
|
|
12
|
+
measure(ctx: CanvasRenderingContext2D, data: RangeTooltip, theme: TooltipTheme): TooltipMeasurement;
|
|
13
|
+
/**
|
|
14
|
+
* Render the tooltip
|
|
15
|
+
*/
|
|
16
|
+
render(ctx: CanvasRenderingContext2D, data: RangeTooltip, position: TooltipPosition, theme: TooltipTheme): void;
|
|
17
|
+
}
|
|
18
|
+
export declare const rangeTooltipTemplate: RangeTooltipTemplate;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DataPointTooltip, TooltipTemplate, TooltipMeasurement, TooltipPosition, TooltipTheme, TooltipType } from '../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Format with SI prefix (for future use)
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Scientific Template
|
|
8
|
+
*
|
|
9
|
+
* Visual layout:
|
|
10
|
+
* ┌────────────────────────────────────────╮
|
|
11
|
+
* │ 📍 Series Name │
|
|
12
|
+
* │ ───────────────────────────────────── │
|
|
13
|
+
* │ X: 1.234×10³ │
|
|
14
|
+
* │ Y: 5.678×10⁻² ± 0.001 │
|
|
15
|
+
* │ ───────────────────────────────────── │
|
|
16
|
+
* │ Index: 1523 │ Cycle: 3 │
|
|
17
|
+
* ╰────────────────────────────────────────╯
|
|
18
|
+
*/
|
|
19
|
+
export declare class ScientificTooltipTemplate implements TooltipTemplate<DataPointTooltip> {
|
|
20
|
+
readonly id = "scientific";
|
|
21
|
+
readonly name = "Scientific Notation";
|
|
22
|
+
readonly supportedTypes: TooltipType[];
|
|
23
|
+
private cachedKey;
|
|
24
|
+
private cachedMeasurement;
|
|
25
|
+
/**
|
|
26
|
+
* Measure tooltip dimensions
|
|
27
|
+
*/
|
|
28
|
+
measure(ctx: CanvasRenderingContext2D, data: DataPointTooltip, theme: TooltipTheme): TooltipMeasurement;
|
|
29
|
+
/**
|
|
30
|
+
* Render the tooltip
|
|
31
|
+
*/
|
|
32
|
+
render(ctx: CanvasRenderingContext2D, data: DataPointTooltip, position: TooltipPosition, theme: TooltipTheme): void;
|
|
33
|
+
}
|
|
34
|
+
export declare const scientificTooltipTemplate: ScientificTooltipTemplate;
|