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
@@ -26,7 +26,42 @@ export interface CirclePackProps<TNode extends Datum = Datum> extends BaseChartP
26
26
  /**
27
27
  * CirclePack - Visualize hierarchical data as nested circles.
28
28
  *
29
- * Wraps StreamNetworkFrame (canvas-first) for circle-pack visualization.
29
+ * Each leaf becomes a circle sized by `valueAccessor`; parents enclose
30
+ * their children. Best for hierarchies where size encoding matters more
31
+ * than precise comparisons.
32
+ *
33
+ * For rectangular tiling of the same data shape use {@link Treemap}; for
34
+ * radial parent→child connections use {@link TreeDiagram}.
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * // Filesystem-style hierarchy sized by file size
39
+ * <CirclePack
40
+ * data={{
41
+ * name: "src",
42
+ * children: [
43
+ * { name: "components", children: [
44
+ * { name: "Chart.tsx", value: 1200 },
45
+ * { name: "Frame.tsx", value: 800 },
46
+ * ]},
47
+ * { name: "utils", children: [{ name: "color.ts", value: 400 }] },
48
+ * ],
49
+ * }}
50
+ * valueAccessor="value"
51
+ * childrenAccessor="children"
52
+ * />
53
+ * ```
54
+ *
55
+ * @example
56
+ * ```tsx
57
+ * // Color by depth instead of by leaf identity
58
+ * <CirclePack
59
+ * data={hierarchyRoot}
60
+ * valueAccessor="size"
61
+ * colorByDepth
62
+ * showLabels
63
+ * />
64
+ * ```
30
65
  */
31
66
  export declare function CirclePack<TNode extends Datum = Datum>(props: CirclePackProps<TNode>): import("react/jsx-runtime").JSX.Element;
32
67
  export declare namespace CirclePack {
@@ -9,21 +9,99 @@ import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
9
9
  * ForceDirectedGraph component props
10
10
  */
11
11
  export interface ForceDirectedGraphProps<TNode extends Datum = Datum, TEdge extends Datum = Datum> extends BaseChartProps {
12
+ /**
13
+ * Array of node objects. Each node must have a unique id (or other field
14
+ * named by `nodeIdAccessor`).
15
+ *
16
+ * **Required for static rendering**: when `edges` is provided, `nodes`
17
+ * must be too — even if it could be inferred from edge endpoints, pass
18
+ * an explicit list so layout can run.
19
+ *
20
+ * **Push mode**: omit BOTH `nodes` and `edges` to opt into ref-based
21
+ * push mode. Validation skips both arrays in that case and the chart
22
+ * accumulates topology from `ref.current.push(...)` calls.
23
+ * @example
24
+ * ```ts
25
+ * [{ id: "A", group: "core" }, { id: "B", group: "leaf" }]
26
+ * ```
27
+ */
12
28
  nodes?: TNode[];
29
+ /**
30
+ * Array of edge objects. Each edge must reference two node ids via
31
+ * `sourceAccessor` and `targetAccessor`. Required for static rendering;
32
+ * omit together with `nodes` for push mode (see above).
33
+ * @example
34
+ * ```ts
35
+ * [{ source: "A", target: "B", weight: 3 }]
36
+ * ```
37
+ */
13
38
  edges?: TEdge[];
39
+ /**
40
+ * Field name or function returning the node's unique id. Edge sources
41
+ * and targets reference this value.
42
+ * @default "id"
43
+ */
44
+ nodeIdAccessor?: ChartAccessor<TNode, string>;
45
+ /**
46
+ * @deprecated Use `nodeIdAccessor` (camelCase) instead. Removed in
47
+ * 4.0. The other network HOCs (`SankeyDiagram`, `ChordDiagram`,
48
+ * `TreeDiagram`, `OrbitDiagram`) all use the camelCase form;
49
+ * `nodeIDAccessor` (uppercase ID) was a casing inconsistency in
50
+ * `ForceDirectedGraph` that the SSR demo's verification matrix
51
+ * surfaced.
52
+ */
14
53
  nodeIDAccessor?: ChartAccessor<TNode, string>;
54
+ /** @default "source" */
15
55
  sourceAccessor?: ChartAccessor<TEdge, string>;
56
+ /** @default "target" */
16
57
  targetAccessor?: ChartAccessor<TEdge, string>;
58
+ /**
59
+ * Field or function for the label text rendered next to a node when
60
+ * `showLabels` is true.
61
+ * @default nodeIdAccessor
62
+ */
17
63
  nodeLabel?: ChartAccessor<TNode, string>;
64
+ /**
65
+ * Field or function that determines node color. Set together with
66
+ * `showLegend` for a legend.
67
+ */
18
68
  colorBy?: ChartAccessor<TNode, string>;
69
+ /** d3 scheme name or explicit color array; falls back to theme. */
19
70
  colorScheme?: string | string[];
71
+ /**
72
+ * Constant pixel radius, or a function/field returning a numeric value
73
+ * scaled into `nodeSizeRange`.
74
+ * @default 8
75
+ */
20
76
  nodeSize?: number | ChartAccessor<TNode, number>;
77
+ /**
78
+ * Min/max pixel radius when `nodeSize` is data-driven.
79
+ * @default [5, 20]
80
+ */
21
81
  nodeSizeRange?: [number, number];
82
+ /**
83
+ * Constant pixel width, or a function/field returning a numeric value
84
+ * scaled to a default width range.
85
+ * @default 1
86
+ */
22
87
  edgeWidth?: number | ChartAccessor<TEdge, number>;
23
88
  edgeColor?: string;
24
89
  edgeOpacity?: number;
90
+ /**
91
+ * Number of force-simulation ticks before the layout settles.
92
+ * @default 300
93
+ */
25
94
  iterations?: number;
95
+ /**
96
+ * Magnitude of the repulsion force between nodes; higher values spread
97
+ * the graph more.
98
+ * @default 0.1
99
+ */
26
100
  forceStrength?: number;
101
+ /**
102
+ * Render labels next to nodes. Uses `nodeLabel` accessor (defaulting to
103
+ * `nodeIdAccessor`).
104
+ */
27
105
  showLabels?: boolean;
28
106
  enableHover?: boolean;
29
107
  showLegend?: boolean;
@@ -33,9 +111,59 @@ export interface ForceDirectedGraphProps<TNode extends Datum = Datum, TEdge exte
33
111
  frameProps?: Partial<Omit<StreamNetworkFrameProps, "nodes" | "edges" | "size">>;
34
112
  }
35
113
  /**
36
- * ForceDirectedGraph - Visualize network relationships with force-directed layout
114
+ * ForceDirectedGraph - Visualize network relationships with a force-directed layout.
37
115
  *
38
- * Wraps StreamNetworkFrame (canvas-first) for force-directed network visualization.
116
+ * Nodes are positioned by simulating attraction along edges and repulsion
117
+ * between unconnected nodes; the layout settles after `iterations` ticks.
118
+ * Wraps {@link StreamNetworkFrame} (canvas-first rendering for large graphs).
119
+ *
120
+ * For ordered hierarchical data prefer {@link TreeDiagram}; for flow
121
+ * relationships prefer {@link SankeyDiagram}; for nested grouping prefer
122
+ * {@link CirclePack} or {@link Treemap}.
123
+ *
124
+ * @example
125
+ * ```tsx
126
+ * // Simple network with explicit nodes and edges
127
+ * <ForceDirectedGraph
128
+ * nodes={[{ id: "A" }, { id: "B" }, { id: "C" }]}
129
+ * edges={[
130
+ * { source: "A", target: "B" },
131
+ * { source: "B", target: "C" },
132
+ * ]}
133
+ * showLabels
134
+ * />
135
+ * ```
136
+ *
137
+ * @example
138
+ * ```tsx
139
+ * // Color by group, edge width from weight, sized nodes
140
+ * <ForceDirectedGraph
141
+ * nodes={nodes}
142
+ * edges={edges}
143
+ * colorBy="group"
144
+ * nodeSize="degree"
145
+ * nodeSizeRange={[6, 24]}
146
+ * edgeWidth="weight"
147
+ * showLegend
148
+ * />
149
+ * ```
150
+ *
151
+ * @example
152
+ * ```tsx
153
+ * // Tighter clustering for dense graphs
154
+ * <ForceDirectedGraph
155
+ * nodes={nodes}
156
+ * edges={edges}
157
+ * forceStrength={0.4}
158
+ * iterations={500}
159
+ * />
160
+ * ```
161
+ *
162
+ * @remarks
163
+ * Force simulation runs synchronously to `iterations`; for very large
164
+ * graphs (>2k nodes) consider lowering `iterations` so layout settles in
165
+ * a reasonable frame budget. Hover, click, and selection wiring follow
166
+ * the same patterns as the rest of the library.
39
167
  */
40
168
  export declare const ForceDirectedGraph: {
41
169
  <TNode extends Datum = Datum, TEdge extends Datum = Datum>(props: ForceDirectedGraphProps<TNode, TEdge> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
@@ -73,6 +73,43 @@ export interface OrbitDiagramProps<TDatum extends Datum = Datum> extends BaseCha
73
73
  /** Frame props passthrough */
74
74
  frameProps?: Partial<Omit<StreamNetworkFrameProps, "data" | "size">>;
75
75
  }
76
+ /**
77
+ * OrbitDiagram - Visualize a hierarchy as concentric orbits with optional rotation.
78
+ *
79
+ * Each level of the hierarchy becomes an orbit ring at a different radius;
80
+ * children are placed around their parent's orbit. With `animated` set
81
+ * (the default), nodes rotate continuously at `speed`, producing a
82
+ * planet-system feel.
83
+ *
84
+ * @example
85
+ * ```tsx
86
+ * // Static orbits
87
+ * <OrbitDiagram
88
+ * data={{
89
+ * name: "Sun",
90
+ * children: [
91
+ * { name: "Mercury" },
92
+ * { name: "Venus" },
93
+ * { name: "Earth", children: [{ name: "Moon" }] },
94
+ * { name: "Mars" },
95
+ * ],
96
+ * }}
97
+ * childrenAccessor="children"
98
+ * animated={false}
99
+ * />
100
+ * ```
101
+ *
102
+ * @example
103
+ * ```tsx
104
+ * // Animated, depth-colored, slower rotation
105
+ * <OrbitDiagram
106
+ * data={hierarchyRoot}
107
+ * childrenAccessor="children"
108
+ * colorByDepth
109
+ * speed={0.2}
110
+ * />
111
+ * ```
112
+ */
76
113
  export declare function OrbitDiagram<TDatum extends Datum = Datum>(props: OrbitDiagramProps<TDatum>): import("react/jsx-runtime").JSX.Element;
77
114
  export declare namespace OrbitDiagram {
78
115
  var displayName: string;
@@ -32,9 +32,58 @@ export interface SankeyDiagramProps<TNode extends Datum = Datum, TEdge extends D
32
32
  frameProps?: Partial<Omit<StreamNetworkFrameProps, "edges" | "size">>;
33
33
  }
34
34
  /**
35
- * SankeyDiagram - Visualize flow and magnitude of movement between nodes
35
+ * SankeyDiagram - Visualize directed many-step flow between nodes.
36
36
  *
37
- * Wraps StreamNetworkFrame (canvas-first) for Sankey flow visualization.
37
+ * Each `edge` is a ribbon whose width encodes `valueAccessor`. The layout
38
+ * positions nodes in vertical columns (`orientation: "horizontal"`) or
39
+ * horizontal rows (`orientation: "vertical"`) so flows always run in a
40
+ * single direction.
41
+ *
42
+ * For bidirectional same-tier flows prefer {@link ChordDiagram}; for
43
+ * unstructured many-to-many networks prefer {@link ForceDirectedGraph}.
44
+ *
45
+ * @example
46
+ * ```tsx
47
+ * // User funnel
48
+ * <SankeyDiagram
49
+ * nodes={[
50
+ * { id: "Visit" }, { id: "Signup" }, { id: "Activate" }, { id: "Drop" },
51
+ * ]}
52
+ * edges={[
53
+ * { source: "Visit", target: "Signup", value: 320 },
54
+ * { source: "Visit", target: "Drop", value: 180 },
55
+ * { source: "Signup", target: "Activate", value: 240 },
56
+ * { source: "Signup", target: "Drop", value: 80 },
57
+ * ]}
58
+ * valueAccessor="value"
59
+ * showLabels
60
+ * />
61
+ * ```
62
+ *
63
+ * @example
64
+ * ```tsx
65
+ * // Color edges by source, vertical orientation
66
+ * <SankeyDiagram
67
+ * nodes={nodes}
68
+ * edges={edges}
69
+ * valueAccessor="value"
70
+ * edgeColorBy="source"
71
+ * orientation="vertical"
72
+ * nodeAlign="justify"
73
+ * />
74
+ * ```
75
+ *
76
+ * @example
77
+ * ```tsx
78
+ * // Tighter nodes for many categories
79
+ * <SankeyDiagram
80
+ * nodes={nodes}
81
+ * edges={edges}
82
+ * valueAccessor="value"
83
+ * nodeWidth={6}
84
+ * nodePaddingRatio={0.3}
85
+ * />
86
+ * ```
38
87
  */
39
88
  export declare const SankeyDiagram: {
40
89
  <TNode extends Datum = Datum, TEdge extends Datum = Datum>(props: SankeyDiagramProps<TNode, TEdge> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
@@ -26,9 +26,44 @@ export interface TreeDiagramProps<TNode extends Datum = Datum> extends BaseChart
26
26
  frameProps?: Partial<Omit<StreamNetworkFrameProps, "edges" | "size">>;
27
27
  }
28
28
  /**
29
- * TreeDiagram - Visualize hierarchical data structures
29
+ * TreeDiagram - Visualize a hierarchy as connected node-link diagram.
30
30
  *
31
- * Wraps StreamNetworkFrame (canvas-first) for hierarchical tree visualization.
31
+ * `data` is a single root object whose children are walked via
32
+ * `childrenAccessor`. `layout` chooses between classic tidy-tree
33
+ * (`"tree"`), partition (`"partition"`), or radial (`"radial"`)
34
+ * arrangements; `orientation` flips horizontal/vertical for the linear
35
+ * layouts.
36
+ *
37
+ * For nested-rectangle encodings of the same data shape use
38
+ * {@link Treemap}; for nested circles use {@link CirclePack}; for
39
+ * concentric-orbit encodings use {@link OrbitDiagram}.
40
+ *
41
+ * @example
42
+ * ```tsx
43
+ * // Org chart
44
+ * <TreeDiagram
45
+ * data={{
46
+ * name: "CEO",
47
+ * reports: [
48
+ * { name: "VP Eng", reports: [{ name: "EM 1" }, { name: "EM 2" }] },
49
+ * { name: "VP Product" },
50
+ * ],
51
+ * }}
52
+ * childrenAccessor="reports"
53
+ * orientation="vertical"
54
+ * />
55
+ * ```
56
+ *
57
+ * @example
58
+ * ```tsx
59
+ * // Radial layout colored by depth
60
+ * <TreeDiagram
61
+ * data={hierarchyRoot}
62
+ * childrenAccessor="children"
63
+ * layout="radial"
64
+ * colorByDepth
65
+ * />
66
+ * ```
32
67
  */
33
68
  export declare function TreeDiagram<TNode extends Datum = Datum>(props: TreeDiagramProps<TNode>): import("react/jsx-runtime").JSX.Element;
34
69
  export declare namespace TreeDiagram {
@@ -25,9 +25,43 @@ export interface TreemapProps<TNode extends Datum = Datum> extends BaseChartProp
25
25
  frameProps?: Partial<Omit<StreamNetworkFrameProps, "edges" | "size">>;
26
26
  }
27
27
  /**
28
- * Treemap - Visualize hierarchical data as nested rectangles.
28
+ * Treemap - Visualize a hierarchy as nested rectangles sized by value.
29
29
  *
30
- * Wraps StreamNetworkFrame (canvas-first) for treemap visualization.
30
+ * Each leaf becomes a rectangle whose area is proportional to
31
+ * `valueAccessor`; ancestors enclose their descendants. Better than
32
+ * {@link CirclePack} when precise area comparison matters; better than
33
+ * {@link TreeDiagram} when leaf count is large.
34
+ *
35
+ * @example
36
+ * ```tsx
37
+ * // Department budgets
38
+ * <Treemap
39
+ * data={{
40
+ * name: "Total",
41
+ * children: [
42
+ * { name: "Eng", children: [
43
+ * { name: "Frontend", value: 120 },
44
+ * { name: "Platform", value: 90 },
45
+ * ]},
46
+ * { name: "Sales", value: 200 },
47
+ * { name: "Marketing", value: 60 },
48
+ * ],
49
+ * }}
50
+ * valueAccessor="value"
51
+ * childrenAccessor="children"
52
+ * showLabels
53
+ * />
54
+ * ```
55
+ *
56
+ * @example
57
+ * ```tsx
58
+ * // Color leaves by their parent (each top-level branch gets its own color)
59
+ * <Treemap
60
+ * data={hierarchyRoot}
61
+ * valueAccessor="size"
62
+ * colorBy="parent"
63
+ * />
64
+ * ```
31
65
  */
32
66
  export declare function Treemap<TNode extends Datum = Datum>(props: TreemapProps<TNode>): import("react/jsx-runtime").JSX.Element;
33
67
  export declare namespace Treemap {
@@ -9,14 +9,47 @@ import type { RealtimeFrameHandle } from "../../realtime/types";
9
9
  * BarChart component props
10
10
  */
11
11
  export interface BarChartProps<TDatum extends Datum = Datum> extends BaseChartProps {
12
+ /**
13
+ * Array of data rows. Each row should have a category and a numeric value.
14
+ * Omit when using the push API.
15
+ * @example
16
+ * ```ts
17
+ * [{ region: "EMEA", revenue: 120 }, { region: "Americas", revenue: 85 }]
18
+ * ```
19
+ */
12
20
  data?: TDatum[];
21
+ /**
22
+ * Field name or function returning the category for each row.
23
+ * @default "category"
24
+ */
13
25
  categoryAccessor?: ChartAccessor<TDatum, string>;
26
+ /**
27
+ * Field name or function returning the bar value.
28
+ * @default "value"
29
+ */
14
30
  valueAccessor?: ChartAccessor<TDatum, number>;
31
+ /**
32
+ * Bar direction. Horizontal puts categories on the y-axis; usually needs
33
+ * a wider left margin to fit the category labels.
34
+ * @default "vertical"
35
+ */
15
36
  orientation?: "vertical" | "horizontal";
37
+ /** Label rendered next to the category axis. */
16
38
  categoryLabel?: string;
39
+ /** Label rendered next to the value axis. */
17
40
  valueLabel?: string;
41
+ /** Custom formatter for value-axis ticks and tooltip values. */
18
42
  valueFormat?: (d: number | string) => string;
43
+ /**
44
+ * Field or function that determines bar color. Defaults to a single
45
+ * color when omitted. Setting `colorBy` also enables the legend.
46
+ */
19
47
  colorBy?: ChartAccessor<TDatum, string>;
48
+ /**
49
+ * Color scheme for `colorBy`. Either a d3 scheme name (`"category10"`,
50
+ * `"set2"`, etc.) or an explicit array of colors. Falls back to the
51
+ * theme's categorical palette when omitted.
52
+ */
20
53
  colorScheme?: string | string[];
21
54
  /** Category ordering. `false` (default) = insertion order. `"asc"` /
22
55
  * `"desc"` sorts by total value. `"auto"` preserves insertion order
@@ -62,7 +95,84 @@ export interface BarChartProps<TDatum extends Datum = Datum> extends BaseChartPr
62
95
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
63
96
  }
64
97
  /**
65
- * BarChart - Visualize categorical data with bars.
98
+ * BarChart - Visualize categorical data with vertical or horizontal bars.
99
+ *
100
+ * One bar per category. For multiple values per category use
101
+ * {@link StackedBarChart} (stacked segments) or {@link GroupedBarChart}
102
+ * (side-by-side bars).
103
+ *
104
+ * @example
105
+ * ```tsx
106
+ * // Simple bar chart
107
+ * <BarChart
108
+ * data={[
109
+ * { region: "EMEA", revenue: 120 },
110
+ * { region: "Americas", revenue: 85 },
111
+ * { region: "APAC", revenue: 60 },
112
+ * ]}
113
+ * categoryAccessor="region"
114
+ * valueAccessor="revenue"
115
+ * />
116
+ * ```
117
+ *
118
+ * @example
119
+ * ```tsx
120
+ * // Color by category, sorted descending by value
121
+ * <BarChart
122
+ * data={data}
123
+ * categoryAccessor="region"
124
+ * valueAccessor="revenue"
125
+ * colorBy="region"
126
+ * sort="desc"
127
+ * showLegend
128
+ * />
129
+ * ```
130
+ *
131
+ * @example
132
+ * ```tsx
133
+ * // Horizontal orientation — usually wants extra left margin for labels
134
+ * <BarChart
135
+ * data={data}
136
+ * categoryAccessor="region"
137
+ * valueAccessor="revenue"
138
+ * orientation="horizontal"
139
+ * margin={{ left: 120 }}
140
+ * />
141
+ * ```
142
+ *
143
+ * @example
144
+ * ```tsx
145
+ * // Gradient fill from bar tip toward baseline
146
+ * <BarChart
147
+ * data={data}
148
+ * categoryAccessor="region"
149
+ * valueAccessor="revenue"
150
+ * color="steelblue"
151
+ * gradientFill
152
+ * roundedTop={4}
153
+ * />
154
+ * ```
155
+ *
156
+ * @example
157
+ * ```tsx
158
+ * // Push API — omit `data`, mutate via ref
159
+ * const ref = useRef<RealtimeFrameHandle>(null)
160
+ * useEffect(() => {
161
+ * ref.current?.push({ region: "EMEA", revenue: 120 })
162
+ * }, [])
163
+ *
164
+ * <BarChart
165
+ * ref={ref}
166
+ * categoryAccessor="region"
167
+ * valueAccessor="revenue"
168
+ * />
169
+ * ```
170
+ *
171
+ * @remarks
172
+ * Wraps {@link StreamOrdinalFrame} with sensible bar defaults. For custom
173
+ * marks, advanced annotations, or non-standard layouts, pass through via
174
+ * `frameProps` or use StreamOrdinalFrame directly. See
175
+ * {@link https://semiotic.nteract.io/charts/bar-chart} for live demos.
66
176
  */
67
177
  export declare const BarChart: {
68
178
  <TDatum extends Datum = Datum>(props: BarChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
@@ -30,6 +30,37 @@ export interface BoxPlotProps<TDatum extends Datum = Datum> extends BaseChartPro
30
30
  categoryFormat?: CategoryFormatFn;
31
31
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
32
32
  }
33
+ /**
34
+ * BoxPlot - Five-number summary (min, Q1, median, Q3, max) per category.
35
+ *
36
+ * Each category gets a box from Q1 to Q3 with a median line, whiskers to
37
+ * the min/max within 1.5×IQR, and individual outlier dots beyond that
38
+ * range. Use {@link ViolinPlot} for full distribution shape or
39
+ * {@link RidgelinePlot} for stacked overlapping densities.
40
+ *
41
+ * @example
42
+ * ```tsx
43
+ * // Distribution of test scores per class
44
+ * <BoxPlot
45
+ * data={observations}
46
+ * categoryAccessor="class"
47
+ * valueAccessor="score"
48
+ * showOutliers
49
+ * />
50
+ * ```
51
+ *
52
+ * @example
53
+ * ```tsx
54
+ * // Hide outliers and color the boxes
55
+ * <BoxPlot
56
+ * data={observations}
57
+ * categoryAccessor="region"
58
+ * valueAccessor="latency_ms"
59
+ * colorBy="region"
60
+ * showOutliers={false}
61
+ * />
62
+ * ```
63
+ */
33
64
  export declare const BoxPlot: {
34
65
  <TDatum extends Datum = Datum>(props: BoxPlotProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
35
66
  displayName?: string;
@@ -25,6 +25,42 @@ export interface DonutChartProps<TDatum extends Datum = Datum> extends BaseChart
25
25
  annotations?: Datum[];
26
26
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
27
27
  }
28
+ /**
29
+ * DonutChart - Pie chart with a hole; supports center content.
30
+ *
31
+ * Same data shape as {@link PieChart}, but the inner radius leaves room
32
+ * for a value, label, or icon at the center via `centerContent`. Useful
33
+ * when the headline number is the total or a key fraction.
34
+ *
35
+ * @example
36
+ * ```tsx
37
+ * // Donut with the total in the center
38
+ * <DonutChart
39
+ * data={[
40
+ * { region: "EMEA", revenue: 120 },
41
+ * { region: "Americas", revenue: 85 },
42
+ * { region: "APAC", revenue: 60 },
43
+ * ]}
44
+ * categoryAccessor="region"
45
+ * valueAccessor="revenue"
46
+ * innerRadius={70}
47
+ * centerContent={<text fontSize={28}>$265</text>}
48
+ * />
49
+ * ```
50
+ *
51
+ * @example
52
+ * ```tsx
53
+ * // Thin ring with rounded wedges
54
+ * <DonutChart
55
+ * data={data}
56
+ * categoryAccessor="region"
57
+ * valueAccessor="revenue"
58
+ * innerRadius={120}
59
+ * cornerRadius={4}
60
+ * showLegend
61
+ * />
62
+ * ```
63
+ */
28
64
  export declare const DonutChart: {
29
65
  <TDatum extends Datum = Datum>(props: DonutChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
30
66
  displayName?: string;
@@ -38,6 +38,37 @@ export interface DotPlotProps<TDatum extends Datum = Datum> extends BaseChartPro
38
38
  categoryFormat?: CategoryFormatFn;
39
39
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
40
40
  }
41
+ /**
42
+ * DotPlot - One dot per category, positioned along the value axis.
43
+ *
44
+ * Lighter-weight than {@link BarChart} for sorted comparisons; emphasizes
45
+ * exact values rather than magnitude perception. Defaults to insertion
46
+ * order while streaming (so categories don't shuffle as values change)
47
+ * and value-descending on static data via `sort: "auto"`.
48
+ *
49
+ * @example
50
+ * ```tsx
51
+ * // Sorted ranking by metric
52
+ * <DotPlot
53
+ * data={teams}
54
+ * categoryAccessor="name"
55
+ * valueAccessor="score"
56
+ * />
57
+ * ```
58
+ *
59
+ * @example
60
+ * ```tsx
61
+ * // Color by group + grid for axis reading
62
+ * <DotPlot
63
+ * data={features}
64
+ * categoryAccessor="feature"
65
+ * valueAccessor="adoption"
66
+ * colorBy="team"
67
+ * showGrid
68
+ * showLegend
69
+ * />
70
+ * ```
71
+ */
41
72
  export declare const DotPlot: {
42
73
  <TDatum extends Datum = Datum>(props: DotPlotProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
43
74
  displayName?: string;