semiotic 3.4.1 → 3.5.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.
Files changed (164) hide show
  1. package/CLAUDE.md +114 -9
  2. package/README.md +45 -4
  3. package/ai/behaviorContracts.cjs +311 -0
  4. package/ai/chartSuggestions.cjs +291 -0
  5. package/ai/cli.js +255 -30
  6. package/ai/componentMetadata.cjs +107 -0
  7. package/ai/dist/mcp-server.js +907 -227
  8. package/ai/schema.json +3954 -2537
  9. package/ai/system-prompt.md +23 -4
  10. package/dist/components/LinkedCharts.d.ts +5 -1
  11. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  12. package/dist/components/charts/custom/NetworkCustomChart.d.ts +64 -0
  13. package/dist/components/charts/custom/OrdinalCustomChart.d.ts +71 -0
  14. package/dist/components/charts/custom/XYCustomChart.d.ts +59 -0
  15. package/dist/components/charts/geo/ChoroplethMap.d.ts +93 -2
  16. package/dist/components/charts/geo/DistanceCartogram.d.ts +51 -4
  17. package/dist/components/charts/geo/FlowMap.d.ts +55 -0
  18. package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +53 -0
  19. package/dist/components/charts/index.d.ts +6 -0
  20. package/dist/components/charts/network/ChordDiagram.d.ts +34 -2
  21. package/dist/components/charts/network/CirclePack.d.ts +36 -1
  22. package/dist/components/charts/network/ForceDirectedGraph.d.ts +130 -2
  23. package/dist/components/charts/network/OrbitDiagram.d.ts +37 -0
  24. package/dist/components/charts/network/SankeyDiagram.d.ts +51 -2
  25. package/dist/components/charts/network/TreeDiagram.d.ts +37 -2
  26. package/dist/components/charts/network/Treemap.d.ts +36 -2
  27. package/dist/components/charts/ordinal/BarChart.d.ts +111 -1
  28. package/dist/components/charts/ordinal/BoxPlot.d.ts +31 -0
  29. package/dist/components/charts/ordinal/DonutChart.d.ts +36 -0
  30. package/dist/components/charts/ordinal/DotPlot.d.ts +31 -0
  31. package/dist/components/charts/ordinal/FunnelChart.d.ts +40 -0
  32. package/dist/components/charts/ordinal/GaugeChart.d.ts +45 -0
  33. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +38 -0
  34. package/dist/components/charts/ordinal/Histogram.d.ts +95 -0
  35. package/dist/components/charts/ordinal/LikertChart.d.ts +42 -0
  36. package/dist/components/charts/ordinal/PieChart.d.ts +90 -1
  37. package/dist/components/charts/ordinal/RidgelinePlot.d.ts +27 -0
  38. package/dist/components/charts/ordinal/StackedBarChart.d.ts +38 -0
  39. package/dist/components/charts/ordinal/SwarmPlot.d.ts +36 -0
  40. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +60 -0
  41. package/dist/components/charts/ordinal/ViolinPlot.d.ts +32 -0
  42. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +22 -4
  43. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +5 -2
  44. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +24 -3
  45. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +12 -0
  46. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +14 -0
  47. package/dist/components/charts/realtime/defaultRealtimeTooltip.d.ts +43 -0
  48. package/dist/components/charts/realtime/resolveWindowSize.d.ts +26 -0
  49. package/dist/components/charts/shared/chartSpecs.d.ts +91 -0
  50. package/dist/components/charts/shared/colorPalettes.d.ts +62 -0
  51. package/dist/components/charts/shared/colorUtils.d.ts +9 -10
  52. package/dist/components/charts/shared/numberFormat.d.ts +58 -0
  53. package/dist/components/charts/shared/sparseArray.d.ts +27 -0
  54. package/dist/components/charts/shared/streamPropsHelpers.d.ts +113 -0
  55. package/dist/components/charts/shared/timeFormat.d.ts +60 -0
  56. package/dist/components/charts/shared/useChartSetup.d.ts +8 -0
  57. package/dist/components/charts/shared/useCustomChartSetup.d.ts +84 -0
  58. package/dist/components/charts/shared/useFrameImperativeHandle.d.ts +28 -0
  59. package/dist/components/charts/shared/useOrdinalStreaming.d.ts +6 -19
  60. package/dist/components/charts/shared/useStreamingLegend.d.ts +27 -11
  61. package/dist/components/charts/shared/validateProps.d.ts +2 -2
  62. package/dist/components/charts/shared/validationMap.d.ts +2 -1
  63. package/dist/components/charts/shared/withChartWrapper.d.ts +13 -4
  64. package/dist/components/charts/xy/AreaChart.d.ts +30 -1
  65. package/dist/components/charts/xy/CandlestickChart.d.ts +33 -6
  66. package/dist/components/charts/xy/ConnectedScatterplot.d.ts +24 -0
  67. package/dist/components/charts/xy/MinimapChart.d.ts +51 -0
  68. package/dist/components/charts/xy/MultiAxisLineChart.d.ts +27 -0
  69. package/dist/components/charts/xy/QuadrantChart.d.ts +21 -0
  70. package/dist/components/charts/xy/Scatterplot.d.ts +34 -2
  71. package/dist/components/charts/xy/ScatterplotMatrix.d.ts +16 -0
  72. package/dist/components/charts/xy/StackedAreaChart.d.ts +49 -1
  73. package/dist/components/export/selectionSerializer.d.ts +1 -1
  74. package/dist/components/realtime/types.d.ts +7 -9
  75. package/dist/components/recipes/bullet.d.ts +86 -0
  76. package/dist/components/recipes/calendar.d.ts +43 -0
  77. package/dist/components/recipes/dagre.d.ts +56 -0
  78. package/dist/components/recipes/flextree.d.ts +55 -0
  79. package/dist/components/recipes/marimekko.d.ts +55 -0
  80. package/dist/components/recipes/parallelCoordinates.d.ts +97 -0
  81. package/dist/components/recipes/recipeUtils.d.ts +27 -0
  82. package/dist/components/recipes/waffle.d.ts +46 -0
  83. package/dist/components/semiotic-ai.d.ts +4 -0
  84. package/dist/components/semiotic-network.d.ts +3 -0
  85. package/dist/components/semiotic-ordinal.d.ts +3 -0
  86. package/dist/components/semiotic-recipes.d.ts +24 -0
  87. package/dist/components/semiotic-xy.d.ts +3 -0
  88. package/dist/components/semiotic.d.ts +2 -2
  89. package/dist/components/server/renderToStaticSVG.d.ts +8 -2
  90. package/dist/components/server/serverChartConfigs.d.ts +47 -1
  91. package/dist/components/server/staticAnnotations.d.ts +6 -0
  92. package/dist/components/store/ObservationStore.d.ts +1 -3
  93. package/dist/components/store/SelectionStore.d.ts +2 -4
  94. package/dist/components/store/ThemeStore.d.ts +4 -4
  95. package/dist/components/store/TooltipStore.d.ts +5 -3
  96. package/dist/components/store/createStore.d.ts +4 -2
  97. package/dist/components/store/useSelection.d.ts +7 -4
  98. package/dist/components/stream/CanvasHitTester.d.ts +10 -8
  99. package/dist/components/stream/DataSourceAdapter.d.ts +9 -0
  100. package/dist/components/stream/GeoPipelineStore.d.ts +9 -0
  101. package/dist/components/stream/GeoTileRenderer.d.ts +14 -0
  102. package/dist/components/stream/NetworkPipelineStore.d.ts +25 -0
  103. package/dist/components/stream/NetworkSVGOverlay.d.ts +18 -12
  104. package/dist/components/stream/OrdinalPipelineStore.d.ts +12 -0
  105. package/dist/components/stream/PipelineStore.d.ts +51 -0
  106. package/dist/components/stream/SVGOverlay.d.ts +12 -0
  107. package/dist/components/stream/SceneGraph.d.ts +15 -1
  108. package/dist/components/stream/SceneToSVG.d.ts +1 -1
  109. package/dist/components/stream/categoryDomain.d.ts +4 -0
  110. package/dist/components/stream/composeOverlays.d.ts +15 -0
  111. package/dist/components/stream/customLayout.d.ts +76 -0
  112. package/dist/components/stream/customLayoutPalette.d.ts +29 -0
  113. package/dist/components/stream/geoTypes.d.ts +33 -8
  114. package/dist/components/stream/hoverUtils.d.ts +4 -10
  115. package/dist/components/stream/keyboardNav.d.ts +18 -6
  116. package/dist/components/stream/networkCustomLayout.d.ts +67 -0
  117. package/dist/components/stream/networkTypes.d.ts +87 -21
  118. package/dist/components/stream/ordinalCustomLayout.d.ts +84 -0
  119. package/dist/components/stream/ordinalTypes.d.ts +47 -13
  120. package/dist/components/stream/renderers/barFunnelCanvasRenderer.d.ts +9 -1
  121. package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +92 -0
  122. package/dist/components/stream/sampleCurvePath.d.ts +9 -0
  123. package/dist/components/stream/types.d.ts +57 -10
  124. package/dist/components/stream/useHydration.d.ts +89 -0
  125. package/dist/components/stream/useStableShallow.d.ts +1 -0
  126. package/dist/components/stream/xySceneBuilders/types.d.ts +4 -0
  127. package/dist/geo.min.js +2 -1
  128. package/dist/geo.module.min.js +2 -1
  129. package/dist/network.min.js +2 -1
  130. package/dist/network.module.min.js +2 -1
  131. package/dist/ordinal.min.js +2 -1
  132. package/dist/ordinal.module.min.js +2 -1
  133. package/dist/realtime.min.js +2 -1
  134. package/dist/realtime.module.min.js +2 -1
  135. package/dist/semiotic-ai.d.ts +69 -65
  136. package/dist/semiotic-ai.min.js +2 -1
  137. package/dist/semiotic-ai.module.min.js +2 -1
  138. package/dist/semiotic-data.d.ts +4 -4
  139. package/dist/semiotic-geo.d.ts +15 -15
  140. package/dist/semiotic-network.d.ts +19 -16
  141. package/dist/semiotic-ordinal.d.ts +31 -28
  142. package/dist/semiotic-realtime.d.ts +17 -17
  143. package/dist/semiotic-recipes.d.ts +24 -0
  144. package/dist/semiotic-recipes.min.js +1 -0
  145. package/dist/semiotic-recipes.module.min.js +1 -0
  146. package/dist/semiotic-server.d.ts +6 -6
  147. package/dist/semiotic-statisticalOverlays-C3DsOgr_.js +1 -0
  148. package/dist/semiotic-themes.d.ts +3 -3
  149. package/dist/semiotic-themes.min.js +2 -1
  150. package/dist/semiotic-themes.module.min.js +2 -1
  151. package/dist/semiotic-utils.d.ts +23 -23
  152. package/dist/semiotic-utils.min.js +2 -1
  153. package/dist/semiotic-utils.module.min.js +2 -1
  154. package/dist/semiotic-xy.d.ts +27 -24
  155. package/dist/semiotic.d.ts +63 -63
  156. package/dist/semiotic.min.js +2 -1
  157. package/dist/semiotic.module.min.js +2 -1
  158. package/dist/server.min.js +1 -1
  159. package/dist/server.module.min.js +1 -1
  160. package/dist/test-utils/canvasMock.d.ts +34 -5
  161. package/dist/xy.min.js +2 -1
  162. package/dist/xy.module.min.js +2 -1
  163. package/package.json +40 -20
  164. package/dist/semiotic-statisticalOverlays-Ckd_jM8z.js +0 -1
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Recipes entry point — curated layout functions for use with `XYCustomChart`.
3
+ *
4
+ * Import from "semiotic/recipes" instead of the full bundle. Recipes are
5
+ * pure CustomLayout functions that emit standard SceneNodes; they get hit
6
+ * testing, transitions, decay, theme cascade, and SSR for free.
7
+ */
8
+ export { waffleLayout } from "./recipes/waffle";
9
+ export type { WaffleConfig } from "./recipes/waffle";
10
+ export { calendarLayout } from "./recipes/calendar";
11
+ export type { CalendarConfig } from "./recipes/calendar";
12
+ export { flextreeLayout } from "./recipes/flextree";
13
+ export type { FlextreeConfig } from "./recipes/flextree";
14
+ export { dagreLayout } from "./recipes/dagre";
15
+ export type { DagreConfig } from "./recipes/dagre";
16
+ export { marimekkoLayout } from "./recipes/marimekko";
17
+ export type { MarimekkoConfig } from "./recipes/marimekko";
18
+ export { bulletLayout } from "./recipes/bullet";
19
+ export type { BulletConfig } from "./recipes/bullet";
20
+ export { parallelCoordinatesLayout } from "./recipes/parallelCoordinates";
21
+ export type { ParallelCoordinatesConfig } from "./recipes/parallelCoordinates";
22
+ export type { CustomLayout, LayoutContext, LayoutResult, } from "./stream/customLayout";
23
+ export type { NetworkCustomLayout, NetworkLayoutContext, NetworkLayoutResult, } from "./stream/networkCustomLayout";
24
+ export type { OrdinalCustomLayout, OrdinalLayoutContext, OrdinalLayoutResult, } from "./stream/ordinalCustomLayout";
@@ -16,7 +16,9 @@ export { MinimapChart } from "./charts/xy/MinimapChart";
16
16
  export { QuadrantChart } from "./charts/xy/QuadrantChart";
17
17
  export { MultiAxisLineChart } from "./charts/xy/MultiAxisLineChart";
18
18
  export { CandlestickChart } from "./charts/xy/CandlestickChart";
19
+ export { XYCustomChart } from "./charts/custom/XYCustomChart";
19
20
  export type { StreamXYFrameProps, StreamXYFrameHandle } from "./stream/types";
21
+ export type { CustomLayout, LayoutContext, LayoutResult } from "./stream/customLayout";
20
22
  export type { LineChartProps } from "./charts/xy/LineChart";
21
23
  export type { AreaChartProps } from "./charts/xy/AreaChart";
22
24
  export type { StackedAreaChartProps } from "./charts/xy/StackedAreaChart";
@@ -27,3 +29,4 @@ export type { HeatmapProps } from "./charts/xy/Heatmap";
27
29
  export type { QuadrantChartProps } from "./charts/xy/QuadrantChart";
28
30
  export type { MultiAxisLineChartProps } from "./charts/xy/MultiAxisLineChart";
29
31
  export type { CandlestickChartProps } from "./charts/xy/CandlestickChart";
32
+ export type { XYCustomChartProps } from "./charts/custom/XYCustomChart";
@@ -1,7 +1,7 @@
1
1
  import StreamXYFrame from "./stream/StreamXYFrame";
2
2
  import StreamOrdinalFrame from "./stream/StreamOrdinalFrame";
3
3
  import StreamNetworkFrame from "./stream/StreamNetworkFrame";
4
- import { Scatterplot, ConnectedScatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, LikertChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, PieChart, DonutChart, GaugeChart, GroupedBarChart, FunnelChart, SwimlaneChart, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, Treemap, CirclePack, OrbitDiagram, ScatterplotMatrix, MinimapChart, QuadrantChart, MultiAxisLineChart, CandlestickChart } from "./charts";
4
+ import { Scatterplot, ConnectedScatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, LikertChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, PieChart, DonutChart, GaugeChart, GroupedBarChart, FunnelChart, SwimlaneChart, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, Treemap, CirclePack, OrbitDiagram, ScatterplotMatrix, MinimapChart, QuadrantChart, MultiAxisLineChart, CandlestickChart, XYCustomChart, NetworkCustomChart, OrdinalCustomChart } from "./charts";
5
5
  import { LinkedCharts } from "./LinkedCharts";
6
6
  import { ThemeProvider, useTheme } from "./ThemeProvider";
7
7
  import { exportChart } from "./export/exportChart";
@@ -23,7 +23,7 @@ import { RealtimeTemporalHistogram, RealtimeHistogram } from "./charts/realtime/
23
23
  import { RealtimeSwarmChart } from "./charts/realtime/RealtimeSwarmChart";
24
24
  import { RealtimeWaterfallChart } from "./charts/realtime/RealtimeWaterfallChart";
25
25
  import { RealtimeHeatmap } from "./charts/realtime/RealtimeHeatmap";
26
- export { StreamXYFrame, StreamOrdinalFrame, StreamNetworkFrame, Scatterplot, ConnectedScatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, LikertChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, PieChart, DonutChart, GaugeChart, FunnelChart, GroupedBarChart, SwimlaneChart, Treemap, CirclePack, OrbitDiagram, ScatterplotMatrix, MinimapChart, QuadrantChart, MultiAxisLineChart, CandlestickChart, LinkedCharts, ThemeProvider, useTheme, exportChart, toConfig, fromConfig, toURL, fromURL, copyConfig, configToJSX, serializeSelections, deserializeSelections, fromVegaLite, ChartErrorBoundary, ChartContainer, ChartGrid, CategoryColorProvider, useCategoryColors, ContextLayout, DetailsPanel, Tooltip, MultiLineTooltip, normalizeTooltip, RingBuffer, IncrementalExtent, RealtimeLineChart, RealtimeTemporalHistogram, RealtimeHistogram, RealtimeSwarmChart, RealtimeWaterfallChart, RealtimeHeatmap, createHatchPattern };
26
+ export { StreamXYFrame, StreamOrdinalFrame, StreamNetworkFrame, Scatterplot, ConnectedScatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, LikertChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, PieChart, DonutChart, GaugeChart, FunnelChart, GroupedBarChart, SwimlaneChart, Treemap, CirclePack, OrbitDiagram, ScatterplotMatrix, MinimapChart, QuadrantChart, MultiAxisLineChart, CandlestickChart, XYCustomChart, NetworkCustomChart, OrdinalCustomChart, LinkedCharts, ThemeProvider, useTheme, exportChart, toConfig, fromConfig, toURL, fromURL, copyConfig, configToJSX, serializeSelections, deserializeSelections, fromVegaLite, ChartErrorBoundary, ChartContainer, ChartGrid, CategoryColorProvider, useCategoryColors, ContextLayout, DetailsPanel, Tooltip, MultiLineTooltip, normalizeTooltip, RingBuffer, IncrementalExtent, RealtimeLineChart, RealtimeTemporalHistogram, RealtimeHistogram, RealtimeSwarmChart, RealtimeWaterfallChart, RealtimeHeatmap, createHatchPattern };
27
27
  export { ScatterplotProps, ConnectedScatterplotProps, LineChartProps, AreaChartProps, StackedAreaChartProps, HeatmapProps, BubbleChartProps, BarChartProps, StackedBarChartProps, LikertChartProps, SwarmPlotProps, BoxPlotProps, HistogramProps, ViolinPlotProps, DotPlotProps, PieChartProps, DonutChartProps, GaugeChartProps, GaugeThreshold, FunnelChartProps, GroupedBarChartProps, SwimlaneChartProps, RidgelinePlotProps, OrbitDiagramProps, OrbitNode, ForceDirectedGraphProps, ChordDiagramProps, SankeyDiagramProps, TreeDiagramProps, TreemapProps, CirclePackProps, ScatterplotMatrixProps, MinimapChartProps, MinimapConfig, QuadrantChartProps, MultiAxisLineChartProps, MultiAxisSeriesConfig, CandlestickChartProps, QuadrantsConfig, QuadrantConfig, CenterlineStyle, BaseChartProps, AxisConfig, Accessor, ChartAccessor, ChartMode } from "./charts";
28
28
  export type { StreamXYFrameProps, StreamXYFrameHandle, StreamChartType, RuntimeMode, SceneNode, Changeset, StreamScales, StreamLayout, CurveType, CanvasRendererFn } from "./stream/types";
29
29
  export type { StreamRendererFn } from "./stream/renderers/types";
@@ -20,6 +20,7 @@ import type { StreamNetworkFrameProps } from "../stream/networkTypes";
20
20
  import type { StreamOrdinalFrameProps } from "../stream/ordinalTypes";
21
21
  import type { StreamGeoFrameProps } from "../stream/geoTypes";
22
22
  import { type ThemeInput } from "./themeResolver";
23
+ import { CHART_CONFIGS } from "./serverChartConfigs";
23
24
  type FrameType = "xy" | "ordinal" | "network" | "geo";
24
25
  interface ThemeAwareProps {
25
26
  theme?: ThemeInput;
@@ -39,8 +40,13 @@ export declare function renderXYToStaticSVG(props: StreamXYFrameProps & ThemeAwa
39
40
  export declare function renderOrdinalToStaticSVG(props: StreamOrdinalFrameProps & ThemeAwareProps): string;
40
41
  export declare function renderNetworkToStaticSVG(props: StreamNetworkFrameProps & ThemeAwareProps): string;
41
42
  export declare function renderGeoToStaticSVG(props: StreamGeoFrameProps & ThemeAwareProps): string;
42
- /** Chart component name to frame type + props mapping */
43
- type ChartName = "LineChart" | "AreaChart" | "StackedAreaChart" | "Scatterplot" | "BubbleChart" | "ConnectedScatterplot" | "Heatmap" | "Sparkline" | "BarChart" | "StackedBarChart" | "GroupedBarChart" | "PieChart" | "DonutChart" | "SwimlaneChart" | "Histogram" | "BoxPlot" | "ViolinPlot" | "SwarmPlot" | "DotPlot" | "RidgelinePlot" | "LikertChart" | "FunnelChart" | "GaugeChart" | "ForceDirectedGraph" | "SankeyDiagram" | "ChordDiagram" | "TreeDiagram" | "Treemap" | "CirclePack" | "ChoroplethMap" | "ProportionalSymbolMap" | "FlowMap";
43
+ /**
44
+ * Chart component names renderable via `renderChart()`. Derived from the
45
+ * registry so adding a chart to `CHART_CONFIGS` automatically widens this
46
+ * union — no second edit required, no silent drift like the CandlestickChart
47
+ * gap that motivated this refactor.
48
+ */
49
+ type ChartName = keyof typeof CHART_CONFIGS;
44
50
  interface RenderChartOptions {
45
51
  /** Output format — currently only "svg" is synchronous */
46
52
  format?: "svg";
@@ -5,5 +5,51 @@ interface ChartConfig {
5
5
  /** Build frame props from HOC-level props */
6
6
  buildProps: (data: any, colorBy: any, colorScheme: any, common: Datum, rest: Datum) => Datum;
7
7
  }
8
- export declare const CHART_CONFIGS: Record<string, ChartConfig>;
8
+ export declare const CHART_CONFIGS: {
9
+ Sparkline: ChartConfig;
10
+ LineChart: ChartConfig;
11
+ AreaChart: ChartConfig;
12
+ StackedAreaChart: ChartConfig;
13
+ Scatterplot: ChartConfig;
14
+ CandlestickChart: ChartConfig;
15
+ BubbleChart: {
16
+ frameType: "xy";
17
+ buildProps: (data: any, colorBy: any, colorScheme: any, common: Datum, rest: Datum) => {
18
+ chartType: string;
19
+ data: any;
20
+ xAccessor: any;
21
+ yAccessor: any;
22
+ colorAccessor: any;
23
+ sizeAccessor: any;
24
+ sizeRange: any;
25
+ colorScheme: any;
26
+ };
27
+ };
28
+ ConnectedScatterplot: ChartConfig;
29
+ Heatmap: ChartConfig;
30
+ BarChart: ChartConfig;
31
+ StackedBarChart: ChartConfig;
32
+ GroupedBarChart: ChartConfig;
33
+ PieChart: ChartConfig;
34
+ DonutChart: ChartConfig;
35
+ Histogram: ChartConfig;
36
+ BoxPlot: ChartConfig;
37
+ ViolinPlot: ChartConfig;
38
+ SwarmPlot: ChartConfig;
39
+ DotPlot: ChartConfig;
40
+ SwimlaneChart: ChartConfig;
41
+ RidgelinePlot: ChartConfig;
42
+ LikertChart: ChartConfig;
43
+ FunnelChart: ChartConfig;
44
+ GaugeChart: ChartConfig;
45
+ ForceDirectedGraph: ChartConfig;
46
+ SankeyDiagram: ChartConfig;
47
+ ChordDiagram: ChartConfig;
48
+ TreeDiagram: ChartConfig;
49
+ Treemap: ChartConfig;
50
+ CirclePack: ChartConfig;
51
+ ChoroplethMap: ChartConfig;
52
+ ProportionalSymbolMap: ChartConfig;
53
+ FlowMap: ChartConfig;
54
+ };
9
55
  export {};
@@ -17,6 +17,12 @@ interface AnnotationScales {
17
17
  };
18
18
  /** For ordinal charts: value scale */
19
19
  r?: (v: number) => number;
20
+ /**
21
+ * For geo charts: projects [lon, lat] → [x, y] pixel coords. Set by
22
+ * `renderGeoFrame` from the resolved `GeoPipelineStore` projection.
23
+ * Annotations that carry `coordinates: [lon, lat]` resolve through this.
24
+ */
25
+ geoProjection?: (coords: [number, number]) => [number, number] | null;
20
26
  }
21
27
  interface AnnotationLayout {
22
28
  width: number;
@@ -56,7 +56,5 @@ export interface ObservationStoreState {
56
56
  pushObservation: (observation: ChartObservation) => void;
57
57
  clearObservations: () => void;
58
58
  }
59
- export declare const ObservationProvider: import("react").FC<{
60
- children: React.ReactNode;
61
- }>, useObservationSelector: <R>(selector: (state: ObservationStoreState) => R) => R;
59
+ export declare const ObservationProvider: import("react").FC<import("./createStore").StoreProviderProps<ObservationStoreState>>, useObservationSelector: <R>(selector: (state: ObservationStoreState) => R) => R;
62
60
  export {};
@@ -2,7 +2,7 @@ import type { Datum } from "../charts/shared/datumTypes";
2
2
  export type ResolutionMode = "union" | "intersect" | "crossfilter";
3
3
  export interface FieldConstraint {
4
4
  type: "point";
5
- values: Set<any>;
5
+ values: Set<unknown>;
6
6
  }
7
7
  export interface IntervalConstraint {
8
8
  type: "interval";
@@ -27,6 +27,4 @@ export interface SelectionStoreState {
27
27
  clearSelection: (selectionName: string) => void;
28
28
  }
29
29
  export declare function buildPredicate(selection: Selection, requestingClientId?: string): (d: Datum) => boolean;
30
- export declare const SelectionProvider: import("react").FC<{
31
- children: React.ReactNode;
32
- }>, useSelectionSelector: <R>(selector: (state: SelectionStoreState) => R) => R;
30
+ export declare const SelectionProvider: import("react").FC<import("./createStore").StoreProviderProps<SelectionStoreState>>, useSelectionSelector: <R>(selector: (state: SelectionStoreState) => R) => R;
@@ -88,8 +88,8 @@ export declare const DARK_THEME: SemioticTheme;
88
88
  export declare const HIGH_CONTRAST_THEME: SemioticTheme;
89
89
  export interface ThemeStoreState {
90
90
  theme: SemioticTheme;
91
- setTheme: (theme: Partial<SemioticTheme> | "light" | "dark" | "high-contrast") => void;
91
+ setTheme: (theme: ThemeStoreUpdate) => void;
92
92
  }
93
- export declare const ThemeProvider: import("react").FC<{
94
- children: React.ReactNode;
95
- }>, useThemeSelector: <R>(selector: (state: ThemeStoreState) => R) => R;
93
+ export type ThemeStoreUpdate = Partial<SemioticTheme> | "light" | "dark" | "high-contrast";
94
+ export declare function resolveThemeUpdate(current: SemioticTheme, theme: ThemeStoreUpdate): SemioticTheme;
95
+ export declare const ThemeProvider: import("react").FC<import("./createStore").StoreProviderProps<ThemeStoreState>>, useThemeSelector: <R>(selector: (state: ThemeStoreState) => R) => R;
@@ -1,4 +1,6 @@
1
- declare const TooltipProvider: import("react").FC<{
2
- children: React.ReactNode;
3
- }>, useTooltip: <R>(selector: (state: unknown) => R) => R;
1
+ interface TooltipStoreState {
2
+ tooltip: unknown;
3
+ changeTooltip: (tooltip: unknown) => void;
4
+ }
5
+ declare const TooltipProvider: import("react").FC<import("./createStore").StoreProviderProps<TooltipStoreState>>, useTooltip: <R>(selector: (state: TooltipStoreState) => R) => R;
4
6
  export { TooltipProvider, useTooltip };
@@ -1,4 +1,6 @@
1
1
  import * as React from "react";
2
- export declare function createStore<T>(fn: (set: (updater: (current: T) => Partial<T>) => void) => T): [React.FC<{
2
+ export interface StoreProviderProps<T> {
3
3
  children: React.ReactNode;
4
- }>, <R>(selector: (state: T) => R) => R];
4
+ initialState?: Partial<T>;
5
+ }
6
+ export declare function createStore<T>(fn: (set: (updater: (current: T) => Partial<T>) => void) => T): [React.FC<StoreProviderProps<T>>, <R>(selector: (state: T) => R) => R];
@@ -14,7 +14,7 @@ export interface UseSelectionResult {
14
14
  /** Whether any selection clause is currently active */
15
15
  isActive: boolean;
16
16
  /** Set a point selection (categorical values) */
17
- selectPoints: (fieldValues: Record<string, any[]>) => void;
17
+ selectPoints: (fieldValues: Record<string, unknown[]>) => void;
18
18
  /** Set an interval selection (numeric ranges) */
19
19
  selectInterval: (fieldRanges: Record<string, [number, number]>) => void;
20
20
  /** Clear this client's clause */
@@ -47,12 +47,12 @@ export interface UseBrushSelectionOptions {
47
47
  yField?: string;
48
48
  }
49
49
  export interface UseBrushSelectionResult {
50
- /** Interaction config to pass to frameProps.interaction */
51
50
  brushInteraction: {
52
51
  brush: "xyBrush" | "xBrush" | "yBrush";
53
- during: (extent: any) => void;
54
- end: (extent: any) => void;
52
+ during: (extent: BrushExtent | null) => void;
53
+ end: (extent: BrushExtent | null) => void;
55
54
  };
55
+ /** Interaction config to pass to frameProps.interaction */
56
56
  /** Returns true if datum matches the brush selection */
57
57
  predicate: (datum: Datum) => boolean;
58
58
  /** Whether any brush is active */
@@ -60,6 +60,9 @@ export interface UseBrushSelectionResult {
60
60
  /** Clear the brush */
61
61
  clear: () => void;
62
62
  }
63
+ type LinearBrushExtent = [number, number];
64
+ type XYBrushExtent = [[number, number], [number, number]];
65
+ type BrushExtent = LinearBrushExtent | XYBrushExtent | [number, number][];
63
66
  export declare function useBrushSelection(options: UseBrushSelectionOptions): UseBrushSelectionResult;
64
67
  /**
65
68
  * Returns the subset of `data` that matches the given selection.
@@ -9,6 +9,15 @@ export interface HitResult {
9
9
  y: number;
10
10
  distance: number;
11
11
  }
12
+ export interface XHitResult {
13
+ node: SceneNode;
14
+ datum: any;
15
+ x: number;
16
+ y: number;
17
+ y0?: number;
18
+ group?: string;
19
+ color?: string;
20
+ }
12
21
  /**
13
22
  * Find the nearest scene node to the given pixel coordinates.
14
23
  * Dispatches to type-specific hit testers for optimal performance.
@@ -29,14 +38,7 @@ export declare function findNearestNode(scene: SceneNode[], px: number, py: numb
29
38
  * For each node, interpolates the Y value at px using the path data.
30
39
  * Used for multi-point tooltip (show all series values at the hovered X).
31
40
  */
32
- export declare function findAllNodesAtX(scene: SceneNode[], px: number, maxXDistance?: number): Array<{
33
- node: SceneNode;
34
- datum: any;
35
- x: number;
36
- y: number;
37
- group?: string;
38
- color?: string;
39
- }>;
41
+ export declare function findAllNodesAtX(scene: SceneNode[], px: number, maxXDistance?: number): XHitResult[];
40
42
  /**
41
43
  * Binary search for nearest point by time value in a RingBuffer.
42
44
  */
@@ -62,12 +62,21 @@ export declare class DataSourceAdapter<T = Datum> {
62
62
  * Data is buffered and flushed as a single changeset via microtask,
63
63
  * so rapid sequential push() calls within the same task are batched
64
64
  * into one callback invocation.
65
+ *
66
+ * Drops `null`/non-object data so a `ref.push(null)` (typically from a
67
+ * loader returning a falsy row) doesn't reach extent/accessor reads
68
+ * inside the pipeline store. Mirrors the bounded-ingest hardening.
65
69
  */
66
70
  push(datum: T): void;
67
71
  /**
68
72
  * Push multiple data (streaming batch).
69
73
  * Like push(), data is buffered and flushed via microtask. Multiple
70
74
  * pushMany() calls within the same task are coalesced.
75
+ *
76
+ * Sparse entries are dropped during the buffer copy. Mirrors the
77
+ * bounded-ingest hardening — `ref.pushMany([null, valid])` lands the
78
+ * valid row and silently skips the null instead of crashing the
79
+ * pipeline. The early `length === 0` short-circuit still applies.
71
80
  */
72
81
  pushMany(data: T[]): void;
73
82
  /**
@@ -101,5 +101,14 @@ export declare class GeoPipelineStore {
101
101
  private applyPulse;
102
102
  get hasActivePulses(): boolean;
103
103
  private startTransition;
104
+ /**
105
+ * Cancel any pending intro animation set up by the most recent
106
+ * `computeScene` call. After this, the next paint shows the scene
107
+ * in its final state directly. See `PipelineStore.cancelIntroAnimation`
108
+ * for the full rationale — Stream Frames call this when they detect
109
+ * SSR hydration so the canvas takeover doesn't re-animate from
110
+ * blank after the server already painted the chart.
111
+ */
112
+ cancelIntroAnimation(): void;
104
113
  advanceTransition(now: number): boolean;
105
114
  }
@@ -1,3 +1,17 @@
1
+ /**
2
+ * GeoTileRenderer — fetches, caches, and renders raster map tiles on a canvas.
3
+ *
4
+ * Inlines slippy-tile math from `d3-tile` (the v1 module is ~30 lines
5
+ * of math; the dependency wasn't earning its weight). The math is
6
+ * Web Mercator standard: each zoom level z has 2^z × 2^z 256-px tiles
7
+ * tiling the world; given a projection scale (in d3 units, where
8
+ * scale=256 puts the world in 256 px) and a translate offset, we
9
+ * compute the tile coordinates that cover the visible viewport and
10
+ * the (translate, scale) transform that maps tile coords to canvas px.
11
+ *
12
+ * Tiles are always in Web Mercator projection. A dev warning is
13
+ * emitted if tiles are used with a non-Mercator projection.
14
+ */
1
15
  import type { GeoProjection } from "d3-geo";
2
16
  export type TileURLTemplate = string | ((z: number, x: number, y: number, dpr: number) => string);
3
17
  interface CachedTile {
@@ -19,6 +19,8 @@ export declare class NetworkPipelineStore {
19
19
  sceneNodes: NetworkSceneNode[];
20
20
  sceneEdges: NetworkSceneEdge[];
21
21
  labels: NetworkLabel[];
22
+ /** Overlays returned from customNetworkLayout (consumed by StreamNetworkFrame). */
23
+ customLayoutOverlays: import("react").ReactNode;
22
24
  particlePool: ParticlePool | null;
23
25
  private config;
24
26
  private tensionConfig;
@@ -75,6 +77,15 @@ export declare class NetworkPipelineStore {
75
77
  * Run the layout algorithm via the appropriate plugin.
76
78
  */
77
79
  runLayout(size: [number, number]): void;
80
+ /**
81
+ * Compute added/removed node and edge sets relative to the previous
82
+ * layout snapshot, and update `lastTopologyChangeTime` if anything
83
+ * changed. Shared by the plugin path (`runLayout` finalization) and the
84
+ * customLayout escape hatch — without this, `getTopologyDiff()` and
85
+ * built-in topology-diff highlighting silently stop working when a
86
+ * `customNetworkLayout` is supplied.
87
+ */
88
+ private recordTopologyDiff;
78
89
  /**
79
90
  * Build the scene graph from current layout positions.
80
91
  */
@@ -86,6 +97,20 @@ export declare class NetworkPipelineStore {
86
97
  * Returns true if the scene should be rebuilt.
87
98
  */
88
99
  tickAnimation(size: [number, number], deltaTime: number): boolean;
100
+ /**
101
+ * Cancel any pending intro animation that the most recent layout
102
+ * pass set up. After this, the next paint shows nodes/edges in
103
+ * their final positions directly — no transition from the
104
+ * center-origin intro state.
105
+ *
106
+ * Stream Frames call this when they detect SSR hydration. The
107
+ * server already painted the chart in its final state via the SVG
108
+ * branch, so re-animating from blank when the canvas takes over is
109
+ * a visual regression.
110
+ *
111
+ * Idempotent — a second call is a no-op.
112
+ */
113
+ cancelIntroAnimation(): void;
89
114
  /**
90
115
  * Advance the transition animation. Returns true if still animating.
91
116
  */
@@ -2,6 +2,17 @@ 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";
5
+ type AnnotationAnchorNode = {
6
+ type: string;
7
+ datum: Datum | null;
8
+ id?: string;
9
+ x?: number;
10
+ y?: number;
11
+ cx?: number;
12
+ cy?: number;
13
+ w?: number;
14
+ h?: number;
15
+ };
5
16
  export interface NetworkSVGOverlayProps {
6
17
  width: number;
7
18
  height: number;
@@ -35,20 +46,14 @@ export interface NetworkSVGOverlayProps {
35
46
  /** User-provided SVG elements on top */
36
47
  foregroundGraphics?: ReactNode;
37
48
  /** Scene nodes for annotation positioning */
38
- sceneNodes?: Array<{
39
- type: string;
40
- datum: any;
41
- id?: string;
42
- x?: number;
43
- y?: number;
44
- cx?: number;
45
- cy?: number;
46
- w?: number;
47
- h?: number;
48
- }>;
49
+ sceneNodes?: AnnotationAnchorNode[];
49
50
  /** Annotations */
50
51
  annotations?: Datum[];
51
- svgAnnotationRules?: (annotation: Datum, index: number, context: any) => ReactNode;
52
+ svgAnnotationRules?: (annotation: Datum, index: number, context: {
53
+ width: number;
54
+ height: number;
55
+ sceneNodes?: AnnotationAnchorNode[];
56
+ }) => ReactNode;
52
57
  annotationFrame?: number;
53
58
  }
54
59
  /**
@@ -61,3 +66,4 @@ export declare function NetworkSVGOverlay(props: NetworkSVGOverlayProps): import
61
66
  export declare namespace NetworkSVGOverlay {
62
67
  var displayName: string;
63
68
  }
69
+ export {};
@@ -53,6 +53,8 @@ export declare class OrdinalPipelineStore {
53
53
  multiScales: (ScaleLinear<number, number>)[];
54
54
  scene: OrdinalSceneNode[];
55
55
  columns: Record<string, OrdinalColumn>;
56
+ /** Overlays returned from customLayout (consumed by StreamOrdinalFrame). */
57
+ customLayoutOverlays: import("react").ReactNode;
56
58
  version: number;
57
59
  /** Bumped whenever the buffer is mutated. Used to invalidate per-frame caches. */
58
60
  private _dataVersion;
@@ -78,6 +80,7 @@ export declare class OrdinalPipelineStore {
78
80
  private buildColumns;
79
81
  private getSceneContext;
80
82
  private buildSceneNodes;
83
+ private buildLayoutContext;
81
84
  private resolvePieceStyle;
82
85
  private getColorFromScheme;
83
86
  private resolveSummaryStyle;
@@ -115,6 +118,15 @@ export declare class OrdinalPipelineStore {
115
118
  private snapshotPositions;
116
119
  private startTransition;
117
120
  advanceTransition(now: number): boolean;
121
+ /**
122
+ * Cancel any pending intro animation that the most recent
123
+ * `computeScene` call set up. After this, the next paint shows the
124
+ * scene in its final state directly. See `PipelineStore.cancelIntroAnimation`
125
+ * for the full rationale — Stream Frames call this when they detect
126
+ * SSR hydration so the canvas takeover doesn't re-animate from blank
127
+ * after the server already painted the chart.
128
+ */
129
+ cancelIntroAnimation(): void;
118
130
  getData(): Datum[];
119
131
  /**
120
132
  * Remove data items by ID. Requires dataIdAccessor to be configured.
@@ -3,6 +3,8 @@ import { type Quadtree } from "d3-quadtree";
3
3
  import { RingBuffer } from "../realtime/RingBuffer";
4
4
  import type { Changeset, StreamChartType, StreamScales, StreamLayout, SceneNode, PointSceneNode, CandlestickStyle, Style, ArrowOfTime, WindowMode, DecayConfig, PulseConfig, TransitionConfig, StalenessConfig, CurveType, BarStyle, ThemeSemanticColors } from "./types";
5
5
  import type { ActiveTransition } from "./pipelineTransitionUtils";
6
+ import type { CustomLayout } from "./customLayout";
7
+ import type { MarginType } from "../types/marginType";
6
8
  export interface PipelineConfig {
7
9
  chartType: StreamChartType;
8
10
  runtimeMode?: "streaming" | "bounded";
@@ -29,6 +31,10 @@ export interface PipelineConfig {
29
31
  sizeRange?: [number, number];
30
32
  binSize?: number;
31
33
  normalize?: boolean;
34
+ /** Stacked area baseline mode. Only consulted by stackedarea chart type. */
35
+ baseline?: "zero" | "wiggle" | "silhouette";
36
+ /** Stack order — see StreamXYFrameProps.stackOrder. */
37
+ stackOrder?: "key" | "insideOut" | "asc" | "desc";
32
38
  openAccessor?: string | ((d: Datum) => number);
33
39
  highAccessor?: string | ((d: Datum) => number);
34
40
  lowAccessor?: string | ((d: Datum) => number);
@@ -117,6 +123,14 @@ export interface PipelineConfig {
117
123
  heatmapValueFormat?: (v: number) => string;
118
124
  pointIdAccessor?: string | ((d: Datum) => string);
119
125
  curve?: CurveType;
126
+ /** When provided, replaces chart-type dispatch in scene building.
127
+ * Receives a LayoutContext (scales, dimensions, theme, resolveColor)
128
+ * and returns scene nodes plus optional overlays. */
129
+ customLayout?: CustomLayout;
130
+ /** User-supplied config blob threaded through to LayoutContext.config. */
131
+ layoutConfig?: object;
132
+ /** Resolved margin — passed through so LayoutContext.dimensions.margin reflects what the frame actually used. */
133
+ layoutMargin?: MarginType;
120
134
  }
121
135
  export declare class PipelineStore {
122
136
  private buffer;
@@ -173,6 +187,8 @@ export declare class PipelineStore {
173
187
  scales: StreamScales | null;
174
188
  scene: SceneNode[];
175
189
  version: number;
190
+ /** Overlays returned from customLayout (consumed by StreamXYFrame for SVGOverlay). */
191
+ customLayoutOverlays: import("react").ReactNode;
176
192
  /** True when the x accessor returns Date objects (auto-detected on first data ingestion) */
177
193
  xIsDate: boolean;
178
194
  private _quadtree;
@@ -182,9 +198,21 @@ export declare class PipelineStore {
182
198
  private _maxPointRadius;
183
199
  private static readonly QUADTREE_THRESHOLD;
184
200
  constructor(config: PipelineConfig);
201
+ private pushDatumYExtent;
202
+ private rebuildYExtent;
203
+ private rebuildExtents;
204
+ private _lastBoundedInsertsRef;
185
205
  /**
186
206
  * Process a changeset from DataSourceAdapter.
187
207
  * Returns true if the scene needs re-rendering.
208
+ *
209
+ * Bounded mode is idempotent on identical `inserts` references —
210
+ * passing the same array a second time is a no-op (returns `false`,
211
+ * indicating no re-render needed). This makes render-time calls
212
+ * from the SSR branch safe under React StrictMode / concurrent
213
+ * rendering, where render runs twice. Non-bounded (streaming)
214
+ * ingests have no such guard because each new buffer entry is
215
+ * meaningful — streaming consumers don't pass the same array twice.
188
216
  */
189
217
  ingest(changeset: Changeset): boolean;
190
218
  /**
@@ -220,6 +248,29 @@ export declare class PipelineStore {
220
248
  private synthesizeIntroPositions;
221
249
  private startTransition;
222
250
  advanceTransition(now: number): boolean;
251
+ /**
252
+ * Cancel any pending intro animation that the most recent
253
+ * `computeScene` call set up. After this, the next paint shows the
254
+ * scene in its final state directly — no transition from zero-state
255
+ * positions, no clip-from-left animation on line/area marks.
256
+ *
257
+ * Stream Frames call this when they detect SSR hydration: the server
258
+ * already painted the chart in its final state via the SVG branch,
259
+ * so re-animating from blank when the canvas takes over is a visual
260
+ * regression. Subsequent data-change transitions still animate
261
+ * normally because they re-populate `prevPositionMap` from the
262
+ * snapshot taken before the change.
263
+ *
264
+ * Per-node `_introClipFraction` MUST be cleared too — line and area
265
+ * canvas renderers consume it directly (a `clipFrac < 1` produces a
266
+ * left-clip that hides the rest of the path), and `synthesizeIntroPositions`
267
+ * sets it to 0. Without the clear, line / area charts would paint
268
+ * blank on the first canvas frame after hydration.
269
+ *
270
+ * Idempotent — a second call is a no-op since the maps are already
271
+ * empty and the per-node flags are already undefined.
272
+ */
273
+ cancelIntroAnimation(): void;
223
274
  private groupData;
224
275
  /**
225
276
  * Resolve a category→color map from data using the colorAccessor.
@@ -81,6 +81,18 @@ interface SVGOverlayProps {
81
81
  curve?: string;
82
82
  /** When true, grid lines and axis baselines are skipped (rendered by SVGUnderlay instead) */
83
83
  underlayRendered?: boolean;
84
+ /**
85
+ * Hint from the frame about whether the canvas is painting an opaque
86
+ * background that will hide `SVGUnderlay`. When `true`, this overlay
87
+ * also renders grid + baselines (otherwise nothing shows in the CSR
88
+ * steady state — the canvas covers the underlay copy). When `false`
89
+ * — e.g. `background="transparent"` or a `backgroundGraphics` SVG
90
+ * sibling — the underlay is visible and we skip the overlay copy to
91
+ * avoid the doubled / slightly-darker stroke. Defaults to `true` so
92
+ * existing callers behave the same as the post-jagged-base-fix
93
+ * baseline.
94
+ */
95
+ canvasObscuresUnderlay?: boolean;
84
96
  /** Name of the linked crosshair store entry to read */
85
97
  linkedCrosshairName?: string;
86
98
  /** Source chart ID — crosshair line is suppressed on the source to avoid double rendering */
@@ -4,10 +4,24 @@ export declare function buildLineNode(data: Datum[], scales: StreamScales, xGet:
4
4
  export declare function buildAreaNode(data: Datum[], scales: StreamScales, xGet: (d: Datum) => number, yGet: (d: Datum) => number, baselineY: number, style: Style, group?: string, y0Get?: (d: Datum) => number): AreaSceneNode;
5
5
  /** Per-group-per-x stacked top values, keyed by group then x */
6
6
  export type StackedTops = Map<string, Map<number, number>>;
7
+ export type StackBaseline = "zero" | "wiggle" | "silhouette";
8
+ /**
9
+ * Compute per-x stack baseline offsets. Shared between scene rendering
10
+ * (`buildStackedAreaNodes`) and extent computation (`PipelineStore`) so
11
+ * both see the same y-bounds — without this, the wiggle offset's
12
+ * accumulated drift can exceed `±total/2` and clip against a too-small
13
+ * y-domain.
14
+ *
15
+ * Inputs:
16
+ * xValues — sorted unique x values
17
+ * groupKeys — group keys in stacking order (same order both callers use)
18
+ * valueAt — (groupKey, x) → group's value at x (0 if absent)
19
+ */
20
+ export declare function computeStackOffsets(xValues: number[], groupKeys: string[], valueAt: (groupKey: string, x: number) => number, baseline: StackBaseline): Map<number, number>;
7
21
  export declare function buildStackedAreaNodes(groups: {
8
22
  key: string;
9
23
  data: Datum[];
10
- }[], scales: StreamScales, xGet: (d: Datum) => number, yGet: (d: Datum) => number, styleFn: (group: string, sampleDatum?: Datum) => Style, normalize?: boolean, curve?: CurveType): {
24
+ }[], scales: StreamScales, xGet: (d: Datum) => number, yGet: (d: Datum) => number, styleFn: (group: string, sampleDatum?: Datum) => Style, normalize?: boolean, curve?: CurveType, baseline?: StackBaseline): {
11
25
  nodes: AreaSceneNode[];
12
26
  stackedTops: StackedTops;
13
27
  };
@@ -9,7 +9,7 @@ import type { SceneNode } from "./types";
9
9
  import type { NetworkSceneNode, NetworkSceneEdge, NetworkLabel } from "./networkTypes";
10
10
  import type { OrdinalSceneNode } from "./ordinalTypes";
11
11
  import type { GeoSceneNode } from "./geoTypes";
12
- export declare function xySceneNodeToSVG(node: SceneNode, i: number): React.ReactNode;
12
+ export declare function xySceneNodeToSVG(node: SceneNode, i: number, idPrefix?: string): React.ReactNode;
13
13
  export declare function networkSceneNodeToSVG(node: NetworkSceneNode, i: number): React.ReactNode;
14
14
  export declare function networkSceneEdgeToSVG(edge: NetworkSceneEdge, i: number): React.ReactNode;
15
15
  export declare function networkLabelToSVG(label: NetworkLabel, i: number): React.ReactNode;
@@ -0,0 +1,4 @@
1
+ import type { Datum } from "../charts/shared/datumTypes";
2
+ export type CategoryDomainAccessor<T = Datum> = string | ((d: T) => unknown);
3
+ export declare function extractCategoryDomain<T extends Datum>(data: T[], accessor: CategoryDomainAccessor<T> | undefined): string[];
4
+ export declare function sameCategoryDomain(a: readonly string[], b: readonly string[]): boolean;