semiotic 3.4.0 → 3.4.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/CLAUDE.md +16 -3
- package/ai/schema.json +42 -1
- package/ai/system-prompt.md +4 -0
- package/dist/components/Annotation.d.ts +42 -2
- package/dist/components/CategoryColors.d.ts +1 -1
- package/dist/components/ChartGrid.d.ts +1 -1
- package/dist/components/ContextLayout.d.ts +1 -1
- package/dist/components/DataSummaryContext.d.ts +1 -1
- package/dist/components/DetailsPanel.d.ts +3 -2
- package/dist/components/Legend.d.ts +2 -3
- package/dist/components/LinkedCharts.d.ts +1 -1
- package/dist/components/ThemeProvider.d.ts +1 -1
- package/dist/components/Tooltip/FlippingTooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +4 -3
- package/dist/components/charts/geo/ChoroplethMap.d.ts +4 -4
- package/dist/components/charts/geo/DistanceCartogram.d.ts +5 -4
- package/dist/components/charts/geo/FlowMap.d.ts +4 -4
- package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +4 -3
- package/dist/components/charts/index.d.ts +2 -0
- package/dist/components/charts/network/ChordDiagram.d.ts +4 -3
- package/dist/components/charts/network/CirclePack.d.ts +3 -3
- package/dist/components/charts/network/ForceDirectedGraph.d.ts +3 -2
- package/dist/components/charts/network/OrbitDiagram.d.ts +6 -5
- package/dist/components/charts/network/SankeyDiagram.d.ts +4 -3
- package/dist/components/charts/network/TreeDiagram.d.ts +3 -3
- package/dist/components/charts/network/Treemap.d.ts +3 -3
- package/dist/components/charts/ordinal/BarChart.d.ts +24 -4
- package/dist/components/charts/ordinal/BoxPlot.d.ts +4 -3
- package/dist/components/charts/ordinal/DonutChart.d.ts +4 -3
- package/dist/components/charts/ordinal/DotPlot.d.ts +4 -3
- package/dist/components/charts/ordinal/FunnelChart.d.ts +4 -3
- package/dist/components/charts/ordinal/GaugeChart.d.ts +2 -1
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +4 -3
- package/dist/components/charts/ordinal/Histogram.d.ts +4 -3
- package/dist/components/charts/ordinal/LikertChart.d.ts +4 -3
- package/dist/components/charts/ordinal/PieChart.d.ts +4 -3
- package/dist/components/charts/ordinal/RidgelinePlot.d.ts +4 -3
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +4 -3
- package/dist/components/charts/ordinal/SwarmPlot.d.ts +4 -3
- package/dist/components/charts/ordinal/SwimlaneChart.d.ts +4 -3
- package/dist/components/charts/ordinal/ViolinPlot.d.ts +4 -3
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +7 -6
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +10 -7
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +9 -6
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +7 -6
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +9 -6
- package/dist/components/charts/shared/ChartError.d.ts +1 -2
- package/dist/components/charts/shared/annotationResolvers.d.ts +4 -3
- package/dist/components/charts/shared/annotationRules.d.ts +2 -1
- package/dist/components/charts/shared/colorUtils.d.ts +4 -3
- package/dist/components/charts/shared/datumTypes.d.ts +20 -0
- package/dist/components/charts/shared/diagnoseConfig.d.ts +2 -7
- package/dist/components/charts/shared/formatUtils.d.ts +4 -2
- package/dist/components/charts/shared/hooks.d.ts +27 -23
- package/dist/components/charts/shared/legendUtils.d.ts +3 -2
- package/dist/components/charts/shared/mergeShapeStyle.d.ts +43 -0
- package/dist/components/charts/shared/networkUtils.d.ts +7 -6
- package/dist/components/charts/shared/selectionUtils.d.ts +5 -4
- package/dist/components/charts/shared/statisticalOverlays.d.ts +14 -26
- package/dist/components/charts/shared/statisticalOverlaysLazy.d.ts +2 -2
- package/dist/components/charts/shared/statsTooltip.d.ts +3 -2
- package/dist/components/charts/shared/tooltipUtils.d.ts +7 -6
- package/dist/components/charts/shared/types.d.ts +22 -13
- package/dist/components/charts/shared/useChartSetup.d.ts +7 -6
- package/dist/components/charts/shared/useLikertAggregation.d.ts +18 -7
- package/dist/components/charts/shared/useOrdinalStreaming.d.ts +3 -2
- package/dist/components/charts/shared/useStreamingLegend.d.ts +2 -1
- package/dist/components/charts/shared/validateChartData.d.ts +2 -1
- package/dist/components/charts/shared/validateProps.d.ts +2 -8
- package/dist/components/charts/shared/withChartWrapper.d.ts +1 -1
- package/dist/components/charts/xy/AreaChart.d.ts +4 -3
- package/dist/components/charts/xy/BubbleChart.d.ts +4 -3
- package/dist/components/charts/xy/CandlestickChart.d.ts +47 -0
- package/dist/components/charts/xy/ConnectedScatterplot.d.ts +4 -3
- package/dist/components/charts/xy/Heatmap.d.ts +12 -7
- package/dist/components/charts/xy/LineChart.d.ts +4 -3
- package/dist/components/charts/xy/MinimapChart.d.ts +4 -4
- package/dist/components/charts/xy/MultiAxisLineChart.d.ts +5 -4
- package/dist/components/charts/xy/QuadrantChart.d.ts +4 -3
- package/dist/components/charts/xy/Scatterplot.d.ts +4 -3
- package/dist/components/charts/xy/ScatterplotMatrix.d.ts +3 -3
- package/dist/components/charts/xy/StackedAreaChart.d.ts +4 -3
- package/dist/components/data/transforms.d.ts +8 -7
- package/dist/components/export/chartConfig.d.ts +4 -3
- package/dist/components/export/selectionSerializer.d.ts +1 -1
- package/dist/components/geo/mergeData.d.ts +2 -1
- package/dist/components/realtime/BinAccumulator.d.ts +3 -2
- package/dist/components/realtime/renderers/types.d.ts +2 -1
- package/dist/components/realtime/renderers/waterfallRenderer.d.ts +2 -1
- package/dist/components/realtime/types.d.ts +25 -21
- package/dist/components/semiotic-themes.d.ts +2 -1
- package/dist/components/semiotic-xy.d.ts +2 -0
- package/dist/components/semiotic.d.ts +3 -3
- package/dist/components/server/animatedGif.d.ts +4 -18
- package/dist/components/server/renderToStaticSVG.d.ts +5 -4
- package/dist/components/server/serverChartConfigs.d.ts +2 -10
- package/dist/components/server/staticAnnotations.d.ts +2 -1
- package/dist/components/server/staticLegend.d.ts +2 -1
- package/dist/components/store/ObservationStore.d.ts +4 -3
- package/dist/components/store/SelectionStore.d.ts +4 -9
- package/dist/components/store/ThemeStore.d.ts +32 -4
- package/dist/components/store/TooltipStore.d.ts +6 -2
- package/dist/components/store/useSelection.d.ts +13 -9
- package/dist/components/stream/AccessibleDataTable.d.ts +5 -5
- package/dist/components/stream/CanvasHitTester.d.ts +2 -1
- package/dist/components/stream/DataSourceAdapter.d.ts +2 -1
- package/dist/components/stream/FocusRing.d.ts +1 -2
- package/dist/components/stream/GeoParticlePool.d.ts +2 -1
- package/dist/components/stream/GeoPipelineStore.d.ts +7 -6
- package/dist/components/stream/MarginalGraphics.d.ts +1 -2
- package/dist/components/stream/NetworkPipelineStore.d.ts +3 -2
- package/dist/components/stream/NetworkSVGOverlay.d.ts +21 -15
- package/dist/components/stream/OrdinalBrushOverlay.d.ts +1 -19
- package/dist/components/stream/OrdinalPipelineStore.d.ts +6 -5
- package/dist/components/stream/OrdinalSVGOverlay.d.ts +6 -5
- package/dist/components/stream/PipelineStore.d.ts +63 -28
- package/dist/components/stream/SVGOverlay.d.ts +10 -10
- package/dist/components/stream/SceneGraph.d.ts +6 -5
- package/dist/components/stream/StreamGeoFrame.d.ts +2 -1
- package/dist/components/stream/StreamNetworkFrame.d.ts +2 -1
- package/dist/components/stream/StreamOrdinalFrame.d.ts +2 -1
- package/dist/components/stream/StreamXYFrame.d.ts +2 -1
- package/dist/components/stream/XYBrushOverlay.d.ts +1 -21
- package/dist/components/stream/devDataAccessWarning.d.ts +2 -11
- package/dist/components/stream/geoTypes.d.ts +43 -24
- package/dist/components/stream/hoverUtils.d.ts +2 -1
- package/dist/components/stream/keyboardNav.d.ts +18 -6
- package/dist/components/stream/layouts/hierarchySceneBuilders.d.ts +4 -3
- package/dist/components/stream/layouts/hierarchyUtils.d.ts +4 -3
- package/dist/components/stream/networkTypes.d.ts +73 -47
- package/dist/components/stream/ordinalSceneBuilders/barFunnelScene.d.ts +1 -1
- package/dist/components/stream/ordinalSceneBuilders/barScene.d.ts +2 -2
- package/dist/components/stream/ordinalSceneBuilders/connectorScene.d.ts +1 -1
- package/dist/components/stream/ordinalSceneBuilders/pointScene.d.ts +2 -2
- package/dist/components/stream/ordinalSceneBuilders/statisticalScene.d.ts +4 -4
- package/dist/components/stream/ordinalSceneBuilders/swimlaneScene.d.ts +1 -1
- package/dist/components/stream/ordinalSceneBuilders/timelineScene.d.ts +1 -1
- package/dist/components/stream/ordinalSceneBuilders/types.d.ts +9 -8
- package/dist/components/stream/ordinalTypes.d.ts +65 -33
- package/dist/components/stream/pipelineDecay.d.ts +2 -1
- package/dist/components/stream/pipelinePulse.d.ts +2 -1
- package/dist/components/stream/pipelineTransitions.d.ts +16 -4
- package/dist/components/stream/renderers/colorUtils.d.ts +20 -0
- package/dist/components/stream/types.d.ts +58 -17
- package/dist/components/stream/xySceneBuilders/areaScene.d.ts +3 -2
- package/dist/components/stream/xySceneBuilders/barScene.d.ts +2 -1
- package/dist/components/stream/xySceneBuilders/boundsScene.d.ts +2 -1
- package/dist/components/stream/xySceneBuilders/candlestickScene.d.ts +2 -1
- package/dist/components/stream/xySceneBuilders/emitPointNodes.d.ts +3 -2
- package/dist/components/stream/xySceneBuilders/heatmapScene.d.ts +2 -1
- package/dist/components/stream/xySceneBuilders/lineScene.d.ts +2 -1
- package/dist/components/stream/xySceneBuilders/mixedScene.d.ts +2 -1
- package/dist/components/stream/xySceneBuilders/pointScene.d.ts +2 -1
- package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +2 -1
- package/dist/components/stream/xySceneBuilders/types.d.ts +35 -26
- package/dist/components/stream/xySceneBuilders/waterfallScene.d.ts +2 -1
- package/dist/components/types/marginType.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-statisticalOverlays-Ckd_jM8z.js +1 -0
- package/dist/semiotic-themes.d.ts +2 -1
- package/dist/semiotic-themes.min.js +1 -1
- package/dist/semiotic-themes.module.min.js +1 -1
- package/dist/semiotic-utils.min.js +1 -1
- package/dist/semiotic-utils.module.min.js +1 -1
- package/dist/semiotic-xy.d.ts +2 -0
- 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/test-utils/canvasMock.d.ts +10 -2
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +38 -32
- package/dist/components/types/annotationTypes.d.ts +0 -145
- package/dist/components/types/generalTypes.d.ts +0 -241
- package/dist/components/types/interactionTypes.d.ts +0 -72
- package/dist/components/types/networkTypes.d.ts +0 -174
- package/dist/components/types/ordinalTypes.d.ts +0 -112
- package/dist/semiotic-statisticalOverlays-DGX_WWc5.js +0 -1
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import type { SceneNode, TransitionConfig } from "./types";
|
|
14
14
|
import type { ActiveTransition } from "./pipelineTransitionUtils";
|
|
15
|
+
import type { Datum } from "../charts/shared/datumTypes";
|
|
15
16
|
export type PrevPosition = {
|
|
16
17
|
x: number;
|
|
17
18
|
y: number;
|
|
@@ -19,6 +20,10 @@ export type PrevPosition = {
|
|
|
19
20
|
h?: number;
|
|
20
21
|
r?: number;
|
|
21
22
|
opacity?: number;
|
|
23
|
+
openY?: number;
|
|
24
|
+
closeY?: number;
|
|
25
|
+
highY?: number;
|
|
26
|
+
lowY?: number;
|
|
22
27
|
};
|
|
23
28
|
export type PrevPath = {
|
|
24
29
|
topPath?: [number, number][];
|
|
@@ -29,12 +34,19 @@ export type PrevPath = {
|
|
|
29
34
|
/** Context needed from PipelineStore for identity resolution */
|
|
30
35
|
export interface TransitionContext {
|
|
31
36
|
runtimeMode?: "streaming" | "bounded";
|
|
32
|
-
getX: (d:
|
|
33
|
-
getY: (d:
|
|
34
|
-
getCategory?: (d:
|
|
37
|
+
getX: (d: Datum) => number;
|
|
38
|
+
getY: (d: Datum) => number;
|
|
39
|
+
getCategory?: (d: Datum) => string;
|
|
35
40
|
}
|
|
36
41
|
/**
|
|
37
42
|
* Get a stable identity key for a scene node.
|
|
43
|
+
*
|
|
44
|
+
* Exit stubs (created during startTransition for scrolled-off nodes) have
|
|
45
|
+
* `datum: null` and carry their original identity on `_transitionKey`. If a
|
|
46
|
+
* new transition starts while exits are still in the scene, resolving their
|
|
47
|
+
* identity via the datum-less fallback (e.g. `c:${index}`) would reshuffle
|
|
48
|
+
* which exit matches which key on the next snapshot. Preferring the stored
|
|
49
|
+
* `_transitionKey` keeps exits stable across overlapping transitions.
|
|
38
50
|
*/
|
|
39
51
|
export declare function getNodeIdentity(ctx: TransitionContext, node: SceneNode, index: number): string | null;
|
|
40
52
|
/**
|
|
@@ -56,4 +68,4 @@ export declare function startTransition(ctx: TransitionContext, transition: Tran
|
|
|
56
68
|
* Advance the transition animation. Returns true if still animating.
|
|
57
69
|
* Mutates scene nodes in place.
|
|
58
70
|
*/
|
|
59
|
-
export declare function advanceTransition(now: number, transition: TransitionConfig, state: TransitionState, prevPositionMap: Map<string, PrevPosition>,
|
|
71
|
+
export declare function advanceTransition(now: number, transition: TransitionConfig, state: TransitionState, prevPositionMap: Map<string, PrevPosition>, _prevPathMap: Map<string, PrevPath>): boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color utilities shared across canvas renderers.
|
|
3
|
+
*
|
|
4
|
+
* Kept here (not in layouts/hierarchyUtils or a deeper shared module) so
|
|
5
|
+
* renderers don't reach into unrelated layers for primitive helpers.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Resolve any valid CSS color string to an [r, g, b] tuple.
|
|
9
|
+
*
|
|
10
|
+
* Uses the canvas's own fillStyle round-trip to normalize first: assigning a
|
|
11
|
+
* CSS color to `ctx.fillStyle` and reading it back always yields `#rrggbb`
|
|
12
|
+
* or `rgba(r, g, b, a)`. That means named colors (`red`, `steelblue`), hsl(),
|
|
13
|
+
* and any other valid CSS form work the same as hex and rgb. Without the
|
|
14
|
+
* normalization pass a bare regex parser silently falls back on anything it
|
|
15
|
+
* doesn't match — gradients from named colors would render gray.
|
|
16
|
+
*
|
|
17
|
+
* The prior fillStyle is restored so this is callable from the middle of a
|
|
18
|
+
* draw without disturbing in-progress paint state.
|
|
19
|
+
*/
|
|
20
|
+
export declare function parseCanvasColor(ctx: CanvasRenderingContext2D, color: string): [number, number, number];
|
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import type { ScaleLinear } from "d3-scale";
|
|
3
3
|
import type { AnimateProp } from "./pipelineTransitionUtils";
|
|
4
|
+
import type { LegendGroup, GradientLegendConfig } from "../types/legendTypes";
|
|
4
5
|
import type { ArrowOfTime, WindowMode, LineStyle, BarStyle, WaterfallStyle, SwarmStyle, HoverAnnotationConfig, HoverData, AnnotationContext, AnnotationAnchorMode } from "../realtime/types";
|
|
6
|
+
import type { Datum } from "../charts/shared/datumTypes";
|
|
7
|
+
export type SceneDatum = Datum | null;
|
|
8
|
+
export type SeriesDatum = Datum[] | null;
|
|
9
|
+
export type AxisTickFormat = ((d: number, index?: number, allTicks?: number[]) => string) | ((d: string, index?: number, allTicks?: number[]) => string) | ((d: Date, index?: number, allTicks?: number[]) => string);
|
|
10
|
+
export interface ThemeSemanticColors {
|
|
11
|
+
primary?: string;
|
|
12
|
+
secondary?: string;
|
|
13
|
+
success?: string;
|
|
14
|
+
danger?: string;
|
|
15
|
+
warning?: string;
|
|
16
|
+
error?: string;
|
|
17
|
+
info?: string;
|
|
18
|
+
text?: string;
|
|
19
|
+
textSecondary?: string;
|
|
20
|
+
border?: string;
|
|
21
|
+
grid?: string;
|
|
22
|
+
surface?: string;
|
|
23
|
+
}
|
|
5
24
|
export interface DecayConfig {
|
|
6
25
|
type: "linear" | "exponential" | "step";
|
|
7
26
|
/** Exponential: half-life in buffer positions (default: bufferSize/2) */
|
|
@@ -85,7 +104,7 @@ export interface LineSceneNode {
|
|
|
85
104
|
/** Threshold-based color segments */
|
|
86
105
|
colorThresholds?: LineColorThreshold[];
|
|
87
106
|
style: Style;
|
|
88
|
-
datum:
|
|
107
|
+
datum: SeriesDatum;
|
|
89
108
|
group?: string;
|
|
90
109
|
/** Horizontal gradient for the line stroke */
|
|
91
110
|
strokeGradient?: {
|
|
@@ -116,7 +135,7 @@ export interface AreaSceneNode {
|
|
|
116
135
|
topPath: [number, number][];
|
|
117
136
|
bottomPath: [number, number][];
|
|
118
137
|
style: Style;
|
|
119
|
-
datum:
|
|
138
|
+
datum: SeriesDatum;
|
|
120
139
|
group?: string;
|
|
121
140
|
/** Gradient fill: opacity-based (topOpacity/bottomOpacity) or multi-color (colorStops) */
|
|
122
141
|
fillGradient?: {
|
|
@@ -168,7 +187,7 @@ export interface PointSceneNode {
|
|
|
168
187
|
y: number;
|
|
169
188
|
r: number;
|
|
170
189
|
style: Style;
|
|
171
|
-
datum:
|
|
190
|
+
datum: SceneDatum;
|
|
172
191
|
/** Optional unique identifier for point-anchored annotations */
|
|
173
192
|
pointId?: string;
|
|
174
193
|
/** Pulse glow intensity 0–1 (set by PipelineStore when pulse is active) */
|
|
@@ -194,10 +213,25 @@ export interface RectSceneNode {
|
|
|
194
213
|
h: number;
|
|
195
214
|
/** Rounded corner radius on the end away from the baseline */
|
|
196
215
|
roundedTop?: number;
|
|
197
|
-
/** Which edge
|
|
216
|
+
/** Which edge is the "tip" (opposite the baseline): "top"/"bottom" for
|
|
217
|
+
* vertical orientation, "right"/"left" for horizontal. Used by the
|
|
218
|
+
* renderer for rounded-corner placement AND gradient direction. Set by
|
|
219
|
+
* bar scene builders unconditionally so gradients resolve without
|
|
220
|
+
* requiring roundedTop. */
|
|
198
221
|
roundedEdge?: "top" | "bottom" | "right" | "left";
|
|
222
|
+
/** Gradient fill — same shape as the area-scene version. Runs tip → base
|
|
223
|
+
* along the bar axis (inferred from `roundedEdge`). */
|
|
224
|
+
fillGradient?: {
|
|
225
|
+
topOpacity: number;
|
|
226
|
+
bottomOpacity: number;
|
|
227
|
+
} | {
|
|
228
|
+
colorStops: Array<{
|
|
229
|
+
offset: number;
|
|
230
|
+
color: string;
|
|
231
|
+
}>;
|
|
232
|
+
};
|
|
199
233
|
style: Style;
|
|
200
|
-
datum:
|
|
234
|
+
datum: SceneDatum;
|
|
201
235
|
group?: string;
|
|
202
236
|
_pulseIntensity?: number;
|
|
203
237
|
_pulseColor?: string;
|
|
@@ -219,7 +253,7 @@ export interface HeatcellSceneNode {
|
|
|
219
253
|
w: number;
|
|
220
254
|
h: number;
|
|
221
255
|
fill: string;
|
|
222
|
-
datum:
|
|
256
|
+
datum: SceneDatum;
|
|
223
257
|
/** Optional style object (used for decay/transition opacity on heatmap cells) */
|
|
224
258
|
style?: Style;
|
|
225
259
|
/** Numeric cell value (for canvas text rendering when showValues is enabled) */
|
|
@@ -256,7 +290,7 @@ export interface CandlestickSceneNode {
|
|
|
256
290
|
isUp: boolean;
|
|
257
291
|
/** Range/dumbbell mode — no body, endpoint dots instead */
|
|
258
292
|
isRange?: boolean;
|
|
259
|
-
datum:
|
|
293
|
+
datum: SceneDatum;
|
|
260
294
|
/** Optional style object (used during transition opacity animations) */
|
|
261
295
|
style?: Style;
|
|
262
296
|
_pulseIntensity?: number;
|
|
@@ -268,6 +302,13 @@ export interface CandlestickSceneNode {
|
|
|
268
302
|
_decayOpacity?: number;
|
|
269
303
|
/** Stable identity key for transition tracking */
|
|
270
304
|
_transitionKey?: string;
|
|
305
|
+
/** Geometry targets — set during a transition so advanceTransition can lerp
|
|
306
|
+
* toward them from the snapshotted prev position. Cleared on completion. */
|
|
307
|
+
_targetX?: number;
|
|
308
|
+
_targetOpenY?: number;
|
|
309
|
+
_targetCloseY?: number;
|
|
310
|
+
_targetHighY?: number;
|
|
311
|
+
_targetLowY?: number;
|
|
271
312
|
}
|
|
272
313
|
export interface CandlestickStyle {
|
|
273
314
|
upColor?: string;
|
|
@@ -278,7 +319,7 @@ export interface CandlestickStyle {
|
|
|
278
319
|
/** Single color for range/dumbbell mode (replaces up/down when no open/close provided) */
|
|
279
320
|
rangeColor?: string;
|
|
280
321
|
}
|
|
281
|
-
export interface Changeset<T =
|
|
322
|
+
export interface Changeset<T = Datum> {
|
|
282
323
|
inserts: T[];
|
|
283
324
|
bounded: boolean;
|
|
284
325
|
/** Hint: total dataset size when progressively chunking bounded data */
|
|
@@ -307,7 +348,7 @@ export interface StreamLayout {
|
|
|
307
348
|
height: number;
|
|
308
349
|
}
|
|
309
350
|
export type CurveType = "linear" | "monotoneX" | "monotoneY" | "step" | "stepAfter" | "stepBefore" | "basis" | "cardinal" | "catmullRom" | "natural";
|
|
310
|
-
export interface StreamXYFrameProps<T =
|
|
351
|
+
export interface StreamXYFrameProps<T = Datum> {
|
|
311
352
|
chartType: StreamChartType;
|
|
312
353
|
runtimeMode?: RuntimeMode;
|
|
313
354
|
data?: T[];
|
|
@@ -409,7 +450,7 @@ export interface StreamXYFrameProps<T = Record<string, any>> {
|
|
|
409
450
|
orient: "left" | "right" | "top" | "bottom";
|
|
410
451
|
label?: string;
|
|
411
452
|
ticks?: number;
|
|
412
|
-
tickFormat?:
|
|
453
|
+
tickFormat?: AxisTickFormat;
|
|
413
454
|
baseline?: boolean | "under";
|
|
414
455
|
jaggedBase?: boolean;
|
|
415
456
|
}>;
|
|
@@ -417,8 +458,8 @@ export interface StreamXYFrameProps<T = Record<string, any>> {
|
|
|
417
458
|
yLabel?: string;
|
|
418
459
|
/** Label for the right Y axis (dual-axis charts) */
|
|
419
460
|
yLabelRight?: string;
|
|
420
|
-
xFormat?: (d:
|
|
421
|
-
yFormat?: (d:
|
|
461
|
+
xFormat?: (d: number | Date | string, index?: number, allTicks?: number[]) => string | ReactNode;
|
|
462
|
+
yFormat?: (d: number | Date | string) => string | ReactNode;
|
|
422
463
|
tickFormatTime?: (value: number) => string;
|
|
423
464
|
tickFormatValue?: (value: number) => string;
|
|
424
465
|
hoverAnnotation?: boolean | HoverAnnotationConfig;
|
|
@@ -448,13 +489,13 @@ export interface StreamXYFrameProps<T = Record<string, any>> {
|
|
|
448
489
|
} | null) => void;
|
|
449
490
|
/** Accessor for unique point IDs used by point-anchored annotations */
|
|
450
491
|
pointIdAccessor?: string | ((d: T) => string);
|
|
451
|
-
annotations?:
|
|
452
|
-
svgAnnotationRules?: (annotation:
|
|
492
|
+
annotations?: Datum[];
|
|
493
|
+
svgAnnotationRules?: (annotation: Datum, index: number, context: AnnotationContext) => ReactNode;
|
|
453
494
|
showGrid?: boolean;
|
|
454
495
|
legend?: ReactNode | {
|
|
455
|
-
legendGroups:
|
|
496
|
+
legendGroups: LegendGroup[];
|
|
456
497
|
} | {
|
|
457
|
-
gradient:
|
|
498
|
+
gradient: GradientLegendConfig;
|
|
458
499
|
};
|
|
459
500
|
legendHoverBehavior?: (item: {
|
|
460
501
|
label: string;
|
|
@@ -510,7 +551,7 @@ export interface StreamXYFrameProps<T = Record<string, any>> {
|
|
|
510
551
|
/** Source chart ID — crosshair is suppressed on the source chart to avoid double rendering */
|
|
511
552
|
linkedCrosshairSourceId?: string;
|
|
512
553
|
}
|
|
513
|
-
export interface StreamXYFrameHandle<T =
|
|
554
|
+
export interface StreamXYFrameHandle<T = Datum> {
|
|
514
555
|
push(datum: T): void;
|
|
515
556
|
pushMany(data: T[]): void;
|
|
516
557
|
/** Remove data points by ID. Requires pointIdAccessor. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Datum } from "../../charts/shared/datumTypes";
|
|
1
2
|
/**
|
|
2
3
|
* Area and stacked area scene builders.
|
|
3
4
|
*
|
|
@@ -9,5 +10,5 @@
|
|
|
9
10
|
*/
|
|
10
11
|
import type { SceneNode } from "../types";
|
|
11
12
|
import type { XYSceneContext } from "./types";
|
|
12
|
-
export declare function buildAreaScene(ctx: XYSceneContext, data:
|
|
13
|
-
export declare function buildStackedAreaScene(ctx: XYSceneContext, data:
|
|
13
|
+
export declare function buildAreaScene(ctx: XYSceneContext, data: Datum[]): SceneNode[];
|
|
14
|
+
export declare function buildStackedAreaScene(ctx: XYSceneContext, data: Datum[]): SceneNode[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Datum } from "../../charts/shared/datumTypes";
|
|
1
2
|
/**
|
|
2
3
|
* Realtime histogram bar scene builder.
|
|
3
4
|
*
|
|
@@ -15,4 +16,4 @@ export interface BarSceneResult {
|
|
|
15
16
|
/** Sorted bin boundary values (edges of all bins) for data-driven brush snapping */
|
|
16
17
|
binBoundaries: number[];
|
|
17
18
|
}
|
|
18
|
-
export declare function buildBarScene(ctx: XYSceneContext, data:
|
|
19
|
+
export declare function buildBarScene(ctx: XYSceneContext, data: Datum[]): BarSceneResult;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Datum } from "../../charts/shared/datumTypes";
|
|
1
2
|
/**
|
|
2
3
|
* Bounds scene builder — produces an AreaSceneNode for confidence bands/envelopes.
|
|
3
4
|
*
|
|
@@ -5,4 +6,4 @@
|
|
|
5
6
|
*/
|
|
6
7
|
import type { AreaSceneNode } from "../types";
|
|
7
8
|
import type { XYSceneContext } from "./types";
|
|
8
|
-
export declare function buildBoundsForGroup(ctx: XYSceneContext, data:
|
|
9
|
+
export declare function buildBoundsForGroup(ctx: XYSceneContext, data: Datum[], group: string): AreaSceneNode | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Datum } from "../../charts/shared/datumTypes";
|
|
1
2
|
/**
|
|
2
3
|
* Candlestick (OHLC) scene builder.
|
|
3
4
|
*
|
|
@@ -7,4 +8,4 @@
|
|
|
7
8
|
*/
|
|
8
9
|
import type { SceneNode, StreamLayout } from "../types";
|
|
9
10
|
import type { XYSceneContext } from "./types";
|
|
10
|
-
export declare function buildCandlestickScene(ctx: XYSceneContext, data:
|
|
11
|
+
export declare function buildCandlestickScene(ctx: XYSceneContext, data: Datum[], _layout: StreamLayout): SceneNode[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Datum } from "../../charts/shared/datumTypes";
|
|
1
2
|
/**
|
|
2
3
|
* Shared helper for emitting PointSceneNodes from grouped data.
|
|
3
4
|
*
|
|
@@ -9,5 +10,5 @@ import type { SceneNode } from "../types";
|
|
|
9
10
|
import type { XYSceneContext } from "./types";
|
|
10
11
|
export declare function emitPointNodes(ctx: XYSceneContext, groups: {
|
|
11
12
|
key: string;
|
|
12
|
-
data:
|
|
13
|
-
}[], nodes: SceneNode[], yGetOverride?: (d:
|
|
13
|
+
data: Datum[];
|
|
14
|
+
}[], nodes: SceneNode[], yGetOverride?: (d: Datum) => number): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Datum } from "../../charts/shared/datumTypes";
|
|
1
2
|
import type { SceneNode, StreamLayout } from "../types";
|
|
2
3
|
import type { XYSceneContext } from "./types";
|
|
3
|
-
export declare function buildHeatmapScene(ctx: XYSceneContext, data:
|
|
4
|
+
export declare function buildHeatmapScene(ctx: XYSceneContext, data: Datum[], layout: StreamLayout): SceneNode[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Datum } from "../../charts/shared/datumTypes";
|
|
1
2
|
/**
|
|
2
3
|
* Line scene builder — produces LineSceneNode[] from grouped data.
|
|
3
4
|
*
|
|
@@ -9,4 +10,4 @@
|
|
|
9
10
|
*/
|
|
10
11
|
import type { SceneNode } from "../types";
|
|
11
12
|
import type { XYSceneContext } from "./types";
|
|
12
|
-
export declare function buildLineScene(ctx: XYSceneContext, data:
|
|
13
|
+
export declare function buildLineScene(ctx: XYSceneContext, data: Datum[]): SceneNode[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Datum } from "../../charts/shared/datumTypes";
|
|
1
2
|
/**
|
|
2
3
|
* Mixed scene builder — renders some series as areas and others as lines.
|
|
3
4
|
*
|
|
@@ -9,4 +10,4 @@
|
|
|
9
10
|
*/
|
|
10
11
|
import type { SceneNode } from "../types";
|
|
11
12
|
import type { XYSceneContext } from "./types";
|
|
12
|
-
export declare function buildMixedScene(ctx: XYSceneContext, data:
|
|
13
|
+
export declare function buildMixedScene(ctx: XYSceneContext, data: Datum[]): SceneNode[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Datum } from "../../charts/shared/datumTypes";
|
|
1
2
|
/**
|
|
2
3
|
* Point/scatter/bubble scene builder.
|
|
3
4
|
*
|
|
@@ -9,4 +10,4 @@
|
|
|
9
10
|
*/
|
|
10
11
|
import type { SceneNode } from "../types";
|
|
11
12
|
import type { XYSceneContext } from "./types";
|
|
12
|
-
export declare function buildPointScene(ctx: XYSceneContext, data:
|
|
13
|
+
export declare function buildPointScene(ctx: XYSceneContext, data: Datum[]): SceneNode[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Datum } from "../../charts/shared/datumTypes";
|
|
1
2
|
/**
|
|
2
3
|
* Realtime swarm chart scene builder.
|
|
3
4
|
*
|
|
@@ -7,4 +8,4 @@
|
|
|
7
8
|
*/
|
|
8
9
|
import type { SceneNode } from "../types";
|
|
9
10
|
import type { XYSceneContext } from "./types";
|
|
10
|
-
export declare function buildSwarmScene(ctx: XYSceneContext, data:
|
|
11
|
+
export declare function buildSwarmScene(ctx: XYSceneContext, data: Datum[]): SceneNode[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Datum } from "../../charts/shared/datumTypes";
|
|
1
2
|
/**
|
|
2
3
|
* XYSceneContext — shared context passed to all XY scene builder functions.
|
|
3
4
|
*
|
|
@@ -5,33 +6,33 @@
|
|
|
5
6
|
* Scene builders are pure functions that receive this context instead of
|
|
6
7
|
* accessing PipelineStore instance fields directly.
|
|
7
8
|
*/
|
|
8
|
-
import type { StreamScales, Style, CurveType } from "../types";
|
|
9
|
+
import type { StreamScales, Style, CurveType, BarStyle, ThemeSemanticColors } from "../types";
|
|
9
10
|
export interface XYSceneContext {
|
|
10
11
|
scales: StreamScales;
|
|
11
12
|
config: XYSceneConfig;
|
|
12
|
-
getX: (d:
|
|
13
|
-
getY: (d:
|
|
14
|
-
getY0?: (d:
|
|
15
|
-
getSize?: (d:
|
|
16
|
-
getColor?: (d:
|
|
17
|
-
getGroup?: (d:
|
|
18
|
-
getCategory?: (d:
|
|
19
|
-
getPointId?: (d:
|
|
20
|
-
getBounds?: (d:
|
|
21
|
-
getOpen?: (d:
|
|
22
|
-
getHigh?: (d:
|
|
23
|
-
getLow?: (d:
|
|
24
|
-
getClose?: (d:
|
|
13
|
+
getX: (d: Datum) => number;
|
|
14
|
+
getY: (d: Datum) => number;
|
|
15
|
+
getY0?: (d: Datum) => number | null;
|
|
16
|
+
getSize?: (d: Datum) => number;
|
|
17
|
+
getColor?: (d: Datum) => string;
|
|
18
|
+
getGroup?: (d: Datum) => string;
|
|
19
|
+
getCategory?: (d: Datum) => string;
|
|
20
|
+
getPointId?: (d: Datum) => string;
|
|
21
|
+
getBounds?: (d: Datum) => number | null;
|
|
22
|
+
getOpen?: (d: Datum) => number;
|
|
23
|
+
getHigh?: (d: Datum) => number;
|
|
24
|
+
getLow?: (d: Datum) => number;
|
|
25
|
+
getClose?: (d: Datum) => number;
|
|
25
26
|
/** Style resolvers — delegate to PipelineStore's cached color management */
|
|
26
|
-
resolveLineStyle: (group: string, sampleDatum?:
|
|
27
|
-
resolveAreaStyle: (group: string, sampleDatum?:
|
|
28
|
-
resolveBoundsStyle: (group: string, sampleDatum?:
|
|
29
|
-
resolveColorMap: (data:
|
|
27
|
+
resolveLineStyle: (group: string, sampleDatum?: Datum) => Style;
|
|
28
|
+
resolveAreaStyle: (group: string, sampleDatum?: Datum) => Style;
|
|
29
|
+
resolveBoundsStyle: (group: string, sampleDatum?: Datum) => Style;
|
|
30
|
+
resolveColorMap: (data: Datum[]) => Map<string, string>;
|
|
30
31
|
resolveGroupColor: (group: string) => string | null;
|
|
31
32
|
/** Group data by lineBy/colorBy accessor */
|
|
32
|
-
groupData: (data:
|
|
33
|
+
groupData: (data: Datum[]) => {
|
|
33
34
|
key: string;
|
|
34
|
-
data:
|
|
35
|
+
data: Datum[];
|
|
35
36
|
}[];
|
|
36
37
|
/** Instance-scoped mutable cache for bar category ordering (prevents cross-instance leaks) */
|
|
37
38
|
barCategoryCache?: {
|
|
@@ -61,14 +62,14 @@ export interface XYSceneConfig {
|
|
|
61
62
|
color: string;
|
|
62
63
|
}>;
|
|
63
64
|
};
|
|
64
|
-
annotations?:
|
|
65
|
-
pointStyle?: (d:
|
|
65
|
+
annotations?: Datum[];
|
|
66
|
+
pointStyle?: (d: Datum) => Style & {
|
|
66
67
|
r?: number;
|
|
67
68
|
};
|
|
68
69
|
sizeRange?: [number, number];
|
|
69
|
-
xAccessor?: string | ((d:
|
|
70
|
-
yAccessor?: string | ((d:
|
|
71
|
-
valueAccessor?: string | ((d:
|
|
70
|
+
xAccessor?: string | ((d: Datum) => any);
|
|
71
|
+
yAccessor?: string | ((d: Datum) => any);
|
|
72
|
+
valueAccessor?: string | ((d: Datum) => any);
|
|
72
73
|
heatmapAggregation?: "count" | "sum" | "mean";
|
|
73
74
|
heatmapXBins?: number;
|
|
74
75
|
heatmapYBins?: number;
|
|
@@ -76,6 +77,13 @@ export interface XYSceneConfig {
|
|
|
76
77
|
heatmapValueFormat?: (v: number) => string;
|
|
77
78
|
binSize?: number;
|
|
78
79
|
barColors?: Record<string, string>;
|
|
80
|
+
/** Bar fill/stroke/strokeWidth/gap. Threaded through from RealtimeHistogram. */
|
|
81
|
+
barStyle?: BarStyle;
|
|
82
|
+
themeSemantic?: ThemeSemanticColors;
|
|
83
|
+
/** Theme sequential scheme name — fallback when colorScheme is not set (heatmap). */
|
|
84
|
+
themeSequential?: string;
|
|
85
|
+
/** Theme diverging scheme name — fallback when colorScheme is not set. */
|
|
86
|
+
themeDiverging?: string;
|
|
79
87
|
swarmStyle?: {
|
|
80
88
|
radius?: number;
|
|
81
89
|
fill?: string;
|
|
@@ -89,6 +97,7 @@ export interface XYSceneConfig {
|
|
|
89
97
|
gap?: number;
|
|
90
98
|
stroke?: string;
|
|
91
99
|
strokeWidth?: number;
|
|
100
|
+
opacity?: number;
|
|
92
101
|
connectorStroke?: string;
|
|
93
102
|
connectorWidth?: number;
|
|
94
103
|
};
|
|
@@ -104,5 +113,5 @@ export interface XYSceneConfig {
|
|
|
104
113
|
candlestickRangeMode?: boolean;
|
|
105
114
|
boundsStyle?: Style | ((d: any, group: string) => Style);
|
|
106
115
|
lineStyle?: Style | ((d: any, group: string) => Style);
|
|
107
|
-
areaStyle?: (d:
|
|
116
|
+
areaStyle?: (d: Datum) => Style;
|
|
108
117
|
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* Dependencies: SceneGraph (buildRectNode)
|
|
8
8
|
* Consumed by: PipelineStore.buildSceneNodes (chartType "waterfall")
|
|
9
9
|
*/
|
|
10
|
+
import type { Datum } from "../../charts/shared/datumTypes";
|
|
10
11
|
import type { SceneNode, StreamLayout } from "../types";
|
|
11
12
|
import type { XYSceneContext } from "./types";
|
|
12
|
-
export declare function buildWaterfallScene(ctx: XYSceneContext, data:
|
|
13
|
+
export declare function buildWaterfallScene(ctx: XYSceneContext, data: Datum[], layout: StreamLayout): SceneNode[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Resolved chart margin in pixels — every side populated. This is the
|
|
2
|
+
* internal shape after the frame merges the user-supplied margin with
|
|
3
|
+
* chart-mode defaults, so downstream layout math can read all four fields
|
|
4
|
+
* without null-checking. */
|
|
5
|
+
export interface MarginType {
|
|
6
|
+
top: number;
|
|
7
|
+
bottom: number;
|
|
8
|
+
left: number;
|
|
9
|
+
right: number;
|
|
10
|
+
}
|
|
11
|
+
/** Public-API margin shape. Users can pass any subset of sides (`{ left: 120 }`
|
|
12
|
+
* for wide y-axis labels is a common pattern) or a single number as shorthand
|
|
13
|
+
* for "same on all sides". The frame fills missing sides from the chart-mode
|
|
14
|
+
* defaults before handing a fully-resolved `MarginType` to the layout code. */
|
|
15
|
+
export type PartialMargin = number | Partial<MarginType>;
|