chartgpu 0.1.0
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 +21 -0
- package/README.md +62 -0
- package/dist/ChartGPU.d.ts +74 -0
- package/dist/ChartGPU.d.ts.map +1 -0
- package/dist/components/createDataZoomSlider.d.ts +14 -0
- package/dist/components/createDataZoomSlider.d.ts.map +1 -0
- package/dist/components/createLegend.d.ts +9 -0
- package/dist/components/createLegend.d.ts.map +1 -0
- package/dist/components/createTextOverlay.d.ts +17 -0
- package/dist/components/createTextOverlay.d.ts.map +1 -0
- package/dist/components/createTooltip.d.ts +12 -0
- package/dist/components/createTooltip.d.ts.map +1 -0
- package/dist/components/formatTooltip.d.ts +12 -0
- package/dist/components/formatTooltip.d.ts.map +1 -0
- package/dist/config/OptionResolver.d.ts +97 -0
- package/dist/config/OptionResolver.d.ts.map +1 -0
- package/dist/config/defaults.d.ts +33 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/types.d.ts +224 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/core/GPUContext.d.ts +210 -0
- package/dist/core/GPUContext.d.ts.map +1 -0
- package/dist/core/RenderScheduler.d.ts +132 -0
- package/dist/core/RenderScheduler.d.ts.map +1 -0
- package/dist/core/createAnimationController.d.ts +15 -0
- package/dist/core/createAnimationController.d.ts.map +1 -0
- package/dist/core/createRenderCoordinator.d.ts +71 -0
- package/dist/core/createRenderCoordinator.d.ts.map +1 -0
- package/dist/data/createDataStore.d.ts +33 -0
- package/dist/data/createDataStore.d.ts.map +1 -0
- package/dist/data/createStreamBuffer.d.ts +20 -0
- package/dist/data/createStreamBuffer.d.ts.map +1 -0
- package/dist/data/lttbSample.d.ts +5 -0
- package/dist/data/lttbSample.d.ts.map +1 -0
- package/dist/data/sampleSeries.d.ts +3 -0
- package/dist/data/sampleSeries.d.ts.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5977 -0
- package/dist/index.js.map +1 -0
- package/dist/interaction/createChartSync.d.ts +12 -0
- package/dist/interaction/createChartSync.d.ts.map +1 -0
- package/dist/interaction/createEventManager.d.ts +24 -0
- package/dist/interaction/createEventManager.d.ts.map +1 -0
- package/dist/interaction/createHoverState.d.ts +20 -0
- package/dist/interaction/createHoverState.d.ts.map +1 -0
- package/dist/interaction/createInsideZoom.d.ts +14 -0
- package/dist/interaction/createInsideZoom.d.ts.map +1 -0
- package/dist/interaction/createZoomState.d.ts +37 -0
- package/dist/interaction/createZoomState.d.ts.map +1 -0
- package/dist/interaction/findNearestPoint.d.ts +61 -0
- package/dist/interaction/findNearestPoint.d.ts.map +1 -0
- package/dist/interaction/findPieSlice.d.ts +36 -0
- package/dist/interaction/findPieSlice.d.ts.map +1 -0
- package/dist/interaction/findPointsAtX.d.ts +37 -0
- package/dist/interaction/findPointsAtX.d.ts.map +1 -0
- package/dist/renderers/createAreaRenderer.d.ts +18 -0
- package/dist/renderers/createAreaRenderer.d.ts.map +1 -0
- package/dist/renderers/createAxisRenderer.d.ts +19 -0
- package/dist/renderers/createAxisRenderer.d.ts.map +1 -0
- package/dist/renderers/createBarRenderer.d.ts +20 -0
- package/dist/renderers/createBarRenderer.d.ts.map +1 -0
- package/dist/renderers/createCrosshairRenderer.d.ts +43 -0
- package/dist/renderers/createCrosshairRenderer.d.ts.map +1 -0
- package/dist/renderers/createGridRenderer.d.ts +44 -0
- package/dist/renderers/createGridRenderer.d.ts.map +1 -0
- package/dist/renderers/createHighlightRenderer.d.ts +39 -0
- package/dist/renderers/createHighlightRenderer.d.ts.map +1 -0
- package/dist/renderers/createLineRenderer.d.ts +18 -0
- package/dist/renderers/createLineRenderer.d.ts.map +1 -0
- package/dist/renderers/createPieRenderer.d.ts +18 -0
- package/dist/renderers/createPieRenderer.d.ts.map +1 -0
- package/dist/renderers/createScatterRenderer.d.ts +19 -0
- package/dist/renderers/createScatterRenderer.d.ts.map +1 -0
- package/dist/renderers/rendererUtils.d.ts +100 -0
- package/dist/renderers/rendererUtils.d.ts.map +1 -0
- package/dist/themes/darkTheme.d.ts +11 -0
- package/dist/themes/darkTheme.d.ts.map +1 -0
- package/dist/themes/index.d.ts +8 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/lightTheme.d.ts +11 -0
- package/dist/themes/lightTheme.d.ts.map +1 -0
- package/dist/themes/types.d.ts +14 -0
- package/dist/themes/types.d.ts.map +1 -0
- package/dist/utils/checkWebGPU.d.ts +39 -0
- package/dist/utils/checkWebGPU.d.ts.map +1 -0
- package/dist/utils/colors.d.ts +14 -0
- package/dist/utils/colors.d.ts.map +1 -0
- package/dist/utils/easing.d.ts +9 -0
- package/dist/utils/easing.d.ts.map +1 -0
- package/dist/utils/scales.d.ts +79 -0
- package/dist/utils/scales.d.ts.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GPUContext - WebGPU device and adapter management
|
|
3
|
+
*
|
|
4
|
+
* Handles WebGPU initialization, adapter selection, and device creation
|
|
5
|
+
* following WebGPU best practices for resource management and error handling.
|
|
6
|
+
*
|
|
7
|
+
* This module provides both functional and class-based APIs for maximum flexibility.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Represents the state of a GPU context.
|
|
11
|
+
* All properties are readonly to ensure immutability.
|
|
12
|
+
*/
|
|
13
|
+
export interface GPUContextState {
|
|
14
|
+
readonly adapter: GPUAdapter | null;
|
|
15
|
+
readonly device: GPUDevice | null;
|
|
16
|
+
readonly initialized: boolean;
|
|
17
|
+
readonly canvas: HTMLCanvasElement | null;
|
|
18
|
+
readonly canvasContext: GPUCanvasContext | null;
|
|
19
|
+
readonly preferredFormat: GPUTextureFormat | null;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Creates a new GPUContext state with initial values.
|
|
23
|
+
*
|
|
24
|
+
* @param canvas - Optional HTMLCanvasElement to configure for WebGPU rendering
|
|
25
|
+
* @returns A new GPUContextState instance
|
|
26
|
+
*/
|
|
27
|
+
export declare function createGPUContext(canvas?: HTMLCanvasElement): GPUContextState;
|
|
28
|
+
/**
|
|
29
|
+
* Initializes the WebGPU context by requesting an adapter and device.
|
|
30
|
+
* Returns a new state object with initialized values.
|
|
31
|
+
*
|
|
32
|
+
* @param context - The GPU context state to initialize
|
|
33
|
+
* @returns A new GPUContextState with initialized adapter and device
|
|
34
|
+
* @throws {Error} If WebGPU is not available in the browser
|
|
35
|
+
* @throws {Error} If adapter request fails
|
|
36
|
+
* @throws {Error} If device request fails
|
|
37
|
+
* @throws {Error} If already initialized
|
|
38
|
+
*/
|
|
39
|
+
export declare function initializeGPUContext(context: GPUContextState): Promise<GPUContextState>;
|
|
40
|
+
/**
|
|
41
|
+
* Gets the current texture from the canvas context.
|
|
42
|
+
*
|
|
43
|
+
* @param context - The GPU context state
|
|
44
|
+
* @returns The current canvas texture
|
|
45
|
+
* @throws {Error} If canvas is not configured or context is not initialized
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* const texture = getCanvasTexture(context);
|
|
50
|
+
* // Use texture in render pass
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare function getCanvasTexture(context: GPUContextState): GPUTexture;
|
|
54
|
+
/**
|
|
55
|
+
* Clears the canvas to a solid color.
|
|
56
|
+
* Creates a command encoder, begins a render pass with the specified clear color,
|
|
57
|
+
* ends the pass, and submits it to the queue.
|
|
58
|
+
*
|
|
59
|
+
* @param context - The GPU context state
|
|
60
|
+
* @param r - Red component (0.0 to 1.0)
|
|
61
|
+
* @param g - Green component (0.0 to 1.0)
|
|
62
|
+
* @param b - Blue component (0.0 to 1.0)
|
|
63
|
+
* @param a - Alpha component (0.0 to 1.0)
|
|
64
|
+
* @throws {Error} If canvas is not configured or context is not initialized
|
|
65
|
+
* @throws {Error} If device is not available
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* // Clear to dark purple (#1a1a2e)
|
|
70
|
+
* clearScreen(context, 0x1a / 255, 0x1a / 255, 0x2e / 255, 1.0);
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare function clearScreen(context: GPUContextState, r: number, g: number, b: number, a: number): void;
|
|
74
|
+
/**
|
|
75
|
+
* Destroys the WebGPU device and cleans up resources.
|
|
76
|
+
* Returns a new state object with reset values.
|
|
77
|
+
* After calling this, the context must be reinitialized before use.
|
|
78
|
+
*
|
|
79
|
+
* @param context - The GPU context state to destroy
|
|
80
|
+
* @returns A new GPUContextState with reset values
|
|
81
|
+
*/
|
|
82
|
+
export declare function destroyGPUContext(context: GPUContextState): GPUContextState;
|
|
83
|
+
/**
|
|
84
|
+
* Convenience function that creates and initializes a GPU context in one step.
|
|
85
|
+
*
|
|
86
|
+
* @param canvas - Optional HTMLCanvasElement to configure for WebGPU rendering
|
|
87
|
+
* @returns A fully initialized GPUContextState
|
|
88
|
+
* @throws {Error} If initialization fails
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```typescript
|
|
92
|
+
* const context = await createGPUContextAsync();
|
|
93
|
+
* const device = context.device;
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```typescript
|
|
98
|
+
* const canvas = document.querySelector('canvas');
|
|
99
|
+
* const context = await createGPUContextAsync(canvas);
|
|
100
|
+
* const texture = getCanvasTexture(context);
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
export declare function createGPUContextAsync(canvas?: HTMLCanvasElement): Promise<GPUContextState>;
|
|
104
|
+
/**
|
|
105
|
+
* GPUContext class wrapper for backward compatibility.
|
|
106
|
+
*
|
|
107
|
+
* This class provides a class-based API that internally uses the functional implementation.
|
|
108
|
+
* Use the functional API directly for better type safety and immutability.
|
|
109
|
+
*/
|
|
110
|
+
export declare class GPUContext {
|
|
111
|
+
private _state;
|
|
112
|
+
/**
|
|
113
|
+
* Gets the WebGPU adapter, or null if not initialized.
|
|
114
|
+
*/
|
|
115
|
+
get adapter(): GPUAdapter | null;
|
|
116
|
+
/**
|
|
117
|
+
* Gets the WebGPU device, or null if not initialized.
|
|
118
|
+
*/
|
|
119
|
+
get device(): GPUDevice | null;
|
|
120
|
+
/**
|
|
121
|
+
* Checks if the context has been initialized.
|
|
122
|
+
*/
|
|
123
|
+
get initialized(): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Gets the canvas element, or null if not provided.
|
|
126
|
+
*/
|
|
127
|
+
get canvas(): HTMLCanvasElement | null;
|
|
128
|
+
/**
|
|
129
|
+
* Gets the WebGPU canvas context, or null if canvas is not configured.
|
|
130
|
+
*/
|
|
131
|
+
get canvasContext(): GPUCanvasContext | null;
|
|
132
|
+
/**
|
|
133
|
+
* Gets the preferred canvas format, or null if canvas is not configured.
|
|
134
|
+
*/
|
|
135
|
+
get preferredFormat(): GPUTextureFormat | null;
|
|
136
|
+
/**
|
|
137
|
+
* Creates a new GPUContext instance.
|
|
138
|
+
*
|
|
139
|
+
* @param canvas - Optional HTMLCanvasElement to configure for WebGPU rendering
|
|
140
|
+
*/
|
|
141
|
+
constructor(canvas?: HTMLCanvasElement);
|
|
142
|
+
/**
|
|
143
|
+
* Initializes the WebGPU context by requesting an adapter and device.
|
|
144
|
+
*
|
|
145
|
+
* @throws {Error} If WebGPU is not available in the browser
|
|
146
|
+
* @throws {Error} If adapter request fails
|
|
147
|
+
* @throws {Error} If device request fails
|
|
148
|
+
* @throws {Error} If already initialized
|
|
149
|
+
*/
|
|
150
|
+
initialize(): Promise<void>;
|
|
151
|
+
/**
|
|
152
|
+
* Static factory method to create and initialize a GPUContext instance.
|
|
153
|
+
*
|
|
154
|
+
* @param canvas - Optional HTMLCanvasElement to configure for WebGPU rendering
|
|
155
|
+
* @returns A fully initialized GPUContext instance
|
|
156
|
+
* @throws {Error} If initialization fails
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```typescript
|
|
160
|
+
* const context = await GPUContext.create();
|
|
161
|
+
* const device = context.device;
|
|
162
|
+
* ```
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* ```typescript
|
|
166
|
+
* const canvas = document.querySelector('canvas');
|
|
167
|
+
* const context = await GPUContext.create(canvas);
|
|
168
|
+
* const texture = context.getCanvasTexture();
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
static create(canvas?: HTMLCanvasElement): Promise<GPUContext>;
|
|
172
|
+
/**
|
|
173
|
+
* Gets the current texture from the canvas context.
|
|
174
|
+
*
|
|
175
|
+
* @returns The current canvas texture
|
|
176
|
+
* @throws {Error} If canvas is not configured or context is not initialized
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```typescript
|
|
180
|
+
* const texture = context.getCanvasTexture();
|
|
181
|
+
* // Use texture in render pass
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
184
|
+
getCanvasTexture(): GPUTexture;
|
|
185
|
+
/**
|
|
186
|
+
* Clears the canvas to a solid color.
|
|
187
|
+
* Creates a command encoder, begins a render pass with the specified clear color,
|
|
188
|
+
* ends the pass, and submits it to the queue.
|
|
189
|
+
*
|
|
190
|
+
* @param r - Red component (0.0 to 1.0)
|
|
191
|
+
* @param g - Green component (0.0 to 1.0)
|
|
192
|
+
* @param b - Blue component (0.0 to 1.0)
|
|
193
|
+
* @param a - Alpha component (0.0 to 1.0)
|
|
194
|
+
* @throws {Error} If canvas is not configured or context is not initialized
|
|
195
|
+
* @throws {Error} If device is not available
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```typescript
|
|
199
|
+
* // Clear to dark purple (#1a1a2e)
|
|
200
|
+
* context.clearScreen(0x1a / 255, 0x1a / 255, 0x2e / 255, 1.0);
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
203
|
+
clearScreen(r: number, g: number, b: number, a: number): void;
|
|
204
|
+
/**
|
|
205
|
+
* Destroys the WebGPU device and cleans up resources.
|
|
206
|
+
* After calling destroy(), the context must be reinitialized before use.
|
|
207
|
+
*/
|
|
208
|
+
destroy(): void;
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=GPUContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GPUContext.d.ts","sourceRoot":"","sources":["../../src/core/GPUContext.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,aAAa,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAChD,QAAQ,CAAC,eAAe,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACnD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,iBAAiB,GAAG,eAAe,CAS5E;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,eAAe,CAAC,CAuG1B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,UAAU,CAUrE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,eAAe,EACxB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,GACR,IAAI,CAqCN;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,eAAe,GAAG,eAAe,CAiB3E;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,eAAe,CAAC,CAG1B;AAED;;;;;GAKG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAkB;IAEhC;;OAEG;IACH,IAAI,OAAO,IAAI,UAAU,GAAG,IAAI,CAE/B;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,SAAS,GAAG,IAAI,CAE7B;IAED;;OAEG;IACH,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,iBAAiB,GAAG,IAAI,CAErC;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,gBAAgB,GAAG,IAAI,CAE3C;IAED;;OAEG;IACH,IAAI,eAAe,IAAI,gBAAgB,GAAG,IAAI,CAE7C;IAED;;;;OAIG;gBACS,MAAM,CAAC,EAAE,iBAAiB;IAItC;;;;;;;OAOG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjC;;;;;;;;;;;;;;;;;;;OAmBG;WACU,MAAM,CAAC,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC;IAMpE;;;;;;;;;;;OAWG;IACH,gBAAgB,IAAI,UAAU;IAI9B;;;;;;;;;;;;;;;;;OAiBG;IACH,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAI7D;;;OAGG;IACH,OAAO,IAAI,IAAI;CAGhB"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RenderScheduler - 60fps render loop management
|
|
3
|
+
*
|
|
4
|
+
* Manages a requestAnimationFrame-based render loop that runs at 60fps,
|
|
5
|
+
* providing delta time tracking and frame scheduling control.
|
|
6
|
+
*
|
|
7
|
+
* This module provides both functional and class-based APIs for maximum flexibility.
|
|
8
|
+
* The functional API is preferred for better type safety and immutability.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Callback function type for render frames.
|
|
12
|
+
* Receives delta time in milliseconds since the last frame.
|
|
13
|
+
*/
|
|
14
|
+
export type RenderCallback = (deltaTime: number) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Represents the state of a render scheduler.
|
|
17
|
+
* All properties are readonly to ensure immutability.
|
|
18
|
+
*/
|
|
19
|
+
export interface RenderSchedulerState {
|
|
20
|
+
readonly id: symbol;
|
|
21
|
+
readonly running: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Creates a new RenderScheduler state with initial values.
|
|
25
|
+
*
|
|
26
|
+
* @returns A new RenderSchedulerState instance
|
|
27
|
+
*/
|
|
28
|
+
export declare function createRenderScheduler(): RenderSchedulerState;
|
|
29
|
+
/**
|
|
30
|
+
* Starts the render loop.
|
|
31
|
+
*
|
|
32
|
+
* Begins a requestAnimationFrame loop that calls the provided callback
|
|
33
|
+
* every frame with the delta time in milliseconds since the last frame.
|
|
34
|
+
* Returns a new state object with running set to true.
|
|
35
|
+
*
|
|
36
|
+
* @param state - The scheduler state to start
|
|
37
|
+
* @param callback - Function to call each frame with delta time
|
|
38
|
+
* @returns A new RenderSchedulerState with running set to true
|
|
39
|
+
* @throws {Error} If callback is not provided
|
|
40
|
+
* @throws {Error} If scheduler is already running
|
|
41
|
+
* @throws {Error} If state is invalid
|
|
42
|
+
*/
|
|
43
|
+
export declare function startRenderScheduler(state: RenderSchedulerState, callback: RenderCallback): RenderSchedulerState;
|
|
44
|
+
/**
|
|
45
|
+
* Stops the render loop.
|
|
46
|
+
*
|
|
47
|
+
* Cancels any pending requestAnimationFrame calls and stops the loop.
|
|
48
|
+
* Returns a new state object with running set to false.
|
|
49
|
+
* The scheduler can be restarted by calling startRenderScheduler() again.
|
|
50
|
+
*
|
|
51
|
+
* @param state - The scheduler state to stop
|
|
52
|
+
* @returns A new RenderSchedulerState with running set to false
|
|
53
|
+
* @throws {Error} If state is invalid
|
|
54
|
+
*/
|
|
55
|
+
export declare function stopRenderScheduler(state: RenderSchedulerState): RenderSchedulerState;
|
|
56
|
+
/**
|
|
57
|
+
* Marks the current frame as dirty, indicating it needs to be rendered.
|
|
58
|
+
*
|
|
59
|
+
* This function is prepared for future optimization where frames can be
|
|
60
|
+
* skipped if nothing has changed. Currently, all frames render regardless
|
|
61
|
+
* of the dirty flag.
|
|
62
|
+
*
|
|
63
|
+
* @param state - The scheduler state
|
|
64
|
+
* @throws {Error} If state is invalid
|
|
65
|
+
*/
|
|
66
|
+
export declare function requestRender(state: RenderSchedulerState): void;
|
|
67
|
+
/**
|
|
68
|
+
* Destroys the render scheduler and cleans up resources.
|
|
69
|
+
* Stops the loop if running and removes internal state from the map.
|
|
70
|
+
* Returns a new state object with reset values.
|
|
71
|
+
* After calling this, the scheduler must be recreated before use.
|
|
72
|
+
*
|
|
73
|
+
* **Important:** Always call this function when done with a scheduler to prevent memory leaks.
|
|
74
|
+
* The internal state map will retain entries until explicitly destroyed.
|
|
75
|
+
*
|
|
76
|
+
* @param state - The scheduler state to destroy
|
|
77
|
+
* @returns A new RenderSchedulerState with reset values
|
|
78
|
+
*/
|
|
79
|
+
export declare function destroyRenderScheduler(state: RenderSchedulerState): RenderSchedulerState;
|
|
80
|
+
/**
|
|
81
|
+
* Convenience function that creates a scheduler and starts it in one step.
|
|
82
|
+
*
|
|
83
|
+
* @param callback - Function to call each frame with delta time
|
|
84
|
+
* @returns A RenderSchedulerState with the loop running
|
|
85
|
+
* @throws {Error} If callback is not provided
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* const scheduler = createRenderSchedulerAsync((deltaTime) => {
|
|
90
|
+
* renderFrame(deltaTime);
|
|
91
|
+
* });
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
export declare function createRenderSchedulerAsync(callback: RenderCallback): RenderSchedulerState;
|
|
95
|
+
/**
|
|
96
|
+
* RenderScheduler class wrapper for backward compatibility.
|
|
97
|
+
*
|
|
98
|
+
* This class provides a class-based API that internally uses the functional implementation.
|
|
99
|
+
* Use the functional API directly for better type safety and immutability.
|
|
100
|
+
*/
|
|
101
|
+
export declare class RenderScheduler {
|
|
102
|
+
private _state;
|
|
103
|
+
/**
|
|
104
|
+
* Checks if the scheduler is currently running.
|
|
105
|
+
*/
|
|
106
|
+
get running(): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Creates a new RenderScheduler instance.
|
|
109
|
+
*/
|
|
110
|
+
constructor();
|
|
111
|
+
/**
|
|
112
|
+
* Starts the render loop.
|
|
113
|
+
*
|
|
114
|
+
* @param callback - Function to call each frame with delta time
|
|
115
|
+
* @throws {Error} If callback is not provided or scheduler already running
|
|
116
|
+
*/
|
|
117
|
+
start(callback: RenderCallback): void;
|
|
118
|
+
/**
|
|
119
|
+
* Stops the render loop.
|
|
120
|
+
*/
|
|
121
|
+
stop(): void;
|
|
122
|
+
/**
|
|
123
|
+
* Marks the current frame as dirty, indicating it needs to be rendered.
|
|
124
|
+
*/
|
|
125
|
+
requestRender(): void;
|
|
126
|
+
/**
|
|
127
|
+
* Destroys the render scheduler and cleans up resources.
|
|
128
|
+
* After calling destroy(), the scheduler must be recreated before use.
|
|
129
|
+
*/
|
|
130
|
+
destroy(): void;
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=RenderScheduler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderScheduler.d.ts","sourceRoot":"","sources":["../../src/core/RenderScheduler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAmBD;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,oBAAoB,CAgB5D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,oBAAoB,EAC3B,QAAQ,EAAE,cAAc,GACvB,oBAAoB,CAyDtB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,oBAAoB,GAAG,oBAAoB,CAkBrF;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAQ/D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,oBAAoB,GAAG,oBAAoB,CAmBxF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,cAAc,GAAG,oBAAoB,CAGzF;AAED;;;;;GAKG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAuB;IAErC;;OAEG;IACH,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;OAEG;;IAKH;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAIrC;;OAEG;IACH,IAAI,IAAI,IAAI;IAIZ;;OAEG;IACH,aAAa,IAAI,IAAI;IAIrB;;;OAGG;IACH,OAAO,IAAI,IAAI;CAGhB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { EasingFunction } from '../utils/easing';
|
|
2
|
+
export type AnimationId = symbol;
|
|
3
|
+
export interface AnimationController {
|
|
4
|
+
animate(from: number, to: number, duration: number, easing: EasingFunction, onUpdate: (value: number) => void, onComplete?: () => void): AnimationId;
|
|
5
|
+
animate(from: ReadonlyArray<number>, to: ReadonlyArray<number>, duration: number, easing: EasingFunction, onUpdate: (value: ReadonlyArray<number>) => void, onComplete?: () => void): AnimationId;
|
|
6
|
+
cancel(animationId: AnimationId): void;
|
|
7
|
+
cancelAll(): void;
|
|
8
|
+
/**
|
|
9
|
+
* Progresses all active animations to `timestamp` (ms).
|
|
10
|
+
* Intended to be called once per frame by the caller (e.g. a render loop).
|
|
11
|
+
*/
|
|
12
|
+
update(timestamp: number): void;
|
|
13
|
+
}
|
|
14
|
+
export declare function createAnimationController(): AnimationController;
|
|
15
|
+
//# sourceMappingURL=createAnimationController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAnimationController.d.ts","sourceRoot":"","sources":["../../src/core/createAnimationController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC,MAAM,WAAW,mBAAmB;IAClC,OAAO,CACL,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,EACjC,UAAU,CAAC,EAAE,MAAM,IAAI,GACtB,WAAW,CAAC;IACf,OAAO,CACL,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,EAC3B,EAAE,EAAE,aAAa,CAAC,MAAM,CAAC,EACzB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,KAAK,IAAI,EAChD,UAAU,CAAC,EAAE,MAAM,IAAI,GACtB,WAAW,CAAC;IAEf,MAAM,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IACvC,SAAS,IAAI,IAAI,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAiCD,wBAAgB,yBAAyB,IAAI,mBAAmB,CAoH/D"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { ResolvedChartGPUOptions } from '../config/OptionResolver';
|
|
2
|
+
import type { DataPoint } from '../config/types';
|
|
3
|
+
export interface GPUContextLike {
|
|
4
|
+
readonly device: GPUDevice | null;
|
|
5
|
+
readonly canvas: HTMLCanvasElement | null;
|
|
6
|
+
readonly canvasContext: GPUCanvasContext | null;
|
|
7
|
+
readonly preferredFormat: GPUTextureFormat | null;
|
|
8
|
+
readonly initialized: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface RenderCoordinator {
|
|
11
|
+
setOptions(resolvedOptions: ResolvedChartGPUOptions): void;
|
|
12
|
+
/**
|
|
13
|
+
* Appends new points to a cartesian series’ runtime data without requiring a full `setOptions(...)`
|
|
14
|
+
* resolver pass.
|
|
15
|
+
*
|
|
16
|
+
* Appends are coalesced and flushed once per render frame.
|
|
17
|
+
*/
|
|
18
|
+
appendData(seriesIndex: number, newPoints: ReadonlyArray<DataPoint>): void;
|
|
19
|
+
/**
|
|
20
|
+
* Gets the current “interaction x” in domain units (or `null` when inactive).
|
|
21
|
+
*
|
|
22
|
+
* This is derived from pointer movement inside the plot grid and can also be driven
|
|
23
|
+
* externally via `setInteractionX(...)` (e.g. chart sync).
|
|
24
|
+
*/
|
|
25
|
+
getInteractionX(): number | null;
|
|
26
|
+
/**
|
|
27
|
+
* Drives the chart’s crosshair + tooltip from a domain-space x value.
|
|
28
|
+
*
|
|
29
|
+
* Passing `null` clears the interaction (hides crosshair/tooltip).
|
|
30
|
+
*/
|
|
31
|
+
setInteractionX(x: number | null, source?: unknown): void;
|
|
32
|
+
/**
|
|
33
|
+
* Subscribes to interaction x changes (domain units).
|
|
34
|
+
*
|
|
35
|
+
* Returns an unsubscribe function.
|
|
36
|
+
*/
|
|
37
|
+
onInteractionXChange(callback: (x: number | null, source?: unknown) => void): () => void;
|
|
38
|
+
/**
|
|
39
|
+
* Returns the current percent-space zoom window (or `null` when zoom is disabled).
|
|
40
|
+
*/
|
|
41
|
+
getZoomRange(): Readonly<{
|
|
42
|
+
start: number;
|
|
43
|
+
end: number;
|
|
44
|
+
}> | null;
|
|
45
|
+
/**
|
|
46
|
+
* Sets the percent-space zoom window.
|
|
47
|
+
*
|
|
48
|
+
* No-op when zoom is disabled.
|
|
49
|
+
*/
|
|
50
|
+
setZoomRange(start: number, end: number): void;
|
|
51
|
+
/**
|
|
52
|
+
* Subscribes to zoom window changes (percent space).
|
|
53
|
+
*
|
|
54
|
+
* Returns an unsubscribe function.
|
|
55
|
+
*/
|
|
56
|
+
onZoomRangeChange(cb: (range: Readonly<{
|
|
57
|
+
start: number;
|
|
58
|
+
end: number;
|
|
59
|
+
}>) => void): () => void;
|
|
60
|
+
render(): void;
|
|
61
|
+
dispose(): void;
|
|
62
|
+
}
|
|
63
|
+
export type RenderCoordinatorCallbacks = Readonly<{
|
|
64
|
+
/**
|
|
65
|
+
* Optional hook for render-on-demand systems (like `ChartGPU`) to re-render when
|
|
66
|
+
* interaction state changes (e.g. crosshair on pointer move).
|
|
67
|
+
*/
|
|
68
|
+
readonly onRequestRender?: () => void;
|
|
69
|
+
}>;
|
|
70
|
+
export declare function createRenderCoordinator(gpuContext: GPUContextLike, options: ResolvedChartGPUOptions, callbacks?: RenderCoordinatorCallbacks): RenderCoordinator;
|
|
71
|
+
//# sourceMappingURL=createRenderCoordinator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createRenderCoordinator.d.ts","sourceRoot":"","sources":["../../src/core/createRenderCoordinator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,uBAAuB,EAExB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAmB,SAAS,EAAwC,MAAM,iBAAiB,CAAC;AAuCxG,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,aAAa,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAChD,QAAQ,CAAC,eAAe,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAClD,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,eAAe,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAC3D;;;;;OAKG;IACH,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IAC3E;;;;;OAKG;IACH,eAAe,IAAI,MAAM,GAAG,IAAI,CAAC;IACjC;;;;OAIG;IACH,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1D;;;;OAIG;IACH,oBAAoB,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACzF;;OAEG;IACH,YAAY,IAAI,QAAQ,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,IAAI,CAAC;IAChE;;;;OAIG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/C;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAC7F,MAAM,IAAI,IAAI,CAAC;IACf,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC;IAChD;;;OAGG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CACvC,CAAC,CAAC;AA0mBH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,cAAc,EAC1B,OAAO,EAAE,uBAAuB,EAChC,SAAS,CAAC,EAAE,0BAA0B,GACrC,iBAAiB,CA+4DnB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { DataPoint } from '../config/types';
|
|
2
|
+
export interface DataStore {
|
|
3
|
+
setSeries(index: number, data: ReadonlyArray<DataPoint>): void;
|
|
4
|
+
/**
|
|
5
|
+
* Appends new points to an existing series without re-uploading the entire buffer when possible.
|
|
6
|
+
*
|
|
7
|
+
* - Reuses the same geometric growth policy as `setSeries`.
|
|
8
|
+
* - When no reallocation is needed, writes only the appended byte range via `queue.writeBuffer(...)`.
|
|
9
|
+
* - Maintains `pointCount` and a CPU-side combined data array so `getSeriesData(...)` remains correct.
|
|
10
|
+
*
|
|
11
|
+
* Throws if the series has not been set yet.
|
|
12
|
+
*/
|
|
13
|
+
appendSeries(index: number, newPoints: ReadonlyArray<DataPoint>): void;
|
|
14
|
+
removeSeries(index: number): void;
|
|
15
|
+
getSeriesBuffer(index: number): GPUBuffer;
|
|
16
|
+
/**
|
|
17
|
+
* Returns the number of points last set for the given series index.
|
|
18
|
+
*
|
|
19
|
+
* Throws if the series has not been set yet.
|
|
20
|
+
*/
|
|
21
|
+
getSeriesPointCount(index: number): number;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the last CPU-side data set for the given series index.
|
|
24
|
+
*
|
|
25
|
+
* This is intended for internal metadata/hit-testing paths that need the same
|
|
26
|
+
* input array that was packed into the GPU buffer (without re-threading it
|
|
27
|
+
* through other state). Throws if the series has not been set yet.
|
|
28
|
+
*/
|
|
29
|
+
getSeriesData(index: number): ReadonlyArray<DataPoint>;
|
|
30
|
+
dispose(): void;
|
|
31
|
+
}
|
|
32
|
+
export declare function createDataStore(device: GPUDevice): DataStore;
|
|
33
|
+
//# sourceMappingURL=createDataStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createDataStore.d.ts","sourceRoot":"","sources":["../../src/data/createDataStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,iBAAiB,CAAC;AAEjE,MAAM,WAAW,SAAS;IACxB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IAC/D;;;;;;;;OAQG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IACvE,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C;;;;OAIG;IACH,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3C;;;;;;OAMG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;IACvD,OAAO,IAAI,IAAI,CAAC;CACjB;AAyED,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,CAmN5D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface StreamBuffer {
|
|
2
|
+
/**
|
|
3
|
+
* Writes a new vertex payload into the streaming buffer.
|
|
4
|
+
*
|
|
5
|
+
* Notes:
|
|
6
|
+
* - `data` is interpreted as interleaved `vec2<f32>` vertices: `[x0, y0, x1, y1, ...]`.
|
|
7
|
+
* - Uses double buffering (alternates GPU buffers each write) to avoid writing into the same
|
|
8
|
+
* buffer the GPU might still be reading from the prior frame.
|
|
9
|
+
* - Uses a per-buffer CPU mirror (Uint32 bit patterns) to compute partial updates.
|
|
10
|
+
*/
|
|
11
|
+
write(data: Float32Array): void;
|
|
12
|
+
/** Returns the GPUBuffer that contains the most recently written data. */
|
|
13
|
+
getBuffer(): GPUBuffer;
|
|
14
|
+
/** Returns the vertex count for the most recently written data. */
|
|
15
|
+
getVertexCount(): number;
|
|
16
|
+
/** Destroys GPU resources (best-effort). Safe to call multiple times. */
|
|
17
|
+
dispose(): void;
|
|
18
|
+
}
|
|
19
|
+
export declare function createStreamBuffer(device: GPUDevice, maxSize: number): StreamBuffer;
|
|
20
|
+
//# sourceMappingURL=createStreamBuffer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createStreamBuffer.d.ts","sourceRoot":"","sources":["../../src/data/createStreamBuffer.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B;;;;;;;;OAQG;IACH,KAAK,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IAChC,0EAA0E;IAC1E,SAAS,IAAI,SAAS,CAAC;IACvB,mEAAmE;IACnE,cAAc,IAAI,MAAM,CAAC;IACzB,yEAAyE;IACzE,OAAO,IAAI,IAAI,CAAC;CACjB;AAoBD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,YAAY,CAiKnF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DataPoint } from '../config/types';
|
|
2
|
+
export declare function lttbSample(data: Float32Array, targetPoints: number): Float32Array;
|
|
3
|
+
export declare function lttbSample(data: DataPoint[], targetPoints: number): DataPoint[];
|
|
4
|
+
export declare function lttbSample(data: ReadonlyArray<DataPoint>, targetPoints: number): ReadonlyArray<DataPoint>;
|
|
5
|
+
//# sourceMappingURL=lttbSample.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lttbSample.d.ts","sourceRoot":"","sources":["../../src/data/lttbSample.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,iBAAiB,CAAC;AA6KjE,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,GAAG,YAAY,CAAC;AACnF,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,YAAY,EAAE,MAAM,GAAG,SAAS,EAAE,CAAC;AACjF,wBAAgB,UAAU,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,EAAE,YAAY,EAAE,MAAM,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampleSeries.d.ts","sourceRoot":"","sources":["../../src/data/sampleSeries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAkB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AA+GjF,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,EAC9B,QAAQ,EAAE,cAAc,EACxB,iBAAiB,EAAE,MAAM,GACxB,aAAa,CAAC,SAAS,CAAC,CAsB1B"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChartGPU - A GPU-accelerated charting library built with WebGPU
|
|
3
|
+
*/
|
|
4
|
+
export declare const version = "1.0.0";
|
|
5
|
+
export { ChartGPU } from './ChartGPU';
|
|
6
|
+
export { createChartGPU as createChart } from './ChartGPU';
|
|
7
|
+
export type { ChartGPUInstance } from './ChartGPU';
|
|
8
|
+
export type { ChartGPUEventName, ChartGPUEventPayload, ChartGPUCrosshairMovePayload, ChartGPUEventCallback, ChartGPUCrosshairMoveCallback, } from './ChartGPU';
|
|
9
|
+
export type { AreaStyleConfig, AnimationConfig, BarItemStyleConfig, AxisConfig, AxisType, ChartGPUOptions, DataZoomConfig, DataPoint, GridConfig, LineStyleConfig, AreaSeriesConfig, LineSeriesConfig, BarSeriesConfig, PieCenter, PieDataItem, PieItemStyleConfig, PieRadius, PieSeriesConfig, ScatterSeriesConfig, ScatterSymbol, ScatterPointTuple, SeriesConfig, SeriesSampling, SeriesType, TooltipParams, } from './config/types';
|
|
10
|
+
export { defaultOptions } from './config/defaults';
|
|
11
|
+
export { OptionResolver, resolveOptions } from './config/OptionResolver';
|
|
12
|
+
export type { ResolvedChartGPUOptions, ResolvedAreaSeriesConfig, ResolvedAreaStyleConfig, ResolvedGridConfig, ResolvedLineSeriesConfig, ResolvedLineStyleConfig, ResolvedSeriesConfig, } from './config/OptionResolver';
|
|
13
|
+
export type { ThemeConfig } from './themes/types';
|
|
14
|
+
export { darkTheme, lightTheme, getTheme } from './themes';
|
|
15
|
+
export type { ThemeName } from './themes';
|
|
16
|
+
export { createLinearScale, createCategoryScale } from './utils/scales';
|
|
17
|
+
export type { LinearScale, CategoryScale } from './utils/scales';
|
|
18
|
+
export { connectCharts } from './interaction/createChartSync';
|
|
19
|
+
export type { GPUContextState } from './core/GPUContext';
|
|
20
|
+
export { createGPUContext, createGPUContextAsync, initializeGPUContext, getCanvasTexture, clearScreen, destroyGPUContext, } from './core/GPUContext';
|
|
21
|
+
export { GPUContext } from './core/GPUContext';
|
|
22
|
+
export type { RenderSchedulerState, RenderCallback } from './core/RenderScheduler';
|
|
23
|
+
export { createRenderScheduler, createRenderSchedulerAsync, startRenderScheduler, stopRenderScheduler, requestRender, destroyRenderScheduler, } from './core/RenderScheduler';
|
|
24
|
+
export { RenderScheduler } from './core/RenderScheduler';
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,OAAO,UAAU,CAAC;AAG/B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,IAAI,WAAW,EAAE,MAAM,YAAY,CAAC;AAC3D,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,YAAY,EACV,iBAAiB,EACjB,oBAAoB,EACpB,4BAA4B,EAC5B,qBAAqB,EACrB,6BAA6B,GAC9B,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,UAAU,EACV,QAAQ,EACR,eAAe,EACf,cAAc,EACd,SAAS,EACT,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,UAAU,EACV,aAAa,GACd,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzE,YAAY,EACV,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;AAGjC,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC3D,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACxE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAG9D,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,WAAW,EACX,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,YAAY,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACnF,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC"}
|