@crysound/crychart 0.0.0-stage → 1.0.2
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.md +288 -0
- package/LICENSE.zh-CN.md +290 -0
- package/README.md +82 -2
- package/README.zh-CN.md +79 -0
- package/dist/crychart.cjs +25234 -0
- package/dist/crychart.global.js +25236 -0
- package/dist/crychart.js +25211 -0
- package/dist/themes.js +357 -0
- package/dist/types/adapters/opentest.d.ts +69 -0
- package/dist/types/annotation-interaction.d.ts +36 -0
- package/dist/types/axis-canvas.d.ts +78 -0
- package/dist/types/axis-layout.d.ts +10 -0
- package/dist/types/axis-scroll-animation.d.ts +16 -0
- package/dist/types/axis.d.ts +532 -0
- package/dist/types/axis3d-label-layout.d.ts +45 -0
- package/dist/types/chart-events.d.ts +89 -0
- package/dist/types/chart.d.ts +674 -0
- package/dist/types/compatibility-types.d.ts +55 -0
- package/dist/types/component-highlight.d.ts +21 -0
- package/dist/types/contracts.d.ts +88 -0
- package/dist/types/core/data.d.ts +204 -0
- package/dist/types/core/events.d.ts +16 -0
- package/dist/types/core/line-delta-certificate.d.ts +70 -0
- package/dist/types/core/paged-columns.d.ts +180 -0
- package/dist/types/core/styles.d.ts +350 -0
- package/dist/types/css-text-fonts.d.ts +13 -0
- package/dist/types/cursor-api.d.ts +47 -0
- package/dist/types/custom-icon.d.ts +46 -0
- package/dist/types/data-bounds.d.ts +28 -0
- package/dist/types/data-order.d.ts +49 -0
- package/dist/types/data-runs.d.ts +15 -0
- package/dist/types/date-time-formatting.d.ts +32 -0
- package/dist/types/date-time-grid.d.ts +56 -0
- package/dist/types/formatting-functions.d.ts +16 -0
- package/dist/types/geometry.d.ts +378 -0
- package/dist/types/gradients.d.ts +37 -0
- package/dist/types/grid-layout.d.ts +10 -0
- package/dist/types/heatmap-stream.d.ts +38 -0
- package/dist/types/hierarchy.d.ts +191 -0
- package/dist/types/index.d.ts +75 -0
- package/dist/types/interaction-policy.d.ts +56 -0
- package/dist/types/line-block-cache.d.ts +146 -0
- package/dist/types/line-coverage-geometry.d.ts +28 -0
- package/dist/types/line-display-arena.d.ts +64 -0
- package/dist/types/line-display-cache.d.ts +144 -0
- package/dist/types/line-display-packets.d.ts +43 -0
- package/dist/types/line-extrema-pair-proof.d.ts +23 -0
- package/dist/types/line-palette-3d.d.ts +6 -0
- package/dist/types/line-selection-ledger.d.ts +143 -0
- package/dist/types/map.d.ts +219 -0
- package/dist/types/mesh3d.d.ts +306 -0
- package/dist/types/native-legend.d.ts +208 -0
- package/dist/types/point-fill.d.ts +14 -0
- package/dist/types/point-stroke-geometry.d.ts +12 -0
- package/dist/types/polar-heatmap.d.ts +68 -0
- package/dist/types/polar-layout.d.ts +100 -0
- package/dist/types/polar-series.d.ts +79 -0
- package/dist/types/raster-clip.d.ts +37 -0
- package/dist/types/render-heatmap.d.ts +117 -0
- package/dist/types/render-line-coverage.d.ts +95 -0
- package/dist/types/render-line-direction.d.ts +27 -0
- package/dist/types/render-line-offsets.d.ts +61 -0
- package/dist/types/render-line-strip.d.ts +102 -0
- package/dist/types/render-line-texture.d.ts +30 -0
- package/dist/types/render.d.ts +66 -0
- package/dist/types/render3d.d.ts +137 -0
- package/dist/types/result-table-layout.d.ts +39 -0
- package/dist/types/series-attributes.d.ts +7 -0
- package/dist/types/series.d.ts +404 -0
- package/dist/types/specialty.d.ts +551 -0
- package/dist/types/streaming-line-policy.d.ts +11 -0
- package/dist/types/stroke-geometry.d.ts +5 -0
- package/dist/types/themes.d.ts +32 -0
- package/dist/types/time-formatting.d.ts +23 -0
- package/dist/types/time-grid.d.ts +26 -0
- package/dist/types/ui.d.ts +207 -0
- package/dist/types/viewport.d.ts +18 -0
- package/dist/types/world-axis.d.ts +21 -0
- package/dist/types/world-camera.d.ts +88 -0
- package/dist/types/zoom-clock.d.ts +36 -0
- package/docs/npm-usage.md +31 -0
- package/package.json +66 -4
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import { EventHub, type EventToken } from './core/events.js';
|
|
2
|
+
import { type FillStyle, type LineStyle, type ValueOrMutator } from './core/styles.js';
|
|
3
|
+
import type { Interval, Rect, RenderHost } from './contracts.js';
|
|
4
|
+
import { type CoordinateClient, type SolveNearestMode } from './cursor-api.js';
|
|
5
|
+
export interface GeometryPoint {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
}
|
|
9
|
+
export interface GeometryOptions {
|
|
10
|
+
axisX?: any;
|
|
11
|
+
axisY?: any;
|
|
12
|
+
fillStyle?: FillStyle;
|
|
13
|
+
strokeStyle?: LineStyle;
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}
|
|
16
|
+
export interface RectangleDimensions {
|
|
17
|
+
x?: number;
|
|
18
|
+
y?: number;
|
|
19
|
+
width?: number;
|
|
20
|
+
height?: number;
|
|
21
|
+
x1?: number;
|
|
22
|
+
y1?: number;
|
|
23
|
+
x2?: number;
|
|
24
|
+
y2?: number;
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}
|
|
27
|
+
export interface SegmentDimensions {
|
|
28
|
+
startX?: number;
|
|
29
|
+
startY?: number;
|
|
30
|
+
endX?: number;
|
|
31
|
+
endY?: number;
|
|
32
|
+
start?: GeometryPoint;
|
|
33
|
+
end?: GeometryPoint;
|
|
34
|
+
[key: string]: any;
|
|
35
|
+
}
|
|
36
|
+
export interface RangePoint {
|
|
37
|
+
x?: number;
|
|
38
|
+
position?: number;
|
|
39
|
+
low?: number;
|
|
40
|
+
high?: number;
|
|
41
|
+
yLow?: number;
|
|
42
|
+
yHigh?: number;
|
|
43
|
+
}
|
|
44
|
+
export interface OHLCPoint {
|
|
45
|
+
x: number;
|
|
46
|
+
open: number;
|
|
47
|
+
high: number;
|
|
48
|
+
low: number;
|
|
49
|
+
close: number;
|
|
50
|
+
}
|
|
51
|
+
export interface BoxDimensions {
|
|
52
|
+
x?: number;
|
|
53
|
+
width?: number;
|
|
54
|
+
start?: number;
|
|
55
|
+
end?: number;
|
|
56
|
+
min?: number;
|
|
57
|
+
max?: number;
|
|
58
|
+
lowerExtreme?: number;
|
|
59
|
+
upperExtreme?: number;
|
|
60
|
+
lowerQuartile: number;
|
|
61
|
+
upperQuartile: number;
|
|
62
|
+
median: number;
|
|
63
|
+
[key: string]: any;
|
|
64
|
+
}
|
|
65
|
+
/** Interleaved numeric storage; item handles are created only when explicitly returned. */
|
|
66
|
+
declare class PackedRows {
|
|
67
|
+
readonly stride: number;
|
|
68
|
+
values: Float64Array<ArrayBuffer>;
|
|
69
|
+
flags: Uint8Array<ArrayBuffer>;
|
|
70
|
+
length: number;
|
|
71
|
+
count: number;
|
|
72
|
+
epoch: number;
|
|
73
|
+
constructor(stride: number);
|
|
74
|
+
append(count: number): number;
|
|
75
|
+
clear(): void;
|
|
76
|
+
}
|
|
77
|
+
export declare class GeometryStyle {
|
|
78
|
+
fill: FillStyle;
|
|
79
|
+
stroke: LineStyle;
|
|
80
|
+
constructor(fill: FillStyle, stroke: LineStyle);
|
|
81
|
+
setFillStyle(value: ValueOrMutator<FillStyle>): this;
|
|
82
|
+
getFillStyle(): FillStyle;
|
|
83
|
+
setStrokeStyle(value: ValueOrMutator<LineStyle>): this;
|
|
84
|
+
getStrokeStyle(): LineStyle;
|
|
85
|
+
}
|
|
86
|
+
export declare abstract class GeometrySeries {
|
|
87
|
+
readonly chart: RenderHost;
|
|
88
|
+
readonly kind: string;
|
|
89
|
+
private readonly componentHighlight;
|
|
90
|
+
protected supportsHighlightRendering(): boolean;
|
|
91
|
+
readonly id: number;
|
|
92
|
+
readonly events: EventHub;
|
|
93
|
+
readonly axisX: any;
|
|
94
|
+
readonly axisY: any;
|
|
95
|
+
readonly xAxis: any;
|
|
96
|
+
readonly yAxis: any;
|
|
97
|
+
name: string;
|
|
98
|
+
visible: boolean;
|
|
99
|
+
disposed: boolean;
|
|
100
|
+
revision: number;
|
|
101
|
+
fill: FillStyle;
|
|
102
|
+
stroke: LineStyle;
|
|
103
|
+
mouseInteractions: boolean;
|
|
104
|
+
cursorEnabled: boolean;
|
|
105
|
+
highlight: number;
|
|
106
|
+
cursorFormatter: any;
|
|
107
|
+
protected lastRect?: Rect;
|
|
108
|
+
private cachedRevision;
|
|
109
|
+
private cachedBounds;
|
|
110
|
+
private seriesDrawOrderIndex;
|
|
111
|
+
constructor(chart: RenderHost, kind: string, options?: GeometryOptions);
|
|
112
|
+
changed(): void;
|
|
113
|
+
protected assertAlive(): void;
|
|
114
|
+
setName(value: string): this;
|
|
115
|
+
getName(): string;
|
|
116
|
+
setDrawOrder(value: {
|
|
117
|
+
seriesDrawOrderIndex: number;
|
|
118
|
+
}): this;
|
|
119
|
+
/** Internal ordering capability; default order belongs to the chart registration sequence. */
|
|
120
|
+
getSeriesDrawOrderIndex(): number | undefined;
|
|
121
|
+
setVisible(value: boolean): this;
|
|
122
|
+
getVisible(): boolean;
|
|
123
|
+
setFillStyle(value: ValueOrMutator<FillStyle>): this;
|
|
124
|
+
getFillStyle(): FillStyle;
|
|
125
|
+
setStrokeStyle(value: ValueOrMutator<LineStyle>): this;
|
|
126
|
+
getStrokeStyle(): LineStyle;
|
|
127
|
+
setDefaultStyle(styler: (style: GeometryStyle) => GeometryStyle): this;
|
|
128
|
+
setCursorResultTableFormatter(value: any): this;
|
|
129
|
+
getCursorResultTableFormatter(): any;
|
|
130
|
+
setCursorEnabled(value: boolean): this;
|
|
131
|
+
setMouseInteractions(value: boolean): this;
|
|
132
|
+
setMouseInteractionsEnabled(value: boolean): this;
|
|
133
|
+
setHighlight(value: boolean | number): this;
|
|
134
|
+
getHighlight(): number;
|
|
135
|
+
setAnimationHighlight(enabled: boolean): this;
|
|
136
|
+
getAnimationHighlight(): boolean;
|
|
137
|
+
advanceHighlight(timestamp: number): void;
|
|
138
|
+
hasPendingHighlight(): boolean;
|
|
139
|
+
getHighlightStrength(): number;
|
|
140
|
+
cancelHighlightAnimation(): void;
|
|
141
|
+
suspendHighlightAnimation(): void;
|
|
142
|
+
protected renderColorCSS(fill: FillStyle, value?: number): string;
|
|
143
|
+
setEffect(value: boolean): this;
|
|
144
|
+
getAxisX(): any;
|
|
145
|
+
getAxisY(): any;
|
|
146
|
+
on(type: string, listener: (...args: any[]) => void): EventToken;
|
|
147
|
+
off(typeOrToken: string | EventToken, token?: EventToken): boolean;
|
|
148
|
+
onDispose(listener: (series: this) => void): EventToken;
|
|
149
|
+
dispose(): this;
|
|
150
|
+
isDisposed(): boolean;
|
|
151
|
+
abstract clear(): this;
|
|
152
|
+
abstract getSampleCount(): number;
|
|
153
|
+
getPointCount(): number;
|
|
154
|
+
getXMin(): number;
|
|
155
|
+
getXMax(): number;
|
|
156
|
+
getYMin(): number;
|
|
157
|
+
getYMax(): number;
|
|
158
|
+
bounds(dimension: 'x' | 'y' | 'z'): Interval | undefined;
|
|
159
|
+
protected abstract calculateBounds(): {
|
|
160
|
+
x?: Interval;
|
|
161
|
+
y?: Interval;
|
|
162
|
+
};
|
|
163
|
+
protected projectors(rect: Rect): {
|
|
164
|
+
x: (value: number) => number;
|
|
165
|
+
y: (value: number) => number;
|
|
166
|
+
};
|
|
167
|
+
draw(ctx: CanvasRenderingContext2D, rect: Rect): void;
|
|
168
|
+
protected abstract drawGeometry(ctx: CanvasRenderingContext2D, rect: Rect): void;
|
|
169
|
+
solveNearestFromScreen(point: GeometryPoint): any;
|
|
170
|
+
hitTest(_point: GeometryPoint, _rect: Rect): any;
|
|
171
|
+
}
|
|
172
|
+
declare abstract class PackedSeries extends GeometrySeries {
|
|
173
|
+
readonly rows: PackedRows;
|
|
174
|
+
readonly itemStyles: Map<number, {
|
|
175
|
+
fill?: FillStyle;
|
|
176
|
+
stroke?: LineStyle;
|
|
177
|
+
}>;
|
|
178
|
+
readonly metadata: Map<number, Record<string, any>>;
|
|
179
|
+
constructor(chart: RenderHost, kind: string, stride: number, options?: GeometryOptions);
|
|
180
|
+
clear(): this;
|
|
181
|
+
getSampleCount(): number;
|
|
182
|
+
dispose(): this;
|
|
183
|
+
protected remember(index: number, value: any): void;
|
|
184
|
+
protected scanBounds(xOffsets: number[], yOffsets: number[]): {
|
|
185
|
+
x?: Interval;
|
|
186
|
+
y?: Interval;
|
|
187
|
+
};
|
|
188
|
+
removeItem(index: number, epoch: number): void;
|
|
189
|
+
itemAlive(index: number, epoch: number): boolean;
|
|
190
|
+
}
|
|
191
|
+
declare class PackedFigure {
|
|
192
|
+
readonly series: PackedSeries;
|
|
193
|
+
readonly index: number;
|
|
194
|
+
readonly events: EventHub;
|
|
195
|
+
readonly epoch: number;
|
|
196
|
+
constructor(series: PackedSeries, index: number);
|
|
197
|
+
protected assertAlive(): void;
|
|
198
|
+
setFillStyle(value: ValueOrMutator<FillStyle>): this;
|
|
199
|
+
getFillStyle(): FillStyle;
|
|
200
|
+
setStrokeStyle(value: ValueOrMutator<LineStyle>): this;
|
|
201
|
+
getStrokeStyle(): LineStyle;
|
|
202
|
+
getDominantStyle(): FillStyle;
|
|
203
|
+
setVisible(value: boolean): this;
|
|
204
|
+
getVisible(): boolean;
|
|
205
|
+
mouseInteractions: boolean;
|
|
206
|
+
setMouseInteractions(value: boolean): this;
|
|
207
|
+
getMouseInteractions(): boolean;
|
|
208
|
+
isDisposed(): boolean;
|
|
209
|
+
dispose(): this;
|
|
210
|
+
onDispose(listener: (item: this) => void): EventToken;
|
|
211
|
+
offDispose(token: EventToken): boolean;
|
|
212
|
+
}
|
|
213
|
+
export declare class RectangleFigure extends PackedFigure {
|
|
214
|
+
setDimensions(value: RectangleDimensions): this;
|
|
215
|
+
setBounds(value: RectangleDimensions): this;
|
|
216
|
+
setPosition(value: GeometryPoint): this;
|
|
217
|
+
getDimensionsTwoPoints(): {
|
|
218
|
+
x1: number;
|
|
219
|
+
y1: number;
|
|
220
|
+
x2: number;
|
|
221
|
+
y2: number;
|
|
222
|
+
};
|
|
223
|
+
getDimensionsPositionAndSize(): {
|
|
224
|
+
x: number;
|
|
225
|
+
y: number;
|
|
226
|
+
width: number;
|
|
227
|
+
height: number;
|
|
228
|
+
};
|
|
229
|
+
getBoundaries(): {
|
|
230
|
+
start: GeometryPoint;
|
|
231
|
+
end: GeometryPoint;
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
export declare class RectangleSeries extends PackedSeries {
|
|
235
|
+
protected supportsHighlightRendering(): boolean;
|
|
236
|
+
private readonly solvePlane;
|
|
237
|
+
constructor(chart: RenderHost, options?: GeometryOptions);
|
|
238
|
+
add(value: RectangleDimensions): RectangleFigure;
|
|
239
|
+
add(value: RectangleDimensions[]): this;
|
|
240
|
+
addRectangle(value: RectangleDimensions): RectangleFigure;
|
|
241
|
+
addRectangles(values: RectangleDimensions[]): this;
|
|
242
|
+
solveNearest(from: CoordinateClient, mode?: SolveNearestMode): any;
|
|
243
|
+
getFigures(): RectangleFigure[];
|
|
244
|
+
protected calculateBounds(): {
|
|
245
|
+
x?: Interval;
|
|
246
|
+
y?: Interval;
|
|
247
|
+
};
|
|
248
|
+
protected drawGeometry(ctx: CanvasRenderingContext2D, rect: Rect): void;
|
|
249
|
+
hitTest(point: GeometryPoint, rect: Rect): any;
|
|
250
|
+
}
|
|
251
|
+
export declare class SegmentFigure extends PackedFigure {
|
|
252
|
+
setDimensions(value: SegmentDimensions): this;
|
|
253
|
+
getDimensions(): {
|
|
254
|
+
startX: number;
|
|
255
|
+
startY: number;
|
|
256
|
+
endX: number;
|
|
257
|
+
endY: number;
|
|
258
|
+
};
|
|
259
|
+
getBoundaries(): {
|
|
260
|
+
start: GeometryPoint;
|
|
261
|
+
end: GeometryPoint;
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
export declare class SegmentSeries extends PackedSeries {
|
|
265
|
+
constructor(chart: RenderHost, options?: GeometryOptions);
|
|
266
|
+
add(value: SegmentDimensions): SegmentFigure;
|
|
267
|
+
add(value: SegmentDimensions[]): this;
|
|
268
|
+
addSegment(value: SegmentDimensions): SegmentFigure;
|
|
269
|
+
protected calculateBounds(): {
|
|
270
|
+
x?: Interval;
|
|
271
|
+
y?: Interval;
|
|
272
|
+
};
|
|
273
|
+
protected drawGeometry(ctx: CanvasRenderingContext2D, rect: Rect): void;
|
|
274
|
+
hitTest(point: GeometryPoint, rect: Rect): any;
|
|
275
|
+
}
|
|
276
|
+
export declare class PolygonFigure {
|
|
277
|
+
readonly series: PolygonSeries;
|
|
278
|
+
points: Float64Array;
|
|
279
|
+
fill?: FillStyle;
|
|
280
|
+
stroke?: LineStyle;
|
|
281
|
+
visible: boolean;
|
|
282
|
+
disposed: boolean;
|
|
283
|
+
readonly events: EventHub;
|
|
284
|
+
constructor(series: PolygonSeries, points: GeometryPoint[]);
|
|
285
|
+
setDimensions(points: GeometryPoint[]): this;
|
|
286
|
+
getDimensions(): GeometryPoint[];
|
|
287
|
+
setFillStyle(value: ValueOrMutator<FillStyle>): this;
|
|
288
|
+
getFillStyle(): FillStyle;
|
|
289
|
+
setStrokeStyle(value: ValueOrMutator<LineStyle>): this;
|
|
290
|
+
getStrokeStyle(): LineStyle;
|
|
291
|
+
setVisible(value: boolean): this;
|
|
292
|
+
getVisible(): boolean;
|
|
293
|
+
dispose(): this;
|
|
294
|
+
isDisposed(): boolean;
|
|
295
|
+
onDispose(listener: (figure: this) => void): EventToken;
|
|
296
|
+
}
|
|
297
|
+
export declare class PolygonSeries extends GeometrySeries {
|
|
298
|
+
readonly figures: PolygonFigure[];
|
|
299
|
+
constructor(chart: RenderHost, options?: GeometryOptions);
|
|
300
|
+
add(points: GeometryPoint[] | {
|
|
301
|
+
points: GeometryPoint[];
|
|
302
|
+
fillStyle?: FillStyle;
|
|
303
|
+
strokeStyle?: LineStyle;
|
|
304
|
+
}): PolygonFigure;
|
|
305
|
+
addPolygon(points: GeometryPoint[] | {
|
|
306
|
+
points: GeometryPoint[];
|
|
307
|
+
}): PolygonFigure;
|
|
308
|
+
clear(): this;
|
|
309
|
+
getSampleCount(): number;
|
|
310
|
+
protected calculateBounds(): {
|
|
311
|
+
x?: Interval;
|
|
312
|
+
y?: Interval;
|
|
313
|
+
};
|
|
314
|
+
protected drawGeometry(ctx: CanvasRenderingContext2D, rect: Rect): void;
|
|
315
|
+
hitTest(point: GeometryPoint, rect: Rect): any;
|
|
316
|
+
}
|
|
317
|
+
export declare class RangeSeries extends PackedSeries {
|
|
318
|
+
highStroke: LineStyle;
|
|
319
|
+
lowStroke: LineStyle;
|
|
320
|
+
lowFill: FillStyle;
|
|
321
|
+
constructor(chart: RenderHost, options?: GeometryOptions);
|
|
322
|
+
add(value: RangePoint | RangePoint[]): this;
|
|
323
|
+
addArraysHighLow(high: ArrayLike<number>, low: ArrayLike<number>, step?: number, start?: number): this;
|
|
324
|
+
setHighFillStyle(value: ValueOrMutator<FillStyle>): this;
|
|
325
|
+
getHighFillStyle(): FillStyle;
|
|
326
|
+
setLowFillStyle(value: ValueOrMutator<FillStyle>): this;
|
|
327
|
+
getLowFillStyle(): FillStyle;
|
|
328
|
+
setHighStrokeStyle(value: ValueOrMutator<LineStyle>): this;
|
|
329
|
+
getHighStrokeStyle(): LineStyle;
|
|
330
|
+
setLowStrokeStyle(value: ValueOrMutator<LineStyle>): this;
|
|
331
|
+
getLowStrokeStyle(): LineStyle;
|
|
332
|
+
setStrokeStyle(value: ValueOrMutator<LineStyle>): this;
|
|
333
|
+
protected calculateBounds(): {
|
|
334
|
+
x?: Interval;
|
|
335
|
+
y?: Interval;
|
|
336
|
+
};
|
|
337
|
+
protected drawGeometry(ctx: CanvasRenderingContext2D, rect: Rect): void;
|
|
338
|
+
}
|
|
339
|
+
export declare class OHLCSeries extends PackedSeries {
|
|
340
|
+
figureWidth: number;
|
|
341
|
+
minimumGap: number;
|
|
342
|
+
pack: boolean;
|
|
343
|
+
mode: string;
|
|
344
|
+
positive: FillStyle;
|
|
345
|
+
negative: FillStyle;
|
|
346
|
+
constructor(chart: RenderHost, options?: GeometryOptions);
|
|
347
|
+
add(value: OHLCPoint | OHLCPoint[]): this;
|
|
348
|
+
setFigureWidth(value: number): this;
|
|
349
|
+
getFigureWidth(): number;
|
|
350
|
+
setFigureMinimumGap(value: number): this;
|
|
351
|
+
getFigureMinimumGap(): number;
|
|
352
|
+
setPackData(value: boolean): this;
|
|
353
|
+
getPackData(): boolean;
|
|
354
|
+
setPositiveFillStyle(value: ValueOrMutator<FillStyle>): this;
|
|
355
|
+
setNegativeFillStyle(value: ValueOrMutator<FillStyle>): this;
|
|
356
|
+
protected calculateBounds(): {
|
|
357
|
+
x?: Interval;
|
|
358
|
+
y?: Interval;
|
|
359
|
+
};
|
|
360
|
+
protected drawGeometry(ctx: CanvasRenderingContext2D, rect: Rect): void;
|
|
361
|
+
}
|
|
362
|
+
export declare class BoxFigure extends PackedFigure {
|
|
363
|
+
setDimensions(value: BoxDimensions): this;
|
|
364
|
+
getDimensions(): BoxDimensions;
|
|
365
|
+
}
|
|
366
|
+
export declare class BoxSeries extends PackedSeries {
|
|
367
|
+
horizontal: boolean;
|
|
368
|
+
constructor(chart: RenderHost, options?: GeometryOptions);
|
|
369
|
+
setHorizontal(value: boolean): this;
|
|
370
|
+
add(value: BoxDimensions): BoxFigure;
|
|
371
|
+
add(value: BoxDimensions[]): this;
|
|
372
|
+
protected calculateBounds(): {
|
|
373
|
+
x?: Interval;
|
|
374
|
+
y?: Interval;
|
|
375
|
+
};
|
|
376
|
+
protected drawGeometry(ctx: CanvasRenderingContext2D, rect: Rect): void;
|
|
377
|
+
}
|
|
378
|
+
export { RangeSeries as AreaRangeSeries };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Color, type FillStyle } from "./core/styles.js";
|
|
2
|
+
import type { Rect } from "./contracts.js";
|
|
3
|
+
export interface ColorStop {
|
|
4
|
+
color: Color;
|
|
5
|
+
offset: number;
|
|
6
|
+
}
|
|
7
|
+
export interface LinearGradientFillStyleProperties {
|
|
8
|
+
type: "fillstyle";
|
|
9
|
+
fillType: "linear-gradient";
|
|
10
|
+
stops: ColorStop[];
|
|
11
|
+
angle: number;
|
|
12
|
+
}
|
|
13
|
+
/** Immutable gradient. Zero degrees points up; positive angles turn clockwise. */
|
|
14
|
+
export declare class LinearGradientFill implements FillStyle {
|
|
15
|
+
readonly kind = "linear-gradient";
|
|
16
|
+
readonly type = "fillstyle";
|
|
17
|
+
readonly fillType = "linear-gradient";
|
|
18
|
+
private readonly stops;
|
|
19
|
+
private readonly angle;
|
|
20
|
+
constructor(options?: Partial<LinearGradientFillStyleProperties>);
|
|
21
|
+
setColorStops(stops: ColorStop[]): this;
|
|
22
|
+
getColorStops(): ColorStop[];
|
|
23
|
+
setAngle(angle: number, isRadians?: boolean): this;
|
|
24
|
+
getAngle(isRadians?: boolean): number;
|
|
25
|
+
/** Representative color for legends and non-gradient swatches. */
|
|
26
|
+
getColor(): Color;
|
|
27
|
+
sample(offset: number): Color;
|
|
28
|
+
hasVisibleStops(): boolean;
|
|
29
|
+
}
|
|
30
|
+
/** Support lines of the box projected onto the gradient direction. */
|
|
31
|
+
export declare function gradientEndpoints(bounds: Rect, angle: number): {
|
|
32
|
+
x0: number;
|
|
33
|
+
y0: number;
|
|
34
|
+
x1: number;
|
|
35
|
+
y1: number;
|
|
36
|
+
};
|
|
37
|
+
export declare function canvasGradient(context: CanvasRenderingContext2D, fill: LinearGradientFill, bounds: Rect): CanvasGradient;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Original tick arithmetic. Sizes are CSS pixels, independent of framebuffer DPR. */
|
|
2
|
+
export interface TickPositions {
|
|
3
|
+
major: number[];
|
|
4
|
+
minor: number[];
|
|
5
|
+
step: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function niceNumericStep(span: number, targetIntervals: number): number;
|
|
8
|
+
export declare function steppedTickPositions(low: number, high: number, step: number, limit?: number): number[];
|
|
9
|
+
export declare function numericTickPositions(start: number, end: number, axisSizePixels: number, intervalCount?: number): TickPositions;
|
|
10
|
+
export declare function logarithmicTickPositions(start: number, end: number): TickPositions;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Interval } from './contracts.js';
|
|
2
|
+
export type HeatmapCleaning = {
|
|
3
|
+
minDataPointCount: number | undefined;
|
|
4
|
+
} | {
|
|
5
|
+
maxDataPointCount: number | undefined;
|
|
6
|
+
} | undefined;
|
|
7
|
+
export interface HeatmapStreamUpdate {
|
|
8
|
+
changed: boolean;
|
|
9
|
+
full: boolean;
|
|
10
|
+
firstPhysical: number;
|
|
11
|
+
physicalCount: number;
|
|
12
|
+
}
|
|
13
|
+
/** A scrolling grid stores columns/rows by absolute sample index. Missing future
|
|
14
|
+
* samples repeat the previous vector; callers can insert NaN to create gaps.
|
|
15
|
+
* Retention and allocation are independent: a minimum is never a hard limit.
|
|
16
|
+
*/
|
|
17
|
+
export declare class HeatmapStream {
|
|
18
|
+
readonly resolution: number;
|
|
19
|
+
readonly dimension: 'columns' | 'rows';
|
|
20
|
+
data: Float32Array;
|
|
21
|
+
capacity: number;
|
|
22
|
+
first: number;
|
|
23
|
+
next: number;
|
|
24
|
+
private hardLimit;
|
|
25
|
+
private minimum;
|
|
26
|
+
private cleaning;
|
|
27
|
+
constructor(resolution: number, dimension: 'columns' | 'rows', fixedCapacity?: number);
|
|
28
|
+
get columns(): number;
|
|
29
|
+
get rows(): number;
|
|
30
|
+
get offset(): number;
|
|
31
|
+
private address;
|
|
32
|
+
getValue(absolute: number, cell: number): number | undefined;
|
|
33
|
+
getCleaning(): HeatmapCleaning;
|
|
34
|
+
configure(value: HeatmapCleaning, interval: Interval, start: number, step: number): HeatmapStreamUpdate;
|
|
35
|
+
write(index: number, vectors: readonly ArrayLike<number>[], interval: Interval, start: number, step: number): HeatmapStreamUpdate;
|
|
36
|
+
clear(): void;
|
|
37
|
+
dispose(): void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { SpecialtyChart, type SpecialtyOptions } from './specialty.js';
|
|
2
|
+
import { Color, FontSettings, LUT, type FillStyle, type LineStyle, type ValueOrMutator } from './core/styles.js';
|
|
3
|
+
import { type UIPoint } from './ui.js';
|
|
4
|
+
import type { Rect } from './contracts.js';
|
|
5
|
+
export interface HierarchyNode {
|
|
6
|
+
name: string;
|
|
7
|
+
value?: number;
|
|
8
|
+
children?: HierarchyNode[];
|
|
9
|
+
color?: string | Color;
|
|
10
|
+
id?: string | number;
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
}
|
|
13
|
+
export interface SunburstArc {
|
|
14
|
+
node: HierarchyNode;
|
|
15
|
+
path: HierarchyNode[];
|
|
16
|
+
depth: number;
|
|
17
|
+
branch: number;
|
|
18
|
+
start: number;
|
|
19
|
+
end: number;
|
|
20
|
+
value: number;
|
|
21
|
+
}
|
|
22
|
+
export declare enum FunnelSliceModes {
|
|
23
|
+
VariableHeight = 0,
|
|
24
|
+
VariableWidth = 1
|
|
25
|
+
}
|
|
26
|
+
export declare enum PyramidSliceModes {
|
|
27
|
+
VariableHeight = 0,
|
|
28
|
+
VariableWidth = 1
|
|
29
|
+
}
|
|
30
|
+
export interface StageGeometry {
|
|
31
|
+
index: number;
|
|
32
|
+
points: UIPoint[];
|
|
33
|
+
value: number;
|
|
34
|
+
fraction: number;
|
|
35
|
+
center: UIPoint;
|
|
36
|
+
}
|
|
37
|
+
export declare function hierarchyWeight(node: HierarchyNode, cache?: Map<HierarchyNode, number>): number;
|
|
38
|
+
/** Allocate each child's angle from its share of its parent's value. */
|
|
39
|
+
export declare function layoutSunburst(nodes: readonly HierarchyNode[], options?: {
|
|
40
|
+
startAngle?: number;
|
|
41
|
+
endAngle?: number;
|
|
42
|
+
maxDepth?: number;
|
|
43
|
+
}): SunburstArc[];
|
|
44
|
+
export declare class SunBurstChart extends SpecialtyChart {
|
|
45
|
+
private data;
|
|
46
|
+
private route;
|
|
47
|
+
private maxDepth;
|
|
48
|
+
private innerRadius;
|
|
49
|
+
private startAngle;
|
|
50
|
+
private radiusFactor;
|
|
51
|
+
private radialLabels;
|
|
52
|
+
private centerLabels;
|
|
53
|
+
private holeFill?;
|
|
54
|
+
private labelEffect;
|
|
55
|
+
labelFont: FontSettings;
|
|
56
|
+
labelFill: FillStyle;
|
|
57
|
+
labelFormatter: (node: HierarchyNode, value: number) => string;
|
|
58
|
+
valueFormatter: (value: number) => string;
|
|
59
|
+
constructor(options?: SpecialtyOptions);
|
|
60
|
+
setData(data: HierarchyNode | HierarchyNode[]): this;
|
|
61
|
+
getData(): HierarchyNode[];
|
|
62
|
+
getFocus(): HierarchyNode | undefined;
|
|
63
|
+
getPath(): string[];
|
|
64
|
+
drillDown(target: HierarchyNode | string | number): this;
|
|
65
|
+
drillUp(): this;
|
|
66
|
+
resetView(): this;
|
|
67
|
+
setMaxDepth(value: number): this;
|
|
68
|
+
setInnerRadius(value: number): this;
|
|
69
|
+
setStartAngle(degrees: number): this;
|
|
70
|
+
setRadiusFactor(value: number): this;
|
|
71
|
+
setLabelOrientation(value: 'radial' | 'tangential'): this;
|
|
72
|
+
setCenterLabelVisible(value: boolean): this;
|
|
73
|
+
setHoleFillStyle(value: FillStyle): this;
|
|
74
|
+
setLabelEffect(value: boolean): this;
|
|
75
|
+
setLabelFont(value: ValueOrMutator<FontSettings>): this;
|
|
76
|
+
setLabelFillStyle(value: ValueOrMutator<FillStyle>): this;
|
|
77
|
+
setLabelFormatter(value: (node: HierarchyNode, weight: number) => string): this;
|
|
78
|
+
setValueFormatter(value: (value: number) => string): this;
|
|
79
|
+
protected key(key: string): boolean;
|
|
80
|
+
protected renderPlot(ctx: CanvasRenderingContext2D, rect: Rect): void;
|
|
81
|
+
}
|
|
82
|
+
/** Both modes place width boundaries by cumulative value; width mode keeps stage heights equal. */
|
|
83
|
+
export declare function layoutStages(values: readonly number[], rect: Rect, options: {
|
|
84
|
+
kind: 'funnel' | 'pyramid';
|
|
85
|
+
mode?: number;
|
|
86
|
+
headWidth?: number;
|
|
87
|
+
neckWidth?: number;
|
|
88
|
+
}): StageGeometry[];
|
|
89
|
+
export declare class StageSlice {
|
|
90
|
+
readonly chart: SlicedHierarchyChart;
|
|
91
|
+
readonly node: HierarchyNode;
|
|
92
|
+
visible: boolean;
|
|
93
|
+
disposed: boolean;
|
|
94
|
+
fillStyle?: FillStyle;
|
|
95
|
+
strokeStyle?: LineStyle;
|
|
96
|
+
private readonly generation;
|
|
97
|
+
constructor(chart: SlicedHierarchyChart, node: HierarchyNode);
|
|
98
|
+
private assertAlive;
|
|
99
|
+
getName(): string;
|
|
100
|
+
setName(name: string): this;
|
|
101
|
+
getValue(): number;
|
|
102
|
+
setValue(value: number): this;
|
|
103
|
+
getFillStyle(): FillStyle | undefined;
|
|
104
|
+
setFillStyle(value: ValueOrMutator<FillStyle>): this;
|
|
105
|
+
getStrokeStyle(): LineStyle | undefined;
|
|
106
|
+
setStrokeStyle(value: ValueOrMutator<LineStyle>): this;
|
|
107
|
+
getVisible(): boolean;
|
|
108
|
+
setVisible(value: boolean): this;
|
|
109
|
+
dispose(): this;
|
|
110
|
+
isDisposed(): boolean;
|
|
111
|
+
}
|
|
112
|
+
export declare abstract class SlicedHierarchyChart extends SpecialtyChart {
|
|
113
|
+
dataGeneration: number;
|
|
114
|
+
private roots;
|
|
115
|
+
private route;
|
|
116
|
+
private handles;
|
|
117
|
+
protected abstract readonly shape: 'funnel' | 'pyramid';
|
|
118
|
+
protected headWidth: number;
|
|
119
|
+
protected neckWidth: number;
|
|
120
|
+
protected sliceMode: number;
|
|
121
|
+
protected gap: number;
|
|
122
|
+
private palette?;
|
|
123
|
+
private style?;
|
|
124
|
+
private sorter?;
|
|
125
|
+
private stroke;
|
|
126
|
+
private labelFill;
|
|
127
|
+
private labelFont;
|
|
128
|
+
private labelFormatter;
|
|
129
|
+
private highlightOnHover;
|
|
130
|
+
private sliceEffect;
|
|
131
|
+
private labelEffect;
|
|
132
|
+
private labelPosition;
|
|
133
|
+
private spacing;
|
|
134
|
+
private gradient;
|
|
135
|
+
private handle;
|
|
136
|
+
setData(data: HierarchyNode | HierarchyNode[]): this;
|
|
137
|
+
getData(): HierarchyNode[];
|
|
138
|
+
addSlice(name: string, value: number): StageSlice;
|
|
139
|
+
addSlices(data: Array<{
|
|
140
|
+
name: string;
|
|
141
|
+
value: number;
|
|
142
|
+
}>): StageSlice[];
|
|
143
|
+
addData(data: HierarchyNode[]): this;
|
|
144
|
+
getSlices(): StageSlice[];
|
|
145
|
+
getSeries(): StageSlice[];
|
|
146
|
+
getFocus(): HierarchyNode | undefined;
|
|
147
|
+
getPath(): string[];
|
|
148
|
+
drillDown(target: HierarchyNode | StageSlice | string | number): this;
|
|
149
|
+
drillUp(): this;
|
|
150
|
+
resetView(): this;
|
|
151
|
+
setNeckWidth(value: number): this;
|
|
152
|
+
getNeckWidth(): number;
|
|
153
|
+
setSliceGap(value: number): this;
|
|
154
|
+
setSliceMode(value: number | 'VariableHeight' | 'VariableWidth'): this;
|
|
155
|
+
setLUT(value: LUT): this;
|
|
156
|
+
setSliceFillStyle(value: (index: number, slice: StageSlice) => FillStyle): this;
|
|
157
|
+
getSliceFillStyle(): ((index: number, slice: StageSlice) => FillStyle) | undefined;
|
|
158
|
+
setSliceStrokeStyle(value: ValueOrMutator<LineStyle>): this;
|
|
159
|
+
getSliceStrokeStyle(): LineStyle;
|
|
160
|
+
setSliceSorter(value: (a: StageSlice, b: StageSlice) => number): this;
|
|
161
|
+
getSliceSorter(): ((a: StageSlice, b: StageSlice) => number) | undefined;
|
|
162
|
+
setLabelFillStyle(value: ValueOrMutator<FillStyle>): this;
|
|
163
|
+
getLabelFillStyle(): FillStyle;
|
|
164
|
+
setLabelFont(value: ValueOrMutator<FontSettings>): this;
|
|
165
|
+
getLabelFont(): FontSettings;
|
|
166
|
+
setLabelFormatter(value: (slice: StageSlice, relativeValue: number) => string): this;
|
|
167
|
+
setLabelPosition(value: 'left' | 'right' | 'inside'): this;
|
|
168
|
+
setSliceSpacing(value: number): this;
|
|
169
|
+
setSliceGradient(value: boolean): this;
|
|
170
|
+
getLabelFormatter(): (slice: StageSlice, relativeValue: number) => string;
|
|
171
|
+
setSliceHighlightOnHover(value: boolean): this;
|
|
172
|
+
setSliceEffect(value: boolean): this;
|
|
173
|
+
getSliceEffect(): boolean;
|
|
174
|
+
setLabelEffect(value: boolean): this;
|
|
175
|
+
getLabelEffect(): boolean;
|
|
176
|
+
protected key(key: string): boolean;
|
|
177
|
+
protected renderPlot(ctx: CanvasRenderingContext2D, rect: Rect): void;
|
|
178
|
+
}
|
|
179
|
+
export declare class Funnel extends SlicedHierarchyChart {
|
|
180
|
+
protected readonly shape: "funnel";
|
|
181
|
+
constructor(options?: SpecialtyOptions);
|
|
182
|
+
setHeadWidth(value: number): this;
|
|
183
|
+
getHeadWidth(): number;
|
|
184
|
+
getFunnelSliceMode(): number;
|
|
185
|
+
}
|
|
186
|
+
export declare class Pyramid extends SlicedHierarchyChart {
|
|
187
|
+
protected readonly shape: "pyramid";
|
|
188
|
+
constructor(options?: SpecialtyOptions);
|
|
189
|
+
getPyramidSliceMode(): number;
|
|
190
|
+
}
|
|
191
|
+
export { Funnel as FunnelChart, Pyramid as PyramidChart };
|