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.
- package/CLAUDE.md +114 -9
- package/README.md +45 -4
- package/ai/behaviorContracts.cjs +311 -0
- package/ai/chartSuggestions.cjs +291 -0
- package/ai/cli.js +255 -30
- package/ai/componentMetadata.cjs +107 -0
- package/ai/dist/mcp-server.js +907 -227
- package/ai/schema.json +3954 -2537
- package/ai/system-prompt.md +23 -4
- package/dist/components/LinkedCharts.d.ts +5 -1
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/charts/custom/NetworkCustomChart.d.ts +64 -0
- package/dist/components/charts/custom/OrdinalCustomChart.d.ts +71 -0
- package/dist/components/charts/custom/XYCustomChart.d.ts +59 -0
- package/dist/components/charts/geo/ChoroplethMap.d.ts +93 -2
- package/dist/components/charts/geo/DistanceCartogram.d.ts +51 -4
- package/dist/components/charts/geo/FlowMap.d.ts +55 -0
- package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +53 -0
- package/dist/components/charts/index.d.ts +6 -0
- package/dist/components/charts/network/ChordDiagram.d.ts +34 -2
- package/dist/components/charts/network/CirclePack.d.ts +36 -1
- package/dist/components/charts/network/ForceDirectedGraph.d.ts +130 -2
- package/dist/components/charts/network/OrbitDiagram.d.ts +37 -0
- package/dist/components/charts/network/SankeyDiagram.d.ts +51 -2
- package/dist/components/charts/network/TreeDiagram.d.ts +37 -2
- package/dist/components/charts/network/Treemap.d.ts +36 -2
- package/dist/components/charts/ordinal/BarChart.d.ts +111 -1
- package/dist/components/charts/ordinal/BoxPlot.d.ts +31 -0
- package/dist/components/charts/ordinal/DonutChart.d.ts +36 -0
- package/dist/components/charts/ordinal/DotPlot.d.ts +31 -0
- package/dist/components/charts/ordinal/FunnelChart.d.ts +40 -0
- package/dist/components/charts/ordinal/GaugeChart.d.ts +45 -0
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +38 -0
- package/dist/components/charts/ordinal/Histogram.d.ts +95 -0
- package/dist/components/charts/ordinal/LikertChart.d.ts +42 -0
- package/dist/components/charts/ordinal/PieChart.d.ts +90 -1
- package/dist/components/charts/ordinal/RidgelinePlot.d.ts +27 -0
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +38 -0
- package/dist/components/charts/ordinal/SwarmPlot.d.ts +36 -0
- package/dist/components/charts/ordinal/SwimlaneChart.d.ts +60 -0
- package/dist/components/charts/ordinal/ViolinPlot.d.ts +32 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +22 -4
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +5 -2
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +24 -3
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +12 -0
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +14 -0
- package/dist/components/charts/realtime/defaultRealtimeTooltip.d.ts +43 -0
- package/dist/components/charts/realtime/resolveWindowSize.d.ts +26 -0
- package/dist/components/charts/shared/chartSpecs.d.ts +91 -0
- package/dist/components/charts/shared/colorPalettes.d.ts +62 -0
- package/dist/components/charts/shared/colorUtils.d.ts +9 -10
- package/dist/components/charts/shared/numberFormat.d.ts +58 -0
- package/dist/components/charts/shared/sparseArray.d.ts +27 -0
- package/dist/components/charts/shared/streamPropsHelpers.d.ts +113 -0
- package/dist/components/charts/shared/timeFormat.d.ts +60 -0
- package/dist/components/charts/shared/useChartSetup.d.ts +8 -0
- package/dist/components/charts/shared/useCustomChartSetup.d.ts +84 -0
- package/dist/components/charts/shared/useFrameImperativeHandle.d.ts +28 -0
- package/dist/components/charts/shared/useOrdinalStreaming.d.ts +6 -19
- package/dist/components/charts/shared/useStreamingLegend.d.ts +27 -11
- package/dist/components/charts/shared/validateProps.d.ts +2 -2
- package/dist/components/charts/shared/validationMap.d.ts +2 -1
- package/dist/components/charts/shared/withChartWrapper.d.ts +13 -4
- package/dist/components/charts/xy/AreaChart.d.ts +30 -1
- package/dist/components/charts/xy/CandlestickChart.d.ts +33 -6
- package/dist/components/charts/xy/ConnectedScatterplot.d.ts +24 -0
- package/dist/components/charts/xy/MinimapChart.d.ts +51 -0
- package/dist/components/charts/xy/MultiAxisLineChart.d.ts +27 -0
- package/dist/components/charts/xy/QuadrantChart.d.ts +21 -0
- package/dist/components/charts/xy/Scatterplot.d.ts +34 -2
- package/dist/components/charts/xy/ScatterplotMatrix.d.ts +16 -0
- package/dist/components/charts/xy/StackedAreaChart.d.ts +49 -1
- package/dist/components/export/selectionSerializer.d.ts +1 -1
- package/dist/components/realtime/types.d.ts +7 -9
- package/dist/components/recipes/bullet.d.ts +86 -0
- package/dist/components/recipes/calendar.d.ts +43 -0
- package/dist/components/recipes/dagre.d.ts +56 -0
- package/dist/components/recipes/flextree.d.ts +55 -0
- package/dist/components/recipes/marimekko.d.ts +55 -0
- package/dist/components/recipes/parallelCoordinates.d.ts +97 -0
- package/dist/components/recipes/recipeUtils.d.ts +27 -0
- package/dist/components/recipes/waffle.d.ts +46 -0
- package/dist/components/semiotic-ai.d.ts +4 -0
- package/dist/components/semiotic-network.d.ts +3 -0
- package/dist/components/semiotic-ordinal.d.ts +3 -0
- package/dist/components/semiotic-recipes.d.ts +24 -0
- package/dist/components/semiotic-xy.d.ts +3 -0
- package/dist/components/semiotic.d.ts +2 -2
- package/dist/components/server/renderToStaticSVG.d.ts +8 -2
- package/dist/components/server/serverChartConfigs.d.ts +47 -1
- package/dist/components/server/staticAnnotations.d.ts +6 -0
- package/dist/components/store/ObservationStore.d.ts +1 -3
- package/dist/components/store/SelectionStore.d.ts +2 -4
- package/dist/components/store/ThemeStore.d.ts +4 -4
- package/dist/components/store/TooltipStore.d.ts +5 -3
- package/dist/components/store/createStore.d.ts +4 -2
- package/dist/components/store/useSelection.d.ts +7 -4
- package/dist/components/stream/CanvasHitTester.d.ts +10 -8
- package/dist/components/stream/DataSourceAdapter.d.ts +9 -0
- package/dist/components/stream/GeoPipelineStore.d.ts +9 -0
- package/dist/components/stream/GeoTileRenderer.d.ts +14 -0
- package/dist/components/stream/NetworkPipelineStore.d.ts +25 -0
- package/dist/components/stream/NetworkSVGOverlay.d.ts +18 -12
- package/dist/components/stream/OrdinalPipelineStore.d.ts +12 -0
- package/dist/components/stream/PipelineStore.d.ts +51 -0
- package/dist/components/stream/SVGOverlay.d.ts +12 -0
- package/dist/components/stream/SceneGraph.d.ts +15 -1
- package/dist/components/stream/SceneToSVG.d.ts +1 -1
- package/dist/components/stream/categoryDomain.d.ts +4 -0
- package/dist/components/stream/composeOverlays.d.ts +15 -0
- package/dist/components/stream/customLayout.d.ts +76 -0
- package/dist/components/stream/customLayoutPalette.d.ts +29 -0
- package/dist/components/stream/geoTypes.d.ts +33 -8
- package/dist/components/stream/hoverUtils.d.ts +4 -10
- package/dist/components/stream/keyboardNav.d.ts +18 -6
- package/dist/components/stream/networkCustomLayout.d.ts +67 -0
- package/dist/components/stream/networkTypes.d.ts +87 -21
- package/dist/components/stream/ordinalCustomLayout.d.ts +84 -0
- package/dist/components/stream/ordinalTypes.d.ts +47 -13
- package/dist/components/stream/renderers/barFunnelCanvasRenderer.d.ts +9 -1
- package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +92 -0
- package/dist/components/stream/sampleCurvePath.d.ts +9 -0
- package/dist/components/stream/types.d.ts +57 -10
- package/dist/components/stream/useHydration.d.ts +89 -0
- package/dist/components/stream/useStableShallow.d.ts +1 -0
- package/dist/components/stream/xySceneBuilders/types.d.ts +4 -0
- package/dist/geo.min.js +2 -1
- package/dist/geo.module.min.js +2 -1
- package/dist/network.min.js +2 -1
- package/dist/network.module.min.js +2 -1
- package/dist/ordinal.min.js +2 -1
- package/dist/ordinal.module.min.js +2 -1
- package/dist/realtime.min.js +2 -1
- package/dist/realtime.module.min.js +2 -1
- package/dist/semiotic-ai.d.ts +69 -65
- package/dist/semiotic-ai.min.js +2 -1
- package/dist/semiotic-ai.module.min.js +2 -1
- package/dist/semiotic-data.d.ts +4 -4
- package/dist/semiotic-geo.d.ts +15 -15
- package/dist/semiotic-network.d.ts +19 -16
- package/dist/semiotic-ordinal.d.ts +31 -28
- package/dist/semiotic-realtime.d.ts +17 -17
- package/dist/semiotic-recipes.d.ts +24 -0
- package/dist/semiotic-recipes.min.js +1 -0
- package/dist/semiotic-recipes.module.min.js +1 -0
- package/dist/semiotic-server.d.ts +6 -6
- package/dist/semiotic-statisticalOverlays-C3DsOgr_.js +1 -0
- package/dist/semiotic-themes.d.ts +3 -3
- package/dist/semiotic-themes.min.js +2 -1
- package/dist/semiotic-themes.module.min.js +2 -1
- package/dist/semiotic-utils.d.ts +23 -23
- package/dist/semiotic-utils.min.js +2 -1
- package/dist/semiotic-utils.module.min.js +2 -1
- package/dist/semiotic-xy.d.ts +27 -24
- package/dist/semiotic.d.ts +63 -63
- package/dist/semiotic.min.js +2 -1
- package/dist/semiotic.module.min.js +2 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/test-utils/canvasMock.d.ts +34 -5
- package/dist/xy.min.js +2 -1
- package/dist/xy.module.min.js +2 -1
- package/package.json +40 -20
- 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
|
+
}
|