@crysound/crychart 0.0.0-stage → 1.0.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.
Files changed (82) hide show
  1. package/LICENSE.md +288 -0
  2. package/LICENSE.zh-CN.md +290 -0
  3. package/README.md +83 -3
  4. package/README.zh-CN.md +79 -0
  5. package/dist/crychart.cjs +25234 -0
  6. package/dist/crychart.global.js +25236 -0
  7. package/dist/crychart.js +25211 -0
  8. package/dist/themes.js +357 -0
  9. package/dist/types/adapters/opentest.d.ts +69 -0
  10. package/dist/types/annotation-interaction.d.ts +36 -0
  11. package/dist/types/axis-canvas.d.ts +78 -0
  12. package/dist/types/axis-layout.d.ts +10 -0
  13. package/dist/types/axis-scroll-animation.d.ts +16 -0
  14. package/dist/types/axis.d.ts +532 -0
  15. package/dist/types/axis3d-label-layout.d.ts +45 -0
  16. package/dist/types/chart-events.d.ts +89 -0
  17. package/dist/types/chart.d.ts +674 -0
  18. package/dist/types/compatibility-types.d.ts +55 -0
  19. package/dist/types/component-highlight.d.ts +21 -0
  20. package/dist/types/contracts.d.ts +88 -0
  21. package/dist/types/core/data.d.ts +204 -0
  22. package/dist/types/core/events.d.ts +16 -0
  23. package/dist/types/core/line-delta-certificate.d.ts +70 -0
  24. package/dist/types/core/paged-columns.d.ts +180 -0
  25. package/dist/types/core/styles.d.ts +350 -0
  26. package/dist/types/css-text-fonts.d.ts +13 -0
  27. package/dist/types/cursor-api.d.ts +47 -0
  28. package/dist/types/custom-icon.d.ts +46 -0
  29. package/dist/types/data-bounds.d.ts +28 -0
  30. package/dist/types/data-order.d.ts +49 -0
  31. package/dist/types/data-runs.d.ts +15 -0
  32. package/dist/types/date-time-formatting.d.ts +32 -0
  33. package/dist/types/date-time-grid.d.ts +56 -0
  34. package/dist/types/formatting-functions.d.ts +16 -0
  35. package/dist/types/geometry.d.ts +378 -0
  36. package/dist/types/gradients.d.ts +37 -0
  37. package/dist/types/grid-layout.d.ts +10 -0
  38. package/dist/types/heatmap-stream.d.ts +38 -0
  39. package/dist/types/hierarchy.d.ts +191 -0
  40. package/dist/types/index.d.ts +75 -0
  41. package/dist/types/interaction-policy.d.ts +56 -0
  42. package/dist/types/line-block-cache.d.ts +146 -0
  43. package/dist/types/line-coverage-geometry.d.ts +28 -0
  44. package/dist/types/line-display-arena.d.ts +64 -0
  45. package/dist/types/line-display-cache.d.ts +144 -0
  46. package/dist/types/line-display-packets.d.ts +43 -0
  47. package/dist/types/line-extrema-pair-proof.d.ts +23 -0
  48. package/dist/types/line-palette-3d.d.ts +6 -0
  49. package/dist/types/line-selection-ledger.d.ts +143 -0
  50. package/dist/types/map.d.ts +219 -0
  51. package/dist/types/mesh3d.d.ts +306 -0
  52. package/dist/types/native-legend.d.ts +208 -0
  53. package/dist/types/point-fill.d.ts +14 -0
  54. package/dist/types/point-stroke-geometry.d.ts +12 -0
  55. package/dist/types/polar-heatmap.d.ts +68 -0
  56. package/dist/types/polar-layout.d.ts +100 -0
  57. package/dist/types/polar-series.d.ts +79 -0
  58. package/dist/types/raster-clip.d.ts +37 -0
  59. package/dist/types/render-heatmap.d.ts +117 -0
  60. package/dist/types/render-line-coverage.d.ts +95 -0
  61. package/dist/types/render-line-direction.d.ts +27 -0
  62. package/dist/types/render-line-offsets.d.ts +61 -0
  63. package/dist/types/render-line-strip.d.ts +102 -0
  64. package/dist/types/render-line-texture.d.ts +30 -0
  65. package/dist/types/render.d.ts +66 -0
  66. package/dist/types/render3d.d.ts +137 -0
  67. package/dist/types/result-table-layout.d.ts +39 -0
  68. package/dist/types/series-attributes.d.ts +7 -0
  69. package/dist/types/series.d.ts +404 -0
  70. package/dist/types/specialty.d.ts +551 -0
  71. package/dist/types/streaming-line-policy.d.ts +11 -0
  72. package/dist/types/stroke-geometry.d.ts +5 -0
  73. package/dist/types/themes.d.ts +32 -0
  74. package/dist/types/time-formatting.d.ts +23 -0
  75. package/dist/types/time-grid.d.ts +26 -0
  76. package/dist/types/ui.d.ts +207 -0
  77. package/dist/types/viewport.d.ts +18 -0
  78. package/dist/types/world-axis.d.ts +21 -0
  79. package/dist/types/world-camera.d.ts +88 -0
  80. package/dist/types/zoom-clock.d.ts +36 -0
  81. package/docs/npm-usage.md +31 -0
  82. package/package.json +68 -6
@@ -0,0 +1,551 @@
1
+ import { EventHub, type EventToken } from './core/events.js';
2
+ import { Color, FontSettings, LUT, SolidLine, type FillStyle, type Theme, type ValueOrMutator } from './core/styles.js';
3
+ import { Cursor, LegendBox, UIElement, type UIPoint } from './ui.js';
4
+ import { type SolveNearestMode } from './cursor-api.js';
5
+ import type { Rect } from './contracts.js';
6
+ export interface SpecialtyOptions {
7
+ container?: string | HTMLElement;
8
+ theme?: Theme;
9
+ width?: number;
10
+ height?: number;
11
+ headless?: boolean;
12
+ [key: string]: unknown;
13
+ }
14
+ interface Hit {
15
+ contains(point: UIPoint): boolean;
16
+ data: any;
17
+ label: string;
18
+ activate?: () => void;
19
+ }
20
+ /** Independent panel lifecycle shared by categorical and tabular charts. */
21
+ export declare abstract class SpecialtyChart {
22
+ readonly events: EventHub;
23
+ readonly theme: Theme;
24
+ readonly canvas?: HTMLCanvasElement;
25
+ readonly container?: HTMLElement;
26
+ readonly ui: UIElement[];
27
+ readonly engine: {
28
+ captureFrame: (type?: string) => Blob;
29
+ layout: () => void;
30
+ };
31
+ title: string;
32
+ titleFont: FontSettings;
33
+ titleAlignment: 'left' | 'center' | 'right';
34
+ background: FillStyle;
35
+ visible: boolean;
36
+ disposed: boolean;
37
+ width: number;
38
+ height: number;
39
+ padding: number;
40
+ protected hits: Hit[];
41
+ protected hovered?: Hit;
42
+ protected selected: any;
43
+ protected pointer: UIPoint;
44
+ protected dragging: boolean;
45
+ private context?;
46
+ private frame?;
47
+ private resizeObserver?;
48
+ private readonly cleanup;
49
+ constructor(options?: SpecialtyOptions);
50
+ invalidate(): void;
51
+ layout(): this;
52
+ render(context?: CanvasRenderingContext2D | undefined): void;
53
+ protected plotRect(): Rect;
54
+ protected abstract renderPlot(ctx: CanvasRenderingContext2D, rect: Rect): void;
55
+ protected onHoverResolved(_hit: Hit | undefined): void;
56
+ protected color(index: number, datum?: any): string;
57
+ protected textColor(): string;
58
+ protected hitRect(rect: Rect, data: any, label: string, activate?: () => void): void;
59
+ protected dragAt(_point: UIPoint): void;
60
+ protected endDragAt(_point: UIPoint): void;
61
+ doubleClickAt(_point: UIPoint): void;
62
+ protected wheel(_delta: number): boolean;
63
+ protected key(_key: string): boolean;
64
+ activateAt(point: UIPoint): any;
65
+ protected drawTooltip(ctx: CanvasRenderingContext2D, label: string): void;
66
+ setTitle(title: string): this;
67
+ getTitle(): string;
68
+ setTitleAlignment(value: 'left' | 'center' | 'right'): this;
69
+ getSelectedItem(): any;
70
+ setTitleFont(value: ValueOrMutator<FontSettings>): this;
71
+ setBackgroundFillStyle(value: ValueOrMutator<FillStyle>): this;
72
+ getBackgroundFillStyle(): FillStyle;
73
+ setPadding(value: number | {
74
+ left?: number;
75
+ top?: number;
76
+ right?: number;
77
+ bottom?: number;
78
+ }): this;
79
+ setVisible(value: boolean): this;
80
+ getVisible(): boolean;
81
+ addUIElement(builder: any, coordinates?: any): UIElement;
82
+ addLegendBox(options?: any): LegendBox;
83
+ on(type: string, listener: (...args: any[]) => void): EventToken;
84
+ off(typeOrToken: string | EventToken, token?: EventToken): boolean;
85
+ onDispose(listener: (chart: this) => void): EventToken;
86
+ getSeries(): any[];
87
+ isDisposed(): boolean;
88
+ dispose(): this;
89
+ captureFrame(type?: string): Blob;
90
+ }
91
+ export declare class PieSlice {
92
+ readonly chart: Pie;
93
+ name: string;
94
+ value: number;
95
+ visible: boolean;
96
+ disposed: boolean;
97
+ fillStyle?: FillStyle;
98
+ strokeStyle: SolidLine;
99
+ private exploded;
100
+ constructor(chart: Pie, name: string, value: number);
101
+ setValue(value: number): this;
102
+ getValue(): number;
103
+ setName(name: string): this;
104
+ getName(): string;
105
+ setFillStyle(value: FillStyle): this;
106
+ getFillStyle(): FillStyle | undefined;
107
+ setStrokeStyle(value: ValueOrMutator<SolidLine>): this;
108
+ setVisible(value: boolean): this;
109
+ getVisible(): boolean;
110
+ setExploded(value: boolean): this;
111
+ getExploded(): boolean;
112
+ /** @internal The chart owns mutual exclusion between live slices. */
113
+ applyExploded(value: boolean): void;
114
+ dispose(): this;
115
+ isDisposed(): boolean;
116
+ }
117
+ export declare function pieAngles(values: readonly number[], start?: number): Array<{
118
+ start: number;
119
+ end: number;
120
+ }>;
121
+ export declare class Pie extends SpecialtyChart {
122
+ readonly slices: PieSlice[];
123
+ innerRadius: number;
124
+ private labelPosition;
125
+ private labelEffect;
126
+ private radiusFactor;
127
+ private selectionOffset;
128
+ private multipleExplosion;
129
+ private cursorMode;
130
+ private readonly nativeCursor;
131
+ private customCursor?;
132
+ private sorter?;
133
+ private labelFormatter;
134
+ private centerLabel;
135
+ private labelFont;
136
+ addSlice(name: string | {
137
+ name?: string;
138
+ value?: number;
139
+ }, value?: number): PieSlice;
140
+ addSlices(data: Array<{
141
+ name: string;
142
+ value: number;
143
+ }>): this;
144
+ setInnerRadius(value: number): this;
145
+ getInnerRadius(): number;
146
+ getSlices(): PieSlice[];
147
+ setMultipleSliceExplosion(value: boolean): this;
148
+ getMultipleSliceExplosion(): boolean;
149
+ setSliceExplosionOffset(value: number): this;
150
+ getSliceExplosionOffset(): number;
151
+ /** @internal Shared by explicit state changes and actual slice activation. */
152
+ setSliceExploded(slice: PieSlice, value: boolean): void;
153
+ setCursorMode(value: SolveNearestMode | undefined): this;
154
+ getCursorMode(): SolveNearestMode | undefined;
155
+ setCursor(mutator: (cursor: Cursor) => Cursor): this;
156
+ getCursor(): Cursor;
157
+ setCustomCursor(value: ((event: any) => unknown) | undefined): this;
158
+ protected onHoverResolved(hit: Hit | undefined): void;
159
+ protected drawTooltip(ctx: CanvasRenderingContext2D, label: string): void;
160
+ dispose(): this;
161
+ setLabelPosition(value: 'inside' | 'outside'): this;
162
+ setLabelFormatter(value: (slice: PieSlice, relativeValue: number) => string): this;
163
+ setLabelFont(value: ValueOrMutator<FontSettings>): this;
164
+ setLabelEffect(value: boolean): this;
165
+ setCenterLabel(value: string | ((total: number) => string)): this;
166
+ setSliceSorter(value: (a: PieSlice, b: PieSlice) => number): this;
167
+ setRadiusFactor(value: number): this;
168
+ setSelectionOffset(value: number): this;
169
+ getSeries(): PieSlice[];
170
+ protected renderPlot(ctx: CanvasRenderingContext2D, rect: Rect): void;
171
+ }
172
+ export declare class Gauge extends SpecialtyChart {
173
+ value: number;
174
+ interval: {
175
+ start: number;
176
+ end: number;
177
+ };
178
+ unit: string;
179
+ valueFormatter: (value: number) => string;
180
+ private arc;
181
+ private cursorStyle;
182
+ private labelPosition;
183
+ private bands;
184
+ private arcColor?;
185
+ private arcThickness;
186
+ private progressVisible;
187
+ private interactive;
188
+ private tickValues;
189
+ private valueFontSize?;
190
+ private orientation;
191
+ private linearLUT?;
192
+ /** Explicit linear mode; the default radial drawing and interaction remain unchanged. */
193
+ setOrientation(value: 'radial' | 'vertical' | 'horizontal'): this;
194
+ getOrientation(): 'radial' | 'vertical' | 'horizontal';
195
+ setLinearLUT(value: LUT | undefined): this;
196
+ getLinearLUT(): LUT | undefined;
197
+ setValue(value: number): this;
198
+ getValue(): number;
199
+ setInterval(value: {
200
+ start: number;
201
+ end: number;
202
+ }): this;
203
+ setUnitLabel(unit: string): this;
204
+ setValueFormatter(formatter: (value: number) => string): this;
205
+ setArc(start: number, sweep: number): this;
206
+ setCursorStyle(value: 'needle' | 'arc'): this;
207
+ setValueLabelPosition(value: 'below' | 'center'): this;
208
+ setBands(value: Array<{
209
+ start: number;
210
+ end: number;
211
+ color: Color;
212
+ }>): this;
213
+ setArcColor(value: Color): this;
214
+ setArcThickness(value: number): this;
215
+ setProgressVisible(value: boolean): this;
216
+ setInteractive(value: boolean): this;
217
+ setTickValues(value: number[]): this;
218
+ setValueFontSize(value: number): this;
219
+ private geometry;
220
+ protected dragAt(p: UIPoint): void;
221
+ protected key(key: string): boolean;
222
+ protected renderPlot(ctx: CanvasRenderingContext2D, rect: Rect): void;
223
+ private linearTrack;
224
+ private renderLinear;
225
+ }
226
+ export interface SpiderPoint {
227
+ name: string;
228
+ value: number;
229
+ }
230
+ export declare class SpiderSeries {
231
+ readonly chart: Spider;
232
+ points: SpiderPoint[];
233
+ name: string;
234
+ visible: boolean;
235
+ disposed: boolean;
236
+ fillStyle?: FillStyle;
237
+ strokeStyle?: SolidLine;
238
+ fillOpacity: number;
239
+ constructor(chart: Spider);
240
+ setName(name: string): this;
241
+ getName(): string;
242
+ addPoints(points: SpiderPoint[]): this;
243
+ setData(points: SpiderPoint[]): this;
244
+ setFillStyle(fill: FillStyle): this;
245
+ setFillOpacity(value: number): this;
246
+ getFillStyle(): FillStyle | undefined;
247
+ setStrokeStyle(stroke: SolidLine): this;
248
+ setVisible(value: boolean): this;
249
+ getVisible(): boolean;
250
+ clear(): this;
251
+ dispose(): this;
252
+ isDisposed(): boolean;
253
+ }
254
+ export declare class Spider extends SpecialtyChart {
255
+ readonly series: SpiderSeries[];
256
+ private axisRanges;
257
+ private gridShape;
258
+ private radiusFactor;
259
+ private tickCount;
260
+ private tickLabels;
261
+ private labelEffect;
262
+ setAxisRange(name: string, value: {
263
+ start: number;
264
+ end: number;
265
+ }): this;
266
+ getAxisRange(name: string): {
267
+ start: number;
268
+ end: number;
269
+ } | undefined;
270
+ setGridShape(value: 'polygon' | 'circle'): this;
271
+ setRadiusFactor(value: number): this;
272
+ setTickCount(value: number): this;
273
+ setTickLabels(value: 'none' | 'first' | 'all'): this;
274
+ setLabelEffect(value: boolean): this;
275
+ addSeries(): SpiderSeries;
276
+ getSeries(): SpiderSeries[];
277
+ protected renderPlot(ctx: CanvasRenderingContext2D, rect: Rect): void;
278
+ }
279
+ export interface BarDatum {
280
+ category?: string;
281
+ name?: string;
282
+ value: number;
283
+ start?: number;
284
+ row?: number;
285
+ barSize?: number;
286
+ label?: string;
287
+ color?: string | Color;
288
+ [key: string]: unknown;
289
+ }
290
+ export declare class BarChart extends SpecialtyChart {
291
+ data: BarDatum[];
292
+ horizontal: boolean;
293
+ private renderedBars;
294
+ private interval?;
295
+ private valueAxisTitle;
296
+ private categoryAxisTitle;
297
+ private numericPlacement;
298
+ private categories?;
299
+ private numericFormatter;
300
+ private barFormatter;
301
+ private labels;
302
+ private categoryLabelsAtBars;
303
+ private grid;
304
+ private tickCount;
305
+ private cornerRadius;
306
+ private gradient;
307
+ private effect;
308
+ private labelEffect;
309
+ addData(data: BarDatum[]): this;
310
+ setData(data: BarDatum[]): this;
311
+ setHorizontal(value: boolean): this;
312
+ setValueInterval(value: {
313
+ start: number;
314
+ end: number;
315
+ }): this;
316
+ setValueAxisTitle(value: string): this;
317
+ setCategoryAxisTitle(value: string): this;
318
+ setValueAxisPlacement(value: 'start' | 'end'): this;
319
+ setCategories(value: string[]): this;
320
+ setValueFormatter(value: (value: number) => string): this;
321
+ setBarLabelFormatter(value: (datum: BarDatum) => string): this;
322
+ setLabelPosition(value: 'inside' | 'inside-end' | 'outside' | 'none'): this;
323
+ setCategoryLabelsAtBars(value: boolean): this;
324
+ setGridVisible(value: boolean): this;
325
+ setTickCount(value: number): this;
326
+ setCornerRadius(value: number): this;
327
+ setGradientFill(value: boolean): this;
328
+ setBarEffect(value: boolean): this;
329
+ setLabelEffect(value: boolean): this;
330
+ getData(): BarDatum[];
331
+ /** Rectangle from the latest completed draw, in chart-local CSS pixels. */
332
+ getBarScreenRect(index: number): Rect | undefined;
333
+ clear(): this;
334
+ protected renderPlot(ctx: CanvasRenderingContext2D, rect: Rect): void;
335
+ }
336
+ export interface TreeMapNode {
337
+ name: string;
338
+ value?: number;
339
+ children?: TreeMapNode[];
340
+ color?: string | Color;
341
+ [key: string]: unknown;
342
+ }
343
+ export interface TreeMapTile extends Rect {
344
+ node: TreeMapNode;
345
+ weight: number;
346
+ }
347
+ /** Balanced recursive partition preserves area and avoids tiny sequential remainder strips. */
348
+ export declare function layoutTreemap(data: readonly TreeMapNode[], rect: Rect): TreeMapTile[];
349
+ export declare class TreeMapChart extends SpecialtyChart {
350
+ data: TreeMapNode[];
351
+ private path;
352
+ private hierarchyDepth;
353
+ private labelEffect;
354
+ private valueLabels;
355
+ private cornerRadius;
356
+ private tilePadding;
357
+ private labelFont;
358
+ setData(data: TreeMapNode[] | TreeMapNode, options?: {
359
+ preservePath?: boolean;
360
+ }): this;
361
+ getData(): TreeMapNode[];
362
+ getPath(): string[];
363
+ drillDown(target: TreeMapNode | string): this;
364
+ drillUp(): this;
365
+ resetView(): this;
366
+ setHierarchyDepth(value: number): this;
367
+ setValueLabelsVisible(value: boolean): this;
368
+ setLabelFont(value: ValueOrMutator<FontSettings>): this;
369
+ setLabelEffect(value: boolean): this;
370
+ setCornerRadius(value: number): this;
371
+ setTilePadding(value: number): this;
372
+ protected key(key: string): boolean;
373
+ protected renderPlot(ctx: CanvasRenderingContext2D, rect: Rect): void;
374
+ }
375
+ export type ParallelValue = number | string | Date;
376
+ export interface ParallelAxisOptions {
377
+ title?: string;
378
+ type?: 'numeric' | 'category' | 'datetime' | 'duration';
379
+ range?: {
380
+ start: number;
381
+ end: number;
382
+ };
383
+ categories?: string[];
384
+ inverted?: boolean;
385
+ ticks?: Array<{
386
+ value: ParallelValue;
387
+ label?: string;
388
+ }>;
389
+ tickCount?: number;
390
+ format?: (value: number | string) => string;
391
+ }
392
+ export interface ParallelThreshold {
393
+ start: number;
394
+ end: number;
395
+ color?: Color | string;
396
+ }
397
+ export interface ParallelAxisDomain {
398
+ key: string;
399
+ type: NonNullable<ParallelAxisOptions['type']>;
400
+ start: number;
401
+ end: number;
402
+ categories: string[];
403
+ }
404
+ export declare function formatParallelDuration(milliseconds: number): string;
405
+ /** Mixed-type axes retain raw records; numeric projection and Path2D geometry are revision caches. */
406
+ export declare class ParallelCoordinateChart extends SpecialtyChart {
407
+ data: Record<string, any>[];
408
+ dimensions: string[];
409
+ private axisOptions;
410
+ private thresholds;
411
+ private filters;
412
+ private prepared;
413
+ private matching;
414
+ private dirty;
415
+ private geometryRevision;
416
+ private pathKey;
417
+ private paths?;
418
+ private maxRows;
419
+ private nextRowIndex;
420
+ private smooth;
421
+ private strokeWidth;
422
+ private opacity;
423
+ private uniformColor?;
424
+ private labelAngle;
425
+ private mapping?;
426
+ private rowColors;
427
+ private rangeSelectors;
428
+ private hoverMode;
429
+ private filterDrag?;
430
+ private suppressClick;
431
+ private selectedKey;
432
+ private graph?;
433
+ private xs;
434
+ private axisItems;
435
+ readonly renderStats: {
436
+ projectionBuilds: number;
437
+ pathBuilds: number;
438
+ retainedRows: number;
439
+ renderedSegments: number;
440
+ };
441
+ setData(data: Record<string, any>[], dimensions?: string[]): this;
442
+ addData(data: Record<string, any>[]): this;
443
+ clear(): this;
444
+ getData(): Record<string, any>[];
445
+ getSampleCount(): number;
446
+ getNextSampleIndex(): number;
447
+ setMaxSampleCount(value: number | undefined): this;
448
+ getMaxSampleCount(): number | undefined;
449
+ setAxisOptions(key: string, options: ParallelAxisOptions): this;
450
+ getAxisDomain(key: string): ParallelAxisDomain | undefined;
451
+ setInterpolation(value: 'linear' | 'smooth'): this;
452
+ setStrokeThickness(value: number): this;
453
+ setLineOpacity(value: number): this;
454
+ setLineColor(value: Color | string): this;
455
+ setAxisLabelAngle(degrees: number): this;
456
+ setHoverMode(value: 'row' | 'axis'): this;
457
+ setColorMapping(key: string, lut: LUT, options?: {
458
+ range?: {
459
+ start: number;
460
+ end: number;
461
+ };
462
+ legend?: boolean;
463
+ title?: string;
464
+ }): this;
465
+ setThresholds(key: string, values: ParallelThreshold[]): this;
466
+ getThresholds(key: string): ParallelThreshold[];
467
+ setRangeSelectorsEnabled(value: boolean): this;
468
+ setRangeFilter(key: string, value: {
469
+ start: ParallelValue;
470
+ end: ParallelValue;
471
+ } | undefined): this;
472
+ clearRangeFilters(): this;
473
+ getRangeFilters(): Record<string, {
474
+ start: number;
475
+ end: number;
476
+ }>;
477
+ getFilteredData(): Record<string, any>[];
478
+ getFilteredCount(): number;
479
+ setRowId(key: string): this;
480
+ setSelectedRow(value?: Record<string, any> | string | number): this;
481
+ getSelectedRow(): Record<string, any> | undefined;
482
+ getAxisScreenPosition(key: string, value: ParallelValue): UIPoint | undefined;
483
+ private markData;
484
+ private emitFilterChange;
485
+ private encode;
486
+ private prepare;
487
+ private updateMatches;
488
+ private layoutGraph;
489
+ private valueY;
490
+ private atY;
491
+ private axisNear;
492
+ doubleClickAt(point: UIPoint): void;
493
+ protected dragAt(point: UIPoint): void;
494
+ protected endDragAt(_point: UIPoint): void;
495
+ activateAt(point: UIPoint): any;
496
+ protected key(key: string): boolean;
497
+ private label;
498
+ private rowLabel;
499
+ private nearestRow;
500
+ private trace;
501
+ protected renderPlot(ctx: CanvasRenderingContext2D, rect: Rect): void;
502
+ }
503
+ export interface DataGridCellStyle {
504
+ background?: string;
505
+ color?: string;
506
+ }
507
+ export type DataGridCellRenderer = (context: CanvasRenderingContext2D, rect: Rect, value: any, row: Readonly<Record<string, any>>) => void;
508
+ export declare class DataGrid extends SpecialtyChart {
509
+ data: Record<string, any>[];
510
+ columns: string[];
511
+ rowHeight: number;
512
+ scrollOffset: number;
513
+ sortKey?: string;
514
+ ascending: boolean;
515
+ private formatters;
516
+ private columnTitles;
517
+ private rowKey;
518
+ private scrollbar;
519
+ private scrollDrag?;
520
+ private cellStyle?;
521
+ private renderers;
522
+ setData(data: Record<string, any>[], columns?: string[], options?: {
523
+ preserveScroll?: boolean;
524
+ preserveSelection?: boolean;
525
+ }): this;
526
+ getData(): Record<string, any>[];
527
+ getRowCount(): number;
528
+ getRowScreenPosition(id: string | number): UIPoint | undefined;
529
+ setRowId(key: string): this;
530
+ setSelectedRow(value?: Record<string, any> | string | number): this;
531
+ getSelectedRow(): Record<string, any> | undefined;
532
+ activateAt(point: UIPoint): any;
533
+ setColumnFormatter(key: string, formatter: (value: any, row: Record<string, any>) => string): this;
534
+ setColumnTitle(key: string, title: string): this;
535
+ /** Original extension: apply conditional formatting without changing underlying values or sort order. */
536
+ setCellStyle(style?: (value: any, key: string, row: Readonly<Record<string, any>>) => DataGridCellStyle): this;
537
+ getCellStyle(id: string | number, key: string): DataGridCellStyle | undefined;
538
+ setColumnRenderer(key: string, renderer?: DataGridCellRenderer): this;
539
+ getCellScreenRect(id: string | number, key: string): Rect | undefined;
540
+ setScrollbarVisible(value: boolean): this;
541
+ setRowHeight(value: number): this;
542
+ scrollTo(row: number): this;
543
+ sortBy(key: string, ascending?: boolean): this;
544
+ protected wheel(delta: number): boolean;
545
+ protected key(key: string): boolean;
546
+ protected dragAt(point: UIPoint): void;
547
+ protected endDragAt(_point: UIPoint): void;
548
+ private format;
549
+ protected renderPlot(ctx: CanvasRenderingContext2D, rect: Rect): void;
550
+ }
551
+ export {};
@@ -0,0 +1,11 @@
1
+ /** CPU admission only. Source data retention and public readback are unchanged. */
2
+ export declare function isDenseStreamingLineWindow(sampleCount: number, maxSampleCount: number | undefined, cssWidth: number, dpr: number): boolean;
3
+ /** Use physical pixels, so a narrow high-DPR view is not treated as a CSS-pixel view. */
4
+ export declare function isDenseStreamingLineViewport(visibleSampleCount: number, cssWidth: number, dpr: number): boolean;
5
+ /** These two axis types use the same affine value transform, not the same precision policy. */
6
+ export declare function isAffineLineAxis(type: string): boolean;
7
+ /** Conservative bound for the Float32 vertex/uniform/subtract/divide/clip pipeline.
8
+ * Never add the relative coordinate back to a large epoch to estimate error:
9
+ * that addition can round away the error being measured. Near an epoch,
10
+ * Sterbenz's lemma makes the original Float64 subtraction exact. */
11
+ export declare function relativeProjectionPixelError(origin: number, start: number, end: number, maximumRelativeMagnitude: number, pixelLength: number): number;
@@ -0,0 +1,5 @@
1
+ /** Each segment stores a bounded dash phase and its physical end distance. */
2
+ export declare function dashDistances(positions: Float32Array, scaleX: number, scaleY: number, period: number): Float32Array;
3
+ export declare function dashPattern(pattern: readonly number[], scale?: number): number[];
4
+ /** Cubic Hermite interpolation with neighboring secants; missing samples split curves. */
5
+ export declare function splinePositions(points: Float32Array, subdivisions?: number): Float32Array;
@@ -0,0 +1,32 @@
1
+ import { Color, Themes, type FillStyle, type LineStyle, type Theme } from './core/styles.js';
2
+ export interface CustomThemeOptions {
3
+ isDark?: boolean;
4
+ effects?: boolean;
5
+ gradients?: boolean;
6
+ dataColors?: readonly Color[];
7
+ backgroundColor?: Color | FillStyle;
8
+ textColor?: Color;
9
+ gridLineColor?: Color;
10
+ axisColor?: Color;
11
+ uiBackgroundColor?: Color;
12
+ uiBorderColor?: Color;
13
+ dashboardSplitterColor?: Color;
14
+ fontFamily?: string;
15
+ axisTickStrokeStyle?: LineStyle;
16
+ minorTickGridStrokeStyle?: LineStyle;
17
+ lineSeriesStrokeStyle?: LineStyle | ((index: number) => LineStyle);
18
+ pointSeriesFillStyle?: Theme['pointSeriesFillStyle'];
19
+ pointSeriesStrokeStyle?: Theme['pointSeriesStrokeStyle'];
20
+ lineSeries3DStrokeStyle?: Theme['lineSeries3DStrokeStyle'];
21
+ pointSeries3DPointStyle?: Theme['pointSeries3DPointStyle'];
22
+ fontSize?: number | Partial<{
23
+ chartTitle: number;
24
+ axisTitle: number;
25
+ legendTitle: number;
26
+ other: number;
27
+ }>;
28
+ [key: string]: unknown;
29
+ }
30
+ /** Theme construction maps user palette choices to concrete drawing styles. */
31
+ export declare function makeCustomTheme(options?: CustomThemeOptions): Theme;
32
+ export { Themes };
@@ -0,0 +1,23 @@
1
+ import type { FormattingRange } from './formatting-functions.js';
2
+ /** Number of fractional second digits supported by Time tick formatting. */
3
+ export type TimePrecision = 0 | 3 | 6 | 9;
4
+ /** Format a signed duration in milliseconds, without changing the source value.
5
+ * Hours do not wrap at midnight. Seconds/milliseconds omit smaller units;
6
+ * microseconds/nanoseconds round the final unit and propagate its carry.
7
+ */
8
+ export declare function formatTime(value: number, precision?: TimePrecision): string;
9
+ /** Public duration formatters; inputs are milliseconds, including fractions. */
10
+ export declare const TimeFormattingFunctions: Readonly<{
11
+ hhmmss: (value: number) => string;
12
+ hhmmssmmm: (value: number) => string;
13
+ hhmmssmmmuuu: (value: number) => string;
14
+ hhmmssmmmuuunnn: (value: number) => string;
15
+ }>;
16
+ /** Select display precision from the resolved formatting range in milliseconds.
17
+ * These boundaries are verified through the public Time axis API, with scroll
18
+ * margins disabled so a logical range cannot be confused with layout padding.
19
+ */
20
+ export declare function timePrecisionForRange(range: FormattingRange): TimePrecision;
21
+ /** Default Time-axis formatting; custom formatter callbacks apply their own
22
+ * policy and must not receive this origin-adjusted display value implicitly. */
23
+ export declare function formatTimeDefault(value: number, range: FormattingRange, timeOrigin?: number): string;
@@ -0,0 +1,26 @@
1
+ import { type TickPositions } from './grid-layout.js';
2
+ /** 候选第一阶段:只修正已观察的秒/分钟主格线分派。
3
+ * 15s下界和1day上界是本库保守实现范围;不声明完整时间转换阈值。
4
+ * 89,999/90,000ms及599,999/600,000ms的边界均有真实公开观察。
5
+ * 返回的绘制坐标仍裁剪到原区间;formatter区间外候选不视为已绘制。
6
+ */
7
+ export declare function timeTickPositions(start: number, end: number, axisSizePixels: number, intervalCount?: number, minorDensity?: Pick<TimeMinorProposalInput, 'majorLabelWidth' | 'minorLabelWidth'>): TickPositions;
8
+ export interface TimeMinorProposalInput {
9
+ start: number;
10
+ end: number;
11
+ axisSizePixels: number;
12
+ majorLabelWidth: number;
13
+ minorLabelWidth: number;
14
+ }
15
+ export interface TimeMinorProposal {
16
+ scope: 'bounded-time';
17
+ majorStep: number;
18
+ minorStep: number | undefined;
19
+ minor: number[];
20
+ minimumCenterDistance: number;
21
+ }
22
+ /** 有限范围的时间次格线:以时钟整数子格为候选,根据主/次文本实际宽度及15CSS间隔选择。
23
+ * 15CSS是字号、宽度与未着色PNG布局条件共同约束下的本库间隔参数。62行仅名义格线吻合,不计运行验收。
24
+ * 仅15s≤span<1h有支持;2h的15min/20min反例禁止向hour域泛化。
25
+ */
26
+ export declare function timeMinorTickPositions(input: TimeMinorProposalInput): TimeMinorProposal | undefined;