semiotic 3.0.0 → 3.1.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 +242 -29
- package/README.md +101 -66
- package/ai/cli.js +34 -21
- package/ai/dist/componentRegistry.js +2 -0
- package/ai/dist/mcp-server.js +54 -0
- package/ai/examples.md +433 -18
- package/ai/schema.json +134 -1
- package/ai/system-prompt.md +51 -10
- package/dist/{ChartGrid.d.ts → components/ChartGrid.d.ts} +9 -7
- package/dist/components/Legend.d.ts +9 -0
- package/dist/{LinkedCharts.d.ts → components/LinkedCharts.d.ts} +34 -1
- package/dist/{Tooltip → components/Tooltip}/Tooltip.d.ts +9 -2
- package/dist/components/charts/geo/ChoroplethMap.d.ts +53 -0
- package/dist/components/charts/geo/DistanceCartogram.d.ts +90 -0
- package/dist/components/charts/geo/FlowMap.d.ts +83 -0
- package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +67 -0
- package/dist/components/charts/geo/index.d.ts +8 -0
- package/dist/{charts → components/charts}/index.d.ts +4 -0
- package/dist/{charts → components/charts}/network/ChordDiagram.d.ts +8 -5
- package/dist/{charts → components/charts}/network/CirclePack.d.ts +4 -2
- package/dist/{charts → components/charts}/network/ForceDirectedGraph.d.ts +10 -6
- package/dist/components/charts/network/OrbitDiagram.d.ts +79 -0
- package/dist/{charts → components/charts}/network/SankeyDiagram.d.ts +8 -5
- package/dist/{charts → components/charts}/network/TreeDiagram.d.ts +4 -2
- package/dist/{charts → components/charts}/network/Treemap.d.ts +4 -2
- package/dist/{charts → components/charts}/ordinal/BarChart.d.ts +9 -5
- package/dist/{charts → components/charts}/ordinal/BoxPlot.d.ts +9 -5
- package/dist/{charts → components/charts}/ordinal/DonutChart.d.ts +9 -5
- package/dist/{charts → components/charts}/ordinal/DotPlot.d.ts +9 -5
- package/dist/{charts → components/charts}/ordinal/GroupedBarChart.d.ts +9 -5
- package/dist/{charts → components/charts}/ordinal/Histogram.d.ts +8 -5
- package/dist/{charts → components/charts}/ordinal/PieChart.d.ts +9 -5
- package/dist/{charts → components/charts}/ordinal/RidgelinePlot.d.ts +2 -0
- package/dist/{charts → components/charts}/ordinal/StackedBarChart.d.ts +9 -5
- package/dist/{charts → components/charts}/ordinal/SwarmPlot.d.ts +9 -5
- package/dist/{charts → components/charts}/ordinal/ViolinPlot.d.ts +8 -5
- package/dist/{charts → components/charts}/realtime/RealtimeHeatmap.d.ts +24 -6
- package/dist/{charts → components/charts}/realtime/RealtimeHistogram.d.ts +28 -7
- package/dist/{charts → components/charts}/realtime/RealtimeLineChart.d.ts +23 -5
- package/dist/{charts → components/charts}/realtime/RealtimeSwarmChart.d.ts +24 -6
- package/dist/{charts → components/charts}/realtime/RealtimeWaterfallChart.d.ts +23 -5
- package/dist/{charts → components/charts}/shared/colorUtils.d.ts +5 -0
- package/dist/components/charts/shared/diagnoseConfig.d.ts +23 -0
- package/dist/{charts → components/charts}/shared/hooks.d.ts +36 -2
- package/dist/{charts → components/charts}/shared/legendUtils.d.ts +2 -3
- package/dist/{charts → components/charts}/shared/statisticalOverlays.d.ts +1 -2
- package/dist/components/charts/shared/statisticalOverlaysLazy.d.ts +10 -0
- package/dist/components/charts/shared/stringDistance.d.ts +11 -0
- package/dist/{charts → components/charts}/shared/tooltipUtils.d.ts +2 -2
- package/dist/{charts → components/charts}/shared/types.d.ts +16 -4
- package/dist/components/charts/shared/useChartSetup.d.ts +112 -0
- package/dist/components/charts/shared/useStreamingLegend.d.ts +65 -0
- package/dist/{charts → components/charts}/shared/withChartWrapper.d.ts +10 -0
- package/dist/{charts → components/charts}/xy/AreaChart.d.ts +18 -5
- package/dist/{charts → components/charts}/xy/BubbleChart.d.ts +18 -5
- package/dist/{charts → components/charts}/xy/ConnectedScatterplot.d.ts +10 -6
- package/dist/{charts → components/charts}/xy/Heatmap.d.ts +24 -5
- package/dist/{charts → components/charts}/xy/LineChart.d.ts +47 -5
- package/dist/{charts → components/charts}/xy/MinimapChart.d.ts +3 -0
- package/dist/components/charts/xy/QuadrantChart.d.ts +120 -0
- package/dist/{charts → components/charts}/xy/Scatterplot.d.ts +11 -5
- package/dist/{charts → components/charts}/xy/StackedAreaChart.d.ts +18 -5
- package/dist/{export → components/export}/exportChart.d.ts +6 -1
- package/dist/components/geo/mergeData.d.ts +18 -0
- package/dist/components/geo/referenceGeography.d.ts +10 -0
- package/dist/components/geo/useReferenceAreas.d.ts +13 -0
- package/dist/{realtime → components/realtime}/RingBuffer.d.ts +1 -0
- package/dist/{realtime → components/realtime}/types.d.ts +17 -0
- package/dist/components/semiotic-ai.d.ts +61 -0
- package/dist/components/semiotic-data.d.ts +8 -0
- package/dist/components/semiotic-geo.d.ts +16 -0
- package/dist/components/semiotic-network.d.ts +14 -0
- package/dist/components/semiotic-ordinal.d.ts +18 -0
- package/dist/components/semiotic-realtime.d.ts +22 -0
- package/dist/components/semiotic-server.d.ts +1 -0
- package/dist/components/semiotic-xy.d.ts +17 -0
- package/dist/components/semiotic.d.ts +57 -0
- package/dist/{server → components/server}/renderToStaticSVG.d.ts +11 -2
- package/dist/components/stream/AccessibleDataTable.d.ts +50 -0
- package/dist/{stream → components/stream}/CanvasHitTester.d.ts +8 -2
- package/dist/components/stream/DataSourceAdapter.d.ts +64 -0
- package/dist/components/stream/GeoCanvasHitTester.d.ts +19 -0
- package/dist/components/stream/GeoParticlePool.d.ts +46 -0
- package/dist/components/stream/GeoPipelineStore.d.ts +81 -0
- package/dist/components/stream/GeoTileRenderer.d.ts +31 -0
- package/dist/{stream → components/stream}/NetworkPipelineStore.d.ts +16 -4
- package/dist/{stream → components/stream}/NetworkSVGOverlay.d.ts +24 -1
- package/dist/{stream → components/stream}/OrdinalPipelineStore.d.ts +8 -4
- package/dist/{stream → components/stream}/OrdinalSVGOverlay.d.ts +31 -1
- package/dist/{stream → components/stream}/PipelineStore.d.ts +64 -5
- package/dist/components/stream/SVGOverlay.d.ts +98 -0
- package/dist/{stream → components/stream}/SceneGraph.d.ts +7 -3
- package/dist/components/stream/SceneToSVG.d.ts +22 -0
- package/dist/components/stream/StreamGeoFrame.d.ts +4 -0
- package/dist/{stream → components/stream}/accessorUtils.d.ts +1 -0
- package/dist/components/stream/canvasSetup.d.ts +26 -0
- package/dist/components/stream/geoTypes.d.ts +186 -0
- package/dist/components/stream/hitTestUtils.d.ts +23 -0
- package/dist/components/stream/layouts/forceLayoutPlugin.d.ts +2 -0
- package/dist/{stream → components/stream}/layouts/index.d.ts +2 -1
- package/dist/components/stream/layouts/orbitLayoutPlugin.d.ts +2 -0
- package/dist/components/stream/legendRenderer.d.ts +33 -0
- package/dist/{stream → components/stream}/networkTypes.d.ts +59 -3
- package/dist/{stream → components/stream}/ordinalTypes.d.ts +26 -10
- package/dist/components/stream/pipelineTransitionUtils.d.ts +42 -0
- package/dist/components/stream/renderers/areaCanvasRenderer.d.ts +2 -0
- package/dist/components/stream/renderers/geoCanvasRenderer.d.ts +9 -0
- package/dist/{stream → components/stream}/renderers/heatmapCanvasRenderer.d.ts +2 -1
- package/dist/{stream → components/stream}/renderers/lineCanvasRenderer.d.ts +1 -0
- package/dist/components/stream/renderers/renderPulse.d.ts +50 -0
- package/dist/{stream → components/stream}/types.d.ts +89 -3
- package/dist/components/stream/useStalenessCheck.d.ts +16 -0
- package/dist/components/types/legendTypes.d.ts +49 -0
- package/dist/geo.min.js +1 -0
- package/dist/geo.module.min.js +1 -0
- package/dist/network.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +3 -0
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-data.d.ts +1 -0
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-geo.d.ts +16 -0
- package/dist/semiotic-network.d.ts +1 -0
- package/dist/semiotic-ordinal.d.ts +1 -0
- package/dist/semiotic-server.d.ts +1 -1
- package/dist/semiotic-xy.d.ts +1 -0
- package/dist/semiotic.d.ts +4 -4
- package/dist/semiotic.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/test-utils/canvasMock.d.ts +23 -0
- package/dist/test-utils/frameMock.d.ts +78 -0
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +34 -20
- package/dist/Legend.d.ts +0 -3
- package/dist/stream/DataSourceAdapter.d.ts +0 -35
- package/dist/stream/SVGOverlay.d.ts +0 -56
- package/dist/stream/layouts/forceLayoutPlugin.d.ts +0 -9
- package/dist/stream/renderers/areaCanvasRenderer.d.ts +0 -7
- package/dist/types/legendTypes.d.ts +0 -20
- /package/dist/{Annotation.d.ts → components/Annotation.d.ts} +0 -0
- /package/dist/{CategoryColors.d.ts → components/CategoryColors.d.ts} +0 -0
- /package/dist/{ChartContainer.d.ts → components/ChartContainer.d.ts} +0 -0
- /package/dist/{ChartErrorBoundary.d.ts → components/ChartErrorBoundary.d.ts} +0 -0
- /package/dist/{ContextLayout.d.ts → components/ContextLayout.d.ts} +0 -0
- /package/dist/{DetailsPanel.d.ts → components/DetailsPanel.d.ts} +0 -0
- /package/dist/{ThemeProvider.d.ts → components/ThemeProvider.d.ts} +0 -0
- /package/dist/{charts → components/charts}/shared/ChartError.d.ts +0 -0
- /package/dist/{charts → components/charts}/shared/annotationRules.d.ts +0 -0
- /package/dist/{charts → components/charts}/shared/formatUtils.d.ts +0 -0
- /package/dist/{charts → components/charts}/shared/loess.d.ts +0 -0
- /package/dist/{charts → components/charts}/shared/networkUtils.d.ts +0 -0
- /package/dist/{charts → components/charts}/shared/selectionUtils.d.ts +0 -0
- /package/dist/{charts → components/charts}/shared/validateChartData.d.ts +0 -0
- /package/dist/{charts → components/charts}/shared/validateProps.d.ts +0 -0
- /package/dist/{charts → components/charts}/xy/ScatterplotMatrix.d.ts +0 -0
- /package/dist/{data → components/data}/fromVegaLite.d.ts +0 -0
- /package/dist/{data → components/data}/transforms.d.ts +0 -0
- /package/dist/{export → components/export}/chartConfig.d.ts +0 -0
- /package/dist/{export → components/export}/selectionSerializer.d.ts +0 -0
- /package/dist/{geometry → components/geometry}/sankeyLinks.d.ts +0 -0
- /package/dist/{realtime → components/realtime}/BinAccumulator.d.ts +0 -0
- /package/dist/{realtime → components/realtime}/IncrementalExtent.d.ts +0 -0
- /package/dist/{realtime → components/realtime}/renderers/types.d.ts +0 -0
- /package/dist/{realtime → components/realtime}/renderers/waterfallRenderer.d.ts +0 -0
- /package/dist/{store → components/store}/ObservationStore.d.ts +0 -0
- /package/dist/{store → components/store}/SelectionStore.d.ts +0 -0
- /package/dist/{store → components/store}/ThemeStore.d.ts +0 -0
- /package/dist/{store → components/store}/TooltipStore.d.ts +0 -0
- /package/dist/{store → components/store}/createStore.d.ts +0 -0
- /package/dist/{store → components/store}/useObservation.d.ts +0 -0
- /package/dist/{store → components/store}/useSelection.d.ts +0 -0
- /package/dist/{stream → components/stream}/MarginalGraphics.d.ts +0 -0
- /package/dist/{stream → components/stream}/NetworkCanvasHitTester.d.ts +0 -0
- /package/dist/{stream → components/stream}/OrdinalCanvasHitTester.d.ts +0 -0
- /package/dist/{stream → components/stream}/ParticlePool.d.ts +0 -0
- /package/dist/{stream → components/stream}/StreamNetworkFrame.d.ts +0 -0
- /package/dist/{stream → components/stream}/StreamOrdinalFrame.d.ts +0 -0
- /package/dist/{stream → components/stream}/StreamXYFrame.d.ts +0 -0
- /package/dist/{stream → components/stream}/keyboardNav.d.ts +0 -0
- /package/dist/{stream → components/stream}/layouts/chordLayoutPlugin.d.ts +0 -0
- /package/dist/{stream → components/stream}/layouts/hierarchyLayoutPlugin.d.ts +0 -0
- /package/dist/{stream → components/stream}/layouts/sankeyLayoutPlugin.d.ts +0 -0
- /package/dist/{stream → components/stream}/ordinalSceneBuilders/barScene.d.ts +0 -0
- /package/dist/{stream → components/stream}/ordinalSceneBuilders/connectorScene.d.ts +0 -0
- /package/dist/{stream → components/stream}/ordinalSceneBuilders/pieScene.d.ts +0 -0
- /package/dist/{stream → components/stream}/ordinalSceneBuilders/pointScene.d.ts +0 -0
- /package/dist/{stream → components/stream}/ordinalSceneBuilders/statisticalScene.d.ts +0 -0
- /package/dist/{stream → components/stream}/ordinalSceneBuilders/timelineScene.d.ts +0 -0
- /package/dist/{stream → components/stream}/ordinalSceneBuilders/types.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/barCanvasRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/boxplotCanvasRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/candlestickCanvasRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/connectorCanvasRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/networkArcRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/networkCircleRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/networkEdgeRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/networkParticleRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/networkRectRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/pointCanvasRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/swarmCanvasRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/types.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/violinCanvasRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/waterfallCanvasRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/wedgeCanvasRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/useResponsiveSize.d.ts +0 -0
- /package/dist/{types → components/types}/annotationTypes.d.ts +0 -0
- /package/dist/{types → components/types}/generalTypes.d.ts +0 -0
- /package/dist/{types → components/types}/interactionTypes.d.ts +0 -0
- /package/dist/{types → components/types}/networkTypes.d.ts +0 -0
- /package/dist/{types → components/types}/ordinalTypes.d.ts +0 -0
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.
|
|
4
|
+
"version": "3.1.0",
|
|
5
5
|
"description": "React data visualization library for charts, networks, and beyond",
|
|
6
6
|
"tools": [
|
|
7
7
|
{
|
|
@@ -294,6 +294,57 @@
|
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
},
|
|
297
|
+
{
|
|
298
|
+
"type": "function",
|
|
299
|
+
"function": {
|
|
300
|
+
"name": "QuadrantChart",
|
|
301
|
+
"description": "Scatterplot divided into four labeled, colored quadrants by center lines. Use for BCG matrices, priority matrices, and any 2x2 strategic framework.",
|
|
302
|
+
"parameters": {
|
|
303
|
+
"type": "object",
|
|
304
|
+
"properties": {
|
|
305
|
+
"data": {
|
|
306
|
+
"type": "array",
|
|
307
|
+
"items": { "type": "object" },
|
|
308
|
+
"description": "Array of data objects"
|
|
309
|
+
},
|
|
310
|
+
"xAccessor": { "type": "string", "default": "x" },
|
|
311
|
+
"yAccessor": { "type": "string", "default": "y" },
|
|
312
|
+
"xCenter": { "type": "number", "description": "X-coordinate of the vertical center line. Defaults to midpoint of x domain." },
|
|
313
|
+
"yCenter": { "type": "number", "description": "Y-coordinate of the horizontal center line. Defaults to midpoint of y domain." },
|
|
314
|
+
"quadrants": {
|
|
315
|
+
"type": "object",
|
|
316
|
+
"description": "Configuration for the four quadrants: { topRight, topLeft, bottomRight, bottomLeft }, each with { label, color, opacity? }",
|
|
317
|
+
"properties": {
|
|
318
|
+
"topRight": { "type": "object", "properties": { "label": { "type": "string" }, "color": { "type": "string" }, "opacity": { "type": "number" } }, "required": ["label", "color"] },
|
|
319
|
+
"topLeft": { "type": "object", "properties": { "label": { "type": "string" }, "color": { "type": "string" }, "opacity": { "type": "number" } }, "required": ["label", "color"] },
|
|
320
|
+
"bottomRight": { "type": "object", "properties": { "label": { "type": "string" }, "color": { "type": "string" }, "opacity": { "type": "number" } }, "required": ["label", "color"] },
|
|
321
|
+
"bottomLeft": { "type": "object", "properties": { "label": { "type": "string" }, "color": { "type": "string" }, "opacity": { "type": "number" } }, "required": ["label", "color"] }
|
|
322
|
+
},
|
|
323
|
+
"required": ["topRight", "topLeft", "bottomRight", "bottomLeft"]
|
|
324
|
+
},
|
|
325
|
+
"showQuadrantLabels": { "type": "boolean", "default": true },
|
|
326
|
+
"quadrantLabelSize": { "type": "number", "default": 12 },
|
|
327
|
+
"colorBy": { "type": "string", "description": "Key to determine point color" },
|
|
328
|
+
"colorScheme": { "type": ["string", "array"], "default": "category10" },
|
|
329
|
+
"sizeBy": { "type": "string", "description": "Key for variable point sizing" },
|
|
330
|
+
"sizeRange": { "type": "array", "items": { "type": "number" }, "default": [3, 15] },
|
|
331
|
+
"pointRadius": { "type": "number", "default": 5 },
|
|
332
|
+
"pointOpacity": { "type": "number", "default": 0.8 },
|
|
333
|
+
"xLabel": { "type": "string" },
|
|
334
|
+
"yLabel": { "type": "string" },
|
|
335
|
+
"title": { "type": "string" },
|
|
336
|
+
"width": { "type": "number", "default": 600 },
|
|
337
|
+
"height": { "type": "number", "default": 400 },
|
|
338
|
+
"enableHover": { "type": "boolean", "default": true },
|
|
339
|
+
"showLegend": { "type": "boolean" },
|
|
340
|
+
"showGrid": { "type": "boolean", "default": false },
|
|
341
|
+
"margin": { "type": "object" },
|
|
342
|
+
"className": { "type": "string" }
|
|
343
|
+
},
|
|
344
|
+
"required": ["quadrants"]
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
},
|
|
297
348
|
{
|
|
298
349
|
"type": "function",
|
|
299
350
|
"function": {
|
|
@@ -377,6 +428,51 @@
|
|
|
377
428
|
"height": { "type": "number", "default": 400 },
|
|
378
429
|
"enableHover": { "type": "boolean", "default": true },
|
|
379
430
|
"margin": { "type": "object" },
|
|
431
|
+
"className": { "type": "string" },
|
|
432
|
+
"showLegend": {
|
|
433
|
+
"type": "boolean",
|
|
434
|
+
"description": "Show a gradient color legend",
|
|
435
|
+
"default": false
|
|
436
|
+
},
|
|
437
|
+
"legendPosition": {
|
|
438
|
+
"type": "string",
|
|
439
|
+
"enum": ["right", "left", "top", "bottom"],
|
|
440
|
+
"description": "Position of the gradient legend",
|
|
441
|
+
"default": "right"
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
"required": ["data"]
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
"type": "function",
|
|
450
|
+
"function": {
|
|
451
|
+
"name": "ConnectedScatterplot",
|
|
452
|
+
"description": "Scatterplot where points are connected in order, showing trajectories through 2D space. Viridis-colored start→end, white halo under lines.",
|
|
453
|
+
"parameters": {
|
|
454
|
+
"type": "object",
|
|
455
|
+
"properties": {
|
|
456
|
+
"data": {
|
|
457
|
+
"type": "array",
|
|
458
|
+
"items": { "type": "object" },
|
|
459
|
+
"description": "Array of data objects"
|
|
460
|
+
},
|
|
461
|
+
"xAccessor": { "type": "string", "description": "Key for x-axis values", "default": "x" },
|
|
462
|
+
"yAccessor": { "type": "string", "description": "Key for y-axis values", "default": "y" },
|
|
463
|
+
"orderAccessor": { "type": "string", "description": "Key for point ordering (number or Date field)" },
|
|
464
|
+
"orderLabel": { "type": "string", "description": "Label for the ordering metric in tooltips" },
|
|
465
|
+
"pointRadius": { "type": "number", "description": "Point radius", "default": 4 },
|
|
466
|
+
"pointIdAccessor": { "type": "string", "description": "Accessor for unique point IDs, used by point-anchored annotations" },
|
|
467
|
+
"annotations": { "type": "array", "description": "Annotation objects to render on the chart" },
|
|
468
|
+
"colorBy": { "type": "string", "description": "Key to determine color encoding" },
|
|
469
|
+
"colorScheme": { "type": ["string", "array"], "description": "Named d3 color scheme or array of color strings" },
|
|
470
|
+
"title": { "type": "string" },
|
|
471
|
+
"width": { "type": "number", "default": 600 },
|
|
472
|
+
"height": { "type": "number", "default": 400 },
|
|
473
|
+
"enableHover": { "type": "boolean", "default": true },
|
|
474
|
+
"showGrid": { "type": "boolean", "default": false },
|
|
475
|
+
"margin": { "type": "object" },
|
|
380
476
|
"className": { "type": "string" }
|
|
381
477
|
},
|
|
382
478
|
"required": ["data"]
|
|
@@ -1126,6 +1222,43 @@
|
|
|
1126
1222
|
}
|
|
1127
1223
|
}
|
|
1128
1224
|
},
|
|
1225
|
+
{
|
|
1226
|
+
"type": "function",
|
|
1227
|
+
"function": {
|
|
1228
|
+
"name": "OrbitDiagram",
|
|
1229
|
+
"description": "Animated orbital diagram showing hierarchical data as nodes orbiting a center. Supports flat, solar, atomic, and custom ring arrangements.",
|
|
1230
|
+
"parameters": {
|
|
1231
|
+
"type": "object",
|
|
1232
|
+
"properties": {
|
|
1233
|
+
"data": {
|
|
1234
|
+
"type": "object",
|
|
1235
|
+
"description": "Hierarchical root object with children: { name: 'root', children: [...] }"
|
|
1236
|
+
},
|
|
1237
|
+
"childrenAccessor": { "type": "string", "description": "Key to access children from each datum", "default": "children" },
|
|
1238
|
+
"nodeIdAccessor": { "type": "string", "description": "Key to identify each node", "default": "name" },
|
|
1239
|
+
"colorBy": { "type": "string", "description": "Field or function for node color" },
|
|
1240
|
+
"colorScheme": { "type": ["string", "array"], "description": "Color scheme", "default": "category10" },
|
|
1241
|
+
"colorByDepth": { "type": "boolean", "description": "Color by hierarchy depth", "default": false },
|
|
1242
|
+
"orbitMode": { "type": ["string", "array"], "description": "Ring arrangement: 'flat', 'solar', 'atomic', or number[]", "default": "flat" },
|
|
1243
|
+
"orbitSize": { "type": "number", "description": "Ring size divisor per depth", "default": 2.95 },
|
|
1244
|
+
"speed": { "type": "number", "description": "Orbit speed in degrees per frame", "default": 0.25 },
|
|
1245
|
+
"eccentricity": { "type": "number", "description": "Vertical squash for elliptical orbits (1 = circle)", "default": 1 },
|
|
1246
|
+
"showRings": { "type": "boolean", "description": "Show orbital ring paths", "default": true },
|
|
1247
|
+
"nodeRadius": { "type": "number", "description": "Node radius", "default": 6 },
|
|
1248
|
+
"showLabels": { "type": "boolean", "description": "Show node labels", "default": false },
|
|
1249
|
+
"animated": { "type": "boolean", "description": "Enable animation", "default": true },
|
|
1250
|
+
"annotations": { "type": "array", "description": "Annotations anchored by nodeId" },
|
|
1251
|
+
"title": { "type": "string" },
|
|
1252
|
+
"width": { "type": "number", "default": 600 },
|
|
1253
|
+
"height": { "type": "number", "default": 600 },
|
|
1254
|
+
"enableHover": { "type": "boolean", "default": true },
|
|
1255
|
+
"margin": { "type": "object" },
|
|
1256
|
+
"className": { "type": "string" }
|
|
1257
|
+
},
|
|
1258
|
+
"required": ["data"]
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
},
|
|
1129
1262
|
{
|
|
1130
1263
|
"type": "function",
|
|
1131
1264
|
"function": {
|
package/ai/system-prompt.md
CHANGED
|
@@ -5,37 +5,78 @@ Use `import { ComponentName } from "semiotic/ai"` for all components below.
|
|
|
5
5
|
## Flat Array Data (`data: object[]`)
|
|
6
6
|
- **LineChart** — `xAccessor`, `yAccessor`, `lineBy` (multi-line), `curve`
|
|
7
7
|
- **AreaChart** — `xAccessor`, `yAccessor`, `areaBy`, `areaOpacity`
|
|
8
|
-
- **StackedAreaChart** — `xAccessor`, `yAccessor`,
|
|
8
|
+
- **StackedAreaChart** — `xAccessor`, `yAccessor`, **`areaBy`** (required, groups flat data into stacked areas), `colorBy`, `normalize`. Data must be a flat array. Do NOT use `lineBy` or `lineDataAccessor`.
|
|
9
9
|
- **Scatterplot** — `xAccessor`, `yAccessor`, `colorBy`, `sizeBy`
|
|
10
10
|
- **BubbleChart** — `xAccessor`, `yAccessor`, **`sizeBy`** (required), `sizeRange`
|
|
11
|
+
- **ConnectedScatterplot** — `xAccessor`, `yAccessor`, `orderAccessor` (sequencing field), `pointRadius`
|
|
11
12
|
- **Heatmap** — `xAccessor`, `yAccessor`, `valueAccessor`, `colorScheme` ("blues"|"reds"|"greens"|"viridis")
|
|
12
13
|
- **BarChart** — `categoryAccessor`, `valueAccessor`, `orientation`, `sort`
|
|
13
14
|
- **StackedBarChart** — `categoryAccessor`, `valueAccessor`, **`stackBy`** (required), `normalize`
|
|
14
15
|
- **GroupedBarChart** — `categoryAccessor`, `valueAccessor`, **`groupBy`** (required)
|
|
15
16
|
- **SwarmPlot** — `categoryAccessor`, `valueAccessor`, `pointRadius`
|
|
16
17
|
- **BoxPlot** — `categoryAccessor`, `valueAccessor`, `showOutliers`
|
|
17
|
-
- **Histogram** — `categoryAccessor
|
|
18
|
+
- **Histogram** — `categoryAccessor` (optional, defaults to `"category"` — omit for single-group), `valueAccessor`, `bins` (default 25), `relative`
|
|
18
19
|
- **ViolinPlot** — `categoryAccessor`, `valueAccessor`, `bins`, `curve`, `showIQR`
|
|
19
20
|
- **DotPlot** — `categoryAccessor`, `valueAccessor`, `sort`, `dotRadius`
|
|
20
21
|
- **PieChart** — `categoryAccessor`, `valueAccessor`
|
|
21
|
-
- **DonutChart** — `categoryAccessor`, `valueAccessor`, `innerRadius`, `centerContent`
|
|
22
|
+
- **DonutChart** — `categoryAccessor`, `valueAccessor`, `innerRadius`, `centerContent` (ReactNode, e.g. `<div>50%</div>`)
|
|
22
23
|
|
|
23
24
|
## Hierarchical Data (`data: { children: [...] }`)
|
|
24
25
|
- **TreeDiagram** — `childrenAccessor`, `nodeIdAccessor`, `layout` ("tree"|"cluster"|"partition"), `orientation`
|
|
25
26
|
- **Treemap** — `childrenAccessor`, `valueAccessor`, `nodeIdAccessor`, `colorByDepth`
|
|
26
27
|
- **CirclePack** — `childrenAccessor`, `valueAccessor`, `nodeIdAccessor`, `colorByDepth`
|
|
28
|
+
- **OrbitDiagram** — animated radial/orbital hierarchy (use this, not TreeDiagram, for animated orbiting nodes). `childrenAccessor`, `nodeIdAccessor`, `orbitMode` ("flat"|"solar"|"atomic"|number[]), `speed`, `animated`. For static radial trees use `TreeDiagram layout="radial"`.
|
|
27
29
|
|
|
28
30
|
## Network Data (`nodes: object[]`, `edges: object[]`)
|
|
29
|
-
- **ForceDirectedGraph** — **`nodes`**, **`edges`** (both required), `nodeIDAccessor`, `sourceAccessor`, `targetAccessor`
|
|
31
|
+
- **ForceDirectedGraph** — **`nodes`**, **`edges`** (both required), `nodeIDAccessor`, `sourceAccessor`, `targetAccessor`, `colorBy`, `nodeSize` (number|string|fn), `nodeSizeRange`, `edgeWidth`, `edgeOpacity`, `iterations`, `forceStrength`, `showLabels`, `nodeLabel`, `tooltip`, `showLegend`
|
|
30
32
|
- **SankeyDiagram** — **`edges`** (required), `sourceAccessor`, `targetAccessor`, `valueAccessor`
|
|
31
33
|
- **ChordDiagram** — **`edges`** (required), `sourceAccessor`, `targetAccessor`, `valueAccessor`
|
|
32
34
|
|
|
35
|
+
**Important**: Always use these HOC components for network charts unless you need sophisticated control they don't expose. `StreamNetworkFrame` is a low-level escape hatch — its callbacks receive internal wrapper objects (`RealtimeNode`), not your raw data.
|
|
36
|
+
|
|
33
37
|
## Realtime (ref-based push API, canvas)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
|
|
39
|
+
**IMPORTANT**: All pushed data must include a time field (default: `"time"`). Set `timeAccessor` if your field is named differently. Without a valid time field, charts silently render blank.
|
|
40
|
+
|
|
41
|
+
Sizing: all Realtime HOCs accept both `size={[600, 400]}` (tuple) and `width={600} height={400}`.
|
|
42
|
+
|
|
43
|
+
- **RealtimeLineChart** — `ref.current.push(datum)`, **`timeAccessor`** ("time"), **`valueAccessor`** ("value"), `windowSize`
|
|
44
|
+
- **RealtimeHistogram** — **`binSize`** (required), **`timeAccessor`** ("time"), **`valueAccessor`** ("value"). Time field required even though this is a distribution — it's used for windowing.
|
|
45
|
+
- **RealtimeSwarmChart** — **`timeAccessor`** ("time"), **`valueAccessor`** ("value"), `categoryAccessor`
|
|
46
|
+
- **RealtimeWaterfallChart** — **`timeAccessor`** ("time"), **`valueAccessor`** ("value"), `positiveColor`, `negativeColor`
|
|
47
|
+
- **RealtimeHeatmap** — **`timeAccessor`** ("time"), **`valueAccessor`** ("value"), `heatmapXBins`, `heatmapYBins`, `aggregation`. Both must match your data fields.
|
|
48
|
+
- **StreamNetworkFrame** (`chartType="sankey"`) — push **individual edges**: `ref.current.push({ source, target, value })`. Use `ref.current.pushMany([...edges])` for batches. Do NOT push full edge snapshots. Props: `sourceAccessor`, `targetAccessor`, `valueAccessor`, `showParticles` (boolean), `particleStyle` (`{ radius, opacity, speedMultiplier, maxPerEdge, colorBy }`) (import from `semiotic`)
|
|
49
|
+
|
|
50
|
+
Pushed data shape: `{ time: Date.now(), value: 42 }` for line/waterfall/heatmap, add `category` for histogram/swarm.
|
|
51
|
+
|
|
52
|
+
### Push API on HOC charts
|
|
53
|
+
Many HOC charts support the push API via `forwardRef`. **Omit the `data` prop** (do NOT pass `data={[]}`) and push imperatively:
|
|
54
|
+
```jsx
|
|
55
|
+
const chartRef = useRef()
|
|
56
|
+
chartRef.current.push({ x: 1, y: 2 })
|
|
57
|
+
<Scatterplot ref={chartRef} xAccessor="x" yAccessor="y" />
|
|
58
|
+
```
|
|
59
|
+
Methods: `push(datum)`, `pushMany(data)`, `clear()`, `getData()`. Streaming-specific props (`windowSize`, `decay`, `pulse`) go in `frameProps`. Supported: XY charts, ordinal charts, network charts (ForceDirectedGraph, SankeyDiagram, ChordDiagram), ProportionalSymbolMap, DistanceCartogram. Not supported: hierarchy charts (TreeDiagram, Treemap, CirclePack, OrbitDiagram), ChoroplethMap, FlowMap, ScatterplotMatrix.
|
|
60
|
+
|
|
61
|
+
For advanced streaming control, use Stream Frames (`StreamXYFrame`, `StreamOrdinalFrame`, `StreamNetworkFrame`) with `runtimeMode="streaming"` and ref-based push.
|
|
62
|
+
|
|
63
|
+
## ChartContainer
|
|
64
|
+
- **ChartContainer** — wrapper with title, subtitle, status indicator, toolbar. `title`, `subtitle`, `height` (default **400** — always set this to match your chart height), `width` ("100%"), `status` ("live"|"stale"|"error"), `loading`, `error`, `actions`, `style`
|
|
65
|
+
- When using with `size={[w, h]}`, set `height={h}` on the container or you'll get extra whitespace.
|
|
39
66
|
|
|
40
67
|
## Common Props (all components)
|
|
41
|
-
`width`, `height`, `margin`, `title`, `colorBy`, `colorScheme`, `enableHover`, `tooltip`, `showLegend`, `className`, `frameProps`
|
|
68
|
+
`width`, `height`, `margin`, `title`, `colorBy`, `colorScheme`, `enableHover`, `tooltip`, `showLegend`, `className`, `frameProps`, `onObservation`, `emphasis` ("primary"|"secondary")
|
|
69
|
+
|
|
70
|
+
### tooltip
|
|
71
|
+
`true` (default) | `false` | `(datum) => ReactNode` (function receives your raw data) | config `{ fields?, title?, format?, style? }`
|
|
72
|
+
|
|
73
|
+
### onObservation
|
|
74
|
+
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
|
+
|
|
76
|
+
### emphasis
|
|
77
|
+
`emphasis="primary"` makes a chart span two columns inside a `ChartGrid`.
|
|
78
|
+
|
|
79
|
+
## Key Patterns
|
|
80
|
+
- **Percentile band + main line**: Layer `<AreaChart yAccessor="p95" y0Accessor="p5" showLine={false} />` + `<LineChart yAccessor="p50" />`. AreaChart's `showLine` only draws the top edge, NOT a separate main line.
|
|
81
|
+
- **SSR**: `renderToStaticSVG("ordinal", props)` or `renderOrdinalToStaticSVG(props)` from `semiotic/server`. Frame type is `"xy"` | `"ordinal"` | `"network"` (NOT component name).
|
|
82
|
+
- **exportChart**: Pass the wrapper div, not the SVG element: `exportChart(wrapperDiv, { format: "png" })`. It finds canvas+SVG internally.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
export type ChartEmphasis = "primary" | "secondary";
|
|
2
3
|
export interface ChartGridProps {
|
|
3
4
|
/** Chart components to arrange in the grid */
|
|
4
5
|
children: React.ReactNode;
|
|
@@ -20,15 +21,16 @@ export interface ChartGridProps {
|
|
|
20
21
|
* Each cell automatically gets `responsiveWidth` behavior since the grid
|
|
21
22
|
* manages the cell dimensions.
|
|
22
23
|
*
|
|
23
|
-
*
|
|
24
|
+
* Children can set `emphasis="primary"` to span two columns and receive
|
|
25
|
+
* higher visual weight, following the F-pattern reading layout recommended
|
|
26
|
+
* by Carbon Design guidelines.
|
|
24
27
|
*
|
|
25
28
|
* ```tsx
|
|
26
|
-
* <
|
|
27
|
-
* <
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* </LinkedCharts>
|
|
29
|
+
* <ChartGrid columns={2}>
|
|
30
|
+
* <LineChart data={d} emphasis="primary" responsiveWidth />
|
|
31
|
+
* <BarChart data={d} responsiveWidth />
|
|
32
|
+
* <ScatterChart data={d} responsiveWidth />
|
|
33
|
+
* </ChartGrid>
|
|
32
34
|
* ```
|
|
33
35
|
*/
|
|
34
36
|
export declare function ChartGrid({ children, columns, minCellWidth, gap, className, style, }: ChartGridProps): React.JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { LegendProps, GradientLegendConfig } from "./types/legendTypes";
|
|
3
|
+
/** Gradient legend for continuous/sequential color scales */
|
|
4
|
+
export declare function GradientLegend({ config, orientation, width, }: {
|
|
5
|
+
config: GradientLegendConfig;
|
|
6
|
+
orientation?: "vertical" | "horizontal";
|
|
7
|
+
width?: number;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
export default function Legend(props: LegendProps): React.JSX.Element;
|
|
@@ -1,15 +1,48 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ResolutionMode } from "./store/SelectionStore";
|
|
3
|
+
type LegendInteractionMode = "highlight" | "isolate" | "none";
|
|
3
4
|
export { useSelection, useLinkedHover, useBrushSelection, useFilteredData } from "./store/useSelection";
|
|
4
5
|
export type { UseSelectionOptions, UseSelectionResult, UseLinkedHoverOptions, UseLinkedHoverResult, UseBrushSelectionOptions, UseBrushSelectionResult } from "./store/useSelection";
|
|
5
6
|
export { useChartObserver } from "./store/useObservation";
|
|
6
7
|
export type { UseChartObserverOptions, UseChartObserverResult } from "./store/useObservation";
|
|
8
|
+
/** Hook: returns true when a parent LinkedCharts is handling the legend. */
|
|
9
|
+
export declare function useLinkedLegendSuppression(): boolean;
|
|
7
10
|
export interface LinkedChartsProps {
|
|
8
11
|
children: React.ReactNode;
|
|
9
12
|
/** Pre-configure selections with resolution modes */
|
|
10
13
|
selections?: Record<string, {
|
|
11
14
|
resolution?: ResolutionMode;
|
|
12
15
|
}>;
|
|
16
|
+
/**
|
|
17
|
+
* Show a unified legend for all linked charts.
|
|
18
|
+
* When true, child chart legends are automatically suppressed unless explicitly set.
|
|
19
|
+
* @default true (when a CategoryColorProvider is present)
|
|
20
|
+
*/
|
|
21
|
+
showLegend?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Position of the unified legend.
|
|
24
|
+
* @default "top"
|
|
25
|
+
*/
|
|
26
|
+
legendPosition?: "top" | "bottom";
|
|
27
|
+
/**
|
|
28
|
+
* Legend interaction mode for the unified legend.
|
|
29
|
+
* - "highlight": hover dims non-hovered categories across all linked charts
|
|
30
|
+
* - "isolate": click toggles category visibility across all linked charts
|
|
31
|
+
* - "none": static legend (default)
|
|
32
|
+
*/
|
|
33
|
+
legendInteraction?: LegendInteractionMode;
|
|
34
|
+
/**
|
|
35
|
+
* Selection name that the unified legend produces on.
|
|
36
|
+
* Child charts must use the same name in their `selection` prop to respond.
|
|
37
|
+
* @default "legend"
|
|
38
|
+
*/
|
|
39
|
+
legendSelectionName?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Field name that the unified legend uses for cross-chart highlighting.
|
|
42
|
+
* This must match the field used in child charts' `linkedHover.fields` / `colorBy`.
|
|
43
|
+
* @default first field from the first child's linkedHover config, or "category"
|
|
44
|
+
*/
|
|
45
|
+
legendField?: string;
|
|
13
46
|
}
|
|
14
47
|
/**
|
|
15
48
|
* LinkedCharts — context provider for coordinated chart views.
|
|
@@ -41,4 +74,4 @@ export interface LinkedChartsProps {
|
|
|
41
74
|
* </LinkedCharts>
|
|
42
75
|
* ```
|
|
43
76
|
*/
|
|
44
|
-
export declare function LinkedCharts({ children, selections }: LinkedChartsProps): React.JSX.Element;
|
|
77
|
+
export declare function LinkedCharts({ children, selections, showLegend, legendPosition, legendInteraction, legendSelectionName, legendField, }: LinkedChartsProps): React.JSX.Element;
|
|
@@ -136,6 +136,13 @@ export declare function MultiLineTooltip(config?: MultiLineTooltipConfig): (data
|
|
|
136
136
|
*/
|
|
137
137
|
export type TooltipProp = boolean | ((data: Record<string, unknown>) => React.ReactNode) | ReturnType<typeof Tooltip> | ReturnType<typeof MultiLineTooltip> | TooltipConfig;
|
|
138
138
|
/**
|
|
139
|
-
*
|
|
139
|
+
* The function signature that Stream Frames expect for tooltipContent.
|
|
140
|
+
* Compatible with HoverData and any Record-based hover object.
|
|
140
141
|
*/
|
|
141
|
-
export
|
|
142
|
+
export type TooltipContentFn = (d: Record<string, any>) => React.ReactNode;
|
|
143
|
+
/**
|
|
144
|
+
* Convert a tooltip prop to the format Semiotic expects.
|
|
145
|
+
* Returns `false` to disable, or a `TooltipContentFn` compatible with
|
|
146
|
+
* all Stream Frame `tooltipContent` signatures.
|
|
147
|
+
*/
|
|
148
|
+
export declare function normalizeTooltip(tooltip: TooltipProp | undefined): false | TooltipContentFn;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { StreamGeoFrameProps, ProjectionProp } from "../../stream/geoTypes";
|
|
3
|
+
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
4
|
+
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
|
+
import type { LegendInteractionMode } from "../shared/hooks";
|
|
6
|
+
import { type AreasProp } from "../../geo/useReferenceAreas";
|
|
7
|
+
export interface ChoroplethMapProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
|
|
8
|
+
/** GeoJSON features or a reference string ("world-110m", "world-50m", "land-110m", "land-50m") */
|
|
9
|
+
areas: AreasProp;
|
|
10
|
+
/** Accessor for the numeric value to encode as color */
|
|
11
|
+
valueAccessor: ChartAccessor<TDatum, number>;
|
|
12
|
+
/** Sequential color scheme @default "blues" */
|
|
13
|
+
colorScheme?: string;
|
|
14
|
+
/** Geographic projection @default "equalEarth" */
|
|
15
|
+
projection?: ProjectionProp;
|
|
16
|
+
/** Show graticule grid lines */
|
|
17
|
+
graticule?: boolean | import("../../stream/geoTypes").GraticuleConfig;
|
|
18
|
+
/** Tooltip config */
|
|
19
|
+
tooltip?: TooltipProp;
|
|
20
|
+
/** Show legend @default true */
|
|
21
|
+
showLegend?: boolean;
|
|
22
|
+
/** Legend interaction mode */
|
|
23
|
+
legendInteraction?: LegendInteractionMode;
|
|
24
|
+
/** Padding fraction for auto-fit projection. 0.1 = 10% inset from edges. @default 0 */
|
|
25
|
+
fitPadding?: number;
|
|
26
|
+
/** Enable zoom/pan. Defaults to true when tileURL is set, false otherwise. */
|
|
27
|
+
zoomable?: boolean;
|
|
28
|
+
/** [minZoom, maxZoom] @default [1, 8] */
|
|
29
|
+
zoomExtent?: [number, number];
|
|
30
|
+
/** Zoom change callback */
|
|
31
|
+
onZoom?: StreamGeoFrameProps["onZoom"];
|
|
32
|
+
/**
|
|
33
|
+
* When true, drag gestures rotate the projection (globe spinning)
|
|
34
|
+
* instead of panning. Defaults to true for orthographic projection.
|
|
35
|
+
*/
|
|
36
|
+
dragRotate?: boolean;
|
|
37
|
+
/** Raster tile URL template or function. Enables tile basemap (Mercator only). */
|
|
38
|
+
tileURL?: string | ((z: number, x: number, y: number, dpr: number) => string);
|
|
39
|
+
/** Attribution text for tile provider */
|
|
40
|
+
tileAttribution?: string;
|
|
41
|
+
/** Max cached tiles @default 256 */
|
|
42
|
+
tileCacheSize?: number;
|
|
43
|
+
/** Fill opacity for area polygons. Useful for layering over tile basemaps. @default 1 */
|
|
44
|
+
areaOpacity?: number;
|
|
45
|
+
/** Annotations */
|
|
46
|
+
annotations?: Record<string, any>[];
|
|
47
|
+
/** Passthrough to StreamGeoFrame */
|
|
48
|
+
frameProps?: Partial<Omit<StreamGeoFrameProps, "areas" | "projection">>;
|
|
49
|
+
}
|
|
50
|
+
export declare function ChoroplethMap<TDatum extends Record<string, any> = Record<string, any>>(props: ChoroplethMapProps<TDatum>): React.JSX.Element | null;
|
|
51
|
+
export declare namespace ChoroplethMap {
|
|
52
|
+
var displayName: string;
|
|
53
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { StreamGeoFrameProps, ProjectionProp } from "../../stream/geoTypes";
|
|
3
|
+
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
4
|
+
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
|
+
import type { LegendPosition } from "../shared/hooks";
|
|
6
|
+
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
7
|
+
export interface DistanceCartogramProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
|
|
8
|
+
/** Point data with geographic coordinates */
|
|
9
|
+
points?: TDatum[];
|
|
10
|
+
/** Route/edge data with source/target fields */
|
|
11
|
+
lines?: {
|
|
12
|
+
source: string;
|
|
13
|
+
target: string;
|
|
14
|
+
coordinates?: any[];
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}[];
|
|
17
|
+
/** Longitude accessor @default "lon" */
|
|
18
|
+
xAccessor?: ChartAccessor<TDatum, number>;
|
|
19
|
+
/** Latitude accessor @default "lat" */
|
|
20
|
+
yAccessor?: ChartAccessor<TDatum, number>;
|
|
21
|
+
/** Node ID accessor @default "id" */
|
|
22
|
+
nodeIdAccessor?: string;
|
|
23
|
+
/** ID of the center point */
|
|
24
|
+
center: string;
|
|
25
|
+
/** Cost/distance accessor — numeric field or function */
|
|
26
|
+
costAccessor: string | ((d: any) => number);
|
|
27
|
+
/** Interpolation between geographic (0) and cartogram (1) @default 1 */
|
|
28
|
+
strength?: number;
|
|
29
|
+
/** Line rendering mode @default "straight" */
|
|
30
|
+
lineMode?: "straight" | "fractional";
|
|
31
|
+
/** Base geographic projection @default "mercator" */
|
|
32
|
+
projection?: ProjectionProp;
|
|
33
|
+
/** Show graticule grid lines */
|
|
34
|
+
graticule?: boolean | import("../../stream/geoTypes").GraticuleConfig;
|
|
35
|
+
/** Transition duration in ms when center/strength changes */
|
|
36
|
+
transition?: number;
|
|
37
|
+
/** Field to determine point color */
|
|
38
|
+
colorBy?: ChartAccessor<TDatum, string>;
|
|
39
|
+
/** Color scheme @default "category10" */
|
|
40
|
+
colorScheme?: string | string[];
|
|
41
|
+
/** Point radius @default 5 */
|
|
42
|
+
pointRadius?: number;
|
|
43
|
+
/** Tooltip */
|
|
44
|
+
tooltip?: TooltipProp;
|
|
45
|
+
/** Show legend */
|
|
46
|
+
showLegend?: boolean;
|
|
47
|
+
/** Legend position */
|
|
48
|
+
legendPosition?: LegendPosition;
|
|
49
|
+
/** Padding fraction for auto-fit projection. 0.1 = 10% inset from edges. @default 0 */
|
|
50
|
+
fitPadding?: number;
|
|
51
|
+
/** Enable zoom/pan. Defaults to true when tileURL is set, false otherwise. */
|
|
52
|
+
zoomable?: boolean;
|
|
53
|
+
/** [minZoom, maxZoom] @default [1, 8] */
|
|
54
|
+
zoomExtent?: [number, number];
|
|
55
|
+
/** Zoom change callback */
|
|
56
|
+
onZoom?: StreamGeoFrameProps["onZoom"];
|
|
57
|
+
/**
|
|
58
|
+
* When true, drag gestures rotate the projection (globe spinning)
|
|
59
|
+
* instead of panning. Defaults to true for orthographic projection.
|
|
60
|
+
*/
|
|
61
|
+
dragRotate?: boolean;
|
|
62
|
+
/** Raster tile URL template or function. Enables tile basemap (Mercator only). */
|
|
63
|
+
tileURL?: string | ((z: number, x: number, y: number, dpr: number) => string);
|
|
64
|
+
/** Attribution text for tile provider */
|
|
65
|
+
tileAttribution?: string;
|
|
66
|
+
/** Max cached tiles @default 256 */
|
|
67
|
+
tileCacheSize?: number;
|
|
68
|
+
/** Show concentric distance rings around center. true for auto intervals, number for ring count, or number[] for explicit cost values. @default true */
|
|
69
|
+
showRings?: boolean | number | number[];
|
|
70
|
+
/** Ring style overrides */
|
|
71
|
+
ringStyle?: {
|
|
72
|
+
stroke?: string;
|
|
73
|
+
strokeWidth?: number;
|
|
74
|
+
strokeDasharray?: string;
|
|
75
|
+
labelColor?: string;
|
|
76
|
+
labelSize?: number;
|
|
77
|
+
};
|
|
78
|
+
/** Show north indicator arrow @default true */
|
|
79
|
+
showNorth?: boolean;
|
|
80
|
+
/** Label for cost units shown on rings (e.g. "hrs", "km") */
|
|
81
|
+
costLabel?: string;
|
|
82
|
+
/** Annotations */
|
|
83
|
+
annotations?: Record<string, any>[];
|
|
84
|
+
/** Passthrough */
|
|
85
|
+
frameProps?: Partial<Omit<StreamGeoFrameProps, "projection">>;
|
|
86
|
+
}
|
|
87
|
+
export declare const DistanceCartogram: {
|
|
88
|
+
<TDatum extends Record<string, any> = Record<string, any>>(props: DistanceCartogramProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
|
|
89
|
+
displayName?: string;
|
|
90
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { StreamGeoFrameProps, ProjectionProp } from "../../stream/geoTypes";
|
|
3
|
+
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
4
|
+
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
|
+
import type { Style } from "../../stream/types";
|
|
6
|
+
import type { GeoParticleStyle } from "../../stream/GeoParticlePool";
|
|
7
|
+
import { type AreasProp } from "../../geo/useReferenceAreas";
|
|
8
|
+
export interface FlowMapProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
|
|
9
|
+
/** Flow edges with source/target/value */
|
|
10
|
+
flows?: {
|
|
11
|
+
source: string;
|
|
12
|
+
target: string;
|
|
13
|
+
value?: number;
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}[];
|
|
16
|
+
/** Geographic nodes with coordinates */
|
|
17
|
+
nodes?: TDatum[];
|
|
18
|
+
/** Node ID accessor @default "id" */
|
|
19
|
+
nodeIdAccessor?: string;
|
|
20
|
+
/** Longitude accessor @default "lon" */
|
|
21
|
+
xAccessor?: ChartAccessor<TDatum, number>;
|
|
22
|
+
/** Latitude accessor @default "lat" */
|
|
23
|
+
yAccessor?: ChartAccessor<TDatum, number>;
|
|
24
|
+
/** Value accessor for edge width @default "value" */
|
|
25
|
+
valueAccessor?: string;
|
|
26
|
+
/** Projection @default "equalEarth" */
|
|
27
|
+
projection?: ProjectionProp;
|
|
28
|
+
/** Show graticule grid lines */
|
|
29
|
+
graticule?: boolean | import("../../stream/geoTypes").GraticuleConfig;
|
|
30
|
+
/** Line type: "geo" for great circles, "line" for straight @default "geo" */
|
|
31
|
+
lineType?: "geo" | "line";
|
|
32
|
+
/** Flow rendering style: "basic" (straight/great-circle), "offset" (bidirectional offset), "arc" (curved arcs) @default "basic" */
|
|
33
|
+
flowStyle?: "basic" | "offset" | "arc";
|
|
34
|
+
/** Optional background areas */
|
|
35
|
+
areas?: AreasProp;
|
|
36
|
+
/** Background area style */
|
|
37
|
+
areaStyle?: Style;
|
|
38
|
+
/** Edge color accessor */
|
|
39
|
+
edgeColorBy?: ChartAccessor<any, string>;
|
|
40
|
+
/** Edge opacity @default 0.6 */
|
|
41
|
+
edgeOpacity?: number;
|
|
42
|
+
/** Min/max pixel width for proportional edge width @default [1, 8] */
|
|
43
|
+
edgeWidthRange?: [number, number];
|
|
44
|
+
/** Line cap style for flow edges @default "round" */
|
|
45
|
+
edgeLinecap?: "butt" | "round" | "square";
|
|
46
|
+
/** Color scheme for edges @default "category10" */
|
|
47
|
+
colorScheme?: string | string[];
|
|
48
|
+
/** Show animated particles along flow lines */
|
|
49
|
+
showParticles?: boolean;
|
|
50
|
+
/** Particle appearance and behavior */
|
|
51
|
+
particleStyle?: GeoParticleStyle;
|
|
52
|
+
/** Tooltip */
|
|
53
|
+
tooltip?: TooltipProp;
|
|
54
|
+
/** Show legend */
|
|
55
|
+
showLegend?: boolean;
|
|
56
|
+
/** Padding fraction for auto-fit projection. 0.1 = 10% inset from edges. @default 0 */
|
|
57
|
+
fitPadding?: number;
|
|
58
|
+
/** Enable zoom/pan. Defaults to true when tileURL is set, false otherwise. */
|
|
59
|
+
zoomable?: boolean;
|
|
60
|
+
/** [minZoom, maxZoom] @default [1, 8] */
|
|
61
|
+
zoomExtent?: [number, number];
|
|
62
|
+
/** Zoom change callback */
|
|
63
|
+
onZoom?: StreamGeoFrameProps["onZoom"];
|
|
64
|
+
/**
|
|
65
|
+
* When true, drag gestures rotate the projection (globe spinning)
|
|
66
|
+
* instead of panning. Defaults to true for orthographic projection.
|
|
67
|
+
*/
|
|
68
|
+
dragRotate?: boolean;
|
|
69
|
+
/** Raster tile URL template or function. Enables tile basemap (Mercator only). */
|
|
70
|
+
tileURL?: string | ((z: number, x: number, y: number, dpr: number) => string);
|
|
71
|
+
/** Attribution text for tile provider */
|
|
72
|
+
tileAttribution?: string;
|
|
73
|
+
/** Max cached tiles @default 256 */
|
|
74
|
+
tileCacheSize?: number;
|
|
75
|
+
/** Annotations */
|
|
76
|
+
annotations?: Record<string, any>[];
|
|
77
|
+
/** Passthrough */
|
|
78
|
+
frameProps?: Partial<Omit<StreamGeoFrameProps, "projection">>;
|
|
79
|
+
}
|
|
80
|
+
export declare function FlowMap<TDatum extends Record<string, any> = Record<string, any>>(props: FlowMapProps<TDatum>): React.JSX.Element;
|
|
81
|
+
export declare namespace FlowMap {
|
|
82
|
+
var displayName: string;
|
|
83
|
+
}
|