@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,350 @@
1
+ export type ImmutableMutator<T, R = T> = (previous: T) => R;
2
+ export type ValueOrMutator<T> = T | ImmutableMutator<T>;
3
+ export declare const resolveValue: <T>(value: ValueOrMutator<T>, previous: T) => T;
4
+ /** Unlit material colors, independent of lighting and camera orientation. */
5
+ export declare class SimpleShadingStyle {
6
+ readonly type: "simple";
7
+ constructor();
8
+ }
9
+ /** Only the implemented Simple mode is exposed; Phong parameters are not emulated. */
10
+ export type ColorShadingStyle = SimpleShadingStyle;
11
+ export declare const ColorShadingStyles: Readonly<{
12
+ Simple: typeof SimpleShadingStyle;
13
+ }>;
14
+ export declare function assertColorShadingStyle(value: unknown): asserts value is ColorShadingStyle;
15
+ /** Channels are normalized here; public RGBA factories and channel setters use bytes. */
16
+ export declare class Color {
17
+ readonly r: number;
18
+ readonly g: number;
19
+ readonly b: number;
20
+ readonly a: number;
21
+ constructor(r?: number | Partial<{
22
+ r: number;
23
+ g: number;
24
+ b: number;
25
+ a: number;
26
+ }>, g?: number, b?: number, a?: number);
27
+ getR(): number;
28
+ getG(): number;
29
+ getB(): number;
30
+ getA(): number;
31
+ setR(value: number): Color;
32
+ setG(value: number): Color;
33
+ setB(value: number): Color;
34
+ setA(value: number): Color;
35
+ toCSS(): string;
36
+ toRGBAString(): string;
37
+ toString(): string;
38
+ toUint32(): number;
39
+ getLighter(): Color;
40
+ getDarker(): Color;
41
+ getHighlight(): Color;
42
+ }
43
+ export declare function ColorRGBA(r: number, g: number, b: number, a?: number): Color;
44
+ export declare function ColorRGB(r: number, g: number, b: number): Color;
45
+ export declare function ColorHEX(value: string): Color;
46
+ export declare function ColorHSV(h: number, s?: number, v?: number): Color;
47
+ export interface FillStyle {
48
+ readonly kind: string;
49
+ getColor?(): Color;
50
+ }
51
+ export declare class SolidFill implements FillStyle {
52
+ readonly kind = "solid";
53
+ readonly color: Color;
54
+ constructor(options?: {
55
+ color?: Color;
56
+ });
57
+ getColor(): Color;
58
+ setColor(value: ValueOrMutator<Color>): SolidFill;
59
+ setR(value: number): SolidFill;
60
+ setG(value: number): SolidFill;
61
+ setB(value: number): SolidFill;
62
+ setA(value: number): SolidFill;
63
+ }
64
+ export declare class EmptyFill implements FillStyle {
65
+ readonly kind = "empty";
66
+ }
67
+ export declare const emptyFill: Readonly<EmptyFill>;
68
+ export declare const transparentFill: SolidFill;
69
+ export interface LineStyle {
70
+ readonly kind: string;
71
+ getFillStyle(): FillStyle;
72
+ getThickness(): number;
73
+ }
74
+ export interface LineOptions {
75
+ fillStyle?: FillStyle;
76
+ thickness?: number;
77
+ }
78
+ export declare class SolidLine implements LineStyle {
79
+ readonly kind: string;
80
+ readonly fillStyle: FillStyle;
81
+ readonly thickness: number;
82
+ constructor(options?: LineOptions);
83
+ protected copy(options: LineOptions): this;
84
+ getFillStyle(): FillStyle;
85
+ setFillStyle(value: ValueOrMutator<FillStyle>): this;
86
+ getThickness(): number;
87
+ setThickness(value: ValueOrMutator<number>): this;
88
+ }
89
+ export declare const StipplePatterns: Readonly<{
90
+ Dotted: number[];
91
+ DottedDense: number[];
92
+ Dashed: number[];
93
+ DashedEqual: number[];
94
+ DashedLoose: number[];
95
+ DashDotted: number[];
96
+ }>;
97
+ export declare class DashedLine extends SolidLine {
98
+ readonly kind = "dashed";
99
+ readonly pattern: readonly number[];
100
+ readonly patternScale: number;
101
+ constructor(options?: LineOptions & {
102
+ pattern?: readonly number[];
103
+ patternScale?: number;
104
+ });
105
+ protected copy(options: LineOptions): this;
106
+ getPattern(): number[];
107
+ setPattern(pattern: readonly number[]): DashedLine;
108
+ getPatternScale(): number;
109
+ setPatternScale(patternScale: number): DashedLine;
110
+ }
111
+ export declare const emptyLine: SolidLine;
112
+ export declare function isSolidFill(style: unknown): style is SolidFill;
113
+ export declare function isSolidLine(style: unknown): style is SolidLine;
114
+ export interface FontProperties {
115
+ size: number;
116
+ family: string;
117
+ weight: string | number;
118
+ style: string;
119
+ variant: string;
120
+ }
121
+ export declare class FontSettings implements FontProperties {
122
+ readonly size: number;
123
+ readonly family: string;
124
+ readonly weight: string | number;
125
+ readonly style: string;
126
+ readonly variant: string;
127
+ constructor(options?: Partial<FontProperties>);
128
+ setSize(size: ValueOrMutator<number>): FontSettings;
129
+ getSize(): number;
130
+ setFamily(family: ValueOrMutator<string>): FontSettings;
131
+ getFamily(): string;
132
+ setWeight(weight: ValueOrMutator<string | number>): FontSettings;
133
+ getWeight(): string | number;
134
+ setStyle(style: ValueOrMutator<string>): FontSettings;
135
+ getStyle(): string;
136
+ setVariant(variant: ValueOrMutator<string>): FontSettings;
137
+ getVariant(): string;
138
+ toCSS(): string;
139
+ }
140
+ export interface LUTStep {
141
+ value: number;
142
+ color: Color;
143
+ label?: string;
144
+ }
145
+ export interface LUTOptions {
146
+ steps?: readonly LUTStep[];
147
+ interpolate?: boolean;
148
+ fallbackColor?: Color;
149
+ percentageValues?: boolean;
150
+ title?: string;
151
+ units?: string;
152
+ }
153
+ export declare class LUT {
154
+ private readonly options;
155
+ constructor(options?: LUTOptions);
156
+ private copy;
157
+ setSteps(steps: readonly LUTStep[]): this;
158
+ getSteps(): LUTStep[];
159
+ setTitle(title: string): this;
160
+ getTitle(): string;
161
+ setUnits(units: string): this;
162
+ getUnits(): string;
163
+ setInterpolation(interpolate: boolean): this;
164
+ getInterpolation(): boolean;
165
+ setFallbackColor(fallbackColor: Color): this;
166
+ getFallbackColor(): Color;
167
+ setPercentageValues(percentageValues: boolean): this;
168
+ getPercentageValues(): boolean;
169
+ getColor(value: number): Color;
170
+ getColors(values: number): Color;
171
+ getColors(values: number[]): Color[];
172
+ getColors(values: number[][]): Color[][];
173
+ }
174
+ export declare class PalettedFill<T extends string = string> implements FillStyle {
175
+ readonly kind = "palette";
176
+ readonly lut: LUT;
177
+ readonly lookUpProperty: T;
178
+ constructor(options?: {
179
+ lut?: LUT;
180
+ lookUpProperty?: T;
181
+ });
182
+ getPalette(): LUT;
183
+ getLUT(): LUT;
184
+ setLUT(lut: LUT): PalettedFill<T>;
185
+ getLookUpProperty(): T;
186
+ setLookUpProperty<P extends string>(value: P | ((previous: T) => P)): PalettedFill<P>;
187
+ }
188
+ export declare function regularColorSteps(min: number, max: number, colors: readonly Color[], options?: {
189
+ formatLabels?: (value: number) => string;
190
+ alpha?: number;
191
+ }): LUTStep[];
192
+ export declare const AxisTickStrategies: Readonly<{
193
+ Empty: "Empty";
194
+ Numeric: "Numeric";
195
+ DateTime: "DateTime";
196
+ Time: "Time";
197
+ }>;
198
+ export interface ScrollStrategy {
199
+ kind: string;
200
+ [key: string]: unknown;
201
+ }
202
+ export interface ScrollStrategyFactory {
203
+ (options?: Record<string, unknown>): ScrollStrategy;
204
+ readonly kind: string;
205
+ }
206
+ export declare const AxisScrollStrategies: Readonly<{
207
+ fitting: ScrollStrategyFactory;
208
+ expansion: ScrollStrategyFactory;
209
+ progressive: ScrollStrategyFactory;
210
+ regressive: ScrollStrategyFactory;
211
+ scrolling: ScrollStrategyFactory;
212
+ }>;
213
+ export declare const PointShape: Readonly<{
214
+ Square: 0;
215
+ Circle: 1;
216
+ Triangle: 2;
217
+ Cross: 3;
218
+ Diamond: 4;
219
+ Plus: 5;
220
+ Minus: 6;
221
+ Arrow: 7;
222
+ Star: 8;
223
+ }>;
224
+ export declare class TriangulatedPoints3D {
225
+ readonly fillStyle: FillStyle;
226
+ readonly size: number;
227
+ readonly shape: string;
228
+ constructor(options?: {
229
+ fillStyle?: FillStyle;
230
+ size?: number;
231
+ shape?: string;
232
+ });
233
+ setFillStyle(value: ValueOrMutator<FillStyle>): TriangulatedPoints3D;
234
+ getFillStyle(): FillStyle;
235
+ setSize(value: ValueOrMutator<number>): TriangulatedPoints3D;
236
+ getSize(): number;
237
+ setShape(shape: string): TriangulatedPoints3D;
238
+ getShape(): string;
239
+ }
240
+ export declare class PixelatedPoints3D extends TriangulatedPoints3D {
241
+ }
242
+ export declare const PointStyle3D: Readonly<{
243
+ Triangulated: typeof TriangulatedPoints3D;
244
+ Pixelated: typeof PixelatedPoints3D;
245
+ }>;
246
+ export declare class UIBuilder {
247
+ readonly kind: string;
248
+ readonly type: string;
249
+ readonly options: Readonly<Record<string, unknown>>;
250
+ constructor(kind: string, options?: Record<string, unknown>);
251
+ setFont(font: ValueOrMutator<FontSettings>): UIBuilder;
252
+ setTextFillStyle(style: FillStyle): UIBuilder;
253
+ setBackground(style: FillStyle): UIBuilder;
254
+ }
255
+ export declare const UIElementBuilders: Readonly<{
256
+ TextBox: UIBuilder;
257
+ CheckBox: UIBuilder;
258
+ ButtonBox: UIBuilder;
259
+ PointableTextBox: UIBuilder;
260
+ AxisTickMajor: UIBuilder;
261
+ AxisTickMinor: UIBuilder;
262
+ LUTRange: UIBuilder;
263
+ }>;
264
+ export declare const UILayoutBuilders: Readonly<{
265
+ Column: UIBuilder;
266
+ Row: UIBuilder;
267
+ }>;
268
+ export declare const UIOrigins: Readonly<{
269
+ LeftBottom: {
270
+ x: number;
271
+ y: number;
272
+ };
273
+ CenterBottom: {
274
+ x: number;
275
+ y: number;
276
+ };
277
+ RightBottom: {
278
+ x: number;
279
+ y: number;
280
+ };
281
+ LeftCenter: {
282
+ x: number;
283
+ y: number;
284
+ };
285
+ Center: {
286
+ x: number;
287
+ y: number;
288
+ };
289
+ RightCenter: {
290
+ x: number;
291
+ y: number;
292
+ };
293
+ LeftTop: {
294
+ x: number;
295
+ y: number;
296
+ };
297
+ CenterTop: {
298
+ x: number;
299
+ y: number;
300
+ };
301
+ RightTop: {
302
+ x: number;
303
+ y: number;
304
+ };
305
+ }>;
306
+ export type Palette<T> = (index: number) => T;
307
+ export type ThemePropertyWithCallbackOption<T> = T | Palette<T>;
308
+ export interface Theme {
309
+ name: string;
310
+ backgroundFillStyle: FillStyle;
311
+ panelBackgroundFillStyle: FillStyle;
312
+ chartTitleFillStyle: FillStyle;
313
+ axisTitleFillStyle: FillStyle;
314
+ axisStrokeStyle: SolidLine;
315
+ dataColors: readonly Color[];
316
+ chartXYBackgroundFillStyle?: FillStyle;
317
+ chartXYTitleFillStyle?: FillStyle;
318
+ chartXYTitleFont?: FontSettings;
319
+ xAxisTitleFillStyle?: FillStyle;
320
+ yAxisTitleFillStyle?: FillStyle;
321
+ zAxisTitleFillStyle?: FillStyle;
322
+ xAxisTitleFont?: FontSettings;
323
+ yAxisTitleFont?: FontSettings;
324
+ zAxisTitleFont?: FontSettings;
325
+ lineSeries3DStrokeStyle?: ThemePropertyWithCallbackOption<LineStyle>;
326
+ pointSeries3DPointStyle?: ThemePropertyWithCallbackOption<TriangulatedPoints3D>;
327
+ pointSeriesFillStyle?: ThemePropertyWithCallbackOption<FillStyle>;
328
+ pointSeriesStrokeStyle?: ThemePropertyWithCallbackOption<LineStyle>;
329
+ heatmapGridSeriesFillStyle?: ThemePropertyWithCallbackOption<FillStyle>;
330
+ heatmapGridSeriesWireframeStyle?: ThemePropertyWithCallbackOption<LineStyle>;
331
+ heatmapScrollingGridSeriesWireframeStyle?: ThemePropertyWithCallbackOption<LineStyle>;
332
+ heatmapScrollingGridSeriesFillStyle?: ThemePropertyWithCallbackOption<FillStyle>;
333
+ polarHeatmapSeriesFillStyle?: ThemePropertyWithCallbackOption<FillStyle>;
334
+ [key: string]: any;
335
+ }
336
+ export declare const Themes: Readonly<{
337
+ darkGold: Theme;
338
+ dark: Theme;
339
+ light: Theme;
340
+ lightNature: Theme;
341
+ turquoiseHexagon: Theme;
342
+ cyberSpace: Theme;
343
+ }>;
344
+ export declare function disableThemeEffects<T extends Record<string, any>>(theme: T): T;
345
+ export declare function disableTextShadows<T extends Record<string, any>>(theme: T): T;
346
+ export declare const htmlTextRenderer: Readonly<{
347
+ kind: "html";
348
+ type: "html-text-renderer";
349
+ createElement(text: string, documentRef?: Document): HTMLElement;
350
+ }>;
@@ -0,0 +1,13 @@
1
+ import { FontSettings } from './core/styles.js';
2
+ /** Resolve HTML text CSS once per semantic font. Canvas rendering and capture
3
+ * use the same resolved font; public FontSettings remain unchanged. */
4
+ export declare class CssTextFonts {
5
+ private readonly probe;
6
+ private readonly fonts;
7
+ private readonly observer?;
8
+ private readonly removeFontListener?;
9
+ private disposed;
10
+ constructor(root: HTMLElement, changed: () => void);
11
+ resolve(font: FontSettings): FontSettings;
12
+ dispose(): void;
13
+ }
@@ -0,0 +1,47 @@
1
+ import type { Axis } from './axis.js';
2
+ export type SolveNearestMode = 'show-nearest' | 'show-all' | 'show-pointed';
3
+ export interface CoordinateClient {
4
+ clientX: number;
5
+ clientY: number;
6
+ }
7
+ export interface CursorHitPositionXY {
8
+ pointMarker: {
9
+ x: number;
10
+ y: number;
11
+ color?: unknown;
12
+ };
13
+ pointMarkerScale: any;
14
+ resultTable: {
15
+ x: number;
16
+ y: number;
17
+ };
18
+ resultTableScale: any;
19
+ }
20
+ export interface SolveResultXY {
21
+ readonly axisX: Axis;
22
+ readonly axisY: Axis;
23
+ readonly series: any;
24
+ readonly x: number;
25
+ readonly y: number;
26
+ readonly cursorPosition: CursorHitPositionXY;
27
+ /** @internal Screen-space ordering, not a source data value. */
28
+ readonly distanceSquared: number;
29
+ }
30
+ export interface SolveResultHeatmap extends SolveResultXY {
31
+ readonly column: number;
32
+ readonly row: number;
33
+ readonly intensity: number;
34
+ readonly lut: any;
35
+ }
36
+ export interface CursorTargetChangedEvent<T = SolveResultXY> {
37
+ hit: T | undefined;
38
+ hits: T[] | undefined;
39
+ mouseLocation: CoordinateClient;
40
+ }
41
+ export type SeriesCursorFormatter = (hit: any, before: any[][]) => any[][] | undefined;
42
+ export declare function validateSolveMode(mode: string): asserts mode is SolveNearestMode;
43
+ export declare function xyCursorHit(series: any, point: {
44
+ x: number;
45
+ y: number;
46
+ }, from: CoordinateClient, extras?: Record<string, any>): SolveResultXY;
47
+ export declare function defaultXYCursorRows(_chart: any, hit: SolveResultXY, hits: SolveResultXY[]): any[][];
@@ -0,0 +1,46 @@
1
+ /** Browser-owned image sources accepted by the public custom-icon API. */
2
+ export type ImageFillSource = TexImageSource | undefined;
3
+ export interface IconProperties {
4
+ type: 'icon';
5
+ width: number | undefined;
6
+ height: number | undefined;
7
+ }
8
+ /** Immutable size styles share the caller's image; disposal never closes that image. */
9
+ export declare class Icon implements IconProperties {
10
+ private readonly owner?;
11
+ readonly type: "icon";
12
+ readonly width: number | undefined;
13
+ readonly height: number | undefined;
14
+ private readonly state;
15
+ /** @internal Icons are normally created by chart.engine.addCustomIcon. */
16
+ constructor(source: ImageFillSource, opts?: Partial<IconProperties>, owner?: IconRegistry | undefined);
17
+ getWidth(): number | undefined;
18
+ getHeight(): number | undefined;
19
+ setWidth(width: number | undefined): Icon;
20
+ setHeight(height: number | undefined): Icon;
21
+ setSize(width: number, height: number): Icon;
22
+ private derive;
23
+ /** @internal Resolved CSS pixel dimensions; public getters retain their original option values. */
24
+ getRasterSize(): {
25
+ width: number;
26
+ height: number;
27
+ };
28
+ /** @internal Borrowed image; undefined means blank or disposed. */
29
+ getSource(): ImageFillSource;
30
+ /** @internal Canvas drawImage does not directly accept ImageData. */
31
+ getCanvasSource(): CanvasImageSource | undefined;
32
+ /** @internal Release notifications let each renderer delete its own texture promptly. */
33
+ onDispose(listener: () => void): () => void;
34
+ isDisposed(): boolean;
35
+ dispose(): this;
36
+ }
37
+ /** @internal One registry belongs to one chart engine, including all derived styles. */
38
+ export declare class IconRegistry {
39
+ private readonly changed;
40
+ private readonly icons;
41
+ private disposed;
42
+ constructor(changed?: () => void);
43
+ add(source: ImageFillSource, opts?: Partial<IconProperties>): Icon;
44
+ release(icon: Icon): void;
45
+ dispose(): void;
46
+ }
@@ -0,0 +1,28 @@
1
+ import { DataSetXY } from './core/data.js';
2
+ import type { Interval } from './contracts.js';
3
+ export declare const DATA_BOUNDS_BLOCK_SIZE = 1024;
4
+ export interface ColumnBoundsStats {
5
+ readonly scannedSamples: number;
6
+ readonly lastScannedSamples: number;
7
+ readonly fullBlockBuilds: number;
8
+ readonly lastFullBlockBuilds: number;
9
+ readonly affineRunVisits: number;
10
+ readonly lastAffineRunVisits: number;
11
+ readonly affineEndpointReads: number;
12
+ readonly lastAffineEndpointReads: number;
13
+ readonly cacheHits: number;
14
+ readonly rebuilds: number;
15
+ readonly updates: number;
16
+ readonly fullBlocksInWindow: number;
17
+ readonly cachedExtremaEntries: number;
18
+ readonly retainedExtremaEntries: number;
19
+ }
20
+ /** Exact finite bounds of retained samples. Dense columns scan each completed block
21
+ * once; a rolling update scans only new samples and its truncated first block.
22
+ * Automatic coordinates use original per-batch endpoint expressions without a dense X.
23
+ */
24
+ export declare function getColumnBounds(dataSet: DataSetXY, name: string): Interval | undefined;
25
+ /** Does not compute bounds, read samples, or create a cache. Counts exclude JavaScript
26
+ * object overhead and caller-held results; no byte estimate is presented as heap/RSS.
27
+ */
28
+ export declare function getColumnBoundsStats(dataSet: DataSetXY, name: string): ColumnBoundsStats | undefined;
@@ -0,0 +1,49 @@
1
+ import type { DataSetXY } from './core/data.js';
2
+ export interface ColumnOrder {
3
+ /** All three properties cover the complete retained window, including hidden data.
4
+ * An empty window is vacuously ordered. Consumers still need their own count guard.
5
+ */
6
+ readonly finite: boolean;
7
+ readonly monotonic: boolean;
8
+ readonly strict: boolean;
9
+ readonly sampleCount: number;
10
+ readonly firstIndex: number;
11
+ readonly nextIndex: number;
12
+ readonly contentEpoch: number;
13
+ readonly lastInvalidPointIndex: number;
14
+ readonly lastDecreaseEdgeIndex: number;
15
+ readonly lastNonIncreaseEdgeIndex: number;
16
+ /** Individually examined values, excluding endpoints of certified affine spans. */
17
+ readonly scannedSamples: number;
18
+ readonly lastScannedSamples: number;
19
+ readonly affineFastSamples: number;
20
+ readonly lastAffineFastSamples: number;
21
+ readonly affineEndpointEvaluations: number;
22
+ readonly lastAffineEndpointEvaluations: number;
23
+ readonly cacheHits: number;
24
+ readonly rebuilds: number;
25
+ }
26
+ /** Exact ordering of the full retained column. Latest violation indices are enough:
27
+ * a retained point must be >= first, while both ends of an edge require index > first.
28
+ * Append-only progress consumes only unseen retained data, independent of revisions.
29
+ */
30
+ export declare function getColumnOrder(dataSet: DataSetXY, name: string): ColumnOrder;
31
+ /** Internal finite-only predicate. Its independent cache never publishes order
32
+ * facts or changes getColumnOrder's scan counters. Every newly exposed value is
33
+ * checked, including values outside the viewport; only a producer-certified
34
+ * unchanged retained prefix can reuse earlier checks. */
35
+ export interface ColumnFinite {
36
+ readonly finite: boolean;
37
+ readonly verifiedCurrent: boolean;
38
+ readonly sampleCount: number;
39
+ readonly firstIndex: number;
40
+ readonly nextIndex: number;
41
+ readonly contentEpoch: number;
42
+ readonly lastInvalidPointIndex: number;
43
+ readonly scannedSamples: number;
44
+ readonly lastScannedSamples: number;
45
+ readonly fullScans: number;
46
+ readonly incrementalScans: number;
47
+ readonly cacheHits: number;
48
+ }
49
+ export declare function getColumnFinite(dataSet: DataSetXY, name: string): ColumnFinite;
@@ -0,0 +1,15 @@
1
+ import type { DataColumnRuns } from './core/data.js';
2
+ import type { Interval } from './contracts.js';
3
+ /** Scan dense values or exact per-append affine endpoints without allocating a time column. */
4
+ export declare function boundsFromRuns(view: DataColumnRuns, from?: number): Interval | undefined;
5
+ export declare function firstRunValue(view: DataColumnRuns | undefined): number;
6
+ /** Write one interleaved coordinate directly. Affine batch origins must not be reassociated. */
7
+ export declare function projectRuns(view: DataColumnRuns, positions: Float32Array, dimension: 0 | 1, from: number, origin: number, logarithmic: boolean): void;
8
+ /** Preserve the single dense pass used by ordinary explicit XY inputs. */
9
+ export declare function projectXYRuns(x: DataColumnRuns, y: DataColumnRuns, positions: Float32Array, from: number, origin: {
10
+ x: number;
11
+ y: number;
12
+ }, logX: boolean, logY: boolean): {
13
+ monotonic: boolean;
14
+ strict: boolean;
15
+ };
@@ -0,0 +1,32 @@
1
+ import type { FormattingFunction, FormattingRange } from './formatting-functions.js';
2
+ export type DateTimeFormatter = Intl.DateTimeFormatOptions | FormattingFunction;
3
+ export type DateTimeTickLevel = 'great' | 'major' | 'minor';
4
+ export type DateTimeZoom = 'decade' | 'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond';
5
+ /** Original formatting state shared by DateTime labels and the public cursor API.
6
+ * Values passed to callbacks are absolute timestamps; the range stays in axis
7
+ * coordinates. Tick placement is deliberately independent of display formatting.
8
+ */
9
+ export declare class DateTimeFormatting {
10
+ private readonly invalidate;
11
+ private origin;
12
+ private utc;
13
+ private locale;
14
+ private formats;
15
+ private zoomFormats;
16
+ private intlCache;
17
+ constructor(invalidate?: () => void);
18
+ setDateOrigin(value: Date | number | undefined): void;
19
+ getDateOrigin(): Date | undefined;
20
+ getOriginTimestamp(): number;
21
+ setUTC(value: boolean): void;
22
+ getUTC(): boolean;
23
+ setLocale(value: string | undefined): void;
24
+ getLocale(): string | undefined;
25
+ setFormatting(great: DateTimeFormatter | undefined, major: DateTimeFormatter | undefined, minor?: DateTimeFormatter): void;
26
+ setZoomFormatting(zoom: DateTimeZoom, great: DateTimeFormatter | undefined, major: DateTimeFormatter | undefined, minor?: DateTimeFormatter): void;
27
+ hasCustomFormatting(): boolean;
28
+ formatTick(value: number, range: FormattingRange, level: DateTimeTickLevel, zoom: DateTimeZoom): string;
29
+ formatCursor(value: number, range: FormattingRange, custom?: FormattingFunction): string;
30
+ }
31
+ /** Select a calendar display scale without converting stored samples. */
32
+ export declare function dateTimeZoomForRange(range: FormattingRange): DateTimeZoom;
@@ -0,0 +1,56 @@
1
+ /** Original calendar placement candidate. No reference implementation is used.
2
+ * A calendar level and its display stride are separate decisions. The caller
3
+ * supplies actual formatted label widths; no font or reference pixel scale is
4
+ * inferred here. Calendar arithmetic never changes the source axis interval.
5
+ */
6
+ export type CalendarUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year' | 'decade';
7
+ export type CalendarTickLevel = 'great' | 'major' | 'minor';
8
+ export type CalendarRange = Readonly<{
9
+ start: number;
10
+ end: number;
11
+ }>;
12
+ export interface CalendarTick {
13
+ value: number;
14
+ timestamp: number;
15
+ label: string;
16
+ level: CalendarTickLevel;
17
+ anchor: number;
18
+ }
19
+ export interface CalendarGridOptions {
20
+ interval: CalendarRange;
21
+ axisSizePixels: number;
22
+ utc: boolean;
23
+ origin?: number;
24
+ format: (value: number, level: CalendarTickLevel, zoom: CalendarUnit) => string;
25
+ measure: (label: string, level: CalendarTickLevel) => number;
26
+ gapPixels?: number;
27
+ /** Minimum clear space between adjacent minor labels, independently of the
28
+ * clearance used when a minor label approaches a major label. */
29
+ minorGapPixels?: number;
30
+ maxTicks?: number;
31
+ minorVisible?: boolean;
32
+ }
33
+ export interface CalendarGrid {
34
+ zoom: CalendarUnit;
35
+ major: CalendarTick[];
36
+ minor: CalendarTick[];
37
+ great: CalendarTick[];
38
+ majorStep: number;
39
+ minorStep: number | undefined;
40
+ truncated: boolean;
41
+ }
42
+ /** Calendar boundary at or before an absolute timestamp. Local days and weeks
43
+ * use wall-calendar fields; a repeated DST hour retains its actual offset. */
44
+ export declare function floorCalendar(value: number, unit: CalendarUnit, utc: boolean): number;
45
+ /** Advance a known boundary. Months/years use calendar setters, not an average
46
+ * millisecond duration; hours and smaller retain both occurrences at DST folds. */
47
+ export declare function advanceCalendar(value: number, unit: CalendarUnit, count: number, utc: boolean): number;
48
+ /** Select the largest unit for which the range contains two whole unit lengths
49
+ * from its first calendar boundary. This is a candidate policy, verified first
50
+ * for the public week/month examples; it is not a claim of all-range parity. */
51
+ export declare function selectCalendarUnit(interval: CalendarRange, utc: boolean, origin?: number): CalendarUnit;
52
+ export declare function calendarBoundaries(interval: CalendarRange, unit: CalendarUnit, utc: boolean, origin?: number, limit?: number): {
53
+ values: number[];
54
+ truncated: boolean;
55
+ };
56
+ export declare function calendarTickGrid(options: CalendarGridOptions): CalendarGrid;
@@ -0,0 +1,16 @@
1
+ export interface FormattingRange {
2
+ start: number;
3
+ end: number;
4
+ }
5
+ export type FormattingFunction = (value: number, range: FormattingRange, locale?: string, shiftInfo?: {
6
+ valueShifted: number;
7
+ shiftOrigin: number;
8
+ }) => string;
9
+ /** Decimal display resolution follows the range, never a rounded source copy. */
10
+ export declare function formatNumeric(value: number, range: FormattingRange): string;
11
+ /** Nonzero scientific values retain three significant digits. */
12
+ export declare function formatScientific(value: number, range: FormattingRange): string;
13
+ export declare const FormattingFunctions: Readonly<{
14
+ Numeric: typeof formatNumeric;
15
+ Scientific: typeof formatScientific;
16
+ }>;