semiotic 3.12.0 → 3.12.1
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/README.md +50 -46
- package/ai/artifact-surface-inventory.json +1 -1
- package/ai/behaviorContracts.cjs +1 -1
- package/ai/dist/diagnose-operation.js +3 -3
- package/ai/dist/mcp-server.js +1 -1
- package/ai/reference.md +15 -3
- package/ai/schema.json +908 -96
- package/ai/surface-manifest.json +1 -1
- package/ai/task-packets/compare-category-totals.json +5 -5
- package/ai/task-packets/compare-category-totals.md +2 -2
- package/ai/task-packets/correct-published-chart.json +5 -5
- package/ai/task-packets/correct-published-chart.md +2 -2
- package/ai/task-packets/index.json +6 -6
- package/ai/task-packets/update-live-chart.json +5 -5
- package/ai/task-packets/update-live-chart.md +2 -2
- package/dist/c-27DCB5T6.min.js +7 -7
- package/dist/c-2CKIGFD2.min.js +1 -1
- package/dist/c-3FATLOH4.min.js +1 -0
- package/dist/{c-STVM6CBI.min.js → c-4SCJKAWZ.min.js} +200 -200
- package/dist/c-5FUOKMH6.min.js +7 -0
- package/dist/c-AAIPWVQ5.min.js +6 -6
- package/dist/{c-2RG4WOVX.min.js → c-ALLF3Y77.min.js} +1 -1
- package/dist/{c-QMKQVCCZ.min.js → c-C5GXUHUO.min.js} +6 -6
- package/dist/c-C67QDKTU.min.js +34 -0
- package/dist/c-F76M77YC.min.js +1 -0
- package/dist/c-FEVXPKQH.min.js +1 -1
- package/dist/c-G42WVQO2.min.js +1 -0
- package/dist/c-G5A3YWTN.min.js +66 -0
- package/dist/c-H4HVKBU3.min.js +1 -0
- package/dist/c-HU3ASFKT.min.js +1 -0
- package/dist/c-I4FYCVJB.min.js +391 -0
- package/dist/{c-5L7JGWQW.min.js → c-IATPZOL7.min.js} +28 -28
- package/dist/c-IE5EBBP6.min.js +110 -0
- package/dist/c-IGONIKZL.min.js +1 -0
- package/dist/c-IKPM53JH.min.js +1 -0
- package/dist/c-IU4QZ7Y5.min.js +1 -1
- package/dist/{c-2ACLVPKF.min.js → c-K5VE57OI.min.js} +1 -1
- package/dist/c-KWJIBJ4R.min.js +1 -0
- package/dist/c-LIMFU6RD.min.js +1 -0
- package/dist/c-M4T43G76.min.js +1 -0
- package/dist/c-M7QUZZCE.min.js +1 -1
- package/dist/c-NVSINXE5.min.js +1 -0
- package/dist/{c-FAF6EV4E.min.js → c-NWRYV6ZF.min.js} +1 -1
- package/dist/c-O5GU2R5W.min.js +1 -0
- package/dist/c-OC7GNXGZ.min.js +1 -0
- package/dist/c-OV5F3DQP.min.js +1 -0
- package/dist/{c-5TAXHW7I.min.js → c-PJ5CAYAW.min.js} +1 -1
- package/dist/c-Q5LZRQGD.min.js +1 -0
- package/dist/c-QP3PXK3N.min.js +1 -0
- package/dist/c-SGZ7ZD2I.min.js +51 -0
- package/dist/c-SSKV5JPW.min.js +1 -1
- package/dist/c-THWTHWXU.min.js +37 -0
- package/dist/c-TRMNDRC4.min.js +41 -0
- package/dist/c-UP656CST.min.js +1 -1
- package/dist/c-USYOK5OX.min.js +1 -0
- package/dist/c-VI753KBO.min.js +1 -0
- package/dist/{c-TT4CTEBR.min.js → c-VLAAAFST.min.js} +1 -1
- package/dist/c-VSOQPII4.min.js +5 -5
- package/dist/c-WGDM4ZRP.min.js +26 -0
- package/dist/c-XCV7VUU3.min.js +87 -0
- package/dist/c-XGDZPYBI.min.js +1 -0
- package/dist/c-XI6CLZII.min.js +1 -0
- package/dist/{c-L4Q2YMXO.min.js → c-XLC7PKM7.min.js} +1 -1
- package/dist/{c-3YAGKCPU.min.js → c-YEB6Z35F.min.js} +1 -1
- package/dist/c-YWZBFG63.min.js +1 -0
- package/dist/c-ZMYO3NZU.min.js +2 -0
- package/dist/c-ZO36H5VH.min.js +48 -0
- package/dist/components/LinkedCharts.d.ts +6 -1
- package/dist/components/Tooltip/Tooltip.d.ts +11 -1
- package/dist/components/Tooltip/tooltipChrome.d.ts +8 -2
- package/dist/components/bundling/semioticVite.d.ts +24 -0
- package/dist/components/charts/physics/cruciblePhysics.d.ts +2 -2
- package/dist/components/charts/physics/gauntletPhysics.d.ts +2 -6
- package/dist/components/charts/physics/physicsHocUtils.d.ts +8 -1
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +2 -0
- package/dist/components/charts/shared/chartSize.d.ts +58 -0
- package/dist/components/charts/shared/chartSizeDefaults.d.ts +189 -0
- package/dist/components/charts/shared/chartSizeDefaultsAtlas.d.ts +9 -0
- package/dist/components/charts/shared/chartSizeDefaultsNetwork.d.ts +29 -0
- package/dist/components/charts/shared/chartSizeDefaultsOrdinal.d.ts +13 -0
- package/dist/components/charts/shared/chartSizeDefaultsPhysics.d.ts +41 -0
- package/dist/components/charts/shared/chartSizeDefaultsValue.d.ts +19 -0
- package/dist/components/charts/shared/chartSizeDefaultsXY.d.ts +10 -0
- package/dist/components/charts/shared/networkPerspectiveWireSchema.d.ts +3 -0
- package/dist/components/charts/shared/useChartSetup.d.ts +3 -0
- package/dist/components/charts/shared/useCustomChartSetup.d.ts +4 -0
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +2 -0
- package/dist/components/charts/shared/withChartWrapper.d.ts +6 -2
- package/dist/components/charts/value/BigNumber.d.ts +0 -8
- package/dist/components/charts/xy/minimapLayout.d.ts +10 -0
- package/dist/components/realtime/BinAccumulator.d.ts +5 -2
- package/dist/components/recipes/atlas/dependencyForestChartProps.d.ts +4 -4
- package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +177 -1
- package/dist/components/recipes/atlas/flowCircuitLayout.d.ts +3 -0
- package/dist/components/recipes/atlas/motifBraidChartProps.d.ts +2 -0
- package/dist/components/recipes/atlas/resolution/BoundaryLoomChart.d.ts +3 -0
- package/dist/components/recipes/atlas/resolution/ComponentCutaway.d.ts +16 -0
- package/dist/components/recipes/atlas/resolution/ResolutionAtlasChart.d.ts +3 -0
- package/dist/components/recipes/atlas/resolution/ResolutionGlyphs.d.ts +15 -0
- package/dist/components/recipes/atlas/resolution/ResolutionReader.d.ts +5 -0
- package/dist/components/recipes/atlas/resolution/appearance.d.ts +58 -0
- package/dist/components/recipes/atlas/resolution/boundaryLoomLayout.d.ts +4 -0
- package/dist/components/recipes/atlas/resolution/chartProps.d.ts +75 -0
- package/dist/components/recipes/atlas/resolution/componentCutawayLayout.d.ts +12 -0
- package/dist/components/recipes/atlas/resolution/cutawayContext.d.ts +23 -0
- package/dist/components/recipes/atlas/resolution/cutawayGraph.d.ts +4 -0
- package/dist/components/recipes/atlas/resolution/cycles.d.ts +7 -0
- package/dist/components/recipes/atlas/resolution/evidence.d.ts +43 -0
- package/dist/components/recipes/atlas/resolution/glyphs.d.ts +40 -0
- package/dist/components/recipes/atlas/resolution/identity.d.ts +4 -0
- package/dist/components/recipes/atlas/resolution/indexGraph.d.ts +32 -0
- package/dist/components/recipes/atlas/resolution/ownership.d.ts +25 -0
- package/dist/components/recipes/atlas/resolution/plan.d.ts +12 -0
- package/dist/components/recipes/atlas/resolution/ports.d.ts +44 -0
- package/dist/components/recipes/atlas/resolution/prepare.d.ts +4 -0
- package/dist/components/recipes/atlas/resolution/project.d.ts +70 -0
- package/dist/components/recipes/atlas/resolution/queries.d.ts +23 -0
- package/dist/components/recipes/atlas/resolution/resolutionAtlasLayout.d.ts +9 -0
- package/dist/components/recipes/atlas/resolution/rules.d.ts +14 -0
- package/dist/components/recipes/atlas/resolution/scene.d.ts +52 -0
- package/dist/components/recipes/atlas/resolution/selection.d.ts +3 -0
- package/dist/components/recipes/atlas/resolution/sets.d.ts +10 -0
- package/dist/components/recipes/atlas/resolution/types.d.ts +401 -0
- package/dist/components/recipes/atlas/resolution/validate.d.ts +4 -0
- package/dist/components/recipes/atlas/resolution/witnesses.d.ts +18 -0
- package/dist/components/recipes/atlas/resolution/worker.d.ts +34 -0
- package/dist/components/recipes/lineageDag.d.ts +4 -0
- package/dist/components/recipes/recipeUtils.d.ts +2 -0
- package/dist/components/recipes/transitDiagram.d.ts +2 -61
- package/dist/components/recipes/transitDiagramTypes.d.ts +65 -0
- package/dist/components/semiotic-ai.d.ts +2 -0
- package/dist/components/semiotic-experimental-network-resolution-react.d.ts +12 -0
- package/dist/components/semiotic-experimental-network-resolution.d.ts +13 -0
- package/dist/components/semiotic-geo.d.ts +1 -1
- package/dist/components/semiotic-network-perspective-core.d.ts +6 -0
- package/dist/components/semiotic-network.d.ts +1 -1
- package/dist/components/semiotic-ordinal.d.ts +1 -1
- package/dist/components/semiotic-physics.d.ts +1 -1
- package/dist/components/semiotic-realtime-core.d.ts +1 -1
- package/dist/components/semiotic-realtime-react.d.ts +2 -0
- package/dist/components/semiotic-utils-core.d.ts +3 -1
- package/dist/components/semiotic-vite.d.ts +2 -0
- package/dist/components/semiotic-xy.d.ts +3 -1
- package/dist/components/semiotic.d.ts +3 -1
- package/dist/components/server/renderToStaticSVG.d.ts +2 -1
- package/dist/components/server/serverChartConfigShared.d.ts +2 -0
- package/dist/components/store/LinkedCrosshairStore.d.ts +43 -11
- package/dist/components/store/themeCore.d.ts +2 -0
- package/dist/components/stream/frameKeyboardNavigation.d.ts +3 -1
- package/dist/components/stream/hoverUtils.d.ts +5 -0
- package/dist/components/stream/networkCustomLayout.d.ts +3 -0
- package/dist/components/stream/networkPerspective.d.ts +2 -0
- package/dist/components/stream/networkPerspectiveFit.d.ts +12 -1
- package/dist/components/stream/networkPerspectiveSolid.d.ts +1 -1
- package/dist/components/stream/networkSceneTypes.d.ts +4 -0
- package/dist/components/stream/networkTypes.d.ts +2 -0
- package/dist/components/stream/pipelineConfig.d.ts +2 -0
- package/dist/components/stream/pipelineDomainResolution.d.ts +4 -1
- package/dist/components/stream/types.d.ts +2 -0
- package/dist/components/stream/useFrame.d.ts +2 -0
- package/dist/components/stream/xySceneBuilders/types.d.ts +2 -0
- package/dist/controls.module.min.js +31 -31
- package/dist/geo.min.js +150 -150
- package/dist/geo.module.min.js +31 -31
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/rough.module.min.js +1 -1
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +2 -0
- package/dist/semiotic-ai.module.min.js +13 -13
- package/dist/semiotic-artifact-react.module.min.js +4 -4
- package/dist/semiotic-artifact.min.js +1 -1
- package/dist/semiotic-artifact.module.min.js +1 -1
- package/dist/semiotic-atlas-selection.module.min.js +1 -1
- package/dist/semiotic-atlas.module.min.js +10 -12
- package/dist/semiotic-client-cjs-shared.min.js +1078 -925
- package/dist/semiotic-client-glyph.module.min.js +2 -2
- package/dist/semiotic-client-shared.module.min.js +1 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +8 -9
- package/dist/semiotic-experimental-network-resolution-react.d.ts +12 -0
- package/dist/semiotic-experimental-network-resolution-react.min.js +2 -0
- package/dist/semiotic-experimental-network-resolution-react.module.min.js +89 -0
- package/dist/semiotic-experimental-network-resolution.d.ts +13 -0
- package/dist/semiotic-experimental-network-resolution.min.js +2 -0
- package/dist/semiotic-experimental-network-resolution.module.min.js +2 -0
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +9 -10
- package/dist/semiotic-geo.d.ts +1 -1
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-network-perspective-core.d.ts +6 -0
- package/dist/semiotic-network-perspective-core.min.js +1 -0
- package/dist/semiotic-network-perspective-core.module.min.js +1 -0
- package/dist/semiotic-network-perspective.module.min.js +1 -1
- package/dist/semiotic-network-placement.min.js +4 -0
- package/dist/semiotic-network-placement.module.min.js +4 -0
- package/dist/semiotic-network-zoom.module.min.js +1 -1
- package/dist/semiotic-network.d.ts +1 -1
- package/dist/semiotic-ordinal.d.ts +1 -1
- package/dist/semiotic-physics.d.ts +1 -1
- package/dist/semiotic-realtime-core.d.ts +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-realtime-react.d.ts +2 -0
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +101 -106
- package/dist/semiotic-recipes-core.module.min.js +75 -76
- package/dist/semiotic-server-edge-node.module.min.js +391 -392
- package/dist/semiotic-server-edge.min.js +387 -388
- package/dist/semiotic-server-edge.module.min.js +371 -371
- package/dist/semiotic-server-node.min.js +387 -388
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-utils-core.d.ts +3 -1
- package/dist/semiotic-utils-core.min.js +12 -11
- package/dist/semiotic-utils-core.module.min.js +12 -11
- package/dist/semiotic-value.module.min.js +4 -4
- package/dist/semiotic-vite.d.ts +2 -0
- package/dist/semiotic-vite.min.js +1 -0
- package/dist/semiotic-vite.module.min.js +1 -0
- package/dist/semiotic-xy.d.ts +3 -1
- package/dist/semiotic.d.ts +3 -1
- package/dist/semiotic.module.min.js +12 -12
- package/dist/server.min.js +387 -388
- package/dist/server.module.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +42 -13
- package/dist/c-2AB65V3L.min.js +0 -1
- package/dist/c-2U5JMOPN.min.js +0 -88
- package/dist/c-3DCTIRW4.min.js +0 -1
- package/dist/c-3OKFRTYM.min.js +0 -1
- package/dist/c-3VZHOPFW.min.js +0 -1
- package/dist/c-4ZSQIBC7.min.js +0 -1
- package/dist/c-5M4RUS7V.min.js +0 -34
- package/dist/c-6O5WWP7F.min.js +0 -1
- package/dist/c-73TOIYIW.min.js +0 -48
- package/dist/c-AE4M7BWH.min.js +0 -1
- package/dist/c-AEIK2NFW.min.js +0 -30
- package/dist/c-AFQSEIZ4.min.js +0 -4
- package/dist/c-BBX7DVVB.min.js +0 -51
- package/dist/c-CNYFCSG4.min.js +0 -5
- package/dist/c-E6QH2WYE.min.js +0 -1
- package/dist/c-GOMQWQJR.min.js +0 -1
- package/dist/c-GTYG4PDT.min.js +0 -1
- package/dist/c-H23GIKTK.min.js +0 -1
- package/dist/c-HQLUUSRJ.min.js +0 -1
- package/dist/c-HXUOFDSD.min.js +0 -64
- package/dist/c-L3LKYOLK.min.js +0 -1
- package/dist/c-MIKDFGKH.min.js +0 -1
- package/dist/c-OYSPTIAG.min.js +0 -1
- package/dist/c-PWPJNYQP.min.js +0 -1
- package/dist/c-QZ5SWKHC.min.js +0 -392
- package/dist/c-RXJH4IRX.min.js +0 -41
- package/dist/c-SN2D6QMH.min.js +0 -1
- package/dist/c-U5YGK6HL.min.js +0 -1
- package/dist/c-VIN5ASK2.min.js +0 -37
- package/dist/c-XZ3GASUJ.min.js +0 -1
- package/dist/c-ZLZZTH4I.min.js +0 -118
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
[](https://mcpqueen.com/s/io.github.nteract/semiotic)
|
|
11
11
|
|
|
12
|
-
A React data visualization library designed for AI-assisted development.
|
|
12
|
+
A React data visualization library designed for AI-assisted development and streaming data.
|
|
13
13
|
|
|
14
14
|
Start with a small chart component. Add network graphs, streaming data and
|
|
15
15
|
coordinated views when the task needs them. Structured schemas, diagnostics
|
|
@@ -26,15 +26,15 @@ evidence scope; source availability does not establish installed or deployed par
|
|
|
26
26
|
<img src="./docs/public/assets/img/semiotic-release-dashboard.svg" alt="Semiotic release dashboard showing chart count, bundle sizes, capability coverage, chart families, and documentation growth" width="100%">
|
|
27
27
|
<!-- semiotic-readme-dashboard:end -->
|
|
28
28
|
|
|
29
|
-
## What's New in 3.12.
|
|
29
|
+
## What's New in 3.12.1
|
|
30
30
|
|
|
31
|
-
3.12.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
3.12.1 extends network perspectives to the Atlas readers and improves projected
|
|
32
|
+
layout sizing, annotation anchors, and static SVG precision. Placement components
|
|
33
|
+
retain their identity across package entries, and `semioticVite()` removes unused
|
|
34
|
+
worker assets from Vite 7 builds while preserving workers that are used.
|
|
35
35
|
|
|
36
|
-
See [the changelog](CHANGELOG.md#
|
|
37
|
-
|
|
36
|
+
See [the changelog](CHANGELOG.md#3121---2026-10-05) for the full list and SVG
|
|
37
|
+
compatibility notes.
|
|
38
38
|
|
|
39
39
|
## Why Semiotic
|
|
40
40
|
|
|
@@ -387,7 +387,7 @@ loadConversationArc(sink.load(), { enabled: false })
|
|
|
387
387
|
|
|
388
388
|
## Bundle Sizes
|
|
389
389
|
|
|
390
|
-
Semiotic ships
|
|
390
|
+
Semiotic ships 41 stable JavaScript entry points (40 subpaths plus the root). **Don't import from `"semiotic"` unless you need everything** — use the smallest sub-path that matches your charts or tooling.
|
|
391
391
|
|
|
392
392
|
Custom network layouts can opt into a virtual zoom/pan viewport through `semiotic/network/zoom`. It exports `ZoomableNetworkCustomChart` and projected-size/LOD hooks; ordinary chart imports exclude its gesture and LOD runtime.
|
|
393
393
|
|
|
@@ -398,45 +398,47 @@ The numbers below are **first-party artifact cost**: the gzip size of Semiotic's
|
|
|
398
398
|
|
|
399
399
|
| Entry Point | gzip | What's inside |
|
|
400
400
|
|---|---|---|
|
|
401
|
-
| `semiotic/atlas` | **
|
|
401
|
+
| `semiotic/atlas` | **303 KB** | Motif Braid, Dependency Forest, and Flow Circuit readers |
|
|
402
402
|
| `semiotic/atlas/core` | **14 KB** | Network Atlas preparation, projections, and evidence queries |
|
|
403
403
|
| `semiotic/access` | **29 KB** | Chart Access Contract factory and first-wave baseline contracts |
|
|
404
404
|
| `semiotic/evidence` | **45 KB** | Chart Evidence Envelope, deterministic hashing, and publication gate |
|
|
405
405
|
| `semiotic/artifact` | **123 KB** | Renderer-independent contracts, claims, time, policy, grounding, and transfer audits |
|
|
406
406
|
| `semiotic/artifact/react` | **4 KB** | Accessible progressive disclosure for artifact contracts and policy evaluations |
|
|
407
|
-
| `semiotic/line` | **
|
|
408
|
-
| `semiotic/xy` | **
|
|
409
|
-
| `semiotic/ordinal` | **
|
|
410
|
-
| `semiotic/network` | **
|
|
411
|
-
| `semiotic/network/zoom` | **
|
|
407
|
+
| `semiotic/line` | **145 KB** | LineChart only — one-chart micro boundary |
|
|
408
|
+
| `semiotic/xy` | **184 KB** | LineChart, AreaChart, Scatterplot, Heatmap, + 8 more XY charts |
|
|
409
|
+
| `semiotic/ordinal` | **136 KB** | BarChart, PieChart, BoxPlot, Histogram, + 11 more categorical charts |
|
|
410
|
+
| `semiotic/network` | **178 KB** | ForceDirectedGraph, SankeyDiagram, ProcessSankey, Treemap, + 4 more |
|
|
411
|
+
| `semiotic/network/zoom` | **184 KB** | Optional virtual network viewport, camera controls and consumer-owned LOD |
|
|
412
412
|
| `semiotic/network/perspective` | **2 KB** | Isometric pictograms and an accessible perspective toggle (the prop ships in ./network) |
|
|
413
|
-
| `semiotic/
|
|
414
|
-
| `semiotic/
|
|
415
|
-
| `semiotic/
|
|
416
|
-
| `semiotic/realtime
|
|
417
|
-
| `semiotic/
|
|
418
|
-
| `semiotic/
|
|
419
|
-
| `semiotic/server
|
|
420
|
-
| `semiotic/
|
|
421
|
-
| `semiotic/
|
|
413
|
+
| `semiotic/network/perspective/core` | **3 KB** | Projection sizing, resolution, and SVG placement helpers |
|
|
414
|
+
| `semiotic/vite` | **1 KB** | Build plugin for unused Semiotic worker assets |
|
|
415
|
+
| `semiotic/geo` | **112 KB** | ChoroplethMap, FlowMap, DistanceCartogram, ProportionalSymbolMap |
|
|
416
|
+
| `semiotic/realtime` | **211 KB** | RealtimeLineChart, RealtimeHistogram, + 4 streaming charts |
|
|
417
|
+
| `semiotic/realtime/core` | **210 KB** | Streaming chart types, HOCs, and buffer helpers |
|
|
418
|
+
| `semiotic/realtime/react` | **2 KB** | Stream status and synced push hooks |
|
|
419
|
+
| `semiotic/server` | **265 KB** | renderChart, renderDashboard, renderToImage, renderToAnimatedGif |
|
|
420
|
+
| `semiotic/server/node` | **265 KB** | renderChart, renderDashboard, renderToImage, renderToAnimatedGif |
|
|
421
|
+
| `semiotic/server/edge` | **274 KB** | renderChart, renderChartWithEvidence, renderToStaticSVG, renderDashboard |
|
|
422
|
+
| `semiotic/utils` | **107 KB** | ThemeProvider, numeric/accessibility audits, serialization — no chart components |
|
|
423
|
+
| `semiotic/utils/core` | **98 KB** | Pure theme helpers, numeric/accessibility audits, and serialization |
|
|
422
424
|
| `semiotic/utils/react` | **8 KB** | ThemeProvider, useTheme, useReducedMotion, useHighContrast, useStreamStatus |
|
|
423
425
|
| `semiotic/recipes` | **114 KB** | Pure layout functions (waffle, marimekko, flextree, dagre, …) |
|
|
424
|
-
| `semiotic/recipes/core` | **
|
|
426
|
+
| `semiotic/recipes/core` | **113 KB** | Pure layout functions (waffle, marimekko, flextree, dagre, …) |
|
|
425
427
|
| `semiotic/recipes/react` | **2 KB** | Glyph and React layout-selection helpers |
|
|
426
428
|
| `semiotic/themes` | **11 KB** | Theme presets only (tufte, carbon, etc.) |
|
|
427
429
|
| `semiotic/themes/core` | **11 KB** | Theme presets and token helpers |
|
|
428
|
-
| `semiotic/themes/react` | **
|
|
430
|
+
| `semiotic/themes/react` | **8 KB** | ThemeProvider/useTheme and hooks |
|
|
429
431
|
| `semiotic/data` | **5 KB** | bin, rollup, groupBy, pivot, fromVegaLite |
|
|
430
432
|
| `semiotic/value` | **6 KB** | BigNumber — focal-value KPI / scorecard (SingleValueFrame POC) |
|
|
431
|
-
| `semiotic/physics` | **
|
|
433
|
+
| `semiotic/physics` | **172 KB** | GaltonBoardChart, EventDropChart, UnitPileChart, CollisionSwarmChart, PacketFlowChart, PhysicsCustomChart |
|
|
432
434
|
| `semiotic/physics/matter` | **1 KB** | Matter.js migration helpers + optional peer guard (no chart components) |
|
|
433
435
|
| `semiotic/physics/rapier` | **1 KB** | Rapier peer guard + adapter decision metadata (no chart components) |
|
|
434
|
-
| `semiotic/ai` | **
|
|
436
|
+
| `semiotic/ai` | **643 KB** | All schema-backed charts + validation — optimized for LLM code generation |
|
|
435
437
|
| `semiotic/ai/core` | **140 KB** | suggestCharts, auditData, describeChart, repairChartConfig, tool adapters — no chart components |
|
|
436
438
|
| `semiotic/controls` | **18 KB** | DirectManipulationControl, CircularBrush, LinearBrush, MobileStandardControls, auditVisualizationControls — no frame renderer |
|
|
437
439
|
| `semiotic/rough` | **3 KB** | Optional deterministic Rough.js paint backend — exact Semiotic geometry remains authoritative |
|
|
438
440
|
| `semiotic/text` | **2 KB** | Optional Pretext annotation hook — peer package excluded |
|
|
439
|
-
| `semiotic` | **
|
|
441
|
+
| `semiotic` | **422 KB** | Full chart API and shared utilities |
|
|
440
442
|
|
|
441
443
|
<!-- semiotic-bundle-sizes:end -->
|
|
442
444
|
|
|
@@ -459,37 +461,39 @@ Method: fresh `npm pack --ignore-scripts` tarball → temporary consumer → min
|
|
|
459
461
|
|
|
460
462
|
| Public named import | Runtime | gzip initial load | gzip on demand |
|
|
461
463
|
|---|---:|---:|---:|
|
|
462
|
-
| `import {
|
|
464
|
+
| `import { semioticVite } from "semiotic/vite"` | node | **0.6 KiB** | — |
|
|
465
|
+
| `import { getNetworkPerspectiveSize } from "semiotic/network/perspective/core"` | browser | **1.1 KiB** | — |
|
|
466
|
+
| `import { MotifBraidChart } from "semiotic/atlas"` | browser | **102.4 KiB** | 29.2 KiB |
|
|
463
467
|
| `import { prepareNetworkAtlas } from "semiotic/atlas/core"` | browser | **5.9 KiB** | — |
|
|
464
|
-
| `import { LineChart } from "semiotic"` | browser | **
|
|
465
|
-
| `import { LineChart } from "semiotic/xy"` | browser | **117.
|
|
466
|
-
| `import { LineChart } from "semiotic/line"` | browser | **
|
|
467
|
-
| `import { BarChart } from "semiotic/ordinal"` | browser | **
|
|
468
|
-
| `import { SankeyDiagram } from "semiotic/network"` | browser | **125.
|
|
469
|
-
| `import { ZoomableNetworkCustomChart } from "semiotic/network/zoom"` | browser | **
|
|
468
|
+
| `import { LineChart } from "semiotic"` | browser | **118.1 KiB** | 43.8 KiB |
|
|
469
|
+
| `import { LineChart } from "semiotic/xy"` | browser | **117.8 KiB** | 31.8 KiB |
|
|
470
|
+
| `import { LineChart } from "semiotic/line"` | browser | **118.0 KiB** | 31.8 KiB |
|
|
471
|
+
| `import { BarChart } from "semiotic/ordinal"` | browser | **101.5 KiB** | 14.7 KiB |
|
|
472
|
+
| `import { SankeyDiagram } from "semiotic/network"` | browser | **125.8 KiB** | 6.6 KiB |
|
|
473
|
+
| `import { ZoomableNetworkCustomChart } from "semiotic/network/zoom"` | browser | **102.3 KiB** | 29.2 KiB |
|
|
470
474
|
| `import { isometricGlyphs } from "semiotic/network/perspective"` | browser | **1.4 KiB** | — |
|
|
471
|
-
| `import { RealtimeLineChart } from "semiotic/realtime"` | browser | **
|
|
472
|
-
| `import { RingBuffer } from "semiotic/realtime/core"` | browser | **0.7 KiB** | 13.
|
|
475
|
+
| `import { RealtimeLineChart } from "semiotic/realtime"` | browser | **115.0 KiB** | 41.5 KiB |
|
|
476
|
+
| `import { RingBuffer } from "semiotic/realtime/core"` | browser | **0.7 KiB** | 13.6 KiB |
|
|
473
477
|
| `import { useStreamStatus } from "semiotic/realtime/react"` | browser | **0.6 KiB** | — |
|
|
474
|
-
| `import { GaltonBoardChart } from "semiotic/physics"` | browser | **85.
|
|
478
|
+
| `import { GaltonBoardChart } from "semiotic/physics"` | browser | **85.5 KiB** | 0.3 KiB |
|
|
475
479
|
| `import { MATTER_PHYSICS_CAPABILITIES } from "semiotic/physics/matter"` | browser | **0.1 KiB** | — |
|
|
476
480
|
| `import { RAPIER_PHYSICS_CAPABILITIES } from "semiotic/physics/rapier"` | browser | **0.2 KiB** | — |
|
|
477
|
-
| `import { renderChart } from "semiotic/server"` | node | **
|
|
478
|
-
| `import { generateFrameSVGs } from "semiotic/server/edge"` | node | **119.
|
|
479
|
-
| `import { renderToImage } from "semiotic/server/node"` | node | **
|
|
480
|
-
| `import { suggestCharts } from "semiotic/ai"` | browser | **38.9 KiB** | 13.
|
|
481
|
+
| `import { renderChart } from "semiotic/server"` | node | **283.5 KiB** | — |
|
|
482
|
+
| `import { generateFrameSVGs } from "semiotic/server/edge"` | node | **119.9 KiB** | — |
|
|
483
|
+
| `import { renderToImage } from "semiotic/server/node"` | node | **284.0 KiB** | 0.4 KiB |
|
|
484
|
+
| `import { suggestCharts } from "semiotic/ai"` | browser | **38.9 KiB** | 13.6 KiB |
|
|
481
485
|
| `import { suggestCharts } from "semiotic/ai/core"` | browser | **38.3 KiB** | — |
|
|
482
486
|
| `import { buildArtifactContract } from "semiotic/artifact"` | browser | **4.4 KiB** | — |
|
|
483
487
|
| `import { ArtifactInspector } from "semiotic/artifact/react"` | browser | **3.8 KiB** | — |
|
|
484
488
|
| `import { createChartAccessContract } from "semiotic/access"` | browser | **26.1 KiB** | — |
|
|
485
489
|
| `import { toEvidenceEnvelope } from "semiotic/evidence"` | browser | **41.8 KiB** | — |
|
|
486
490
|
| `import { bin } from "semiotic/data"` | browser | **0.9 KiB** | — |
|
|
487
|
-
| `import { ChoroplethMap } from "semiotic/geo"` | browser | **
|
|
491
|
+
| `import { ChoroplethMap } from "semiotic/geo"` | browser | **104.5 KiB** | 1.7 KiB |
|
|
488
492
|
| `import { usePretextAnnotations } from "semiotic/text"` | browser | **1.5 KiB** | — |
|
|
489
493
|
| `import { createRoughRenderMode } from "semiotic/rough"` | browser | **3.2 KiB** | — |
|
|
490
494
|
| `import { resolveThemePreset } from "semiotic/themes"` | browser | **2.5 KiB** | — |
|
|
491
495
|
| `import { resolveThemePreset } from "semiotic/themes/core"` | browser | **2.5 KiB** | — |
|
|
492
|
-
| `import { ThemeProvider } from "semiotic/themes/react"` | browser | **5.
|
|
496
|
+
| `import { ThemeProvider } from "semiotic/themes/react"` | browser | **5.1 KiB** | — |
|
|
493
497
|
| `import { validateProps } from "semiotic/utils"` | browser | **9.6 KiB** | — |
|
|
494
498
|
| `import { smartTickFormat } from "semiotic/utils/core"` | browser | **1.1 KiB** | — |
|
|
495
499
|
| `import { useReducedMotion } from "semiotic/utils/react"` | browser | **0.3 KiB** | — |
|
|
@@ -499,7 +503,7 @@ Method: fresh `npm pack --ignore-scripts` tarball → temporary consumer → min
|
|
|
499
503
|
| `import { BigNumber } from "semiotic/value"` | browser | **5.9 KiB** | — |
|
|
500
504
|
| `import { DirectManipulationControl } from "semiotic/controls"` | browser | **1.5 KiB** | — |
|
|
501
505
|
|
|
502
|
-
**Line-boundary interpretation:** the retained named import from `semiotic/line` emits
|
|
506
|
+
**Line-boundary interpretation:** the retained named import from `semiotic/line` emits 356.3 KiB raw versus 356.3 KiB from `semiotic/xy`; gzip differs by 0.1 KiB (0.1%). Tree-shaking converges both paths on the same LineChart implementation graph. Treat `semiotic/line` as a narrower API/direct-ESM artifact boundary, not an application-bundle saving. Do not add another per-chart entry until its packed named import beats the family path by both 10 KiB gzip and 7%.
|
|
503
507
|
|
|
504
508
|
<!-- semiotic-cold-consumer:end -->
|
|
505
509
|
|
package/ai/behaviorContracts.cjs
CHANGED
|
@@ -194,7 +194,7 @@ const BEHAVIOR_CONTRACTS = [
|
|
|
194
194
|
severity: "warning",
|
|
195
195
|
appliesTo: {},
|
|
196
196
|
summary: "Interactive charts keep useful tooltips unless omission is intentional. tooltip=false or an empty callback result (null/undefined, booleans, whitespace-only strings, empty arrays/fragments) suppresses the entire tooltip; numeric zero remains visible. Suppression is independent of hover observations and selection. Verify actual content and placement in a browser; do not silently disable tooltips to avoid a defect.",
|
|
197
|
-
agentAction: "Use the documented callback shape: custom/network chart tooltip callbacks receive authored data, while frameProps.tooltipContent receives a hover wrapper (unwrapDatum once). Handle node and edge records separately. Prefer default/configured tooltips or TooltipRoot for custom chrome. Use
|
|
197
|
+
agentAction: "Use the documented callback shape: custom/network chart tooltip callbacks receive authored data, while frameProps.tooltipContent receives a hover wrapper (unwrapDatum once). Handle node and edge records separately. Prefer default/configured tooltips or TooltipRoot for custom chrome. Use tooltip={{ content: renderer, chrome: \"none\" }} when consumer content owns chrome through wrapper components, or theme.tooltip.chrome: \"none\" for a shared policy. Config content receives authored data, with multi-series context when present. markTooltipChrome(renderer) remains supported; leave plain renderers unmarked. Wrapping libraries should call the exported hasTooltipContent on consumer results before adding elements. Hover a real mark and an edge when interactive; assert expected labels/values, one readable tooltip, no empty box or clipping after zoom/pan and resize, and disappearance on leave. Test tooltip=false and null-returning renderers without disabling enableHover when observations or selection are required. An inspector or a mount-only test does not establish tooltip behavior.",
|
|
198
198
|
},
|
|
199
199
|
{
|
|
200
200
|
id: "props.data-required-by-usage-mode",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var H=Object.create;var h=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var A=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},K=(e,t)=>{for(var r in t)h(e,r,{get:t[r],enumerable:!0})},R=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of J(t))!Y.call(e,o)&&o!==r&&h(e,o,{get:()=>t[o],enumerable:!(a=V(t,o))||a.enumerable});return e};var k=(e,t,r)=>(r=e!=null?H(W(e)):{},R(t||!e||!e.__esModule?h(r,"default",{value:e,enumerable:!0}):r,e)),X=e=>R(h({},"__esModule",{value:!0}),e);var O=A((Re,M)=>{"use strict";var S=require("path"),Q=require("fs"),P="<!-- semiotic-behavior-contracts:start -->",D="<!-- semiotic-behavior-contracts:end -->";function Z(){let e=[S.join(__dirname,"schema.json"),S.join(__dirname,"..","schema.json")];for(let t of e)try{let r=JSON.parse(Q.readFileSync(t,"utf8")),a=new Set;for(let o of r.tools||[])"data"in(o.function?.parameters?.properties||{})&&a.add(o.function.name);if(a.size>0)return a}catch{}return new Set}var g=[{component:"StackedAreaChart",required:["areaBy"],staticRequired:["data","areaBy"],pushRequired:["areaBy"],summary:"Stacked areas need a flat data array plus areaBy to identify the stacked series."},{component:"BubbleChart",required:["sizeBy"],staticRequired:["data","sizeBy"],pushRequired:["sizeBy"],summary:"Bubbles need sizeBy in addition to x/y accessors so radius encodes data rather than a constant point size."},{component:"StackedBarChart",required:["stackBy"],staticRequired:["data","stackBy"],pushRequired:["stackBy"],summary:"Stacked bars need stackBy to split each category into stack segments."},{component:"GroupedBarChart",required:["groupBy"],staticRequired:["data","groupBy"],pushRequired:["groupBy"],summary:"Grouped bars need groupBy to split each category into side-by-side bars."},{component:"SwimlaneChart",required:["subcategoryAccessor"],staticRequired:["data","subcategoryAccessor"],pushRequired:["subcategoryAccessor"],summary:"Swimlanes need subcategoryAccessor; colorBy defaults to the same field when not provided."},{component:"GaugeChart",required:["value"],staticRequired:["value"],pushRequired:[],summary:"GaugeChart is value-only. Its thresholds use { value, color, label? }; BigNumber thresholds use the distinct { at, level, color?, label? } vocabulary."},{component:"ForceDirectedGraph",required:["nodes","edges"],staticRequired:["nodes","edges"],pushRequired:["nodes","edges"],summary:"ForceDirectedGraph schema/rendering requires nodes and edges. If an agent infers nodes from edge endpoints, it must materialize a nodes array before returning code."}],u=["RealtimeLineChart","RealtimeHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","LineChart","AreaChart","StackedAreaChart","Scatterplot","BubbleChart","ConnectedScatterplot","CandlestickChart","MultiAxisLineChart","Heatmap","WaterfallChart","QuadrantChart","DifferenceChart","BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","LikertChart","SwimlaneChart","FunnelChart","RadarChart","ForceDirectedGraph","SankeyDiagram","ChordDiagram","ProportionalSymbolMap","DistanceCartogram","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart"],x=Z(),b=[{id:"accessibility.description-props",category:"accessibility",title:"Accessible chart text uses direct chart props",severity:"warning",appliesTo:{},summary:"High-level charts expose title for the visible name, description for a concise accessible description, summary for a screen-reader-only takeaway and interaction guidance, and accessibleTable for the data-table fallback.",agentAction:'Put title, description, summary, and accessibleTable directly on the chart component when they appear in its schema. If a consumer-owned role=img wraps the chart, use accessibleTable: { portalTarget: "element-id" } and render that target outside the image. For generated L1\u2013L3 description or a navigable chart tree, use ChartContainer with chartConfig plus describe and/or navigable; do not invent frameProps fields.'},{id:"interaction.cursor-is-presentation-only",category:"interaction",title:"Cursor styling does not create behavior",severity:"warning",appliesTo:{propsAny:["cursor"],propPathsAny:[["styleRules","*","style","cursor"]]},summary:"Cursor values in realtime props, retained mark styles, styleRules, and custom hit targets change pointer presentation only. They do not install click handlers, keyboard activation, observations, or accessibility semantics.",agentAction:"Use an actionable cursor only when the application separately supplies documented click or observation behavior and an accessible activation path. Treat cursor in serialized/static output as visual metadata, never as proof that a mark is interactive."},{id:"interaction.tooltip-content-and-verification",category:"interaction",title:"Tooltip behavior needs browser evidence",severity:"warning",appliesTo:{},summary:"Interactive charts keep useful tooltips unless omission is intentional. tooltip=false or an empty callback result (null/undefined, booleans, whitespace-only strings, empty arrays/fragments) suppresses the entire tooltip; numeric zero remains visible. Suppression is independent of hover observations and selection. Verify actual content and placement in a browser; do not silently disable tooltips to avoid a defect.",agentAction:"Use the documented callback shape: custom/network chart tooltip callbacks receive authored data, while frameProps.tooltipContent receives a hover wrapper (unwrapDatum once). Handle node and edge records separately. Prefer default/configured tooltips or TooltipRoot for custom chrome. Use markTooltipChrome(renderer) when a callback owns chrome through wrapper components; leave plain renderers unmarked. Wrapping libraries should call the exported hasTooltipContent on consumer results before adding elements. Hover a real mark and an edge when interactive; assert expected labels/values, one readable tooltip, no empty box or clipping after zoom/pan and resize, and disappearance on leave. Test tooltip=false and null-returning renderers without disabling enableHover when observations or selection are required. An inspector or a mount-only test does not establish tooltip behavior."},{id:"props.data-required-by-usage-mode",category:"required-props",title:"Data required by usage mode",severity:"error",appliesTo:{components:u},summary:"Static usage (`renderChart`, MCP previews, SSR snapshots, and copy/paste examples with immediate data) requires data in props. React push mode selects live ingestion by omitting data and mutating through a ref.",agentAction:'Pass usageMode="push" to `semiotic-ai --doctor` when validating ref-based JSX with no data prop. Keep usageMode="static" or omit it for renderChart/MCP/static configs where data must be present.'},{id:"color.category-precedence",category:"color",title:"Categorical color precedence",severity:"info",appliesTo:{propsAny:["colorBy","colorScheme"]},summary:"When colorBy is set, explicit CategoryColorProvider mappings, including those inherited through LinkedCharts, win for mapped categories. Unmapped categories fall back to explicit colorScheme, then ThemeProvider colors.categorical, then the built-in categorical fallback. Generated LinkedCharts colors do not override a child's colorScheme.",agentAction:"Use colorBy for categorical encodings. Use CategoryColorProvider or LinkedCharts for cross-chart consistency, colorScheme for per-chart fallback palettes, and avoid frameProps style functions unless intentionally bypassing HOC color resolution."},{id:"props.required-combinations",category:"required-props",title:"Required prop combinations",severity:"error",appliesTo:{components:g.map(e=>e.component)},summary:"Some chart families need semantic props beyond data. These combinations are enforced by validation/schema for static configs and remain required in push mode unless explicitly noted.",agentAction:"Before returning code, check the selected component against the required combinations list. For push mode, omit data but keep semantic props such as areaBy, sizeBy, stackBy, and groupBy.",combinations:g},{id:"streaming.push-mode-data",category:"streaming",title:"Push mode omits data",severity:"warning",appliesTo:{components:u},summary:"HOC push mode is selected by omitting the data prop entirely. Passing data={[]} is static empty data and can clear/reinitialize the frame on render.",agentAction:"For live charts, create a ref, omit data, then call ref.current.push() or pushMany(). For static renderChart/MCP snapshots, provide data because renderChart cannot push later."},{id:"streaming.serialized-proposal-snapshot",category:"streaming",title:"Serialized proposals keep the initial snapshot",severity:"warning",appliesTo:{components:u},summary:"A JSON component/props proposal for MCP, SSR, or evaluation is a static snapshot even when the request mentions future pushes. Keep the supplied initial rows in the component's real data prop and do not invent pushRows, pushRequirement, ref, or method props.",agentAction:"Return renderable initial props in JSON. If the requested deliverable is React push code, separately omit the controlled data prop in JSX, attach a ref, and call the documented imperative method from an effect or event handler.",example:'JSON snapshot: { "component": "LineChart", "props": { "data": [{"week":1,"users":120}], "xAccessor":"week", "yAccessor":"users" } }. React push code instead omits data and calls ref.current?.push(row).'},{id:"streaming.ref-mutations-require-id-accessors",category:"streaming",title:"Ref mutations need stable IDs",severity:"warning",appliesTo:{components:u},summary:"push() and pushMany() can append without IDs, but remove(id) and update(id, updater) require a stable ID accessor: pointIdAccessor for XY/realtime charts, dataIdAccessor for ordinal charts, and nodeIDAccessor/edgeIdAccessor for network operations.",agentAction:"When generating code that calls remove() or update(), include the matching ID accessor and make sure pushed rows carry that ID field."},{id:"rendering.renderchart-static-props",category:"rendering",title:"renderChart uses static props only",severity:"warning",appliesTo:{},summary:"MCP renderChart and semiotic/server renderChart render a single static SVG/PNG snapshot, never future ref pushes. semiotic/server accepts bounded data for realtime charts; MCP rendering excludes the five live Realtime components but includes TemporalHistogram.",agentAction:"Use complete static data for snapshots. For a Realtime component snapshot, use semiotic/server directly; for live behavior, return React code with a ref and do not promise MCP-rendered output."},{id:"serialization.formatters-are-react-callbacks",category:"serialization",title:"Axis formatters are React callbacks",severity:"error",appliesTo:{propsAny:["xFormat","yFormat","categoryFormat","valueFormat"]},summary:"xFormat, yFormat, categoryFormat, and valueFormat are callback props, not d3 format strings or axis-title strings. They are intentionally absent from JSON/MCP schemas and string values fail validation.",agentAction:"In serialized props, omit formatter callbacks and use xLabel, yLabel, categoryLabel, or valueLabel for axis titles. In React JSX, pass a function such as xFormat={value => formatAxis(value)}.",example:'JSON: { "xLabel": "Payload (KB)", "yLabel": "Response time (ms)" }. React-only: xFormat={value => formatNumber(value, { maximumFractionDigits: 0 })}.'},{id:"value.bignumber-wire-contract",category:"value",title:"Value components do not inherit chart-HOC props",severity:"error",appliesTo:{components:["BigNumber"]},summary:"BigNumber is a value component, not a chart HOC, so it does not inherit the common chart-HOC prop list. It uses label as its visible heading and supports description and summary; title and accessibleTable are invalid. Its percent format expects a ratio such as 0.97 and renders it as 97%.",agentAction:'Validate BigNumber against its own prop schema and remove inherited chart-HOC props such as title and accessibleTable before returning a proposal. Use label, description, and summary for text. For a 97-of-100 KPI, either pass value={0.97} with format="percent" or pass value={97} with format="number" and suffix="%"; do not combine value={97} with format="percent".',example:'{ "component": "BigNumber", "props": { "value": 97, "label": "SLA attainment", "format": "number", "suffix": "%", "target": { "value": 99, "label": "target", "format": "number" } } }'},{id:"geo.proportional-symbol-wire-shape",category:"geo",title:"Proportional symbol maps use geographic props",severity:"error",appliesTo:{components:["ProportionalSymbolMap"]},summary:"ProportionalSymbolMap reads point rows from points, longitude from xAccessor (default lon), latitude from yAccessor (default lat), and radius from sizeBy. sizeRange is the two-number pixel-radius range.",agentAction:"Use points, xAccessor, yAccessor, and sizeBy. Do not rename points to data or sizeBy to valueAccessor merely because the map renders circles.",example:'{ "points": [{"city":"A","longitude":-122.4,"latitude":37.8,"incidents":18}], "xAccessor":"longitude", "yAccessor":"latitude", "sizeBy":"incidents", "sizeRange":[5,40] }'},{id:"network.perspective-is-presentational",category:"network",title:"Network perspective is presentational",severity:"warning",appliesTo:{components:["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram","TreeDiagram","Treemap","CirclePack","OrbitDiagram"],propsAny:["perspective","projection"]},summary:"Network perspective is a parallel projection applied after layout. Layout coordinates and data semantics are unchanged, interaction and the accessible table follow the projected marks, and elevation is the only added encoding. Network charts use perspective, not projection, which belongs to geo charts.",agentAction:'Use a preset string ("isometric", "pixel", "dimetric", "military", "cabinet") or a config object in JSON; function elevation/extrude/marks and glyph are React-only. Choose it for categorical or topological positions, not measured ones, and do not describe it as 3D or WebGL. Rename projection to perspective on network charts.',example:'{ "component": "ForceDirectedGraph", "props": { "nodes": [{"id":"api","tier":2}], "edges": [], "perspective": { "type": "isometric", "elevation": "tier", "ground": { "grid": true } } } }'},{id:"physics.sample-and-mechanical-inputs",category:"physics",title:"Physics charts separate chart mode from simulation input",severity:"warning",appliesTo:{components:["GaltonBoardChart","UnitPileChart"]},summary:`Sample simulations use data plus the chart's accessors. Seeded no-data demonstrations use simulationMode="mechanical" (legacy mode="mechanical" remains accepted); mode otherwise carries chart display modes such as primary or sparkline.`,agentAction:"For observed Galton values pass data + valueAccessor. For unit piles pass data + categoryAccessor + valueAccessor. Use seed for reproducibility, bins for Galton columns, and unitValue for the amount represented by one full UnitPile circle; remainders use proportional area.",example:'{ "component": "GaltonBoardChart", "props": { "data": [{"id":"a","value":1}], "valueAccessor":"value", "bins":4, "seed":42 } }'},{id:"physics.push-uses-source-records",category:"physics",title:"Physics push methods ingest source records",severity:"error",appliesTo:{components:["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart"]},summary:"Physics HOC refs push source records through the chart's accessors. pushRows and dataIdAccessor are not component props; stable source id fields are retained on spawned bodies without an invented accessor.",agentAction:"For React live code, call ref.current?.push(row) or pushMany(rows). For serialized snapshots, append the rows to data. Keep category/value/time accessors, but omit pushRows and dataIdAccessor.",example:'ref.current?.push({ id: "c", team: "Blue", value: 2 }); <UnitPileChart ref={ref} categoryAccessor="team" valueAccessor="value" unitValue={1} />'},{id:"physics.live-source-reconciliation",category:"physics",title:"Distribution physics charts update bodies and projections together",severity:"warning",appliesTo:{components:["GaltonBoardChart","UnitPileChart","CollisionSwarmChart","EventDropChart"]},summary:"Bodies, categories, domains, and totals update together without changing React keys. getData() returns source rows. New data replaces live rows; rerunMS restores the seed.",agentAction:"Omit data for push mode; data=[] stays empty and rejects pushes. Use stable IDs and remove for source edits; popBodies only removes marks. Set xExtent/valueExtent/timeExtent for stable domains.",example:'ref.current?.update("a", row => ({ ...row, value: 102 })); ref.current?.remove("b");'},{id:"physics.event-admission-history",category:"physics",title:"EventDrop distinguishes admission history from current closure",severity:"error",appliesTo:{components:["EventDropChart"]},summary:"Arrival order determines historical lateness with a delay/function watermark. Equal arrival times keep source order. A window is closed when its end is at or below the watermark; previously accepted events stay accepted as later events advance it. An explicit watermark.value instead tests one fixed policy.",agentAction:"Use watermark={{delay: n}} for arrival-ordered admission, or watermarkAtArrivalAccessor for recorded thresholds independent of current closure. Keep all times in the same units. The current board has solid lids: accepted history starts below them, late arrivals roll left. For a chronological demonstration, supply successive data/watermark states and coordinate source time with travel. timeScale does not replay lid changes. Source projection labels describe snapshot totals; readEventDropOccupancy(metadata, bodies) counts current containers and in-flight bodies independently of source flags.",example:'{ "data": [{"time":1,"arrivalTime":2,"admission":-3}], "watermarkAtArrivalAccessor":"admission", "watermark":{"value":100} }'}];function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ee(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function te(e,t){if(!t)return!e.appliesTo?.components;let r=e.appliesTo?.components;return!r||r.includes(t)}function re(e,t){let r=e.appliesTo?.propsAny,a=e.appliesTo?.propPathsAny;return(!r||r.length===0)&&(!a||a.length===0)||r?.some(o=>T(t,o)&&t[o]!==void 0)?!0:a?.some(o=>y(t,o))??!1}function y(e,t){if(t.length===0)return e!==void 0;if(e===null||typeof e!="object")return!1;let[r,...a]=t;return r==="*"?Array.isArray(e)&&e.some(o=>y(o,a)):T(e,r)&&y(e[r],a)}function ae({component:e,props:t}={}){let r=ee(t);return b.filter(a=>te(a,e)&&re(a,r))}function B(e){return e==="push"?"push":"static"}function oe(e,t){return!(!x.has(e)||B(t)==="push"&&u.includes(e))}function se(e){return g.filter(t=>!e||t.component===e)}function q(e){let t=e.staticRequired||e.required,r=e.pushRequired||e.required.filter(o=>o!=="data"),a=r.length>0?r.join(" + "):"not supported";return`${e.component}: static ${t.join(" + ")}; push ${a}. ${e.summary}`}function ne(e){if(!e||e.length===0)return"";let t=["Behavior contracts:"];for(let r of e){if(t.push(` - [${r.id}] ${r.summary}`),r.combinations)for(let a of r.combinations)t.push(` ${q(a)}`);r.example&&t.push(` Example: ${r.example}`),t.push(` Action: ${r.agentAction}`)}return t.join(`
|
|
2
|
-
`)}function ie({compact:e=!1}={}){let t=[e?"## Behavior Contracts":"## AI Behavior Contracts","",P,"","These rules are generated from `ai/behaviorContracts.cjs` and are consumed by `semiotic-ai --doctor`, MCP resources, and docs checks.",""];for(let r of
|
|
3
|
-
`)}M.exports={BEHAVIOR_CONTRACTS:
|
|
1
|
+
"use strict";var H=Object.create;var h=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var A=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},K=(e,t)=>{for(var r in t)h(e,r,{get:t[r],enumerable:!0})},R=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of J(t))!Y.call(e,o)&&o!==r&&h(e,o,{get:()=>t[o],enumerable:!(a=V(t,o))||a.enumerable});return e};var k=(e,t,r)=>(r=e!=null?H(W(e)):{},R(t||!e||!e.__esModule?h(r,"default",{value:e,enumerable:!0}):r,e)),X=e=>R(h({},"__esModule",{value:!0}),e);var O=A((Re,M)=>{"use strict";var S=require("path"),Q=require("fs"),P="<!-- semiotic-behavior-contracts:start -->",D="<!-- semiotic-behavior-contracts:end -->";function Z(){let e=[S.join(__dirname,"schema.json"),S.join(__dirname,"..","schema.json")];for(let t of e)try{let r=JSON.parse(Q.readFileSync(t,"utf8")),a=new Set;for(let o of r.tools||[])"data"in(o.function?.parameters?.properties||{})&&a.add(o.function.name);if(a.size>0)return a}catch{}return new Set}var g=[{component:"StackedAreaChart",required:["areaBy"],staticRequired:["data","areaBy"],pushRequired:["areaBy"],summary:"Stacked areas need a flat data array plus areaBy to identify the stacked series."},{component:"BubbleChart",required:["sizeBy"],staticRequired:["data","sizeBy"],pushRequired:["sizeBy"],summary:"Bubbles need sizeBy in addition to x/y accessors so radius encodes data rather than a constant point size."},{component:"StackedBarChart",required:["stackBy"],staticRequired:["data","stackBy"],pushRequired:["stackBy"],summary:"Stacked bars need stackBy to split each category into stack segments."},{component:"GroupedBarChart",required:["groupBy"],staticRequired:["data","groupBy"],pushRequired:["groupBy"],summary:"Grouped bars need groupBy to split each category into side-by-side bars."},{component:"SwimlaneChart",required:["subcategoryAccessor"],staticRequired:["data","subcategoryAccessor"],pushRequired:["subcategoryAccessor"],summary:"Swimlanes need subcategoryAccessor; colorBy defaults to the same field when not provided."},{component:"GaugeChart",required:["value"],staticRequired:["value"],pushRequired:[],summary:"GaugeChart is value-only. Its thresholds use { value, color, label? }; BigNumber thresholds use the distinct { at, level, color?, label? } vocabulary."},{component:"ForceDirectedGraph",required:["nodes","edges"],staticRequired:["nodes","edges"],pushRequired:["nodes","edges"],summary:"ForceDirectedGraph schema/rendering requires nodes and edges. If an agent infers nodes from edge endpoints, it must materialize a nodes array before returning code."}],u=["RealtimeLineChart","RealtimeHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","LineChart","AreaChart","StackedAreaChart","Scatterplot","BubbleChart","ConnectedScatterplot","CandlestickChart","MultiAxisLineChart","Heatmap","WaterfallChart","QuadrantChart","DifferenceChart","BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","LikertChart","SwimlaneChart","FunnelChart","RadarChart","ForceDirectedGraph","SankeyDiagram","ChordDiagram","ProportionalSymbolMap","DistanceCartogram","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart"],x=Z(),C=[{id:"accessibility.description-props",category:"accessibility",title:"Accessible chart text uses direct chart props",severity:"warning",appliesTo:{},summary:"High-level charts expose title for the visible name, description for a concise accessible description, summary for a screen-reader-only takeaway and interaction guidance, and accessibleTable for the data-table fallback.",agentAction:'Put title, description, summary, and accessibleTable directly on the chart component when they appear in its schema. If a consumer-owned role=img wraps the chart, use accessibleTable: { portalTarget: "element-id" } and render that target outside the image. For generated L1\u2013L3 description or a navigable chart tree, use ChartContainer with chartConfig plus describe and/or navigable; do not invent frameProps fields.'},{id:"interaction.cursor-is-presentation-only",category:"interaction",title:"Cursor styling does not create behavior",severity:"warning",appliesTo:{propsAny:["cursor"],propPathsAny:[["styleRules","*","style","cursor"]]},summary:"Cursor values in realtime props, retained mark styles, styleRules, and custom hit targets change pointer presentation only. They do not install click handlers, keyboard activation, observations, or accessibility semantics.",agentAction:"Use an actionable cursor only when the application separately supplies documented click or observation behavior and an accessible activation path. Treat cursor in serialized/static output as visual metadata, never as proof that a mark is interactive."},{id:"interaction.tooltip-content-and-verification",category:"interaction",title:"Tooltip behavior needs browser evidence",severity:"warning",appliesTo:{},summary:"Interactive charts keep useful tooltips unless omission is intentional. tooltip=false or an empty callback result (null/undefined, booleans, whitespace-only strings, empty arrays/fragments) suppresses the entire tooltip; numeric zero remains visible. Suppression is independent of hover observations and selection. Verify actual content and placement in a browser; do not silently disable tooltips to avoid a defect.",agentAction:'Use the documented callback shape: custom/network chart tooltip callbacks receive authored data, while frameProps.tooltipContent receives a hover wrapper (unwrapDatum once). Handle node and edge records separately. Prefer default/configured tooltips or TooltipRoot for custom chrome. Use tooltip={{ content: renderer, chrome: "none" }} when consumer content owns chrome through wrapper components, or theme.tooltip.chrome: "none" for a shared policy. Config content receives authored data, with multi-series context when present. markTooltipChrome(renderer) remains supported; leave plain renderers unmarked. Wrapping libraries should call the exported hasTooltipContent on consumer results before adding elements. Hover a real mark and an edge when interactive; assert expected labels/values, one readable tooltip, no empty box or clipping after zoom/pan and resize, and disappearance on leave. Test tooltip=false and null-returning renderers without disabling enableHover when observations or selection are required. An inspector or a mount-only test does not establish tooltip behavior.'},{id:"props.data-required-by-usage-mode",category:"required-props",title:"Data required by usage mode",severity:"error",appliesTo:{components:u},summary:"Static usage (`renderChart`, MCP previews, SSR snapshots, and copy/paste examples with immediate data) requires data in props. React push mode selects live ingestion by omitting data and mutating through a ref.",agentAction:'Pass usageMode="push" to `semiotic-ai --doctor` when validating ref-based JSX with no data prop. Keep usageMode="static" or omit it for renderChart/MCP/static configs where data must be present.'},{id:"color.category-precedence",category:"color",title:"Categorical color precedence",severity:"info",appliesTo:{propsAny:["colorBy","colorScheme"]},summary:"When colorBy is set, explicit CategoryColorProvider mappings, including those inherited through LinkedCharts, win for mapped categories. Unmapped categories fall back to explicit colorScheme, then ThemeProvider colors.categorical, then the built-in categorical fallback. Generated LinkedCharts colors do not override a child's colorScheme.",agentAction:"Use colorBy for categorical encodings. Use CategoryColorProvider or LinkedCharts for cross-chart consistency, colorScheme for per-chart fallback palettes, and avoid frameProps style functions unless intentionally bypassing HOC color resolution."},{id:"props.required-combinations",category:"required-props",title:"Required prop combinations",severity:"error",appliesTo:{components:g.map(e=>e.component)},summary:"Some chart families need semantic props beyond data. These combinations are enforced by validation/schema for static configs and remain required in push mode unless explicitly noted.",agentAction:"Before returning code, check the selected component against the required combinations list. For push mode, omit data but keep semantic props such as areaBy, sizeBy, stackBy, and groupBy.",combinations:g},{id:"streaming.push-mode-data",category:"streaming",title:"Push mode omits data",severity:"warning",appliesTo:{components:u},summary:"HOC push mode is selected by omitting the data prop entirely. Passing data={[]} is static empty data and can clear/reinitialize the frame on render.",agentAction:"For live charts, create a ref, omit data, then call ref.current.push() or pushMany(). For static renderChart/MCP snapshots, provide data because renderChart cannot push later."},{id:"streaming.serialized-proposal-snapshot",category:"streaming",title:"Serialized proposals keep the initial snapshot",severity:"warning",appliesTo:{components:u},summary:"A JSON component/props proposal for MCP, SSR, or evaluation is a static snapshot even when the request mentions future pushes. Keep the supplied initial rows in the component's real data prop and do not invent pushRows, pushRequirement, ref, or method props.",agentAction:"Return renderable initial props in JSON. If the requested deliverable is React push code, separately omit the controlled data prop in JSX, attach a ref, and call the documented imperative method from an effect or event handler.",example:'JSON snapshot: { "component": "LineChart", "props": { "data": [{"week":1,"users":120}], "xAccessor":"week", "yAccessor":"users" } }. React push code instead omits data and calls ref.current?.push(row).'},{id:"streaming.ref-mutations-require-id-accessors",category:"streaming",title:"Ref mutations need stable IDs",severity:"warning",appliesTo:{components:u},summary:"push() and pushMany() can append without IDs, but remove(id) and update(id, updater) require a stable ID accessor: pointIdAccessor for XY/realtime charts, dataIdAccessor for ordinal charts, and nodeIDAccessor/edgeIdAccessor for network operations.",agentAction:"When generating code that calls remove() or update(), include the matching ID accessor and make sure pushed rows carry that ID field."},{id:"rendering.renderchart-static-props",category:"rendering",title:"renderChart uses static props only",severity:"warning",appliesTo:{},summary:"MCP renderChart and semiotic/server renderChart render a single static SVG/PNG snapshot, never future ref pushes. semiotic/server accepts bounded data for realtime charts; MCP rendering excludes the five live Realtime components but includes TemporalHistogram.",agentAction:"Use complete static data for snapshots. For a Realtime component snapshot, use semiotic/server directly; for live behavior, return React code with a ref and do not promise MCP-rendered output."},{id:"serialization.formatters-are-react-callbacks",category:"serialization",title:"Axis formatters are React callbacks",severity:"error",appliesTo:{propsAny:["xFormat","yFormat","categoryFormat","valueFormat"]},summary:"xFormat, yFormat, categoryFormat, and valueFormat are callback props, not d3 format strings or axis-title strings. They are intentionally absent from JSON/MCP schemas and string values fail validation.",agentAction:"In serialized props, omit formatter callbacks and use xLabel, yLabel, categoryLabel, or valueLabel for axis titles. In React JSX, pass a function such as xFormat={value => formatAxis(value)}.",example:'JSON: { "xLabel": "Payload (KB)", "yLabel": "Response time (ms)" }. React-only: xFormat={value => formatNumber(value, { maximumFractionDigits: 0 })}.'},{id:"value.bignumber-wire-contract",category:"value",title:"Value components do not inherit chart-HOC props",severity:"error",appliesTo:{components:["BigNumber"]},summary:"BigNumber is a value component, not a chart HOC, so it does not inherit the common chart-HOC prop list. It uses label as its visible heading and supports description and summary; title and accessibleTable are invalid. Its percent format expects a ratio such as 0.97 and renders it as 97%.",agentAction:'Validate BigNumber against its own prop schema and remove inherited chart-HOC props such as title and accessibleTable before returning a proposal. Use label, description, and summary for text. For a 97-of-100 KPI, either pass value={0.97} with format="percent" or pass value={97} with format="number" and suffix="%"; do not combine value={97} with format="percent".',example:'{ "component": "BigNumber", "props": { "value": 97, "label": "SLA attainment", "format": "number", "suffix": "%", "target": { "value": 99, "label": "target", "format": "number" } } }'},{id:"geo.proportional-symbol-wire-shape",category:"geo",title:"Proportional symbol maps use geographic props",severity:"error",appliesTo:{components:["ProportionalSymbolMap"]},summary:"ProportionalSymbolMap reads point rows from points, longitude from xAccessor (default lon), latitude from yAccessor (default lat), and radius from sizeBy. sizeRange is the two-number pixel-radius range.",agentAction:"Use points, xAccessor, yAccessor, and sizeBy. Do not rename points to data or sizeBy to valueAccessor merely because the map renders circles.",example:'{ "points": [{"city":"A","longitude":-122.4,"latitude":37.8,"incidents":18}], "xAccessor":"longitude", "yAccessor":"latitude", "sizeBy":"incidents", "sizeRange":[5,40] }'},{id:"network.perspective-is-presentational",category:"network",title:"Network perspective is presentational",severity:"warning",appliesTo:{components:["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram","TreeDiagram","Treemap","CirclePack","OrbitDiagram"],propsAny:["perspective","projection"]},summary:"Network perspective is a parallel projection applied after layout. Layout coordinates and data semantics are unchanged, interaction and the accessible table follow the projected marks, and elevation is the only added encoding. Network charts use perspective, not projection, which belongs to geo charts.",agentAction:'Use a preset string ("isometric", "pixel", "dimetric", "military", "cabinet") or a config object in JSON; function elevation/extrude/marks and glyph are React-only. Choose it for categorical or topological positions, not measured ones, and do not describe it as 3D or WebGL. Rename projection to perspective on network charts.',example:'{ "component": "ForceDirectedGraph", "props": { "nodes": [{"id":"api","tier":2}], "edges": [], "perspective": { "type": "isometric", "elevation": "tier", "ground": { "grid": true } } } }'},{id:"physics.sample-and-mechanical-inputs",category:"physics",title:"Physics charts separate chart mode from simulation input",severity:"warning",appliesTo:{components:["GaltonBoardChart","UnitPileChart"]},summary:`Sample simulations use data plus the chart's accessors. Seeded no-data demonstrations use simulationMode="mechanical" (legacy mode="mechanical" remains accepted); mode otherwise carries chart display modes such as primary or sparkline.`,agentAction:"For observed Galton values pass data + valueAccessor. For unit piles pass data + categoryAccessor + valueAccessor. Use seed for reproducibility, bins for Galton columns, and unitValue for the amount represented by one full UnitPile circle; remainders use proportional area.",example:'{ "component": "GaltonBoardChart", "props": { "data": [{"id":"a","value":1}], "valueAccessor":"value", "bins":4, "seed":42 } }'},{id:"physics.push-uses-source-records",category:"physics",title:"Physics push methods ingest source records",severity:"error",appliesTo:{components:["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart"]},summary:"Physics HOC refs push source records through the chart's accessors. pushRows and dataIdAccessor are not component props; stable source id fields are retained on spawned bodies without an invented accessor.",agentAction:"For React live code, call ref.current?.push(row) or pushMany(rows). For serialized snapshots, append the rows to data. Keep category/value/time accessors, but omit pushRows and dataIdAccessor.",example:'ref.current?.push({ id: "c", team: "Blue", value: 2 }); <UnitPileChart ref={ref} categoryAccessor="team" valueAccessor="value" unitValue={1} />'},{id:"physics.live-source-reconciliation",category:"physics",title:"Distribution physics charts update bodies and projections together",severity:"warning",appliesTo:{components:["GaltonBoardChart","UnitPileChart","CollisionSwarmChart","EventDropChart"]},summary:"Bodies, categories, domains, and totals update together without changing React keys. getData() returns source rows. New data replaces live rows; rerunMS restores the seed.",agentAction:"Omit data for push mode; data=[] stays empty and rejects pushes. Use stable IDs and remove for source edits; popBodies only removes marks. Set xExtent/valueExtent/timeExtent for stable domains.",example:'ref.current?.update("a", row => ({ ...row, value: 102 })); ref.current?.remove("b");'},{id:"physics.event-admission-history",category:"physics",title:"EventDrop distinguishes admission history from current closure",severity:"error",appliesTo:{components:["EventDropChart"]},summary:"Arrival order determines historical lateness with a delay/function watermark. Equal arrival times keep source order. A window is closed when its end is at or below the watermark; previously accepted events stay accepted as later events advance it. An explicit watermark.value instead tests one fixed policy.",agentAction:"Use watermark={{delay: n}} for arrival-ordered admission, or watermarkAtArrivalAccessor for recorded thresholds independent of current closure. Keep all times in the same units. The current board has solid lids: accepted history starts below them, late arrivals roll left. For a chronological demonstration, supply successive data/watermark states and coordinate source time with travel. timeScale does not replay lid changes. Source projection labels describe snapshot totals; readEventDropOccupancy(metadata, bodies) counts current containers and in-flight bodies independently of source flags.",example:'{ "data": [{"time":1,"arrivalTime":2,"admission":-3}], "watermarkAtArrivalAccessor":"admission", "watermark":{"value":100} }'}];function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ee(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function te(e,t){if(!t)return!e.appliesTo?.components;let r=e.appliesTo?.components;return!r||r.includes(t)}function re(e,t){let r=e.appliesTo?.propsAny,a=e.appliesTo?.propPathsAny;return(!r||r.length===0)&&(!a||a.length===0)||r?.some(o=>T(t,o)&&t[o]!==void 0)?!0:a?.some(o=>y(t,o))??!1}function y(e,t){if(t.length===0)return e!==void 0;if(e===null||typeof e!="object")return!1;let[r,...a]=t;return r==="*"?Array.isArray(e)&&e.some(o=>y(o,a)):T(e,r)&&y(e[r],a)}function ae({component:e,props:t}={}){let r=ee(t);return C.filter(a=>te(a,e)&&re(a,r))}function B(e){return e==="push"?"push":"static"}function oe(e,t){return!(!x.has(e)||B(t)==="push"&&u.includes(e))}function se(e){return g.filter(t=>!e||t.component===e)}function q(e){let t=e.staticRequired||e.required,r=e.pushRequired||e.required.filter(o=>o!=="data"),a=r.length>0?r.join(" + "):"not supported";return`${e.component}: static ${t.join(" + ")}; push ${a}. ${e.summary}`}function ne(e){if(!e||e.length===0)return"";let t=["Behavior contracts:"];for(let r of e){if(t.push(` - [${r.id}] ${r.summary}`),r.combinations)for(let a of r.combinations)t.push(` ${q(a)}`);r.example&&t.push(` Example: ${r.example}`),t.push(` Action: ${r.agentAction}`)}return t.join(`
|
|
2
|
+
`)}function ie({compact:e=!1}={}){let t=[e?"## Behavior Contracts":"## AI Behavior Contracts","",P,"","These rules are generated from `ai/behaviorContracts.cjs` and are consumed by `semiotic-ai --doctor`, MCP resources, and docs checks.",""];for(let r of C){if(t.push(`- **${r.title}** (\`${r.id}\`): ${r.summary}`),e||t.push(` Agent action: ${r.agentAction}`),r.combinations){let a=r.combinations.map(q).join(" ");t.push(` Required combinations: ${a}`)}!e&&r.example&&t.push(` Example: \`${r.example}\``)}return t.push("",D),t.join(`
|
|
3
|
+
`)}M.exports={BEHAVIOR_CONTRACTS:C,DOC_MARKER_END:D,DOC_MARKER_START:P,PUSH_MODE_COMPONENTS:u,REQUIRED_COMBINATIONS:g,STATIC_DATA_COMPONENTS:x,behaviorContractsFor:ae,dataRequiredForUsageMode:oe,formatBehaviorContractsMarkdown:ie,formatDoctorBehaviorContracts:ne,normalizeUsageMode:B,requiredCombinationsFor:se}});var L=A((ke,G)=>{"use strict";var F=["xy","ordinal","network","geo","realtime","physics","value","recipe"],E={xy:["LineChart","BumpChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","BubbleChart","Heatmap","QuadrantChart","MultiAxisLineChart","WaterfallChart","CandlestickChart","ConnectedScatterplot","ScatterplotMatrix","MinimapChart"],ordinal:["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","GaugeChart","FunnelChart","RadarChart","SwimlaneChart","LikertChart"],network:["MotifBraidChart","DependencyForestChart","ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram","TreeDiagram","Treemap","CirclePack","OrbitDiagram"],geo:["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"],realtime:["RealtimeLineChart","RealtimeHistogram","TemporalHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap"],physics:["FlowCircuitChart","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","ChainReactionChart"],value:["BigNumber"],recipe:["ParallelCoordinatesRecipe","CalendarHeatmapRecipe"]},b=new Map;for(let[e,t]of Object.entries(E))for(let r of t)b.set(r,e);var ce={PhysicsCustomChart:"physics"};function v(e){return e.tools.map(t=>t.function)}function U(e){let t=b.get(e);if(!t)throw new Error(`No AI component metadata category for "${e}"`);return t}function le(e){return b.get(e)??ce[e]}function I(e){return e==="physics"?"semiotic/physics":e==="recipe"?"semiotic/ai":e==="geo"?"semiotic/geo":`semiotic/${e}`}function N(e){return`semiotic://schema/${encodeURIComponent(e)}`}function $(e){let t=typeof e=="string"?e:e.name,r=U(t),a=r==="realtime"&&t.startsWith("Realtime");return{name:t,category:r,importPath:["MotifBraidChart","DependencyForestChart","FlowCircuitChart"].includes(t)?"semiotic/atlas":I(r),schemaResourceUri:N(t),renderable:!a,requiresLiveData:a,description:typeof e=="string"?void 0:e.description}}function de(e,t){let r=v(e),a=r.find(n=>n.name===t);if(a)return a;let o=t.toLowerCase();return r.find(n=>n.name.toLowerCase()===o)}function pe(e){let t=v(e).map($),r={};for(let a of F)r[a]=[];for(let a of t)r[a.category].push(a.name);for(let a of Object.values(r))a.sort();return{version:e.version,totalComponents:t.length,renderableComponents:t.filter(a=>a.renderable).length,browserOnlyComponents:t.filter(a=>!a.renderable).length,requiresLiveDataComponents:t.filter(a=>a.requiresLiveData).length,categories:r,components:t}}G.exports={CATEGORY_ORDER:F,COMPONENTS_BY_CATEGORY:E,categoryForComponent:U,categoryForAIExport:le,componentIndexFromSchema:pe,findComponent:de,importPathForCategory:I,metadataForComponent:$,schemaResourceUriForComponent:N,schemaEntries:v}});var we={};K(we,{diagnoseChart:()=>fe});module.exports=X(we);var j=k(O()),z=k(L()),{dataRequiredForUsageMode:w,normalizeUsageMode:ue}=j.default,{findComponent:me,schemaEntries:he,COMPONENTS_BY_CATEGORY:ge}=z.default;function fe(e,t,r){let{component:a,props:o}=e,n=ue(e.usageMode),m=ge.realtime.includes(a)&&(w(a,n)||o.data===null)&&o.data==null,p=`"data" is required for ${a}.`;if(t.diagnoseConfig){let i=t.diagnoseConfig(a,o),l=f(a,o,n)?i.diagnoses.filter(c=>c.code!=="VALIDATION"||c.message!==`"data" is required for ${a}.`):[...i.diagnoses];return m&&!l.some(({message:c})=>c===p)&&l.push({code:"VALIDATION",severity:"error",message:p,fix:"Provide bounded data for a static snapshot, or select push usage for React ref startup."}),{component:a,usageMode:n,mode:"diagnose",ok:l.every(({severity:c})=>c==="warning"),diagnoses:l}}let d=t.validateProps?"validate":"schema-only",s=t.validateProps?be(a,[...t.validateProps(a,o).errors],n,o):ve(a,o,n,r()).errors;return m&&!s.includes(p)&&s.push(p),w(a,"static")&&Array.isArray(o.data)&&o.data.length===0&&!s.includes(`${a}: No data provided. Pass a non-empty array to the data prop.`)&&s.push(`"data" must contain at least one observation for ${a}; an empty array is a static snapshot, not push startup.`),{component:a,usageMode:n,mode:d,ok:s.length===0,errors:s}}function ye(e,t){return(Array.isArray(t)?t:[t]).some(a=>a==="array"?Array.isArray(e):a==="object"?typeof e=="object"&&!Array.isArray(e):typeof e===a)}function Ce(e){return Array.isArray(e)?"array":typeof e}function f(e,t,r){return t.data===void 0&&!w(e,r)}function be(e,t,r,a){return f(e,a,r)?t.filter(o=>o!==`"data" is required for ${e}.`):t}function ve(e,t,r,a){let o=me(a,e);if(!o){let s=he(a).map(i=>i.name).sort().join(", ");return{valid:!1,errors:[`Unknown component "${e}". Available components: ${s}`]}}let n=o.parameters||{},m=n.properties||{},p=n.required||[],d=[];for(let s of p)s==="data"&&f(o.name,t,r)||(t[s]===void 0||t[s]===null)&&d.push(`"${s}" is required for ${o.name}.`);"data"in m&&!p.includes("data")&&!f(o.name,t,r)&&(t.data===void 0||t.data===null)&&d.push(`"data" is required for ${o.name}.`);for(let[s,i]of Object.entries(t)){if(i==null)continue;let l=m[s];if(!l){d.push(`Unknown prop "${s}" for ${o.name}.`);continue}let c=l["x-semiotic-runtime-types"]||l.type;if(c&&!ye(i,c)){let _=Array.isArray(c)?c.join(" | "):c;d.push(`"${s}" should be ${_}, got ${Ce(i)}.`)}l.enum&&typeof i=="string"&&!l.enum.includes(i)&&d.push(`"${s}" value "${i}" is not valid. Expected one of: ${l.enum.join(", ")}.`)}return{valid:d.length===0,errors:d}}0&&(module.exports={diagnoseChart});
|