semiotic 3.2.0 → 3.2.2

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 (109) hide show
  1. package/CLAUDE.md +50 -8
  2. package/README.md +11 -11
  3. package/ai/dist/mcp-server.js +31925 -528
  4. package/ai/examples.md +91 -0
  5. package/ai/schema.json +235 -9
  6. package/ai/system-prompt.md +12 -4
  7. package/dist/components/ChartContainer.d.ts +2 -0
  8. package/dist/components/DataSummaryContext.d.ts +12 -0
  9. package/dist/components/Tooltip/FlippingTooltip.d.ts +34 -0
  10. package/dist/components/charts/index.d.ts +4 -0
  11. package/dist/components/charts/ordinal/BarChart.d.ts +3 -1
  12. package/dist/components/charts/ordinal/BoxPlot.d.ts +3 -1
  13. package/dist/components/charts/ordinal/DonutChart.d.ts +0 -1
  14. package/dist/components/charts/ordinal/DotPlot.d.ts +3 -1
  15. package/dist/components/charts/ordinal/FunnelChart.d.ts +3 -1
  16. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +3 -1
  17. package/dist/components/charts/ordinal/Histogram.d.ts +16 -2
  18. package/dist/components/charts/ordinal/LikertChart.d.ts +94 -0
  19. package/dist/components/charts/ordinal/PieChart.d.ts +0 -1
  20. package/dist/components/charts/ordinal/RidgelinePlot.d.ts +11 -7
  21. package/dist/components/charts/ordinal/StackedBarChart.d.ts +3 -1
  22. package/dist/components/charts/ordinal/SwarmPlot.d.ts +14 -1
  23. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +65 -0
  24. package/dist/components/charts/ordinal/ViolinPlot.d.ts +16 -2
  25. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +20 -0
  26. package/dist/components/charts/shared/annotationResolvers.d.ts +28 -0
  27. package/dist/components/charts/shared/hooks.d.ts +23 -2
  28. package/dist/components/charts/shared/selectionUtils.d.ts +5 -1
  29. package/dist/components/charts/shared/statsTooltip.d.ts +11 -0
  30. package/dist/components/charts/shared/types.d.ts +22 -1
  31. package/dist/components/charts/shared/useChartSetup.d.ts +12 -2
  32. package/dist/components/charts/shared/useLikertAggregation.d.ts +51 -0
  33. package/dist/components/charts/shared/useOrdinalBrush.d.ts +28 -0
  34. package/dist/components/charts/shared/useOrdinalStreaming.d.ts +54 -0
  35. package/dist/components/charts/shared/useStreamingLegend.d.ts +2 -2
  36. package/dist/components/charts/shared/validateProps.d.ts +2 -2
  37. package/dist/components/charts/shared/validationMap.d.ts +12 -0
  38. package/dist/components/charts/xy/AreaChart.d.ts +11 -0
  39. package/dist/components/charts/xy/MinimapChart.d.ts +1 -1
  40. package/dist/components/charts/xy/StackedAreaChart.d.ts +11 -0
  41. package/dist/components/realtime/types.d.ts +4 -0
  42. package/dist/components/semiotic-ai.d.ts +1 -0
  43. package/dist/components/semiotic-ordinal.d.ts +2 -0
  44. package/dist/components/semiotic-themes.d.ts +16 -0
  45. package/dist/components/semiotic-utils.d.ts +30 -0
  46. package/dist/components/semiotic.d.ts +4 -4
  47. package/dist/components/store/LinkedCrosshairStore.d.ts +11 -0
  48. package/dist/components/store/useSelection.d.ts +1 -0
  49. package/dist/components/stream/AccessibleDataTable.d.ts +28 -6
  50. package/dist/components/stream/FocusRing.d.ts +33 -0
  51. package/dist/components/stream/OrdinalBrushOverlay.d.ts +43 -0
  52. package/dist/components/stream/OrdinalPipelineStore.d.ts +16 -0
  53. package/dist/components/stream/OrdinalSVGOverlay.d.ts +1 -1
  54. package/dist/components/stream/PipelineStore.d.ts +5 -47
  55. package/dist/components/stream/SVGOverlay.d.ts +4 -0
  56. package/dist/components/stream/SceneGraph.d.ts +6 -1
  57. package/dist/components/stream/XYBrushOverlay.d.ts +47 -0
  58. package/dist/components/stream/devDataAccessWarning.d.ts +13 -0
  59. package/dist/components/stream/geoTypes.d.ts +5 -1
  60. package/dist/components/stream/keyboardNav.d.ts +85 -9
  61. package/dist/components/stream/layouts/hierarchySceneBuilders.d.ts +35 -0
  62. package/dist/components/stream/layouts/hierarchyUtils.d.ts +25 -0
  63. package/dist/components/stream/networkTypes.d.ts +5 -1
  64. package/dist/components/stream/ordinalSceneBuilders/swimlaneScene.d.ts +12 -0
  65. package/dist/components/stream/ordinalTypes.d.ts +15 -3
  66. package/dist/components/stream/pipelineDecay.d.ts +20 -0
  67. package/dist/components/stream/pipelinePulse.d.ts +24 -0
  68. package/dist/components/stream/pipelineTransitions.d.ts +59 -0
  69. package/dist/components/stream/renderers/pointCanvasRenderer.d.ts +2 -1
  70. package/dist/components/stream/types.d.ts +19 -1
  71. package/dist/components/stream/useMediaPreferences.d.ts +11 -0
  72. package/dist/components/stream/xySceneBuilders/areaScene.d.ts +13 -0
  73. package/dist/components/stream/xySceneBuilders/barScene.d.ts +18 -0
  74. package/dist/components/stream/xySceneBuilders/boundsScene.d.ts +8 -0
  75. package/dist/components/stream/xySceneBuilders/candlestickScene.d.ts +10 -0
  76. package/dist/components/stream/xySceneBuilders/emitPointNodes.d.ts +13 -0
  77. package/dist/components/stream/xySceneBuilders/heatmapScene.d.ts +3 -0
  78. package/dist/components/stream/xySceneBuilders/lineScene.d.ts +12 -0
  79. package/dist/components/stream/xySceneBuilders/pointScene.d.ts +12 -0
  80. package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +10 -0
  81. package/dist/components/stream/xySceneBuilders/types.d.ts +93 -0
  82. package/dist/components/stream/xySceneBuilders/waterfallScene.d.ts +12 -0
  83. package/dist/geo.min.js +1 -1
  84. package/dist/geo.module.min.js +1 -1
  85. package/dist/network.min.js +1 -1
  86. package/dist/network.module.min.js +1 -1
  87. package/dist/ordinal.min.js +1 -1
  88. package/dist/ordinal.module.min.js +1 -1
  89. package/dist/realtime.min.js +1 -1
  90. package/dist/realtime.module.min.js +1 -1
  91. package/dist/semiotic-ai.d.ts +1 -0
  92. package/dist/semiotic-ai.min.js +1 -1
  93. package/dist/semiotic-ai.module.min.js +1 -1
  94. package/dist/semiotic-ordinal.d.ts +2 -0
  95. package/dist/{semiotic-statisticalOverlays-D8LhSbQt.js → semiotic-statisticalOverlays-DGX_WWc5.js} +1 -1
  96. package/dist/semiotic-themes.d.ts +16 -0
  97. package/dist/semiotic-themes.min.js +1 -1
  98. package/dist/semiotic-themes.module.min.js +1 -1
  99. package/dist/semiotic-utils.d.ts +30 -0
  100. package/dist/semiotic-utils.min.js +1 -0
  101. package/dist/semiotic-utils.module.min.js +1 -0
  102. package/dist/semiotic.d.ts +4 -4
  103. package/dist/semiotic.min.js +1 -1
  104. package/dist/semiotic.module.min.js +1 -1
  105. package/dist/server.min.js +1 -1
  106. package/dist/server.module.min.js +1 -1
  107. package/dist/xy.min.js +1 -1
  108. package/dist/xy.module.min.js +1 -1
  109. package/package.json +19 -11
package/ai/examples.md CHANGED
@@ -995,3 +995,94 @@ import { ThemeProvider, DARK_THEME, COLOR_BLIND_SAFE_CATEGORICAL } from "semioti
995
995
  showGrid
996
996
  />
997
997
  ```
998
+
999
+ ---
1000
+
1001
+ ## Click Handlers
1002
+
1003
+ ### onClick on BarChart
1004
+
1005
+ ```jsx
1006
+ import { BarChart } from "semiotic/ai"
1007
+
1008
+ <BarChart
1009
+ data={salesData}
1010
+ categoryAccessor="region"
1011
+ valueAccessor="revenue"
1012
+ onClick={(datum, { x, y }) => {
1013
+ console.log(`Clicked ${datum.region}: $${datum.revenue}`)
1014
+ setSelectedRegion(datum.region)
1015
+ }}
1016
+ />
1017
+ ```
1018
+
1019
+ Key props: `onClick` receives the original datum and pixel coordinates. Works on all chart types.
1020
+
1021
+ ---
1022
+
1023
+ ## Linked Crosshair (Multi-chart Hover Sync)
1024
+
1025
+ ### Synced crosshair across time-series charts
1026
+
1027
+ ```jsx
1028
+ import { LineChart, LinkedCharts } from "semiotic/ai"
1029
+
1030
+ <LinkedCharts>
1031
+ <LineChart
1032
+ data={cpuData}
1033
+ xAccessor="time" yAccessor="cpu"
1034
+ linkedHover={{ name: "metrics", mode: "x-position", xField: "time" }}
1035
+ selection={{ name: "metrics" }}
1036
+ />
1037
+ <LineChart
1038
+ data={memoryData}
1039
+ xAccessor="time" yAccessor="memory"
1040
+ linkedHover={{ name: "metrics", mode: "x-position", xField: "time" }}
1041
+ selection={{ name: "metrics" }}
1042
+ />
1043
+ </LinkedCharts>
1044
+ ```
1045
+
1046
+ Key props: `linkedHover` with `mode: "x-position"` broadcasts the hovered X value. Each chart shows its own tooltip with its own Y values. Use for multi-metric dashboards.
1047
+
1048
+ ---
1049
+
1050
+ ## Category Format (Custom Tick Labels)
1051
+
1052
+ ### Truncated category labels
1053
+
1054
+ ```jsx
1055
+ import { BarChart } from "semiotic/ai"
1056
+
1057
+ <BarChart
1058
+ data={data}
1059
+ categoryAccessor="department"
1060
+ valueAccessor="headcount"
1061
+ orientation="horizontal"
1062
+ categoryFormat={(label) => label.length > 12 ? label.slice(0, 12) + "…" : label}
1063
+ />
1064
+ ```
1065
+
1066
+ Key props: `categoryFormat` receives each tick label and returns a formatted string. Available on all ordinal HOCs except Pie/Donut.
1067
+
1068
+ ---
1069
+
1070
+ ## Ordinal Annotations
1071
+
1072
+ ### Threshold + category highlight on BarChart
1073
+
1074
+ ```jsx
1075
+ import { BarChart } from "semiotic/ai"
1076
+
1077
+ <BarChart
1078
+ data={quarterlyData}
1079
+ categoryAccessor="quarter"
1080
+ valueAccessor="revenue"
1081
+ annotations={[
1082
+ { type: "y-threshold", value: 50000, label: "Target", color: "#e45050", labelPosition: "left" },
1083
+ { type: "category-highlight", category: "Q3 2024", color: "#4589ff", opacity: 0.15, label: "Current" },
1084
+ ]}
1085
+ />
1086
+ ```
1087
+
1088
+ Key props: `y-threshold` works on vertical ordinal charts. `category-highlight` highlights a category column. `labelPosition` controls label placement.
package/ai/schema.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "name": "semiotic",
4
- "version": "3.2.0",
4
+ "version": "3.2.2",
5
5
  "description": "React data visualization library for charts, networks, and beyond",
6
6
  "tools": [
7
7
  {
@@ -1578,6 +1578,100 @@
1578
1578
  }
1579
1579
  }
1580
1580
  },
1581
+ {
1582
+ "type": "function",
1583
+ "function": {
1584
+ "name": "LikertChart",
1585
+ "description": "Visualize Likert scale survey responses. Horizontal (default): diverging bar chart centered at 0% — negative levels extend left, positive right, neutral (if odd count) split 50/50 across centerline. Vertical: stacked 100% bar chart. Supports raw integer scores (1-based, aggregated automatically) or pre-aggregated (question, level, count) data. The levels array defines polarity: first half = negative, second half = positive, center = neutral (if odd). Works with any scale size (3-point to 7-point+). Supports push API for streaming — accumulates raw data and re-aggregates on each push.",
1586
+ "parameters": {
1587
+ "type": "object",
1588
+ "properties": {
1589
+ "data": {
1590
+ "type": "array",
1591
+ "items": {
1592
+ "type": "object"
1593
+ },
1594
+ "description": "Array of raw response or pre-aggregated data objects"
1595
+ },
1596
+ "levels": {
1597
+ "type": "array",
1598
+ "items": {
1599
+ "type": "string"
1600
+ },
1601
+ "description": "Ordered response labels, most negative to most positive (required). Odd count = center is neutral."
1602
+ },
1603
+ "categoryAccessor": {
1604
+ "type": "string",
1605
+ "description": "Question/item field (ordinal axis)",
1606
+ "default": "question"
1607
+ },
1608
+ "valueAccessor": {
1609
+ "type": "string",
1610
+ "description": "Integer score field for raw response mode (1-based: score 1 → levels[0])",
1611
+ "default": "score"
1612
+ },
1613
+ "levelAccessor": {
1614
+ "type": "string",
1615
+ "description": "Level name field for pre-aggregated mode. Each value must match an entry in levels."
1616
+ },
1617
+ "countAccessor": {
1618
+ "type": "string",
1619
+ "description": "Count/frequency field for pre-aggregated mode",
1620
+ "default": "count"
1621
+ },
1622
+ "orientation": {
1623
+ "type": "string",
1624
+ "enum": [
1625
+ "horizontal",
1626
+ "vertical"
1627
+ ],
1628
+ "default": "horizontal"
1629
+ },
1630
+ "colorScheme": {
1631
+ "type": "array",
1632
+ "items": {
1633
+ "type": "string"
1634
+ },
1635
+ "description": "One color per level. Use a diverging palette (red → gray → blue). Defaults to Carbon-inspired diverging."
1636
+ },
1637
+ "barPadding": {
1638
+ "type": "number",
1639
+ "default": 20
1640
+ },
1641
+ "title": {
1642
+ "type": "string"
1643
+ },
1644
+ "width": {
1645
+ "type": "number",
1646
+ "default": 600
1647
+ },
1648
+ "height": {
1649
+ "type": "number",
1650
+ "default": 400
1651
+ },
1652
+ "enableHover": {
1653
+ "type": "boolean",
1654
+ "default": true
1655
+ },
1656
+ "showLegend": {
1657
+ "type": "boolean",
1658
+ "default": true
1659
+ },
1660
+ "showGrid": {
1661
+ "type": "boolean",
1662
+ "default": false
1663
+ },
1664
+ "tooltip": {
1665
+ "type": "boolean",
1666
+ "default": true
1667
+ }
1668
+ },
1669
+ "required": [
1670
+ "levels"
1671
+ ]
1672
+ }
1673
+ }
1674
+ },
1581
1675
  {
1582
1676
  "type": "function",
1583
1677
  "function": {
@@ -2508,10 +2602,6 @@
2508
2602
  "description": "Starting angle in radians",
2509
2603
  "default": 0
2510
2604
  },
2511
- "slicePadding": {
2512
- "type": "number",
2513
- "default": 2
2514
- },
2515
2605
  "title": {
2516
2606
  "type": "string"
2517
2607
  },
@@ -2623,10 +2713,6 @@
2623
2713
  "type": "number",
2624
2714
  "default": 0
2625
2715
  },
2626
- "slicePadding": {
2627
- "type": "number",
2628
- "default": 2
2629
- },
2630
2716
  "title": {
2631
2717
  "type": "string"
2632
2718
  },
@@ -3852,6 +3938,18 @@
3852
3938
  "gap": {
3853
3939
  "type": "number"
3854
3940
  },
3941
+ "brush": {
3942
+ "type": ["boolean", "string", "object"],
3943
+ "description": "Enable brush selection. true defaults to { dimension: \"x\", snap: \"bin\" }. String: \"x\". Object: { dimension, snap: \"continuous\"|\"bin\", snapDuring }."
3944
+ },
3945
+ "onBrush": {
3946
+ "type": "function",
3947
+ "description": "Callback when brush extent changes: (extent | null) => void"
3948
+ },
3949
+ "linkedBrush": {
3950
+ "type": ["string", "object"],
3951
+ "description": "Cross-chart brush coordination via LinkedCharts. String: selection name. Object: { name, xField, yField }."
3952
+ },
3855
3953
  "showAxes": {
3856
3954
  "type": "boolean",
3857
3955
  "default": true
@@ -4504,6 +4602,134 @@
4504
4602
  ]
4505
4603
  }
4506
4604
  }
4605
+ },
4606
+ {
4607
+ "type": "function",
4608
+ "function": {
4609
+ "name": "SwimlaneChart",
4610
+ "description": "Categorical lanes with sequentially stacked items colored by subcategory. Unlike StackedBarChart, the same subcategory can appear multiple times in the same lane — items stack left-to-right (horizontal) or bottom-to-top (vertical) in data order. Supports brush for value-axis selection and push API for streaming.",
4611
+ "parameters": {
4612
+ "type": "object",
4613
+ "properties": {
4614
+ "data": {
4615
+ "type": "array",
4616
+ "items": {
4617
+ "type": "object"
4618
+ },
4619
+ "description": "Array of data objects. Omit for push API mode."
4620
+ },
4621
+ "categoryAccessor": {
4622
+ "type": "string",
4623
+ "description": "Key for lane categories (swim lanes)",
4624
+ "default": "category"
4625
+ },
4626
+ "subcategoryAccessor": {
4627
+ "type": "string",
4628
+ "description": "Key for item subcategory (color grouping within lanes). Required. Duplicate subcategories in the same lane stack sequentially."
4629
+ },
4630
+ "valueAccessor": {
4631
+ "type": "string",
4632
+ "description": "Key for item size/duration along the value axis",
4633
+ "default": "value"
4634
+ },
4635
+ "colorBy": {
4636
+ "type": "string",
4637
+ "description": "Key to determine color encoding. Defaults to subcategoryAccessor."
4638
+ },
4639
+ "colorScheme": {
4640
+ "type": [
4641
+ "string",
4642
+ "array"
4643
+ ],
4644
+ "description": "Named d3 color scheme or array of color strings"
4645
+ },
4646
+ "orientation": {
4647
+ "type": "string",
4648
+ "enum": ["horizontal", "vertical"],
4649
+ "description": "Horizontal renders lanes as rows; vertical as columns.",
4650
+ "default": "horizontal"
4651
+ },
4652
+ "barPadding": {
4653
+ "type": "number",
4654
+ "description": "Padding between lanes in pixels",
4655
+ "default": 40
4656
+ },
4657
+ "brush": {
4658
+ "type": "boolean",
4659
+ "description": "Enable value-axis brush selection"
4660
+ },
4661
+ "onBrush": {
4662
+ "type": "function",
4663
+ "description": "Callback with { r: [min, max] } or null when brush clears"
4664
+ },
4665
+ "linkedBrush": {
4666
+ "type": [
4667
+ "string",
4668
+ "object"
4669
+ ],
4670
+ "description": "LinkedCharts brush integration name"
4671
+ },
4672
+ "showCategoryTicks": {
4673
+ "type": "boolean",
4674
+ "description": "Show lane labels on the category axis"
4675
+ },
4676
+ "annotations": {
4677
+ "type": "array",
4678
+ "description": "Annotation objects to render on the chart.",
4679
+ "items": {
4680
+ "type": "object"
4681
+ }
4682
+ },
4683
+ "title": {
4684
+ "type": "string"
4685
+ },
4686
+ "width": {
4687
+ "type": "number",
4688
+ "default": 600
4689
+ },
4690
+ "height": {
4691
+ "type": "number",
4692
+ "default": 400
4693
+ },
4694
+ "margin": {
4695
+ "type": "object",
4696
+ "description": "Chart margins: { top, right, bottom, left }"
4697
+ },
4698
+ "responsiveWidth": {
4699
+ "type": "boolean",
4700
+ "description": "Auto-resize to container width"
4701
+ },
4702
+ "tooltip": {
4703
+ "type": [
4704
+ "function",
4705
+ "object"
4706
+ ],
4707
+ "description": "Tooltip content function or config."
4708
+ },
4709
+ "showLegend": {
4710
+ "type": "boolean",
4711
+ "description": "Show legend (auto-enabled with colorBy)"
4712
+ },
4713
+ "legendPosition": {
4714
+ "type": "string",
4715
+ "enum": [
4716
+ "right",
4717
+ "left",
4718
+ "top",
4719
+ "bottom"
4720
+ ],
4721
+ "default": "right"
4722
+ },
4723
+ "enableHover": {
4724
+ "type": "boolean",
4725
+ "default": true
4726
+ }
4727
+ },
4728
+ "required": [
4729
+ "subcategoryAccessor"
4730
+ ]
4731
+ }
4732
+ }
4507
4733
  }
4508
4734
  ]
4509
4735
  }
@@ -21,6 +21,8 @@ Use `import { ComponentName } from "semiotic/ai"` for all components below.
21
21
  - **PieChart** — `categoryAccessor`, `valueAccessor`
22
22
  - **DonutChart** — `categoryAccessor`, `valueAccessor`, `innerRadius`, `centerContent` (ReactNode, e.g. `<div>50%</div>`)
23
23
 
24
+ All ordinal HOCs (except Pie/Donut) support `categoryFormat` — a function `(label, index?) => string` for custom tick label formatting (truncation, abbreviation).
25
+
24
26
  ## Hierarchical Data (`data: { children: [...] }`)
25
27
  - **TreeDiagram** — `childrenAccessor`, `nodeIdAccessor`, `layout` ("tree"|"cluster"|"partition"), `orientation`
26
28
  - **Treemap** — `childrenAccessor`, `valueAccessor`, `nodeIdAccessor`, `colorByDepth`
@@ -65,20 +67,24 @@ For advanced streaming control, use Stream Frames (`StreamXYFrame`, `StreamOrdin
65
67
  - When using with `size={[w, h]}`, set `height={h}` on the container or you'll get extra whitespace.
66
68
 
67
69
  ## Common Props (all components)
68
- `width`, `height`, `margin`, `title`, `colorBy`, `colorScheme`, `enableHover`, `tooltip`, `showLegend`, `className`, `frameProps`, `onObservation`, `emphasis` ("primary"|"secondary")
70
+ `width`, `height`, `margin`, `title`, `colorBy`, `colorScheme`, `enableHover`, `tooltip`, `showLegend`, `className`, `frameProps`, `onObservation`, `onClick`, `emphasis` ("primary"|"secondary")
69
71
 
70
72
  ### tooltip
71
73
  `true` (default) | `false` | `(datum) => ReactNode` (function receives your raw data) | config `{ fields?, title?, format?, style? }`
72
74
 
75
+ ### onClick
76
+ `onClick={(datum, { x, y }) => ...}` — called when a data element is clicked. Receives the original datum and pixel coordinates. Works on lines, bars, areas, pie slices, nodes, and geo features.
77
+
73
78
  ### onObservation
74
79
  Callback receiving `ChartObservation`: `{ type: "hover"|"click"|"brush"|"selection", datum: <your data>, x, y, timestamp, chartType, chartId }`. The `datum` field is your original data object. Hover-end/click-end events omit `datum`.
75
80
 
76
81
  ### emphasis
77
82
  `emphasis="primary"` makes a chart span two columns inside a `ChartGrid`.
78
83
 
79
- ## Annotations (XY charts)
80
- - `annotations={[{ type: "y-threshold", value: 200, label: "SLA limit", color: "#e45050" }]}` — horizontal reference line
81
- - `annotations={[{ type: "x-threshold", value: 50, label: "Cutoff" }]}` — vertical reference line
84
+ ## Annotations (XY and ordinal charts)
85
+ - `annotations={[{ type: "y-threshold", value: 200, label: "SLA limit", color: "#e45050", labelPosition: "right" }]}` — horizontal reference line (works on XY and vertical ordinal charts). `labelPosition`: "left"|"center"|"right"
86
+ - `annotations={[{ type: "x-threshold", value: 50, label: "Cutoff", labelPosition: "top" }]}` — vertical reference line. `labelPosition`: "top"|"center"|"bottom"
87
+ - `annotations={[{ type: "category-highlight", category: "Q3 2024", color: "#4589ff", opacity: 0.15 }]}` — highlight a category column/row in ordinal charts
82
88
  - `annotations={[{ type: "widget", time: 42, latency: 850, dy: -10, content: <span>Alert</span> }]}` — place React element at data coordinates
83
89
  - `annotations={[{ type: "enclose", coordinates: [datum1, datum2], label: "Cluster" }]}` — circle enclosing data points
84
90
 
@@ -99,6 +105,8 @@ All charts respond to CSS custom properties on any ancestor:
99
105
  ```
100
106
  Or use ThemeProvider with 15 named presets: `<ThemeProvider theme="tufte">`, `"tufte-dark"`, `"pastels"`, `"bi-tool"`, `"italian"`, `"journalist"`, `"playful"` (each with `-dark` variant), `"dark"`, `"high-contrast"`.
101
107
 
108
+ **Color resolution**: When `colorBy` is set, charts use: explicit `colorScheme` prop > ThemeProvider `colors.categorical` > `"category10"`. No need to pass `colorScheme` on every chart when using ThemeProvider.
109
+
102
110
  `semiotic/themes` entry point: `themeToCSS(theme, selector)` generates CSS string, `themeToTokens(theme)` generates DTCG design tokens, `resolveThemePreset("tufte")` returns theme object by name. Theme objects: `TUFTE_LIGHT`, `TUFTE_DARK`, `PASTELS_LIGHT`, `BI_TOOL_LIGHT`, `ITALIAN_LIGHT`, `JOURNALIST_LIGHT`, `PLAYFUL_LIGHT`, etc.
103
111
 
104
112
  `COLOR_BLIND_SAFE_CATEGORICAL` — 8-color accessible palette (Wong 2011). Import from `semiotic`.
@@ -23,6 +23,8 @@ export interface ChartContainerProps {
23
23
  copyConfig?: boolean | {
24
24
  format?: CopyFormat;
25
25
  };
26
+ /** Enable "Data Summary" action button — shows statistical summary + sample rows */
27
+ dataSummary?: boolean;
26
28
  };
27
29
  /** Chart configuration for serialization. Enables the "Copy Config" toolbar action. */
28
30
  chartConfig?: ChartConfig;
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ interface DataSummaryState {
3
+ /** When true, AccessibleDataTable renders visibly instead of sr-only */
4
+ visible: boolean;
5
+ setVisible: React.Dispatch<React.SetStateAction<boolean>>;
6
+ }
7
+ export declare function DataSummaryProvider({ children }: {
8
+ children: React.ReactNode;
9
+ }): React.JSX.Element;
10
+ export declare function useDataSummary(): DataSummaryState | null;
11
+ export declare function useDataSummaryToggle(): (() => void) | null;
12
+ export {};
@@ -0,0 +1,34 @@
1
+ import * as React from "react";
2
+ interface FlippingTooltipProps {
3
+ /** X position within the chart area (relative to margin.left) */
4
+ x: number;
5
+ /** Y position within the chart area (relative to margin.top) */
6
+ y: number;
7
+ /** Chart area width (excluding margins) */
8
+ containerWidth: number;
9
+ /** Chart area height (excluding margins) */
10
+ containerHeight: number;
11
+ /** Chart margins */
12
+ margin: {
13
+ left: number;
14
+ top: number;
15
+ right: number;
16
+ bottom: number;
17
+ };
18
+ /** Tooltip content */
19
+ children: React.ReactNode;
20
+ /** CSS class name for the wrapper */
21
+ className?: string;
22
+ /** z-index (default 1) */
23
+ zIndex?: number;
24
+ }
25
+ /**
26
+ * Viewport-aware tooltip wrapper that flips horizontally and vertically
27
+ * when the tooltip would overflow the chart container.
28
+ *
29
+ * On first render, uses a heuristic (similar to the old 70%/30% thresholds).
30
+ * After measuring the actual tooltip size via ref, repositions precisely to
31
+ * prevent clipping against container edges.
32
+ */
33
+ export declare function FlippingTooltip({ x, y, containerWidth, containerHeight, margin, children, className, zIndex }: FlippingTooltipProps): React.JSX.Element;
34
+ export {};
@@ -32,6 +32,8 @@ export { BarChart } from "./ordinal/BarChart";
32
32
  export type { BarChartProps } from "./ordinal/BarChart";
33
33
  export { StackedBarChart } from "./ordinal/StackedBarChart";
34
34
  export type { StackedBarChartProps } from "./ordinal/StackedBarChart";
35
+ export { LikertChart } from "./ordinal/LikertChart";
36
+ export type { LikertChartProps } from "./ordinal/LikertChart";
35
37
  export { SwarmPlot } from "./ordinal/SwarmPlot";
36
38
  export type { SwarmPlotProps } from "./ordinal/SwarmPlot";
37
39
  export { BoxPlot } from "./ordinal/BoxPlot";
@@ -52,6 +54,8 @@ export { DonutChart } from "./ordinal/DonutChart";
52
54
  export type { DonutChartProps } from "./ordinal/DonutChart";
53
55
  export { GroupedBarChart } from "./ordinal/GroupedBarChart";
54
56
  export type { GroupedBarChartProps } from "./ordinal/GroupedBarChart";
57
+ export { SwimlaneChart } from "./ordinal/SwimlaneChart";
58
+ export type { SwimlaneChartProps } from "./ordinal/SwimlaneChart";
55
59
  export { ForceDirectedGraph } from "./network/ForceDirectedGraph";
56
60
  export type { ForceDirectedGraphProps } from "./network/ForceDirectedGraph";
57
61
  export { ChordDiagram } from "./network/ChordDiagram";
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
3
  import type { LegendInteractionMode } from "../shared/hooks";
4
- import type { BaseChartProps, ChartAccessor } from "../shared/types";
4
+ import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
5
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
6
  import type { RealtimeFrameHandle } from "../../realtime/types";
7
7
  /**
@@ -27,6 +27,8 @@ export interface BarChartProps<TDatum extends Record<string, any> = Record<strin
27
27
  legendPosition?: "right" | "left" | "top" | "bottom";
28
28
  tooltip?: TooltipProp;
29
29
  annotations?: Record<string, any>[];
30
+ /** Custom formatter for category tick labels */
31
+ categoryFormat?: CategoryFormatFn;
30
32
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
31
33
  }
32
34
  /**
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
3
  import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
4
- import type { BaseChartProps, ChartAccessor } from "../shared/types";
4
+ import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
5
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
6
  import type { RealtimeFrameHandle } from "../../realtime/types";
7
7
  export interface BoxPlotProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
@@ -25,6 +25,8 @@ export interface BoxPlotProps<TDatum extends Record<string, any> = Record<string
25
25
  legendPosition?: LegendPosition;
26
26
  tooltip?: TooltipProp;
27
27
  annotations?: Record<string, any>[];
28
+ /** Custom formatter for category tick labels */
29
+ categoryFormat?: CategoryFormatFn;
28
30
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
29
31
  }
30
32
  export declare const BoxPlot: {
@@ -13,7 +13,6 @@ export interface DonutChartProps<TDatum extends Record<string, any> = Record<str
13
13
  colorBy?: ChartAccessor<TDatum, string>;
14
14
  colorScheme?: string | string[];
15
15
  startAngle?: number;
16
- slicePadding?: number;
17
16
  enableHover?: boolean;
18
17
  showCategoryTicks?: boolean;
19
18
  showLegend?: boolean;
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
3
  import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
4
- import type { BaseChartProps, ChartAccessor } from "../shared/types";
4
+ import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
5
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
6
  import type { RealtimeFrameHandle } from "../../realtime/types";
7
7
  export interface DotPlotProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
@@ -25,6 +25,8 @@ export interface DotPlotProps<TDatum extends Record<string, any> = Record<string
25
25
  legendPosition?: LegendPosition;
26
26
  tooltip?: TooltipProp;
27
27
  annotations?: Record<string, any>[];
28
+ /** Custom formatter for category tick labels */
29
+ categoryFormat?: CategoryFormatFn;
28
30
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
29
31
  }
30
32
  export declare const DotPlot: {
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
3
  import type { LegendInteractionMode } from "../shared/hooks";
4
- import type { BaseChartProps, ChartAccessor } from "../shared/types";
4
+ import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
5
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
6
  import type { RealtimeFrameHandle } from "../../realtime/types";
7
7
  /**
@@ -37,6 +37,8 @@ export interface FunnelChartProps<TDatum extends Record<string, any> = Record<st
37
37
  legendPosition?: "right" | "left" | "top" | "bottom";
38
38
  tooltip?: TooltipProp;
39
39
  annotations?: Record<string, any>[];
40
+ /** Custom formatter for category tick labels */
41
+ categoryFormat?: CategoryFormatFn;
40
42
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
41
43
  }
42
44
  /**
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
3
  import type { LegendInteractionMode } from "../shared/hooks";
4
- import type { BaseChartProps, ChartAccessor } from "../shared/types";
4
+ import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
5
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
6
  import type { RealtimeFrameHandle } from "../../realtime/types";
7
7
  export interface GroupedBarChartProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
@@ -24,6 +24,8 @@ export interface GroupedBarChartProps<TDatum extends Record<string, any> = Recor
24
24
  legendPosition?: "right" | "left" | "top" | "bottom";
25
25
  tooltip?: TooltipProp;
26
26
  annotations?: Record<string, any>[];
27
+ /** Custom formatter for category tick labels */
28
+ categoryFormat?: CategoryFormatFn;
27
29
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
28
30
  }
29
31
  export declare const GroupedBarChart: {
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
- import type { LegendPosition } from "../shared/hooks";
4
- import type { BaseChartProps, ChartAccessor } from "../shared/types";
3
+ import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
4
+ import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
5
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
6
  import type { RealtimeFrameHandle } from "../../realtime/types";
7
7
  export interface HistogramProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
@@ -20,9 +20,23 @@ export interface HistogramProps<TDatum extends Record<string, any> = Record<stri
20
20
  showGrid?: boolean;
21
21
  showCategoryTicks?: boolean;
22
22
  showLegend?: boolean;
23
+ legendInteraction?: LegendInteractionMode;
23
24
  legendPosition?: LegendPosition;
24
25
  tooltip?: TooltipProp;
25
26
  annotations?: Record<string, any>[];
27
+ /** Enable brush on the value axis */
28
+ brush?: boolean;
29
+ /** Callback when brush selection changes */
30
+ onBrush?: (extent: {
31
+ r: [number, number];
32
+ } | null) => void;
33
+ /** LinkedCharts brush integration */
34
+ linkedBrush?: string | {
35
+ name: string;
36
+ rField?: string;
37
+ };
38
+ /** Custom formatter for category tick labels */
39
+ categoryFormat?: CategoryFormatFn;
26
40
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
27
41
  }
28
42
  export declare const Histogram: {