semiotic 3.5.2 → 3.5.4

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 (101) hide show
  1. package/CLAUDE.md +9 -8
  2. package/README.md +15 -15
  3. package/ai/componentMetadata.cjs +9 -2
  4. package/ai/dist/mcp-server.js +4 -1
  5. package/ai/examples.md +27 -0
  6. package/ai/schema.json +300 -41
  7. package/ai/system-prompt.md +1 -1
  8. package/dist/components/ThemeProvider.d.ts +2 -2
  9. package/dist/components/charts/index.d.ts +3 -3
  10. package/dist/components/charts/network/ProcessSankey.d.ts +22 -0
  11. package/dist/components/charts/network/SankeyDiagram.d.ts +5 -1
  12. package/dist/components/charts/network/Treemap.d.ts +8 -0
  13. package/dist/components/charts/network/processSankey/algorithm.d.ts +57 -0
  14. package/dist/components/charts/network/processSankey/buildScenes.d.ts +6 -0
  15. package/dist/components/charts/network/processSankey/streamingLayout.d.ts +13 -0
  16. package/dist/components/charts/ordinal/GaugeChart.d.ts +10 -0
  17. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +2 -0
  18. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +24 -0
  19. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +2 -0
  20. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +2 -0
  21. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +2 -0
  22. package/dist/components/charts/shared/gaugeGradient.d.ts +62 -0
  23. package/dist/components/charts/shared/hooks.d.ts +2 -2
  24. package/dist/components/charts/shared/streamPropsHelpers.d.ts +2 -2
  25. package/dist/components/charts/shared/tooltipUtils.d.ts +11 -0
  26. package/dist/components/charts/shared/types.d.ts +17 -2
  27. package/dist/components/charts/shared/useAreaSeriesSetup.d.ts +4 -1
  28. package/dist/components/charts/shared/useChartSetup.d.ts +4 -2
  29. package/dist/components/charts/shared/useCustomChartSetup.d.ts +2 -1
  30. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +2 -0
  31. package/dist/components/charts/shared/withChartWrapper.d.ts +10 -3
  32. package/dist/components/charts/xy/AreaChart.d.ts +27 -2
  33. package/dist/components/charts/xy/LineChart.d.ts +26 -2
  34. package/dist/components/charts/xy/Scatterplot.d.ts +5 -1
  35. package/dist/components/semiotic-ai.d.ts +1 -1
  36. package/dist/components/semiotic-realtime.d.ts +3 -3
  37. package/dist/components/semiotic-server.d.ts +1 -0
  38. package/dist/components/semiotic-xy.d.ts +1 -1
  39. package/dist/components/semiotic.d.ts +6 -5
  40. package/dist/components/server/renderToStaticSVG.d.ts +4 -1
  41. package/dist/components/server/serverChartConfigs.d.ts +1 -0
  42. package/dist/components/server/staticAnnotations.d.ts +1 -1
  43. package/dist/components/server/staticLegend.d.ts +35 -0
  44. package/dist/components/server/themeResolver.d.ts +7 -1
  45. package/dist/components/store/ThemeStore.d.ts +9 -1
  46. package/dist/components/stream/AccessibleDataTable.d.ts +2 -2
  47. package/dist/components/stream/NetworkSVGOverlay.d.ts +2 -1
  48. package/dist/components/stream/OrdinalSVGOverlay.d.ts +2 -1
  49. package/dist/components/stream/PipelineStore.d.ts +20 -13
  50. package/dist/components/stream/SVGOverlay.d.ts +4 -30
  51. package/dist/components/stream/SceneToSVG.d.ts +1 -1
  52. package/dist/components/stream/accessorUtils.d.ts +2 -1
  53. package/dist/components/stream/geoTypes.d.ts +2 -1
  54. package/dist/components/stream/hoverUtils.d.ts +1 -0
  55. package/dist/components/stream/layouts/hierarchyLayoutPlugin.d.ts +1 -1
  56. package/dist/components/stream/legendRenderer.d.ts +2 -1
  57. package/dist/components/stream/networkTypes.d.ts +13 -1
  58. package/dist/components/stream/ordinalTypes.d.ts +31 -3
  59. package/dist/components/stream/renderers/wedgePathBuilder.d.ts +87 -0
  60. package/dist/components/stream/types.d.ts +110 -16
  61. package/dist/components/stream/xySceneBuilders/areaGradient.d.ts +20 -0
  62. package/dist/components/stream/xySceneBuilders/barScene.d.ts +2 -2
  63. package/dist/components/stream/xySceneBuilders/candlestickScene.d.ts +2 -2
  64. package/dist/components/stream/xySceneBuilders/heatmapScene.d.ts +2 -2
  65. package/dist/components/stream/xySceneBuilders/lineScene.d.ts +4 -3
  66. package/dist/components/stream/xySceneBuilders/pointScene.d.ts +2 -2
  67. package/dist/components/stream/xySceneBuilders/ribbonScene.d.ts +107 -0
  68. package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +2 -2
  69. package/dist/components/stream/xySceneBuilders/types.d.ts +9 -12
  70. package/dist/components/stream/xySceneBuilders/waterfallScene.d.ts +2 -2
  71. package/dist/components/types/legendTypes.d.ts +15 -0
  72. package/dist/components/types/marginType.d.ts +17 -3
  73. package/dist/geo.min.js +1 -1
  74. package/dist/geo.module.min.js +1 -1
  75. package/dist/network.min.js +1 -1
  76. package/dist/network.module.min.js +1 -1
  77. package/dist/ordinal.min.js +1 -1
  78. package/dist/ordinal.module.min.js +1 -1
  79. package/dist/realtime.min.js +1 -1
  80. package/dist/realtime.module.min.js +1 -1
  81. package/dist/semiotic-ai.d.ts +1 -1
  82. package/dist/semiotic-ai.min.js +1 -1
  83. package/dist/semiotic-ai.module.min.js +1 -1
  84. package/dist/semiotic-data.min.js +1 -1
  85. package/dist/semiotic-data.module.min.js +1 -1
  86. package/dist/semiotic-realtime.d.ts +3 -3
  87. package/dist/semiotic-server.d.ts +1 -0
  88. package/dist/semiotic-themes.min.js +1 -1
  89. package/dist/semiotic-themes.module.min.js +1 -1
  90. package/dist/semiotic-utils.min.js +1 -1
  91. package/dist/semiotic-utils.module.min.js +1 -1
  92. package/dist/semiotic-xy.d.ts +1 -1
  93. package/dist/semiotic.d.ts +6 -5
  94. package/dist/semiotic.min.js +1 -1
  95. package/dist/semiotic.module.min.js +1 -1
  96. package/dist/server.min.js +1 -1
  97. package/dist/server.module.min.js +1 -1
  98. package/dist/xy.min.js +1 -1
  99. package/dist/xy.module.min.js +1 -1
  100. package/package.json +25 -25
  101. package/dist/components/stream/xySceneBuilders/boundsScene.d.ts +0 -9
package/CLAUDE.md CHANGED
@@ -4,7 +4,7 @@
4
4
  - Install: `npm install semiotic`
5
5
  <!-- semiotic-bundle-sizes:start -->
6
6
  <!-- Auto-generated by scripts/sync-bundle-sizes.mjs — do not edit by hand. -->
7
- - **Use sub-path imports** — `semiotic/xy` (83KB gz), `semiotic/ordinal` (67KB gz), `semiotic/network` (62KB gz), `semiotic/geo` (50KB gz), `semiotic/realtime` (88KB gz), `semiotic/server` (114KB gz), `semiotic/utils` (22KB gz), `semiotic/recipes` (5KB gz), `semiotic/themes` (4KB gz), `semiotic/data` (3KB gz), `semiotic/ai` (184KB gz). Full `semiotic` is 183KB gz.
7
+ - **Use sub-path imports** — `semiotic/xy` (85KB gz), `semiotic/ordinal` (69KB gz), `semiotic/network` (63KB gz), `semiotic/geo` (52KB gz), `semiotic/realtime` (90KB gz), `semiotic/server` (122KB gz), `semiotic/utils` (22KB gz), `semiotic/recipes` (5KB gz), `semiotic/themes` (4KB gz), `semiotic/data` (3KB gz), `semiotic/ai` (189KB gz). Full `semiotic` is 188KB gz.
8
8
  <!-- semiotic-bundle-sizes:end -->
9
9
  - CLI: `npx semiotic-ai [--schema|--compact|--examples|--doctor]`
10
10
  - MCP: `npx semiotic-mcp`
@@ -15,7 +15,7 @@
15
15
  - Every HOC accepts `frameProps` for pass-through. TypeScript `strict: true`. Every HOC has error boundary + dev-mode validation.
16
16
 
17
17
  ## Common Props (all HOCs)
18
- `title`, `description` (aria-label), `summary` (sr-only), `width` (600), `height` (400), `responsiveWidth`, `responsiveHeight`, `margin`, `className`, `color` (uniform fill), `stroke` (uniform stroke color — CSS var OK), `strokeWidth` (uniform stroke width in px), `opacity` (uniform 0–1 opacity), `enableHover` (true), `tooltip` (boolean | "multi" | function | config object), `showLegend`, `showGrid` (false), `frameProps`, `onObservation`, `onClick`, `chartId`, `loading` (false), `emptyContent`, `legendInteraction` ("none"|"highlight"|"isolate"), `legendPosition` ("right"|"left"|"top"|"bottom"), `emphasis` ("primary"|"secondary"), `annotations` (array), `accessibleTable` (true), `hoverHighlight` (boolean — dims non-hovered series, requires `colorBy`), `hoverRadius` (30), `animate` (boolean | { duration?, easing?, intro? } — animated intro on first render + smooth transitions on data change; intro defaults to true when animate is enabled), `axisExtent` ("nice" default | "exact" — pins first/last tick to actual data min/max with equidistant intermediates. Applies to XY x/y axes and ordinal value axis only; no-op on network/geo/hierarchy. Explicit `tickValues` still wins.)
18
+ `title`, `description` (aria-label), `summary` (sr-only), `width` (600), `height` (400), `responsiveWidth`, `responsiveHeight`, `margin`, `className`, `color` (uniform fill), `stroke` (uniform stroke color — CSS var OK), `strokeWidth` (uniform stroke width in px), `opacity` (uniform 0–1 opacity), `enableHover` (true), `tooltip` (boolean | "multi" | function | config object), `showLegend`, `showGrid` (false), `frameProps`, `onObservation`, `onClick`, `chartId`, `loading` (false), `loadingContent` (ReactNode — replaces the default skeleton when `loading` is true; pass `false` to suppress the loading UI entirely), `emptyContent`, `legendInteraction` ("none"|"highlight"|"isolate"), `legendPosition` ("right"|"left"|"top"|"bottom"), `emphasis` ("primary"|"secondary"), `annotations` (array), `accessibleTable` (true), `hoverHighlight` (boolean — dims non-hovered series, requires `colorBy`), `hoverRadius` (30), `animate` (boolean | { duration?, easing?, intro? } — animated intro on first render + smooth transitions on data change; intro defaults to true when animate is enabled), `axisExtent` ("nice" default | "exact" — pins first/last tick to actual data min/max with equidistant intermediates. Applies to XY x/y axes and ordinal value axis only; no-op on network/geo/hierarchy. Explicit `tickValues` still wins.)
19
19
 
20
20
  **Primitive styling props** (`color`, `stroke`, `strokeWidth`, `opacity`) apply to any shape the chart draws (bars, circles, lines, wedges, rects). Precedence: top-level prop > `frameProps.*Style` function return > HOC base > theme fallback. Use CSS variables (`stroke="var(--semiotic-border)"`) for theme-aware, cascade-overridable styling. For per-datum customization, keep using the function-form `frameProps.pieceStyle` / `pointStyle` / `lineStyle` etc. — the top-level prop overlays on top of whatever the function returns.
21
21
 
@@ -23,8 +23,8 @@
23
23
 
24
24
  ## XY Charts (`semiotic/xy`)
25
25
 
26
- **LineChart** — `data`, `xAccessor` ("x"), `yAccessor` ("y"), `lineBy`, `lineDataAccessor`, `colorBy`, `colorScheme`, `curve`, `lineWidth` (2), `showPoints`, `pointRadius` (3), `fillArea` (boolean|string[]), `areaOpacity` (0.3), `lineGradient`, `anomaly`, `forecast`, `directLabel`, `gapStrategy`, `xScaleType`/`yScaleType` ("linear"|"log"|"time"), `tooltip="multi"` for hover-anywhere series comparison
27
- **AreaChart** — LineChart props + `areaBy`, `y0Accessor`, `gradientFill`, `areaOpacity` (0.7), `showLine` (true), `tooltip="multi"` for hover-anywhere area comparison
26
+ **LineChart** — `data`, `xAccessor` ("x"), `yAccessor` ("y"), `lineBy`, `lineDataAccessor`, `colorBy`, `colorScheme`, `curve`, `lineWidth` (2), `showPoints`, `pointRadius` (3), `fillArea` (boolean|string[]), `areaOpacity` (0.3), `lineGradient`, `anomaly`, `forecast`, `band` (asymmetric min/max envelope: `{ y0Accessor, y1Accessor, style?, perSeries?, interactive? }` or array for fan charts; participates in yExtent; non-interactive by default; hovered datum is enriched with `band: {y0,y1}` and `bands: [...]`), `directLabel`, `gapStrategy`, `xScaleType`/`yScaleType` ("linear"|"log"|"time"), `tooltip="multi"` for hover-anywhere series comparison
27
+ **AreaChart** — LineChart props + `areaBy`, `y0Accessor`, `gradientFill`, `areaOpacity` (0.7), `showLine` (true), `band` (same shape as LineChart — decorative envelope under the area), `tooltip="multi"` for hover-anywhere area comparison
28
28
  **DifferenceChart** — Two-series A/B comparison. Fills the area between with `seriesAColor` where A > B and `seriesBColor` where B > A; crossovers interpolated. Props: `data`, `xAccessor` ("x"), `seriesAAccessor` ("a"), `seriesBAccessor` ("b"), `seriesALabel`/`seriesBLabel`, `seriesAColor` (var(--semiotic-danger))/`seriesBColor` (var(--semiotic-info)), `showLines` (true), `lineWidth` (1.5), `showPoints` (false), `pointRadius` (3), `curve` ("linear"), `areaOpacity` (0.6), `gradientFill`, `xExtent`/`yExtent`, `pointIdAccessor`, `windowSize` (max raw rows in push buffer; FIFO eviction). Push API via `ref.current.push({x, a, b})`. Accessor outputs coerce through `toNumber` so `Date` + numeric strings are accepted.
29
29
  **StackedAreaChart** — flat array + `areaBy` (required), `colorBy`, `normalize`, `baseline` (`"zero"` default | `"wiggle"` streamgraph | `"silhouette"` centered), `stackOrder` (`"key"` alpha | `"insideOut"` largest-in-middle | `"asc"`/`"desc"`). Streamgraph: `baseline="wiggle"` + `stackOrder="insideOut"`. `baseline` ⊥ `normalize`. No `lineBy`/`lineDataAccessor`. `tooltip="multi"` lists every series at the hovered x (values interpolated between samples).
30
30
  **Scatterplot** — `data`, `xAccessor`, `yAccessor`, `colorBy`, `sizeBy`, `sizeRange`, `pointRadius` (5), `pointOpacity` (0.8), `marginalGraphics`, `regression` (boolean | "linear" | "polynomial" | "loess" | RegressionConfig — sugar for a trend-annotation overlay; sits underneath user annotations)
@@ -61,7 +61,7 @@ All ordinal: `colorBy`, `colorScheme`, `categoryFormat` (string|ReactNode), `sho
61
61
 
62
62
  **ForceDirectedGraph** — `nodes`, `edges`, `nodeIDAccessor`, `sourceAccessor`, `targetAccessor`, `colorBy`, `nodeSize`, `nodeSizeRange`, `edgeWidth`, `iterations` (300), `forceStrength` (0.1), `showLabels`, `nodeLabel`
63
63
  **SankeyDiagram** — `edges`, `nodes`, `valueAccessor`, `nodeIdAccessor`, `colorBy`, `edgeColorBy`, `orientation`, `nodeAlign`, `nodeWidth`, `nodePaddingRatio`, `showLabels`
64
- **ProcessSankey** — temporal sankey with a real time x-axis. `nodes`, `edges` (each with `startTime`/`endTime`), `domain` (required `[t0, t1]`), `axisTicks?`, `xExtentAccessor` (optional `[start, end]` lifetime per node — lane spans `min(xExtent[0], earliestEdge)` to `max(xExtent[1], latestEdge)`), `colorBy`/`colorScheme`/`showLegend`/`legendPosition`, `pairing` ("value"|"temporal"), `packing` ("off"|"reuse"), `laneOrder` ("crossing-min"|"inside-out"|"crossing-min+inside-out"|"insertion"), `lifetimeMode` ("full"|"half"), `ribbonLane` ("source"|"target"|"both"), `showLaneRails`, `showQualityReadout`, `showParticles` + `particleStyle` (same shape as SankeyDiagram, canvas + ParticlePool), `timeFormat`/`valueFormat`, push API via ref. Static-graph cycles are valid as long as edges move forward in time. Use for time-stamped flow events; use `SankeyDiagram` for static total-flow snapshots.
64
+ **ProcessSankey** — temporal sankey with a real time x-axis. `nodes`, `edges` (each with `startTime`/`endTime`), `domain` (required `[t0, t1]`), `axisTicks?`, `xExtentAccessor` (optional `[start, end]` lifetime per node — lane spans `min(xExtent[0], earliestEdge)` to `max(xExtent[1], latestEdge)`), `colorBy`/`colorScheme`/`showLegend`/`legendPosition`, `pairing` ("value"|"temporal"), `packing` ("off"|"reuse"), `laneOrder` ("crossing-min"|"inside-out"|"crossing-min+inside-out"|"insertion"), `lifetimeMode` ("full"|"half"), `ribbonLane` ("source"|"target"|"both"), `showLaneRails`, `showLabels` (default true), `showQualityReadout`, `showParticles` + `particleStyle` (same shape as SankeyDiagram, canvas + ParticlePool), `timeFormat`/`valueFormat`, push API via ref. Static-graph cycles are valid as long as edges move forward in time. Use for time-stamped flow events; use `SankeyDiagram` for static total-flow snapshots.
65
65
  **ChordDiagram** — `edges`, `nodes`, `valueAccessor`, `edgeColorBy`, `padAngle`, `showLabels`
66
66
  **TreeDiagram** — `data` (root), `layout`, `orientation`, `childrenAccessor`, `colorBy`, `colorByDepth`
67
67
  **Treemap** — `data` (root), `childrenAccessor`, `valueAccessor`, `colorBy`, `colorByDepth`, `showLabels`
@@ -84,7 +84,7 @@ Helpers: `resolveReferenceGeography("world-110m"|"world-50m")`, `mergeData(featu
84
84
 
85
85
  Push API: `ref.current.push({ time, value })`. All pushed data **must** include a time field.
86
86
 
87
- **RealtimeLineChart**, **RealtimeHistogram** (+ `brush`, `onBrush`, `linkedBrush`), **RealtimeSwarmChart**, **RealtimeWaterfallChart**, **RealtimeHeatmap**, **Streaming Sankey** (StreamNetworkFrame + `showParticles`)
87
+ **RealtimeLineChart**, **RealtimeHistogram** (+ `brush`, `onBrush`, `linkedBrush`, `direction`), **TemporalHistogram** (static-data sibling of RealtimeHistogram — same props minus `windowSize`/`windowMode`; takes a bounded `data` array), **RealtimeSwarmChart**, **RealtimeWaterfallChart**, **RealtimeHeatmap**, **Streaming Sankey** (StreamNetworkFrame + `showParticles`)
88
88
 
89
89
  Encoding: `decay`, `pulse`, `transition`, `staleness` — compose freely.
90
90
 
@@ -243,7 +243,7 @@ All HOCs accept `annotations` (array). Coordinates use data field names.
243
243
 
244
244
  ## Theming
245
245
 
246
- CSS custom properties: `--semiotic-bg`, `--semiotic-text`, `--semiotic-text-secondary`, `--semiotic-border`, `--semiotic-grid`, `--semiotic-primary`, `--semiotic-secondary`, `--semiotic-surface`, `--semiotic-success`, `--semiotic-danger`, `--semiotic-warning`, `--semiotic-error`, `--semiotic-info`, `--semiotic-focus`, `--semiotic-font-family`, `--semiotic-annotation-color`, `--semiotic-legend-font-size`, `--semiotic-title-font-size`, `--semiotic-tick-font-family`, `--semiotic-tooltip-bg`/`text`/`radius`/`font-size`/`shadow`.
246
+ CSS custom properties: `--semiotic-bg`, `--semiotic-text`, `--semiotic-text-secondary`, `--semiotic-border`, `--semiotic-grid`, `--semiotic-primary`, `--semiotic-secondary`, `--semiotic-surface`, `--semiotic-success`, `--semiotic-danger`, `--semiotic-warning`, `--semiotic-error`, `--semiotic-info`, `--semiotic-focus`, `--semiotic-font-family`, `--semiotic-annotation-color`, `--semiotic-legend-font-size`, `--semiotic-title-font-size`, `--semiotic-tick-font-family`, `--semiotic-tick-font-size` (10px default — drives axis tick text), `--semiotic-axis-label-font-size` (12px default — drives axis-label text + foreignObject ticks), `--semiotic-tooltip-bg`/`text`/`radius`/`font-size`/`shadow`.
247
247
 
248
248
  ```jsx
249
249
  <ThemeProvider theme="tufte"> {/* Named preset */}
@@ -309,7 +309,8 @@ These rules are generated from `ai/behaviorContracts.cjs` and are consumed by `s
309
309
  - **fillArea**: `fillArea={["seriesA"]}` fills named series only. Names must match `lineBy`/`colorBy` keys.
310
310
  - **hoverHighlight**: Requires `colorBy` as a string field.
311
311
  - **tooltip="multi"**: Shows all series at hovered X for LineChart, AreaChart, and StackedAreaChart. Custom fn receives `datum.allSeries`.
312
- - **Axis config**: `frameProps.axes: [{ orient, includeMax, autoRotate, gridStyle, landmarkTicks }]`
312
+ - **Axis config**: `frameProps.axes: [{ orient, includeMax, autoRotate, gridStyle, landmarkTicks, tickAnchor }]`. `tickAnchor: "edges"` flips the first tick's `text-anchor` to `start` and the last to `end` on horizontal axes (and `dominant-baseline` to `hanging`/`auto` on vertical axes) so edge labels don't overflow the plot. Pairs naturally with `axisExtent: "exact"`.
313
+ - **Targeting individual axes from CSS**: every axis renders as its own `<g class="semiotic-axis semiotic-axis-{bottom|left|right|top}" data-orient="…">`. Style with `[data-orient="left"] text { font-size: 14px }` or via the class names — no `!important` needed because the CSS-var defaults are set inline via `var(--semiotic-tick-font-size, …)`, so cascade overrides win cleanly. Tick text carries `class="semiotic-axis-tick"`; labels carry `class="semiotic-axis-label"`; titles carry `class="semiotic-chart-title"`.
313
314
  - **xScaleType: "time"**: Creates `scaleTime`. Required for landmark ticks with timestamps.
314
315
  - **scalePadding**: Pixel inset on scale ranges. Pass via `frameProps={{ scalePadding: 12 }}`.
315
316
  - **categoryFormat/xFormat/yFormat**: Can return ReactNode (renders in `<foreignObject>`).
package/README.md CHANGED
@@ -35,7 +35,7 @@ generate correct code without examples.
35
35
  Semiotic ships with everything an AI coding assistant needs to generate
36
36
  correct visualizations without trial and error:
37
37
 
38
- - **`semiotic/ai`** — a single import with 40 HOC charts (XY, ordinal, network, realtime), optimized for LLM code generation. Geo charts are in `semiotic/geo` to keep d3-geo out of non-geo bundles.
38
+ - **`semiotic/ai`** — a single import with 41 HOC charts (XY, ordinal, network, realtime), optimized for LLM code generation. Geo charts are in `semiotic/geo` to keep d3-geo out of non-geo bundles.
39
39
  - **`ai/schema.json`** — machine-readable prop schemas for every component
40
40
  - **`npx semiotic-mcp`** — an MCP server for tool-based chart rendering in any MCP client
41
41
  - **`npx semiotic-ai --doctor`** — validate component + props JSON from the command line with typo suggestions and anti-pattern detection
@@ -240,12 +240,12 @@ import { LineChart, BarChart } from "semiotic"
240
240
 
241
241
  | Category | Components |
242
242
  |---|---|
243
- | **XY** | `LineChart` `AreaChart` `StackedAreaChart` `Scatterplot` `ConnectedScatterplot` `BubbleChart` `Heatmap` `QuadrantChart` `MultiAxisLineChart` `MinimapChart` |
244
- | **Categorical** | `BarChart` `StackedBarChart` `GroupedBarChart` `LikertChart` `SwimlaneChart` `FunnelChart` `SwarmPlot` `BoxPlot` `Histogram` `ViolinPlot` `RidgelinePlot` `DotPlot` `PieChart` `DonutChart` |
245
- | **Network** | `ForceDirectedGraph` `ChordDiagram` `SankeyDiagram` `TreeDiagram` `Treemap` `CirclePack` `OrbitDiagram` |
243
+ | **XY** | `LineChart` `AreaChart` `DifferenceChart` `StackedAreaChart` `Scatterplot` `ConnectedScatterplot` `BubbleChart` `Heatmap` `QuadrantChart` `MultiAxisLineChart` `MinimapChart` `CandlestickChart` `ScatterplotMatrix` |
244
+ | **Categorical** | `BarChart` `StackedBarChart` `GroupedBarChart` `LikertChart` `SwimlaneChart` `FunnelChart` `SwarmPlot` `BoxPlot` `Histogram` `ViolinPlot` `RidgelinePlot` `DotPlot` `PieChart` `DonutChart` `GaugeChart` |
245
+ | **Network** | `ForceDirectedGraph` `ChordDiagram` `SankeyDiagram` `ProcessSankey` `TreeDiagram` `Treemap` `CirclePack` `OrbitDiagram` |
246
246
  | **Geo** | `ChoroplethMap` `ProportionalSymbolMap` `FlowMap` `DistanceCartogram` |
247
247
  | **Realtime** | `RealtimeLineChart` `RealtimeHistogram` `RealtimeSwarmChart` `RealtimeWaterfallChart` `RealtimeHeatmap` |
248
- | **Coordination** | `LinkedCharts` `ScatterplotMatrix` |
248
+ | **Coordination** | `LinkedCharts` |
249
249
  | **Layout** | `ChartGrid` `ContextLayout` `CategoryColorProvider` |
250
250
  | **Frames** | `StreamXYFrame` `StreamOrdinalFrame` `StreamNetworkFrame` `StreamGeoFrame` |
251
251
 
@@ -287,18 +287,18 @@ Semiotic ships 12 entry points. **Don't import from `"semiotic"` unless you need
287
287
 
288
288
  | Entry Point | gzip | What's inside |
289
289
  |---|---|---|
290
- | `semiotic/xy` | **83 KB** | LineChart, AreaChart, Scatterplot, Heatmap, + 8 more XY charts |
291
- | `semiotic/ordinal` | **67 KB** | BarChart, PieChart, BoxPlot, Histogram, + 11 more categorical charts |
292
- | `semiotic/network` | **62 KB** | ForceDirectedGraph, SankeyDiagram, ProcessSankey, Treemap, + 4 more |
293
- | `semiotic/geo` | **50 KB** | ChoroplethMap, FlowMap, DistanceCartogram, ProportionalSymbolMap |
294
- | `semiotic/realtime` | **88 KB** | RealtimeLineChart, RealtimeHistogram, + 3 streaming charts |
295
- | `semiotic/server` | **114 KB** | renderChart, renderDashboard, renderToImage, renderToAnimatedGif |
290
+ | `semiotic/xy` | **85 KB** | LineChart, AreaChart, Scatterplot, Heatmap, + 8 more XY charts |
291
+ | `semiotic/ordinal` | **69 KB** | BarChart, PieChart, BoxPlot, Histogram, + 11 more categorical charts |
292
+ | `semiotic/network` | **63 KB** | ForceDirectedGraph, SankeyDiagram, ProcessSankey, Treemap, + 4 more |
293
+ | `semiotic/geo` | **52 KB** | ChoroplethMap, FlowMap, DistanceCartogram, ProportionalSymbolMap |
294
+ | `semiotic/realtime` | **90 KB** | RealtimeLineChart, RealtimeHistogram, + 3 streaming charts |
295
+ | `semiotic/server` | **122 KB** | renderChart, renderDashboard, renderToImage, renderToAnimatedGif |
296
296
  | `semiotic/utils` | **22 KB** | ThemeProvider, validators, serialization — no chart components |
297
297
  | `semiotic/recipes` | **5 KB** | Pure layout functions (waffle, marimekko, flextree, dagre, …) |
298
298
  | `semiotic/themes` | **4 KB** | Theme presets only (tufte, carbon, etc.) |
299
299
  | `semiotic/data` | **3 KB** | bin, rollup, groupBy, pivot, fromVegaLite |
300
- | `semiotic/ai` | **184 KB** | All 40 HOCs + validation — optimized for LLM code generation |
301
- | `semiotic` | **183 KB** | Everything below (full bundle) |
300
+ | `semiotic/ai` | **189 KB** | All 41 HOCs + validation — optimized for LLM code generation |
301
+ | `semiotic` | **188 KB** | Everything below (full bundle) |
302
302
 
303
303
  <!-- semiotic-bundle-sizes:end -->
304
304
 
@@ -389,7 +389,7 @@ No API keys or authentication required. The server runs locally via stdio. HTTP
389
389
  | Tool | Description |
390
390
  |------|-------------|
391
391
  | **`renderChart`** | Render a Semiotic chart to static SVG. Supports the components returned by `getSchema` that are marked `[renderable]`. Pass `{ component: "LineChart", props: { data: [...], xAccessor: "x", yAccessor: "y" } }`. Returns SVG string or validation errors with fix suggestions. |
392
- | **`getSchema`** | Return the prop schema for a specific component. Pass `{ component: "LineChart" }` to get its props, or omit `component` to list all 43 chart schemas. Components marked `[renderable]` are available through `renderChart`; realtime charts require a browser/live environment. |
392
+ | **`getSchema`** | Return the prop schema for a specific component. Pass `{ component: "LineChart" }` to get its props, or omit `component` to list all 45 chart schemas. Components marked `[renderable]` are available through `renderChart`; realtime charts require a browser/live environment. |
393
393
  | **`suggestChart`** | Recommend chart types for a data sample. Pass `{ data: [{...}, ...] }` with 1–5 sample objects. Optionally include `intent` (`"comparison"`, `"trend"`, `"distribution"`, `"relationship"`, `"composition"`, `"geographic"`, `"network"`, `"hierarchy"`). Returns ranked suggestions with example props. |
394
394
  | **`diagnoseConfig`** | Check a chart configuration for common problems — empty data, bad dimensions, missing accessors, wrong data shape, and more. Returns a human-readable diagnostic report with actionable fixes. |
395
395
  | **`reportIssue`** | Generate a pre-filled GitHub issue URL for bug reports or feature requests. Pass `{ title: "...", body: "...", labels: ["bug"] }`. Returns a URL the user can open to submit. |
@@ -502,7 +502,7 @@ Semiotic is indexed by AI-coding-agent documentation tools so your assistant (Cl
502
502
 
503
503
  Agent-facing API surface:
504
504
 
505
- - **`CLAUDE.md`**, **`ai/schema.json`**, **`ai/behaviorContracts.cjs`** — bundled in the npm tarball (see `package.json#files`); agents that install Semiotic locally read these directly. `CLAUDE.md` is the quick-start cheat sheet (HOC props, push API, theming, usage notes); `ai/schema.json` is the JSON Schema for every chart's prop surface (44 charts); `ai/behaviorContracts.cjs` carries the agent-visible semantic rules (color precedence, push-mode requirements, ID-accessor contracts).
505
+ - **`CLAUDE.md`**, **`ai/schema.json`**, **`ai/behaviorContracts.cjs`** — bundled in the npm tarball (see `package.json#files`); agents that install Semiotic locally read these directly. `CLAUDE.md` is the quick-start cheat sheet (HOC props, push API, theming, usage notes); `ai/schema.json` is the JSON Schema for every chart's prop surface (45 charts); `ai/behaviorContracts.cjs` carries the agent-visible semantic rules (color precedence, push-mode requirements, ID-accessor contracts).
506
506
  - [**`semiotic.nteract.io/llms.txt`**](https://semiotic.nteract.io/llms.txt) + [**`/llms-full.txt`**](https://semiotic.nteract.io/llms-full.txt) — deployed at the docs site per the [llms.txt standard](https://llmstxt.org). Agents fetch the navigation map (`llms.txt`) or the full inlined docs (`llms-full.txt`) over HTTP; they're not part of the npm package itself.
507
507
 
508
508
  ## Documentation
@@ -21,7 +21,7 @@ const COMPONENTS_BY_CATEGORY = {
21
21
  "ChoroplethMap", "ProportionalSymbolMap", "FlowMap", "DistanceCartogram",
22
22
  ],
23
23
  realtime: [
24
- "RealtimeLineChart", "RealtimeHistogram", "RealtimeSwarmChart",
24
+ "RealtimeLineChart", "RealtimeHistogram", "TemporalHistogram", "RealtimeSwarmChart",
25
25
  "RealtimeWaterfallChart", "RealtimeHeatmap",
26
26
  ],
27
27
  }
@@ -52,11 +52,18 @@ function importPathForCategory(category) {
52
52
  function metadataForComponent(entryOrName) {
53
53
  const name = typeof entryOrName === "string" ? entryOrName : entryOrName.name
54
54
  const category = categoryForComponent(name)
55
+ // Realtime push-streaming charts are browser-only by design.
56
+ // TemporalHistogram is the static-data sibling living in the
57
+ // "realtime" category for documentation grouping — it accepts a
58
+ // bounded data array and is renderable through the SSR path like
59
+ // any other static HOC. Matches the name-prefix exclusion the
60
+ // check-surface-parity script applies.
61
+ const isPushOnly = category === "realtime" && name.startsWith("Realtime")
55
62
  return {
56
63
  name,
57
64
  category,
58
65
  importPath: importPathForCategory(category),
59
- renderable: category !== "realtime",
66
+ renderable: !isPushOnly,
60
67
  description: typeof entryOrName === "string" ? undefined : entryOrName.description,
61
68
  }
62
69
  }
@@ -6943,6 +6943,7 @@ var require_componentMetadata = __commonJS({
6943
6943
  realtime: [
6944
6944
  "RealtimeLineChart",
6945
6945
  "RealtimeHistogram",
6946
+ "TemporalHistogram",
6946
6947
  "RealtimeSwarmChart",
6947
6948
  "RealtimeWaterfallChart",
6948
6949
  "RealtimeHeatmap"
@@ -6970,11 +6971,12 @@ var require_componentMetadata = __commonJS({
6970
6971
  function metadataForComponent2(entryOrName) {
6971
6972
  const name = typeof entryOrName === "string" ? entryOrName : entryOrName.name;
6972
6973
  const category = categoryForComponent(name);
6974
+ const isPushOnly = category === "realtime" && name.startsWith("Realtime");
6973
6975
  return {
6974
6976
  name,
6975
6977
  category,
6976
6978
  importPath: importPathForCategory(category),
6977
- renderable: category !== "realtime",
6979
+ renderable: !isPushOnly,
6978
6980
  description: typeof entryOrName === "string" ? void 0 : entryOrName.description
6979
6981
  };
6980
6982
  }
@@ -32363,6 +32365,7 @@ var COMPONENT_REGISTRY = {
32363
32365
  QuadrantChart: { component: import_ai.QuadrantChart, category: "xy" },
32364
32366
  MultiAxisLineChart: { component: import_ai.MultiAxisLineChart, category: "xy" },
32365
32367
  CandlestickChart: { component: import_ai.CandlestickChart, category: "xy" },
32368
+ TemporalHistogram: { component: import_ai.TemporalHistogram, category: "xy" },
32366
32369
  BarChart: { component: import_ai.BarChart, category: "ordinal" },
32367
32370
  StackedBarChart: { component: import_ai.StackedBarChart, category: "ordinal" },
32368
32371
  GroupedBarChart: { component: import_ai.GroupedBarChart, category: "ordinal" },
package/ai/examples.md CHANGED
@@ -292,6 +292,33 @@ const data = [
292
292
 
293
293
  Key props: `orderAccessor` sequences points along the path, Viridis gradient from start→end
294
294
 
295
+ ### TemporalHistogram
296
+
297
+ ```jsx
298
+ import { TemporalHistogram } from "semiotic/ai"
299
+
300
+ // One row per event; the chart bins events into `binSize` time buckets.
301
+ const events = [
302
+ { time: 1700000000000, value: 1, category: "errors" },
303
+ { time: 1700000005000, value: 1, category: "warnings" },
304
+ { time: 1700000007000, value: 1, category: "errors" },
305
+ { time: 1700000020000, value: 1, category: "info" },
306
+ { time: 1700000022000, value: 1, category: "info" },
307
+ { time: 1700000040000, value: 1, category: "errors" },
308
+ { time: 1700000045000, value: 1, category: "warnings" }
309
+ ]
310
+
311
+ <TemporalHistogram
312
+ data={events}
313
+ binSize={15000}
314
+ categoryAccessor="category"
315
+ colors={{ errors: "#dc3545", warnings: "#fd7e14", info: "#007bff" }}
316
+ enableHover
317
+ />
318
+ ```
319
+
320
+ Static-data sibling of `RealtimeHistogram` — accepts a bounded `data` array instead of a push-mode ref. Same props minus `windowSize` / `windowMode`. Use for backfilled or historical temporal histograms where the time range is fixed; reach for `RealtimeHistogram` when events arrive over time and you want a sliding window.
321
+
295
322
  ---
296
323
 
297
324
  ## Flat Array — Ordinal Charts