semiotic 3.0.0-beta.3 → 3.0.0-beta.5

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 (138) hide show
  1. package/CLAUDE.md +116 -751
  2. package/README.md +80 -7
  3. package/dist/CategoryColors.d.ts +48 -0
  4. package/dist/ChartContainer.d.ts +60 -0
  5. package/dist/ChartGrid.d.ts +37 -0
  6. package/dist/ContextLayout.d.ts +38 -0
  7. package/dist/DetailsPanel.d.ts +37 -0
  8. package/dist/LinkedCharts.d.ts +2 -0
  9. package/dist/Tooltip/Tooltip.d.ts +2 -2
  10. package/dist/charts/index.d.ts +1 -1
  11. package/dist/charts/ordinal/BarChart.d.ts +1 -0
  12. package/dist/charts/ordinal/BoxPlot.d.ts +1 -0
  13. package/dist/charts/ordinal/DonutChart.d.ts +1 -0
  14. package/dist/charts/ordinal/DotPlot.d.ts +1 -0
  15. package/dist/charts/ordinal/GroupedBarChart.d.ts +1 -0
  16. package/dist/charts/ordinal/Histogram.d.ts +1 -0
  17. package/dist/charts/ordinal/PieChart.d.ts +1 -0
  18. package/dist/charts/ordinal/RidgelinePlot.d.ts +1 -0
  19. package/dist/charts/ordinal/StackedBarChart.d.ts +1 -0
  20. package/dist/charts/ordinal/SwarmPlot.d.ts +1 -0
  21. package/dist/charts/ordinal/ViolinPlot.d.ts +1 -0
  22. package/dist/charts/realtime/RealtimeHeatmap.d.ts +11 -0
  23. package/dist/charts/realtime/RealtimeHistogram.d.ts +15 -1
  24. package/dist/charts/realtime/RealtimeLineChart.d.ts +6 -0
  25. package/dist/charts/realtime/RealtimeSwarmChart.d.ts +6 -0
  26. package/dist/charts/realtime/RealtimeWaterfallChart.d.ts +6 -0
  27. package/dist/charts/shared/annotationRules.d.ts +3 -0
  28. package/dist/charts/shared/colorUtils.d.ts +17 -11
  29. package/dist/charts/shared/hooks.d.ts +96 -1
  30. package/dist/charts/shared/loess.d.ts +13 -0
  31. package/dist/charts/shared/networkUtils.d.ts +31 -0
  32. package/dist/charts/shared/statisticalOverlays.d.ts +76 -0
  33. package/dist/charts/shared/tooltipUtils.d.ts +16 -0
  34. package/dist/charts/shared/types.d.ts +21 -2
  35. package/dist/charts/shared/validateChartData.d.ts +2 -3
  36. package/dist/charts/shared/validateProps.d.ts +18 -0
  37. package/dist/charts/xy/AreaChart.d.ts +26 -1
  38. package/dist/charts/xy/BubbleChart.d.ts +6 -0
  39. package/dist/charts/xy/Heatmap.d.ts +4 -0
  40. package/dist/charts/xy/LineChart.d.ts +18 -0
  41. package/dist/charts/xy/Scatterplot.d.ts +4 -0
  42. package/dist/charts/xy/StackedAreaChart.d.ts +4 -0
  43. package/dist/data/fromVegaLite.d.ts +48 -0
  44. package/dist/export/chartConfig.d.ts +29 -0
  45. package/dist/export/selectionSerializer.d.ts +20 -0
  46. package/dist/geometry/sankeyLinks.d.ts +1 -1
  47. package/dist/network.min.js +1 -1
  48. package/dist/network.module.min.js +1 -1
  49. package/dist/ordinal.min.js +1 -1
  50. package/dist/ordinal.module.min.js +1 -1
  51. package/dist/realtime/types.d.ts +20 -6
  52. package/dist/realtime.min.js +1 -1
  53. package/dist/realtime.module.min.js +1 -1
  54. package/dist/semiotic-ai.d.ts +21 -0
  55. package/dist/semiotic-ai.min.js +1 -1
  56. package/dist/semiotic-ai.module.min.js +1 -1
  57. package/dist/semiotic-data.d.ts +2 -0
  58. package/dist/semiotic-data.min.js +1 -1
  59. package/dist/semiotic-data.module.min.js +1 -1
  60. package/dist/semiotic-network.d.ts +9 -19
  61. package/dist/semiotic-ordinal.d.ts +12 -14
  62. package/dist/semiotic-xy.d.ts +12 -18
  63. package/dist/semiotic.d.ts +22 -13
  64. package/dist/semiotic.min.js +1 -1
  65. package/dist/semiotic.module.min.js +1 -1
  66. package/dist/server.min.js +1 -1
  67. package/dist/server.module.min.js +1 -1
  68. package/dist/store/ObservationStore.d.ts +61 -0
  69. package/dist/store/SelectionStore.d.ts +9 -1
  70. package/dist/store/ThemeStore.d.ts +6 -1
  71. package/dist/store/TooltipStore.d.ts +3 -1
  72. package/dist/store/createStore.d.ts +4 -1
  73. package/dist/store/useObservation.d.ts +18 -0
  74. package/dist/stream/MarginalGraphics.d.ts +1 -1
  75. package/dist/stream/NetworkPipelineStore.d.ts +44 -0
  76. package/dist/stream/OrdinalCanvasHitTester.d.ts +1 -0
  77. package/dist/stream/OrdinalSVGOverlay.d.ts +6 -2
  78. package/dist/stream/ParticlePool.d.ts +2 -1
  79. package/dist/stream/PipelineStore.d.ts +17 -0
  80. package/dist/stream/SVGOverlay.d.ts +21 -2
  81. package/dist/stream/SceneGraph.d.ts +2 -2
  82. package/dist/stream/keyboardNav.d.ts +39 -0
  83. package/dist/stream/networkTypes.d.ts +60 -1
  84. package/dist/stream/ordinalTypes.d.ts +15 -0
  85. package/dist/stream/types.d.ts +38 -0
  86. package/dist/stream/useResponsiveSize.d.ts +10 -0
  87. package/dist/types/annotationTypes.d.ts +10 -0
  88. package/dist/types/networkTypes.d.ts +1 -2
  89. package/dist/xy.min.js +1 -1
  90. package/dist/xy.module.min.js +1 -1
  91. package/package.json +30 -38
  92. package/dist/AnnotationLayer/AnnotationLayer.d.ts +0 -25
  93. package/dist/Axis/Axis.d.ts +0 -7
  94. package/dist/Axis/axisTitle.d.ts +0 -10
  95. package/dist/Axis/index.d.ts +0 -2
  96. package/dist/Axis/summaryGraphic.d.ts +0 -17
  97. package/dist/Brush.d.ts +0 -12
  98. package/dist/DividedLine.d.ts +0 -16
  99. package/dist/TooltipPositioner/index.d.ts +0 -7
  100. package/dist/annotationLayerBehavior/annotationHandling.d.ts +0 -19
  101. package/dist/annotationLayerBehavior/d3labeler.d.ts +0 -9
  102. package/dist/annotationRules/baseRules.d.ts +0 -25
  103. package/dist/annotationRules/networkframeRules.d.ts +0 -48
  104. package/dist/annotationRules/xyframeRules.d.ts +0 -117
  105. package/dist/batchWork.d.ts +0 -6
  106. package/dist/constants/coordinateNames.d.ts +0 -8
  107. package/dist/constants/frame_props.d.ts +0 -13
  108. package/dist/data/dataFunctions.d.ts +0 -45
  109. package/dist/data/multiAccessorUtils.d.ts +0 -1
  110. package/dist/data/unflowedFunctions.d.ts +0 -1
  111. package/dist/generic_utilities/functions.d.ts +0 -1
  112. package/dist/geometry/areaDrawing.d.ts +0 -21
  113. package/dist/geometry/contourLayout.d.ts +0 -6
  114. package/dist/geometry/hexbinLayout.d.ts +0 -7
  115. package/dist/geometry/lineDrawing.d.ts +0 -71
  116. package/dist/geometry/summaryLayouts.d.ts +0 -45
  117. package/dist/index.d.ts +0 -1
  118. package/dist/processing/InteractionItems.d.ts +0 -13
  119. package/dist/processing/hierarchyUtils.d.ts +0 -16
  120. package/dist/processing/layouts/chordLayout.d.ts +0 -2
  121. package/dist/processing/layouts/forceLayout.d.ts +0 -3
  122. package/dist/processing/layouts/hierarchyLayout.d.ts +0 -10
  123. package/dist/processing/layouts/index.d.ts +0 -8
  124. package/dist/processing/layouts/sankeyLayout.d.ts +0 -8
  125. package/dist/processing/layouts/simpleLayouts.d.ts +0 -7
  126. package/dist/processing/layouts/types.d.ts +0 -17
  127. package/dist/processing/networkDefaults.d.ts +0 -36
  128. package/dist/realtime/renderers/barRenderer.d.ts +0 -2
  129. package/dist/realtime/renderers/candlestickRenderer.d.ts +0 -2
  130. package/dist/realtime/renderers/lineRenderer.d.ts +0 -2
  131. package/dist/realtime/renderers/swarmRenderer.d.ts +0 -2
  132. package/dist/stream/NetworkSceneGraph.d.ts +0 -14
  133. package/dist/stream/index.d.ts +0 -16
  134. package/dist/types/canvasTypes.d.ts +0 -9
  135. package/dist/types/xyTypes.d.ts +0 -24
  136. package/dist/useBoundingRect.d.ts +0 -2
  137. package/dist/visualizationLayerBehavior/axis.d.ts +0 -36
  138. package/dist/visualizationLayerBehavior/general.d.ts +0 -80
package/README.md CHANGED
@@ -87,10 +87,20 @@ LLM code generation. AI coding assistants can generate correct Semiotic code on
87
87
  the first try. Run `npx semiotic-ai --help` for CLI options or add `semiotic-mcp`
88
88
  to your MCP client config for tool-based chart rendering.
89
89
 
90
+ **Vega-Lite compatible.** Have existing Vega-Lite specs? `fromVegaLite(spec)`
91
+ translates them to Semiotic chart configs — instant onboarding from notebooks,
92
+ dashboards, or AI-generated specs. Composes with `configToJSX()`,
93
+ `copyConfig()`, and `toURL()` for full round-trip interop.
94
+
95
+ **Streaming system models.** Turn a streaming Sankey into a live system monitor:
96
+ click-to-inspect `DetailsPanel`, particle speed proportional to edge throughput,
97
+ threshold alerting with animated glow, and automatic topology diffing that
98
+ highlights new services as they appear. Visualization as product navigation.
99
+
90
100
  ## Install
91
101
 
92
102
  ```bash
93
- npm install semiotic@3.0.0-beta.3
103
+ npm install semiotic@3.0.0-beta.4
94
104
  ```
95
105
 
96
106
  Requires React 18.1 or later.
@@ -154,6 +164,31 @@ import { ForceDirectedGraph, SankeyDiagram } from "semiotic"
154
164
  />
155
165
  ```
156
166
 
167
+ ### Streaming System Monitor
168
+
169
+ Live service topology with threshold alerting and click-to-inspect:
170
+
171
+ ```jsx
172
+ import { StreamNetworkFrame, ChartContainer, DetailsPanel, LinkedCharts } from "semiotic"
173
+
174
+ const chartRef = useRef()
175
+ chartRef.current.push({ source: "API", target: "Orders", value: 15 })
176
+
177
+ <LinkedCharts>
178
+ <ChartContainer title="System Monitor" status="live"
179
+ detailsPanel={
180
+ <DetailsPanel position="right" trigger="click">
181
+ {(datum) => <div>{datum.id}: {datum.value} req/s</div>}
182
+ </DetailsPanel>
183
+ }>
184
+ <StreamNetworkFrame ref={chartRef} chartType="sankey"
185
+ showParticles particleStyle={{ proportionalSpeed: true }}
186
+ thresholds={{ metric: n => n.value, warning: 100, critical: 250 }}
187
+ />
188
+ </ChartContainer>
189
+ </LinkedCharts>
190
+ ```
191
+
157
192
  ### Standard Charts
158
193
 
159
194
  Line, bar, scatter, area — all the basics, with sensible defaults:
@@ -185,20 +220,53 @@ import { LineChart, BarChart } from "semiotic"
185
220
  | **Coordination** | `LinkedCharts` `ScatterplotMatrix` |
186
221
  | **Frames** | `StreamXYFrame` `StreamOrdinalFrame` `StreamNetworkFrame` |
187
222
 
223
+ ### Vega-Lite Translation
224
+
225
+ Paste a Vega-Lite spec, get a Semiotic chart:
226
+
227
+ ```jsx
228
+ import { fromVegaLite } from "semiotic/data"
229
+ import { configToJSX, fromConfig } from "semiotic"
230
+
231
+ const config = fromVegaLite({
232
+ mark: "bar",
233
+ data: { values: [{ a: "A", b: 28 }, { a: "B", b: 55 }] },
234
+ encoding: {
235
+ x: { field: "a", type: "nominal" },
236
+ y: { field: "b", type: "quantitative" },
237
+ },
238
+ })
239
+
240
+ // Render directly
241
+ const { componentName, props } = fromConfig(config)
242
+ // → componentName: "BarChart", props: { data, categoryAccessor: "a", valueAccessor: "b" }
243
+
244
+ // Or generate JSX code
245
+ configToJSX(config)
246
+ // → <BarChart data={[...]} categoryAccessor="a" valueAccessor="b" />
247
+ ```
248
+
249
+ Supports bar, line, area, point, rect, arc, tick marks with encoding translation
250
+ for color, size, aggregation, and binning.
251
+
188
252
  ## Smaller Bundles
189
253
 
190
254
  Import only what you need:
191
255
 
192
256
  ```jsx
193
- import { LineChart } from "semiotic/xy" // 125 KB (vs 218 KB full)
194
- import { BarChart } from "semiotic/ordinal" // 140 KB
195
- import { ForceDirectedGraph } from "semiotic/network" // 133 KB
196
- import { LineChart } from "semiotic/ai" // HOC-only surface for AI generation
257
+ import { LineChart } from "semiotic/xy" // 123 KB
258
+ import { BarChart } from "semiotic/ordinal" // 118 KB
259
+ import { ForceDirectedGraph } from "semiotic/network" // 127 KB
260
+ import { LineChart } from "semiotic/ai" // HOC-only surface for AI generation
197
261
  ```
198
262
 
263
+ Granular entry points export only v3 Stream Frames and HOC charts — no legacy
264
+ utilities or backwards-compatibility shims.
265
+
199
266
  ## TypeScript
200
267
 
201
- Full type definitions ship with the package. Generics for type-safe accessors:
268
+ Built with `strict: true`. Full type definitions ship with the package.
269
+ Generics for type-safe accessors:
202
270
 
203
271
  ```tsx
204
272
  interface Sale { month: number; revenue: number }
@@ -234,7 +302,7 @@ Works with Next.js App Router, Remix, and Astro via `"use client"` directives.
234
302
  - [Getting Started](https://semiotic.nteract.io/getting-started)
235
303
  - [Charts](https://semiotic.nteract.io/charts) — all 27 chart types with live examples
236
304
  - [Frames](https://semiotic.nteract.io/frames) — full Frame API reference
237
- - [Features](https://semiotic.nteract.io/features) — axes, annotations, tooltips, styling
305
+ - [Features](https://semiotic.nteract.io/features) — axes, annotations, tooltips, styling, Vega-Lite translator
238
306
  - [Cookbook](https://semiotic.nteract.io/cookbook) — advanced patterns and recipes
239
307
  - [Playground](https://semiotic.nteract.io/playground) — interactive prop exploration
240
308
 
@@ -253,6 +321,11 @@ See [CONTRIBUTING.md](CONTRIBUTING.md). Our community follows the nteract
253
321
  Development of this library owes a lot to Susie Lu, Jason Reid, James Womack,
254
322
  Matt Herman, Shelby Sturgis, and Tristan Reid.
255
323
 
324
+ The Sankey layout engine is based on [sankey-plus](https://github.com/tomshanley/sankey-plus)
325
+ by [Tom Shanley](https://github.com/tomshanley), which improved on his earlier
326
+ `d3-sankey-circular` with better cycle detection, hierarchical arc stacking,
327
+ and dynamic extent adjustment.
328
+
256
329
  _Semiotic icon based on an icon by Andre Schauer._
257
330
 
258
331
  ## License
@@ -0,0 +1,48 @@
1
+ import * as React from "react";
2
+ /**
3
+ * Category→color mapping. Maps category values (like "North", "error", "active")
4
+ * to fixed color strings. Charts inside a CategoryColorProvider will use these
5
+ * colors consistently regardless of what subset of categories each chart displays.
6
+ */
7
+ export type CategoryColorMap = Record<string, string>;
8
+ export interface CategoryColorProviderProps {
9
+ /** Explicit category→color mapping */
10
+ colors?: CategoryColorMap;
11
+ /**
12
+ * Category values to auto-assign colors from a scheme.
13
+ * Use when you want consistent colors but don't need specific assignments.
14
+ */
15
+ categories?: string[];
16
+ /** Color scheme to use for auto-assignment. Default: "category10" */
17
+ colorScheme?: string | string[];
18
+ children: React.ReactNode;
19
+ }
20
+ /**
21
+ * CategoryColorProvider — assigns stable colors to category values
22
+ * shared across all Semiotic charts within its subtree.
23
+ *
24
+ * Two modes:
25
+ * - **Explicit**: pass a `colors` map of category→color
26
+ * - **Auto**: pass a `categories` array and optional `colorScheme`
27
+ *
28
+ * Charts with `colorBy` inside this provider will use the mapped colors
29
+ * instead of computing their own color scale per-chart.
30
+ *
31
+ * ```tsx
32
+ * <CategoryColorProvider colors={{ North: "#e41a1c", South: "#377eb8", East: "#4daf4a" }}>
33
+ * <ChartGrid columns={2}>
34
+ * <LineChart data={d1} colorBy="region" responsiveWidth />
35
+ * <BarChart data={d2} colorBy="region" responsiveWidth />
36
+ * </ChartGrid>
37
+ * </CategoryColorProvider>
38
+ * ```
39
+ */
40
+ export declare function CategoryColorProvider({ colors, categories, colorScheme, children, }: CategoryColorProviderProps): React.JSX.Element;
41
+ export declare namespace CategoryColorProvider {
42
+ var displayName: string;
43
+ }
44
+ /**
45
+ * Hook to access the category color map from the nearest provider.
46
+ * Returns null if no provider is present.
47
+ */
48
+ export declare function useCategoryColors(): CategoryColorMap | null;
@@ -0,0 +1,60 @@
1
+ import * as React from "react";
2
+ import type { ChartConfig, CopyFormat } from "./export/chartConfig";
3
+ export interface ChartContainerProps {
4
+ /** Chart title */
5
+ title?: string;
6
+ /** Subtitle / description */
7
+ subtitle?: string;
8
+ /** Chart children (any Semiotic chart component) */
9
+ children: React.ReactNode;
10
+ /** Width — passed to child chart if not set on child. Default: "100%" */
11
+ width?: number | string;
12
+ /** Height of the chart area (excluding header). Default: 400 */
13
+ height?: number;
14
+ /** Built-in actions. Each can be true (default config), false (hidden), or config object */
15
+ actions?: {
16
+ export?: boolean | {
17
+ format?: "svg" | "png";
18
+ scale?: number;
19
+ filename?: string;
20
+ };
21
+ fullscreen?: boolean;
22
+ /** Enable "Copy Config" action button. Requires chartConfig prop. */
23
+ copyConfig?: boolean | {
24
+ format?: CopyFormat;
25
+ };
26
+ };
27
+ /** Chart configuration for serialization. Enables the "Copy Config" toolbar action. */
28
+ chartConfig?: ChartConfig;
29
+ /** Additional controls rendered in the toolbar after built-in actions */
30
+ controls?: React.ReactNode;
31
+ /** Loading state — shows skeleton placeholder */
32
+ loading?: boolean;
33
+ /** Error state — shows error message (overrides children) */
34
+ error?: string | React.ReactNode;
35
+ /** Wrap children in ChartErrorBoundary */
36
+ errorBoundary?: boolean;
37
+ /** Status indicator (wired to streaming staleness) */
38
+ status?: "live" | "stale" | "paused" | "error" | "static";
39
+ /** Details panel rendered alongside the chart (e.g. DetailsPanel component) */
40
+ detailsPanel?: React.ReactNode;
41
+ /** CSS class for the outer container */
42
+ className?: string;
43
+ /** Inline style overrides */
44
+ style?: React.CSSProperties;
45
+ }
46
+ export interface ChartContainerHandle {
47
+ /** Export chart to SVG or PNG */
48
+ export: (options?: {
49
+ format?: "svg" | "png";
50
+ scale?: number;
51
+ filename?: string;
52
+ }) => Promise<void>;
53
+ /** Toggle fullscreen */
54
+ toggleFullscreen: () => void;
55
+ /** Copy chart config to clipboard */
56
+ copyConfig: (format?: CopyFormat) => Promise<void>;
57
+ /** The chart container DOM element */
58
+ element: HTMLDivElement | null;
59
+ }
60
+ export declare const ChartContainer: React.ForwardRefExoticComponent<ChartContainerProps & React.RefAttributes<ChartContainerHandle>>;
@@ -0,0 +1,37 @@
1
+ import * as React from "react";
2
+ export interface ChartGridProps {
3
+ /** Chart components to arrange in the grid */
4
+ children: React.ReactNode;
5
+ /** Number of columns. Default: "auto" (auto-fill based on minCellWidth) */
6
+ columns?: number | "auto";
7
+ /** Minimum cell width for auto columns. Default: 300 */
8
+ minCellWidth?: number;
9
+ /** Gap between cells in pixels. Default: 16 */
10
+ gap?: number;
11
+ /** CSS class for the grid container */
12
+ className?: string;
13
+ /** Inline style overrides */
14
+ style?: React.CSSProperties;
15
+ }
16
+ /**
17
+ * ChartGrid — responsive grid layout for multiple Semiotic charts.
18
+ *
19
+ * Arranges child charts in a CSS Grid that reflows based on available space.
20
+ * Each cell automatically gets `responsiveWidth` behavior since the grid
21
+ * manages the cell dimensions.
22
+ *
23
+ * Works naturally with `LinkedCharts` for coordinated views:
24
+ *
25
+ * ```tsx
26
+ * <LinkedCharts>
27
+ * <ChartGrid columns={2}>
28
+ * <LineChart data={d} xAccessor="x" yAccessor="y" responsiveWidth />
29
+ * <BarChart data={d} categoryAccessor="cat" valueAccessor="val" responsiveWidth />
30
+ * </ChartGrid>
31
+ * </LinkedCharts>
32
+ * ```
33
+ */
34
+ export declare function ChartGrid({ children, columns, minCellWidth, gap, className, style, }: ChartGridProps): React.JSX.Element;
35
+ export declare namespace ChartGrid {
36
+ var displayName: string;
37
+ }
@@ -0,0 +1,38 @@
1
+ import * as React from "react";
2
+ export interface ContextLayoutProps {
3
+ /** The main chart (renders at full size in the primary slot) */
4
+ children: React.ReactNode;
5
+ /** Context chart(s) displayed alongside the primary chart */
6
+ context: React.ReactNode;
7
+ /** Position of the context panel. Default: "right" */
8
+ position?: "right" | "left" | "bottom" | "top";
9
+ /** Size of the context panel in pixels. Default: 250 */
10
+ contextSize?: number;
11
+ /** Gap between primary and context panels in pixels. Default: 12 */
12
+ gap?: number;
13
+ /** CSS class for the layout container */
14
+ className?: string;
15
+ /** Inline style overrides */
16
+ style?: React.CSSProperties;
17
+ }
18
+ /**
19
+ * ContextLayout — places a primary chart alongside one or more context charts.
20
+ *
21
+ * The primary chart fills available space while the context panel has a fixed
22
+ * width (or height for top/bottom). Context charts should use `mode="context"`
23
+ * for compact rendering without axes or labels.
24
+ *
25
+ * ```tsx
26
+ * <ContextLayout
27
+ * context={<Treemap data={hierarchy} mode="context" responsiveWidth colorByDepth />}
28
+ * position="right"
29
+ * contextSize={250}
30
+ * >
31
+ * <LineChart data={timeSeries} xAccessor="time" yAccessor="value" responsiveWidth />
32
+ * </ContextLayout>
33
+ * ```
34
+ */
35
+ export declare function ContextLayout({ children, context, position, contextSize, gap, className, style, }: ContextLayoutProps): React.JSX.Element;
36
+ export declare namespace ContextLayout {
37
+ var displayName: string;
38
+ }
@@ -0,0 +1,37 @@
1
+ import * as React from "react";
2
+ import type { ChartObservation, ClickObservation } from "./store/ObservationStore";
3
+ export interface DetailsPanelProps {
4
+ /**
5
+ * Render function receiving the clicked datum and the full observation.
6
+ * Return null to hide the panel for a given datum.
7
+ */
8
+ children: (datum: Record<string, any>, observation: ClickObservation) => React.ReactNode;
9
+ /** Panel position relative to the chart. Default: "right" */
10
+ position?: "right" | "bottom" | "overlay";
11
+ /** Panel width (for "right" position) or height (for "bottom"). Default: 300 */
12
+ size?: number;
13
+ /** Observation trigger type. Default: "click" */
14
+ trigger?: "click" | "hover";
15
+ /** Filter observations by chart ID */
16
+ chartId?: string;
17
+ /**
18
+ * Direct observation feed — use when the chart pushes observations via
19
+ * onObservation callback rather than through the ObservationStore.
20
+ * When set, bypasses useChartObserver and reacts to this prop directly.
21
+ */
22
+ observation?: ChartObservation | null;
23
+ /** Whether clicking empty space dismisses the panel. Default: true */
24
+ dismissOnEmpty?: boolean;
25
+ /** Custom close button. Set to false to hide. Default: true */
26
+ showClose?: boolean;
27
+ /** Called when the panel opens or closes */
28
+ onToggle?: (open: boolean) => void;
29
+ /** CSS class for the panel container */
30
+ className?: string;
31
+ /** Inline style overrides */
32
+ style?: React.CSSProperties;
33
+ }
34
+ export declare function DetailsPanel({ children, position, size, trigger, chartId, observation: directObservation, dismissOnEmpty, showClose, onToggle, className, style, }: DetailsPanelProps): React.JSX.Element | null;
35
+ export declare namespace DetailsPanel {
36
+ var displayName: string;
37
+ }
@@ -2,6 +2,8 @@ import * as React from "react";
2
2
  import type { ResolutionMode } from "./store/SelectionStore";
3
3
  export { useSelection, useLinkedHover, useBrushSelection, useFilteredData } from "./store/useSelection";
4
4
  export type { UseSelectionOptions, UseSelectionResult, UseLinkedHoverOptions, UseLinkedHoverResult, UseBrushSelectionOptions, UseBrushSelectionResult } from "./store/useSelection";
5
+ export { useChartObserver } from "./store/useObservation";
6
+ export type { UseChartObserverOptions, UseChartObserverResult } from "./store/useObservation";
5
7
  export interface LinkedChartsProps {
6
8
  children: React.ReactNode;
7
9
  /** Pre-configure selections with resolution modes */
@@ -87,7 +87,7 @@ export declare const defaultTooltipStyle: React.CSSProperties;
87
87
  * />
88
88
  * ```
89
89
  */
90
- export declare function Tooltip(config?: TooltipConfig): (data: Record<string, unknown>) => React.JSX.Element;
90
+ export declare function Tooltip(config?: TooltipConfig): (data: Record<string, unknown>) => React.JSX.Element | null;
91
91
  /**
92
92
  * Create a multi-line tooltip that displays multiple fields
93
93
  *
@@ -130,7 +130,7 @@ export declare function Tooltip(config?: TooltipConfig): (data: Record<string, u
130
130
  * />
131
131
  * ```
132
132
  */
133
- export declare function MultiLineTooltip(config?: MultiLineTooltipConfig): (data: Record<string, unknown>) => React.JSX.Element;
133
+ export declare function MultiLineTooltip(config?: MultiLineTooltipConfig): (data: Record<string, unknown>) => React.JSX.Element | null;
134
134
  /**
135
135
  * Type for tooltip prop that chart components accept
136
136
  */
@@ -66,7 +66,7 @@ export { RealtimeWaterfallChart } from "./realtime/RealtimeWaterfallChart";
66
66
  export type { RealtimeWaterfallChartProps } from "./realtime/RealtimeWaterfallChart";
67
67
  export { RealtimeHeatmap } from "./realtime/RealtimeHeatmap";
68
68
  export type { RealtimeHeatmapProps } from "./realtime/RealtimeHeatmap";
69
- export type { BaseChartProps, AxisConfig, Accessor, ChartAccessor } from "./shared/types";
69
+ export type { BaseChartProps, AxisConfig, Accessor, ChartAccessor, ChartMode } from "./shared/types";
70
70
  export { useColorScale, useSortedData, DEFAULT_COLOR } from "./shared/hooks";
71
71
  export { COLOR_SCHEMES, DEFAULT_COLORS, getColor, createColorScale, getSize } from "./shared/colorUtils";
72
72
  export { formatNumber, formatDate, formatAxis, createTooltip, formatLargeNumber, truncateText } from "./shared/formatUtils";
@@ -21,6 +21,7 @@ export interface BarChartProps<TDatum extends Record<string, any> = Record<strin
21
21
  showGrid?: boolean;
22
22
  showLegend?: boolean;
23
23
  tooltip?: TooltipProp;
24
+ annotations?: Record<string, any>[];
24
25
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
25
26
  }
26
27
  /**
@@ -19,6 +19,7 @@ export interface BoxPlotProps<TDatum extends Record<string, any> = Record<string
19
19
  showGrid?: boolean;
20
20
  showLegend?: boolean;
21
21
  tooltip?: TooltipProp;
22
+ annotations?: Record<string, any>[];
22
23
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
23
24
  }
24
25
  export declare function BoxPlot<TDatum extends Record<string, any> = Record<string, any>>(props: BoxPlotProps<TDatum>): React.JSX.Element;
@@ -15,6 +15,7 @@ export interface DonutChartProps<TDatum extends Record<string, any> = Record<str
15
15
  enableHover?: boolean;
16
16
  showLegend?: boolean;
17
17
  tooltip?: TooltipProp;
18
+ annotations?: Record<string, any>[];
18
19
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
19
20
  }
20
21
  export declare function DonutChart<TDatum extends Record<string, any> = Record<string, any>>(props: DonutChartProps<TDatum>): React.JSX.Element;
@@ -19,6 +19,7 @@ export interface DotPlotProps<TDatum extends Record<string, any> = Record<string
19
19
  showGrid?: boolean;
20
20
  showLegend?: boolean;
21
21
  tooltip?: TooltipProp;
22
+ annotations?: Record<string, any>[];
22
23
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
23
24
  }
24
25
  export declare function DotPlot<TDatum extends Record<string, any> = Record<string, any>>(props: DotPlotProps<TDatum>): React.JSX.Element;
@@ -18,6 +18,7 @@ export interface GroupedBarChartProps<TDatum extends Record<string, any> = Recor
18
18
  showGrid?: boolean;
19
19
  showLegend?: boolean;
20
20
  tooltip?: TooltipProp;
21
+ annotations?: Record<string, any>[];
21
22
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
22
23
  }
23
24
  export declare function GroupedBarChart<TDatum extends Record<string, any> = Record<string, any>>(props: GroupedBarChartProps<TDatum>): React.JSX.Element;
@@ -18,6 +18,7 @@ export interface HistogramProps<TDatum extends Record<string, any> = Record<stri
18
18
  showGrid?: boolean;
19
19
  showLegend?: boolean;
20
20
  tooltip?: TooltipProp;
21
+ annotations?: Record<string, any>[];
21
22
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
22
23
  }
23
24
  export declare function Histogram<TDatum extends Record<string, any> = Record<string, any>>(props: HistogramProps<TDatum>): React.JSX.Element;
@@ -13,6 +13,7 @@ export interface PieChartProps<TDatum extends Record<string, any> = Record<strin
13
13
  enableHover?: boolean;
14
14
  showLegend?: boolean;
15
15
  tooltip?: TooltipProp;
16
+ annotations?: Record<string, any>[];
16
17
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
17
18
  }
18
19
  export declare function PieChart<TDatum extends Record<string, any> = Record<string, any>>(props: PieChartProps<TDatum>): React.JSX.Element;
@@ -20,6 +20,7 @@ export interface RidgelinePlotProps<TDatum extends Record<string, any> = Record<
20
20
  showGrid?: boolean;
21
21
  showLegend?: boolean;
22
22
  tooltip?: TooltipProp;
23
+ annotations?: Record<string, any>[];
23
24
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
24
25
  }
25
26
  /**
@@ -19,6 +19,7 @@ export interface StackedBarChartProps<TDatum extends Record<string, any> = Recor
19
19
  showGrid?: boolean;
20
20
  showLegend?: boolean;
21
21
  tooltip?: TooltipProp;
22
+ annotations?: Record<string, any>[];
22
23
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
23
24
  }
24
25
  export declare function StackedBarChart<TDatum extends Record<string, any> = Record<string, any>>(props: StackedBarChartProps<TDatum>): React.JSX.Element;
@@ -21,6 +21,7 @@ export interface SwarmPlotProps<TDatum extends Record<string, any> = Record<stri
21
21
  showGrid?: boolean;
22
22
  showLegend?: boolean;
23
23
  tooltip?: TooltipProp;
24
+ annotations?: Record<string, any>[];
24
25
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
25
26
  }
26
27
  export declare function SwarmPlot<TDatum extends Record<string, any> = Record<string, any>>(props: SwarmPlotProps<TDatum>): React.JSX.Element;
@@ -20,6 +20,7 @@ export interface ViolinPlotProps<TDatum extends Record<string, any> = Record<str
20
20
  showGrid?: boolean;
21
21
  showLegend?: boolean;
22
22
  tooltip?: TooltipProp;
23
+ annotations?: Record<string, any>[];
23
24
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
24
25
  }
25
26
  export declare function ViolinPlot<TDatum extends Record<string, any> = Record<string, any>>(props: ViolinPlotProps<TDatum>): React.JSX.Element;
@@ -2,7 +2,11 @@ import * as React from "react";
2
2
  import type { ArrowOfTime, WindowMode, HoverAnnotationConfig, HoverData, AnnotationContext, DecayConfig, PulseConfig, StalenessConfig } from "../../stream/types";
3
3
  import type { RealtimeFrameHandle } from "../../realtime/types";
4
4
  import type { ReactNode } from "react";
5
+ import type { ChartMode } from "../shared/types";
6
+ import type { OnObservationCallback } from "../../store/ObservationStore";
5
7
  export interface RealtimeHeatmapProps {
8
+ /** Display mode: "primary" (full chrome), "context" (compact), "sparkline" (inline) */
9
+ mode?: ChartMode;
6
10
  /** Chart dimensions as [width, height] */
7
11
  size?: [number, number];
8
12
  /** Chart width (alternative to size) */
@@ -18,6 +22,8 @@ export interface RealtimeHeatmapProps {
18
22
  };
19
23
  /** CSS class name */
20
24
  className?: string;
25
+ onObservation?: OnObservationCallback;
26
+ chartId?: string;
21
27
  /** Direction time flows */
22
28
  arrowOfTime?: ArrowOfTime;
23
29
  /** Data retention strategy */
@@ -70,6 +76,11 @@ export interface RealtimeHeatmapProps {
70
76
  staleness?: StalenessConfig;
71
77
  /** Custom tooltip renderer (alias for tooltipContent) */
72
78
  tooltip?: (d: HoverData) => ReactNode;
79
+ /** Enable linked hover selection events for cross-chart highlighting */
80
+ linkedHover?: boolean | string | {
81
+ name?: string;
82
+ fields: string[];
83
+ };
73
84
  }
74
85
  /**
75
86
  * RealtimeHeatmap - Streaming heatmap with 2D grid binning.
@@ -1,8 +1,12 @@
1
1
  import * as React from "react";
2
- import type { ArrowOfTime, WindowMode, HoverAnnotationConfig, HoverData, AnnotationContext } from "../../stream/types";
2
+ import type { ArrowOfTime, WindowMode, HoverAnnotationConfig, HoverData, AnnotationContext, DecayConfig, PulseConfig, StalenessConfig, TransitionConfig } from "../../stream/types";
3
3
  import type { RealtimeFrameHandle } from "../../realtime/types";
4
4
  import type { ReactNode } from "react";
5
+ import type { ChartMode } from "../shared/types";
6
+ import type { OnObservationCallback } from "../../store/ObservationStore";
5
7
  export interface RealtimeTemporalHistogramProps {
8
+ /** Display mode: "primary" (full chrome), "context" (compact), "sparkline" (inline) */
9
+ mode?: ChartMode;
6
10
  /** Time interval for binning */
7
11
  binSize: number;
8
12
  /** Chart dimensions as [width, height] */
@@ -20,6 +24,8 @@ export interface RealtimeTemporalHistogramProps {
20
24
  };
21
25
  /** CSS class name */
22
26
  className?: string;
27
+ onObservation?: OnObservationCallback;
28
+ chartId?: string;
23
29
  /** Direction time flows */
24
30
  arrowOfTime?: ArrowOfTime;
25
31
  /** Data retention strategy */
@@ -81,6 +87,14 @@ export interface RealtimeTemporalHistogramProps {
81
87
  name?: string;
82
88
  fields: string[];
83
89
  };
90
+ /** Configurable opacity decay for older data */
91
+ decay?: DecayConfig;
92
+ /** Flash effect on newly inserted data */
93
+ pulse?: PulseConfig;
94
+ /** Frame-level data liveness indicator */
95
+ staleness?: StalenessConfig;
96
+ /** Smooth position interpolation on data change */
97
+ transition?: TransitionConfig;
84
98
  }
85
99
  /**
86
100
  * RealtimeTemporalHistogram - Streaming temporal histogram.
@@ -2,7 +2,11 @@ import * as React from "react";
2
2
  import type { ArrowOfTime, WindowMode, HoverAnnotationConfig, HoverData, AnnotationContext, DecayConfig, PulseConfig, StalenessConfig, TransitionConfig } from "../../stream/types";
3
3
  import type { RealtimeFrameHandle } from "../../realtime/types";
4
4
  import type { ReactNode } from "react";
5
+ import type { ChartMode } from "../shared/types";
6
+ import type { OnObservationCallback } from "../../store/ObservationStore";
5
7
  export interface RealtimeLineChartProps {
8
+ /** Display mode: "primary" (full chrome), "context" (compact), "sparkline" (inline) */
9
+ mode?: ChartMode;
6
10
  /** Chart dimensions as [width, height] */
7
11
  size?: [number, number];
8
12
  /** Chart width (alternative to size) */
@@ -18,6 +22,8 @@ export interface RealtimeLineChartProps {
18
22
  };
19
23
  /** CSS class name */
20
24
  className?: string;
25
+ onObservation?: OnObservationCallback;
26
+ chartId?: string;
21
27
  /** Direction time flows */
22
28
  arrowOfTime?: ArrowOfTime;
23
29
  /** Data retention strategy */
@@ -2,7 +2,11 @@ import * as React from "react";
2
2
  import type { ArrowOfTime, WindowMode, HoverAnnotationConfig, HoverData, AnnotationContext } from "../../stream/types";
3
3
  import type { RealtimeFrameHandle } from "../../realtime/types";
4
4
  import type { ReactNode } from "react";
5
+ import type { ChartMode } from "../shared/types";
6
+ import type { OnObservationCallback } from "../../store/ObservationStore";
5
7
  export interface RealtimeSwarmChartProps {
8
+ /** Display mode: "primary" (full chrome), "context" (compact), "sparkline" (inline) */
9
+ mode?: ChartMode;
6
10
  /** Chart dimensions as [width, height] */
7
11
  size?: [number, number];
8
12
  /** Chart width (alternative to size) */
@@ -18,6 +22,8 @@ export interface RealtimeSwarmChartProps {
18
22
  };
19
23
  /** CSS class name */
20
24
  className?: string;
25
+ onObservation?: OnObservationCallback;
26
+ chartId?: string;
21
27
  /** Direction time flows */
22
28
  arrowOfTime?: ArrowOfTime;
23
29
  /** Data retention strategy */
@@ -2,7 +2,11 @@ import * as React from "react";
2
2
  import type { ArrowOfTime, WindowMode, HoverAnnotationConfig, HoverData, AnnotationContext } from "../../stream/types";
3
3
  import type { RealtimeFrameHandle } from "../../realtime/types";
4
4
  import type { ReactNode } from "react";
5
+ import type { ChartMode } from "../shared/types";
6
+ import type { OnObservationCallback } from "../../store/ObservationStore";
5
7
  export interface RealtimeWaterfallChartProps {
8
+ /** Display mode: "primary" (full chrome), "context" (compact), "sparkline" (inline) */
9
+ mode?: ChartMode;
6
10
  /** Chart dimensions as [width, height] */
7
11
  size?: [number, number];
8
12
  /** Chart width (alternative to size) */
@@ -18,6 +22,8 @@ export interface RealtimeWaterfallChartProps {
18
22
  };
19
23
  /** CSS class name */
20
24
  className?: string;
25
+ onObservation?: OnObservationCallback;
26
+ chartId?: string;
21
27
  /** Direction time flows */
22
28
  arrowOfTime?: ArrowOfTime;
23
29
  /** Data retention strategy */
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ import type { AnnotationContext } from "../../realtime/types";
3
+ export declare function createDefaultAnnotationRules(frameType: "xy" | "ordinal" | "network"): (annotation: Record<string, any>, index: number, context: AnnotationContext) => React.ReactNode | null;