@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,143 @@
|
|
|
1
|
+
import type { DataColumnRuns } from './core/data.js';
|
|
2
|
+
import { type SourceCertificate } from './core/line-delta-certificate.js';
|
|
3
|
+
/** These are selector-owned immutable arrays, never DataSet borrowed storage. */
|
|
4
|
+
export interface LedgerSelection {
|
|
5
|
+
readonly indices: Float64Array;
|
|
6
|
+
readonly positions: Float32Array;
|
|
7
|
+
readonly groups: Int32Array;
|
|
8
|
+
readonly groupLookup?: Uint16Array;
|
|
9
|
+
readonly strict: boolean;
|
|
10
|
+
readonly maximumXError: number;
|
|
11
|
+
readonly maximumYError: number;
|
|
12
|
+
readonly largestSpan: number;
|
|
13
|
+
readonly scale: number;
|
|
14
|
+
}
|
|
15
|
+
export interface LedgerChunk {
|
|
16
|
+
readonly key: string;
|
|
17
|
+
readonly positions: Float32Array;
|
|
18
|
+
readonly first: number;
|
|
19
|
+
readonly count: number;
|
|
20
|
+
readonly strictlyMonotonicX: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface LedgerEntry extends LedgerChunk {
|
|
23
|
+
readonly offset: number;
|
|
24
|
+
}
|
|
25
|
+
export interface LedgerPage {
|
|
26
|
+
readonly index: number;
|
|
27
|
+
readonly chunks: readonly LedgerChunk[];
|
|
28
|
+
readonly aggregate: Float64Array;
|
|
29
|
+
}
|
|
30
|
+
export interface LedgerPolicy {
|
|
31
|
+
readonly identity: object;
|
|
32
|
+
readonly binding: number;
|
|
33
|
+
readonly projection: string;
|
|
34
|
+
/** Exact scalar copies. Their evaluation remains in the original selector. */
|
|
35
|
+
readonly numbers: readonly (number | undefined)[];
|
|
36
|
+
readonly preserveNeighbors: boolean;
|
|
37
|
+
readonly reuseGroups: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface LedgerSource {
|
|
40
|
+
identity: object;
|
|
41
|
+
contentEpoch: number;
|
|
42
|
+
revision: number;
|
|
43
|
+
firstSampleIndex: number;
|
|
44
|
+
nextSampleIndex: number;
|
|
45
|
+
x: DataColumnRuns;
|
|
46
|
+
y: DataColumnRuns;
|
|
47
|
+
}
|
|
48
|
+
export interface LedgerWork {
|
|
49
|
+
hits: number;
|
|
50
|
+
fallbacks: number;
|
|
51
|
+
lastReason: string;
|
|
52
|
+
reusedCompletePages: number;
|
|
53
|
+
visitedPages: number;
|
|
54
|
+
newlyScannedSamples: number;
|
|
55
|
+
ownedPageRecords: number;
|
|
56
|
+
retainedTypedBytes: number;
|
|
57
|
+
auxiliaryTypedBytes: number;
|
|
58
|
+
}
|
|
59
|
+
export interface LedgerPlan {
|
|
60
|
+
readonly owner: LineSelectionLedger;
|
|
61
|
+
readonly certificate: SourceCertificate;
|
|
62
|
+
readonly policy: LedgerPolicy;
|
|
63
|
+
readonly visibleFirst: number;
|
|
64
|
+
readonly visibleEnd: number;
|
|
65
|
+
readonly firstPage: number;
|
|
66
|
+
readonly endPage: number;
|
|
67
|
+
readonly previousFirstPage: number;
|
|
68
|
+
readonly previousEndPage: number;
|
|
69
|
+
readonly stableFirstPage: number;
|
|
70
|
+
readonly stableEndPage: number;
|
|
71
|
+
readonly stable: Float64Array;
|
|
72
|
+
readonly oldStableOffset: number;
|
|
73
|
+
readonly prefixPages: number;
|
|
74
|
+
readonly suffixPages: number;
|
|
75
|
+
}
|
|
76
|
+
export interface LedgerCompletedPlan extends LedgerPlan {
|
|
77
|
+
readonly prefix: readonly LedgerEntry[];
|
|
78
|
+
readonly suffix: readonly LedgerEntry[];
|
|
79
|
+
readonly changedPages: readonly LedgerPage[];
|
|
80
|
+
readonly prefixCount: number;
|
|
81
|
+
readonly count: number;
|
|
82
|
+
readonly aggregate: Float64Array;
|
|
83
|
+
}
|
|
84
|
+
export declare const A: {
|
|
85
|
+
readonly count: 0;
|
|
86
|
+
readonly chunks: 1;
|
|
87
|
+
readonly selection: 2;
|
|
88
|
+
readonly projection: 3;
|
|
89
|
+
readonly topology: 4;
|
|
90
|
+
readonly extra: 5;
|
|
91
|
+
readonly span: 6;
|
|
92
|
+
readonly errorX: 7;
|
|
93
|
+
readonly errorY: 8;
|
|
94
|
+
readonly strict: 9;
|
|
95
|
+
readonly firstX: 10;
|
|
96
|
+
readonly lastX: 11;
|
|
97
|
+
};
|
|
98
|
+
export declare function ownLedgerPage(index: number, cached: LedgerSelection | undefined, chunks: readonly {
|
|
99
|
+
key: string;
|
|
100
|
+
selected: LedgerSelection;
|
|
101
|
+
first: number;
|
|
102
|
+
end: number;
|
|
103
|
+
}[], largestSpan: number): LedgerPage;
|
|
104
|
+
/** Bounded page-keyed aggregation tree. Only changed owned pages are written.
|
|
105
|
+
* The absolute page number is checked separately from its cyclic tree slot. */
|
|
106
|
+
export declare class LineSelectionLedger {
|
|
107
|
+
readonly pageSize: number;
|
|
108
|
+
readonly maximumPages: number;
|
|
109
|
+
readonly maximumTypedBytes: number;
|
|
110
|
+
readonly maximumChangedPages: number;
|
|
111
|
+
private pages;
|
|
112
|
+
private capacity;
|
|
113
|
+
private tree;
|
|
114
|
+
private certificate?;
|
|
115
|
+
private policy?;
|
|
116
|
+
private firstPage;
|
|
117
|
+
private endPage;
|
|
118
|
+
private visibleFirst;
|
|
119
|
+
private visibleEnd;
|
|
120
|
+
private serial;
|
|
121
|
+
private planSerial;
|
|
122
|
+
private disposed;
|
|
123
|
+
private work;
|
|
124
|
+
constructor(pageSize: number, maximumPages?: number, maximumTypedBytes?: number, maximumChangedPages?: number);
|
|
125
|
+
getStats(): LedgerWork;
|
|
126
|
+
private miss;
|
|
127
|
+
private readNode;
|
|
128
|
+
private writePage;
|
|
129
|
+
private physicalRange;
|
|
130
|
+
range(first: number, end: number): Float64Array;
|
|
131
|
+
private retainedBytes;
|
|
132
|
+
private validPage;
|
|
133
|
+
private updateResources;
|
|
134
|
+
seed(source: LedgerSource, policy: LedgerPolicy, visibleFirst: number, visibleEnd: number, pages: readonly LedgerPage[], newlyScannedSamples?: number): boolean;
|
|
135
|
+
prepare(source: LedgerSource, policy: LedgerPolicy, visibleFirst: number, visibleEnd: number): LedgerPlan | undefined;
|
|
136
|
+
complete(plan: LedgerPlan, changedPages: readonly LedgerPage[]): LedgerCompletedPlan;
|
|
137
|
+
validate(plan: LedgerPlan, requireComplete?: boolean): void;
|
|
138
|
+
lookupOld(key: string): LedgerEntry | undefined;
|
|
139
|
+
materialize(plan?: LedgerCompletedPlan): LedgerEntry[];
|
|
140
|
+
commit(plan: LedgerCompletedPlan, newlyScannedSamples: number): void;
|
|
141
|
+
clear(): void;
|
|
142
|
+
dispose(): void;
|
|
143
|
+
}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { SpecialtyChart, type SpecialtyOptions } from './specialty.js';
|
|
2
|
+
import { 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
|
+
import type { EventToken } from './core/events.js';
|
|
6
|
+
export type MapProjection = 'mercator' | 'equirectangular';
|
|
7
|
+
export type GeoPosition = readonly [number, number, ...number[]];
|
|
8
|
+
export interface GeoJSONPolygon {
|
|
9
|
+
type: 'Polygon';
|
|
10
|
+
coordinates: GeoPosition[][];
|
|
11
|
+
}
|
|
12
|
+
export interface GeoJSONMultiPolygon {
|
|
13
|
+
type: 'MultiPolygon';
|
|
14
|
+
coordinates: GeoPosition[][][];
|
|
15
|
+
}
|
|
16
|
+
export interface GeoJSONFeature {
|
|
17
|
+
type: 'Feature';
|
|
18
|
+
id?: string | number;
|
|
19
|
+
properties: Record<string, unknown> | null;
|
|
20
|
+
geometry: GeoJSONPolygon | GeoJSONMultiPolygon | null;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
}
|
|
23
|
+
export interface GeoJSONFeatureCollection {
|
|
24
|
+
type: 'FeatureCollection';
|
|
25
|
+
features: GeoJSONFeature[];
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
}
|
|
28
|
+
export type MapRegionKey = string | ((feature: GeoJSONFeature, index: number) => string | number);
|
|
29
|
+
export interface MapOptions extends SpecialtyOptions {
|
|
30
|
+
projection?: MapProjection;
|
|
31
|
+
regionKey?: MapRegionKey;
|
|
32
|
+
}
|
|
33
|
+
export interface MapBounds {
|
|
34
|
+
minX: number;
|
|
35
|
+
maxX: number;
|
|
36
|
+
minY: number;
|
|
37
|
+
maxY: number;
|
|
38
|
+
}
|
|
39
|
+
export interface ProjectedMapPolygon {
|
|
40
|
+
rings: UIPoint[][];
|
|
41
|
+
bounds: MapBounds;
|
|
42
|
+
path?: Path2D;
|
|
43
|
+
}
|
|
44
|
+
export interface MapView {
|
|
45
|
+
projection: MapProjection;
|
|
46
|
+
center: {
|
|
47
|
+
longitude: number;
|
|
48
|
+
latitude: number;
|
|
49
|
+
};
|
|
50
|
+
projectedCenter: UIPoint;
|
|
51
|
+
zoom: number;
|
|
52
|
+
}
|
|
53
|
+
export type MapPointInput = GeoPosition | {
|
|
54
|
+
longitude: number;
|
|
55
|
+
latitude: number;
|
|
56
|
+
[key: string]: unknown;
|
|
57
|
+
} | {
|
|
58
|
+
lon: number;
|
|
59
|
+
lat: number;
|
|
60
|
+
[key: string]: unknown;
|
|
61
|
+
} | {
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
[key: string]: unknown;
|
|
65
|
+
};
|
|
66
|
+
export interface MapRegionClick {
|
|
67
|
+
chart: MapChart;
|
|
68
|
+
key: string;
|
|
69
|
+
feature: GeoJSONFeature;
|
|
70
|
+
value?: number;
|
|
71
|
+
selected: boolean;
|
|
72
|
+
}
|
|
73
|
+
/** World width is one unit, with north at negative projected Y. Longitude may be unwrapped. */
|
|
74
|
+
export declare function projectMapPosition(position: GeoPosition, projection?: MapProjection): UIPoint;
|
|
75
|
+
export declare function unprojectMapPosition(point: UIPoint, projection?: MapProjection): [number, number];
|
|
76
|
+
/** Short edges across ±180° are unwrapped; holes follow their exterior's world copy. */
|
|
77
|
+
export declare function projectMapPolygon(rings: readonly (readonly GeoPosition[])[], projection?: MapProjection): ProjectedMapPolygon;
|
|
78
|
+
export declare function pointInMapRing(point: UIPoint, ring: readonly UIPoint[]): boolean;
|
|
79
|
+
/** Hole boundaries are excluded; exterior boundaries are included. Winding order is irrelevant. */
|
|
80
|
+
export declare function pointInMapPolygon(point: UIPoint, rings: readonly (readonly UIPoint[])[]): boolean;
|
|
81
|
+
interface MapSample {
|
|
82
|
+
position: [number, number];
|
|
83
|
+
source: MapPointInput;
|
|
84
|
+
index: number;
|
|
85
|
+
}
|
|
86
|
+
export declare class MapOverlay {
|
|
87
|
+
readonly chart: MapChart;
|
|
88
|
+
readonly kind: 'points' | 'line';
|
|
89
|
+
name: string;
|
|
90
|
+
visible: boolean;
|
|
91
|
+
disposed: boolean;
|
|
92
|
+
revision: number;
|
|
93
|
+
protected samples: MapSample[];
|
|
94
|
+
private projectedCache?;
|
|
95
|
+
fill: FillStyle;
|
|
96
|
+
stroke: LineStyle;
|
|
97
|
+
pointSize: number;
|
|
98
|
+
constructor(chart: MapChart, kind: 'points' | 'line');
|
|
99
|
+
private assertAlive;
|
|
100
|
+
add(points: readonly MapPointInput[]): this;
|
|
101
|
+
addPoints(points: readonly MapPointInput[]): this;
|
|
102
|
+
setData(points: readonly MapPointInput[]): this;
|
|
103
|
+
clear(): this;
|
|
104
|
+
getPoints(): MapPointInput[];
|
|
105
|
+
getSampleCount(): number;
|
|
106
|
+
setName(value: string): this;
|
|
107
|
+
getName(): string;
|
|
108
|
+
setVisible(value: boolean): this;
|
|
109
|
+
getVisible(): boolean;
|
|
110
|
+
setPointSize(value: number): this;
|
|
111
|
+
setPointFillStyle(value: ValueOrMutator<FillStyle>): this;
|
|
112
|
+
setFillStyle(value: ValueOrMutator<FillStyle>): this;
|
|
113
|
+
getFillStyle(): FillStyle;
|
|
114
|
+
setStrokeStyle(value: ValueOrMutator<LineStyle>): this;
|
|
115
|
+
getStrokeStyle(): LineStyle;
|
|
116
|
+
/** Internal cached projected storage; original samples remain in geographic coordinates. */
|
|
117
|
+
projected(projection: MapProjection): {
|
|
118
|
+
samples: readonly MapSample[];
|
|
119
|
+
points: readonly UIPoint[];
|
|
120
|
+
};
|
|
121
|
+
dispose(): this;
|
|
122
|
+
isDisposed(): boolean;
|
|
123
|
+
}
|
|
124
|
+
export declare class MapPointSeries extends MapOverlay {
|
|
125
|
+
constructor(chart: MapChart);
|
|
126
|
+
}
|
|
127
|
+
export declare class MapLineSeries extends MapOverlay {
|
|
128
|
+
constructor(chart: MapChart);
|
|
129
|
+
}
|
|
130
|
+
export declare class MapChart extends SpecialtyChart {
|
|
131
|
+
private projection;
|
|
132
|
+
private regionKey?;
|
|
133
|
+
private geoJSON;
|
|
134
|
+
private regions;
|
|
135
|
+
private values;
|
|
136
|
+
private palette?;
|
|
137
|
+
private regionFill;
|
|
138
|
+
private regionStroke;
|
|
139
|
+
private tooltipFormatter;
|
|
140
|
+
private center;
|
|
141
|
+
private zoom;
|
|
142
|
+
private fitBounds;
|
|
143
|
+
private lastDrag?;
|
|
144
|
+
private dragOrigin?;
|
|
145
|
+
private dragMoved;
|
|
146
|
+
private selectedRegion?;
|
|
147
|
+
private readonly overlays;
|
|
148
|
+
private readonly mapCleanup;
|
|
149
|
+
constructor(options?: MapOptions);
|
|
150
|
+
private worldBounds;
|
|
151
|
+
private prepare;
|
|
152
|
+
setGeoJSON(data: GeoJSONFeatureCollection, options?: {
|
|
153
|
+
key?: MapRegionKey;
|
|
154
|
+
fit?: boolean;
|
|
155
|
+
}): this;
|
|
156
|
+
getGeoJSON(): GeoJSONFeatureCollection;
|
|
157
|
+
setRegionKey(key: MapRegionKey): this;
|
|
158
|
+
getRegionCount(): number;
|
|
159
|
+
/** Public geographic picking, independent of the previous rendered hit list. */
|
|
160
|
+
getRegionAt(point: UIPoint): {
|
|
161
|
+
key: string;
|
|
162
|
+
feature: GeoJSONFeature;
|
|
163
|
+
value?: number;
|
|
164
|
+
} | undefined;
|
|
165
|
+
getPlotRect(): Rect;
|
|
166
|
+
getRegions(): Array<{
|
|
167
|
+
key: string;
|
|
168
|
+
name: string;
|
|
169
|
+
value?: number;
|
|
170
|
+
selected: boolean;
|
|
171
|
+
}>;
|
|
172
|
+
getRegionValue(key: string | number): number | undefined;
|
|
173
|
+
setRegionValues(input: ReadonlyMap<string | number, number | null> | Record<string, number | null>, lut?: LUT): this;
|
|
174
|
+
setRegionFillStyle(value: ValueOrMutator<FillStyle>): this;
|
|
175
|
+
setRegionStrokeStyle(value: ValueOrMutator<LineStyle>): this;
|
|
176
|
+
setTooltipFormatter(value: (feature: GeoJSONFeature, value: number | undefined, key: string) => string): this;
|
|
177
|
+
onRegionClick(listener: (event: MapRegionClick) => void): EventToken;
|
|
178
|
+
getSelectedRegion(): string | undefined;
|
|
179
|
+
setSelectedRegion(key: string | number | undefined): this;
|
|
180
|
+
getProjection(): MapProjection;
|
|
181
|
+
setProjection(projection: MapProjection): this;
|
|
182
|
+
private scale;
|
|
183
|
+
private changedView;
|
|
184
|
+
fit(): this;
|
|
185
|
+
getView(): MapView;
|
|
186
|
+
/** Fit an explicit geographic extent. A west > east interval crosses the date line. */
|
|
187
|
+
setViewBounds(bounds: {
|
|
188
|
+
west: number;
|
|
189
|
+
south: number;
|
|
190
|
+
east: number;
|
|
191
|
+
north: number;
|
|
192
|
+
}): this;
|
|
193
|
+
setView(view: {
|
|
194
|
+
center?: GeoPosition;
|
|
195
|
+
zoom?: number;
|
|
196
|
+
}): this;
|
|
197
|
+
private screenToWorld;
|
|
198
|
+
private worldToScreen;
|
|
199
|
+
positionToScreen(position: GeoPosition): UIPoint;
|
|
200
|
+
screenToPosition(point: UIPoint): [number, number];
|
|
201
|
+
zoomAt(point: UIPoint, factor: number): this;
|
|
202
|
+
panBy(dx: number, dy: number): this;
|
|
203
|
+
protected dragAt(point: UIPoint): void;
|
|
204
|
+
protected wheel(delta: number): boolean;
|
|
205
|
+
protected key(key: string): boolean;
|
|
206
|
+
activateAt(point: UIPoint): any;
|
|
207
|
+
addPointSeries(): MapPointSeries;
|
|
208
|
+
addLineSeries(): MapLineSeries;
|
|
209
|
+
addPoints(data: readonly MapPointInput[]): MapPointSeries;
|
|
210
|
+
addLine(data: readonly MapPointInput[]): MapLineSeries;
|
|
211
|
+
removeOverlay(series: MapOverlay): void;
|
|
212
|
+
getSeries(): MapOverlay[];
|
|
213
|
+
private worldCopies;
|
|
214
|
+
private path;
|
|
215
|
+
protected renderPlot(ctx: CanvasRenderingContext2D, rect: Rect): void;
|
|
216
|
+
private drawOverlay;
|
|
217
|
+
dispose(): this;
|
|
218
|
+
}
|
|
219
|
+
export {};
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import { Color, type ColorShadingStyle, type FillStyle, type LineStyle, type ValueOrMutator } from './core/styles.js';
|
|
2
|
+
import { EventHub, type EventToken } from './core/events.js';
|
|
3
|
+
import type { RenderHost, Interval } from './contracts.js';
|
|
4
|
+
import type { DrawPacket3D } from './render3d.js';
|
|
5
|
+
import { type Vec3 } from './world-camera.js';
|
|
6
|
+
export type Normalize3D = (value: number, dimension: 0 | 1 | 2) => number;
|
|
7
|
+
export interface MeshOptions3D {
|
|
8
|
+
axisX?: any;
|
|
9
|
+
axisY?: any;
|
|
10
|
+
axisZ?: any;
|
|
11
|
+
fillStyle?: FillStyle;
|
|
12
|
+
wireframeStyle?: LineStyle;
|
|
13
|
+
lighting?: boolean;
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}
|
|
16
|
+
export interface MeshGeometry3D {
|
|
17
|
+
positions: ArrayLike<number>;
|
|
18
|
+
indices?: ArrayLike<number>;
|
|
19
|
+
colors?: ArrayLike<number>;
|
|
20
|
+
values?: ArrayLike<number>;
|
|
21
|
+
}
|
|
22
|
+
export interface MeshVertex3D {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
z: number;
|
|
26
|
+
value?: number;
|
|
27
|
+
color?: Color;
|
|
28
|
+
}
|
|
29
|
+
export interface ModelGeometry3D {
|
|
30
|
+
vertices: ArrayLike<number>;
|
|
31
|
+
indices?: ArrayLike<number>;
|
|
32
|
+
normals?: ArrayLike<number>;
|
|
33
|
+
}
|
|
34
|
+
export type CullMode3D = 'disabled' | 'cull-back' | 'cull-front';
|
|
35
|
+
type DirtyRange = {
|
|
36
|
+
start: number;
|
|
37
|
+
count: number;
|
|
38
|
+
};
|
|
39
|
+
/** Area-weighted vertex normals. Invalid and degenerate triangles contribute nothing. */
|
|
40
|
+
export declare function meshNormals(positions: Float32Array, indices: Uint32Array): Float32Array;
|
|
41
|
+
export declare abstract class Series3DBase {
|
|
42
|
+
readonly chart: RenderHost;
|
|
43
|
+
readonly id: number;
|
|
44
|
+
readonly events: EventHub;
|
|
45
|
+
readonly axisX: any;
|
|
46
|
+
readonly axisY: any;
|
|
47
|
+
readonly axisZ: any;
|
|
48
|
+
visible: boolean;
|
|
49
|
+
disposed: boolean;
|
|
50
|
+
revision: number;
|
|
51
|
+
name: string;
|
|
52
|
+
lighting: boolean;
|
|
53
|
+
fill: FillStyle;
|
|
54
|
+
wireframe: LineStyle;
|
|
55
|
+
mouseInteractions: boolean;
|
|
56
|
+
cursorEnabled: boolean;
|
|
57
|
+
protected packetRevision: number;
|
|
58
|
+
private colorShadingStyle?;
|
|
59
|
+
private depthTestEnabled;
|
|
60
|
+
private backfaceCullingMode;
|
|
61
|
+
private highlightOnHover;
|
|
62
|
+
constructor(chart: RenderHost, options?: MeshOptions3D);
|
|
63
|
+
protected assertAlive(): void;
|
|
64
|
+
protected changed(): void;
|
|
65
|
+
setName(value: string): this;
|
|
66
|
+
getName(): string;
|
|
67
|
+
setVisible(value: boolean): this;
|
|
68
|
+
getVisible(): boolean;
|
|
69
|
+
setFillStyle(value: ValueOrMutator<FillStyle>): this;
|
|
70
|
+
getFillStyle(): FillStyle;
|
|
71
|
+
setWireframeStyle(value: ValueOrMutator<LineStyle>): this;
|
|
72
|
+
getWireframeStyle(): LineStyle;
|
|
73
|
+
setLighting(value: boolean): this;
|
|
74
|
+
setColorShadingStyle(value: ColorShadingStyle): this;
|
|
75
|
+
getColorShadingStyle(): ColorShadingStyle | undefined;
|
|
76
|
+
setDepthTestEnabled(value: boolean): this;
|
|
77
|
+
getDepthTestEnabled(): boolean;
|
|
78
|
+
setBackfaceCullingMode(value: CullMode3D): this;
|
|
79
|
+
getBackfaceCullingMode(): CullMode3D;
|
|
80
|
+
setHighlightOnHover(value: boolean): this;
|
|
81
|
+
getHighlightOnHover(): boolean;
|
|
82
|
+
protected renderingState(): Pick<DrawPacket3D, 'unshaded' | 'depthTestEnabled' | 'backfaceCullingMode'>;
|
|
83
|
+
setMouseInteractions(value: boolean): this;
|
|
84
|
+
setMouseInteractionsEnabled(value: boolean): this;
|
|
85
|
+
getAxisX(): any;
|
|
86
|
+
getAxisY(): any;
|
|
87
|
+
getAxisZ(): any;
|
|
88
|
+
getXMin(): number | undefined;
|
|
89
|
+
getXMax(): number | undefined;
|
|
90
|
+
getYMin(): number | undefined;
|
|
91
|
+
getYMax(): number | undefined;
|
|
92
|
+
getZMin(): number | undefined;
|
|
93
|
+
getZMax(): number | undefined;
|
|
94
|
+
setCursorEnabled(value: boolean): this;
|
|
95
|
+
getCursorEnabled(): boolean;
|
|
96
|
+
on(type: string, listener: (...args: any[]) => void): EventToken;
|
|
97
|
+
off(token: EventToken): boolean;
|
|
98
|
+
protected invalidateStyle(): void;
|
|
99
|
+
abstract readonly kind: string;
|
|
100
|
+
abstract getSampleCount(): number;
|
|
101
|
+
abstract bounds(dimension: 'x' | 'y' | 'z'): Interval | undefined;
|
|
102
|
+
abstract getDrawPackets(normalize: Normalize3D, axisKey: string): DrawPacket3D[];
|
|
103
|
+
dispose(): this;
|
|
104
|
+
isDisposed(): boolean;
|
|
105
|
+
}
|
|
106
|
+
/** Indexed geometry retains source coordinates; only renderer packets are normalized. */
|
|
107
|
+
export declare class MeshSeries3D extends Series3DBase {
|
|
108
|
+
readonly kind: string;
|
|
109
|
+
protected vertices: Float64Array<ArrayBuffer>;
|
|
110
|
+
protected indices: Uint32Array<ArrayBuffer>;
|
|
111
|
+
protected scalarValues?: Float32Array;
|
|
112
|
+
protected vertexColors?: Float32Array;
|
|
113
|
+
protected topologyRevision: number;
|
|
114
|
+
protected geometryRevision: number;
|
|
115
|
+
protected dirty: DirtyRange[];
|
|
116
|
+
protected styleDirty: boolean;
|
|
117
|
+
private compiled?;
|
|
118
|
+
private boundsCache?;
|
|
119
|
+
setGeometry(input: MeshGeometry3D): this;
|
|
120
|
+
setData(input: MeshGeometry3D | readonly MeshVertex3D[]): this;
|
|
121
|
+
getGeometry(): {
|
|
122
|
+
positions: Float64Array;
|
|
123
|
+
indices: Uint32Array;
|
|
124
|
+
values?: Float32Array;
|
|
125
|
+
colors?: Float32Array;
|
|
126
|
+
};
|
|
127
|
+
invalidateVertexPositions(values: ArrayLike<number>): this;
|
|
128
|
+
invalidateValues(values: ArrayLike<number>): this;
|
|
129
|
+
invalidateVertexColors(values: ArrayLike<number> | undefined): this;
|
|
130
|
+
clear(): this;
|
|
131
|
+
getSampleCount(): number;
|
|
132
|
+
getTriangleCount(): number;
|
|
133
|
+
protected invalidateStyle(): void;
|
|
134
|
+
protected markGeometry(ranges: DirtyRange[]): void;
|
|
135
|
+
protected updateNormals(positions: Float32Array, _previous: Float32Array | undefined, _ranges: readonly DirtyRange[]): {
|
|
136
|
+
values: Float32Array;
|
|
137
|
+
ranges?: DirtyRange[];
|
|
138
|
+
};
|
|
139
|
+
protected colorAt(index: number): Color;
|
|
140
|
+
protected normalizedVertex(index: number, normalize: Normalize3D): Vec3;
|
|
141
|
+
bounds(dimension: 'x' | 'y' | 'z'): Interval | undefined;
|
|
142
|
+
getDrawPackets(normalize: Normalize3D, axisKey: string): DrawPacket3D[];
|
|
143
|
+
dispose(): this;
|
|
144
|
+
}
|
|
145
|
+
export interface SurfaceGridOptions3D extends MeshOptions3D {
|
|
146
|
+
columns?: number;
|
|
147
|
+
rows?: number;
|
|
148
|
+
start?: {
|
|
149
|
+
x: number;
|
|
150
|
+
z: number;
|
|
151
|
+
};
|
|
152
|
+
step?: {
|
|
153
|
+
x: number;
|
|
154
|
+
z: number;
|
|
155
|
+
};
|
|
156
|
+
transposeXZ?: boolean;
|
|
157
|
+
}
|
|
158
|
+
export type GridPatch3D = {
|
|
159
|
+
iColumn?: number;
|
|
160
|
+
iRow?: number;
|
|
161
|
+
values: readonly ArrayLike<number>[];
|
|
162
|
+
};
|
|
163
|
+
export declare class SurfaceGrid3D extends MeshSeries3D {
|
|
164
|
+
readonly kind: string;
|
|
165
|
+
readonly columns: number;
|
|
166
|
+
readonly rows: number;
|
|
167
|
+
readonly values: Float32Array;
|
|
168
|
+
readonly transposeXZ: boolean;
|
|
169
|
+
start: {
|
|
170
|
+
x: number;
|
|
171
|
+
z: number;
|
|
172
|
+
};
|
|
173
|
+
step: {
|
|
174
|
+
x: number;
|
|
175
|
+
z: number;
|
|
176
|
+
};
|
|
177
|
+
private requestedStep;
|
|
178
|
+
private explicitEnd?;
|
|
179
|
+
constructor(chart: RenderHost, options?: SurfaceGridOptions3D);
|
|
180
|
+
private validateGridTransform;
|
|
181
|
+
private updateGrid;
|
|
182
|
+
invalidateHeightMap(input: ArrayLike<number> | readonly ArrayLike<number>[] | GridPatch3D): this;
|
|
183
|
+
invalidateIntensityValues(input: ArrayLike<number> | readonly ArrayLike<number>[] | GridPatch3D): this;
|
|
184
|
+
clear(): this;
|
|
185
|
+
setStart(value: {
|
|
186
|
+
x: number;
|
|
187
|
+
z: number;
|
|
188
|
+
} | undefined): this;
|
|
189
|
+
getStart(): {
|
|
190
|
+
x: number;
|
|
191
|
+
z: number;
|
|
192
|
+
};
|
|
193
|
+
setStep(value: {
|
|
194
|
+
x: number;
|
|
195
|
+
z: number;
|
|
196
|
+
} | undefined): this;
|
|
197
|
+
getStep(): {
|
|
198
|
+
x: number;
|
|
199
|
+
z: number;
|
|
200
|
+
};
|
|
201
|
+
setEnd(value: {
|
|
202
|
+
x: number;
|
|
203
|
+
z: number;
|
|
204
|
+
} | undefined): this;
|
|
205
|
+
getEnd(): {
|
|
206
|
+
x: number;
|
|
207
|
+
z: number;
|
|
208
|
+
};
|
|
209
|
+
private resolveTransform;
|
|
210
|
+
/** @internal Native chart cursor queries retained nodes without copying the mesh. */
|
|
211
|
+
solveNearest3D(from: {
|
|
212
|
+
clientX: number;
|
|
213
|
+
clientY: number;
|
|
214
|
+
}): any;
|
|
215
|
+
private updateCoordinates;
|
|
216
|
+
/** Append complete rows while preserving a bounded, chronologically ordered surface. */
|
|
217
|
+
addRows(input: readonly ArrayLike<number>[]): this;
|
|
218
|
+
protected updateNormals(positions: Float32Array, previous: Float32Array | undefined, ranges: readonly DirtyRange[]): {
|
|
219
|
+
values: Float32Array;
|
|
220
|
+
ranges?: DirtyRange[];
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
export interface BoxInput3D {
|
|
224
|
+
x?: number;
|
|
225
|
+
y?: number;
|
|
226
|
+
z?: number;
|
|
227
|
+
width?: number;
|
|
228
|
+
height?: number;
|
|
229
|
+
depth?: number;
|
|
230
|
+
xCenter?: number;
|
|
231
|
+
yCenter?: number;
|
|
232
|
+
zCenter?: number;
|
|
233
|
+
xSize?: number;
|
|
234
|
+
ySize?: number;
|
|
235
|
+
zSize?: number;
|
|
236
|
+
value?: number;
|
|
237
|
+
color?: Color;
|
|
238
|
+
}
|
|
239
|
+
export interface BoxOptions3D extends MeshOptions3D {
|
|
240
|
+
roundedEdges?: boolean | number;
|
|
241
|
+
maxSampleCount?: number;
|
|
242
|
+
}
|
|
243
|
+
export declare class BoxSeries3D extends Series3DBase {
|
|
244
|
+
readonly kind = "boxes3d";
|
|
245
|
+
private readonly data;
|
|
246
|
+
private roundness;
|
|
247
|
+
private compiled?;
|
|
248
|
+
constructor(chart: RenderHost, options?: BoxOptions3D);
|
|
249
|
+
private prepare;
|
|
250
|
+
add(input: readonly BoxInput3D[]): this;
|
|
251
|
+
addBoxes(input: readonly BoxInput3D[]): this;
|
|
252
|
+
setData(input: readonly BoxInput3D[]): this;
|
|
253
|
+
clear(): this;
|
|
254
|
+
setMaxSampleCount(value: number | undefined): this;
|
|
255
|
+
getMaxSampleCount(): number | undefined;
|
|
256
|
+
getSampleCount(): number;
|
|
257
|
+
setRoundedEdges(value: boolean | number): this;
|
|
258
|
+
getRoundedEdges(): number;
|
|
259
|
+
bounds(dimension: 'x' | 'y' | 'z'): Interval | undefined;
|
|
260
|
+
getDrawPackets(normalize: Normalize3D, axisKey: string): DrawPacket3D[];
|
|
261
|
+
dispose(): this;
|
|
262
|
+
}
|
|
263
|
+
/** Irregular structured meshes and arbitrary indexed models share the original mesh model. */
|
|
264
|
+
export declare class SurfaceMesh3D extends MeshSeries3D {
|
|
265
|
+
readonly kind: string;
|
|
266
|
+
}
|
|
267
|
+
export declare class MeshModel3D extends MeshSeries3D {
|
|
268
|
+
readonly kind: string;
|
|
269
|
+
private modelCoordinates;
|
|
270
|
+
private modelScale;
|
|
271
|
+
private modelLocation;
|
|
272
|
+
private modelAlignment;
|
|
273
|
+
private modelContext?;
|
|
274
|
+
setModelGeometry(input: ModelGeometry3D): this;
|
|
275
|
+
setScale(value: number | Partial<Vec3>): this;
|
|
276
|
+
getScale(): Vec3;
|
|
277
|
+
setModelLocation(value: Vec3): this;
|
|
278
|
+
getModelLocation(): Vec3;
|
|
279
|
+
setModelAlignment(value: Vec3): this;
|
|
280
|
+
getModelAlignment(): Vec3;
|
|
281
|
+
private transformChanged;
|
|
282
|
+
private prepareModelContext;
|
|
283
|
+
private worldVertex;
|
|
284
|
+
protected normalizedVertex(index: number, normalize: Normalize3D): Vec3;
|
|
285
|
+
getDrawPackets(normalize: Normalize3D, axisKey: string): DrawPacket3D[];
|
|
286
|
+
bounds(dimension: 'x' | 'y' | 'z'): Interval | undefined;
|
|
287
|
+
dispose(): this;
|
|
288
|
+
}
|
|
289
|
+
/** Original incremental triangulation on XZ. Coincident locations retain the first finite sample. */
|
|
290
|
+
export declare function triangulateScatter3D(input: readonly MeshVertex3D[]): MeshGeometry3D;
|
|
291
|
+
export interface EllipsoidFit3D {
|
|
292
|
+
center: [number, number, number];
|
|
293
|
+
covariance: Float64Array;
|
|
294
|
+
eigenvalues: [number, number, number]; /** Column-major orthonormal basis. */
|
|
295
|
+
basis: Float64Array;
|
|
296
|
+
radii: [number, number, number];
|
|
297
|
+
sampleCount: number;
|
|
298
|
+
geometry: MeshGeometry3D;
|
|
299
|
+
}
|
|
300
|
+
/** Sample covariance and an original symmetric Jacobi eigensolver; the scale has no implicit probability claim. */
|
|
301
|
+
export declare function fitEllipsoid3D(input: readonly Pick<MeshVertex3D, 'x' | 'y' | 'z'>[], options?: {
|
|
302
|
+
standardDeviations?: number;
|
|
303
|
+
longitudeSegments?: number;
|
|
304
|
+
latitudeSegments?: number;
|
|
305
|
+
}): EllipsoidFit3D;
|
|
306
|
+
export {};
|