@rm-graph/core 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/README.md +65 -0
- package/dist/chunk-KATRK3C3.js +336 -0
- package/dist/chunk-KATRK3C3.js.map +1 -0
- package/dist/chunk-Q2ZHY445.mjs +328 -0
- package/dist/chunk-Q2ZHY445.mjs.map +1 -0
- package/dist/index-DWzDIVQ9.d.mts +404 -0
- package/dist/index-DWzDIVQ9.d.ts +404 -0
- package/dist/index.d.mts +556 -0
- package/dist/index.d.ts +556 -0
- package/dist/index.js +1655 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1600 -0
- package/dist/index.mjs.map +1 -0
- package/dist/themes/index.d.mts +1 -0
- package/dist/themes/index.d.ts +1 -0
- package/dist/themes/index.js +32 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/themes/index.mjs +3 -0
- package/dist/themes/index.mjs.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core type definitions for SciChart UI
|
|
3
|
+
*/
|
|
4
|
+
interface ChartConfig {
|
|
5
|
+
/** Unique identifier for the chart */
|
|
6
|
+
id?: string;
|
|
7
|
+
/** Width of the chart (CSS value or number in pixels) */
|
|
8
|
+
width?: string | number;
|
|
9
|
+
/** Height of the chart (CSS value or number in pixels) */
|
|
10
|
+
height?: string | number;
|
|
11
|
+
/** Theme to apply to the chart */
|
|
12
|
+
theme?: ThemeConfig | string;
|
|
13
|
+
/** Enable/disable animations */
|
|
14
|
+
animation?: boolean | AnimationConfig;
|
|
15
|
+
/** Tooltip configuration */
|
|
16
|
+
tooltip?: TooltipConfig;
|
|
17
|
+
/** Legend configuration */
|
|
18
|
+
legend?: LegendConfig;
|
|
19
|
+
/** Title configuration */
|
|
20
|
+
title?: TitleConfig;
|
|
21
|
+
}
|
|
22
|
+
interface AnimationConfig {
|
|
23
|
+
/** Enable/disable animations */
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
/** Animation duration in milliseconds */
|
|
26
|
+
duration?: number;
|
|
27
|
+
/** Animation easing function */
|
|
28
|
+
easing?: "linear" | "easeIn" | "easeOut" | "easeInOut";
|
|
29
|
+
}
|
|
30
|
+
interface TooltipConfig {
|
|
31
|
+
/** Enable/disable tooltip */
|
|
32
|
+
enabled?: boolean;
|
|
33
|
+
/** Tooltip trigger mode */
|
|
34
|
+
trigger?: "hover" | "click" | "none";
|
|
35
|
+
/** Custom tooltip formatter */
|
|
36
|
+
formatter?: (data: TooltipData) => string;
|
|
37
|
+
}
|
|
38
|
+
interface TooltipData {
|
|
39
|
+
seriesName: string;
|
|
40
|
+
dataPoint: DataPoint;
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
}
|
|
44
|
+
interface LegendConfig {
|
|
45
|
+
/** Show/hide legend */
|
|
46
|
+
show?: boolean;
|
|
47
|
+
/** Legend position */
|
|
48
|
+
position?: "top" | "bottom" | "left" | "right";
|
|
49
|
+
/** Legend orientation */
|
|
50
|
+
orientation?: "horizontal" | "vertical";
|
|
51
|
+
}
|
|
52
|
+
interface TitleConfig {
|
|
53
|
+
/** Title text */
|
|
54
|
+
text?: string;
|
|
55
|
+
/** Subtitle text */
|
|
56
|
+
subtext?: string;
|
|
57
|
+
/** Title position */
|
|
58
|
+
position?: "left" | "center" | "right";
|
|
59
|
+
}
|
|
60
|
+
interface DataPoint {
|
|
61
|
+
x: number | Date | string;
|
|
62
|
+
y: number;
|
|
63
|
+
/** Optional label for the data point */
|
|
64
|
+
label?: string;
|
|
65
|
+
/** Optional custom data */
|
|
66
|
+
meta?: Record<string, unknown>;
|
|
67
|
+
}
|
|
68
|
+
interface SeriesData {
|
|
69
|
+
/** Series name (used in legend and tooltips) */
|
|
70
|
+
name: string;
|
|
71
|
+
/** Data points */
|
|
72
|
+
data: DataPoint[] | number[];
|
|
73
|
+
/** Series color (overrides theme) */
|
|
74
|
+
color?: string;
|
|
75
|
+
/** Series type for mixed charts */
|
|
76
|
+
type?: ChartType;
|
|
77
|
+
}
|
|
78
|
+
type ChartType = "line" | "bar" | "area" | "scatter" | "pie" | "donut" | "candlestick" | "column" | "spline" | "bubble" | "heatmap" | "surface3d";
|
|
79
|
+
interface AxisConfig {
|
|
80
|
+
/** Axis title */
|
|
81
|
+
title?: string;
|
|
82
|
+
/** Show/hide axis */
|
|
83
|
+
show?: boolean;
|
|
84
|
+
/** Axis type */
|
|
85
|
+
type?: "numeric" | "category" | "date" | "logarithmic";
|
|
86
|
+
/** Minimum value (auto if not specified) */
|
|
87
|
+
min?: number;
|
|
88
|
+
/** Maximum value (auto if not specified) */
|
|
89
|
+
max?: number;
|
|
90
|
+
/** Grid line configuration */
|
|
91
|
+
gridLines?: GridLineConfig;
|
|
92
|
+
/** Label formatter */
|
|
93
|
+
labelFormatter?: (value: number | string) => string;
|
|
94
|
+
}
|
|
95
|
+
interface GridLineConfig {
|
|
96
|
+
/** Show/hide grid lines */
|
|
97
|
+
show?: boolean;
|
|
98
|
+
/** Grid line color */
|
|
99
|
+
color?: string;
|
|
100
|
+
/** Grid line style */
|
|
101
|
+
style?: "solid" | "dashed" | "dotted";
|
|
102
|
+
}
|
|
103
|
+
interface XAxisConfig extends AxisConfig {
|
|
104
|
+
/** Categories for category axis */
|
|
105
|
+
categories?: string[];
|
|
106
|
+
}
|
|
107
|
+
interface YAxisConfig extends AxisConfig {
|
|
108
|
+
/** Position of Y axis */
|
|
109
|
+
position?: "left" | "right";
|
|
110
|
+
}
|
|
111
|
+
interface ThemeConfig {
|
|
112
|
+
/** Theme name */
|
|
113
|
+
name: string;
|
|
114
|
+
/** Background color */
|
|
115
|
+
backgroundColor?: string;
|
|
116
|
+
/** Text color */
|
|
117
|
+
textColor?: string;
|
|
118
|
+
/** Default color palette for series */
|
|
119
|
+
colorPalette?: string[];
|
|
120
|
+
/** Axis styling */
|
|
121
|
+
axis?: {
|
|
122
|
+
lineColor?: string;
|
|
123
|
+
labelColor?: string;
|
|
124
|
+
titleColor?: string;
|
|
125
|
+
gridLineColor?: string;
|
|
126
|
+
};
|
|
127
|
+
/** Tooltip styling */
|
|
128
|
+
tooltip?: {
|
|
129
|
+
backgroundColor?: string;
|
|
130
|
+
textColor?: string;
|
|
131
|
+
borderColor?: string;
|
|
132
|
+
borderRadius?: number;
|
|
133
|
+
};
|
|
134
|
+
/** Legend styling */
|
|
135
|
+
legend?: {
|
|
136
|
+
textColor?: string;
|
|
137
|
+
backgroundColor?: string;
|
|
138
|
+
};
|
|
139
|
+
/** Title styling */
|
|
140
|
+
title?: {
|
|
141
|
+
color?: string;
|
|
142
|
+
fontSize?: number;
|
|
143
|
+
fontWeight?: string;
|
|
144
|
+
};
|
|
145
|
+
/** Font family */
|
|
146
|
+
fontFamily?: string;
|
|
147
|
+
}
|
|
148
|
+
interface ChartEventMap {
|
|
149
|
+
click: ChartClickEvent;
|
|
150
|
+
hover: ChartHoverEvent;
|
|
151
|
+
legendClick: LegendClickEvent;
|
|
152
|
+
zoom: ZoomEvent;
|
|
153
|
+
pan: PanEvent;
|
|
154
|
+
rendered: RenderedEvent;
|
|
155
|
+
}
|
|
156
|
+
interface ChartClickEvent {
|
|
157
|
+
dataPoint?: DataPoint;
|
|
158
|
+
seriesIndex?: number;
|
|
159
|
+
x: number;
|
|
160
|
+
y: number;
|
|
161
|
+
}
|
|
162
|
+
interface ChartHoverEvent {
|
|
163
|
+
dataPoint?: DataPoint;
|
|
164
|
+
seriesIndex?: number;
|
|
165
|
+
x: number;
|
|
166
|
+
y: number;
|
|
167
|
+
}
|
|
168
|
+
interface LegendClickEvent {
|
|
169
|
+
seriesName: string;
|
|
170
|
+
seriesIndex: number;
|
|
171
|
+
visible: boolean;
|
|
172
|
+
}
|
|
173
|
+
interface ZoomEvent {
|
|
174
|
+
xMin: number;
|
|
175
|
+
xMax: number;
|
|
176
|
+
yMin: number;
|
|
177
|
+
yMax: number;
|
|
178
|
+
}
|
|
179
|
+
interface PanEvent {
|
|
180
|
+
deltaX: number;
|
|
181
|
+
deltaY: number;
|
|
182
|
+
}
|
|
183
|
+
interface RenderedEvent {
|
|
184
|
+
chartId: string;
|
|
185
|
+
renderTime: number;
|
|
186
|
+
}
|
|
187
|
+
interface ChartInstance {
|
|
188
|
+
/** Unique chart ID */
|
|
189
|
+
readonly id: string;
|
|
190
|
+
/** Update chart data */
|
|
191
|
+
setData(data: SeriesData[]): void;
|
|
192
|
+
/** Update chart options */
|
|
193
|
+
setOptions(options: Partial<ChartConfig>): void;
|
|
194
|
+
/** Destroy the chart and clean up resources */
|
|
195
|
+
destroy(): void;
|
|
196
|
+
/** Resize the chart */
|
|
197
|
+
resize(width?: number, height?: number): void;
|
|
198
|
+
/** Export chart as image */
|
|
199
|
+
exportImage(format?: "png" | "jpeg" | "svg"): Promise<string>;
|
|
200
|
+
/** Add event listener */
|
|
201
|
+
on<K extends keyof ChartEventMap>(event: K, handler: (e: ChartEventMap[K]) => void): void;
|
|
202
|
+
/** Remove event listener */
|
|
203
|
+
off<K extends keyof ChartEventMap>(event: K, handler: (e: ChartEventMap[K]) => void): void;
|
|
204
|
+
}
|
|
205
|
+
interface LineChartConfig extends ChartConfig {
|
|
206
|
+
/** X-axis configuration */
|
|
207
|
+
xAxis?: XAxisConfig;
|
|
208
|
+
/** Y-axis configuration */
|
|
209
|
+
yAxis?: YAxisConfig;
|
|
210
|
+
/** Line thickness */
|
|
211
|
+
lineWidth?: number;
|
|
212
|
+
/** Show data points */
|
|
213
|
+
showPoints?: boolean;
|
|
214
|
+
/** Point size */
|
|
215
|
+
pointSize?: number;
|
|
216
|
+
/** Enable smooth curves (spline) */
|
|
217
|
+
smooth?: boolean;
|
|
218
|
+
/** Series data */
|
|
219
|
+
series: SeriesData[];
|
|
220
|
+
}
|
|
221
|
+
interface BarChartConfig extends ChartConfig {
|
|
222
|
+
/** X-axis configuration */
|
|
223
|
+
xAxis?: XAxisConfig;
|
|
224
|
+
/** Y-axis configuration */
|
|
225
|
+
yAxis?: YAxisConfig;
|
|
226
|
+
/** Bar orientation */
|
|
227
|
+
orientation?: "vertical" | "horizontal";
|
|
228
|
+
/** Bar width (0-1 as percentage) */
|
|
229
|
+
barWidth?: number;
|
|
230
|
+
/** Stack bars */
|
|
231
|
+
stacked?: boolean;
|
|
232
|
+
/** Border radius for bars */
|
|
233
|
+
borderRadius?: number;
|
|
234
|
+
/** Series data */
|
|
235
|
+
series: SeriesData[];
|
|
236
|
+
}
|
|
237
|
+
interface PieChartConfig extends ChartConfig {
|
|
238
|
+
/** Inner radius for donut (0 for pie) */
|
|
239
|
+
innerRadius?: number;
|
|
240
|
+
/** Outer radius */
|
|
241
|
+
outerRadius?: number;
|
|
242
|
+
/** Start angle in degrees */
|
|
243
|
+
startAngle?: number;
|
|
244
|
+
/** Show labels */
|
|
245
|
+
showLabels?: boolean;
|
|
246
|
+
/** Label position */
|
|
247
|
+
labelPosition?: "inside" | "outside";
|
|
248
|
+
/** Series data (single series) */
|
|
249
|
+
series: SeriesData;
|
|
250
|
+
}
|
|
251
|
+
interface AreaChartConfig extends LineChartConfig {
|
|
252
|
+
/** Fill opacity (0-1) */
|
|
253
|
+
fillOpacity?: number;
|
|
254
|
+
/** Stack areas */
|
|
255
|
+
stacked?: boolean;
|
|
256
|
+
}
|
|
257
|
+
interface ScatterChartConfig extends ChartConfig {
|
|
258
|
+
/** X-axis configuration */
|
|
259
|
+
xAxis?: XAxisConfig;
|
|
260
|
+
/** Y-axis configuration */
|
|
261
|
+
yAxis?: YAxisConfig;
|
|
262
|
+
/** Point size */
|
|
263
|
+
pointSize?: number;
|
|
264
|
+
/** Point shape */
|
|
265
|
+
pointShape?: "circle" | "square" | "triangle" | "diamond";
|
|
266
|
+
/** Series data */
|
|
267
|
+
series: SeriesData[];
|
|
268
|
+
}
|
|
269
|
+
interface HeatmapChartConfig extends ChartConfig {
|
|
270
|
+
/** X-axis configuration */
|
|
271
|
+
xAxis?: XAxisConfig;
|
|
272
|
+
/** Y-axis configuration */
|
|
273
|
+
yAxis?: YAxisConfig;
|
|
274
|
+
/** 2D array of z-values for the heatmap */
|
|
275
|
+
zValues: number[][];
|
|
276
|
+
/** X start position */
|
|
277
|
+
xStart?: number;
|
|
278
|
+
/** X step size */
|
|
279
|
+
xStep?: number;
|
|
280
|
+
/** Y start position */
|
|
281
|
+
yStart?: number;
|
|
282
|
+
/** Y step size */
|
|
283
|
+
yStep?: number;
|
|
284
|
+
/** Minimum value for color mapping */
|
|
285
|
+
colorMin?: number;
|
|
286
|
+
/** Maximum value for color mapping */
|
|
287
|
+
colorMax?: number;
|
|
288
|
+
/** Color gradient stops */
|
|
289
|
+
colorStops?: Array<{
|
|
290
|
+
offset: number;
|
|
291
|
+
color: string;
|
|
292
|
+
}>;
|
|
293
|
+
/** Show color legend */
|
|
294
|
+
showLegend?: boolean;
|
|
295
|
+
}
|
|
296
|
+
interface Surface3DChartConfig extends ChartConfig {
|
|
297
|
+
/** X size of the grid */
|
|
298
|
+
xSize?: number;
|
|
299
|
+
/** Z size of the grid */
|
|
300
|
+
zSize?: number;
|
|
301
|
+
/** X step size */
|
|
302
|
+
xStep?: number;
|
|
303
|
+
/** Z step size */
|
|
304
|
+
zStep?: number;
|
|
305
|
+
/** 2D array of Y values for the surface (height values) */
|
|
306
|
+
yValues: number[][];
|
|
307
|
+
/** Minimum value for color mapping */
|
|
308
|
+
colorMin?: number;
|
|
309
|
+
/** Maximum value for color mapping */
|
|
310
|
+
colorMax?: number;
|
|
311
|
+
/** Color gradient stops */
|
|
312
|
+
colorStops?: Array<{
|
|
313
|
+
offset: number;
|
|
314
|
+
color: string;
|
|
315
|
+
}>;
|
|
316
|
+
/** Surface opacity (0-1) */
|
|
317
|
+
opacity?: number;
|
|
318
|
+
/** Draw wireframe */
|
|
319
|
+
drawWireframe?: boolean;
|
|
320
|
+
/** Wireframe stroke color */
|
|
321
|
+
wireframeStroke?: string;
|
|
322
|
+
/** Draw mesh */
|
|
323
|
+
drawMesh?: boolean;
|
|
324
|
+
/** Camera position */
|
|
325
|
+
cameraPosition?: {
|
|
326
|
+
x: number;
|
|
327
|
+
y: number;
|
|
328
|
+
z: number;
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Default light theme - clean white background with subtle grid
|
|
334
|
+
*/
|
|
335
|
+
declare const lightTheme: ThemeConfig;
|
|
336
|
+
/**
|
|
337
|
+
* Default dark theme
|
|
338
|
+
*/
|
|
339
|
+
declare const darkTheme: ThemeConfig;
|
|
340
|
+
/**
|
|
341
|
+
* Modern gradient theme with vibrant colors
|
|
342
|
+
*/
|
|
343
|
+
declare const modernTheme: ThemeConfig;
|
|
344
|
+
/**
|
|
345
|
+
* Midnight theme - deep dark with neon accents
|
|
346
|
+
*/
|
|
347
|
+
declare const midnightTheme: ThemeConfig;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* ThemeManager - Manages chart themes and provides theme resolution
|
|
351
|
+
*/
|
|
352
|
+
declare class ThemeManager {
|
|
353
|
+
private static instance;
|
|
354
|
+
private themes;
|
|
355
|
+
private currentTheme;
|
|
356
|
+
private constructor();
|
|
357
|
+
/**
|
|
358
|
+
* Get the singleton instance of ThemeManager
|
|
359
|
+
*/
|
|
360
|
+
static getInstance(): ThemeManager;
|
|
361
|
+
/**
|
|
362
|
+
* Register a custom theme
|
|
363
|
+
*/
|
|
364
|
+
registerTheme(theme: ThemeConfig): void;
|
|
365
|
+
/**
|
|
366
|
+
* Get a theme by name
|
|
367
|
+
*/
|
|
368
|
+
getTheme(name: string): ThemeConfig;
|
|
369
|
+
/**
|
|
370
|
+
* Set the global default theme
|
|
371
|
+
*/
|
|
372
|
+
setDefaultTheme(name: string): void;
|
|
373
|
+
/**
|
|
374
|
+
* Get the current default theme name
|
|
375
|
+
*/
|
|
376
|
+
getDefaultThemeName(): string;
|
|
377
|
+
/**
|
|
378
|
+
* Get the current default theme configuration
|
|
379
|
+
*/
|
|
380
|
+
getDefaultTheme(): ThemeConfig;
|
|
381
|
+
/**
|
|
382
|
+
* Get all registered theme names
|
|
383
|
+
*/
|
|
384
|
+
getAvailableThemes(): string[];
|
|
385
|
+
/**
|
|
386
|
+
* Check if a theme is registered
|
|
387
|
+
*/
|
|
388
|
+
hasTheme(name: string): boolean;
|
|
389
|
+
/**
|
|
390
|
+
* Resolve theme from string name or ThemeConfig object
|
|
391
|
+
*/
|
|
392
|
+
resolveTheme(theme?: ThemeConfig | string): ThemeConfig;
|
|
393
|
+
/**
|
|
394
|
+
* Merge two themes, with override taking precedence
|
|
395
|
+
*/
|
|
396
|
+
mergeThemes(base: ThemeConfig, override: Partial<ThemeConfig>): ThemeConfig;
|
|
397
|
+
/**
|
|
398
|
+
* Get color from palette by index (cycles through palette)
|
|
399
|
+
*/
|
|
400
|
+
getColorFromPalette(theme: ThemeConfig, index: number): string;
|
|
401
|
+
}
|
|
402
|
+
declare const getThemeManager: () => ThemeManager;
|
|
403
|
+
|
|
404
|
+
export { type AreaChartConfig as A, type BarChartConfig as B, type ChartConfig as C, type DataPoint as D, type GridLineConfig as G, type HeatmapChartConfig as H, type LineChartConfig as L, type PieChartConfig as P, type RenderedEvent as R, type SeriesData as S, type ThemeConfig as T, type XAxisConfig as X, type YAxisConfig as Y, type ZoomEvent as Z, type ChartInstance as a, type ChartEventMap as b, type Surface3DChartConfig as c, type ScatterChartConfig as d, type AnimationConfig as e, type TooltipConfig as f, type TooltipData as g, type LegendConfig as h, type TitleConfig as i, type AxisConfig as j, type ChartType as k, type ChartClickEvent as l, type ChartHoverEvent as m, type LegendClickEvent as n, type PanEvent as o, lightTheme as p, darkTheme as q, modernTheme as r, midnightTheme as s, ThemeManager as t, getThemeManager as u };
|