semiotic 3.2.2 → 3.3.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/CLAUDE.md +118 -222
- package/README.md +37 -17
- package/ai/schema.json +64 -1
- package/ai/system-prompt.md +3 -3
- package/dist/components/Tooltip/Tooltip.d.ts +6 -1
- package/dist/components/charts/index.d.ts +2 -0
- package/dist/components/charts/ordinal/BarChart.d.ts +2 -0
- package/dist/components/charts/ordinal/GaugeChart.d.ts +55 -0
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +1 -0
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +1 -0
- package/dist/components/charts/ordinal/SwimlaneChart.d.ts +4 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +2 -0
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +2 -0
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +2 -0
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +2 -0
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +2 -0
- package/dist/components/charts/shared/hooks.d.ts +5 -1
- package/dist/components/charts/shared/types.d.ts +14 -5
- package/dist/components/charts/shared/useChartSetup.d.ts +2 -0
- package/dist/components/charts/xy/AreaChart.d.ts +17 -2
- package/dist/components/charts/xy/LineChart.d.ts +14 -3
- package/dist/components/realtime/RingBuffer.d.ts +11 -0
- package/dist/components/realtime/types.d.ts +4 -0
- package/dist/components/semiotic-ordinal.d.ts +2 -0
- package/dist/components/semiotic-server.d.ts +6 -1
- package/dist/components/semiotic-utils.d.ts +2 -1
- package/dist/components/semiotic.d.ts +3 -3
- package/dist/components/server/animatedGif.d.ts +78 -0
- package/dist/components/server/renderToStaticSVG.d.ts +85 -5
- package/dist/components/server/staticAnnotations.d.ts +40 -0
- package/dist/components/server/staticLegend.d.ts +39 -0
- package/dist/components/server/svgHatchPattern.d.ts +26 -0
- package/dist/components/server/themeResolver.d.ts +35 -0
- package/dist/components/store/LinkedCrosshairStore.d.ts +6 -2
- package/dist/components/stream/CanvasHitTester.d.ts +13 -0
- package/dist/components/stream/GeoPipelineStore.d.ts +6 -1
- package/dist/components/stream/NetworkPipelineStore.d.ts +20 -0
- package/dist/components/stream/OrdinalPipelineStore.d.ts +11 -0
- package/dist/components/stream/OrdinalSVGOverlay.d.ts +6 -1
- package/dist/components/stream/PipelineStore.d.ts +28 -1
- package/dist/components/stream/SVGOverlay.d.ts +11 -5
- package/dist/components/stream/accessorUtils.d.ts +3 -3
- package/dist/components/stream/geoTypes.d.ts +2 -0
- package/dist/components/stream/hitTestUtils.d.ts +15 -0
- package/dist/components/stream/networkTypes.d.ts +33 -0
- package/dist/components/stream/ordinalTypes.d.ts +37 -4
- package/dist/components/stream/renderers/resolveCSSColor.d.ts +17 -0
- package/dist/components/stream/types.d.ts +58 -5
- package/dist/components/stream/xySceneBuilders/mixedScene.d.ts +12 -0
- package/dist/components/stream/xySceneBuilders/types.d.ts +15 -0
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-ordinal.d.ts +2 -0
- package/dist/semiotic-server.d.ts +6 -1
- package/dist/semiotic-utils.d.ts +2 -1
- package/dist/semiotic-utils.min.js +1 -1
- package/dist/semiotic-utils.module.min.js +1 -1
- package/dist/semiotic.d.ts +3 -3
- package/dist/semiotic.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +21 -7
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static annotation rendering for server-side SVG.
|
|
3
|
+
*
|
|
4
|
+
* Supports common annotation types without DOM or React hooks.
|
|
5
|
+
* Converts data coordinates to pixels using provided scales.
|
|
6
|
+
*/
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import type { SemioticTheme } from "../store/ThemeStore";
|
|
9
|
+
interface AnnotationScales {
|
|
10
|
+
x?: (v: any) => number;
|
|
11
|
+
y?: (v: any) => number;
|
|
12
|
+
/** For ordinal charts: band scale */
|
|
13
|
+
o?: {
|
|
14
|
+
(v: string): number | undefined;
|
|
15
|
+
bandwidth?: () => number;
|
|
16
|
+
};
|
|
17
|
+
/** For ordinal charts: value scale */
|
|
18
|
+
r?: (v: number) => number;
|
|
19
|
+
}
|
|
20
|
+
interface AnnotationLayout {
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
}
|
|
24
|
+
export interface StaticAnnotationConfig {
|
|
25
|
+
annotations: Record<string, any>[];
|
|
26
|
+
scales: AnnotationScales;
|
|
27
|
+
layout: AnnotationLayout;
|
|
28
|
+
theme: SemioticTheme;
|
|
29
|
+
/** ID prefix for multi-chart documents */
|
|
30
|
+
idPrefix?: string;
|
|
31
|
+
xAccessor?: string;
|
|
32
|
+
yAccessor?: string;
|
|
33
|
+
/** Ordinal projection — determines whether r maps to x or y */
|
|
34
|
+
projection?: "vertical" | "horizontal" | "radial";
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Render annotations as static SVG elements.
|
|
38
|
+
*/
|
|
39
|
+
export declare function renderStaticAnnotations(config: StaticAnnotationConfig): React.ReactNode;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static legend rendering for server-side SVG.
|
|
3
|
+
*
|
|
4
|
+
* Builds legend SVG elements from data + colorScheme without React hooks.
|
|
5
|
+
* Used by renderToStaticSVG when showLegend is true.
|
|
6
|
+
*/
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import type { SemioticTheme } from "../store/ThemeStore";
|
|
9
|
+
export interface StaticLegendConfig {
|
|
10
|
+
/** Category labels to show in legend */
|
|
11
|
+
categories: string[];
|
|
12
|
+
/** Color scheme — array of colors or d3-scale-chromatic name */
|
|
13
|
+
colorScheme?: string | string[];
|
|
14
|
+
/** Theme for text/font colors */
|
|
15
|
+
theme: SemioticTheme;
|
|
16
|
+
/** Legend position */
|
|
17
|
+
position?: "right" | "left" | "top" | "bottom";
|
|
18
|
+
/** Chart dimensions for positioning */
|
|
19
|
+
totalWidth: number;
|
|
20
|
+
totalHeight: number;
|
|
21
|
+
/** Chart margins */
|
|
22
|
+
margin: {
|
|
23
|
+
top: number;
|
|
24
|
+
right: number;
|
|
25
|
+
bottom: number;
|
|
26
|
+
left: number;
|
|
27
|
+
};
|
|
28
|
+
/** Title presence (affects top-position offset) */
|
|
29
|
+
hasTitle?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Render a static legend as SVG elements.
|
|
33
|
+
* Returns null if no categories to show.
|
|
34
|
+
*/
|
|
35
|
+
export declare function renderStaticLegend(config: StaticLegendConfig): React.ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Extract unique categories from data using an accessor.
|
|
38
|
+
*/
|
|
39
|
+
export declare function extractCategories(data: any[], accessor: string | ((d: any) => string) | undefined): string[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SVG hatch pattern for server-side rendering.
|
|
3
|
+
*
|
|
4
|
+
* Creates a <pattern> element that can be referenced via url(#id) fill.
|
|
5
|
+
* The SVG equivalent of createHatchPattern() which produces CanvasPatterns.
|
|
6
|
+
*/
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
export interface SVGHatchOptions {
|
|
9
|
+
/** Pattern ID — must be unique within the SVG */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Background color */
|
|
12
|
+
background?: string;
|
|
13
|
+
/** Line color */
|
|
14
|
+
stroke?: string;
|
|
15
|
+
/** Line width @default 1.5 */
|
|
16
|
+
lineWidth?: number;
|
|
17
|
+
/** Spacing between lines @default 6 */
|
|
18
|
+
spacing?: number;
|
|
19
|
+
/** Angle in degrees @default 45 */
|
|
20
|
+
angle?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Create an SVG <pattern> element for diagonal hatch fills.
|
|
24
|
+
* Place inside <defs> and reference with fill="url(#id)".
|
|
25
|
+
*/
|
|
26
|
+
export declare function createSVGHatchPattern(options: SVGHatchOptions): React.ReactElement;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme resolution for server-side rendering.
|
|
3
|
+
*
|
|
4
|
+
* Resolves theme presets and partial theme objects to concrete
|
|
5
|
+
* SemioticTheme instances with all color/font values resolved.
|
|
6
|
+
* No CSS custom properties — everything is concrete for inline SVG.
|
|
7
|
+
*/
|
|
8
|
+
import type { SemioticTheme } from "../store/ThemeStore";
|
|
9
|
+
export type ThemeInput = string | Partial<SemioticTheme> | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Resolve a theme input to a full SemioticTheme object.
|
|
12
|
+
*
|
|
13
|
+
* - undefined → LIGHT_THEME
|
|
14
|
+
* - string → named preset ("dark", "tufte", "carbon-dark", etc.)
|
|
15
|
+
* - object with mode → merge onto matching base theme
|
|
16
|
+
* - object without mode → merge onto LIGHT_THEME
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveTheme(theme: ThemeInput): SemioticTheme;
|
|
19
|
+
/**
|
|
20
|
+
* Extract concrete style values from a resolved theme for use in SVG attributes.
|
|
21
|
+
* Returns a flat object of commonly-needed values.
|
|
22
|
+
*/
|
|
23
|
+
export declare function themeStyles(theme: SemioticTheme): {
|
|
24
|
+
background: string;
|
|
25
|
+
text: string;
|
|
26
|
+
textSecondary: string;
|
|
27
|
+
grid: string;
|
|
28
|
+
border: string;
|
|
29
|
+
primary: string;
|
|
30
|
+
fontFamily: string;
|
|
31
|
+
titleSize: number;
|
|
32
|
+
labelSize: number;
|
|
33
|
+
tickSize: number;
|
|
34
|
+
categorical: string[];
|
|
35
|
+
};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
export declare function setCrosshairPosition(name: string, xValue: number, sourceId: string): void;
|
|
2
2
|
export declare function clearCrosshairPosition(name: string, sourceId: string): void;
|
|
3
|
+
/** Toggle lock: if unlocked, lock at xValue; if locked, unlock and clear. Returns new locked state. */
|
|
4
|
+
export declare function toggleCrosshairLock(name: string, xValue: number, sourceId: string): boolean;
|
|
5
|
+
/** Force-unlock a crosshair by name. When sourceId is provided, only unlocks if it matches (safe for multi-chart unmount). */
|
|
6
|
+
export declare function unlockCrosshair(name: string, sourceId?: string): void;
|
|
3
7
|
/**
|
|
4
8
|
* Hook to read a specific crosshair position by name.
|
|
5
|
-
* Returns the X value and
|
|
6
|
-
* When name is undefined, uses a no-op subscription to avoid unnecessary re-renders.
|
|
9
|
+
* Returns the X value, sourceId, and locked state, or null if no crosshair is active.
|
|
7
10
|
*/
|
|
8
11
|
export declare function useCrosshairPosition(name: string | undefined): {
|
|
9
12
|
xValue: number;
|
|
10
13
|
sourceId: string;
|
|
14
|
+
locked?: boolean;
|
|
11
15
|
} | null;
|
|
@@ -18,6 +18,19 @@ export interface HitResult {
|
|
|
18
18
|
* use the linear scan.
|
|
19
19
|
*/
|
|
20
20
|
export declare function findNearestNode(scene: SceneNode[], px: number, py: number, maxDistance?: number, pointQuadtree?: Quadtree<PointSceneNode> | null): HitResult | null;
|
|
21
|
+
/**
|
|
22
|
+
* Find all line/area nodes at a given X pixel coordinate.
|
|
23
|
+
* For each node, interpolates the Y value at px using the path data.
|
|
24
|
+
* Used for multi-point tooltip (show all series values at the hovered X).
|
|
25
|
+
*/
|
|
26
|
+
export declare function findAllNodesAtX(scene: SceneNode[], px: number, maxXDistance?: number): Array<{
|
|
27
|
+
node: SceneNode;
|
|
28
|
+
datum: any;
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
group?: string;
|
|
32
|
+
color?: string;
|
|
33
|
+
}>;
|
|
21
34
|
/**
|
|
22
35
|
* Binary search for nearest point by time value in a RingBuffer.
|
|
23
36
|
*/
|
|
@@ -39,6 +39,11 @@ export declare class GeoPipelineStore {
|
|
|
39
39
|
pushPoint(datum: Record<string, any>): void;
|
|
40
40
|
/** Push multiple streaming points */
|
|
41
41
|
pushMany(data: Record<string, any>[]): void;
|
|
42
|
+
/**
|
|
43
|
+
* Remove points by ID. Requires pointIdAccessor to be configured.
|
|
44
|
+
* Returns the removed items.
|
|
45
|
+
*/
|
|
46
|
+
removePoint(id: string | string[]): Record<string, any>[];
|
|
42
47
|
clear(): void;
|
|
43
48
|
computeScene(layout: StreamLayout): void;
|
|
44
49
|
private fitProjection;
|
|
@@ -70,7 +75,7 @@ export declare class GeoPipelineStore {
|
|
|
70
75
|
scale: number;
|
|
71
76
|
translate: [number, number];
|
|
72
77
|
};
|
|
73
|
-
|
|
78
|
+
getPoints(): Record<string, any>[];
|
|
74
79
|
private buildSceneNodes;
|
|
75
80
|
private applyCartogramTransform;
|
|
76
81
|
private applyDecay;
|
|
@@ -126,5 +126,25 @@ export declare class NetworkPipelineStore {
|
|
|
126
126
|
nodes: RealtimeNode[];
|
|
127
127
|
edges: RealtimeEdge[];
|
|
128
128
|
};
|
|
129
|
+
/**
|
|
130
|
+
* Update a node's data by ID. Returns the previous data, or null if not found.
|
|
131
|
+
*/
|
|
132
|
+
updateNode(id: string, updater: (data: Record<string, any>) => Record<string, any>): Record<string, any> | null;
|
|
133
|
+
/**
|
|
134
|
+
* Update all edges between source and target. Handles parallel edges.
|
|
135
|
+
* Returns array of previous data values (one per updated edge), or empty array.
|
|
136
|
+
*/
|
|
137
|
+
updateEdge(sourceId: string, targetId: string, updater: (data: Record<string, any>) => Record<string, any>): Record<string, any>[];
|
|
138
|
+
/**
|
|
139
|
+
* Remove a node by ID. Also removes all edges connected to this node.
|
|
140
|
+
* Returns true if the node was found and removed.
|
|
141
|
+
*/
|
|
142
|
+
removeNode(id: string): boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Remove all edges between source and target node IDs.
|
|
145
|
+
* Handles parallel edges (multiple edges between the same pair).
|
|
146
|
+
* Returns true if at least one edge was removed.
|
|
147
|
+
*/
|
|
148
|
+
removeEdge(sourceId: string, targetId: string): boolean;
|
|
129
149
|
clear(): void;
|
|
130
150
|
}
|
|
@@ -32,6 +32,7 @@ export declare class OrdinalPipelineStore {
|
|
|
32
32
|
private getGroup;
|
|
33
33
|
private getColor;
|
|
34
34
|
private getConnector;
|
|
35
|
+
private getDataId;
|
|
35
36
|
/** Discovered categories in insertion order */
|
|
36
37
|
private categories;
|
|
37
38
|
/** True once a non-bounded (push) changeset has been ingested */
|
|
@@ -77,6 +78,16 @@ export declare class OrdinalPipelineStore {
|
|
|
77
78
|
private startTransition;
|
|
78
79
|
advanceTransition(now: number): boolean;
|
|
79
80
|
getData(): Record<string, any>[];
|
|
81
|
+
/**
|
|
82
|
+
* Remove data items by ID. Requires dataIdAccessor to be configured.
|
|
83
|
+
* Returns the removed items. Marks the store dirty for scene rebuild.
|
|
84
|
+
*/
|
|
85
|
+
remove(id: string | string[]): Record<string, any>[];
|
|
86
|
+
/**
|
|
87
|
+
* Update data items by ID. Requires dataIdAccessor.
|
|
88
|
+
* Returns the previous values. Categories and extents are rebuilt.
|
|
89
|
+
*/
|
|
90
|
+
update(id: string | string[], updater: (d: Record<string, any>) => Record<string, any>): Record<string, any>[];
|
|
80
91
|
clear(): void;
|
|
81
92
|
get size(): number;
|
|
82
93
|
getOAccessor(): (d: any) => string;
|
|
@@ -19,8 +19,12 @@ interface OrdinalSVGOverlayProps {
|
|
|
19
19
|
showCategoryTicks?: boolean;
|
|
20
20
|
oLabel?: string;
|
|
21
21
|
rLabel?: string;
|
|
22
|
-
oFormat?: (d: string, index?: number) => string;
|
|
22
|
+
oFormat?: (d: string, index?: number) => string | React.ReactNode;
|
|
23
23
|
rFormat?: (d: number) => string;
|
|
24
|
+
/** Custom tick values for the value (r) axis */
|
|
25
|
+
rTickValues?: number[];
|
|
26
|
+
/** Align first tick label to start, last to end */
|
|
27
|
+
tickLabelEdgeAlign?: boolean;
|
|
24
28
|
showGrid?: boolean;
|
|
25
29
|
title?: string | ReactNode;
|
|
26
30
|
legend?: ReactNode | {
|
|
@@ -63,6 +67,7 @@ interface OrdinalSVGUnderlayProps {
|
|
|
63
67
|
showAxes?: boolean;
|
|
64
68
|
showGrid?: boolean;
|
|
65
69
|
rFormat?: (d: number) => string;
|
|
70
|
+
rTickValues?: number[];
|
|
66
71
|
}
|
|
67
72
|
export declare function OrdinalSVGUnderlay(props: OrdinalSVGUnderlayProps): React.JSX.Element | null;
|
|
68
73
|
export declare function OrdinalSVGOverlay(props: OrdinalSVGOverlayProps): React.JSX.Element | null;
|
|
@@ -9,6 +9,8 @@ export interface PipelineConfig {
|
|
|
9
9
|
windowMode: WindowMode;
|
|
10
10
|
arrowOfTime: ArrowOfTime;
|
|
11
11
|
extentPadding: number;
|
|
12
|
+
/** Pixel inset on scale ranges to prevent glyph clipping at chart edges. Default 0. */
|
|
13
|
+
scalePadding?: number;
|
|
12
14
|
maxCapacity?: number;
|
|
13
15
|
xAccessor?: string | ((d: any) => number);
|
|
14
16
|
yAccessor?: string | ((d: any) => number);
|
|
@@ -19,7 +21,7 @@ export interface PipelineConfig {
|
|
|
19
21
|
groupAccessor?: string | ((d: any) => string);
|
|
20
22
|
categoryAccessor?: string | ((d: any) => string);
|
|
21
23
|
lineDataAccessor?: string;
|
|
22
|
-
xScaleType?: "linear" | "log";
|
|
24
|
+
xScaleType?: "linear" | "log" | "time";
|
|
23
25
|
yScaleType?: "linear" | "log";
|
|
24
26
|
xExtent?: [number | undefined, number | undefined] | [number];
|
|
25
27
|
yExtent?: [number | undefined, number | undefined] | [number];
|
|
@@ -31,12 +33,26 @@ export interface PipelineConfig {
|
|
|
31
33
|
lowAccessor?: string | ((d: any) => number);
|
|
32
34
|
closeAccessor?: string | ((d: any) => number);
|
|
33
35
|
candlestickStyle?: CandlestickStyle;
|
|
36
|
+
/** Internal: set by PipelineStore when open/close accessors are both missing */
|
|
37
|
+
candlestickRangeMode?: boolean;
|
|
34
38
|
boundsAccessor?: string | ((d: any) => number);
|
|
35
39
|
boundsStyle?: any;
|
|
36
40
|
y0Accessor?: string | ((d: any) => number);
|
|
37
41
|
gradientFill?: {
|
|
38
42
|
topOpacity: number;
|
|
39
43
|
bottomOpacity: number;
|
|
44
|
+
} | {
|
|
45
|
+
colorStops: Array<{
|
|
46
|
+
offset: number;
|
|
47
|
+
color: string;
|
|
48
|
+
}>;
|
|
49
|
+
};
|
|
50
|
+
areaGroups?: Set<string>;
|
|
51
|
+
lineGradient?: {
|
|
52
|
+
colorStops: Array<{
|
|
53
|
+
offset: number;
|
|
54
|
+
color: string;
|
|
55
|
+
}>;
|
|
40
56
|
};
|
|
41
57
|
lineStyle?: any;
|
|
42
58
|
pointStyle?: (d: any) => Style & {
|
|
@@ -181,6 +197,17 @@ export declare class PipelineStore {
|
|
|
181
197
|
*/
|
|
182
198
|
private getBufferArray;
|
|
183
199
|
getData(): Record<string, any>[];
|
|
200
|
+
/**
|
|
201
|
+
* Remove data points by ID. Requires pointIdAccessor to be configured.
|
|
202
|
+
* Returns the removed items. Marks the store dirty for scene rebuild.
|
|
203
|
+
*/
|
|
204
|
+
remove(id: string | string[]): Record<string, any>[];
|
|
205
|
+
/**
|
|
206
|
+
* Update data points by ID. Requires pointIdAccessor.
|
|
207
|
+
* The updater receives the current datum and returns the replacement.
|
|
208
|
+
* Returns the previous values. Extents and scene are marked dirty.
|
|
209
|
+
*/
|
|
210
|
+
update(id: string | string[], updater: (d: Record<string, any>) => Record<string, any>): Record<string, any>[];
|
|
184
211
|
/** Returns sorted bin boundary values from the last bar scene build. Persists until clear() or the next bar scene build. */
|
|
185
212
|
getBinBoundaries(): number[];
|
|
186
213
|
getExtents(): {
|
|
@@ -7,9 +7,15 @@ export interface AxisConfig {
|
|
|
7
7
|
orient: "left" | "right" | "top" | "bottom";
|
|
8
8
|
label?: string;
|
|
9
9
|
ticks?: number;
|
|
10
|
-
tickFormat?: (d: any, index?: number, allTicks?: number[]) => string;
|
|
10
|
+
tickFormat?: (d: any, index?: number, allTicks?: number[]) => string | ReactNode;
|
|
11
11
|
baseline?: boolean | "under";
|
|
12
12
|
jaggedBase?: boolean;
|
|
13
|
+
/** Grid line stroke style: "dashed" (6,4), "dotted" (2,4), or a custom strokeDasharray string. Applied to grid lines extending from ticks across the chart area. */
|
|
14
|
+
gridStyle?: "dashed" | "dotted" | string;
|
|
15
|
+
/** Always include the domain max as a tick, even if d3 omits it. */
|
|
16
|
+
includeMax?: boolean;
|
|
17
|
+
/** Auto-rotate labels 45° when horizontal spacing is too tight. */
|
|
18
|
+
autoRotate?: boolean;
|
|
13
19
|
/** Highlight ticks at time boundaries (new month, year, etc.) with semibold text.
|
|
14
20
|
* `true` auto-detects Date boundaries. A function receives (value, index) and returns true for landmark ticks. */
|
|
15
21
|
landmarkTicks?: boolean | ((value: any, index: number) => boolean);
|
|
@@ -32,8 +38,8 @@ interface SVGOverlayProps {
|
|
|
32
38
|
yLabel?: string;
|
|
33
39
|
/** Label for the right Y axis (dual-axis charts) */
|
|
34
40
|
yLabelRight?: string;
|
|
35
|
-
xFormat?: (d: any, index?: number, allTicks?: number[]) => string;
|
|
36
|
-
yFormat?: (d: any) => string;
|
|
41
|
+
xFormat?: (d: any, index?: number, allTicks?: number[]) => string | ReactNode;
|
|
42
|
+
yFormat?: (d: any) => string | ReactNode;
|
|
37
43
|
showGrid?: boolean;
|
|
38
44
|
title?: string | ReactNode;
|
|
39
45
|
legend?: ReactNode | {
|
|
@@ -96,8 +102,8 @@ interface SVGUnderlayProps {
|
|
|
96
102
|
showAxes?: boolean;
|
|
97
103
|
axes?: AxisConfig[];
|
|
98
104
|
showGrid?: boolean;
|
|
99
|
-
xFormat?: (d: any, index?: number, allTicks?: number[]) => string;
|
|
100
|
-
yFormat?: (d: any) => string;
|
|
105
|
+
xFormat?: (d: any, index?: number, allTicks?: number[]) => string | ReactNode;
|
|
106
|
+
yFormat?: (d: any) => string | ReactNode;
|
|
101
107
|
}
|
|
102
108
|
export declare function SVGUnderlay(props: SVGUnderlayProps): React.JSX.Element | null;
|
|
103
109
|
export declare function SVGOverlay(props: SVGOverlayProps): React.JSX.Element | null;
|
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
* the variable in the dependency array so the reference changes when behavior changes.
|
|
13
13
|
*/
|
|
14
14
|
export declare function accessorsEquivalent(a: string | ((...args: any[]) => any) | undefined, b: string | ((...args: any[]) => any) | undefined): boolean;
|
|
15
|
-
export declare function resolveAccessor<T
|
|
16
|
-
export declare function resolveRawAccessor<T
|
|
17
|
-
export declare function resolveStringAccessor<T
|
|
15
|
+
export declare function resolveAccessor<T extends Record<string, unknown>>(accessor: string | ((d: T) => number) | undefined, fallback: string): (d: T) => number;
|
|
16
|
+
export declare function resolveRawAccessor<T extends Record<string, unknown>>(accessor: string | ((d: T) => unknown) | undefined, fallback: string): (d: T) => unknown;
|
|
17
|
+
export declare function resolveStringAccessor<T extends Record<string, unknown>>(accessor: string | ((d: T) => string) | undefined, fallback?: string): ((d: T) => string) | undefined;
|
|
@@ -171,6 +171,8 @@ export interface StreamGeoFrameProps<T = Record<string, any>> {
|
|
|
171
171
|
export interface StreamGeoFrameHandle {
|
|
172
172
|
push(datum: Record<string, any>): void;
|
|
173
173
|
pushMany(data: Record<string, any>[]): void;
|
|
174
|
+
/** Remove points by ID. Requires pointIdAccessor. */
|
|
175
|
+
removePoint(id: string | string[]): Record<string, any>[];
|
|
174
176
|
clear(): void;
|
|
175
177
|
getProjection(): GeoProjection | null;
|
|
176
178
|
getGeoPath(): GeoPath<any, GeoPermissibleObjects> | null;
|
|
@@ -17,6 +17,21 @@ export declare function hitTestRect(px: number, py: number, node: {
|
|
|
17
17
|
w: number;
|
|
18
18
|
h: number;
|
|
19
19
|
}): RectHitResult;
|
|
20
|
+
/**
|
|
21
|
+
* Compute the effective hit radius for a point/circle node.
|
|
22
|
+
* Uses the larger of the visual radius + tolerance, Fitts's law minimum (12px),
|
|
23
|
+
* and the caller's maxDistance (default 30px).
|
|
24
|
+
*/
|
|
25
|
+
export declare function getHitRadius(nodeRadius: number | undefined, maxDistance?: number): number;
|
|
26
|
+
/**
|
|
27
|
+
* Convert a value to a Date if possible. Returns null for non-date values.
|
|
28
|
+
* Treats numbers > 1e9 as millisecond timestamps.
|
|
29
|
+
*/
|
|
30
|
+
export declare function toDate(value: any): Date | null;
|
|
31
|
+
/**
|
|
32
|
+
* Detect whether a tick marks a time boundary (new month or year) compared to the previous tick.
|
|
33
|
+
*/
|
|
34
|
+
export declare function isTimeLandmark(value: any, prevValue: any): boolean;
|
|
20
35
|
/**
|
|
21
36
|
* Normalize an angle to the [0, 2π) range.
|
|
22
37
|
*/
|
|
@@ -35,6 +35,9 @@ export interface RealtimeNode {
|
|
|
35
35
|
createdByFrame?: boolean;
|
|
36
36
|
sourceLinks?: RealtimeEdge[];
|
|
37
37
|
targetLinks?: RealtimeEdge[];
|
|
38
|
+
_pulseIntensity?: number;
|
|
39
|
+
_pulseColor?: string;
|
|
40
|
+
_pulseGlowRadius?: number;
|
|
38
41
|
}
|
|
39
42
|
export interface RealtimeEdge {
|
|
40
43
|
source: RealtimeNode | string;
|
|
@@ -56,6 +59,12 @@ export interface RealtimeEdge {
|
|
|
56
59
|
data?: Record<string, any>;
|
|
57
60
|
/** Unique key for this edge (supports parallel edges between same node pair) */
|
|
58
61
|
_edgeKey?: string;
|
|
62
|
+
_pulseIntensity?: number;
|
|
63
|
+
_pulseColor?: string;
|
|
64
|
+
_pulseGlowRadius?: number;
|
|
65
|
+
/** @internal Circular sankey layout fields */
|
|
66
|
+
_circularWidth?: number;
|
|
67
|
+
_circularStub?: boolean;
|
|
59
68
|
}
|
|
60
69
|
export interface BezierPoint {
|
|
61
70
|
x: number;
|
|
@@ -171,6 +180,9 @@ export interface NetworkArcNode {
|
|
|
171
180
|
datum: any;
|
|
172
181
|
id?: string;
|
|
173
182
|
label?: string;
|
|
183
|
+
_pulseIntensity?: number;
|
|
184
|
+
_pulseColor?: string;
|
|
185
|
+
_pulseGlowRadius?: number;
|
|
174
186
|
}
|
|
175
187
|
/** Line edge — used by force */
|
|
176
188
|
export interface NetworkLineEdge {
|
|
@@ -200,6 +212,8 @@ export interface NetworkRibbonEdge {
|
|
|
200
212
|
pathD: string;
|
|
201
213
|
style: Style;
|
|
202
214
|
datum: any;
|
|
215
|
+
_pulseIntensity?: number;
|
|
216
|
+
_pulseColor?: string;
|
|
203
217
|
}
|
|
204
218
|
/** Curved edge — used by tree, cluster */
|
|
205
219
|
export interface NetworkCurvedEdge {
|
|
@@ -207,6 +221,8 @@ export interface NetworkCurvedEdge {
|
|
|
207
221
|
pathD: string;
|
|
208
222
|
style: Style;
|
|
209
223
|
datum: any;
|
|
224
|
+
_pulseIntensity?: number;
|
|
225
|
+
_pulseColor?: string;
|
|
210
226
|
}
|
|
211
227
|
export type NetworkSceneNode = NetworkCircleNode | NetworkRectNode | NetworkArcNode;
|
|
212
228
|
export type NetworkSceneEdge = NetworkLineEdge | NetworkBezierEdge | NetworkRibbonEdge | NetworkCurvedEdge;
|
|
@@ -333,6 +349,15 @@ export interface NetworkPipelineConfig {
|
|
|
333
349
|
orbitShowRings?: boolean;
|
|
334
350
|
/** Enable orbit animation. @default true */
|
|
335
351
|
orbitAnimated?: boolean;
|
|
352
|
+
/** @internal Hierarchy root stashed for tree/treemap/circlepack plugins */
|
|
353
|
+
__hierarchyRoot?: unknown;
|
|
354
|
+
/** @internal Orbit animation state preserved across config updates */
|
|
355
|
+
__orbitState?: unknown;
|
|
356
|
+
/** @internal Previous node positions for warm-start force layout */
|
|
357
|
+
__previousPositions?: Map<string, {
|
|
358
|
+
x: number;
|
|
359
|
+
y: number;
|
|
360
|
+
}>;
|
|
336
361
|
}
|
|
337
362
|
export interface StreamNetworkFrameProps<T = Record<string, any>> {
|
|
338
363
|
chartType: NetworkChartType;
|
|
@@ -450,6 +475,14 @@ export interface StreamNetworkFrameProps<T = Record<string, any>> {
|
|
|
450
475
|
export interface StreamNetworkFrameHandle {
|
|
451
476
|
push(edge: EdgePush): void;
|
|
452
477
|
pushMany(edges: EdgePush[]): void;
|
|
478
|
+
/** Remove a node by ID. Also removes connected edges. */
|
|
479
|
+
removeNode(id: string): boolean;
|
|
480
|
+
/** Remove all edges between source and target node IDs. */
|
|
481
|
+
removeEdge(sourceId: string, targetId: string): boolean;
|
|
482
|
+
/** Update a node's data by ID. Returns previous data. */
|
|
483
|
+
updateNode(id: string, updater: (data: Record<string, any>) => Record<string, any>): Record<string, any> | null;
|
|
484
|
+
/** Update all edges between source+target. Returns array of previous data. */
|
|
485
|
+
updateEdge(sourceId: string, targetId: string, updater: (data: Record<string, any>) => Record<string, any>): Record<string, any>[];
|
|
453
486
|
clear(): void;
|
|
454
487
|
getTopology(): {
|
|
455
488
|
nodes: RealtimeNode[];
|
|
@@ -20,12 +20,11 @@ export interface WedgeSceneNode {
|
|
|
20
20
|
style: Style;
|
|
21
21
|
datum: any;
|
|
22
22
|
category?: string;
|
|
23
|
-
/** Pulse intensity 0–1 (set when aggregated category value changes) */
|
|
24
23
|
_pulseIntensity?: number;
|
|
25
|
-
/** Pulse color */
|
|
26
24
|
_pulseColor?: string;
|
|
27
|
-
|
|
25
|
+
_pulseGlowRadius?: number;
|
|
28
26
|
_targetOpacity?: number;
|
|
27
|
+
_transitionKey?: string;
|
|
29
28
|
}
|
|
30
29
|
export interface BoxplotSceneNode {
|
|
31
30
|
type: "boxplot";
|
|
@@ -51,7 +50,11 @@ export interface BoxplotSceneNode {
|
|
|
51
50
|
value: number;
|
|
52
51
|
datum: any;
|
|
53
52
|
}[];
|
|
53
|
+
_pulseIntensity?: number;
|
|
54
|
+
_pulseColor?: string;
|
|
55
|
+
_pulseGlowRadius?: number;
|
|
54
56
|
_targetOpacity?: number;
|
|
57
|
+
_transitionKey?: string;
|
|
55
58
|
}
|
|
56
59
|
export interface DistributionStats {
|
|
57
60
|
n: number;
|
|
@@ -89,7 +92,11 @@ export interface ViolinSceneNode {
|
|
|
89
92
|
style: Style;
|
|
90
93
|
datum: any;
|
|
91
94
|
category?: string;
|
|
95
|
+
_pulseIntensity?: number;
|
|
96
|
+
_pulseColor?: string;
|
|
97
|
+
_pulseGlowRadius?: number;
|
|
92
98
|
_targetOpacity?: number;
|
|
99
|
+
_transitionKey?: string;
|
|
93
100
|
}
|
|
94
101
|
export interface ConnectorSceneNode {
|
|
95
102
|
type: "connector";
|
|
@@ -100,7 +107,11 @@ export interface ConnectorSceneNode {
|
|
|
100
107
|
style: Style;
|
|
101
108
|
datum: any;
|
|
102
109
|
group?: string;
|
|
110
|
+
_pulseIntensity?: number;
|
|
111
|
+
_pulseColor?: string;
|
|
112
|
+
_pulseGlowRadius?: number;
|
|
103
113
|
_targetOpacity?: number;
|
|
114
|
+
_transitionKey?: string;
|
|
104
115
|
}
|
|
105
116
|
export interface TrapezoidSceneNode {
|
|
106
117
|
type: "trapezoid";
|
|
@@ -109,7 +120,11 @@ export interface TrapezoidSceneNode {
|
|
|
109
120
|
style: Style;
|
|
110
121
|
datum: any;
|
|
111
122
|
category?: string;
|
|
123
|
+
_pulseIntensity?: number;
|
|
124
|
+
_pulseColor?: string;
|
|
125
|
+
_pulseGlowRadius?: number;
|
|
112
126
|
_targetOpacity?: number;
|
|
127
|
+
_transitionKey?: string;
|
|
113
128
|
}
|
|
114
129
|
export type { Style, PointSceneNode, RectSceneNode } from "./types";
|
|
115
130
|
import type { PointSceneNode, RectSceneNode } from "./types";
|
|
@@ -146,9 +161,13 @@ export interface OrdinalPipelineConfig {
|
|
|
146
161
|
rExtent?: [number?, number?];
|
|
147
162
|
oExtent?: string[];
|
|
148
163
|
barPadding?: number;
|
|
164
|
+
/** When true, adds padding below the 0 baseline. When false (default), bars are flush with the axis line. */
|
|
165
|
+
baselinePadding?: boolean;
|
|
149
166
|
innerRadius?: number;
|
|
150
167
|
normalize?: boolean;
|
|
151
168
|
startAngle?: number;
|
|
169
|
+
/** Total arc sweep in degrees (default 360 = full circle). Used by GaugeChart for partial arcs. */
|
|
170
|
+
sweepAngle?: number;
|
|
152
171
|
bins?: number;
|
|
153
172
|
showOutliers?: boolean;
|
|
154
173
|
showIQR?: boolean;
|
|
@@ -163,6 +182,8 @@ export interface OrdinalPipelineConfig {
|
|
|
163
182
|
summaryStyle?: (d: any, category?: string) => Style;
|
|
164
183
|
colorScheme?: string | string[];
|
|
165
184
|
barColors?: Record<string, string>;
|
|
185
|
+
/** ID accessor for remove() — extracts a unique identifier from each datum */
|
|
186
|
+
dataIdAccessor?: string | ((d: any) => string);
|
|
166
187
|
decay?: DecayConfig;
|
|
167
188
|
pulse?: PulseConfig;
|
|
168
189
|
transition?: TransitionConfig;
|
|
@@ -192,9 +213,11 @@ export interface StreamOrdinalFrameProps<T = Record<string, any>> {
|
|
|
192
213
|
left?: number;
|
|
193
214
|
};
|
|
194
215
|
barPadding?: number;
|
|
216
|
+
baselinePadding?: boolean;
|
|
195
217
|
innerRadius?: number;
|
|
196
218
|
normalize?: boolean;
|
|
197
219
|
startAngle?: number;
|
|
220
|
+
sweepAngle?: number;
|
|
198
221
|
dynamicColumnWidth?: string | ((data: T[]) => number);
|
|
199
222
|
bins?: number;
|
|
200
223
|
showOutliers?: boolean;
|
|
@@ -211,6 +234,12 @@ export interface StreamOrdinalFrameProps<T = Record<string, any>> {
|
|
|
211
234
|
windowSize?: number;
|
|
212
235
|
connectorAccessor?: string | ((d: T) => string);
|
|
213
236
|
connectorStyle?: Style | ((d: any) => Style);
|
|
237
|
+
/** ID accessor for remove()/update() — extracts a unique identifier from each datum */
|
|
238
|
+
dataIdAccessor?: string | ((d: any) => string);
|
|
239
|
+
/** Custom tick values for the value (r) axis. Overrides the default d3 ticks. */
|
|
240
|
+
rTickValues?: number[];
|
|
241
|
+
/** Align first tick label to start and last tick label to end. Default false. */
|
|
242
|
+
tickLabelEdgeAlign?: boolean;
|
|
214
243
|
pieceStyle?: (d: any, category?: string) => Style;
|
|
215
244
|
summaryStyle?: (d: any, category?: string) => Style;
|
|
216
245
|
colorScheme?: string | string[];
|
|
@@ -219,7 +248,7 @@ export interface StreamOrdinalFrameProps<T = Record<string, any>> {
|
|
|
219
248
|
showCategoryTicks?: boolean;
|
|
220
249
|
oLabel?: string;
|
|
221
250
|
rLabel?: string;
|
|
222
|
-
oFormat?: (d: string, index?: number) => string;
|
|
251
|
+
oFormat?: (d: string, index?: number) => string | ReactNode;
|
|
223
252
|
rFormat?: (d: number | string) => string;
|
|
224
253
|
enableHover?: boolean;
|
|
225
254
|
hoverAnnotation?: boolean | HoverAnnotationConfig;
|
|
@@ -270,6 +299,10 @@ export interface StreamOrdinalFrameProps<T = Record<string, any>> {
|
|
|
270
299
|
export interface StreamOrdinalFrameHandle<T = Record<string, any>> {
|
|
271
300
|
push(datum: T): void;
|
|
272
301
|
pushMany(data: T[]): void;
|
|
302
|
+
/** Remove data items by ID. Requires dataIdAccessor. */
|
|
303
|
+
remove(id: string | string[]): T[];
|
|
304
|
+
/** Update data items by ID in place. Requires dataIdAccessor. Returns previous values. */
|
|
305
|
+
update(id: string | string[], updater: (d: T) => T): T[];
|
|
273
306
|
clear(): void;
|
|
274
307
|
getData(): T[];
|
|
275
308
|
getScales(): OrdinalScales | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve a CSS custom property value to a concrete color string.
|
|
3
|
+
*
|
|
4
|
+
* If the input is a `var(--name)` or `var(--name, fallback)` string,
|
|
5
|
+
* reads the computed value from the canvas element. Otherwise returns
|
|
6
|
+
* the input unchanged.
|
|
7
|
+
*
|
|
8
|
+
* Per-canvas cache avoids repeated getComputedStyle calls within a single
|
|
9
|
+
* paint cycle. The cache is cleared on theme changes via clearCSSColorCache(),
|
|
10
|
+
* which each Stream Frame calls in its theme-change useEffect.
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveCSSColor(ctx: CanvasRenderingContext2D, value: string | undefined): string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Clear the per-canvas CSS variable cache. Called by Stream Frames
|
|
15
|
+
* when the theme changes so the next paint reads fresh computed values.
|
|
16
|
+
*/
|
|
17
|
+
export declare function clearCSSColorCache(canvas: HTMLCanvasElement): void;
|