@radishcandy/h-charts 0.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.
- package/CHANGELOG.md +19 -0
- package/LICENSE +21 -0
- package/README.md +528 -0
- package/dist/HChart-B61851DE.js +245 -0
- package/dist/HChart-DKVtg5A8.cjs +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +568 -0
- package/dist/index.js +1377 -0
- package/dist/react.cjs +1 -0
- package/dist/react.d.ts +166 -0
- package/dist/react.js +87 -0
- package/dist/style.css +1 -0
- package/dist/vue.cjs +1 -0
- package/dist/vue.d.ts +180 -0
- package/dist/vue.js +96 -0
- package/package.json +113 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,568 @@
|
|
|
1
|
+
import { default as default_2 } from 'highcharts';
|
|
2
|
+
import * as Highcharts_2 from 'highcharts';
|
|
3
|
+
|
|
4
|
+
export declare class AnnotationPlugin extends BasePlugin {
|
|
5
|
+
name: string;
|
|
6
|
+
private cursorPoint;
|
|
7
|
+
private labelFormatter;
|
|
8
|
+
private markerRadius;
|
|
9
|
+
private markerColor;
|
|
10
|
+
private marks;
|
|
11
|
+
private seq;
|
|
12
|
+
private draggingId;
|
|
13
|
+
private dragStart;
|
|
14
|
+
private onMouseMoveBound;
|
|
15
|
+
private onMouseUpBound;
|
|
16
|
+
private unbindRedraw;
|
|
17
|
+
constructor(options?: AnnotationPluginOptions);
|
|
18
|
+
init(chart: IHChart): void;
|
|
19
|
+
onCursorChange(point: Point): void;
|
|
20
|
+
enable(): void;
|
|
21
|
+
disable(): void;
|
|
22
|
+
private bindEvents;
|
|
23
|
+
private unbindEvents;
|
|
24
|
+
update(options: AnnotationPluginOptions): void;
|
|
25
|
+
markCurrentPoint(): void;
|
|
26
|
+
markPoint(point: Point): void;
|
|
27
|
+
clearMark(): void;
|
|
28
|
+
getMarkedPoint(): Point | null;
|
|
29
|
+
getMarkedPoints(): Point[];
|
|
30
|
+
private render;
|
|
31
|
+
private clearAllMarks;
|
|
32
|
+
private getMarkerAnnotationId;
|
|
33
|
+
private renderMark;
|
|
34
|
+
private drawMarker;
|
|
35
|
+
private ensureLabel;
|
|
36
|
+
private ensureConnector;
|
|
37
|
+
private updateAllPositions;
|
|
38
|
+
private updateMarkPosition;
|
|
39
|
+
private updateConnectorPosition;
|
|
40
|
+
private onLabelMouseDown;
|
|
41
|
+
private onLabelMouseMove;
|
|
42
|
+
private onLabelMouseUp;
|
|
43
|
+
private stopDragging;
|
|
44
|
+
destroy(): void;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export declare interface AnnotationPluginOptions {
|
|
48
|
+
enabled?: boolean;
|
|
49
|
+
labelFormatter?: (x: number, y: number) => string;
|
|
50
|
+
markerRadius?: number;
|
|
51
|
+
markerColor?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export declare type AxisInternals = Highcharts_2.Axis & {
|
|
55
|
+
tickInterval?: number;
|
|
56
|
+
dataMin?: number;
|
|
57
|
+
dataMax?: number;
|
|
58
|
+
plotLinesAndBands: AxisPlotLine[];
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Highcharts v12 的公开类型未声明下列运行时实例成员,这里做最小扩展,
|
|
63
|
+
* 以便插件在不引入 `any` 的前提下访问轴与注解的内部状态。
|
|
64
|
+
*/
|
|
65
|
+
export declare type AxisPlotLine = Highcharts_2.PlotLineOrBand & {
|
|
66
|
+
id?: string;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export declare abstract class BasePlugin implements IPlugin {
|
|
70
|
+
abstract name: string;
|
|
71
|
+
protected chart: IHChart | null;
|
|
72
|
+
protected enabled: boolean;
|
|
73
|
+
protected options: any;
|
|
74
|
+
constructor(options?: any);
|
|
75
|
+
init(chart: IHChart): void;
|
|
76
|
+
destroy(): void;
|
|
77
|
+
enable(): void;
|
|
78
|
+
disable(): void;
|
|
79
|
+
isEnabled(): boolean;
|
|
80
|
+
update(options: any): void;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export declare type ChartInternals = Highcharts_2.Chart & {
|
|
84
|
+
annotations?: Array<{
|
|
85
|
+
group?: {
|
|
86
|
+
css(styles: Highcharts_2.CSSObject): void;
|
|
87
|
+
};
|
|
88
|
+
labels?: Array<{
|
|
89
|
+
graphic?: {
|
|
90
|
+
css(styles: Highcharts_2.CSSObject): void;
|
|
91
|
+
};
|
|
92
|
+
}>;
|
|
93
|
+
shapes?: Array<{
|
|
94
|
+
graphic?: {
|
|
95
|
+
css(styles: Highcharts_2.CSSObject): void;
|
|
96
|
+
};
|
|
97
|
+
}>;
|
|
98
|
+
}>;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export declare type ContextMenuBuiltinId = 'sideband' | 'threshold_line' | 'band_count' | 'export';
|
|
102
|
+
|
|
103
|
+
export declare type ContextMenuEntry = ContextMenuItem | ContextMenuBuiltinId;
|
|
104
|
+
|
|
105
|
+
export declare interface ContextMenuItem {
|
|
106
|
+
label?: string;
|
|
107
|
+
pluginName?: string;
|
|
108
|
+
action?: (chart: IHChart, item?: ContextMenuItem) => void;
|
|
109
|
+
type?: 'builtin' | 'custom';
|
|
110
|
+
id?: string;
|
|
111
|
+
items?: ContextMenuItem[];
|
|
112
|
+
value?: string | number;
|
|
113
|
+
inputType?: 'text' | 'number';
|
|
114
|
+
min?: number;
|
|
115
|
+
max?: number;
|
|
116
|
+
onInput?: (value: string, chart: IHChart) => void;
|
|
117
|
+
fileName?: string | ((chart: IHChart) => string);
|
|
118
|
+
exportBackgroundColor?: string;
|
|
119
|
+
exportOptions?: Record<string, unknown>;
|
|
120
|
+
exportChartOptions?: Record<string, unknown>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** A framework-independent, extensible context menu for an HChart instance. */
|
|
124
|
+
export declare class ContextMenuPlugin extends BasePlugin {
|
|
125
|
+
name: string;
|
|
126
|
+
private static readonly activeInstances;
|
|
127
|
+
private readonly items;
|
|
128
|
+
private readonly labels;
|
|
129
|
+
private readonly translate;
|
|
130
|
+
private menu;
|
|
131
|
+
private eventsBound;
|
|
132
|
+
private contextStart;
|
|
133
|
+
private readonly onContextMenuBound;
|
|
134
|
+
private readonly onMouseDownBound;
|
|
135
|
+
private readonly onDocumentClickBound;
|
|
136
|
+
static get BUILTIN_ITEMS(): Record<ContextMenuBuiltinId, ContextMenuItem>;
|
|
137
|
+
static get DEFAULT_ITEMS(): ContextMenuItem[];
|
|
138
|
+
constructor(options?: ContextMenuPluginOptions);
|
|
139
|
+
init(chart: IHChart): void;
|
|
140
|
+
enable(): void;
|
|
141
|
+
disable(): void;
|
|
142
|
+
destroy(): void;
|
|
143
|
+
private resolveItems;
|
|
144
|
+
private localizedBuiltinItems;
|
|
145
|
+
private addRequiredPlugins;
|
|
146
|
+
private createPlugin;
|
|
147
|
+
private createMenu;
|
|
148
|
+
private bindEvents;
|
|
149
|
+
private unbindEvents;
|
|
150
|
+
private onMouseDown;
|
|
151
|
+
private onContextMenu;
|
|
152
|
+
private showMenu;
|
|
153
|
+
private createMenuItem;
|
|
154
|
+
private createInputItem;
|
|
155
|
+
private createSubmenu;
|
|
156
|
+
private resolveInputValue;
|
|
157
|
+
private clampInputValue;
|
|
158
|
+
private handleItem;
|
|
159
|
+
private hideMenu;
|
|
160
|
+
private resolveZIndex;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export declare interface ContextMenuPluginOptions {
|
|
164
|
+
enabled?: boolean;
|
|
165
|
+
items?: ContextMenuEntry[];
|
|
166
|
+
zIndex?: number;
|
|
167
|
+
labels?: Partial<Record<ContextMenuBuiltinId, string>>;
|
|
168
|
+
translate?: (id: ContextMenuBuiltinId, fallback: string) => string;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** Create a reusable guard object for one or more bidirectional cursor links. */
|
|
172
|
+
export declare function createCursorSyncState(): CursorSyncState;
|
|
173
|
+
|
|
174
|
+
/** Default envelope-analysis menu. */
|
|
175
|
+
export declare function createEnvelopeContextMenuItems(): ContextMenuEntry[];
|
|
176
|
+
|
|
177
|
+
/** Default spectrum-analysis menu, suitable as a host-level starting point. */
|
|
178
|
+
export declare function createSpectrumContextMenuItems(): ContextMenuEntry[];
|
|
179
|
+
|
|
180
|
+
/** Minimal time-waveform menu. */
|
|
181
|
+
export declare function createWaveContextMenuItems(): ContextMenuEntry[];
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Framework-agnostic cursor bridge.
|
|
185
|
+
*
|
|
186
|
+
* The bridge forwards only `point.x`; the target chart resolves its own nearest
|
|
187
|
+
* point, which is important when two series use different sampling intervals.
|
|
188
|
+
*/
|
|
189
|
+
export declare class CursorLinkPlugin extends BasePlugin {
|
|
190
|
+
name: string;
|
|
191
|
+
private readonly target;
|
|
192
|
+
private readonly syncState;
|
|
193
|
+
constructor(options: CursorLinkPluginOptions);
|
|
194
|
+
onCursorChange(point: Point): void;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export declare interface CursorLinkPluginOptions {
|
|
198
|
+
enabled?: boolean;
|
|
199
|
+
/** Resolve the chart that should receive the source point's X value. */
|
|
200
|
+
target: () => IHChart | null | undefined;
|
|
201
|
+
/** Optional unique name when more than one link plugin is registered. */
|
|
202
|
+
name?: string;
|
|
203
|
+
/** Share this object between both directions of a bidirectional link. */
|
|
204
|
+
syncState?: CursorSyncState;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Cursor Plugin
|
|
209
|
+
*
|
|
210
|
+
* Provides an interactive cursor that snaps to data points.
|
|
211
|
+
* Features:
|
|
212
|
+
* - Snap to nearest point
|
|
213
|
+
* - Keyboard navigation (Left/Right arrow)
|
|
214
|
+
* - Draggable cursor (via hidden hit area)
|
|
215
|
+
* - Custom label formatting
|
|
216
|
+
*/
|
|
217
|
+
export declare class CursorPlugin extends BasePlugin {
|
|
218
|
+
name: string;
|
|
219
|
+
private cursorLabel;
|
|
220
|
+
private cursorHitLine;
|
|
221
|
+
private activePoint;
|
|
222
|
+
private onKeyDownBound;
|
|
223
|
+
private labelFormatter;
|
|
224
|
+
private onCursorMove;
|
|
225
|
+
private isDragging;
|
|
226
|
+
private hoverDebounceTimer;
|
|
227
|
+
private multiLine;
|
|
228
|
+
private draggable;
|
|
229
|
+
private pointerDown;
|
|
230
|
+
private pointerDragged;
|
|
231
|
+
private suppressClickUntil;
|
|
232
|
+
private eventsBound;
|
|
233
|
+
private unbindAfterSetExtremes;
|
|
234
|
+
private onPointerDownBound;
|
|
235
|
+
private onPointerMoveBound;
|
|
236
|
+
private onPointerUpBound;
|
|
237
|
+
private onContainerMouseMoveBound;
|
|
238
|
+
private onContainerMouseUpBound;
|
|
239
|
+
constructor(options?: CursorPluginOptions);
|
|
240
|
+
private onContainerMouseMove;
|
|
241
|
+
private onPointerDown;
|
|
242
|
+
private onPointerMove;
|
|
243
|
+
private trackPointerDrag;
|
|
244
|
+
private onPointerUp;
|
|
245
|
+
private shouldIgnoreChartClick;
|
|
246
|
+
private onContainerMouseUp;
|
|
247
|
+
init(chart: IHChart): void;
|
|
248
|
+
enable(): void;
|
|
249
|
+
disable(): void;
|
|
250
|
+
onCursorChange(point: any): void;
|
|
251
|
+
private bindEvents;
|
|
252
|
+
private unbindEvents;
|
|
253
|
+
private getNativeChart;
|
|
254
|
+
private getSeriesList;
|
|
255
|
+
private getXData;
|
|
256
|
+
private onKeyDown;
|
|
257
|
+
onChartClick(e: default_2.ChartClickEventObject | default_2.PointClickEventObject): void;
|
|
258
|
+
/**
|
|
259
|
+
* Update cursor position based on X value.
|
|
260
|
+
* Uses raw xData to ensure accuracy across zoom levels.
|
|
261
|
+
*/
|
|
262
|
+
updateCursor(xValue: number): void;
|
|
263
|
+
/**
|
|
264
|
+
* Re-applies the cursor based on the last active point.
|
|
265
|
+
* Called after zoom/pan to ensure cursor stays on the correct data point.
|
|
266
|
+
*/
|
|
267
|
+
private refreshCursor;
|
|
268
|
+
private drawCursor;
|
|
269
|
+
/** 边频/阈值线等可拖拽辅助线,需保留 pointer-events */
|
|
270
|
+
private isInteractivePlotLine;
|
|
271
|
+
private applyPassiveCursorLayer;
|
|
272
|
+
private buildCursorLabelText;
|
|
273
|
+
private formatXText;
|
|
274
|
+
private getOrderedSeries;
|
|
275
|
+
private getOrderedVisibleSeriesPointsAtX;
|
|
276
|
+
private getSeriesPointByX;
|
|
277
|
+
private scheduleSeriesHoverState;
|
|
278
|
+
private applySeriesHoverState;
|
|
279
|
+
destroy(): void;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export declare interface CursorPluginOptions {
|
|
283
|
+
enabled?: boolean;
|
|
284
|
+
multiLine?: boolean;
|
|
285
|
+
/** 是否允许拖拽光标线;关闭后仅点击图表移动光标,避免与框选放大冲突 */
|
|
286
|
+
draggable?: boolean;
|
|
287
|
+
/**
|
|
288
|
+
* Custom formatter for the cursor label.
|
|
289
|
+
* Return a string to be displayed (e.g. "x, y" or "x Hz, y mm/s").
|
|
290
|
+
*/
|
|
291
|
+
labelFormatter?: (x: number, y: number) => string;
|
|
292
|
+
/** Called after cursor position updates (click / drag / keyboard). */
|
|
293
|
+
onCursorMove?: (point: {
|
|
294
|
+
x: number;
|
|
295
|
+
y: number;
|
|
296
|
+
index: number;
|
|
297
|
+
}) => void;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export declare interface CursorSyncState {
|
|
301
|
+
active: boolean;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* HChart - Highcharts Wrapper Class
|
|
306
|
+
*
|
|
307
|
+
* Encapsulates Highcharts initialization, default configuration, and plugin management.
|
|
308
|
+
*/
|
|
309
|
+
export declare class HChart implements IHChart {
|
|
310
|
+
chart: Highcharts_2.Chart;
|
|
311
|
+
plugins: Map<string, IPlugin>;
|
|
312
|
+
container: HTMLElement;
|
|
313
|
+
activePoint: Point | null;
|
|
314
|
+
private resizeObserver;
|
|
315
|
+
private reflowFrame;
|
|
316
|
+
constructor(config: HChartConfig);
|
|
317
|
+
addPlugin(plugin: IPlugin): void;
|
|
318
|
+
getPlugin<T extends IPlugin>(name: string): T | undefined;
|
|
319
|
+
removePlugin(name: string): void;
|
|
320
|
+
/**
|
|
321
|
+
* Coalesce multiple size changes into one chart reflow in the next animation frame.
|
|
322
|
+
* ResizeObserver can fire repeatedly while split panes and cards are animating.
|
|
323
|
+
*/
|
|
324
|
+
requestReflow(): void;
|
|
325
|
+
destroy(): void;
|
|
326
|
+
private onChartClick;
|
|
327
|
+
setCursor(point: Point): void;
|
|
328
|
+
/**
|
|
329
|
+
* Set cursor by X value (will snap to nearest point)
|
|
330
|
+
*/
|
|
331
|
+
setCursorX(x: number): void;
|
|
332
|
+
/**
|
|
333
|
+
* Toggle a plugin by name
|
|
334
|
+
*/
|
|
335
|
+
togglePlugin(name: string, enabled: boolean): void;
|
|
336
|
+
/** Update the underlying Highcharts options without recreating plugins. */
|
|
337
|
+
updateOptions(options: Highcharts_2.Options, redraw?: boolean): void;
|
|
338
|
+
/** Replace one series data set through the stable HChart API. */
|
|
339
|
+
setSeriesData(data: Highcharts_2.PointOptionsType[], seriesIndex?: number, redraw?: boolean): void;
|
|
340
|
+
getSeriesData(): number[][];
|
|
341
|
+
private resolveMarkerConfig;
|
|
342
|
+
/**
|
|
343
|
+
* Adds a static reference line (vertical or horizontal) to the chart.
|
|
344
|
+
* Useful for thresholds, limits, or markers.
|
|
345
|
+
*
|
|
346
|
+
* @param options Configuration for the reference line
|
|
347
|
+
* @returns The unique ID of the added line (use to remove later)
|
|
348
|
+
*/
|
|
349
|
+
addReferenceLine(options: {
|
|
350
|
+
axis?: 'x' | 'y';
|
|
351
|
+
value: number;
|
|
352
|
+
color?: string;
|
|
353
|
+
text?: string;
|
|
354
|
+
width?: number;
|
|
355
|
+
dashStyle?: Highcharts_2.DashStyleValue;
|
|
356
|
+
zIndex?: number;
|
|
357
|
+
}): string;
|
|
358
|
+
removeReferenceLine(id: string, axis?: 'x' | 'y'): void;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export declare interface HChartConfig {
|
|
362
|
+
/**
|
|
363
|
+
* The ID of the container element or the element itself.
|
|
364
|
+
*/
|
|
365
|
+
container: string | HTMLElement;
|
|
366
|
+
/**
|
|
367
|
+
* Standard Highcharts options to override defaults.
|
|
368
|
+
*/
|
|
369
|
+
options?: Highcharts_2.Options;
|
|
370
|
+
/**
|
|
371
|
+
* List of plugins to initialize with the chart.
|
|
372
|
+
*/
|
|
373
|
+
plugins?: IPlugin[];
|
|
374
|
+
/**
|
|
375
|
+
* Configuration for data point markers.
|
|
376
|
+
*/
|
|
377
|
+
markerConfig?: {
|
|
378
|
+
/**
|
|
379
|
+
* Force enable/disable markers.
|
|
380
|
+
*/
|
|
381
|
+
enabled?: boolean;
|
|
382
|
+
/**
|
|
383
|
+
* If true, markers are enabled based on data density (threshold).
|
|
384
|
+
*/
|
|
385
|
+
auto?: boolean;
|
|
386
|
+
/**
|
|
387
|
+
* Maximum number of points to show markers in auto mode (default 50).
|
|
388
|
+
*/
|
|
389
|
+
threshold?: number;
|
|
390
|
+
};
|
|
391
|
+
theme?: 'light' | 'dark';
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
export declare type HChartMarkerConfig = NonNullable<HChartConfig['markerConfig']>;
|
|
395
|
+
|
|
396
|
+
export declare interface IHChart {
|
|
397
|
+
chart: Highcharts_2.Chart;
|
|
398
|
+
container: HTMLElement;
|
|
399
|
+
activePoint: Point | null;
|
|
400
|
+
addPlugin(plugin: IPlugin): void;
|
|
401
|
+
getPlugin<T extends IPlugin>(name: string): T | undefined;
|
|
402
|
+
removePlugin(name: string): void;
|
|
403
|
+
requestReflow(): void;
|
|
404
|
+
destroy(): void;
|
|
405
|
+
setCursor(point: Point): void;
|
|
406
|
+
setCursorX(x: number): void;
|
|
407
|
+
togglePlugin(name: string, enabled: boolean): void;
|
|
408
|
+
updateOptions?(options: Highcharts_2.Options, redraw?: boolean): void;
|
|
409
|
+
setSeriesData?(data: Highcharts_2.PointOptionsType[], seriesIndex?: number, redraw?: boolean): void;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export declare interface IPlugin {
|
|
413
|
+
name: string;
|
|
414
|
+
init(chart: IHChart): void;
|
|
415
|
+
destroy(): void;
|
|
416
|
+
enable(): void;
|
|
417
|
+
disable(): void;
|
|
418
|
+
update(options: any): void;
|
|
419
|
+
isEnabled?(): boolean;
|
|
420
|
+
onChartClick?(e: Highcharts_2.PointerEventObject): void;
|
|
421
|
+
onCursorChange?(point: Point): void;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/** plot line 运行时通过 addEvent 支持任意 DOM 事件,类型声明只覆盖了其中一部分。 */
|
|
425
|
+
export declare type PlotLineEvents = Highcharts_2.XAxisPlotLinesEventsOptions & {
|
|
426
|
+
mousedown?: (e: PointerEvent) => void;
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
export declare interface Point {
|
|
430
|
+
x: number;
|
|
431
|
+
y: number;
|
|
432
|
+
index: number;
|
|
433
|
+
seriesIndex?: number;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export declare function shouldSuppressCursorClick(container: HTMLElement | null | undefined): boolean;
|
|
437
|
+
|
|
438
|
+
export declare class SidebandPlugin extends BasePlugin {
|
|
439
|
+
name: string;
|
|
440
|
+
private delta;
|
|
441
|
+
private lineCount;
|
|
442
|
+
private lineIds;
|
|
443
|
+
private isDragging;
|
|
444
|
+
private draggedLineIndex;
|
|
445
|
+
private onDeltaChange;
|
|
446
|
+
private lineColor;
|
|
447
|
+
private dashStyle;
|
|
448
|
+
private labelOptions;
|
|
449
|
+
private directShow;
|
|
450
|
+
private xAxisUnit;
|
|
451
|
+
private onMouseUpBound;
|
|
452
|
+
private onContainerMouseMoveBound;
|
|
453
|
+
private eventsBound;
|
|
454
|
+
constructor(options?: SidebandPluginOptions);
|
|
455
|
+
setLineCount(count: number): void;
|
|
456
|
+
getLineCount(): number;
|
|
457
|
+
setDelta(delta: number): void;
|
|
458
|
+
getDelta(): number;
|
|
459
|
+
/** 边频标签:频谱图直接显示 Hz;时域图将 ms 间隔换算为 Hz */
|
|
460
|
+
private formatSidebandLabel;
|
|
461
|
+
isEnabled(): boolean;
|
|
462
|
+
setDirectShow(show: boolean): void;
|
|
463
|
+
init(chart: IHChart): void;
|
|
464
|
+
private bindEvents;
|
|
465
|
+
private unbindEvents;
|
|
466
|
+
private onMouseUp;
|
|
467
|
+
onCursorChange(point: Point): void;
|
|
468
|
+
enable(): void;
|
|
469
|
+
disable(): void;
|
|
470
|
+
private clearLines;
|
|
471
|
+
private renderSidebands;
|
|
472
|
+
private onContainerMouseMove;
|
|
473
|
+
destroy(): void;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
export declare interface SidebandPluginOptions {
|
|
477
|
+
enabled?: boolean;
|
|
478
|
+
initialDelta?: number;
|
|
479
|
+
lineCount?: number;
|
|
480
|
+
directShow?: boolean;
|
|
481
|
+
color?: string;
|
|
482
|
+
dashStyle?: Highcharts_2.DashStyleValue;
|
|
483
|
+
labelColor?: string;
|
|
484
|
+
/** X 轴单位:时域 ms 需将间隔换算为 Hz 显示 */
|
|
485
|
+
xAxisUnit?: 'Hz' | 'ms' | string;
|
|
486
|
+
onDeltaChange?: (delta: number) => void;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/** 框选/拖拽后短暂禁止标点,避免与放大冲突 */
|
|
490
|
+
export declare function suppressCursorClick(container: HTMLElement | null | undefined, ms?: number): void;
|
|
491
|
+
|
|
492
|
+
export declare class ThresholdLinePlugin extends BasePlugin {
|
|
493
|
+
name: string;
|
|
494
|
+
private yValue;
|
|
495
|
+
private lineId;
|
|
496
|
+
private isDragging;
|
|
497
|
+
private annotationId;
|
|
498
|
+
private onContainerMouseMoveBound;
|
|
499
|
+
private onMouseUpBound;
|
|
500
|
+
private eventsBound;
|
|
501
|
+
constructor(options?: ThresholdLinePluginOptions);
|
|
502
|
+
init(chart: IHChart): void;
|
|
503
|
+
private bindEvents;
|
|
504
|
+
private unbindEvents;
|
|
505
|
+
destroy(): void;
|
|
506
|
+
private onMouseUp;
|
|
507
|
+
enable(): void;
|
|
508
|
+
disable(): void;
|
|
509
|
+
private clear;
|
|
510
|
+
setValue(v: number): void;
|
|
511
|
+
getValue(): number;
|
|
512
|
+
private clearMarkers;
|
|
513
|
+
private renderLine;
|
|
514
|
+
private getData;
|
|
515
|
+
private markPointsAboveThreshold;
|
|
516
|
+
private onContainerMouseMove;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
export declare interface ThresholdLinePluginOptions {
|
|
520
|
+
enabled?: boolean;
|
|
521
|
+
initialValue?: number;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
export declare class Utils {
|
|
525
|
+
/**
|
|
526
|
+
* Find the index of the data point closest to a given value using binary search.
|
|
527
|
+
* Assumes data is sorted in ascending order.
|
|
528
|
+
* @param value The value to search for (e.g., x-axis value)
|
|
529
|
+
* @param data The array of values to search in
|
|
530
|
+
* @returns The index of the nearest value
|
|
531
|
+
*/
|
|
532
|
+
static getMostNearIndex(value: number, data: number[]): number;
|
|
533
|
+
/**
|
|
534
|
+
* Helper to format numbers with precision
|
|
535
|
+
*/
|
|
536
|
+
static formatNumber(val: number, decimals?: number): string;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
export declare class ZoomPlugin extends BasePlugin {
|
|
540
|
+
name: string;
|
|
541
|
+
private startX;
|
|
542
|
+
private onMouseDownBound;
|
|
543
|
+
private onMouseUpBound;
|
|
544
|
+
private onContextMenuBound;
|
|
545
|
+
private onMouseMoveBound;
|
|
546
|
+
private isPanning;
|
|
547
|
+
private lastX;
|
|
548
|
+
private rightMouseDown;
|
|
549
|
+
private panMoved;
|
|
550
|
+
private eventsBound;
|
|
551
|
+
constructor(options?: ZoomPluginOptions);
|
|
552
|
+
init(chart: IHChart): void;
|
|
553
|
+
private bindEvents;
|
|
554
|
+
private unbindEvents;
|
|
555
|
+
enable(): void;
|
|
556
|
+
disable(): void;
|
|
557
|
+
private onContextMenu;
|
|
558
|
+
private onMouseDown;
|
|
559
|
+
private onMouseMove;
|
|
560
|
+
private onMouseUp;
|
|
561
|
+
destroy(): void;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
export declare interface ZoomPluginOptions {
|
|
565
|
+
enabled?: boolean;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
export { }
|