@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,75 @@
1
+ export * from "./core/data.js";
2
+ export * from "./core/styles.js";
3
+ export { Icon, type IconProperties, type ImageFillSource } from './custom-icon.js';
4
+ export * from "./core/events.js";
5
+ export * from "./contracts.js";
6
+ export * from "./axis.js";
7
+ export * from "./formatting-functions.js";
8
+ export * from "./time-formatting.js";
9
+ export * from "./series.js";
10
+ export * from "./geometry.js";
11
+ export * from "./hierarchy.js";
12
+ export * from "./ui.js";
13
+ export * from './native-legend.js';
14
+ export * from './cursor-api.js';
15
+ export * from './chart-events.js';
16
+ export * from './compatibility-types.js';
17
+ export * from "./chart.js";
18
+ export * from "./specialty.js";
19
+ export * from "./themes.js";
20
+ export * from "./gradients.js";
21
+ export * from "./point-fill.js";
22
+ export * from "./map.js";
23
+ export * from './polar-heatmap.js';
24
+ export * from './polar-series.js';
25
+ export * from './mesh3d.js';
26
+ export * from "./adapters/opentest.js";
27
+ import { ChartXY, Chart3D, Polar, type ChartOptions } from "./chart.js";
28
+ import { Pie, Gauge, Spider, BarChart, TreeMapChart, ParallelCoordinateChart, DataGrid } from "./specialty.js";
29
+ import { SunBurstChart, Funnel, Pyramid } from "./hierarchy.js";
30
+ import { MapChart, type MapOptions } from "./map.js";
31
+ import { type EventListener } from './core/events.js';
32
+ /** Create a CRYChart context that owns its chart instances. */
33
+ export declare function cryChart(_options?: Record<string, unknown>): {
34
+ ChartXY: (o?: ChartOptions) => ChartXY;
35
+ Chart3D: (o?: ChartOptions) => Chart3D;
36
+ Polar: (o?: ChartOptions) => Polar;
37
+ Pie: (o?: any) => Pie;
38
+ Gauge: (o?: any) => Gauge;
39
+ Spider: (o?: any) => Spider;
40
+ BarChart: (o?: any) => BarChart;
41
+ TreeMapChart: (o?: any) => TreeMapChart;
42
+ ParallelCoordinateChart: (o?: any) => ParallelCoordinateChart;
43
+ DataGrid: (o?: any) => DataGrid;
44
+ MapChart: (o?: MapOptions) => MapChart;
45
+ SunBurstChart: (o?: any) => SunBurstChart;
46
+ Funnel: (o?: any) => Funnel;
47
+ Pyramid: (o?: any) => Pyramid;
48
+ Dashboard: (o?: any) => Dashboard;
49
+ dispose(): void;
50
+ isDisposed: () => boolean;
51
+ /** Live charts owned by this context; disposed charts are released immediately. */
52
+ getChartCount: () => number;
53
+ };
54
+ export declare const version = "1.0.1";
55
+ export declare class Dashboard {
56
+ readonly root: HTMLDivElement;
57
+ private cells;
58
+ private children;
59
+ private events;
60
+ private columns;
61
+ private rows;
62
+ disposed: boolean;
63
+ constructor(options?: any);
64
+ private chart;
65
+ createChartXY(options?: any): ChartXY;
66
+ createChart3D(options?: any): Chart3D;
67
+ createPolar(options?: any): Polar;
68
+ createPie(options?: any): Pie;
69
+ createGauge(options?: any): Gauge;
70
+ createSpider(options?: any): Spider;
71
+ dispose(): this;
72
+ isDisposed(): boolean;
73
+ onDispose(listener: EventListener): symbol;
74
+ getChartCount(): number;
75
+ }
@@ -0,0 +1,56 @@
1
+ export type InteractionConfiguration = boolean | Record<string, any> | undefined | null;
2
+ export type InteractionDimension = 'x' | 'y';
3
+ export type ZoomAnchorMode = 'toward-pointer' | 'centered' | 'keep-start' | 'keep-end';
4
+ export type ChartInteractionKind = 'pan' | 'zoom' | 'rectangleZoom' | 'restoreDefault';
5
+ export interface InteractionContext {
6
+ axis?: InteractionDimension;
7
+ axisConfig?: InteractionConfiguration;
8
+ }
9
+ export interface PointerGesture {
10
+ button?: number;
11
+ shiftKey?: boolean;
12
+ ctrlKey?: boolean;
13
+ altKey?: boolean;
14
+ }
15
+ export interface InteractionPolicy {
16
+ readonly enabled: boolean;
17
+ readonly scope: 'chart' | 'axis';
18
+ readonly axis?: InteractionDimension;
19
+ readonly legacyShiftPan: boolean;
20
+ /** Immutable owned configuration snapshot. No reference to the consumer input. */
21
+ readonly config: Readonly<Record<string, any>>;
22
+ }
23
+ export interface InteractionDecisionBase {
24
+ x: boolean;
25
+ y: boolean;
26
+ stopScroll: boolean;
27
+ sensitivity: number;
28
+ }
29
+ export interface DragInteractionDecision extends InteractionDecisionBase {
30
+ kind: 'none' | 'pan' | 'rectangle-zoom';
31
+ }
32
+ export interface WheelInteractionDecision extends InteractionDecisionBase {
33
+ kind: 'none' | 'zoom';
34
+ mode: ZoomAnchorMode;
35
+ factor: number;
36
+ }
37
+ export interface RestoreInteractionDecision extends InteractionDecisionBase {
38
+ kind: 'none' | 'restore';
39
+ }
40
+ /** Axis-lane settings are separate from chart-area interactions. A global axes
41
+ * override is refined by the directional override and finally the axis itself.
42
+ * Explicit chart false/undefined disables chart routes. Empty/default configuration
43
+ * preserves CRY's existing left rectangle, right/Shift pan, wheel zoom and fit.
44
+ */
45
+ export declare function resolveInteractionPolicy(chartConfig: InteractionConfiguration, context?: InteractionContext): InteractionPolicy;
46
+ export declare function getDragInteraction(policy: InteractionPolicy, event: PointerGesture): DragInteractionDecision;
47
+ export declare function getWheelInteraction(policy: InteractionPolicy, event: {
48
+ deltaY: number;
49
+ deltaMode?: number;
50
+ }, pagePixels?: number): WheelInteractionDecision;
51
+ /** Pointer fraction is in axis DATA order (after inversion and pane mapping). */
52
+ export declare function wheelAnchorFraction(mode: ZoomAnchorMode, pointerFraction: number): number;
53
+ export declare function getDoubleClickInteraction(policy: InteractionPolicy, event?: PointerGesture): RestoreInteractionDecision;
54
+ /** Axis pan/zoom settings only apply to its lane; the distinct public opt-out
55
+ * controls whether a chart-area gesture may affect that axis. */
56
+ export declare function axisAcceptsChartInteraction(axisConfig: InteractionConfiguration, kind: ChartInteractionKind): boolean;
@@ -0,0 +1,146 @@
1
+ import type { DrawPacket, Rect } from './contracts.js';
2
+ import type { DataColumnRuns } from './core/data.js';
3
+ /** Leaves room for endpoint, both block halos and renderer end padding within
4
+ * one 32768-sample power-of-two allocation. Block indices need not be powers of two. */
5
+ export declare const DEFAULT_LINE_BLOCK_SEGMENTS = 32760;
6
+ /** Experimental block contract: the ChartXY integration is opt-in and off by default.
7
+ * Blocks partition SEGMENTS, not samples. For B segments, an interior block
8
+ * draws B+1 samples and stores two additional samples solely as miter halos.
9
+ * Adjacent blocks share one drawn boundary sample and never share a segment.
10
+ */
11
+ export interface LineBlockSource {
12
+ /** Stable identity of the source DataSet; never retained after dispose(). */
13
+ identity: object;
14
+ /** Changes on clear/replacement/nonappend mutation, including clear+append
15
+ * between two rendered frames. Revision jumps alone do not imply a reset. */
16
+ contentEpoch: number;
17
+ revision: number;
18
+ firstSampleIndex: number;
19
+ nextSampleIndex: number;
20
+ /** Borrowed dense/affine views in source precision; no dense auto-X snapshot. */
21
+ x: DataColumnRuns;
22
+ y: DataColumnRuns;
23
+ }
24
+ export interface LineBlockRequest {
25
+ source: LineBlockSource;
26
+ /** Same logical stroke across independently cached geometry packets. */
27
+ strokeGroup?: number;
28
+ /** Coordinate mapping / axis transform identity. Logarithmic or unsupported
29
+ * mappings return a fallback result until separately implemented and tested. */
30
+ projectionKey: string;
31
+ coordinateMode: 'linear' | 'unsupported';
32
+ bindingRevision: number;
33
+ styleRevision: number;
34
+ /** Inclusive first, exclusive last requested segment-start indices. The host
35
+ * derives these from the visible source X range, retaining edge neighbors. */
36
+ visibleSegments: {
37
+ first: number;
38
+ end: number;
39
+ };
40
+ domain: DrawPacket['domain'];
41
+ clipRect?: Rect;
42
+ style: Pick<DrawPacket, 'color' | 'thickness'>;
43
+ /** Negative X values are valid. Reversing, duplicate or nonfinite source X
44
+ * must be detected; it cannot be asserted away from a schema hint alone. */
45
+ monotonicX: 'verified-strict' | 'unknown' | 'invalid';
46
+ }
47
+ export interface LineBlockSpan {
48
+ blockIndex: number;
49
+ nominalFirstSegment: number;
50
+ /** Owned segment starts [firstSegment,endSegment). */
51
+ firstSegment: number;
52
+ endSegment: number;
53
+ /** Real drawn samples [firstSegment,endSegment], inclusive at both ends. */
54
+ firstDrawSample: number;
55
+ lastDrawSample: number;
56
+ /** Actual source halo indices; endpoints duplicate the first/last retained
57
+ * sample only when a real neighbor no longer exists. */
58
+ beforeSample: number;
59
+ afterSample: number;
60
+ }
61
+ export interface LineBlockPacket extends DrawPacket {
62
+ /** A private far-negative identity (starting below -2^40); -seriesId is
63
+ * already used by other geometry and must not be reused for block packets. */
64
+ id: number;
65
+ /** Packet count includes only local storage, including both halos. Public
66
+ * series/data-set sample counts always come from the complete source. */
67
+ count: number;
68
+ /** Intersect the visibility range with these drawn samples. Halos participate
69
+ * in join calculation but are never separate segments or cursor samples. */
70
+ drawFirst: number;
71
+ drawCount: number;
72
+ sourceFirstSample: number;
73
+ firstOwnedSegment: number;
74
+ endOwnedSegment: number;
75
+ contentEpoch: number;
76
+ blockIndex: number;
77
+ clipRect?: Rect;
78
+ /** Float64 origin with unchanged Float32 relative raster coordinates. Source
79
+ * values, readback, cursor data and affine X expressions retain precision. */
80
+ origin: DrawPacket['origin'];
81
+ /** CPU reconstruction error, not a promise that raster bytes equal the old
82
+ * whole-series Float32 origin. Smaller blocks may improve that precision. */
83
+ precision: {
84
+ maximumXError: number;
85
+ maximumYError: number;
86
+ };
87
+ /** Local position pairs changed this update. Compatibility uploaders may use
88
+ * updateFrom, but that can include unchanged pairs between disjoint patches. */
89
+ dirtySampleRanges: readonly {
90
+ first: number;
91
+ count: number;
92
+ }[];
93
+ }
94
+ export interface LineBlockCacheStats {
95
+ residentBlocks: number;
96
+ residentProjectionBytes: number;
97
+ projectedSamplesThisUpdate: number;
98
+ positionPairsWrittenThisUpdate: number;
99
+ evictedBlocksThisUpdate: number;
100
+ reusedBlocksThisUpdate: number;
101
+ requestedSegments: number;
102
+ sourceRetainedSamples: number;
103
+ /** No source rows are discarded by this cache. */
104
+ sourceReduction: false;
105
+ }
106
+ export type LineBlockResult = {
107
+ kind: 'blocks';
108
+ packets: readonly LineBlockPacket[];
109
+ stats: LineBlockCacheStats;
110
+ } | {
111
+ kind: 'fallback';
112
+ reason: 'unverified-x-order' | 'unsupported-transform' | 'nonfinite-x' | 'nonincreasing-x' | 'relative-overflow' | 'resource-limit';
113
+ stats: LineBlockCacheStats;
114
+ };
115
+ export interface LineBlockCache {
116
+ /** Update only touched tail blocks and changed endpoint halos. Advancing the
117
+ * retained start clips old segments; it does not reproject the whole history.
118
+ * Viewport changes retain only visible blocks plus adjacent halo information.
119
+ * Binding/epoch/style changes publish packets atomically or request fallback. */
120
+ update(request: LineBlockRequest): LineBlockResult;
121
+ clear(): void;
122
+ dispose(): void;
123
+ }
124
+ /** Experimental CPU block cache. It owns derived Float32 coordinates only;
125
+ * it never owns, trims, materializes, mutates, or disposes source columns.
126
+ * The host must obtain verified-strict from a complete retained-column order
127
+ * certificate (data-order.ts), not merely from the currently visible range.
128
+ */
129
+ export declare class LineBlockCache {
130
+ private readonly strokeGroup;
131
+ private readonly blockSize;
132
+ private readonly maximumBytes;
133
+ private entries;
134
+ private state?;
135
+ private revision;
136
+ private disposed;
137
+ constructor(options?: {
138
+ segmentsPerBlock?: number;
139
+ maximumProjectionBytes?: number;
140
+ });
141
+ }
142
+ /** Pure range planner for the proposed geometry contract, not a renderer. */
143
+ export declare function planLineBlockSpans(firstSample: number, nextSample: number, visibleSegments: {
144
+ first: number;
145
+ end: number;
146
+ }, segmentsPerBlock?: number): LineBlockSpan[];
@@ -0,0 +1,28 @@
1
+ import type { Rect } from './contracts.js';
2
+ import { type RasterClipFrame } from './raster-clip.js';
3
+ export interface StrokePixel {
4
+ x: number;
5
+ y: number;
6
+ }
7
+ export interface StrokeViewport {
8
+ x: number;
9
+ y: number;
10
+ width: number;
11
+ height: number;
12
+ }
13
+ export interface StrokeRegion {
14
+ viewport: StrokeViewport;
15
+ region: StrokeViewport;
16
+ offsetX: number;
17
+ offsetY: number;
18
+ }
19
+ /** Framebuffer coordinates, with a lower-left origin. A scratch texture only
20
+ * needs the intersection that can actually contribute to the destination. */
21
+ export declare function strokeRegion(rect: Rect, clip: Rect, dpr: number, bufferWidth: number, bufferHeight: number, containedFrame?: RasterClipFrame): StrokeRegion | undefined;
22
+ /** Four triangle-strip corners enclosing a round-cap segment's entire AA
23
+ * support. Unlike a shared miter, this bound is independent of its neighbors. */
24
+ export declare function capsuleQuad(start: StrokePixel, end: StrokePixel, width: number): readonly StrokePixel[];
25
+ export declare function segmentCoverage(point: StrokePixel, start: StrokePixel, end: StrokePixel, width: number): number;
26
+ /** The intended mask semantics: a stroke is the union of finite segments,
27
+ * including caps. Alpha is applied once after taking the maximum coverage. */
28
+ export declare function strokeCoverage(point: StrokePixel, points: readonly StrokePixel[], width: number): number;
@@ -0,0 +1,64 @@
1
+ import { type LedgerCompletedPlan } from './line-selection-ledger.js';
2
+ import type { DrawPacket } from './contracts.js';
3
+ import type { DisplayPageChunk, PagePacketTemplate } from './line-display-packets.js';
4
+ export interface LineArenaDirtyRange {
5
+ first: number;
6
+ count: number;
7
+ }
8
+ /** Borrowed until the arena's next successful update. One storage id owns one
9
+ * VBO, even when two draw views refer to it. Ranges are physical sample slots. */
10
+ export interface LineArenaStorage {
11
+ id: number;
12
+ revision: number;
13
+ previousRevision: number;
14
+ values: Float32Array;
15
+ dirtyRanges: readonly LineArenaDirtyRange[];
16
+ capacity: number;
17
+ }
18
+ export interface LineArenaPacket extends DrawPacket {
19
+ arenaStorage: LineArenaStorage;
20
+ arenaFirst: number;
21
+ }
22
+ export interface LineArenaStats {
23
+ sourceDisplaySamples: number;
24
+ submittedSegments: number;
25
+ geometryPackets: number;
26
+ capacityBytes: number;
27
+ reusedSamples: number;
28
+ writtenSamples: number;
29
+ dirtyPositionBytes: number;
30
+ fullRebuild: boolean;
31
+ head: number;
32
+ wrapped: boolean;
33
+ generationReset: boolean;
34
+ }
35
+ /** Experimental packaging only: existing projected coordinates are copied
36
+ * byte-for-byte into a single cyclic allocation. No source value is removed,
37
+ * re-projected, or approximated. This needs the independent arena uploader;
38
+ * ordinary DrawPacket upload must not consume these shared-storage packets. */
39
+ export declare class LineDisplayArena {
40
+ readonly maximumSamples: number;
41
+ private storage?;
42
+ private entries;
43
+ private entriesOwner?;
44
+ private generation?;
45
+ private origin?;
46
+ private head;
47
+ private disposed;
48
+ constructor(maximumSamples?: number);
49
+ update(chunks: readonly DisplayPageChunk[], template: PagePacketTemplate, generation: unknown): {
50
+ packets: readonly LineArenaPacket[];
51
+ storage?: LineArenaStorage;
52
+ stats: LineArenaStats;
53
+ };
54
+ /** Internal own-selector certificate. Foreign descriptors use update(). */
55
+ updateCertified(plan: LedgerCompletedPlan, template: PagePacketTemplate, generation: unknown): {
56
+ packets: readonly LineArenaPacket[];
57
+ storage?: LineArenaStorage;
58
+ stats: LineArenaStats;
59
+ };
60
+ /** Before a full fallback, restore only private descriptor metadata. */
61
+ materializeLedgerEntries(): void;
62
+ clear(): void;
63
+ dispose(): void;
64
+ }
@@ -0,0 +1,144 @@
1
+ import { type ExtremaPairProof } from './line-extrema-pair-proof.js';
2
+ import { type LedgerWork } from './line-selection-ledger.js';
3
+ import type { DrawPacket, Rect } from './contracts.js';
4
+ import type { LineBlockRequest } from './line-block-cache.js';
5
+ import { type PagePacketStats } from './line-display-packets.js';
6
+ import { type LineArenaStats } from './line-display-arena.js';
7
+ /** Experimental display simplification only. All source rows remain owned by
8
+ * the DataSet. This is not a replacement for raw readback, bounds or cursors. */
9
+ export interface LineDisplayRequest extends LineBlockRequest {
10
+ plotRect: Rect;
11
+ devicePixelRatio: number;
12
+ /** Maximum physical-pixel X extent of one simplified finite run. This is a
13
+ * horizontal centerline bound, not a promise of identical antialias bytes. */
14
+ maximumPixelSpan?: number;
15
+ collectAudit?: boolean;
16
+ /** Capsule-coverage-only packaging experiment. It does not change selection.
17
+ * Source indices are flattened only when collectAudit is explicitly true. */
18
+ packetMode?: 'flat' | 'pages' | 'arena';
19
+ /** Explicit capsule-coverage experiment. Defaults to preserving the original
20
+ * neighbors of sharp extrema for compatibility with miter geometry. */
21
+ preserveExtremaNeighbors?: boolean;
22
+ /** Explicit local capsule experiment. Both adjacent original points must
23
+ * lie within this conservative physical-pixel radius before omission. */
24
+ extremaNeighborDistancePixels?: number;
25
+ /** Exact-byte candidate: reuse accepted, unchanged terminal groups when an
26
+ * appended tail causes its containing page to be selected again. */
27
+ reuseUnchangedGroups?: boolean;
28
+ /** Internal-render candidate: omit the flattened audit-only source-index
29
+ * vector. Page selection indices and all original DataSet values remain.
30
+ * collectAudit:true always materializes this vector for verification. */
31
+ collectSourceIndices?: boolean;
32
+ /** Independent producer-certified selection experiment; default false. */
33
+ reuseCertifiedPages?: boolean;
34
+ /** Independent finite dense waveform candidate; issued proof expires on mutation. */
35
+ extremaPairProof?: ExtremaPairProof;
36
+ }
37
+ export interface LineDisplayAudit {
38
+ first: number;
39
+ last: number;
40
+ minimum: number;
41
+ maximum: number;
42
+ pixelSpan: number;
43
+ finite: boolean;
44
+ }
45
+ export interface LineDisplayStats {
46
+ retainedSourceSamples: number;
47
+ displaySelectionPolicy?: string;
48
+ extremaPairAdmission?: string;
49
+ requestedSourceSamples: number;
50
+ selectedDisplaySamples: number;
51
+ submittedDisplaySamples: number;
52
+ omittedDisplaySamples: number;
53
+ summaryPages: number;
54
+ summaryBytes: number;
55
+ selectionBytes: number;
56
+ projectionBytes: number;
57
+ cachedSelectionBytes: number;
58
+ cachedProjectionBytes: number;
59
+ cachedTopologyBytes: number;
60
+ reusedSelectionPages: number;
61
+ sourceSamplesScannedThisUpdate: number;
62
+ boundarySamplesScannedThisUpdate: number;
63
+ visitedSummaryNodes: number;
64
+ reusedPages: number;
65
+ evictedPages: number;
66
+ largestSimplifiedPixelSpan: number;
67
+ maximumProjectionXError: number;
68
+ maximumProjectionYError: number;
69
+ sourceReduction: false;
70
+ displayReduction: boolean;
71
+ pagePackets?: PagePacketStats;
72
+ arena?: LineArenaStats;
73
+ extremaNeighborsRetained: boolean;
74
+ extremaNeighborDistancePixels?: number;
75
+ reusedTerminalGroups: number;
76
+ reusedProjectionSamplesThisUpdate: number;
77
+ projectedSamplesThisUpdate: number;
78
+ projectionRebasesThisUpdate: number;
79
+ selectionDelta?: LedgerWork;
80
+ }
81
+ export type LineDisplayResult = {
82
+ kind: 'display';
83
+ packet?: DrawPacket;
84
+ packets?: readonly DrawPacket[];
85
+ sourceIndices: Float64Array;
86
+ sourceIndicesIncluded?: boolean;
87
+ stats: LineDisplayStats;
88
+ audit?: readonly LineDisplayAudit[];
89
+ } | {
90
+ kind: 'fallback';
91
+ reason: 'unverified-x-order' | 'unsupported-transform' | 'invalid-viewport' | 'resource-limit' | 'relative-overflow';
92
+ stats: LineDisplayStats;
93
+ };
94
+ /** Fixed absolute-index pages contain a compact min/max tree. Tail appends only
95
+ * rebuild touched leaves and their ancestors. Moving the retained start only
96
+ * clips queries; expired values are never read from old tree nodes. Each finite
97
+ * accepted node emits its first/minimum/maximum/last source indices in source
98
+ * order. Mixed finite/nonfinite nodes descend; every gap remains disconnected.
99
+ *
100
+ * For a finite accepted node, both the original and selected polylines are
101
+ * continuous and attain the same minimum and maximum Y inside an X slab no
102
+ * wider than maximumPixelSpan. Their centerline Hausdorff distance is therefore
103
+ * bounded horizontally by that span, before Float32 projection. This statement
104
+ * does not imply equal raster coverage, opacity accumulation or join geometry.
105
+ * Dense bounded opaque solid streams may use this display view when admitted
106
+ * by the host's rendering policy. All original source values remain available;
107
+ * the view does not promise byte-identical antialiasing or join coverage.
108
+ */
109
+ export declare class LineDisplayCache {
110
+ private readonly pageSize;
111
+ private readonly leafSize;
112
+ private readonly leaves;
113
+ private readonly pageBytes;
114
+ private readonly maximumSummaryBytes;
115
+ private readonly maximumDisplaySamples;
116
+ private pages;
117
+ private state?;
118
+ private origin?;
119
+ private indices;
120
+ private positions;
121
+ private outputCount;
122
+ private revision;
123
+ private id;
124
+ private disposed;
125
+ private pagePackets?;
126
+ private arena?;
127
+ private deltaLedger?;
128
+ constructor(options?: {
129
+ pageSize?: number;
130
+ leafSize?: number;
131
+ maximumSummaryBytes?: number;
132
+ maximumDisplaySamples?: number;
133
+ });
134
+ update(request: LineDisplayRequest): LineDisplayResult;
135
+ private updateProjection;
136
+ /** Release hidden geometry without changing the projection of unchanged data.
137
+ * Only the scalar origin and existing source/policy invalidation record remain.
138
+ * update still invalidates them on identity/epoch/binding/policy/window changes;
139
+ * ordinary clear and dispose continue to drop every reference. */
140
+ suspend(): void;
141
+ clear(): void;
142
+ dispose(): void;
143
+ private merge;
144
+ }
@@ -0,0 +1,43 @@
1
+ import type { DrawPacket } from './contracts.js';
2
+ /** Independent experiment only. The selector still decides every retained
3
+ * display index. This stage only partitions its already projected geometry. */
4
+ export interface DisplayPageChunk {
5
+ /** Stable page and boundary-role identity within one selector generation. */
6
+ key: string;
7
+ positions: Float32Array;
8
+ first: number;
9
+ count: number;
10
+ /** Must describe the submitted slice, not merely its source schema. */
11
+ strictlyMonotonicX: boolean;
12
+ }
13
+ export type PagePacketTemplate = Pick<DrawPacket, 'origin' | 'domain' | 'clipRect' | 'color' | 'thickness' | 'strokeGroup'>;
14
+ export interface PagePacketStats {
15
+ sourceDisplaySamples: number;
16
+ submittedSegments: number;
17
+ geometryPackets: number;
18
+ bridgePackets: number;
19
+ newPackets: number;
20
+ changedPackets: number;
21
+ reusedPackets: number;
22
+ evictedPackets: number;
23
+ /** Input bytes whose packet revision changed, not measured GL uploads. */
24
+ dirtyPositionBytes: number;
25
+ allocatedBridgeBytes: number;
26
+ borrowedProjectionBytes: number;
27
+ }
28
+ /** A coverage-union-only experiment. Interior page segments use their original
29
+ * Float32 views. Exactly one two-point bridge owns each inter-page segment.
30
+ * All packets must be submitted together under the same strokeGroup; this
31
+ * class does not claim compatible miter geometry in the older strip renderer.
32
+ * Call clear() when source identity/content epoch or projection origin changes.
33
+ */
34
+ export declare class DisplayPagePacketCache {
35
+ private entries;
36
+ private disposed;
37
+ update(chunks: readonly DisplayPageChunk[], template: PagePacketTemplate): {
38
+ packets: readonly DrawPacket[];
39
+ stats: PagePacketStats;
40
+ };
41
+ clear(): void;
42
+ dispose(): void;
43
+ }
@@ -0,0 +1,23 @@
1
+ import type { DataSetXY } from './core/data.js';
2
+ import type { LineBlockRequest } from './line-block-cache.js';
3
+ export interface ExtremaPairProof {
4
+ readonly enabled: boolean;
5
+ readonly reason: string;
6
+ readonly identity: object;
7
+ readonly revision: number;
8
+ readonly epoch: number;
9
+ readonly first: number;
10
+ readonly next: number;
11
+ }
12
+ export declare function getExtremaPairProofWork(data: DataSetXY): {
13
+ fullChecks: number;
14
+ incrementalChecks: number;
15
+ unchangedChecks: number;
16
+ lastRunVisits: number;
17
+ totalRunVisits: number;
18
+ lastBinarySteps: number;
19
+ ownedSourceArrays: number;
20
+ sourceViewsRetained: boolean;
21
+ } | undefined;
22
+ export declare function proveExtremaPair(data: DataSetXY, xKey: string, yKey: string): ExtremaPairProof;
23
+ export declare function acceptsExtremaPair(proof: ExtremaPairProof | undefined, source: LineBlockRequest['source']): boolean;
@@ -0,0 +1,6 @@
1
+ import type { LUT } from './core/styles.js';
2
+ /** A three-dimensional line is split at raw LUT boundaries before normalization is drawn. */
3
+ export declare function colorMappedLine3D(positions: Float32Array, values: ArrayLike<number>, lut: LUT): {
4
+ positions: Float32Array;
5
+ colors: Float32Array;
6
+ };