semiotic 3.4.1 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/CLAUDE.md +114 -9
  2. package/README.md +45 -4
  3. package/ai/behaviorContracts.cjs +311 -0
  4. package/ai/chartSuggestions.cjs +291 -0
  5. package/ai/cli.js +255 -30
  6. package/ai/componentMetadata.cjs +107 -0
  7. package/ai/dist/mcp-server.js +907 -227
  8. package/ai/schema.json +3954 -2537
  9. package/ai/system-prompt.md +23 -4
  10. package/dist/components/LinkedCharts.d.ts +5 -1
  11. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  12. package/dist/components/charts/custom/NetworkCustomChart.d.ts +64 -0
  13. package/dist/components/charts/custom/OrdinalCustomChart.d.ts +71 -0
  14. package/dist/components/charts/custom/XYCustomChart.d.ts +59 -0
  15. package/dist/components/charts/geo/ChoroplethMap.d.ts +93 -2
  16. package/dist/components/charts/geo/DistanceCartogram.d.ts +51 -4
  17. package/dist/components/charts/geo/FlowMap.d.ts +55 -0
  18. package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +53 -0
  19. package/dist/components/charts/index.d.ts +6 -0
  20. package/dist/components/charts/network/ChordDiagram.d.ts +34 -2
  21. package/dist/components/charts/network/CirclePack.d.ts +36 -1
  22. package/dist/components/charts/network/ForceDirectedGraph.d.ts +130 -2
  23. package/dist/components/charts/network/OrbitDiagram.d.ts +37 -0
  24. package/dist/components/charts/network/SankeyDiagram.d.ts +51 -2
  25. package/dist/components/charts/network/TreeDiagram.d.ts +37 -2
  26. package/dist/components/charts/network/Treemap.d.ts +36 -2
  27. package/dist/components/charts/ordinal/BarChart.d.ts +111 -1
  28. package/dist/components/charts/ordinal/BoxPlot.d.ts +31 -0
  29. package/dist/components/charts/ordinal/DonutChart.d.ts +36 -0
  30. package/dist/components/charts/ordinal/DotPlot.d.ts +31 -0
  31. package/dist/components/charts/ordinal/FunnelChart.d.ts +40 -0
  32. package/dist/components/charts/ordinal/GaugeChart.d.ts +45 -0
  33. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +38 -0
  34. package/dist/components/charts/ordinal/Histogram.d.ts +95 -0
  35. package/dist/components/charts/ordinal/LikertChart.d.ts +42 -0
  36. package/dist/components/charts/ordinal/PieChart.d.ts +90 -1
  37. package/dist/components/charts/ordinal/RidgelinePlot.d.ts +27 -0
  38. package/dist/components/charts/ordinal/StackedBarChart.d.ts +38 -0
  39. package/dist/components/charts/ordinal/SwarmPlot.d.ts +36 -0
  40. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +60 -0
  41. package/dist/components/charts/ordinal/ViolinPlot.d.ts +32 -0
  42. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +22 -4
  43. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +5 -2
  44. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +24 -3
  45. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +12 -0
  46. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +14 -0
  47. package/dist/components/charts/realtime/defaultRealtimeTooltip.d.ts +43 -0
  48. package/dist/components/charts/realtime/resolveWindowSize.d.ts +26 -0
  49. package/dist/components/charts/shared/chartSpecs.d.ts +91 -0
  50. package/dist/components/charts/shared/colorPalettes.d.ts +62 -0
  51. package/dist/components/charts/shared/colorUtils.d.ts +9 -10
  52. package/dist/components/charts/shared/numberFormat.d.ts +58 -0
  53. package/dist/components/charts/shared/sparseArray.d.ts +27 -0
  54. package/dist/components/charts/shared/streamPropsHelpers.d.ts +113 -0
  55. package/dist/components/charts/shared/timeFormat.d.ts +60 -0
  56. package/dist/components/charts/shared/useChartSetup.d.ts +8 -0
  57. package/dist/components/charts/shared/useCustomChartSetup.d.ts +84 -0
  58. package/dist/components/charts/shared/useFrameImperativeHandle.d.ts +28 -0
  59. package/dist/components/charts/shared/useOrdinalStreaming.d.ts +6 -19
  60. package/dist/components/charts/shared/useStreamingLegend.d.ts +27 -11
  61. package/dist/components/charts/shared/validateProps.d.ts +2 -2
  62. package/dist/components/charts/shared/validationMap.d.ts +2 -1
  63. package/dist/components/charts/shared/withChartWrapper.d.ts +13 -4
  64. package/dist/components/charts/xy/AreaChart.d.ts +30 -1
  65. package/dist/components/charts/xy/CandlestickChart.d.ts +33 -6
  66. package/dist/components/charts/xy/ConnectedScatterplot.d.ts +24 -0
  67. package/dist/components/charts/xy/MinimapChart.d.ts +51 -0
  68. package/dist/components/charts/xy/MultiAxisLineChart.d.ts +27 -0
  69. package/dist/components/charts/xy/QuadrantChart.d.ts +21 -0
  70. package/dist/components/charts/xy/Scatterplot.d.ts +34 -2
  71. package/dist/components/charts/xy/ScatterplotMatrix.d.ts +16 -0
  72. package/dist/components/charts/xy/StackedAreaChart.d.ts +49 -1
  73. package/dist/components/export/selectionSerializer.d.ts +1 -1
  74. package/dist/components/realtime/types.d.ts +7 -9
  75. package/dist/components/recipes/bullet.d.ts +86 -0
  76. package/dist/components/recipes/calendar.d.ts +43 -0
  77. package/dist/components/recipes/dagre.d.ts +56 -0
  78. package/dist/components/recipes/flextree.d.ts +55 -0
  79. package/dist/components/recipes/marimekko.d.ts +55 -0
  80. package/dist/components/recipes/parallelCoordinates.d.ts +97 -0
  81. package/dist/components/recipes/recipeUtils.d.ts +27 -0
  82. package/dist/components/recipes/waffle.d.ts +46 -0
  83. package/dist/components/semiotic-ai.d.ts +4 -0
  84. package/dist/components/semiotic-network.d.ts +3 -0
  85. package/dist/components/semiotic-ordinal.d.ts +3 -0
  86. package/dist/components/semiotic-recipes.d.ts +24 -0
  87. package/dist/components/semiotic-xy.d.ts +3 -0
  88. package/dist/components/semiotic.d.ts +2 -2
  89. package/dist/components/server/renderToStaticSVG.d.ts +8 -2
  90. package/dist/components/server/serverChartConfigs.d.ts +47 -1
  91. package/dist/components/server/staticAnnotations.d.ts +6 -0
  92. package/dist/components/store/ObservationStore.d.ts +1 -3
  93. package/dist/components/store/SelectionStore.d.ts +2 -4
  94. package/dist/components/store/ThemeStore.d.ts +4 -4
  95. package/dist/components/store/TooltipStore.d.ts +5 -3
  96. package/dist/components/store/createStore.d.ts +4 -2
  97. package/dist/components/store/useSelection.d.ts +7 -4
  98. package/dist/components/stream/CanvasHitTester.d.ts +10 -8
  99. package/dist/components/stream/DataSourceAdapter.d.ts +9 -0
  100. package/dist/components/stream/GeoPipelineStore.d.ts +9 -0
  101. package/dist/components/stream/GeoTileRenderer.d.ts +14 -0
  102. package/dist/components/stream/NetworkPipelineStore.d.ts +25 -0
  103. package/dist/components/stream/NetworkSVGOverlay.d.ts +18 -12
  104. package/dist/components/stream/OrdinalPipelineStore.d.ts +12 -0
  105. package/dist/components/stream/PipelineStore.d.ts +51 -0
  106. package/dist/components/stream/SVGOverlay.d.ts +12 -0
  107. package/dist/components/stream/SceneGraph.d.ts +15 -1
  108. package/dist/components/stream/SceneToSVG.d.ts +1 -1
  109. package/dist/components/stream/categoryDomain.d.ts +4 -0
  110. package/dist/components/stream/composeOverlays.d.ts +15 -0
  111. package/dist/components/stream/customLayout.d.ts +76 -0
  112. package/dist/components/stream/customLayoutPalette.d.ts +29 -0
  113. package/dist/components/stream/geoTypes.d.ts +33 -8
  114. package/dist/components/stream/hoverUtils.d.ts +4 -10
  115. package/dist/components/stream/keyboardNav.d.ts +18 -6
  116. package/dist/components/stream/networkCustomLayout.d.ts +67 -0
  117. package/dist/components/stream/networkTypes.d.ts +87 -21
  118. package/dist/components/stream/ordinalCustomLayout.d.ts +84 -0
  119. package/dist/components/stream/ordinalTypes.d.ts +47 -13
  120. package/dist/components/stream/renderers/barFunnelCanvasRenderer.d.ts +9 -1
  121. package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +92 -0
  122. package/dist/components/stream/sampleCurvePath.d.ts +9 -0
  123. package/dist/components/stream/types.d.ts +57 -10
  124. package/dist/components/stream/useHydration.d.ts +89 -0
  125. package/dist/components/stream/useStableShallow.d.ts +1 -0
  126. package/dist/components/stream/xySceneBuilders/types.d.ts +4 -0
  127. package/dist/geo.min.js +2 -1
  128. package/dist/geo.module.min.js +2 -1
  129. package/dist/network.min.js +2 -1
  130. package/dist/network.module.min.js +2 -1
  131. package/dist/ordinal.min.js +2 -1
  132. package/dist/ordinal.module.min.js +2 -1
  133. package/dist/realtime.min.js +2 -1
  134. package/dist/realtime.module.min.js +2 -1
  135. package/dist/semiotic-ai.d.ts +69 -65
  136. package/dist/semiotic-ai.min.js +2 -1
  137. package/dist/semiotic-ai.module.min.js +2 -1
  138. package/dist/semiotic-data.d.ts +4 -4
  139. package/dist/semiotic-geo.d.ts +15 -15
  140. package/dist/semiotic-network.d.ts +19 -16
  141. package/dist/semiotic-ordinal.d.ts +31 -28
  142. package/dist/semiotic-realtime.d.ts +17 -17
  143. package/dist/semiotic-recipes.d.ts +24 -0
  144. package/dist/semiotic-recipes.min.js +1 -0
  145. package/dist/semiotic-recipes.module.min.js +1 -0
  146. package/dist/semiotic-server.d.ts +6 -6
  147. package/dist/semiotic-statisticalOverlays-C3DsOgr_.js +1 -0
  148. package/dist/semiotic-themes.d.ts +3 -3
  149. package/dist/semiotic-themes.min.js +2 -1
  150. package/dist/semiotic-themes.module.min.js +2 -1
  151. package/dist/semiotic-utils.d.ts +23 -23
  152. package/dist/semiotic-utils.min.js +2 -1
  153. package/dist/semiotic-utils.module.min.js +2 -1
  154. package/dist/semiotic-xy.d.ts +27 -24
  155. package/dist/semiotic.d.ts +63 -63
  156. package/dist/semiotic.min.js +2 -1
  157. package/dist/semiotic.module.min.js +2 -1
  158. package/dist/server.min.js +1 -1
  159. package/dist/server.module.min.js +1 -1
  160. package/dist/test-utils/canvasMock.d.ts +34 -5
  161. package/dist/xy.min.js +2 -1
  162. package/dist/xy.module.min.js +2 -1
  163. package/package.json +40 -20
  164. package/dist/semiotic-statisticalOverlays-Ckd_jM8z.js +0 -1
@@ -0,0 +1,107 @@
1
+ "use strict"
2
+
3
+ const CATEGORY_ORDER = ["xy", "ordinal", "network", "geo", "realtime"]
4
+
5
+ const COMPONENTS_BY_CATEGORY = {
6
+ xy: [
7
+ "LineChart", "AreaChart", "StackedAreaChart", "Scatterplot", "QuadrantChart",
8
+ "MultiAxisLineChart", "CandlestickChart", "BubbleChart", "Heatmap",
9
+ "ConnectedScatterplot", "ScatterplotMatrix", "MinimapChart",
10
+ ],
11
+ ordinal: [
12
+ "BarChart", "StackedBarChart", "LikertChart", "GroupedBarChart", "SwarmPlot",
13
+ "BoxPlot", "Histogram", "ViolinPlot", "RidgelinePlot", "DotPlot", "PieChart",
14
+ "DonutChart", "GaugeChart", "FunnelChart", "SwimlaneChart",
15
+ ],
16
+ network: [
17
+ "ForceDirectedGraph", "SankeyDiagram", "ChordDiagram", "TreeDiagram",
18
+ "Treemap", "CirclePack", "OrbitDiagram",
19
+ ],
20
+ geo: [
21
+ "ChoroplethMap", "ProportionalSymbolMap", "FlowMap", "DistanceCartogram",
22
+ ],
23
+ realtime: [
24
+ "RealtimeLineChart", "RealtimeHistogram", "RealtimeSwarmChart",
25
+ "RealtimeWaterfallChart", "RealtimeHeatmap",
26
+ ],
27
+ }
28
+
29
+ const COMPONENT_TO_CATEGORY = new Map()
30
+ for (const [category, names] of Object.entries(COMPONENTS_BY_CATEGORY)) {
31
+ for (const name of names) {
32
+ COMPONENT_TO_CATEGORY.set(name, category)
33
+ }
34
+ }
35
+
36
+ function schemaEntries(schema) {
37
+ return schema.tools.map((tool) => tool.function)
38
+ }
39
+
40
+ function categoryForComponent(name) {
41
+ const category = COMPONENT_TO_CATEGORY.get(name)
42
+ if (!category) {
43
+ throw new Error(`No AI component metadata category for "${name}"`)
44
+ }
45
+ return category
46
+ }
47
+
48
+ function importPathForCategory(category) {
49
+ return category === "geo" ? "semiotic/geo" : `semiotic/${category}`
50
+ }
51
+
52
+ function metadataForComponent(entryOrName) {
53
+ const name = typeof entryOrName === "string" ? entryOrName : entryOrName.name
54
+ const category = categoryForComponent(name)
55
+ return {
56
+ name,
57
+ category,
58
+ importPath: importPathForCategory(category),
59
+ renderable: category !== "realtime",
60
+ description: typeof entryOrName === "string" ? undefined : entryOrName.description,
61
+ }
62
+ }
63
+
64
+ function findComponent(schema, name) {
65
+ const entries = schemaEntries(schema)
66
+ const exact = entries.find((entry) => entry.name === name)
67
+ if (exact) return exact
68
+
69
+ const lower = name.toLowerCase()
70
+ return entries.find((entry) => entry.name.toLowerCase() === lower)
71
+ }
72
+
73
+ function componentIndexFromSchema(schema) {
74
+ const components = schemaEntries(schema).map(metadataForComponent)
75
+ const categories = {}
76
+ for (const category of CATEGORY_ORDER) {
77
+ categories[category] = []
78
+ }
79
+
80
+ for (const component of components) {
81
+ categories[component.category].push(component.name)
82
+ }
83
+
84
+ for (const names of Object.values(categories)) {
85
+ names.sort()
86
+ }
87
+
88
+ return {
89
+ version: schema.version,
90
+ totalComponents: components.length,
91
+ renderableComponents: components.filter((component) => component.renderable).length,
92
+ browserOnlyComponents: components.filter((component) => !component.renderable).length,
93
+ categories,
94
+ components,
95
+ }
96
+ }
97
+
98
+ module.exports = {
99
+ CATEGORY_ORDER,
100
+ COMPONENTS_BY_CATEGORY,
101
+ categoryForComponent,
102
+ componentIndexFromSchema,
103
+ findComponent,
104
+ importPathForCategory,
105
+ metadataForComponent,
106
+ schemaEntries,
107
+ }