semiotic 3.9.2 → 3.10.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 +97 -76
- package/agent-skill/semiotic-charts/SKILL.md +13 -7
- package/ai/artifact-contract-reference.md +408 -0
- package/ai/artifact-surface-inventory.json +5586 -0
- package/ai/behaviorContracts.cjs +24 -2
- package/ai/cli.js +480 -56
- package/ai/componentMetadata.cjs +3 -1
- package/ai/dist/mcp-server.js +68 -68
- package/ai/examples.md +68 -1
- package/ai/reference.md +105 -14
- package/ai/schema.json +6646 -18
- package/ai/surface-manifest.json +34 -6
- package/ai/system-prompt.md +2 -0
- package/ai/task-packets/compare-category-totals.json +301 -0
- package/ai/task-packets/compare-category-totals.md +188 -0
- package/ai/task-packets/correct-published-chart.json +271 -0
- package/ai/task-packets/correct-published-chart.md +597 -0
- package/ai/task-packets/index.json +40 -0
- package/ai/task-packets/update-live-chart.json +289 -0
- package/ai/task-packets/update-live-chart.md +424 -0
- package/dist/c-2N7IU2NY.min.js +1 -0
- package/dist/c-2RL2QPZJ.min.js +1 -0
- package/dist/c-2WK7YJLL.min.js +1 -0
- package/dist/c-42PLDTX7.min.js +1 -0
- package/dist/c-45CQWZZ6.min.js +1 -0
- package/dist/c-4BRHKVKV.min.js +1 -0
- package/dist/c-7242NXSG.min.js +1 -0
- package/dist/c-7DVPSB5C.min.js +1 -0
- package/dist/c-7EGHJU2F.min.js +1 -0
- package/dist/c-A7OGOFSL.min.js +1 -0
- package/dist/c-AFBSWT77.min.js +1 -0
- package/dist/c-AH5HWZWS.min.js +1 -0
- package/dist/c-AJ7EC32V.min.js +1 -0
- package/dist/c-AQADQNY7.min.js +1 -0
- package/dist/c-ATM475SA.min.js +1 -0
- package/dist/c-AVO3Q7T7.min.js +1 -0
- package/dist/c-B7GW7IHJ.min.js +1 -0
- package/dist/c-BNFJMDHN.min.js +1 -0
- package/dist/c-BOHCQILI.min.js +1 -0
- package/dist/c-C3TZLTZK.min.js +1 -0
- package/dist/c-CGQAQWBV.min.js +1 -0
- package/dist/c-CPV4N35K.min.js +1 -0
- package/dist/c-D6HAAPTX.min.js +1 -0
- package/dist/c-DIPEYUOW.min.js +1 -0
- package/dist/c-E4JDJH4I.min.js +1 -0
- package/dist/c-E72OTUZU.min.js +1 -0
- package/dist/c-E7I2L7CU.min.js +1 -0
- package/dist/c-ELDWAO2V.min.js +1 -0
- package/dist/c-EUBTECGM.min.js +1 -0
- package/dist/c-EUMPMDCS.min.js +1 -0
- package/dist/c-EZZT2WAE.min.js +1 -0
- package/dist/c-FHBVFCQB.min.js +1 -0
- package/dist/c-G4HCO2IQ.min.js +1 -0
- package/dist/c-G5VIJEOK.min.js +1 -0
- package/dist/c-GHVOXAYH.min.js +1 -0
- package/dist/c-GNTXRXRN.min.js +1 -0
- package/dist/c-GXV3C3MO.min.js +1 -0
- package/dist/c-HHTK2R75.min.js +1 -0
- package/dist/c-HLLFJYTY.min.js +1 -0
- package/dist/c-HP4ZFM47.min.js +1 -0
- package/dist/c-HPOYKCCG.min.js +1 -0
- package/dist/c-HYDTS5OP.min.js +1 -0
- package/dist/c-I4QJ6YLM.min.js +1 -0
- package/dist/c-IK33LNZ6.min.js +1 -0
- package/dist/c-IK3PZHRY.min.js +1 -0
- package/dist/c-J6DVC236.min.js +1 -0
- package/dist/c-JIMJF6F6.min.js +1 -0
- package/dist/c-JUKIWTBJ.min.js +1 -0
- package/dist/c-KKPMHAZC.min.js +1 -0
- package/dist/c-L6WNDBHV.min.js +1 -0
- package/dist/c-LDEX5OFW.min.js +1 -0
- package/dist/c-LESEUVC5.min.js +1 -0
- package/dist/c-LYQMZMZQ.min.js +1 -0
- package/dist/c-MB6CV5NC.min.js +1 -0
- package/dist/c-MOKJOIPE.min.js +1 -0
- package/dist/c-MVR3RWF3.min.js +1 -0
- package/dist/c-N3FXLRNT.min.js +1 -0
- package/dist/c-N5NPTJVJ.min.js +1 -0
- package/dist/c-NHBL4J67.min.js +1 -0
- package/dist/c-ODG6TFSY.min.js +1 -0
- package/dist/c-ORLEBW72.min.js +1 -0
- package/dist/c-P65V6HLO.min.js +1 -0
- package/dist/c-PRIKOLTE.min.js +1 -0
- package/dist/c-PSKKFZNP.min.js +1 -0
- package/dist/c-PSNI6KAZ.min.js +1 -0
- package/dist/c-QA3HMQJP.min.js +1 -0
- package/dist/c-R2P4RR7Q.min.js +1 -0
- package/dist/c-RFC7UAG7.min.js +1 -0
- package/dist/c-S3AZX5PP.min.js +1 -0
- package/dist/c-SGAURYHG.min.js +1 -0
- package/dist/c-SJMWU6UX.min.js +1 -0
- package/dist/c-STIIGQOD.min.js +1 -0
- package/dist/c-T2ASIJVZ.min.js +1 -0
- package/dist/c-T2V7O2LO.min.js +1 -0
- package/dist/c-TKG2NP7G.min.js +1 -0
- package/dist/c-TX3THUTO.min.js +1 -0
- package/dist/c-TX7XJM3Z.min.js +1 -0
- package/dist/c-UC7SIU2W.min.js +1 -0
- package/dist/c-UMXSJIOV.min.js +1 -0
- package/dist/c-VJTDST2R.min.js +1 -0
- package/dist/c-VRSXMLYF.min.js +1 -0
- package/dist/c-VSLWSAN2.min.js +1 -0
- package/dist/c-VXLOLYTO.min.js +1 -0
- package/dist/c-W4ZUKSEQ.min.js +1 -0
- package/dist/c-WCBRPILW.min.js +1 -0
- package/dist/c-WGHT7OCY.min.js +1 -0
- package/dist/c-WUWXGQYA.min.js +1 -0
- package/dist/c-WWCW3APR.min.js +1 -0
- package/dist/{c-CKLIFCGN.min.js → c-XSB27XPS.min.js} +1 -1
- package/dist/c-Y6PYUMFU.min.js +1 -0
- package/dist/c-YDECTEUW.min.js +1 -0
- package/dist/c-YF3YKVQI.min.js +1 -0
- package/dist/c-YLZIV3VS.min.js +1 -0
- package/dist/c-ZIVPFTOC.min.js +1 -0
- package/dist/components/Annotation.d.ts +2 -1
- package/dist/components/ai/chartRecipeRegistry.d.ts +6 -1
- package/dist/components/ai/chartRecipes.d.ts +4 -0
- package/dist/components/ai/describePhysicsProjection.d.ts +18 -0
- package/dist/components/ai/describePhysicsSource.d.ts +13 -0
- package/dist/components/artifact/ArtifactInspector.d.ts +26 -0
- package/dist/components/artifact/ArtifactInspectorContextSections.d.ts +18 -0
- package/dist/components/artifact/artifactContractDiff.d.ts +8 -0
- package/dist/components/artifact/artifactInspectorSummary.d.ts +53 -0
- package/dist/components/artifact/artifactRevision.d.ts +54 -0
- package/dist/components/artifact/artifactTestFixtures.d.ts +17 -0
- package/dist/components/artifact/attachmentAudit.d.ts +13 -0
- package/dist/components/artifact/claimCorrections.d.ts +3 -0
- package/dist/components/artifact/claimGraph.d.ts +5 -0
- package/dist/components/artifact/claimLifecycle.d.ts +32 -0
- package/dist/components/artifact/claims.d.ts +24 -0
- package/dist/components/artifact/collection.d.ts +10 -0
- package/dist/components/artifact/collectionCorrectionScope.d.ts +4 -0
- package/dist/components/artifact/collectionImpact.d.ts +11 -0
- package/dist/components/artifact/collectionLineage.d.ts +3 -0
- package/dist/components/artifact/collectionOperations.d.ts +8 -0
- package/dist/components/artifact/collectionPolicy.d.ts +22 -0
- package/dist/components/artifact/collectionTypes.d.ts +117 -0
- package/dist/components/artifact/configurationRepair.d.ts +8 -0
- package/dist/components/artifact/contract.d.ts +30 -0
- package/dist/components/artifact/evaluateArtifact.d.ts +12 -0
- package/dist/components/artifact/evaluateArtifactTypes.d.ts +78 -0
- package/dist/components/artifact/evaluationPresentation.d.ts +9 -0
- package/dist/components/artifact/evidenceSample.d.ts +8 -0
- package/dist/components/artifact/exportPaths.d.ts +8 -0
- package/dist/components/artifact/fieldPolicies.d.ts +12 -0
- package/dist/components/artifact/fingerprint.d.ts +36 -0
- package/dist/components/artifact/grounding.d.ts +51 -0
- package/dist/components/artifact/groundingBudget.d.ts +38 -0
- package/dist/components/artifact/hostTransfer.d.ts +13 -0
- package/dist/components/artifact/identity.d.ts +19 -0
- package/dist/components/artifact/inheritance.d.ts +48 -0
- package/dist/components/artifact/inheritanceIntegrity.d.ts +3 -0
- package/dist/components/artifact/jsonCompatibility.d.ts +2 -0
- package/dist/components/artifact/obligations.d.ts +3 -0
- package/dist/components/artifact/policies.d.ts +45 -0
- package/dist/components/artifact/policyRelations.d.ts +3 -0
- package/dist/components/artifact/recordProjection.d.ts +7 -0
- package/dist/components/artifact/representation.d.ts +50 -0
- package/dist/components/artifact/serialization.d.ts +40 -0
- package/dist/components/artifact/temporal.d.ts +32 -0
- package/dist/components/artifact/temporalAdapters.d.ts +75 -0
- package/dist/components/artifact/temporalAuditHelpers.d.ts +12 -0
- package/dist/components/artifact/temporalPresentation.d.ts +8 -0
- package/dist/components/artifact/types.d.ts +341 -0
- package/dist/components/artifact/validation.d.ts +13 -0
- package/dist/components/artifact/validationFieldStatus.d.ts +7 -0
- package/dist/components/artifact/validationPrimitives.d.ts +24 -0
- package/dist/components/artifact/validationSurfaces.d.ts +7 -0
- package/dist/components/artifact/validationTemporal.d.ts +3 -0
- package/dist/components/charts/geo/FlowMap.d.ts +7 -0
- package/dist/components/charts/geo/flowMapLineStyle.d.ts +18 -0
- package/dist/components/charts/ordinal/DonutChart.d.ts +2 -0
- package/dist/components/charts/ordinal/FunnelChart.d.ts +2 -0
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +6 -0
- package/dist/components/charts/ordinal/PieChart.d.ts +2 -0
- package/dist/components/charts/ordinal/RadarChart.d.ts +2 -0
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +6 -0
- package/dist/components/charts/physics/CollisionSwarmChart.d.ts +1 -1
- package/dist/components/charts/physics/EventDropChart.d.ts +3 -1
- package/dist/components/charts/physics/GaltonBoardChart.d.ts +4 -2
- package/dist/components/charts/physics/ProcessFlowChart.d.ts +6 -0
- package/dist/components/charts/physics/UnitPileChart.d.ts +2 -1
- package/dist/components/charts/physics/collisionSwarmPacking.d.ts +14 -0
- package/dist/components/charts/physics/collisionSwarmPhysics.d.ts +1 -0
- package/dist/components/charts/physics/eventDropAdmission.d.ts +32 -0
- package/dist/components/charts/physics/eventDropPhysics.d.ts +22 -1
- package/dist/components/charts/physics/galtonBoardPhysics.d.ts +2 -9
- package/dist/components/charts/physics/physicsChartReconcile.d.ts +4 -0
- package/dist/components/charts/physics/physicsChartUtils.d.ts +1 -1
- package/dist/components/charts/physics/physicsGaltonData.d.ts +10 -0
- package/dist/components/charts/physics/physicsHocHandle.d.ts +2 -0
- package/dist/components/charts/physics/physicsPileData.d.ts +11 -0
- package/dist/components/charts/physics/physicsPilePhysics.d.ts +5 -12
- package/dist/components/charts/physics/physicsProjectionOverlays.d.ts +1 -1
- package/dist/components/charts/physics/physicsSourceRows.d.ts +8 -0
- package/dist/components/charts/physics/usePhysicsChartData.d.ts +19 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +4 -0
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +14 -6
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +4 -0
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +4 -0
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +4 -0
- package/dist/components/charts/realtime/realtimeAccessors.d.ts +4 -0
- package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +8 -7
- package/dist/components/charts/realtime/realtimeChartTypes.d.ts +7 -0
- package/dist/components/charts/realtime/temporalHistogramConfig.d.ts +17 -11
- package/dist/components/charts/shared/GaugeReadout.d.ts +9 -0
- package/dist/components/charts/shared/ThresholdAnnotation.d.ts +18 -0
- package/dist/components/charts/shared/ThresholdEndCap.d.ts +7 -0
- package/dist/components/charts/shared/auditAccessibilityText.d.ts +4 -2
- package/dist/components/charts/shared/chartDataProps.d.ts +3 -0
- package/dist/components/charts/shared/chartSpecAtlasSchemas.d.ts +5 -0
- package/dist/components/charts/shared/chartSpecCore.d.ts +4 -0
- package/dist/components/charts/shared/chartSpecsAtlas.d.ts +2 -0
- package/dist/components/charts/shared/hooks.d.ts +3 -1
- package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
- package/dist/components/charts/shared/numericTickFormatter.d.ts +2 -0
- package/dist/components/charts/shared/radialCenterContent.d.ts +10 -0
- package/dist/components/charts/shared/tooltipUtils.d.ts +1 -1
- package/dist/components/charts/shared/useChartLegend.d.ts +4 -0
- package/dist/components/charts/shared/useXYPointStyle.d.ts +2 -0
- package/dist/components/charts/xy/BubbleChart.d.ts +7 -0
- package/dist/components/charts/xy/CandlestickChart.d.ts +7 -0
- package/dist/components/charts/xy/DifferenceChart.d.ts +7 -0
- package/dist/components/charts/xy/MinimapChart.d.ts +7 -0
- package/dist/components/charts/xy/MultiAxisLineChart.d.ts +7 -0
- package/dist/components/charts/xy/ScatterplotMatrix.d.ts +6 -0
- package/dist/components/charts/xy/WaterfallChart.d.ts +8 -0
- package/dist/components/charts/xy/differenceMarkStyle.d.ts +28 -0
- package/dist/components/charts/xy/multiAxisFields.d.ts +23 -0
- package/dist/components/charts/xy/scatterplotMatrixCells.d.ts +50 -0
- package/dist/components/evidence/chartEvidenceEnvelope.d.ts +16 -8
- package/dist/components/evidence/evidenceEnvelopeInput.d.ts +8 -0
- package/dist/components/evidence/evidenceEnvelopeValidation.d.ts +11 -0
- package/dist/components/evidence/evidenceGate.d.ts +3 -1
- package/dist/components/evidence/renderedSceneHash.d.ts +23 -0
- package/dist/components/evidence/stableJsonHash.d.ts +4 -0
- package/dist/components/export/chartConfig.d.ts +40 -5
- package/dist/components/export/chartConfigArtifact.d.ts +6 -0
- package/dist/components/legendLayout.d.ts +18 -0
- package/dist/components/legendStyles.d.ts +4 -0
- package/dist/components/recipes/atlas/DependencyForestChart.d.ts +20 -0
- package/dist/components/recipes/atlas/DependencyMatrix.d.ts +7 -0
- package/dist/components/recipes/atlas/FlowCircuitChart.d.ts +20 -0
- package/dist/components/recipes/atlas/MotifBraidChart.d.ts +17 -0
- package/dist/components/recipes/atlas/atlasChartOptions.d.ts +11 -0
- package/dist/components/recipes/atlas/braid.d.ts +62 -0
- package/dist/components/recipes/atlas/capsules.d.ts +18 -0
- package/dist/components/recipes/atlas/compare.d.ts +4 -0
- package/dist/components/recipes/atlas/completeness.d.ts +2 -0
- package/dist/components/recipes/atlas/dependencyForest.d.ts +32 -0
- package/dist/components/recipes/atlas/dependencyForestChartProps.d.ts +58 -0
- package/dist/components/recipes/atlas/dependencyForestLayout.d.ts +17 -0
- package/dist/components/recipes/atlas/dependencyQueries.d.ts +20 -0
- package/dist/components/recipes/atlas/dependencyTypes.d.ts +21 -0
- package/dist/components/recipes/atlas/directedGraph.d.ts +9 -0
- package/dist/components/recipes/atlas/entityCounts.d.ts +3 -0
- package/dist/components/recipes/atlas/flowCircuit.d.ts +32 -0
- package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +72 -0
- package/dist/components/recipes/atlas/flowCircuitChrome.d.ts +18 -0
- package/dist/components/recipes/atlas/flowCircuitGeometry.d.ts +11 -0
- package/dist/components/recipes/atlas/flowCircuitLayout.d.ts +20 -0
- package/dist/components/recipes/atlas/flowCircuitSemantics.d.ts +26 -0
- package/dist/components/recipes/atlas/flowCircuitTape.d.ts +22 -0
- package/dist/components/recipes/atlas/flowCircuitTypes.d.ts +144 -0
- package/dist/components/recipes/atlas/forests.d.ts +11 -0
- package/dist/components/recipes/atlas/ids.d.ts +6 -0
- package/dist/components/recipes/atlas/index.d.ts +26 -0
- package/dist/components/recipes/atlas/ledger.d.ts +7 -0
- package/dist/components/recipes/atlas/motifBraidChartProps.d.ts +51 -0
- package/dist/components/recipes/atlas/motifBraidGeometry.d.ts +5 -0
- package/dist/components/recipes/atlas/motifBraidLayout.d.ts +11 -0
- package/dist/components/recipes/atlas/motifs.d.ts +3 -0
- package/dist/components/recipes/atlas/prefixForest.d.ts +9 -0
- package/dist/components/recipes/atlas/prepare.d.ts +14 -0
- package/dist/components/recipes/atlas/prepareAsync.d.ts +7 -0
- package/dist/components/recipes/atlas/profile.d.ts +19 -0
- package/dist/components/recipes/atlas/publish.d.ts +10 -0
- package/dist/components/recipes/atlas/queries.d.ts +34 -0
- package/dist/components/recipes/atlas/requiredPaths.d.ts +9 -0
- package/dist/components/recipes/atlas/rootedForest.d.ts +4 -0
- package/dist/components/recipes/atlas/sections.d.ts +3 -0
- package/dist/components/recipes/atlas/support.d.ts +7 -0
- package/dist/components/recipes/atlas/types.d.ts +278 -0
- package/dist/components/recipes/atlas/validate.d.ts +12 -0
- package/dist/components/recipes/firstAvailableTrack.d.ts +17 -0
- package/dist/components/recipes/intervals.d.ts +1 -1
- package/dist/components/semiotic-ai-core.d.ts +33 -22
- package/dist/components/semiotic-ai.d.ts +15 -3
- package/dist/components/semiotic-artifact-react.d.ts +10 -0
- package/dist/components/semiotic-artifact.d.ts +23 -0
- package/dist/components/semiotic-atlas-core.d.ts +20 -0
- package/dist/components/semiotic-atlas.d.ts +8 -0
- package/dist/components/semiotic-experimental.d.ts +1 -1
- package/dist/components/semiotic-physics.d.ts +4 -4
- package/dist/components/semiotic-recipes-core.d.ts +9 -0
- package/dist/components/semiotic-text.d.ts +2 -0
- package/dist/components/semiotic-utils-core.d.ts +18 -18
- package/dist/components/semiotic.d.ts +3 -3
- package/dist/components/server/renderEvidence.d.ts +12 -0
- package/dist/components/server/renderToStaticSVG.d.ts +3 -0
- package/dist/components/server/serverChartConfigs.d.ts +3 -0
- package/dist/components/server/serverChartConfigsAtlas.d.ts +4 -0
- package/dist/components/server/staticSVGChrome.d.ts +1 -4
- package/dist/components/server/staticXYAxisTicks.d.ts +2 -38
- package/dist/components/server/staticXYGrid.d.ts +1 -1
- package/dist/components/server/svgSizing.d.ts +6 -0
- package/dist/components/shared/svgRoot.d.ts +17 -0
- package/dist/components/store/selectionProvenance.d.ts +6 -0
- package/dist/components/stream/GeoSVGOverlay.d.ts +4 -0
- package/dist/components/stream/NetworkPipelineStore.d.ts +1 -0
- package/dist/components/stream/NetworkSVGOverlay.d.ts +4 -0
- package/dist/components/stream/OrdinalSVGOverlay.d.ts +4 -0
- package/dist/components/stream/SVGOverlay.d.ts +4 -0
- package/dist/components/stream/SceneToSVG.d.ts +4 -19
- package/dist/components/stream/SceneToSVGXY.d.ts +13 -0
- package/dist/components/stream/StreamGeoFrame.d.ts +1 -2
- package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -2
- package/dist/components/stream/XYGrid.d.ts +11 -0
- package/dist/components/stream/axisTickUtils.d.ts +0 -1
- package/dist/components/stream/canvasSetup.d.ts +1 -2
- package/dist/components/stream/fontLoading.d.ts +4 -0
- package/dist/components/stream/hitTestUtils.d.ts +2 -0
- package/dist/components/stream/networkCustomLayout.d.ts +8 -0
- package/dist/components/stream/networkCustomLayoutCache.d.ts +12 -0
- package/dist/components/stream/networkPipelineConfig.d.ts +0 -7
- package/dist/components/stream/overlayAccessibleText.d.ts +18 -0
- package/dist/components/stream/physics/PhysicsControllers.d.ts +1 -1
- package/dist/components/stream/physics/PhysicsKernel.d.ts +9 -0
- package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +5 -4
- package/dist/components/stream/physics/PhysicsPipelineTypes.d.ts +9 -0
- package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +3 -0
- package/dist/components/stream/physics/physicsCanvasCoordinates.d.ts +5 -0
- package/dist/components/stream/physics/physicsFixedPosition.d.ts +16 -0
- package/dist/components/stream/physics/physicsKernelCloning.d.ts +6 -0
- package/dist/components/stream/physics/physicsPipelineObservations.d.ts +2 -0
- package/dist/components/stream/physics/physicsPipelineSettle.d.ts +15 -9
- package/dist/components/stream/physics/physicsRegionRuntime.d.ts +8 -17
- package/dist/components/stream/physics/physicsSemanticUI.d.ts +11 -0
- package/dist/components/stream/physics/usePhysicsCanvasPointer.d.ts +3 -1
- package/dist/components/stream/physics/usePhysicsSemanticNavigation.d.ts +2 -0
- package/dist/components/stream/pipelineConfig.d.ts +4 -0
- package/dist/components/stream/pipelineStoreUpdateResults.d.ts +1 -1
- package/dist/components/stream/resolveXYAxes.d.ts +13 -0
- package/dist/components/stream/sceneToSVGShared.d.ts +2 -1
- package/dist/components/stream/seriesGeometry.d.ts +13 -0
- package/dist/components/stream/shallowEqual.d.ts +2 -0
- package/dist/components/stream/streamEncodingTypes.d.ts +53 -0
- package/dist/components/stream/types.d.ts +4 -53
- package/dist/components/stream/useEnsureCustomXYRenderers.d.ts +4 -2
- package/dist/components/stream/useGeoFrameHandle.d.ts +16 -0
- package/dist/components/stream/useOrdinalFrameHandle.d.ts +15 -0
- package/dist/components/stream/useXYFrameHandle.d.ts +15 -0
- package/dist/components/stream/xyAxisTicks.d.ts +25 -0
- package/dist/components/stream/xyDateTicks.d.ts +3 -2
- package/dist/components/stream/xyFrameAxisTypes.d.ts +2 -0
- package/dist/components/stream/xySceneBuilders/ribbonScene.d.ts +1 -1
- package/dist/components/stream/xySceneBuilders/types.d.ts +1 -0
- package/dist/components/text/annotationTextLayout.d.ts +28 -0
- package/dist/components/text/pretextAnnotationLayout.d.ts +29 -0
- package/dist/components/text/usePretextAnnotations.d.ts +12 -0
- package/dist/controls.module.min.js +1 -1
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics-matter.min.js +1 -1
- package/dist/physics-matter.module.min.js +1 -1
- package/dist/physics-rapier.min.js +1 -1
- package/dist/physics-rapier.module.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/physicsWorker.js +1 -1
- package/dist/processSankeyLayoutWorker.js +1 -1
- package/dist/rough.min.js +1 -1
- package/dist/rough.module.min.js +1 -1
- package/dist/semiotic-access.module.min.js +1 -1
- package/dist/semiotic-ai-artifact-policy-constants.module.min.js +2 -0
- package/dist/semiotic-ai-core.d.ts +33 -22
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai-hash-primitives.module.min.js +2 -0
- package/dist/semiotic-ai.d.ts +15 -3
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-artifact-react.d.ts +10 -0
- package/dist/semiotic-artifact-react.min.js +2 -0
- package/dist/semiotic-artifact-react.module.min.js +2 -0
- package/dist/semiotic-artifact.d.ts +23 -0
- package/dist/semiotic-artifact.min.js +1 -0
- package/dist/semiotic-artifact.module.min.js +1 -0
- package/dist/semiotic-atlas-core.d.ts +20 -0
- package/dist/semiotic-atlas-core.min.js +1 -0
- package/dist/semiotic-atlas-core.module.min.js +1 -0
- package/dist/semiotic-atlas-selection.module.min.js +2 -0
- package/dist/semiotic-atlas.d.ts +8 -0
- package/dist/semiotic-atlas.min.js +2 -0
- package/dist/semiotic-atlas.module.min.js +2 -0
- package/dist/semiotic-client-cjs-shared.min.js +1 -1
- package/dist/semiotic-client-glyph.module.min.js +1 -1
- package/dist/semiotic-client-responsive.module.min.js +1 -1
- package/dist/semiotic-client-shared.module.min.js +1 -1
- package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +1 -1
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-evidence.min.js +1 -1
- package/dist/semiotic-evidence.module.min.js +1 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -1
- package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
- package/dist/semiotic-experimental-vacp.min.js +1 -1
- package/dist/semiotic-experimental-vacp.module.min.js +1 -1
- package/dist/semiotic-experimental.d.ts +1 -1
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-physics.d.ts +4 -4
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
- package/dist/semiotic-recipes-core.d.ts +9 -0
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes-geo-cjs.min.js +1 -1
- package/dist/semiotic-recipes-react.min.js +1 -1
- package/dist/semiotic-server-edge-node.module.min.js +1 -1
- package/dist/semiotic-server-edge.min.js +1 -1
- package/dist/semiotic-server-edge.module.min.js +1 -1
- package/dist/semiotic-server-node.min.js +1 -1
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-text.d.ts +2 -0
- package/dist/semiotic-text.min.js +2 -0
- package/dist/semiotic-text.module.min.js +2 -0
- package/dist/semiotic-themes-core.min.js +1 -1
- package/dist/semiotic-themes-core.module.min.js +1 -1
- package/dist/semiotic-themes.min.js +1 -1
- package/dist/semiotic-themes.module.min.js +1 -1
- package/dist/semiotic-utils-core.d.ts +18 -18
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic-value.module.min.js +1 -1
- package/dist/semiotic.d.ts +3 -3
- 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/xy.module.min.js +1 -1
- package/package.json +70 -14
- package/spec/README.md +8 -3
- package/spec/v0.1/artifact-contract.schema.json +2299 -0
- package/spec/v0.1/examples/artifact-contract-full.json +369 -0
- package/spec/v0.1/examples/artifact-contract-unknown-state.json +46 -0
- package/dist/c-3BLJEQNG.min.js +0 -1
- package/dist/c-3SCUN5HI.min.js +0 -1
- package/dist/c-3VVKFA4M.min.js +0 -1
- package/dist/c-43TJZS3F.min.js +0 -1
- package/dist/c-4DTZPSUD.min.js +0 -1
- package/dist/c-4ES5367Y.min.js +0 -1
- package/dist/c-52TEGIUJ.min.js +0 -1
- package/dist/c-54IRWOGM.min.js +0 -1
- package/dist/c-5D2S4RMI.min.js +0 -1
- package/dist/c-5JWCTX3G.min.js +0 -1
- package/dist/c-6CMMSN6N.min.js +0 -1
- package/dist/c-6HRB2L7H.min.js +0 -1
- package/dist/c-6O5EVOPH.min.js +0 -1
- package/dist/c-7W4SV36A.min.js +0 -1
- package/dist/c-A4WRGZFX.min.js +0 -1
- package/dist/c-AG7WWVIH.min.js +0 -1
- package/dist/c-AH6J4MTN.min.js +0 -1
- package/dist/c-AKAF6JAD.min.js +0 -1
- package/dist/c-ALYR5LKK.min.js +0 -1
- package/dist/c-BBKITSXB.min.js +0 -1
- package/dist/c-BYDPC44I.min.js +0 -1
- package/dist/c-CFFIU2MW.min.js +0 -1
- package/dist/c-CGNHBHCE.min.js +0 -1
- package/dist/c-CJYSXIFV.min.js +0 -1
- package/dist/c-CZF7MV67.min.js +0 -1
- package/dist/c-D53OKBSY.min.js +0 -1
- package/dist/c-DADXPJXV.min.js +0 -1
- package/dist/c-DBQ2V7CH.min.js +0 -1
- package/dist/c-DPMVAUAW.min.js +0 -1
- package/dist/c-ECJCKLYY.min.js +0 -1
- package/dist/c-EGATGOWJ.min.js +0 -1
- package/dist/c-EGR6VYBW.min.js +0 -1
- package/dist/c-ESNR43AN.min.js +0 -1
- package/dist/c-F3LIKINL.min.js +0 -1
- package/dist/c-F5ZB5GJ6.min.js +0 -1
- package/dist/c-G36WS6LN.min.js +0 -1
- package/dist/c-G3VYMHKE.min.js +0 -1
- package/dist/c-GGISSW5E.min.js +0 -1
- package/dist/c-GR6MOEQC.min.js +0 -1
- package/dist/c-GSVCN34B.min.js +0 -1
- package/dist/c-GYOQCEFP.min.js +0 -1
- package/dist/c-H3DNMTCC.min.js +0 -1
- package/dist/c-I6J3FEZE.min.js +0 -1
- package/dist/c-IGH6MGJ5.min.js +0 -1
- package/dist/c-II2EEAJN.min.js +0 -1
- package/dist/c-IUHFPMHD.min.js +0 -1
- package/dist/c-J6M4JHRS.min.js +0 -1
- package/dist/c-JM3MGLQV.min.js +0 -1
- package/dist/c-KM3N7F7R.min.js +0 -1
- package/dist/c-LF5BZFNC.min.js +0 -1
- package/dist/c-LKBSGFQC.min.js +0 -1
- package/dist/c-MNF2S4AA.min.js +0 -1
- package/dist/c-MT3WBK7M.min.js +0 -1
- package/dist/c-NDJADPIF.min.js +0 -1
- package/dist/c-NVPQCIL5.min.js +0 -1
- package/dist/c-NY3JWV2K.min.js +0 -1
- package/dist/c-OFWJBEE5.min.js +0 -1
- package/dist/c-OYFHP5F5.min.js +0 -1
- package/dist/c-PGKQGGQ2.min.js +0 -1
- package/dist/c-PPWDL5ZI.min.js +0 -1
- package/dist/c-Q2IPZ3MU.min.js +0 -1
- package/dist/c-QKHMBE2E.min.js +0 -1
- package/dist/c-QMVM3AY6.min.js +0 -1
- package/dist/c-QSGWX53A.min.js +0 -1
- package/dist/c-RJKEKZOO.min.js +0 -1
- package/dist/c-RSVIHIQ4.min.js +0 -1
- package/dist/c-S6U5CGT5.min.js +0 -1
- package/dist/c-SFDIIU5G.min.js +0 -1
- package/dist/c-SLGMUBUL.min.js +0 -1
- package/dist/c-SRTBCRVE.min.js +0 -1
- package/dist/c-T6UAIKBH.min.js +0 -1
- package/dist/c-TMCTEVVW.min.js +0 -1
- package/dist/c-TMOSJLT3.min.js +0 -1
- package/dist/c-TZW3JGJ5.min.js +0 -1
- package/dist/c-U6ESPM7V.min.js +0 -1
- package/dist/c-UC5PTTFI.min.js +0 -1
- package/dist/c-USFMFKIH.min.js +0 -1
- package/dist/c-VGKUEZBC.min.js +0 -1
- package/dist/c-VGW3VG3I.min.js +0 -1
- package/dist/c-VN2HG5BS.min.js +0 -1
- package/dist/c-VPZDY5Q4.min.js +0 -1
- package/dist/c-VRXUB2F2.min.js +0 -1
- package/dist/c-VUBQNQJH.min.js +0 -1
- package/dist/c-VUH4PGZY.min.js +0 -1
- package/dist/c-W3CE4A4S.min.js +0 -1
- package/dist/c-X5UBGU2V.min.js +0 -1
- package/dist/c-XDRV7RKW.min.js +0 -1
- package/dist/c-YGZHURXZ.min.js +0 -1
- package/dist/c-YZVRZGX2.min.js +0 -1
- /package/dist/{c-N4G2L7ID.min.js → c-HYW2XA4Q.min.js} +0 -0
- /package/dist/{c-ENF72HU5.min.js → c-QAVFOEUY.min.js} +0 -0
- /package/dist/{c-OCI56QF2.min.js → c-V4XMSLC3.min.js} +0 -0
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
<!-- Generated by scripts/generate-ai-task-packets.mjs; edit ai/tasks/update-live-chart.json. -->
|
|
2
|
+
|
|
3
|
+
# Update a live chart by record ID
|
|
4
|
+
|
|
5
|
+
Maintain a bounded window of incoming records, apply corrections, and reconcile the display after reconnecting.
|
|
6
|
+
|
|
7
|
+
Source package: semiotic@3.10.1. Channel: source.
|
|
8
|
+
Source revision: sha256:43a44221c44befa71122be662b0ceb1390c182e48c40ecb1b484add5acdd30e3. Verified source checkout guidance; npm package, hosted site and MCP deployment identities require separate checks.
|
|
9
|
+
|
|
10
|
+
## The job
|
|
11
|
+
|
|
12
|
+
Show incoming observations, keep the UI stable, and correct existing records without duplicates.
|
|
13
|
+
|
|
14
|
+
Data: Synthetic observations with stable IDs, numeric event time and value; a four-record retained window.
|
|
15
|
+
|
|
16
|
+
## Fit and constraints
|
|
17
|
+
|
|
18
|
+
- Use when a React application needs ref-based updates and explicit record correction.
|
|
19
|
+
- The host owns subscription lifecycle, replay and reconnection policy.
|
|
20
|
+
|
|
21
|
+
- Static SVG cannot establish subscription cleanup, correct replay or browser lifecycle behavior.
|
|
22
|
+
- This simulated feed is not a production network protocol, durable queue or live service.
|
|
23
|
+
|
|
24
|
+
## Smallest working path
|
|
25
|
+
|
|
26
|
+
Component: LineChart from `semiotic/line`. Usage: push. Data prop required in this mode: false.
|
|
27
|
+
|
|
28
|
+
### Mounted browser lifecycle
|
|
29
|
+
|
|
30
|
+
React browser only; source: docs/src/pages/tasks/examples/LiveChartExample.tsx.
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import React, { useEffect, useRef, useState } from "react"
|
|
34
|
+
import { LineChart } from "semiotic/line"
|
|
35
|
+
import {
|
|
36
|
+
connectLiveChart,
|
|
37
|
+
createLiveSource,
|
|
38
|
+
LIVE_EVENTS,
|
|
39
|
+
liveChartProps,
|
|
40
|
+
type LiveSource,
|
|
41
|
+
type Observation,
|
|
42
|
+
} from "./live-chart"
|
|
43
|
+
import "./live-chart.css"
|
|
44
|
+
|
|
45
|
+
/** The optional source lets lifecycle tests inspect subscriptions directly. */
|
|
46
|
+
export function LiveChartSession({ source }: { source: LiveSource }) {
|
|
47
|
+
const chartRef = useRef<React.ComponentRef<typeof LineChart>>(null)
|
|
48
|
+
const [connected, setConnected] = useState(true)
|
|
49
|
+
const [playing, setPlaying] = useState(false)
|
|
50
|
+
const [sourceCursor, setSourceCursor] = useState(source.cursor)
|
|
51
|
+
const [display, setDisplay] = useState<{ rows: Observation[]; cursor: number }>({
|
|
52
|
+
rows: [],
|
|
53
|
+
cursor: 0,
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (!connected || !chartRef.current) return
|
|
58
|
+
// Effects run after the child ref is available. Cleanup also handles
|
|
59
|
+
// React StrictMode's setup/cleanup/setup cycle without duplicate listeners.
|
|
60
|
+
return connectLiveChart(source, chartRef.current, (rows, cursor) => {
|
|
61
|
+
setDisplay({ rows, cursor })
|
|
62
|
+
})
|
|
63
|
+
}, [source, connected])
|
|
64
|
+
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (!playing || !connected) return
|
|
67
|
+
const timer = window.setInterval(() => {
|
|
68
|
+
const advanced = source.advance()
|
|
69
|
+
setSourceCursor(source.cursor)
|
|
70
|
+
if (!advanced || source.cursor === LIVE_EVENTS.length) setPlaying(false)
|
|
71
|
+
}, 1_000)
|
|
72
|
+
return () => window.clearInterval(timer)
|
|
73
|
+
}, [source, playing, connected])
|
|
74
|
+
|
|
75
|
+
function advance() {
|
|
76
|
+
source.advance()
|
|
77
|
+
setSourceCursor(source.cursor)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const finished = sourceCursor === LIVE_EVENTS.length
|
|
81
|
+
const lag = sourceCursor - display.cursor
|
|
82
|
+
return (
|
|
83
|
+
<section className="task-live" aria-label="Live chart demonstration">
|
|
84
|
+
<p>
|
|
85
|
+
<strong>Synthetic fixture.</strong> Three readings start at 09:00–09:02. Five events include
|
|
86
|
+
two corrections and three new observations. The line uses observation time; the event
|
|
87
|
+
counter records processing order.
|
|
88
|
+
</p>
|
|
89
|
+
<div className="task-live__controls">
|
|
90
|
+
<button type="button" onClick={advance} disabled={finished || playing}>
|
|
91
|
+
Advance source
|
|
92
|
+
</button>
|
|
93
|
+
<button
|
|
94
|
+
type="button"
|
|
95
|
+
onClick={() => setPlaying((value) => !value)}
|
|
96
|
+
disabled={!connected || finished}
|
|
97
|
+
>
|
|
98
|
+
{playing ? "Pause replay" : "Play replay"}
|
|
99
|
+
</button>
|
|
100
|
+
<button
|
|
101
|
+
type="button"
|
|
102
|
+
onClick={() => {
|
|
103
|
+
setPlaying(false)
|
|
104
|
+
setConnected((value) => !value)
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
{connected ? "Disconnect" : "Reconnect"}
|
|
108
|
+
</button>
|
|
109
|
+
</div>
|
|
110
|
+
<p role="status" aria-live="polite" data-testid="live-chart-status">
|
|
111
|
+
{connected ? "Connected" : "Disconnected"}. Source event {sourceCursor} of{" "}
|
|
112
|
+
{LIVE_EVENTS.length}; display through event {display.cursor}.{" "}
|
|
113
|
+
{lag ? `${lag} unapplied event${lag === 1 ? "" : "s"}.` : "Display is current."}
|
|
114
|
+
</p>
|
|
115
|
+
<p>
|
|
116
|
+
{finished ? "Replay complete." : `Next event: ${LIVE_EVENTS[sourceCursor].label}.`}
|
|
117
|
+
{!connected &&
|
|
118
|
+
" Advance the source while disconnected, then reconnect to replace the frozen display with the source’s current window."}
|
|
119
|
+
</p>
|
|
120
|
+
<div data-testid="live-chart-rendering">
|
|
121
|
+
{/* No data prop: push mode remains active across control re-renders. */}
|
|
122
|
+
<LineChart ref={chartRef} {...liveChartProps} height={320} responsiveWidth />
|
|
123
|
+
</div>
|
|
124
|
+
<div className="task-live__table">
|
|
125
|
+
<table>
|
|
126
|
+
<caption>Records currently retained by the chart</caption>
|
|
127
|
+
<thead>
|
|
128
|
+
<tr>
|
|
129
|
+
<th scope="col">Record ID</th>
|
|
130
|
+
<th scope="col">Observation time</th>
|
|
131
|
+
<th scope="col">Reading (units)</th>
|
|
132
|
+
</tr>
|
|
133
|
+
</thead>
|
|
134
|
+
<tbody>
|
|
135
|
+
{display.rows.map((row) => (
|
|
136
|
+
<tr key={row.id}>
|
|
137
|
+
<th scope="row">{row.id}</th>
|
|
138
|
+
<td>09:{String(row.minute).padStart(2, "0")}</td>
|
|
139
|
+
<td>{row.value}</td>
|
|
140
|
+
</tr>
|
|
141
|
+
))}
|
|
142
|
+
</tbody>
|
|
143
|
+
</table>
|
|
144
|
+
</div>
|
|
145
|
+
<p>
|
|
146
|
+
Retention: the four latest observations by event time. Corrections replace a retained record
|
|
147
|
+
by ID; older observations are removed. A reconnect takes the current source window, so it
|
|
148
|
+
can recover a missed correction without retaining a complete event history. At completion,
|
|
149
|
+
expect obs-03 = 17, obs-04 = 20, obs-05 = 16 and obs-06 = 19.
|
|
150
|
+
</p>
|
|
151
|
+
</section>
|
|
152
|
+
)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export default function LiveChartExample() {
|
|
156
|
+
const [source, setSource] = useState(createLiveSource)
|
|
157
|
+
const [session, setSession] = useState(0)
|
|
158
|
+
function restart() {
|
|
159
|
+
setSource(createLiveSource())
|
|
160
|
+
setSession((value) => value + 1)
|
|
161
|
+
}
|
|
162
|
+
return (
|
|
163
|
+
<>
|
|
164
|
+
<LiveChartSession key={session} source={source} />
|
|
165
|
+
<button type="button" onClick={restart}>
|
|
166
|
+
Restart fixture
|
|
167
|
+
</button>
|
|
168
|
+
</>
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Deterministic source and reconnect policy
|
|
174
|
+
|
|
175
|
+
Host-owned synthetic feed; source: docs/src/pages/tasks/examples/live-chart.ts.
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
import type { ComponentRef } from "react"
|
|
179
|
+
import type { LineChart } from "semiotic/line"
|
|
180
|
+
|
|
181
|
+
export interface Observation {
|
|
182
|
+
id: string
|
|
183
|
+
minute: number
|
|
184
|
+
value: number
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export const RETAINED_RECORDS = 4
|
|
188
|
+
export const INITIAL_OBSERVATIONS: Observation[] = [
|
|
189
|
+
{ id: "obs-01", minute: 0, value: 12 },
|
|
190
|
+
{ id: "obs-02", minute: 1, value: 18 },
|
|
191
|
+
{ id: "obs-03", minute: 2, value: 15 },
|
|
192
|
+
]
|
|
193
|
+
|
|
194
|
+
// Event order is processing order. A correction preserves the observation's
|
|
195
|
+
// event time and ID; it does not create a new point at its arrival time.
|
|
196
|
+
export const LIVE_EVENTS = [
|
|
197
|
+
{ row: { id: "obs-02", minute: 1, value: 14 }, label: "Correct obs-02 from 18 to 14" },
|
|
198
|
+
{ row: { id: "obs-04", minute: 3, value: 20 }, label: "Add obs-04 at minute 3" },
|
|
199
|
+
{ row: { id: "obs-05", minute: 4, value: 16 }, label: "Add obs-05; discard obs-01" },
|
|
200
|
+
{ row: { id: "obs-03", minute: 2, value: 17 }, label: "Correct obs-03 from 15 to 17" },
|
|
201
|
+
{ row: { id: "obs-06", minute: 5, value: 19 }, label: "Add obs-06; discard obs-02" },
|
|
202
|
+
] satisfies Array<{ row: Observation; label: string }>
|
|
203
|
+
|
|
204
|
+
export const liveChartProps = {
|
|
205
|
+
xAccessor: "minute",
|
|
206
|
+
yAccessor: "value",
|
|
207
|
+
pointIdAccessor: "id",
|
|
208
|
+
xLabel: "Observation time (minutes after 09:00)",
|
|
209
|
+
yLabel: "Synthetic reading (units)",
|
|
210
|
+
title: "The latest four observations",
|
|
211
|
+
description:
|
|
212
|
+
"Synthetic observations by event time. Corrections keep their original time and record ID.",
|
|
213
|
+
summary:
|
|
214
|
+
"Advance the source to inspect corrections and retention. Disconnect to freeze the displayed window, then reconnect to catch up.",
|
|
215
|
+
showPoints: true,
|
|
216
|
+
showGrid: true,
|
|
217
|
+
accessibleTable: true,
|
|
218
|
+
xExtent: [0, 5] as [number, number],
|
|
219
|
+
yExtent: [0, 24] as [number, number],
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
type FeedMessage =
|
|
223
|
+
| { kind: "snapshot"; rows: Observation[]; cursor: number }
|
|
224
|
+
| { kind: "change"; row: Observation; removed: string[]; cursor: number }
|
|
225
|
+
|
|
226
|
+
/** A deterministic, in-memory source, not a network or ordering protocol. */
|
|
227
|
+
export function createLiveSource() {
|
|
228
|
+
let rows = INITIAL_OBSERVATIONS.map((row) => ({ ...row }))
|
|
229
|
+
let cursor = 0
|
|
230
|
+
const listeners = new Set<(message: FeedMessage) => void>()
|
|
231
|
+
return {
|
|
232
|
+
get cursor() {
|
|
233
|
+
return cursor
|
|
234
|
+
},
|
|
235
|
+
get subscriberCount() {
|
|
236
|
+
return listeners.size
|
|
237
|
+
},
|
|
238
|
+
get rows() {
|
|
239
|
+
return rows.map((row) => ({ ...row }))
|
|
240
|
+
},
|
|
241
|
+
subscribe(listener: (message: FeedMessage) => void) {
|
|
242
|
+
listeners.add(listener)
|
|
243
|
+
// Registration and snapshot are synchronous in this fixture. A remote
|
|
244
|
+
// source needs an atomic snapshot/cursor handoff to avoid losing events.
|
|
245
|
+
listener({ kind: "snapshot", rows: rows.map((row) => ({ ...row })), cursor })
|
|
246
|
+
return () => {
|
|
247
|
+
listeners.delete(listener)
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
advance() {
|
|
251
|
+
const event = LIVE_EVENTS[cursor]
|
|
252
|
+
if (!event) return false
|
|
253
|
+
const byId = new Map(rows.map((row) => [row.id, row]))
|
|
254
|
+
byId.set(event.row.id, { ...event.row })
|
|
255
|
+
const ordered = [...byId.values()].sort((a, b) => a.minute - b.minute)
|
|
256
|
+
const removed = ordered.slice(0, -RETAINED_RECORDS).map((row) => row.id)
|
|
257
|
+
rows = ordered.slice(-RETAINED_RECORDS)
|
|
258
|
+
cursor += 1
|
|
259
|
+
for (const listener of listeners) {
|
|
260
|
+
listener({ kind: "change", row: { ...event.row }, removed, cursor })
|
|
261
|
+
}
|
|
262
|
+
return true
|
|
263
|
+
},
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export type LiveSource = ReturnType<typeof createLiveSource>
|
|
268
|
+
type LiveChartHandle = ComponentRef<typeof LineChart>
|
|
269
|
+
|
|
270
|
+
/** Connect only after React mounts the chart and supplies its ref. */
|
|
271
|
+
export function connectLiveChart(
|
|
272
|
+
source: LiveSource,
|
|
273
|
+
chart: LiveChartHandle,
|
|
274
|
+
onReadback: (rows: Observation[], cursor: number) => void,
|
|
275
|
+
) {
|
|
276
|
+
const retainedIds = new Set<string>()
|
|
277
|
+
return source.subscribe((message) => {
|
|
278
|
+
if (message.kind === "snapshot") {
|
|
279
|
+
chart.clear()
|
|
280
|
+
chart.pushMany(message.rows)
|
|
281
|
+
retainedIds.clear()
|
|
282
|
+
for (const row of message.rows) retainedIds.add(row.id)
|
|
283
|
+
} else {
|
|
284
|
+
for (const id of message.removed) {
|
|
285
|
+
chart.remove(id)
|
|
286
|
+
retainedIds.delete(id)
|
|
287
|
+
}
|
|
288
|
+
if (retainedIds.has(message.row.id)) {
|
|
289
|
+
chart.update(message.row.id, (previous) => ({ ...previous, ...message.row }))
|
|
290
|
+
} else if (!message.removed.includes(message.row.id)) {
|
|
291
|
+
chart.push(message.row)
|
|
292
|
+
retainedIds.add(message.row.id)
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
// Inspect the chart's retained store, rather than echoing the source rows.
|
|
296
|
+
const actual = chart.getData().map((row) => ({
|
|
297
|
+
id: String(row.id),
|
|
298
|
+
minute: Number(row.minute),
|
|
299
|
+
value: Number(row.value),
|
|
300
|
+
}))
|
|
301
|
+
onReadback(actual, message.cursor)
|
|
302
|
+
})
|
|
303
|
+
}
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### Example styles
|
|
307
|
+
|
|
308
|
+
Browser presentation; source: docs/src/pages/tasks/examples/live-chart.css.
|
|
309
|
+
|
|
310
|
+
```css
|
|
311
|
+
.task-live {
|
|
312
|
+
min-width: 0;
|
|
313
|
+
}
|
|
314
|
+
.task-live__controls {
|
|
315
|
+
display: flex;
|
|
316
|
+
flex-wrap: wrap;
|
|
317
|
+
gap: 0.6rem;
|
|
318
|
+
}
|
|
319
|
+
.task-live__controls button {
|
|
320
|
+
min-height: 40px;
|
|
321
|
+
padding: 0.4rem 0.8rem;
|
|
322
|
+
}
|
|
323
|
+
.task-live__table {
|
|
324
|
+
overflow-x: auto;
|
|
325
|
+
margin: 1rem 0;
|
|
326
|
+
}
|
|
327
|
+
.task-live__table table {
|
|
328
|
+
width: 100%;
|
|
329
|
+
border-collapse: collapse;
|
|
330
|
+
}
|
|
331
|
+
.task-live__table caption {
|
|
332
|
+
text-align: left;
|
|
333
|
+
font-weight: 600;
|
|
334
|
+
margin-bottom: 0.5rem;
|
|
335
|
+
}
|
|
336
|
+
.task-live__table th,
|
|
337
|
+
.task-live__table td {
|
|
338
|
+
text-align: left;
|
|
339
|
+
padding: 0.5rem;
|
|
340
|
+
border-bottom: 1px solid var(--border-color, #aaa);
|
|
341
|
+
}
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
## Check the result
|
|
345
|
+
|
|
346
|
+
Evidence state: supported-in-scope. Only the content digests and environment recorded here; not a release range or an adoption result.
|
|
347
|
+
|
|
348
|
+
- Corrections replace records by stable ID without increasing the retained count.
|
|
349
|
+
- At most four records remain in the chart after new observations.
|
|
350
|
+
- While disconnected, the displayed window remains unchanged; reconnect replaces it with the current source window.
|
|
351
|
+
- Unmount and StrictMode cleanup leave no active subscription or playback timer.
|
|
352
|
+
- After all five events, retained IDs obs-03 through obs-06 have values 17, 20, 16 and 19.
|
|
353
|
+
|
|
354
|
+
Run:
|
|
355
|
+
|
|
356
|
+
```sh
|
|
357
|
+
npx vitest run docs/src/pages/tasks/examples/live-chart.test.tsx
|
|
358
|
+
npx playwright test --config playwright.docs-examples.config.ts integration-tests/docs-examples-task-live.spec.ts
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
Recorded execution: 2026-09-15T00:29:02.031Z. Agent-observed execution of repository tests; independent review is not recorded.
|
|
362
|
+
|
|
363
|
+
Not assessed:
|
|
364
|
+
|
|
365
|
+
- Real transport failures, server retention, clock synchronization and production backpressure.
|
|
366
|
+
- Performance on physical devices or under a production event rate.
|
|
367
|
+
- Assistive-technology reception and organic adoption.
|
|
368
|
+
|
|
369
|
+
## Repair and recheck
|
|
370
|
+
|
|
371
|
+
### Pushed rows disappear when React renders again.
|
|
372
|
+
|
|
373
|
+
Omit data entirely in push mode. Push the initial window through the mounted ref; do not pass data={[]}.
|
|
374
|
+
|
|
375
|
+
Recheck: Change host UI state and confirm that the retained records survive.
|
|
376
|
+
|
|
377
|
+
Contract: streaming.push-mode-data.
|
|
378
|
+
|
|
379
|
+
### A correction cannot find a record or creates duplicates.
|
|
380
|
+
|
|
381
|
+
Set pointIdAccessor to id and use update(id, updater). On reconnect, replace the bounded window from the authoritative host snapshot.
|
|
382
|
+
|
|
383
|
+
Recheck: Inspect the chart handle's data after correction and reconnect, including IDs, values and count.
|
|
384
|
+
|
|
385
|
+
Contract: streaming.ref-mutations-require-id-accessors.
|
|
386
|
+
|
|
387
|
+
## Exact API and mode guidance
|
|
388
|
+
|
|
389
|
+
Selected properties copied from ai/schema.json; retrieve the component resource for the full schema. React push mode follows the included behavior contracts.
|
|
390
|
+
|
|
391
|
+
Full component resource: semiotic://schema/LineChart. Machine packet: /tasks/update-live-chart.json.
|
|
392
|
+
|
|
393
|
+
- **accessibility.description-props:** 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. 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–L3 description or a navigable chart tree, use ChartContainer with chartConfig plus describe and/or navigable; do not invent frameProps fields.
|
|
394
|
+
|
|
395
|
+
- **props.data-required-by-usage-mode:** 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. 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.
|
|
396
|
+
|
|
397
|
+
- **streaming.push-mode-data:** 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. 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.
|
|
398
|
+
|
|
399
|
+
- **streaming.ref-mutations-require-id-accessors:** 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. When generating code that calls remove() or update(), include the matching ID accessor and make sure pushed rows carry that ID field.
|
|
400
|
+
|
|
401
|
+
- **rendering.renderchart-static-props:** MCP renderChart and semiotic/server renderChart render a single static SVG/PNG snapshot. Browser-only realtime components and future ref pushes are not renderable through that path. Use renderChart only with renderable HOC components and complete static data. For live behavior, return React code with a ref and do not promise MCP-rendered output.
|
|
402
|
+
|
|
403
|
+
## Maintenance context
|
|
404
|
+
|
|
405
|
+
The host needs explicit correction and reconnect behavior over a bounded observation window.
|
|
406
|
+
|
|
407
|
+
- Cleanup, stable IDs, retention, data-prop omission and reconnect replacement after lifecycle or dependency changes.
|
|
408
|
+
|
|
409
|
+
A static export records one window. It does not carry an active subscription, prove cleanup or promise future updates.
|
|
410
|
+
|
|
411
|
+
Read the installed package and lockfile before applying source guidance. A matching version string alone does not establish deployed parity. These notes are removable project context, subordinate to the current task and dependency policy.
|
|
412
|
+
|
|
413
|
+
## Behavioral update
|
|
414
|
+
|
|
415
|
+
Status: source-only. Released introduction: not established.
|
|
416
|
+
|
|
417
|
+
Assumption to revisit: A static render or an empty data array demonstrates a working live chart.
|
|
418
|
+
|
|
419
|
+
Omit data for push mode. Establish the subscription after the ref mounts, correct records by ID, clean up and reconcile from the authoritative window on reconnect.
|
|
420
|
+
|
|
421
|
+
- Retained records and actual canvas paint through correction, disconnect, reconnect and restart.
|
|
422
|
+
- Subscriptions and replay timers after unmount and StrictMode cleanup.
|
|
423
|
+
|
|
424
|
+
Production transport reliability and event-rate performance require their own environment-specific checks.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t){return c.has(t)?e:r}var o={top:50,right:40,bottom:60,left:70},r={top:20,right:80,bottom:20,left:80},e={top:40,right:40,bottom:40,left:40},c=new Set(["chord","force","circlepack","orbit"]);export{o as AXIS_FRAME_DEFAULT_MARGIN,t as networkFrameDefaultMargin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{registerBuiltInXYPlugins as m}from"./c-WWCW3APR.min.js";import"./c-WCBRPILW.min.js";import"./c-E72OTUZU.min.js";import"./c-G5VIJEOK.min.js";import"./c-LESEUVC5.min.js";import"./c-R2P4RR7Q.min.js";import"./c-SJMWU6UX.min.js";import"./c-AVO3Q7T7.min.js";import"./c-TKG2NP7G.min.js";import"./c-MOKJOIPE.min.js";import"./c-PSKKFZNP.min.js";import"./c-KKPMHAZC.min.js";import"./c-YLZIV3VS.min.js";import"./c-W4ZUKSEQ.min.js";import"./c-CPV4N35K.min.js";import"./c-T2V7O2LO.min.js";import"./c-MB6CV5NC.min.js";export{m as registerBuiltInXYPlugins};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t){if("function"==typeof e)return t=>+e(t);let a=e||t;return e=>+e[a]}function t(e,t){if("function"==typeof e)return e;let a=e||t;return e=>e[a]}function a(e,t){return he.has(e)||de.has(e)||"SwimlaneChart"===e||"GaugeChart"===e?{measure:t.valueAccessor,measureFallback:"value",dimension:t.categoryAccessor??t.stepAccessor,dimensionFallback:"category"}:{measure:t.yAccessor??t.valueAccessor,measureFallback:"y",dimension:t.xAccessor,dimensionFallback:"x"}}function r(e){for(let t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){let a=e[t];if("string"==typeof a&&a)return a}}function n(e,t){return null==e?"—":e instanceof Date?e.toISOString().slice(0,10):"number"==typeof e?t(e):e+""}function l(e,t={}){let a=!0===t.showRetractedAnnotations,r=!0===t.showSupersededAnnotations,n=new Set;for(let t of e){let e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&n.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!a)return!1;let t=e?.provenance?.stableId;return!(t&&n.has(t)&&!r)})}function i(){let e=globalThis;return e[fe]||(e[fe]={recipes:new Map,capabilities:new Map,layouts:new Map}),e[fe]}function o(e){return i().recipes.get(e)}function s(e){let t=i().layouts.get(e)?.identity;return t?{...t}:void 0}function c(e){return"string"==typeof e?o(e):e&&"object"==typeof e&&"string"==typeof e.id?e:void 0}function u(e){return"string"==typeof e?e:e.id??e.name}function h(e){return e.layoutConfig&&"object"==typeof e.layoutConfig?e.layoutConfig:{}}function d(e){return Array.isArray(e.data)?e.data:Array.isArray(e.nodes)?e.nodes:Array.isArray(e.points)?e.points:Array.isArray(e.areas)?e.areas:[]}function m(e,t,a){return a??c(t.recipe)??c(t.recipeId)??o(e)}function f(e,t,a=[]){let r=e.accessor?t[e.accessor]:void 0;if("string"==typeof r&&r)return r;if(e.field)return e.field;let n=a.find(e=>e&&"object"==typeof e);if(!n)return;let l=Object.entries(n).filter(([e,t])=>!e.startsWith("_")&&null!=t);return"quantitative"===e.semanticType?l.find(([,e])=>"number"==typeof e)?.[0]:"identifier"===e.semanticType?["id","key","name"].find(e=>e in n):l.find(([,e])=>"string"==typeof e)?.[0]}function p(e,t){return e.dataRoles.find(e=>e.role===t)}function g(e,t){return e.dataRoles.find(e=>t.includes(e.semanticType))}function $(e,t,a,r,n,l={}){let i={...l};if(t)for(let[e,a]of Object.entries(t))i[e]=a;for(let e of a.dataRoles){let a=f(e,r,n),l=t&&a?t[a]:a;void 0!==l&&(i[e.role]=l)}return e.replace(/\{([^}]+)\}/g,(e,t)=>{let a=i[t];return null==a?`{${t}}`:a+""})}function b(e,t,a){return"function"==typeof a?a(e,t):e[a]}function v(e){if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?t:null}let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function y(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}}function w(e,t,a=0){let r=new Set(e.filter(e=>null!=e.id).map(e=>e.id+"")),n=new Map;for(let l of e){let e=null==l.id?`${t}-${a++}`:l.id+"";for(;null==l.id&&r.has(e);)e=`${t}-${a++}`;r.add(e),n.set(e,null==l.id?{...l,id:e}:l)}return{seed:e,rows:Array.from(n.values()),nextId:a}}function C(e={}){let t=(e.categories?.length?e.categories:["Intake","Review","Build","Ship"]).map(e=>(e+"").trim()).filter(Boolean),a=t.length?t:["Intake"],r=Math.max(a.length,Math.round(e.count??Math.max(48,12*a.length))),n=function(e){let t=v(e);return null!=t&&t>0?t:1}(e.unitValue),l=y(e.seed??1),i=e.idPrefix??"mechanical-pile",o=a.map(()=>.65+.9*l()),s=o.reduce((e,t)=>e+t,0)||1,c=r-a.length,u=o.map(e=>e/s*c),h=u.map(e=>1+Math.floor(e)),d=r-h.reduce((e,t)=>e+t,0),m=u.map((e,t)=>({index:t,fraction:e-Math.floor(e)})).sort((e,t)=>t.fraction-e.fraction);for(let e=0;d>0;e=(e+1)%m.length)h[m[e].index]+=1,d-=1;return a.map((e,t)=>({id:`${i}-${t}`,category:e,value:h[t]*n,mechanical:!0,unitCount:h[t],unitValue:n,share:h[t]/r}))}function k(e,t){let a=e/t,r=Math.round(a);return Math.ceil(r>0&&Number.EPSILON*a*4>=Math.abs(a-r)?r:a)}function A(e,t){let a="mechanical"===(t.simulationMode??t.mode)&&("GaltonBoardChart"===e||"UnitPileChart"===e);if(!Array.isArray(t.data)&&!a)return null;let r=Array.isArray(t.data)?t.data:[],n=Math.max(2,Math.round(v(t.bins)??21)),l=Math.max(1,Math.round(v(t.pegRows)??n-1));if(a&&(r="GaltonBoardChart"===e?function(e){let t=Math.max(2,Math.round(e.bins)),a=Math.max(1,Math.round(e.pegRows??t-1)),r=Math.max(1,Math.round(e.count??Math.max(64,4*t))),n=(o=Number.isFinite(e.branchProbability)?e.branchProbability??.5:.5,Math.max(0,Math.min(1,o))),l=y(e.seed??1),i=e.idPrefix??"mechanical";var o;return Array.from({length:r},(e,t)=>{let r=0;for(let e=0;a>e;e+=1)l()<n&&(r+=1);let o=a/2;return{id:`${i}-${t}`,value:r,mechanical:!0,pegRows:a,branchProbability:n,pathRights:r,side:o>r?"left":r>o?"right":"center"}})}({bins:n,count:t.mechanicalCount,pegRows:l,branchProbability:t.branchProbability,seed:t.seed}):C({count:t.mechanicalCount,categories:t.mechanicalCategories,unitValue:t.unitValue,seed:t.seed})),r=w(r,"UnitPileChart"===e?"pile":"GaltonBoardChart"===e?"galton":"EventDropChart"===e?"event":"collision-swarm").rows,"UnitPileChart"===e){let e=new Map,n=t.valueAccessor??(a?"value":void 0);return r.forEach((a,r)=>{let l=(b(a,r,t.categoryAccessor??"category")??"unknown")+"",i=n?v(b(a,r,n)):1;e.set(l,(e.get(l)??0)+Math.max(0,i??0))}),{generated:a,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("GaltonBoardChart"===e){let e=r.map((e,a)=>v(b(e,a,t.valueAccessor??"value"))).filter(e=>null!=e),i=a?[0,l]:function(e){if(!e)return;let t=v(e[0]),a=v(e[1]);return null!=t&&null!=a?t>a?[a,t]:[t,a]:void 0}(t.valueExtent),o=i?.[0]??(e.length?Math.min(...e):0),s=i?.[1]??(e.length?Math.max(...e):1),c=o===s?1:s-o,u=Array.from({length:n},(e,t)=>({label:t+1+"",value:0}));for(let t of e)u[Math.max(0,Math.min(n-1,Math.floor((t-o)/c*n)))].value+=1;return{generated:a,rows:u}}if("CollisionSwarmChart"===e){let e=new Map;return r.forEach((a,r)=>{if(null==v(b(a,r,t.xAccessor??"x")))return;let n=t.groupAccessor?(b(a,r,t.groupAccessor)??"All")+"":"All";e.set(n,(e.get(n)??0)+1)}),{generated:a,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("EventDropChart"===e){let e=v(t.windows?.size??10);if(null==e||0>=e)return null;let{events:n}=function(e){let{windowSize:t,watermark:a,watermarkAtArrivalAccessor:r}=e;if(!Number.isFinite(t)||0>=t)throw new RangeError("EventDrop windows.size must be a finite positive number");let{rows:n}=w(e.data,"event"),l=n.flatMap((t,a)=>{let r=v(b(t,a,e.timeAccessor));return null==r?[]:[{datum:t,index:a,eventTime:r,arrivalTime:v(b(t,a,e.arrivalAccessor))??r,watermarkAtArrival:0,late:!1}]}),i="function"==typeof a?null:v(a?.value),o="function"==typeof a?t:v(a?.delay)??t,s=-1/0,c=-1/0;for(let e of l.slice().sort((e,t)=>e.arrivalTime-t.arrivalTime||e.index-t.index)){s=Math.max(s,e.eventTime);let n="function"==typeof a?v(a(s)):s-o;c=i??Math.max(c,n??s-t);let l=r?v(b(e.datum,e.index,r)):null;e.watermarkAtArrival=l??c,e.late=e.watermarkAtArrival>=(Math.floor(e.eventTime/t)+1)*t}return{events:l,watermarkValue:l.length?c:i??-o}}({data:r,timeAccessor:t.timeAccessor??"time",arrivalAccessor:t.arrivalAccessor??"arrivalTime",windowSize:e,watermark:t.watermark,watermarkAtArrivalAccessor:t.watermarkAtArrivalAccessor}),l=n.map(e=>e.eventTime),i=l.length?Math.min(...l):0,o=l.length?Math.max(...l):i+e,s=Math.min(v(t.timeExtent?.[0])??i,i),c=Math.max(v(t.timeExtent?.[1])??o,o),u=Math.floor(s/e)*e,h=Math.max(1,Math.ceil((c-u+e)/e)),d=Array.from({length:h},(t,a)=>({label:`${u+a*e}-${u+(a+1)*e}`,value:0,secondary:0,secondaryLabel:"late"}));for(let t of n){let a=d[Math.max(0,Math.min(h-1,Math.floor((t.eventTime-u)/e)))];t.late?a.secondary+=1:a.value+=1}return{generated:a,rows:d}}return null}function x(e){let t="number"==typeof e?e:"string"==typeof e?Number(e):NaN;return Number.isFinite(t)?t:void 0}function M(e,t){let a=e.physics&&"object"==typeof e.physics?e.physics:null,r=e.settledProjection&&"object"==typeof e.settledProjection?e.settledProjection:null,l=[e.settledProjectionRows,e.projectionRows,r?.rows,a?.settledProjectionRows,a?.projectionRows,a?.settledProjection&&"object"==typeof a.settledProjection?a.settledProjection.rows:void 0].find(e=>Array.isArray(e));return Array.isArray(l)?l.map((e,a)=>{if(!e||"object"!=typeof e)return null;let r=e,l=x(r.count??r.value??r.total??r.bodies??r.events);if(null==l)return null;let i=r.label??r.id??r.name??"container "+(a+1),o=x(r.secondary??r.secondaryCount),s=x(r.observed??r.observedCount);return{label:n(i,t),count:l,...null!=o?{secondary:o}:{},..."string"==typeof r.secondaryLabel&&r.secondaryLabel?{secondaryLabel:r.secondaryLabel}:{},...null!=s?{observed:s}:{}}}).filter(e=>null!=e):null}function S(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function L(e){return pe[e]||e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()+" chart"}function F(e,t){let a=function(e){if(e){if("fits"in e||"buildProps"in e){let t=e,a={};for(let[e,r]of Object.entries(t.intentScores))"number"==typeof r&&Number.isFinite(r)&&(a[e]=r);return{family:t.family,intentScores:Object.keys(a).length?a:void 0}}return e}}(t);if(a?.act)return a.act;if(a?.intentScores){let e=function(e){let t,a=0;for(let[r,n]of Object.entries(e))if("number"==typeof n&&n>0){if(n>a){t=r,a=n;continue}if(n===a&&void 0!==t){let e=we.indexOf(r),a=we.indexOf(t);-1!==e&&(-1===a||a>e)&&(t=r)}}return t}(a.intentScores);if(e&&ve[e]&&(a.intentScores[e]??0)>=3)return ve[e]}return a?.family?ye[a.family]:function(e){return"BumpChart"===e?"ranking":de.has(e)||"StackedAreaChart"===e?"apportioning":be.has(e)?"relating":he.has(e)?"comparing":me.has(e)?"characterizing":ue.has(e)?"tracking":ge.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}(e)}function P(e){let t=e.annotations;return!!Array.isArray(t)&&t.some(e=>{if(!e||"object"!=typeof e)return!1;let t=e;if("string"!=typeof t.type||!ke.has(t.type))return!1;let a=t.provenance;return!(!a||"object"!=typeof a)&&(Ae.has(a.authorKind)||xe.has(a.source)||Me.has(a.basis))})}function j(e="en"){let t,a;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),a=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch{t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),a=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?1e4>Math.abs(e)?a.format(e):t.format(e):e+""}function N(e){let t=Se["string"==typeof e.type?e.type:"annotation"]||"an annotation",a=function(e){let t=e.provenance&&"object"==typeof e.provenance?e.provenance:null,a=t?.authorKind??t?.source??t?.basis;return"watcher"===a?"a watcher-flagged ":"agent"===a||"ai"===a||"llm-inference"===a?"an AI-suggested ":""}(e),r=a?a+t.replace(/^an? /,""):t,n="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return n?`${r} labeled "${n}"`:r}function T(e){let t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;let a=l(t.filter(e=>!!e&&"object"==typeof e));if(0===a.length)return;let r=a.map(N),n=r.slice(0,5),i=r.length-n.length,o=function(e){return e.length>1?2===e.length?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`:e[0]??""}(n)+(i>0?`, and ${i} more`:""),s=a.length;return`The author has marked ${1===s?"one feature":s+" features"} on this chart: ${o}.`}function D(l,i,o={}){let s=void 0!==o.levels,c=new Set(o.levels??["l1","l2","l3"]);!s&&(o.capability||P(i))&&c.add("l4");let p=m(l,i,o.recipe);if(p){let e=["l1","l2","l3","l4"].filter(e=>c.has(e));!s&&!e.includes("l4")&&e.push("l4");let t=function(e,t,a={}){let r=d(t),n=h(t),l=a.locale??"en",i=("function"==typeof e.description?e.description({data:r,config:n,locale:l}):void 0)?.levels??function(e,t,a,r){let n=g(e,["nominal","ordinal"]),l=g(e,["quantitative"]),i=n?f(n,a,t):void 0,o=l?f(l,a,t):void 0,s=n?.role??i??"category",c=l?.role??o??"value",h=e.encodings??[],d=h.length?h.slice(0,3).map(e=>e.meaning.replace(/\.$/,"")).join("; "):`${s} and ${c} are mapped through the recipe's declared visual semantics`,{number:m,percent:p}=function(e){try{return{number:new Intl.NumberFormat(e,{maximumFractionDigits:2}),percent:new Intl.NumberFormat(e,{style:"percent",maximumFractionDigits:1})}}catch{return{number:new Intl.NumberFormat("en",{maximumFractionDigits:2}),percent:new Intl.NumberFormat("en",{style:"percent",maximumFractionDigits:1})}}}(r),$=new Map;if(i&&o)for(let e of t){let t=(e[i]??"Uncategorized")+"",a=Number(e[o]);Number.isFinite(a)&&$.set(t,($.get(t)??0)+a)}let b=[...$].sort((e,t)=>t[1]-e[1]),v=b.reduce((e,[,t])=>e+t,0),y=b[0],w=b[1],C=v>0?((y?.[1]??0)+(w?.[1]??0))/v:0,k=e.intents.map(e=>({id:u(e),strength:"string"==typeof e?void 0:e.strength})).sort((e,t)=>"primary"===e.strength?-1:"primary"===t.strength?1:0)[0]?.id,A=e.audience?.primary??e.audienceFit?.find(e=>"strong"===e.fit)?.audience;return{l1:`A ${e.name.toLowerCase()} encodes ${s} and ${c}. ${x=d,x&&x.charAt(0).toUpperCase()+x.slice(1)}.`,l2:b.length>0?`${b.length} categories total ${m.format(v)}. ${y[0]} accounts for ${m.format(y[1])}${v>0?` (${p.format(y[1]/v)})`:""}${w?`, followed by ${w[0]} at ${m.format(w[1])}`:""}.`:`${t.length} data ${1===t.length?"item is":"items are"} represented.`,l3:2>b.length?y?y[0]+" is the only represented category.":"No quantitative pattern can be derived from the available data.":.5>C?`The total is distributed across ${b.length} categories without the first two forming a majority.`:`Most of the total is concentrated in ${y[0]} and ${w[0]}, which together account for ${p.format(C)}.`,l4:`The chart is intended for ${k??"explanation"}${A?` with a ${A} audience`:""}: ${e.designContract.whyCustom}`};var x}(e,r,n,l),o=a.levels??["l1","l2","l3","l4"],s={};for(let e of o)i[e]&&(s[e]=i[e]);let c=["l1","l2","l3","l4"].map(e=>s[e]).filter(e=>!!e).join(" "),m=a.includeCaveats?[...e.reception?.risks??[],...e.caveats??[],...(e.designContract.misuse??[]).map(e=>"Misuse: "+e)]:void 0;return{text:c,levels:s,...m?.length?{caveats:m}:{}}}(p,i,{levels:e,locale:o.locale,audience:o.audience,includeCaveats:o.includeCaveats}),a=T(i);return{...t,text:a?`${a} ${t.text}`.trim():t.text,...a?{annotations:a}:{}}}let $=j(o.locale??"en"),b=L(l),v=Array.isArray(i.data)?i.data:null,y=r(i),w=$e.has(l)?M(i,$):null,C=$e.has(l)&&null===w?A(l,i):null,{measure:k,measureFallback:x,dimension:N,dimensionFallback:D}=a(l,i),I="string"==typeof k&&k?k:x,E="string"==typeof N&&N?N:D,G={};if($e.has(l)&&function(e,t,a,r,n,l,i=null){let o=function(e){return"EventDropChart"===e?"time window":"GaltonBoardChart"===e?"bin":"CollisionSwarmChart"===e?"group lane":"PacketFlowChart"===e?"flow node":"CrucibleChart"===e?"result group":"container"}(e),s=i&&"EventDropChart"===e?"accepted event":function(e){return"EventDropChart"===e?"event":"GaltonBoardChart"===e?"sample":"CollisionSwarmChart"===e?"point":"PacketFlowChart"===e?"packet":"CrucibleChart"===e?"settled item":"UnitPileChart"===e?"unit":"body"}(e),c=i?i.generated?"The generated sample projection":"The source projection":"The settled projection";if(n.has("l1")&&(r.l1=function(e,t){return"EventDropChart"===e?"An event-drop physics chart that collapses moving events into a settled projection by event-time window.":"GaltonBoardChart"===e?"A Galton board chart that collapses falling samples into a settled histogram projection.":"UnitPileChart"===e?"A physics pile chart that collapses moving bodies into a settled bar-style projection by container.":"CollisionSwarmChart"===e?"A collision swarm chart that separates overlapping points while preserving their quantitative axis position.":"PacketFlowChart"===e?"A physical flow chart that keeps authored routes visible while packet bodies show throughput and proximity events.":"CrucibleChart"===e?"A crucible physics chart that replays authored phases and events into declared products and outlets; the settled ledger, not collisions, determines the result.":`A ${t} whose accessible reading is the settled projection rather than individual trajectories.`}(e,t)),!n.has("l2")&&!n.has("l3"))return;if(!a||0===a.length)return void(n.has("l2")&&(r.l2=i?"No valid source records are available.":"No settled projection is loaded yet."));let u=a.reduce((e,t)=>e+t.count,0),h=a.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),d=h[0]??a.slice().sort((e,t)=>t.count-e.count)[0];if(!d)return;let m=a.reduce((e,t)=>e+(t.secondary??0),0),f=a.find(e=>e.secondaryLabel)?.secondaryLabel??"secondary";if(n.has("l2"))if(i&&"EventDropChart"===e)r.l2=`${c} classifies ${l(u+m)} ${S(u+m,"event")} across ${a.length} ${S(a.length,o)}: ${l(u)} accepted and ${l(m)} late.`;else if(0===h.length)r.l2=`${c} contains ${l(u)} ${S(u,s)} across ${a.length} ${S(a.length,o)}; no ${S(2,o)} are non-empty yet.`;else{let e=m>0?` ${l(m)} ${S(m,s)} ${1===m?"is":"are"} marked ${f}.`:"";r.l2=`${c} contains ${l(u)} ${S(u,s)} across ${a.length} ${S(a.length,o)}; ${h.length} ${S(h.length,o)} ${1===h.length?"is":"are"} non-empty. The largest ${o} is ${d.label} with ${l(d.count)} ${S(d.count,s)}.${e}`}if(n.has("l3")&&u>0&&h.length>0){let e=h.find(e=>e!==d),t=function(e,t){if(0>=t)return"0%";let a=e/t*100;return(10>a?Math.round(10*a)/10:Math.round(a))+"%"}(d.count,u);r.l3=e?`${c} is most concentrated in ${d.label}, which holds ${l(d.count)} ${S(d.count,s)} (${t}); ${e.label} follows with ${l(e.count)} ${S(e.count,s)}.`:`${c} is concentrated in ${d.label}, which holds all ${l(d.count)} ${S(d.count,s)}.`}}(l,b,w??(C?M({projectionRows:C.rows},$):null),G,c,$,C),c.has("l1")&&!$e.has(l))if("BumpChart"===l)G.l1=`A ${b} ranking ${y??"series"} by ${I} across ${E}.`;else if(ue.has(l)||he.has(l))G.l1=`A ${b} of ${I} by ${E}`+(y?`, split by ${y}.`:".");else if(de.has(l))G.l1=`A ${b} showing ${I} across ${E} categories.`;else if(me.has(l))G.l1=`A ${b} of the distribution of ${I}`+(y?` by ${y}.`:".");else if(ge.has(l)){let e=Array.isArray(i.nodes)?i.nodes.length:void 0,t=Array.isArray(i.edges)?i.edges.length:void 0,a=[null!=e?`${e} ${R(e,"node")}`:null,null!=t?`${t} ${R(t,"edge")}`:null].filter(Boolean);G.l1=`A ${b}${a.length?" with "+a.join(" and "):""}.`}else if("BigNumber"===l){let e="string"==typeof i.label?i.label:I;G.l1=`A single value${e?" for "+e:""}.`}else G.l1=`A ${b}.`;let z=ue.has(l)||"BumpChart"===l||he.has(l)||de.has(l)||me.has(l),O=null;if((c.has("l2")||c.has("l3")||c.has("l4"))&&z&&v&&v.length>0&&(O=function(e,t,a,r){let l=0,i=0,o=1/0,s=-1/0,c=null,u=null,h=0,d=0,m=null,f=null,p=NaN,g=NaN;for(let a of e){let e=t(a);Number.isFinite(e)&&(0===l&&(p=e,m=a),g=e,f=a,o>e&&(o=e,c=a,h=l),e>s&&(s=e,u=a,d=l),l++,i+=e)}return 0===l?null:{count:l,min:o,max:s,mean:i/l,minLabel:n(null!=c?a(c):null,r),maxLabel:n(null!=u?a(u):null,r),first:p,last:g,firstLabel:n(null!=m?a(m):null,r),lastLabel:n(null!=f?a(f):null,r),minIndex:h,maxIndex:d}}(v,e(k,x),t(N,D),$)),c.has("l2")&&z&&(v&&0!==v.length?O&&(G.l2=de.has(l)?`${O.count} segments totaling ${$(function(e){return e.mean*e.count}(O))}. Largest is ${O.maxLabel} at ${$(O.max)}; smallest is ${O.minLabel} at ${$(O.min)}.`:`${I} ranges from ${$(O.min)} (${O.minLabel}) to ${$(O.max)} (${O.maxLabel}), with a mean of ${$(O.mean)} across ${O.count} points.`):G.l2="No data is loaded yet."),c.has("l3")&&O&&!y&&ue.has(l)?G.l3=function(e,t,a){let{first:r,last:n,min:l,max:i,maxLabel:o,minLabel:s,firstLabel:c,lastLabel:u,minIndex:h,maxIndex:d,count:m}=e,f=i-l,p=n-r;if(0===f)return`${B(t)} is constant at ${a(r)} across the series.`;if(.04>f/(Math.abs(e.mean)||1))return`${B(t)} ends roughly where it started (${a(r)} at ${c} to ${a(n)} at ${u}), ranging between ${a(l)} and ${a(i)}.`;let g=d>0&&m-1>d,$=h>0&&m-1>h,b=(i-Math.max(r,n))/f,v=(Math.min(r,n)-l)/f;return g&&b>.15?`Overall ${t} climbs to a peak of ${a(i)} (${o}), then falls to ${a(n)} (${u}).`:$&&v>.15?`Overall ${t} drops to a low of ${a(l)} (${s}), then recovers to ${a(n)} (${u}).`:.05>Math.abs(p)/f?`${B(t)} ends roughly where it started (${a(r)} at ${c} to ${a(n)} at ${u}), ranging between ${a(l)} and ${a(i)}.`:p>0?d===m-1?`Overall ${t} rises from ${a(r)} (${c}) to a peak of ${a(n)} (${u}).`:`Overall ${t} rises from ${a(r)} (${c}) to ${a(n)} (${u}), after peaking at ${a(i)} (${o}).`:h===m-1?`Overall ${t} falls from ${a(r)} (${c}) to a low of ${a(n)} (${u}).`:`Overall ${t} falls from ${a(r)} (${c}) to ${a(n)} (${u}), after dipping to ${a(l)} (${s}).`}(O,I,$):c.has("l3")&&O&&!y&&he.has(l)&&(G.l3=`The highest ${E} is ${O.maxLabel} and the lowest is ${O.minLabel}.`),c.has("l4")){let e=P(i)?"alerting":F(l,o.capability);e&&(G.l4=function(e,t,a,r,n,l,i,o){let s,c,u=Ce[e],h=/^[aeiou]/i.test(u)?"an":"a";switch(e){case"locating":s="This is a map",c="read values by location";break;case"presenting":s="This is a single-value display",c=`read ${"string"==typeof a.label&&a.label?a.label:n} as the headline number`;break;case"tracing":s=`This is ${h} ${u} chart`,c="follow the movement between states";break;case"nesting":s=`This is ${h} ${u} chart`,c="read it for nested structure and how children sum into their parents";break;case"relating":s=`This is ${h} ${u} chart`,c=`read it for whether ${l} and ${n} move together`;break;default:s=`This is ${h} ${u} chart`,c=function(e,t,a,r,n,l){if(!t)switch(e){case"alerting":return"watch for points that break from the rest";case"tracking":return"read it for the overall direction of "+a;case"comparing":return`compare ${a} across ${r}`;case"ranking":return"read it top to bottom by "+a;case"apportioning":return`read each ${r}'s share of the whole`;case"characterizing":return"read it for the spread and shape of "+a;default:return"read the highlighted features"}switch(e){case"alerting":return function(e,t,a){if(he.has(a)||de.has(a))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;let{first:r,last:n,min:l,max:i,minLabel:o,maxLabel:s,lastLabel:c,minIndex:u,maxIndex:h,count:d}=e,m=i-l;if(m>0){let e=h>0&&d-1>h,a=u>0&&d-1>u,f=(i-Math.max(r,n))/m,p=(Math.min(r,n)-l)/m;if(e&&f>.15)return`the peak of ${t(i)} at ${s} is the point to investigate`;if(a&&p>.15)return`the dip to ${t(l)} at ${o} is the point to investigate`;if(n>=i)return`the climb to ${t(n)} at ${c} warrants a closer look`;if(l>=n)return`the drop to ${t(n)} at ${c} warrants a closer look`}return`the extremes — ${s} (${t(i)}) and ${o} (${t(l)}) — are the points to check`}(t,n,l);case"tracking":return`read it for the trajectory of ${a}, which ${function(e){let t=e.max-e.min,a=e.last-e.first;return 0===t||.05>Math.abs(a)/t?"holds roughly steady":a>0?"rises":"falls"}(t)} from ${n(t.first)} (${t.firstLabel}) to ${n(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${a} across ${r}; ${t.maxLabel} leads at ${n(t.max)}`;case"ranking":return`read it top to bottom by ${a}; ${t.maxLabel} ranks highest at ${n(t.max)}`;case"apportioning":{let e=t.mean*t.count,a=e>0?Math.round(t.max/e*100):null;return`read each ${r}'s share of the ${n(e)} total; ${t.maxLabel} is the largest at ${n(t.max)}${null!=a?` (${a}%)`:""}`}case"characterizing":return`read it for the spread of ${a}, from ${n(t.min)} to ${n(t.max)}`;default:return"read the highlighted features"}}(e,r,n,l,i,t)}return`${s}; ${c}.${function(e,t){if(!t)return"";let a=t.familiarity?.[e];return"number"!=typeof a||a>2?"":` This ${L(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`}(t,o)}`}(e,l,i,y?null:O,I,E,$,o.audience))}let U=["l1","l2","l3","l4"].filter(e=>c.has(e)&&G[e]).map(e=>G[e]).join(" "),H=T(i);return{text:H?`${H} ${U}`.trim():U,levels:G,...H?{annotations:H}:{}}}function B(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function R(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function I(e){return((e??"unknown")+"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function E(e,t,a){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:a]}function G(e,t="—"){return null==e||""===e?t:"object"==typeof e?G(e.id??e.name??e.label,t):e+""}function z(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function O(e){return G(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function U(e,t){let a=E(e,t,"children");return Array.isArray(a)?a:[]}function H(e,t,a){return`${e} ${1===e?t:a}`}function V(e,t){return 0===e.numericLeaves?"":e.numericLeaves===e.leaves?", leaf total "+t(e.leafTotal):`, known leaf total ${t(e.leafTotal)} across ${H(e.numericLeaves,"valued leaf","valued leaves")}`}function q(e){return"TreeDiagram"===e?"tree":"Treemap"===e?"treemap":"CirclePack"===e?"circle-packing":"orbit"}function Q(e,t,a){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:a]}function W(e,t="—"){return null==e||""===e?t:"object"==typeof e?W(e.id??e.name??e.label,t):e+""}function K(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function X(e){return W(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Z(e){let t=[];return(e.linkedHover||e.selection||e.linkedBrush)&&t.push("Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&t.push("Hover or focus a mark for its details."),t.length>0?" "+t.join(" "):""}function _(e,t,a){let r=Q(e,t,a);if(void 0!==r)return r;let n=e.properties;return n&&"object"==typeof n?Q(n,t,a):void 0}function J(e,t,a){return W(_(e,t,"id")??_(e,"name","name")??_(e,"NAME","NAME")??_(e,"label","label"),a)}function Y(e){let t=0,a=1/0,r=-1/0,n=0;for(let l of e)null!=l.value&&(t+=1,a=Math.min(a,l.value),r=Math.max(r,l.value),n+=l.value);return 0===t?null:{count:t,min:a,max:r,total:n,average:n/t}}function ee(e,t){let a=Y(e);return a?`range ${t(a.min)} to ${t(a.max)}, average ${t(a.average)}, total ${t(a.total)}`:"no numeric values"}function te(e,t,a,r){let n=function(e){if(Array.isArray(e))return e;if(!e||"object"!=typeof e)return[];let t=e;return Array.isArray(t.features)?t.features:"Feature"===t.type?[t]:[]}(t.areas),l="FlowMap"===e&&Array.isArray(t.nodes)?t.nodes:Array.isArray(t.points)?t.points:[],i=Array.isArray(t.flows)?t.flows:[],o=Array.isArray(t.lines)?t.lines:[],s=t.valueAccessor??t.sizeBy??t.costAccessor??"value",c=t.pointIdAccessor??t.nodeIdAccessor??"id",u=("ChoroplethMap"===e?n:l).map((a,r)=>({datum:a,index:r,label:J(a,"ChoroplethMap"===e?t.idAccessor:c,`${"ChoroplethMap"===e?"region":"location"} ${r+1}`),value:K(_(a,s,"value"))})),h=u.filter(e=>null!=e.value),d={id:"root",role:"chart",level:1,label:`${"ChoroplethMap"===e?`A choropleth map with ${n.length} regions.${h.length>0?` Values are available for ${h.length} of ${n.length} regions; ${ee(h,r)}.`:" No regions have numeric values."}`:"FlowMap"===e?`A flow map with ${i.length} flows and ${l.length} locations.`:"DistanceCartogram"===e?`A distance cartogram with ${l.length} locations and ${o.length} routes.`:`A proportional-symbol map with ${l.length} locations.`}${Z(t)}`,children:[]};if("ChoroplethMap"===e)d.children=function(e,t,a){let r,n=e.filter(e=>null!=e.value).sort((e,t)=>t.value-e.value||e.index-t.index),l=new Map,i=0;for(let[e,t]of n.entries())r!==t.value&&(i=e+1,r=t.value),l.set(t.index,i);let o=0;return function(e){let t=e.filter(e=>null!=e.value),a=e.filter(e=>null==e.value),r=[],n=Y(t);if(n)if(n.min===n.max)r.push({id:"equal",label:"Equal values",rows:t});else{let e=n.min+(n.max-n.min)/3,a=n.min+2*(n.max-n.min)/3,l=t.filter(e=>e.value>=a),i=t.filter(t=>t.value>=e&&a>t.value),o=t.filter(t=>e>t.value);l.length>0&&r.push({id:"highest",label:"Highest values",rows:l}),i.length>0&&r.push({id:"middle",label:"Middle values",rows:i}),o.length>0&&r.push({id:"lowest",label:"Lowest values",rows:o})}return a.length>0&&r.push({id:"missing",label:"No numeric value",rows:a}),r}(e).map(e=>{let r=e.rows.slice(0,Math.max(0,t-o));o+=r.length;let i=r.map(e=>{let t=l.get(e.index),r=null==t||2>n.length?"":`, rank ${t} of ${n.length}`;return{id:`geo-${X(e.label)}-${e.index}`,role:"datum",level:3,label:null==e.value?e.label+": no numeric value.":`${e.label}: ${a(e.value)}${r}.`,...null==e.value?{}:{value:e.value},datum:e.datum}}),s=e.rows.length-r.length;return s>0&&i.push({id:`geo-${e.id}-more`,role:"datum",level:3,label:`${s} more ${1===s?"region":"regions"} in ${e.label.toLowerCase()} not shown; navigation is capped at ${t}.`}),{id:"regions-"+e.id,role:"series",level:2,label:`${e.label}: ${e.rows.length} ${1===e.rows.length?"region":"regions"}, ${ee(e.rows,a)}.`,children:i}})}(u,a,r);else if(u.length>0){let e=u.slice(0,a).map(e=>({id:`geo-${X(e.label)}-${e.index}`,role:"datum",level:3,label:`${e.label}${null==e.value?"":": "+r(e.value)}.`,...null==e.value?{}:{value:e.value},datum:e.datum}));u.length>a&&e.push({id:"geo-more",role:"datum",level:3,label:`…and ${u.length-a} more locations.`}),d.children?.push({id:"locations",role:"series",level:2,label:`Locations: ${u.length} marks.`,children:e})}let m="FlowMap"===e?i:o;if(m.length>0){let e=m.slice(0,a).map((e,t)=>{let a=W(e.source,"unknown"),n=W(e.target,"unknown"),l=K(Q(e,s,"value"));return{id:`route-${X(a)}-${X(n)}-${t}`,role:"datum",level:3,label:`${a} to ${n}${null==l?"":": "+r(l)}.`,...null==l?{}:{value:l},datum:e}});d.children?.push({id:"routes",role:"series",level:2,label:`Routes: ${m.length} ${1===m.length?"route":"routes"}.`,children:e})}return d}function ae(e,t={},a={}){return!!m(e,t,a.recipe)||Le.has(e)||Fe.has(e)||Pe.has(e)||ue.has(e)||he.has(e)||de.has(e)||me.has(e)}function re(e,t,a){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:a]}function ne(e,t="—"){return null==e||""===e?t:"object"==typeof e?ne(e.id??e.name??e.label,t):e+""}function le(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function ie(e){return ne(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function oe(e,t){let a=[];return(e.linkedHover||e.selection||e.linkedBrush)&&a.push("network"===t?"Use linked highlighting to trace related marks.":"Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&a.push("Hover or focus a mark for its details."),a.length>0?" "+a.join(" "):""}function se(e,t){t&&e.children?.push(t)}function ce(i,o,s={}){let c=s.locale??"en",u=Math.max(1,s.maxLeaves??200),b=j(c),v=m(i,o,s.recipe);if(v)return function(e,t,a={}){let r=d(t),n=h(t),l=Math.max(1,a.maxLeaves??200);if("function"==typeof e.navigation)return e.navigation({data:r,config:n,locale:a.locale??"en"});let i=(y=e.navigation)&&"object"==typeof y?e.navigation:void 0,o=(i?.groupByRole?p(e,i.groupByRole):void 0)??(i?.groupBy?.[0]?p(e,i.groupBy[0])??e.dataRoles.find(e=>e.field===i.groupBy?.[0]):void 0)??g(e,["nominal","ordinal"]),s=o?f(o,n,r):void 0,c=(i?.idRole?p(e,i.idRole):void 0)??g(e,["identifier"]),u=c?f(c,n,r):void 0,m={id:"root",role:"chart",label:i?.summaryTemplate?$(i.summaryTemplate,void 0,e,n,r,{count:r.length}):`${e.name}: ${r.length} ${1===r.length?"item":"items"} represented.`,level:1,children:[]},b=0,v=(t,a,l)=>{let o=u?t[u]:void 0,s=i?.itemLabelTemplate?$(i.itemLabelTemplate,t,e,n,r,{count:r.length}):function(e,t,a,r){let n=g(t,["nominal","ordinal"]),l=t.dataRoles.filter(e=>"quantitative"===e.semanticType),i=n?f(n,a,r):void 0,o=[];i&&null!=e[i]&&o.push(e[i]+"");for(let t of l){let n=f(t,a,r);n&&null!=e[n]&&o.push(`${t.role}: ${e[n]+""}`)}return o.length>0?o.join(", "):"Data item"}(t,e,n,r);return{id:"datum-"+I(o??a),role:"datum",label:s,level:l,datum:t}};var y;if(s){let e=new Map;for(let t of r){let a=(t[s]??"Uncategorized")+"",r=e.get(a);r?r.push(t):e.set(a,[t])}m.children=[...e].map(([e,t],a)=>{let r=t.slice(0,Math.max(0,l-b));b+=r.length;let n=r.map((e,t)=>v(e,1e5*a+t,3));return t.length>r.length&&n.push({id:"more-"+I(e),role:"datum",label:`…and ${t.length-r.length} more items`,level:3}),{id:"group-"+I(e),role:"series",label:`${e}: ${t.length} ${1===t.length?"item":"items"}.`,level:2,children:n}})}else{let e=r.slice(0,l);m.children=e.map((e,t)=>v(e,t,2)),r.length>e.length&&m.children.push({id:"more",role:"datum",label:`…and ${r.length-e.length} more items`,level:2})}return m}(v,o,{maxLeaves:u,locale:c});let y={id:"root",role:"chart",label:D(i,o,{locale:c}).text||"Chart.",level:1,children:[]},w=function(e,t){let a=Array.isArray(e.annotations)?e.annotations:null;if(!a)return null;let r=l(a.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return null;let n=0,i=r.slice(0,t).map(e=>{let t=e.lifecycle?.status,a=t&&"accepted"!==t?` (${t})`:"";return{id:"annotation-"+n++,role:"annotation",level:3,label:`${r=N(e),r&&r.charAt(0).toUpperCase()+r.slice(1)}${a}.`,datum:e};var r});r.length>t&&i.push({id:"annotation-"+n++,role:"annotation",level:3,label:`…and ${r.length-t} more annotations.`});let o=r.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===o?"one marked feature":o+" marked features"}.`,children:i}}(o,u);if(Le.has(i)){let e=function(e,t,a,r){let n=Array.isArray(t.nodes)?t.nodes:[],l=Array.isArray(t.edges)?t.edges:Array.isArray(t.flows)?t.flows:[],i=t.nodeIdAccessor??t.nodeIDAccessor,o=t.sourceAccessor??"source",s=t.targetAccessor??"target",c=t.valueAccessor??"value",u=e=>ne(re(e,i,"id"),"unknown"),h=(e,t)=>ne(re(e,t,""),"unknown"),d=new Set;for(let e of l)d.add(h(e,o)),d.add(h(e,s));let m=n.length>0?n:[...d].map(e=>({id:e})),f=new Map;for(let e of m)f.set(u(e),{links:0,value:0});for(let e of l){let t=h(e,o),a=h(e,s),r=le(re(e,c,"value"))??0;for(let e of[t,a]){let t=f.get(e)??{links:0,value:0};t.links+=1,t.value+=r,f.set(e,t)}}let p={id:"root",role:"chart",level:1,label:`A ${"SankeyDiagram"===e||"ProcessSankey"===e?"flow diagram":"ChordDiagram"===e?"chord diagram":"network graph"} with ${m.length} nodes and ${l.length} links.${oe(t,"network")}`,children:[]},g=0,$=new Map,b=t.colorBy??"group";for(let e of m){let t=ne(re(e,b,"group"),"Ungrouped"),a=$.get(t);a?a.push(e):$.set(t,[e])}let v=[...$].map(([e,t],n)=>{let l=[];for(let[e,i]of t.entries()){if(g>=a)break;g+=1;let t=u(i),o=f.get(t)??{links:0,value:0},s=o.value>0?`, ${r(o.value)} total flow`:"";l.push({id:`node-${n}-${e}-${ie(t)}`,role:"datum",level:3,label:`${t}: ${o.links} ${1===o.links?"link":"links"}${s}.`,value:o.value>0?o.value:void 0,datum:i})}return{id:`nodes-${n}-${ie(e)}`,role:"series",level:2,label:`${e}: ${t.length} ${1===t.length?"node":"nodes"}.`,children:l}});v.length>0&&p.children?.push(...v);let y=l.slice(0,a).map((e,t)=>{let a=h(e,o),n=h(e,s),l=le(re(e,c,"value"));return{id:`link-${ie(a)}-${ie(n)}-${t}`,role:"datum",level:3,label:`${a} to ${n}${null==l?"":": "+r(l)}.`,value:l,datum:e}});return l.length>a&&y.push({id:"links-more",role:"datum",level:3,label:`…and ${l.length-a} more links.`,value:void 0}),y.length>0&&p.children?.push({id:"links",role:"series",level:2,label:`Links: ${l.length} ${1===l.length?"connection":"connections"}.`,children:y}),p}(i,o,u,b);return se(e,w),e}if(Fe.has(i)){let e=function(e,t,a,r){let n=t.data&&"object"==typeof t.data?t.data:null,l=t.childrenAccessor??"children",i=t.valueAccessor??"value",o=t.nodeLabel??t.nodeIdAccessor,s=new WeakMap,c=new WeakSet,u=e=>{let t=s.get(e);if(t)return t;if(c.has(e))return{descendants:0,depth:0,leaves:0,numericLeaves:0,leafTotal:0};c.add(e);let a,r=U(e,l);if(0===r.length){let t=z(E(e,i,"value"));a={descendants:0,depth:1,leaves:1,numericLeaves:null==t?0:1,leafTotal:t??0}}else a=r.reduce((e,t)=>{let a=u(t);return{descendants:e.descendants+1+a.descendants,depth:Math.max(e.depth,a.depth+1),leaves:e.leaves+a.leaves,numericLeaves:e.numericLeaves+a.numericLeaves,leafTotal:e.leafTotal+a.leafTotal}},{descendants:0,depth:1,leaves:0,numericLeaves:0,leafTotal:0});return c.delete(e),s.set(e,a),a},h=0,d=(e,t,n,s)=>{let c=G(E(e,o,"name"),"item "+n);if(s.has(e))return{id:`hierarchy-${O(n)}-cycle`,role:"datum",level:t,label:`Repeated hierarchy reference to ${c}; branch omitted.`};let m=U(e,l),f=u(e);if(0===m.length){if(h>=a)return null;h+=1;let l=z(E(e,i,"value"));return{id:`hierarchy-${O(n)}-${O(c)}`,role:"datum",level:t,label:`${c}${null==l?"":": "+r(l)}.`,...null==l?{}:{value:l},datum:e}}let p=new Set(s);p.add(e);let g=[],$=0;for(let[e,r]of m.entries()){if(h>=a){$+=u(r).leaves;continue}let l=d(r,t+1,`${n}-${e}`,p);l&&g.push(l)}return $>0&&g.push({id:`hierarchy-${O(n)}-more`,role:"datum",level:t+1,label:`${H($,"more leaf","more leaves")} in ${c} not shown; navigation is capped at ${a}.`}),{id:`hierarchy-${O(n)}-${O(c)}`,role:"series",level:t,label:`${c}: ${H(m.length,"direct child","direct children")}, ${H(f.descendants,"total descendant","total descendants")}, ${H(f.leaves,"leaf","leaves")}${V(f,r)}.`,datum:e,children:g}},m=n?u(n):null,f={id:"root",role:"chart",level:1,label:n?`A ${q(e)} chart with ${H(m.leaves,"leaf","leaves")} and ${H(m.descendants,"total descendant","total descendants")} across ${H(m.depth,"hierarchy level","hierarchy levels")}${V(m,r)}.`:"A hierarchy chart with no hierarchy data loaded.",children:[]};if(n){let e=d(n,2,"root",new Set);if(e){let t=G(E(n,o,"name"),"");f.children="series"===e.role&&""===t?e.children:[e]}}return f}(i,o,u,b);return se(e,w),e}if(Pe.has(i)){let e=te(i,o,u,b);return se(e,w),e}let C=Array.isArray(o.data)?o.data:null,k=ae(i,o,s);if(!C||0===C.length||!k)return w&&(y.children=[w]),y;let{measure:A,measureFallback:x,dimension:M,dimensionFallback:S}=a(i,o),L=e(A,x),F=t(M,S),P="string"==typeof A&&A?A:x,T="string"==typeof M&&M?M:S,B=r(o),R=0,Q=e=>`${e}-${R++}`,W=(e,t)=>{let a=e.slice(0,u).map(e=>((e,t)=>{let a=L(e),r=n(F(e),b);return{id:Q("datum"),role:"datum",level:t,label:`${r}: ${Number.isFinite(a)?b(a):"—"}`,value:Number.isFinite(a)?a:void 0,datum:e}})(e,t));return e.length>u&&a.push({id:Q("more"),role:"datum",level:t,label:`…and ${e.length-u} more points`}),a},K=[];if(ue.has(i)||he.has(i)){let e=1/0,t=-1/0,a=1/0,r=-1/0,l=[],o=!0;for(let n of C){let i=L(n);Number.isFinite(i)&&(e>i&&(e=i),i>t&&(t=i));let s=F(n);l.push(s),"number"==typeof s&&Number.isFinite(s)?(a>s&&(a=s),s>r&&(r=s)):o=!1}let s=new Set,c=[];for(let e of l){let t=e+"";s.has(t)||(s.add(t),c.push(e))}let u=o?`${b(a)} to ${b(r)}`:`${n(c[0],b)} to ${n(c[c.length-1],b)} (${he.has(i)?c.length+" categories":C.length+" points"})`;K.push({id:Q("axis"),role:"axis",level:2,label:`${he.has(i)?"Category axis":"X axis"}: ${T}, ${u}.`}),t>=e&&K.push({id:Q("axis"),role:"axis",level:2,label:`Value axis: ${P}, ${b(e)} to ${b(t)}.`})}if(B){let e=t(B,B),a=new Map;for(let t of C){let r=(e(t)??"—")+"",n=a.get(r);n?n.push(t):a.set(r,[t])}let r=[];for(let[e,t]of a){let a=D(i,{...o,data:t},{levels:["l2","l3"],locale:c}).text;r.push({id:Q("series"),role:"series",level:2,label:`Series ${e}: ${a}`,children:W(t,3)})}y.children=[...K,...r]}else y.children=[...K,...W(C,2)];return w&&y.children.push(w),y}var ue=new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),he=new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),de=new Set(["PieChart","DonutChart","FunnelChart"]),me=new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]),fe=Symbol.for("semiotic.chartRecipeRegistry"),pe={LineChart:"line chart",AreaChart:"area chart",StackedAreaChart:"stacked area chart",DifferenceChart:"difference chart",Scatterplot:"scatter plot",BubbleChart:"bubble chart",ConnectedScatterplot:"connected scatter plot",QuadrantChart:"quadrant chart",MultiAxisLineChart:"dual-axis line chart",CandlestickChart:"candlestick chart",BumpChart:"bump chart",Heatmap:"heatmap",MinimapChart:"line chart",BarChart:"bar chart",StackedBarChart:"stacked bar chart",GroupedBarChart:"grouped bar chart",DotPlot:"dot plot",Histogram:"histogram",BoxPlot:"box plot",ViolinPlot:"violin plot",RidgelinePlot:"ridgeline plot",SwarmPlot:"swarm plot",PieChart:"pie chart",DonutChart:"donut chart",FunnelChart:"funnel chart",GaugeChart:"gauge",LikertChart:"Likert chart",SwimlaneChart:"swimlane chart",ForceDirectedGraph:"network graph",SankeyDiagram:"Sankey diagram",ProcessSankey:"temporal Sankey diagram",ChordDiagram:"chord diagram",TreeDiagram:"tree diagram",Treemap:"treemap",CirclePack:"circle-packing chart",OrbitDiagram:"orbit diagram",ChoroplethMap:"choropleth map",ProportionalSymbolMap:"proportional-symbol map",FlowMap:"flow map",DistanceCartogram:"distance cartogram",BigNumber:"single value",StreamPhysicsFrame:"physics stream frame",EventDropChart:"event-drop physics chart",GaltonBoardChart:"Galton board chart",UnitPileChart:"physics pile chart",CollisionSwarmChart:"collision swarm chart",PacketFlowChart:"physical flow chart",ProcessFlowChart:"process flow physics chart",CrucibleChart:"crucible physics chart",PhysicsCustomChart:"custom physics chart"},ge=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),$e=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),be=new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),ve={"outlier-detection":"alerting","change-detection":"alerting",trend:"tracking","composition-over-time":"apportioning","compare-series":"comparing","compare-categories":"comparing",rank:"ranking","part-to-whole":"apportioning",distribution:"characterizing",correlation:"relating",flow:"tracing",hierarchy:"nesting",geo:"locating"},ye={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},we=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],Ce={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"},ke=new Set(["y-threshold","x-threshold","band","x-band","callout","label"]),Ae=new Set(["system","agent","watcher"]),xe=new Set(["ai","agent","system","computed","dbt","great-expectations"]),Me=new Set(["rule","statistical-test","llm-inference","computed"]),Se={"y-threshold":"a threshold line","x-threshold":"a threshold line",band:"a highlighted band","x-band":"a highlighted band",label:"a label",callout:"a callout","callout-circle":"a callout","callout-rect":"a callout",text:"a text note",bracket:"a bracket",enclose:"an enclosure","rect-enclose":"an enclosure",highlight:"a highlight",widget:"a widget",trend:"a trend line",envelope:"an envelope","anomaly-band":"an anomaly band",forecast:"a forecast","category-highlight":"a category highlight"},Le=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),Fe=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),Pe=new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]);export{o as getChartRecipe,s as getRecipeLayoutIdentity,c as resolveChartRecipe,u as recipeIntentId,v as finiteNumber,w as createPhysicsSourceState,C as generatePhysicsPileMechanicalSamples,k as physicsPileUnitCount,F as resolveCommunicativeAct,D as describeChart,ae as supportsStructuredNavigation,ce as buildNavigationTree};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){if(!e?.colors)return;let a=e.colors;return{primary:a.primary,secondary:a.secondary||a.primary,surface:a.surface||a.background,success:a.success,danger:a.danger,warning:a.warning,error:a.error,info:a.info,text:a.text,textSecondary:a.textSecondary,border:a.border,grid:a.grid}}function a(e){if(!e.accessibility)return e;let a=e;if(e.accessibility.colorBlindSafe&&(a={...a,colors:{...a.colors,categorical:i}}),e.accessibility.highContrast){let e="dark"===a.mode;a={...a,colors:{...a.colors,text:e?"#ffffff":"#000000",textSecondary:e?"#cccccc":"#333333",grid:e?"#666666":"#999999",border:e?"#888888":"#000000"}}}return a}function o(e){return Object.prototype.hasOwnProperty.call(F,e)?F[e]:void 0}function r(e){let a={"--semiotic-bg":e.colors.background,"--semiotic-text":e.colors.text,"--semiotic-text-secondary":e.colors.textSecondary,"--semiotic-grid":e.colors.grid,"--semiotic-border":e.colors.border,"--semiotic-cell-border":e.colors.cellBorder||e.colors.border,"--semiotic-primary":e.colors.primary,"--semiotic-font-family":e.typography.fontFamily,"--semiotic-secondary":e.colors.secondary||e.colors.primary,"--semiotic-surface":e.colors.surface||e.colors.background};e.colors.categorical.forEach((e,o)=>{a["--semiotic-category-"+(o+1)]=e}),e.colors.focus&&(a["--semiotic-focus"]=e.colors.focus),e.colors.selection&&(a["--semiotic-selection-color"]=e.colors.selection),null!=e.colors.selectionOpacity&&(a["--semiotic-selection-opacity"]=e.colors.selectionOpacity+""),e.colors.diverging&&(a["--semiotic-diverging"]=e.colors.diverging),e.colors.annotation&&(a["--semiotic-annotation-color"]=e.colors.annotation),e.colors.success&&(a["--semiotic-success"]=e.colors.success),e.colors.danger&&(a["--semiotic-danger"]=e.colors.danger),e.colors.warning&&(a["--semiotic-warning"]=e.colors.warning),e.colors.error&&(a["--semiotic-error"]=e.colors.error),e.colors.info&&(a["--semiotic-info"]=e.colors.info),e.tooltip?.background&&(a["--semiotic-tooltip-bg"]=e.tooltip.background),e.tooltip?.text&&(a["--semiotic-tooltip-text"]=e.tooltip.text),e.tooltip?.borderRadius&&(a["--semiotic-tooltip-radius"]=e.tooltip.borderRadius),e.tooltip?.fontSize&&(a["--semiotic-tooltip-font-size"]=e.tooltip.fontSize),e.tooltip?.shadow&&(a["--semiotic-tooltip-shadow"]=e.tooltip.shadow),e.borderRadius&&(a["--semiotic-border-radius"]=e.borderRadius);let o=e.typography.legendSize??e.typography.labelSize;null!=o&&(a["--semiotic-legend-font-size"]=o+"px"),null!=e.typography.legendFontFamily&&(a["--semiotic-legend-font-family"]=e.typography.legendFontFamily),null!=e.typography.legendFontWeight&&(a["--semiotic-legend-font-weight"]=e.typography.legendFontWeight+"");let r=e.typography.titleFontSize??e.typography.titleSize;return null!=r&&(a["--semiotic-title-font-size"]=r+"px"),null!=e.typography.titleFontFamily&&(a["--semiotic-title-font-family"]=e.typography.titleFontFamily),null!=e.typography.titleFontWeight&&(a["--semiotic-title-font-weight"]=e.typography.titleFontWeight+""),null!=e.typography.tickFontFamily&&(a["--semiotic-tick-font-family"]=e.typography.tickFontFamily),null!=e.typography.tickSize&&(a["--semiotic-tick-font-size"]=e.typography.tickSize+"px"),null!=e.typography.labelSize&&(a["--semiotic-axis-label-font-size"]=e.typography.labelSize+"px"),a}var i=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],t={mode:"light",colors:{primary:"#00a2ce",secondary:"#6c757d",categorical:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],sequential:"blues",diverging:"RdBu",background:"transparent",surface:"#ffffff",text:"#333",textSecondary:"#666",grid:"#e0e0e0",border:"#ccc",selection:"#00a2ce",selectionOpacity:.15,success:"#2ca02c",danger:"#d62728",warning:"#f0ad4e",error:"#b4181b",info:"#00a2ce"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},c={mode:"dark",colors:{primary:"#4fc3f7",secondary:"#90a4ae",categorical:["#4fc3f7","#ffb74d","#81c784","#ef5350","#ba68c8","#a1887f","#f06292","#90a4ae","#dce775","#4dd0e1"],sequential:"blues",diverging:"RdBu",background:"#1a1a2e",surface:"#252540",text:"#e0e0e0",textSecondary:"#aaa",grid:"#333",border:"#555",selection:"#4fc3f7",selectionOpacity:.15,success:"#81c784",danger:"#ef5350",warning:"#ffb74d",error:"#d84848",info:"#4fc3f7"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},s={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:i,sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#000000",textSecondary:"#333333",grid:"#999999",border:"#000000",focus:"#0000cc",selection:"#0000cc",selectionOpacity:.1,success:"#006400",danger:"#cc0000",warning:"#b15a00",error:"#8b0000",info:"#0000cc"},typography:{fontFamily:"system-ui, sans-serif",titleSize:18,labelSize:14,tickSize:12},tooltip:{background:"#000000",text:"#ffffff",borderRadius:"4px",fontSize:"14px",shadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},borderRadius:"4px"},f={mode:"light",colors:{primary:"#c9a0dc",secondary:"#b8a8c8",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#fdf6f0",surface:"#fff5ee",text:"#4a3728",textSecondary:"#7a644a",grid:"#e8d5c4",border:"#e8d5c4",focus:"#8a5fae",annotation:"#8a5fae",success:"#9ad4a3",danger:"#e8869a",warning:"#f0c888",error:"#c86070",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#fff5ee",text:"#4a3728",borderRadius:"8px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"10px"},d={mode:"dark",colors:{primary:"#c9a0dc",secondary:"#a899c0",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#1a1525",surface:"#251e35",text:"#e8ddf0",textSecondary:"#a899c0",grid:"#3d3455",border:"#3d3455",focus:"#c9a0dc",annotation:"#c9a0dc",success:"#88d4ab",danger:"#f0a0c0",warning:"#f0c888",error:"#e87690",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#251e35",text:"#e8ddf0",borderRadius:"8px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"10px"},n={mode:"light",colors:{primary:"#2563eb",secondary:"#6b7280",categorical:["#2563eb","#0d9488","#ea580c","#6b7280"],sequential:"blues",background:"#f5f6f8",surface:"#ffffff",text:"#2c3e50",textSecondary:"#64717f",grid:"#d8dce3",border:"#d8dce3",focus:"#2563eb",annotation:"#2563eb",success:"#10b981",danger:"#ef4444",warning:"#f59e0b",error:"#dc2626",info:"#2563eb"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2c3e50",borderRadius:"6px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"8px"},l={mode:"dark",colors:{primary:"#3b82f6",secondary:"#9ca3af",categorical:["#3b82f6","#14b8a6","#f97316","#9ca3af"],sequential:"blues",background:"#111827",surface:"#1f2937",text:"#f3f4f6",textSecondary:"#9ca3af",grid:"#374151",border:"#374151",focus:"#3b82f6",annotation:"#3b82f6",success:"#34d399",danger:"#f87171",warning:"#fbbf24",error:"#ef4444",info:"#60a5fa"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f2937",text:"#f3f4f6",borderRadius:"6px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"8px"},b={mode:"light",colors:{primary:"#cc0000",secondary:"#666666",categorical:["#cc0000","#333333","#c8a415","#4682b4"],sequential:"reds",background:"#fafafa",surface:"#ffffff",text:"#1a1a1a",textSecondary:"#666666",grid:"#e0e0e0",border:"#e0e0e0",focus:"#cc0000",annotation:"#cc0000",success:"#556b2f",danger:"#cc0000",warning:"#c8a415",error:"#8b0000",info:"#4682b4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#1a1a1a",borderRadius:"2px",shadow:"0 2px 4px rgba(0, 0, 0, 0.15)"},borderRadius:"2px"},g={mode:"dark",colors:{primary:"#ff3333",secondary:"#aaaaaa",categorical:["#ff3333","#aaaaaa","#d4a843","#6aa4d4"],sequential:"reds",background:"#0a0a0a",surface:"#1a1a1a",text:"#f5f5f5",textSecondary:"#aaaaaa",grid:"#333333",border:"#333333",focus:"#ff3333",annotation:"#ff3333",success:"#7a8b5a",danger:"#ff3333",warning:"#d4a843",error:"#cc0000",info:"#6aa4d4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1a1a1a",text:"#f5f5f5",borderRadius:"2px",shadow:"0 2px 8px rgba(0, 0, 0, 0.5)"},borderRadius:"2px"},p={mode:"light",colors:{primary:"#8b0000",secondary:"#555555",categorical:["#8b4513","#556b2f","#4a5568","#800020"],sequential:"oranges",background:"#fffff8",surface:"#fffff8",text:"#111111",textSecondary:"#555555",grid:"#e0ddd0",border:"#e0ddd0",focus:"#8b0000",annotation:"#8b0000",success:"#556b2f",danger:"#8b0000",warning:"#b88700",error:"#6b0000",info:"#4a5568"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#fffff8",text:"#111111",borderRadius:"2px",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},borderRadius:"0px"},u={mode:"dark",colors:{primary:"#c05050",secondary:"#a09880",categorical:["#c08050","#7a8b5a","#8090a0","#a05060"],sequential:"oranges",background:"#1c1b18",surface:"#262520",text:"#e8e4d8",textSecondary:"#a09880",grid:"#3d3c35",border:"#3d3c35",focus:"#c05050",annotation:"#d06a6a",success:"#7a8b5a",danger:"#c05050",warning:"#c8a060",error:"#a04040",info:"#8090a0"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262520",text:"#e8e4d8",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.4)"},borderRadius:"0px"},y={mode:"light",colors:{primary:"#e45050",secondary:"#666666",categorical:["#3a86c8","#e45050","#d4a843","#888888"],sequential:"blues",background:"#ffffff",surface:"#f8f8f8",text:"#222222",textSecondary:"#666666",grid:"#d4d4d4",border:"#d4d4d4",focus:"#e45050",annotation:"#c63b3b",success:"#2d7a3d",danger:"#c8303a",warning:"#d4a843",error:"#a02028",info:"#3a86c8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:18,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#f8f8f8",text:"#222222",borderRadius:"4px",shadow:"0 2px 6px rgba(0, 0, 0, 0.12)"},borderRadius:"4px"},x={mode:"dark",colors:{primary:"#ff6b6b",secondary:"#a0a0a0",categorical:["#5a9fd8","#ff6b6b","#e0c060","#aaaaaa"],sequential:"blues",background:"#141414",surface:"#1e1e1e",text:"#ededed",textSecondary:"#a0a0a0",grid:"#383838",border:"#383838",focus:"#ff6b6b",annotation:"#ff6b6b",success:"#6fba78",danger:"#ff6b6b",warning:"#e0c060",error:"#d04040",info:"#5a9fd8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1e1e1e",text:"#ededed",borderRadius:"4px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"4px"},m={mode:"light",colors:{primary:"#8b5cf6",secondary:"#7c5a9e",categorical:["#8b5cf6","#ec4899","#06b6d4","#84cc16"],sequential:"viridis",background:"#fdf8ff",surface:"#ffffff",text:"#2d1b4e",textSecondary:"#7c5a9e",grid:"#e8d0f8",border:"#e8d0f8",focus:"#8b5cf6",annotation:"#7a47e8",success:"#10d870",danger:"#ff4b6e",warning:"#ffaa33",error:"#e11d48",info:"#06b6d4"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2d1b4e",borderRadius:"12px",shadow:"0 4px 12px rgba(139, 92, 246, 0.15)"},borderRadius:"12px"},S={mode:"dark",colors:{primary:"#a78bfa",secondary:"#b8a0d8",categorical:["#a78bfa","#f472b6","#22d3ee","#a3e635"],sequential:"viridis",background:"#150a28",surface:"#1f1138",text:"#f0e8ff",textSecondary:"#b8a0d8",grid:"#3a2560",border:"#3a2560",focus:"#a78bfa",annotation:"#a78bfa",success:"#4ade80",danger:"#fb7185",warning:"#fbbf24",error:"#f43f5e",info:"#22d3ee"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f1138",text:"#f0e8ff",borderRadius:"12px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"12px"},k=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"],h={danger:"#da1e28",warning:"#f1c21b",success:"#24a148",info:"#0043ce"},z={mode:"light",colors:{primary:"#0f62fe",secondary:"#525252",categorical:["#6929c4","#1192e8","#005d5d","#9f1853"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#161616",textSecondary:"#525252",grid:"#e0e0e0",border:"#e0e0e0",focus:"#0f62fe",annotation:"#0f62fe",success:"#24a148",danger:"#da1e28",warning:"#f1c21b",error:"#a2191f",info:"#0043ce"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#161616",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.2)"},borderRadius:"0px"},w={mode:"dark",colors:{primary:"#4589ff",secondary:"#a8a8a8",categorical:["#a56eff","#33b1ff","#08bdba","#ff7eb6"],sequential:"blues",diverging:"RdBu",background:"#161616",surface:"#262626",text:"#f4f4f4",textSecondary:"#a8a8a8",grid:"#393939",border:"#393939",focus:"#4589ff",annotation:"#4589ff",success:"#42be65",danger:"#fa4d56",warning:"#f1c21b",error:"#da1e28",info:"#4589ff"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262626",text:"#f4f4f4",borderRadius:"2px",shadow:"0 4px 12px rgba(0, 0, 0, 0.5)"},borderRadius:"0px"},F={light:t,dark:c,"high-contrast":s,pastels:f,"pastels-dark":d,"bi-tool":n,"bi-tool-dark":l,italian:b,"italian-dark":g,tufte:p,"tufte-dark":u,journalist:y,"journalist-dark":x,playful:m,"playful-dark":S,carbon:z,"carbon-dark":w};export{i as COLOR_BLIND_SAFE_CATEGORICAL,t as LIGHT_THEME,c as DARK_THEME,s as HIGH_CONTRAST_THEME,e as resolveThemeSemanticColors,a as applyThemeAccessibility,f as PASTELS_LIGHT,d as PASTELS_DARK,n as BI_TOOL_LIGHT,l as BI_TOOL_DARK,b as ITALIAN_LIGHT,g as ITALIAN_DARK,p as TUFTE_LIGHT,u as TUFTE_DARK,y as JOURNALIST_LIGHT,x as JOURNALIST_DARK,m as PLAYFUL_LIGHT,S as PLAYFUL_DARK,k as CARBON_CATEGORICAL_14,h as CARBON_ALERT,z as CARBON_LIGHT,w as CARBON_DARK,F as THEME_PRESETS,o as resolveThemePreset,r as themeToCSSVariables};
|