semiotic 3.3.1 → 3.4.1
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 +25 -6
- package/README.md +1 -1
- package/ai/dist/mcp-server.js +104 -9
- 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 +9 -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 +3 -1
- 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 +30 -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 +13 -4
- 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 +6 -5
- package/dist/components/charts/ordinal/Histogram.d.ts +4 -3
- package/dist/components/charts/ordinal/LikertChart.d.ts +8 -4
- 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 +6 -5
- 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 +41 -24
- 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 +14 -11
- 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 +20 -7
- package/dist/components/charts/shared/types.d.ts +27 -19
- package/dist/components/charts/shared/useChartSetup.d.ts +15 -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/useResolvedSelection.d.ts +2 -0
- 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/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 +32 -16
- package/dist/components/semiotic-geo.d.ts +4 -0
- package/dist/components/semiotic-network.d.ts +7 -0
- package/dist/components/semiotic-ordinal.d.ts +8 -0
- package/dist/components/semiotic-themes.d.ts +2 -1
- package/dist/components/semiotic-xy.d.ts +11 -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 +6 -5
- 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 +3 -8
- package/dist/components/store/ThemeStore.d.ts +34 -4
- package/dist/components/store/TooltipStore.d.ts +1 -1
- package/dist/components/store/useSelection.d.ts +6 -5
- package/dist/components/stream/AccessibleDataTable.d.ts +5 -5
- package/dist/components/stream/CanvasHitTester.d.ts +10 -4
- package/dist/components/stream/DataSourceAdapter.d.ts +19 -1
- package/dist/components/stream/FocusRing.d.ts +1 -2
- package/dist/components/stream/GeoCanvasHitTester.d.ts +1 -1
- package/dist/components/stream/GeoParticlePool.d.ts +2 -1
- package/dist/components/stream/GeoPipelineStore.d.ts +26 -7
- package/dist/components/stream/MarginalGraphics.d.ts +1 -2
- package/dist/components/stream/NetworkPipelineStore.d.ts +8 -2
- package/dist/components/stream/NetworkSVGOverlay.d.ts +4 -4
- package/dist/components/stream/OrdinalBrushOverlay.d.ts +1 -19
- package/dist/components/stream/OrdinalCanvasHitTester.d.ts +3 -1
- package/dist/components/stream/OrdinalPipelineStore.d.ts +44 -6
- package/dist/components/stream/OrdinalSVGOverlay.d.ts +6 -5
- package/dist/components/stream/ParticlePool.d.ts +4 -0
- package/dist/components/stream/PipelineStore.d.ts +80 -30
- 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 +19 -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 +32 -18
- package/dist/components/stream/hoverUtils.d.ts +14 -1
- 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 +51 -28
- 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 +102 -29
- package/dist/components/stream/pipelineDecay.d.ts +2 -1
- package/dist/components/stream/pipelinePulse.d.ts +2 -1
- package/dist/components/stream/pipelineTransitionUtils.d.ts +21 -0
- package/dist/components/stream/pipelineTransitions.d.ts +16 -4
- package/dist/components/stream/quadtreeHitTest.d.ts +22 -0
- package/dist/components/stream/renderers/colorUtils.d.ts +20 -0
- package/dist/components/stream/renderers/resolveCSSColor.d.ts +23 -6
- package/dist/components/stream/types.d.ts +63 -8
- package/dist/components/stream/useFrame.d.ts +122 -0
- 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-geo.d.ts +4 -0
- package/dist/semiotic-network.d.ts +7 -0
- package/dist/semiotic-ordinal.d.ts +8 -0
- 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 +11 -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 +35 -1
- package/dist/test-utils/ordinalFixtures.d.ts +48 -0
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +50 -42
- 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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Changeset } from "./types";
|
|
2
|
+
import type { Datum } from "../charts/shared/datumTypes";
|
|
2
3
|
export type ChangesetCallback<T> = (changeset: Changeset<T>) => void;
|
|
3
|
-
export declare class DataSourceAdapter<T =
|
|
4
|
+
export declare class DataSourceAdapter<T = Datum> {
|
|
4
5
|
private callback;
|
|
5
6
|
private lastBoundedData;
|
|
6
7
|
private chunkTimer;
|
|
@@ -32,6 +33,23 @@ export declare class DataSourceAdapter<T = Record<string, any>> {
|
|
|
32
33
|
* animation frames (bounded: false so they append without clearing).
|
|
33
34
|
*/
|
|
34
35
|
setBoundedData(data: T[]): void;
|
|
36
|
+
/**
|
|
37
|
+
* Replace the buffer contents without clearing category insertion-order
|
|
38
|
+
* memory. Intended for aggregator HOCs (e.g. LikertChart) that re-derive
|
|
39
|
+
* a full dataset from streaming input on every push — the transport is
|
|
40
|
+
* wholesale replacement, but the user perceives it as a live stream
|
|
41
|
+
* where categories should stay put across updates.
|
|
42
|
+
*
|
|
43
|
+
* Small datasets (≤ chunkThreshold) emit a single synchronous
|
|
44
|
+
* changeset — the common aggregator case. Larger datasets fall
|
|
45
|
+
* through to progressive chunking so an unexpectedly-huge replacement
|
|
46
|
+
* doesn't block the main thread. Only the first chunk carries
|
|
47
|
+
* `preserveCategoryOrder: true` (it's the one that resets the
|
|
48
|
+
* buffer and seeds the category Set); subsequent chunks are plain
|
|
49
|
+
* append-only streaming changesets, which preserve order anyway via
|
|
50
|
+
* the streaming-mode branch.
|
|
51
|
+
*/
|
|
52
|
+
setReplacementData(data: T[]): void;
|
|
35
53
|
/**
|
|
36
54
|
* Flush all buffered push data as a single changeset.
|
|
37
55
|
* Called automatically via microtask after push()/pushMany().
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
/**
|
|
3
2
|
* Shape-appropriate keyboard focus indicator for canvas-based charts.
|
|
4
3
|
*
|
|
@@ -30,4 +29,4 @@ export interface FocusRingProps {
|
|
|
30
29
|
/** Height of rect-shaped focus target */
|
|
31
30
|
height?: number;
|
|
32
31
|
}
|
|
33
|
-
export declare function FocusRing({ active, hoverPoint, margin, size, shape, width, height }: FocusRingProps):
|
|
32
|
+
export declare function FocusRing({ active, hoverPoint, margin, size, shape, width, height }: FocusRingProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -16,4 +16,4 @@ export interface GeoHitResult {
|
|
|
16
16
|
* The `hitCtx` parameter is a shared offscreen canvas context used for
|
|
17
17
|
* isPointInPath checks without polluting the visible canvas.
|
|
18
18
|
*/
|
|
19
|
-
export declare function findNearestGeoNode(nodes: GeoSceneNode[], mouseX: number, mouseY: number, maxDistance: number, hitCtx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, pointQuadtree?: Quadtree<PointSceneNode>): GeoHitResult | null;
|
|
19
|
+
export declare function findNearestGeoNode(nodes: GeoSceneNode[], mouseX: number, mouseY: number, maxDistance: number, hitCtx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, pointQuadtree?: Quadtree<PointSceneNode> | null, maxPointRadius?: number): GeoHitResult | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Datum } from "../charts/shared/datumTypes";
|
|
1
2
|
/**
|
|
2
3
|
* GeoParticlePool — particle system for geo line paths.
|
|
3
4
|
*
|
|
@@ -20,7 +21,7 @@ export interface GeoParticleStyle {
|
|
|
20
21
|
/** Particle radius @default 2 */
|
|
21
22
|
radius?: number;
|
|
22
23
|
/** Particle color: a CSS color string, "source" to inherit from line stroke, or a function `(datum) => string` */
|
|
23
|
-
color?: string | ((datum:
|
|
24
|
+
color?: string | ((datum: Datum) => string);
|
|
24
25
|
/** Particle opacity @default 0.7 */
|
|
25
26
|
opacity?: number;
|
|
26
27
|
/** Speed multiplier @default 1 */
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import type { ZoomTransform } from "d3-zoom";
|
|
2
|
+
import { type Quadtree } from "d3-quadtree";
|
|
2
3
|
import type { GeoPipelineConfig, GeoScales, GeoSceneNode } from "./geoTypes";
|
|
3
|
-
import type { StreamLayout } from "./types";
|
|
4
|
+
import type { PointSceneNode, StreamLayout } from "./types";
|
|
4
5
|
import type { ActiveTransition } from "./pipelineTransitionUtils";
|
|
6
|
+
import type { Datum } from "../charts/shared/datumTypes";
|
|
5
7
|
export declare class GeoPipelineStore {
|
|
6
8
|
config: GeoPipelineConfig;
|
|
7
9
|
scene: GeoSceneNode[];
|
|
8
10
|
scales: GeoScales | null;
|
|
9
11
|
version: number;
|
|
12
|
+
private static readonly QUADTREE_THRESHOLD;
|
|
13
|
+
private _quadtree;
|
|
14
|
+
/** Largest visual point radius in the current scene; used to widen quadtree
|
|
15
|
+
* hit-test radius when points are larger than the default maxDistance. */
|
|
16
|
+
private _maxPointRadius;
|
|
10
17
|
private projection;
|
|
11
18
|
private geoPath;
|
|
12
19
|
private baseScale;
|
|
@@ -28,22 +35,23 @@ export declare class GeoPipelineStore {
|
|
|
28
35
|
private timestampBuffer;
|
|
29
36
|
activeTransition: ActiveTransition | null;
|
|
30
37
|
private prevPositions;
|
|
38
|
+
private _hasRenderedOnce;
|
|
31
39
|
constructor(config: GeoPipelineConfig);
|
|
32
40
|
updateConfig(config: Partial<GeoPipelineConfig>): void;
|
|
33
41
|
setAreas(features: GeoJSON.Feature[]): void;
|
|
34
|
-
setPoints(data:
|
|
35
|
-
setLines(data:
|
|
42
|
+
setPoints(data: Datum[]): void;
|
|
43
|
+
setLines(data: Datum[]): void;
|
|
36
44
|
/** Initialize streaming mode with a ring buffer */
|
|
37
45
|
initStreaming(windowSize?: number): void;
|
|
38
46
|
/** Push a single streaming point */
|
|
39
|
-
pushPoint(datum:
|
|
47
|
+
pushPoint(datum: Datum): void;
|
|
40
48
|
/** Push multiple streaming points */
|
|
41
|
-
pushMany(data:
|
|
49
|
+
pushMany(data: Datum[]): void;
|
|
42
50
|
/**
|
|
43
51
|
* Remove points by ID. Requires pointIdAccessor to be configured.
|
|
44
52
|
* Returns the removed items.
|
|
45
53
|
*/
|
|
46
|
-
removePoint(id: string | string[]):
|
|
54
|
+
removePoint(id: string | string[]): Datum[];
|
|
47
55
|
clear(): void;
|
|
48
56
|
computeScene(layout: StreamLayout): void;
|
|
49
57
|
private fitProjection;
|
|
@@ -75,7 +83,18 @@ export declare class GeoPipelineStore {
|
|
|
75
83
|
scale: number;
|
|
76
84
|
translate: [number, number];
|
|
77
85
|
};
|
|
78
|
-
getPoints():
|
|
86
|
+
getPoints(): Datum[];
|
|
87
|
+
/**
|
|
88
|
+
* Build (or clear) the quadtree spatial index for point scene nodes.
|
|
89
|
+
* Only built when the point count exceeds QUADTREE_THRESHOLD; below that
|
|
90
|
+
* a linear scan is faster than indexing overhead. Also tracks the largest
|
|
91
|
+
* point radius so the hit tester can widen its query when symbols are big.
|
|
92
|
+
*/
|
|
93
|
+
private rebuildQuadtree;
|
|
94
|
+
/** Quadtree spatial index for point hit testing, or null when below threshold. */
|
|
95
|
+
get quadtree(): Quadtree<PointSceneNode> | null;
|
|
96
|
+
/** Largest visual point radius in the current scene. */
|
|
97
|
+
get maxPointRadius(): number;
|
|
79
98
|
private buildSceneNodes;
|
|
80
99
|
private applyCartogramTransform;
|
|
81
100
|
private applyDecay;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import type { ScaleLinear } from "d3-scale";
|
|
3
2
|
import type { MarginalConfig, MarginalType } from "./types";
|
|
4
3
|
export type MarginalOrient = "top" | "bottom" | "left" | "right";
|
|
@@ -16,4 +15,4 @@ export interface MarginalGraphicsProps {
|
|
|
16
15
|
}
|
|
17
16
|
/** Resolve a string shorthand or full config into a MarginalConfig */
|
|
18
17
|
export declare function normalizeMarginalConfig(input: MarginalConfig | MarginalType): MarginalConfig;
|
|
19
|
-
export declare function MarginalGraphics({ orient, config: rawConfig, values, scale, size, length }: MarginalGraphicsProps):
|
|
18
|
+
export declare function MarginalGraphics({ orient, config: rawConfig, values, scale, size, length }: MarginalGraphicsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ParticlePool } from "./ParticlePool";
|
|
2
2
|
import type { ActiveTransition } from "./pipelineTransitionUtils";
|
|
3
3
|
import type { NetworkPipelineConfig, NetworkSceneNode, NetworkSceneEdge, NetworkLabel, RealtimeNode, RealtimeEdge, EdgePush } from "./networkTypes";
|
|
4
|
+
import type { Datum } from "../charts/shared/datumTypes";
|
|
4
5
|
/**
|
|
5
6
|
* NetworkPipelineStore — stateful store for the StreamNetworkFrame.
|
|
6
7
|
*
|
|
@@ -22,6 +23,11 @@ export declare class NetworkPipelineStore {
|
|
|
22
23
|
private config;
|
|
23
24
|
private tensionConfig;
|
|
24
25
|
transition: ActiveTransition | null;
|
|
26
|
+
private _hasRenderedOnce;
|
|
27
|
+
/** Snapshot of node positions from before bounded re-ingestion cleared the maps */
|
|
28
|
+
private _boundedPrevSnapshot;
|
|
29
|
+
/** Snapshot of edge positions from before bounded re-ingestion cleared the maps */
|
|
30
|
+
private _boundedEdgeSnapshot;
|
|
25
31
|
lastIngestTime: number;
|
|
26
32
|
private nodeTimestamps;
|
|
27
33
|
private edgeTimestamps;
|
|
@@ -129,12 +135,12 @@ export declare class NetworkPipelineStore {
|
|
|
129
135
|
/**
|
|
130
136
|
* Update a node's data by ID. Returns the previous data, or null if not found.
|
|
131
137
|
*/
|
|
132
|
-
updateNode(id: string, updater: (data:
|
|
138
|
+
updateNode(id: string, updater: (data: Datum) => Datum): Datum | null;
|
|
133
139
|
/**
|
|
134
140
|
* Update all edges between source and target. Handles parallel edges.
|
|
135
141
|
* Returns array of previous data values (one per updated edge), or empty array.
|
|
136
142
|
*/
|
|
137
|
-
updateEdge(sourceId: string, targetId: string, updater: (data:
|
|
143
|
+
updateEdge(sourceId: string, targetId: string, updater: (data: Datum) => Datum): Datum[];
|
|
138
144
|
/**
|
|
139
145
|
* Remove a node by ID. Also removes all edges connected to this node.
|
|
140
146
|
* Returns true if the node was found and removed.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { Datum } from "../charts/shared/datumTypes";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
import type { NetworkLabel } from "./networkTypes";
|
|
4
4
|
import type { LegendGroup, GradientLegendConfig } from "../types/legendTypes";
|
|
@@ -47,8 +47,8 @@ export interface NetworkSVGOverlayProps {
|
|
|
47
47
|
h?: number;
|
|
48
48
|
}>;
|
|
49
49
|
/** Annotations */
|
|
50
|
-
annotations?:
|
|
51
|
-
svgAnnotationRules?: (annotation:
|
|
50
|
+
annotations?: Datum[];
|
|
51
|
+
svgAnnotationRules?: (annotation: Datum, index: number, context: any) => ReactNode;
|
|
52
52
|
annotationFrame?: number;
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
@@ -57,7 +57,7 @@ export interface NetworkSVGOverlayProps {
|
|
|
57
57
|
* Unlike XY/ordinal overlays, network charts don't have axes or grid lines.
|
|
58
58
|
* The overlay is positioned absolutely over the canvas.
|
|
59
59
|
*/
|
|
60
|
-
export declare function NetworkSVGOverlay(props: NetworkSVGOverlayProps):
|
|
60
|
+
export declare function NetworkSVGOverlay(props: NetworkSVGOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
61
61
|
export declare namespace NetworkSVGOverlay {
|
|
62
62
|
var displayName: string;
|
|
63
63
|
}
|
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OrdinalBrushOverlay — d3-brush SVG overlay for ordinal frames.
|
|
3
|
-
*
|
|
4
|
-
* Renders a transparent SVG positioned above the canvas. Brushes along the
|
|
5
|
-
* r-axis (value axis) only: horizontal projection → brushX, vertical → brushY.
|
|
6
|
-
*
|
|
7
|
-
* Key design decisions:
|
|
8
|
-
* - Outer SVG has pointerEvents:"none", inner brush-g has "all", so
|
|
9
|
-
* axes/legends rendered underneath remain clickable.
|
|
10
|
-
* - d3-brush lifecycle (useEffect) depends on [width, height, isHorizontal]
|
|
11
|
-
* only — NOT scales. Scales are read from a ref to avoid brush teardown
|
|
12
|
-
* mid-drag (scales change every render due to new object identity).
|
|
13
|
-
* - A separate useEffect repositions the brush when scales change (streaming).
|
|
14
|
-
*
|
|
15
|
-
* Consumed by: StreamOrdinalFrame (rendered when brush prop is set).
|
|
16
|
-
* Wired by: useOrdinalBrush hook in HOC charts.
|
|
17
|
-
*/
|
|
18
|
-
import * as React from "react";
|
|
19
1
|
import type { OrdinalScales } from "./ordinalTypes";
|
|
20
2
|
interface OrdinalBrushOverlayProps {
|
|
21
3
|
width: number;
|
|
@@ -39,5 +21,5 @@ interface OrdinalBrushOverlayProps {
|
|
|
39
21
|
* In horizontal projection, r maps to x-pixels → uses brushX.
|
|
40
22
|
* In vertical projection, r maps to y-pixels → uses brushY.
|
|
41
23
|
*/
|
|
42
|
-
export declare function OrdinalBrushOverlay({ width, height, totalWidth, totalHeight, margin, scales, onBrush }: OrdinalBrushOverlayProps):
|
|
24
|
+
export declare function OrdinalBrushOverlay({ width, height, totalWidth, totalHeight, margin, scales, onBrush }: OrdinalBrushOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
43
25
|
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { OrdinalSceneNode } from "./ordinalTypes";
|
|
2
|
+
import type { PointSceneNode } from "./types";
|
|
3
|
+
import type { Quadtree } from "d3-quadtree";
|
|
2
4
|
export interface OrdinalHitResult {
|
|
3
5
|
datum: any;
|
|
4
6
|
x: number;
|
|
@@ -7,4 +9,4 @@ export interface OrdinalHitResult {
|
|
|
7
9
|
category?: string;
|
|
8
10
|
stats?: import("./ordinalTypes").DistributionStats;
|
|
9
11
|
}
|
|
10
|
-
export declare function findNearestOrdinalNode(scene: OrdinalSceneNode[], px: number, py: number, maxDistance?: number): OrdinalHitResult | null;
|
|
12
|
+
export declare function findNearestOrdinalNode(scene: OrdinalSceneNode[], px: number, py: number, maxDistance?: number, pointQuadtree?: Quadtree<PointSceneNode> | null, maxPointRadius?: number): OrdinalHitResult | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Datum } from "../charts/shared/datumTypes";
|
|
1
2
|
/**
|
|
2
3
|
* OrdinalPipelineStore — stateful pipeline for ordinal chart data.
|
|
3
4
|
*
|
|
@@ -15,8 +16,9 @@
|
|
|
15
16
|
* Consumed by: StreamOrdinalFrame (sole consumer).
|
|
16
17
|
*/
|
|
17
18
|
import { type ScaleLinear } from "d3-scale";
|
|
19
|
+
import { type Quadtree } from "d3-quadtree";
|
|
18
20
|
import type { OrdinalPipelineConfig, OrdinalScales, OrdinalSceneNode, OrdinalColumn, OrdinalLayout } from "./ordinalTypes";
|
|
19
|
-
import type { Changeset } from "./types";
|
|
21
|
+
import type { Changeset, PointSceneNode } from "./types";
|
|
20
22
|
import type { ActiveTransition } from "./pipelineTransitionUtils";
|
|
21
23
|
export declare class OrdinalPipelineStore {
|
|
22
24
|
private buffer;
|
|
@@ -52,6 +54,17 @@ export declare class OrdinalPipelineStore {
|
|
|
52
54
|
scene: OrdinalSceneNode[];
|
|
53
55
|
columns: Record<string, OrdinalColumn>;
|
|
54
56
|
version: number;
|
|
57
|
+
/** Bumped whenever the buffer is mutated. Used to invalidate per-frame caches. */
|
|
58
|
+
private _dataVersion;
|
|
59
|
+
private static readonly QUADTREE_THRESHOLD;
|
|
60
|
+
private _pointQuadtree;
|
|
61
|
+
/** Largest visual point radius in the current scene. */
|
|
62
|
+
private _maxPointRadius;
|
|
63
|
+
/** Cached datum→index map for applyDecay/applyPulse. Keyed by `_dataVersion`. */
|
|
64
|
+
private _datumIndexCache;
|
|
65
|
+
/** Cached category→indices map for applyPulse wedge path. Keyed by `_dataVersion`. */
|
|
66
|
+
private _categoryIndexCache;
|
|
67
|
+
private _hasRenderedOnce;
|
|
55
68
|
constructor(config: OrdinalPipelineConfig);
|
|
56
69
|
ingest(changeset: Changeset): boolean;
|
|
57
70
|
private pushValueExtent;
|
|
@@ -69,28 +82,53 @@ export declare class OrdinalPipelineStore {
|
|
|
69
82
|
private getColorFromScheme;
|
|
70
83
|
private resolveSummaryStyle;
|
|
71
84
|
computeDecayOpacity(bufferIndex: number, bufferSize: number): number;
|
|
85
|
+
/**
|
|
86
|
+
* Build (or return cached) datum→buffer-index map. Cached against
|
|
87
|
+
* `_dataVersion` so the per-frame applyDecay/applyPulse calls don't
|
|
88
|
+
* rebuild it during animation when the buffer hasn't changed.
|
|
89
|
+
*/
|
|
90
|
+
private getDatumIndexMap;
|
|
91
|
+
/**
|
|
92
|
+
* Build (or return cached) category→[indices] map used by applyPulse for
|
|
93
|
+
* wedge nodes. Cached against `_dataVersion` so the per-wedge inner loop
|
|
94
|
+
* collapses from O(data) to O(matches-for-this-category).
|
|
95
|
+
*/
|
|
96
|
+
private getCategoryIndexMap;
|
|
97
|
+
/**
|
|
98
|
+
* Build (or clear) a quadtree spatial index for point scene nodes.
|
|
99
|
+
* Useful for swarm plots — other ordinal types (bar/wedge/box/violin) are
|
|
100
|
+
* not indexed because they're typically few in number or already O(1) hit
|
|
101
|
+
* tests via bbox checks.
|
|
102
|
+
*/
|
|
103
|
+
private rebuildPointQuadtree;
|
|
104
|
+
/** Quadtree spatial index for point hit testing, or null when below threshold. */
|
|
105
|
+
get pointQuadtree(): Quadtree<PointSceneNode> | null;
|
|
106
|
+
/** Largest visual point radius in the current scene. */
|
|
107
|
+
get maxPointRadius(): number;
|
|
72
108
|
private applyDecay;
|
|
73
109
|
private applyPulse;
|
|
74
110
|
get hasActivePulses(): boolean;
|
|
111
|
+
/** Synthesize a zero-state prevPositionMap for animated intro (first render). */
|
|
112
|
+
private synthesizeIntroPositions;
|
|
75
113
|
/** Build a stable identity key for a scene node based on its content, not array index */
|
|
76
114
|
private getNodeKey;
|
|
77
115
|
private snapshotPositions;
|
|
78
116
|
private startTransition;
|
|
79
117
|
advanceTransition(now: number): boolean;
|
|
80
|
-
getData():
|
|
118
|
+
getData(): Datum[];
|
|
81
119
|
/**
|
|
82
120
|
* Remove data items by ID. Requires dataIdAccessor to be configured.
|
|
83
121
|
* Returns the removed items. Marks the store dirty for scene rebuild.
|
|
84
122
|
*/
|
|
85
|
-
remove(id: string | string[]):
|
|
123
|
+
remove(id: string | string[]): Datum[];
|
|
86
124
|
/**
|
|
87
125
|
* Update data items by ID. Requires dataIdAccessor.
|
|
88
126
|
* Returns the previous values. Categories and extents are rebuilt.
|
|
89
127
|
*/
|
|
90
|
-
update(id: string | string[], updater: (d:
|
|
128
|
+
update(id: string | string[], updater: (d: Datum) => Datum): Datum[];
|
|
91
129
|
clear(): void;
|
|
92
130
|
get size(): number;
|
|
93
|
-
getOAccessor(): (d:
|
|
94
|
-
getRAccessor(): (d:
|
|
131
|
+
getOAccessor(): (d: Datum) => string;
|
|
132
|
+
getRAccessor(): (d: Datum) => number;
|
|
95
133
|
updateConfig(config: Partial<OrdinalPipelineConfig>): void;
|
|
96
134
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Datum } from "../charts/shared/datumTypes";
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import type { OrdinalScales } from "./ordinalTypes";
|
|
3
4
|
import type { AnnotationContext } from "../realtime/types";
|
|
@@ -42,12 +43,12 @@ interface OrdinalSVGOverlayProps {
|
|
|
42
43
|
legendIsolatedCategories?: Set<string>;
|
|
43
44
|
legendPosition?: "right" | "left" | "top" | "bottom";
|
|
44
45
|
foregroundGraphics?: ReactNode;
|
|
45
|
-
annotations?:
|
|
46
|
-
svgAnnotationRules?: (annotation:
|
|
46
|
+
annotations?: Datum[];
|
|
47
|
+
svgAnnotationRules?: (annotation: Datum, index: number, context: AnnotationContext) => ReactNode;
|
|
47
48
|
annotationFrame?: number;
|
|
48
49
|
xAccessor?: string;
|
|
49
50
|
yAccessor?: string;
|
|
50
|
-
annotationData?:
|
|
51
|
+
annotationData?: Datum[];
|
|
51
52
|
/** When true, grid lines and axis baselines are skipped (rendered by OrdinalSVGUnderlay instead) */
|
|
52
53
|
underlayRendered?: boolean;
|
|
53
54
|
children?: ReactNode;
|
|
@@ -69,6 +70,6 @@ interface OrdinalSVGUnderlayProps {
|
|
|
69
70
|
rFormat?: (d: number) => string;
|
|
70
71
|
rTickValues?: number[];
|
|
71
72
|
}
|
|
72
|
-
export declare function OrdinalSVGUnderlay(props: OrdinalSVGUnderlayProps):
|
|
73
|
-
export declare function OrdinalSVGOverlay(props: OrdinalSVGOverlayProps):
|
|
73
|
+
export declare function OrdinalSVGUnderlay(props: OrdinalSVGUnderlayProps): import("react/jsx-runtime").JSX.Element | null;
|
|
74
|
+
export declare function OrdinalSVGOverlay(props: OrdinalSVGOverlayProps): import("react/jsx-runtime").JSX.Element | null;
|
|
74
75
|
export {};
|
|
@@ -4,10 +4,14 @@ import type { Particle, RealtimeEdge } from "./networkTypes";
|
|
|
4
4
|
*
|
|
5
5
|
* Pre-allocates a fixed-size array to avoid GC pressure.
|
|
6
6
|
* Particles travel along bezier paths within link bands.
|
|
7
|
+
*
|
|
8
|
+
* `_freeIndices` is a stack of currently-free slot indices. Spawn pops; step
|
|
9
|
+
* pushes when a particle expires. This makes spawn O(1) instead of O(capacity).
|
|
7
10
|
*/
|
|
8
11
|
export declare class ParticlePool {
|
|
9
12
|
particles: Particle[];
|
|
10
13
|
private capacity;
|
|
14
|
+
private _freeIndices;
|
|
11
15
|
constructor(capacity: number);
|
|
12
16
|
/**
|
|
13
17
|
* Spawn a new particle on the given edge.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { Datum } from "../charts/shared/datumTypes";
|
|
1
2
|
import { type Quadtree } from "d3-quadtree";
|
|
2
3
|
import { RingBuffer } from "../realtime/RingBuffer";
|
|
3
|
-
import type { Changeset, StreamChartType, StreamScales, StreamLayout, SceneNode, PointSceneNode, CandlestickStyle, Style, ArrowOfTime, WindowMode, DecayConfig, PulseConfig, TransitionConfig, StalenessConfig, CurveType } from "./types";
|
|
4
|
+
import type { Changeset, StreamChartType, StreamScales, StreamLayout, SceneNode, PointSceneNode, CandlestickStyle, Style, ArrowOfTime, WindowMode, DecayConfig, PulseConfig, TransitionConfig, StalenessConfig, CurveType, BarStyle, ThemeSemanticColors } from "./types";
|
|
4
5
|
import type { ActiveTransition } from "./pipelineTransitionUtils";
|
|
5
6
|
export interface PipelineConfig {
|
|
6
7
|
chartType: StreamChartType;
|
|
@@ -12,14 +13,14 @@ export interface PipelineConfig {
|
|
|
12
13
|
/** Pixel inset on scale ranges to prevent glyph clipping at chart edges. Default 0. */
|
|
13
14
|
scalePadding?: number;
|
|
14
15
|
maxCapacity?: number;
|
|
15
|
-
xAccessor?: string | ((d:
|
|
16
|
-
yAccessor?: string | ((d:
|
|
17
|
-
timeAccessor?: string | ((d:
|
|
18
|
-
valueAccessor?: string | ((d:
|
|
19
|
-
colorAccessor?: string | ((d:
|
|
20
|
-
sizeAccessor?: string | ((d:
|
|
21
|
-
groupAccessor?: string | ((d:
|
|
22
|
-
categoryAccessor?: string | ((d:
|
|
16
|
+
xAccessor?: string | ((d: Datum) => number);
|
|
17
|
+
yAccessor?: string | ((d: Datum) => number);
|
|
18
|
+
timeAccessor?: string | ((d: Datum) => number);
|
|
19
|
+
valueAccessor?: string | ((d: Datum) => number);
|
|
20
|
+
colorAccessor?: string | ((d: Datum) => string);
|
|
21
|
+
sizeAccessor?: string | ((d: Datum) => number);
|
|
22
|
+
groupAccessor?: string | ((d: Datum) => string);
|
|
23
|
+
categoryAccessor?: string | ((d: Datum) => string);
|
|
23
24
|
lineDataAccessor?: string;
|
|
24
25
|
xScaleType?: "linear" | "log" | "time";
|
|
25
26
|
yScaleType?: "linear" | "log";
|
|
@@ -28,16 +29,16 @@ export interface PipelineConfig {
|
|
|
28
29
|
sizeRange?: [number, number];
|
|
29
30
|
binSize?: number;
|
|
30
31
|
normalize?: boolean;
|
|
31
|
-
openAccessor?: string | ((d:
|
|
32
|
-
highAccessor?: string | ((d:
|
|
33
|
-
lowAccessor?: string | ((d:
|
|
34
|
-
closeAccessor?: string | ((d:
|
|
32
|
+
openAccessor?: string | ((d: Datum) => number);
|
|
33
|
+
highAccessor?: string | ((d: Datum) => number);
|
|
34
|
+
lowAccessor?: string | ((d: Datum) => number);
|
|
35
|
+
closeAccessor?: string | ((d: Datum) => number);
|
|
35
36
|
candlestickStyle?: CandlestickStyle;
|
|
36
37
|
/** Internal: set by PipelineStore when open/close accessors are both missing */
|
|
37
38
|
candlestickRangeMode?: boolean;
|
|
38
|
-
boundsAccessor?: string | ((d:
|
|
39
|
+
boundsAccessor?: string | ((d: Datum) => number);
|
|
39
40
|
boundsStyle?: any;
|
|
40
|
-
y0Accessor?: string | ((d:
|
|
41
|
+
y0Accessor?: string | ((d: Datum) => number);
|
|
41
42
|
gradientFill?: {
|
|
42
43
|
topOpacity: number;
|
|
43
44
|
bottomOpacity: number;
|
|
@@ -55,10 +56,10 @@ export interface PipelineConfig {
|
|
|
55
56
|
}>;
|
|
56
57
|
};
|
|
57
58
|
lineStyle?: any;
|
|
58
|
-
pointStyle?: (d:
|
|
59
|
+
pointStyle?: (d: Datum) => Style & {
|
|
59
60
|
r?: number;
|
|
60
61
|
};
|
|
61
|
-
areaStyle?: (d:
|
|
62
|
+
areaStyle?: (d: Datum) => Style;
|
|
62
63
|
swarmStyle?: {
|
|
63
64
|
radius?: number;
|
|
64
65
|
fill?: string;
|
|
@@ -76,18 +77,45 @@ export interface PipelineConfig {
|
|
|
76
77
|
strokeWidth?: number;
|
|
77
78
|
};
|
|
78
79
|
colorScheme?: string | string[];
|
|
80
|
+
/** Theme categorical palette — used as fallback when colorScheme is not an explicit array */
|
|
81
|
+
themeCategorical?: string[];
|
|
82
|
+
/**
|
|
83
|
+
* Theme-resolved semantic role colors. Scene builders use these as the
|
|
84
|
+
* default before falling back to hardcoded hex. Populated by the Stream
|
|
85
|
+
* Frame from the in-memory `SemioticTheme.colors` object at render time
|
|
86
|
+
* — the values are concrete hex (or whatever the preset declares), not
|
|
87
|
+
* `var(...)` strings, and so this channel does NOT participate in the
|
|
88
|
+
* DOM CSS cascade. Changing the ambient theme (`<ThemeProvider>`) or
|
|
89
|
+
* swapping to a nested provider is how you override these values.
|
|
90
|
+
*
|
|
91
|
+
* Per-scope overrides via CSS custom properties
|
|
92
|
+
* (e.g. `<div style={{ "--semiotic-danger": "#c00" }}>`) work only for
|
|
93
|
+
* values a user explicitly passes through as `var(--...)` strings in
|
|
94
|
+
* chart props — those are resolved via `getComputedStyle` in the
|
|
95
|
+
* canvas renderer at paint time (see `resolveCSSColor.ts`). The theme
|
|
96
|
+
* defaults in this field don't read CSS.
|
|
97
|
+
*/
|
|
98
|
+
themeSemantic?: ThemeSemanticColors;
|
|
99
|
+
/** Theme sequential scheme name (e.g. "blues") — fallback when `colorScheme` is not explicitly set for magnitude encodings (heatmap, choropleth, size). */
|
|
100
|
+
themeSequential?: string;
|
|
101
|
+
/** Theme diverging scheme name (e.g. "RdBu") — fallback when `colorScheme` is not explicitly set for midpoint encodings (likert, bivariate, ± deviation). */
|
|
102
|
+
themeDiverging?: string;
|
|
79
103
|
barColors?: Record<string, string>;
|
|
80
|
-
|
|
104
|
+
/** Histogram bar style — fill/stroke/strokeWidth/gap. Accepted by RealtimeHistogram and routed through to the bar scene builder. */
|
|
105
|
+
barStyle?: BarStyle;
|
|
106
|
+
annotations?: Datum[];
|
|
81
107
|
decay?: DecayConfig;
|
|
82
108
|
pulse?: PulseConfig;
|
|
83
109
|
transition?: TransitionConfig;
|
|
110
|
+
/** Whether to animate elements on first render (points scale up, lines/areas clip from left, rects grow from baseline) */
|
|
111
|
+
introAnimation?: boolean;
|
|
84
112
|
staleness?: StalenessConfig;
|
|
85
113
|
heatmapAggregation?: "count" | "sum" | "mean";
|
|
86
114
|
heatmapXBins?: number;
|
|
87
115
|
heatmapYBins?: number;
|
|
88
116
|
showValues?: boolean;
|
|
89
117
|
heatmapValueFormat?: (v: number) => string;
|
|
90
|
-
pointIdAccessor?: string | ((d:
|
|
118
|
+
pointIdAccessor?: string | ((d: Datum) => string);
|
|
91
119
|
curve?: CurveType;
|
|
92
120
|
}
|
|
93
121
|
export declare class PipelineStore {
|
|
@@ -111,6 +139,7 @@ export declare class PipelineStore {
|
|
|
111
139
|
private getPointId;
|
|
112
140
|
private timestampBuffer;
|
|
113
141
|
activeTransition: ActiveTransition | null;
|
|
142
|
+
private _hasRenderedOnce;
|
|
114
143
|
private prevPositionMap;
|
|
115
144
|
/** Previous line/area path arrays for path interpolation */
|
|
116
145
|
private prevPathMap;
|
|
@@ -119,8 +148,15 @@ export declare class PipelineStore {
|
|
|
119
148
|
lastIngestTime: number;
|
|
120
149
|
/** Unified color map cache keyed by sorted category set — shared across point, swarm, etc. */
|
|
121
150
|
private _colorMapCache;
|
|
122
|
-
/** Separate group→color map for resolveGroupColor (insertion-order based, never invalidates _colorMapCache)
|
|
151
|
+
/** Separate group→color map for resolveGroupColor (insertion-order based, never invalidates _colorMapCache).
|
|
152
|
+
* FIFO-bounded to `GROUP_COLOR_MAP_CAP` entries — in long-running streams with unique group IDs (e.g. UUIDs
|
|
153
|
+
* as `lineBy` keys) this would otherwise grow unboundedly. Evicted groups that re-appear get a new palette
|
|
154
|
+
* slot; stable color assignment is only guaranteed for the most-recent `CAP` unique groups. */
|
|
123
155
|
private _groupColorMap;
|
|
156
|
+
/** Monotonic counter for group-color palette indexing. Decoupled from `_groupColorMap.size` so FIFO eviction
|
|
157
|
+
* doesn't cause new groups to collide with existing entries on a shrunk map. */
|
|
158
|
+
private _groupColorCounter;
|
|
159
|
+
private static readonly GROUP_COLOR_MAP_CAP;
|
|
124
160
|
private _barCategoryCache;
|
|
125
161
|
/** Sorted bin boundary values from the last bar scene build (for data-driven brush snapping) */
|
|
126
162
|
private _binBoundaries;
|
|
@@ -140,6 +176,10 @@ export declare class PipelineStore {
|
|
|
140
176
|
/** True when the x accessor returns Date objects (auto-detected on first data ingestion) */
|
|
141
177
|
xIsDate: boolean;
|
|
142
178
|
private _quadtree;
|
|
179
|
+
/** Largest visual point radius in the current scene. The hit tester uses
|
|
180
|
+
* this to widen its quadtree query so points with big radii (bubble) don't
|
|
181
|
+
* fall outside the search region. */
|
|
182
|
+
private _maxPointRadius;
|
|
143
183
|
private static readonly QUADTREE_THRESHOLD;
|
|
144
184
|
constructor(config: PipelineConfig);
|
|
145
185
|
/**
|
|
@@ -161,6 +201,8 @@ export declare class PipelineStore {
|
|
|
161
201
|
* Returns null when chart type is not scatter/bubble or point count is below threshold.
|
|
162
202
|
*/
|
|
163
203
|
get quadtree(): Quadtree<PointSceneNode> | null;
|
|
204
|
+
/** Largest visual point radius in the current scene. */
|
|
205
|
+
get maxPointRadius(): number;
|
|
164
206
|
/**
|
|
165
207
|
* Remap existing scene node coordinates for a new layout size.
|
|
166
208
|
* Proportionally scales all pixel coordinates without rebuilding from data.
|
|
@@ -174,20 +216,28 @@ export declare class PipelineStore {
|
|
|
174
216
|
get hasActivePulses(): boolean;
|
|
175
217
|
private get transitionContext();
|
|
176
218
|
private snapshotPositions;
|
|
219
|
+
/** Synthesize a zero-state prevPositionMap/prevPathMap for animated intro (first render). */
|
|
220
|
+
private synthesizeIntroPositions;
|
|
177
221
|
private startTransition;
|
|
178
222
|
advanceTransition(now: number): boolean;
|
|
179
223
|
private groupData;
|
|
180
224
|
/**
|
|
181
225
|
* Resolve a category→color map from data using the colorAccessor.
|
|
182
|
-
* Caches the result in _colorMapCache keyed by
|
|
183
|
-
*
|
|
226
|
+
* Caches the result in _colorMapCache keyed by `_ingestVersion` (fast path)
|
|
227
|
+
* and a sorted-category fingerprint (so palette/scheme changes still
|
|
228
|
+
* invalidate). Multiple scene builders within one frame skip the data scan
|
|
229
|
+
* entirely after the first call.
|
|
184
230
|
*/
|
|
185
231
|
private resolveColorMap;
|
|
186
232
|
private resolveLineStyle;
|
|
187
233
|
private resolveAreaStyle;
|
|
188
234
|
/** Resolve a group name to a color from the cached color map or a dedicated group palette.
|
|
189
235
|
* First checks _colorMapCache (populated by resolveColorMap when colorAccessor is set).
|
|
190
|
-
* Falls back to _groupColorMap (insertion-order, never mutates _colorMapCache).
|
|
236
|
+
* Falls back to _groupColorMap (insertion-order, never mutates _colorMapCache).
|
|
237
|
+
*
|
|
238
|
+
* FIFO-evicts the oldest entry when the map exceeds `GROUP_COLOR_MAP_CAP`. The palette index
|
|
239
|
+
* uses `_groupColorCounter` (monotonic, decoupled from map size) so eviction doesn't cause
|
|
240
|
+
* new groups to collide with existing entries on a shrunk map. */
|
|
191
241
|
private resolveGroupColor;
|
|
192
242
|
/**
|
|
193
243
|
* Return a cached materialized array of the buffer contents.
|
|
@@ -196,18 +246,18 @@ export declare class PipelineStore {
|
|
|
196
246
|
* transition ticks, hover redraws, and other non-data-changing renders.
|
|
197
247
|
*/
|
|
198
248
|
private getBufferArray;
|
|
199
|
-
getData():
|
|
249
|
+
getData(): Datum[];
|
|
200
250
|
/**
|
|
201
251
|
* Remove data points by ID. Requires pointIdAccessor to be configured.
|
|
202
252
|
* Returns the removed items. Marks the store dirty for scene rebuild.
|
|
203
253
|
*/
|
|
204
|
-
remove(id: string | string[]):
|
|
254
|
+
remove(id: string | string[]): Datum[];
|
|
205
255
|
/**
|
|
206
256
|
* Update data points by ID. Requires pointIdAccessor.
|
|
207
257
|
* The updater receives the current datum and returns the replacement.
|
|
208
258
|
* Returns the previous values. Extents and scene are marked dirty.
|
|
209
259
|
*/
|
|
210
|
-
update(id: string | string[], updater: (d:
|
|
260
|
+
update(id: string | string[], updater: (d: Datum) => Datum): Datum[];
|
|
211
261
|
/** Returns sorted bin boundary values from the last bar scene build. Persists until clear() or the next bar scene build. */
|
|
212
262
|
getBinBoundaries(): number[];
|
|
213
263
|
getExtents(): {
|
|
@@ -216,9 +266,9 @@ export declare class PipelineStore {
|
|
|
216
266
|
} | null;
|
|
217
267
|
clear(): void;
|
|
218
268
|
get size(): number;
|
|
219
|
-
getBuffer(): RingBuffer<
|
|
220
|
-
getXAccessor(): (d:
|
|
221
|
-
getYAccessor(): (d:
|
|
222
|
-
getCategoryAccessor(): ((d:
|
|
269
|
+
getBuffer(): RingBuffer<Datum>;
|
|
270
|
+
getXAccessor(): (d: Datum) => number;
|
|
271
|
+
getYAccessor(): (d: Datum) => number;
|
|
272
|
+
getCategoryAccessor(): ((d: Datum) => string) | undefined;
|
|
223
273
|
updateConfig(config: Partial<PipelineConfig>): void;
|
|
224
274
|
}
|