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
package/dist/c-CFFIU2MW.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{contrastRatio as e}from"./c-7W4SV36A.min.js";import{DARK_THEME as t,LIGHT_THEME as o,ruleMatches as a,themeToCSSVariables as r}from"./c-CJYSXIFV.min.js";function i(e,t=":root"){return`${t} {\n${Object.entries(r(e)).map(([e,t])=>` ${e}: ${t};`).join("\n")}\n}`}function n(e){return{semiotic:{bg:{$value:e.colors.background,$type:"color"},text:{$value:e.colors.text,$type:"color"},"text-secondary":{$value:e.colors.textSecondary,$type:"color"},grid:{$value:e.colors.grid,$type:"color"},border:{$value:e.colors.border,$type:"color"},primary:{$value:e.colors.primary,$type:"color"},focus:{$value:e.colors.focus||e.colors.primary,$type:"color"},"font-family":{$value:e.typography.fontFamily,$type:"fontFamily"},"border-radius":{$value:e.borderRadius||"8px",$type:"dimension"},tooltip:{bg:{$value:e.tooltip?.background||e.colors.background,$type:"color"},text:{$value:e.tooltip?.text||e.colors.text,$type:"color"},radius:{$value:e.tooltip?.borderRadius||"6px",$type:"dimension"},"font-size":{$value:e.tooltip?.fontSize||"14px",$type:"dimension"},shadow:{$value:e.tooltip?.shadow||"0 2px 8px rgba(0,0,0,0.15)",$type:"shadow"}},selection:{color:{$value:e.colors.selection||e.colors.primary,$type:"color"},opacity:{$value:e.colors.selectionOpacity??.2,$type:"number"}},categorical:{$value:e.colors.categorical,$type:"color",$description:"Categorical color palette"},sequential:{$value:e.colors.sequential,$type:"string",$description:"d3-scale-chromatic sequential scheme name"},...e.aesthetics?{aesthetics:{...e.aesthetics.name?{profile:{$value:e.aesthetics.name,$type:"string"}}:{},...null!=e.aesthetics.minimumScore?{"minimum-score":{$value:e.aesthetics.minimumScore,$type:"number"}}:{},weights:Object.fromEntries(Object.entries(e.aesthetics.weights??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),thresholds:Object.fromEntries(Object.entries(e.aesthetics.thresholds??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),rationales:Object.fromEntries(Object.entries(e.aesthetics.rationales??{}).map(([e,t])=>[e,{$value:t,$type:"string"}]))}}:{},...e.colors.diverging?{diverging:{$value:e.colors.diverging,$type:"string",$description:"d3-scale-chromatic diverging scheme name"}}:{},...e.colors.annotation?{"annotation-color":{$value:e.colors.annotation,$type:"color"}}:{},...null!=e.typography.legendSize?{"legend-font-size":{$value:e.typography.legendSize+"px",$type:"dimension"}}:{},...null!=e.typography.legendFontFamily?{"legend-font-family":{$value:e.typography.legendFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.legendFontWeight?{"legend-font-weight":{$value:e.typography.legendFontWeight,$type:"fontWeight"}}:{},"title-font-size":{$value:(e.typography.titleFontSize??e.typography.titleSize)+"px",$type:"dimension"},...null!=e.typography.titleFontFamily?{"title-font-family":{$value:e.typography.titleFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.titleFontWeight?{"title-font-weight":{$value:e.typography.titleFontWeight,$type:"fontWeight"}}:{},...null!=e.typography.tickFontFamily?{"tick-font-family":{$value:e.typography.tickFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.tickSize?{"tick-font-size":{$value:e.typography.tickSize+"px",$type:"dimension"}}:{},...null!=e.typography.labelSize?{"axis-label-font-size":{$value:e.typography.labelSize+"px",$type:"dimension"}}:{},secondary:{$value:e.colors.secondary||e.colors.primary,$type:"color"},surface:{$value:e.colors.surface||e.colors.background,$type:"color"},...e.colors.success?{success:{$value:e.colors.success,$type:"color"}}:{},...e.colors.danger?{danger:{$value:e.colors.danger,$type:"color"}}:{},...e.colors.warning?{warning:{$value:e.colors.warning,$type:"color"}}:{},...e.colors.error?{error:{$value:e.colors.error,$type:"color"}}:{},...e.colors.info?{info:{$value:e.colors.info,$type:"color"}}:{}}}}var s=/^\{([^}]+)\}$/,l={bg:"background",text:"text","text-secondary":"textSecondary",grid:"grid",border:"border",primary:"primary",focus:"focus",secondary:"secondary",surface:"surface",annotation:"annotation",success:"success",danger:"danger",warning:"warning",error:"error",info:"info"},c=[["textSecondary",/^(text-?secondary|secondary-?text|muted|subtle|text-?muted|fg-?muted)$/],["text",/^(text|foreground|fg|ink|on-?background|on-?surface|text-?default|fg-?default)$/],["background",/^(background|bg|canvas|base|page|backdrop|bg-?default)$/],["surface",/^(surface|card|elevated|panel|sheet)$/],["border",/^(border|divider|outline|stroke|hairline)$/],["grid",/^(grid|gridline|gridlines)$/],["primary",/^(primary|brand|accent|brand-?primary)$/],["secondary",/^(secondary|brand-?secondary)$/],["focus",/^(focus|ring|focus-?ring)$/],["error",/^(error|critical)$/],["danger",/^(danger|negative|destructive|fail|alert)$/],["success",/^(success|positive|ok|good|pass)$/],["warning",/^(warning|warn|caution)$/],["info",/^(info|information|note)$/],["annotation",/^(annotation|callout)$/]],u=/^rgba?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)(?:\s*,\s*[\d.]+)?\s*\)$/i;function f(e){return"string"==typeof e.value&&("color"===e.type||function(e){const t=e.trim();return/^#[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(t)||u.test(t)||/^hsla?\(/i.test(t)}(e.value))}function m(e){return Array.isArray(e)&&e.every(e=>"string"==typeof e)?e.join(", "):"string"==typeof e?e:void 0}function h(e){if("number"==typeof e&&Number.isFinite(e))return e;if("string"!=typeof e)return;const t=e.trim().match(/^(-?(?:\d+|\d*\.\d+))px$/);return t?Number(t[1]):void 0}function p(e){return"string"==typeof e||"number"==typeof e&&Number.isFinite(e)?e:void 0}function y(e,a={}){const r=function(e){const t=new Map(e.map(e=>[e.path,e])),o=(e,a)=>{if(a>8||"string"!=typeof e)return e;const r=e.match(s);if(!r)return e;const i=t.get(r[1]);return i?o(i.value,a+1):e};return e.map(e=>({...e,value:o(e.value,0)}))}(function(e){const t=[],o=(e,a,r)=>{if(!e||"object"!=typeof e)return;const i=e,n=i.$type??r;if(function(e){return!!e&&"object"==typeof e&&"$value"in e}(i))t.push({path:a.join("."),leaf:a[a.length-1]??"",value:i.$value,type:i.$type??r});else for(const[e,t]of Object.entries(i))e.startsWith("$")||o(t,[...a,e],n)};return o(e,[]),t}(e)),i=new Map(r.map(e=>[e.path,e])),n=new Set,y={};for(const[e,t]of Object.entries(a.mapping??{})){if("fontFamily"===e||"categorical"===e)continue;const o=t?i.get(t):void 0;o&&"string"==typeof o.value&&(y[e]=o.value,n.add(o.path))}for(const e of r){const t=e.path.match(/^semiotic\.([^.]+)$/),o=t?l[t[1]]:void 0;o&&!(o in y)&&"string"==typeof e.value&&(y[o]=e.value,n.add(e.path))}for(const[e,t]of c){if(e in y)continue;const o=r.find(e=>!n.has(e.path)&&f(e)&&t.test(e.leaf.toLowerCase()));o&&"string"==typeof o.value&&(y[e]=o.value,n.add(o.path))}let d;const g=a.mapping?.categorical,b=(g?i.get(g):void 0)??i.get("semiotic.categorical")??r.find(e=>Array.isArray(e.value)&&/categor|chart|palette|qualitative|series/i.test(e.path));if(b&&Array.isArray(b.value))d=b.value.filter(e=>"string"==typeof e);else{const e=r.filter(e=>f(e)&&/(^|\.)(categorical|chart|palette|qualitative|series)\b/i.test(e.path));2>e.length||(d=e.map(e=>e.value))}const v=(a.mapping?.fontFamily?i.get(a.mapping.fontFamily):void 0)??i.get("semiotic.font-family")??r.find(e=>("fontFamily"===e.type||/font-?family|typeface/i.test(e.leaf))&&("string"==typeof e.value||Array.isArray(e.value))),$=v?m(v.value):void 0,x=h(i.get("semiotic.legend-font-size")?.value),S=m(i.get("semiotic.legend-font-family")?.value),k=p(i.get("semiotic.legend-font-weight")?.value),M=h(i.get("semiotic.title-font-size")?.value),C=m(i.get("semiotic.title-font-family")?.value),A=p(i.get("semiotic.title-font-weight")?.value),w=m(i.get("semiotic.tick-font-family")?.value),F=h(i.get("semiotic.tick-font-size")?.value),R=h(i.get("semiotic.axis-label-font-size")?.value),j={},z={},N={};for(const e of r){const t=e.path.match(/^semiotic\.aesthetics\.weights\.(.+)$/);t&&"number"==typeof e.value&&Number.isFinite(e.value)&&(j[t[1]]=e.value);const o=e.path.match(/^semiotic\.aesthetics\.thresholds\.(.+)$/);o&&"number"==typeof e.value&&Number.isFinite(e.value)&&(z[o[1]]=e.value);const a=e.path.match(/^semiotic\.aesthetics\.rationales\.(.+)$/);a&&"string"==typeof e.value&&(N[a[1]]=e.value)}const O=i.get("semiotic.aesthetics.profile")?.value,I=i.get("semiotic.aesthetics.minimum-score")?.value,P="string"==typeof O||"number"==typeof I||Object.keys(j).length>0||Object.keys(z).length>0||Object.keys(N).length>0?{..."string"==typeof O?{name:O}:{},..."number"==typeof I?{minimumScore:I}:{},...Object.keys(j).length>0?{weights:j}:{},...Object.keys(z).length>0?{thresholds:z}:{},...Object.keys(N).length>0?{rationales:N}:{}}:void 0,W=function(e){if("string"!=typeof e)return null;const t=e.trim();let o=t.replace(/^#/,"");if(3===o.length&&(o=o.split("").map(e=>e+e).join("")),/^[0-9a-f]{6}$/i.test(o))return parseInt(o.slice(0,2),16)/255*.2126+parseInt(o.slice(2,4),16)/255*.7152+parseInt(o.slice(4,6),16)/255*.0722;const a=t.match(u);if(a){const e=Number(a[1])/255,t=Number(a[2])/255,o=Number(a[3])/255;return[e,t,o].some(e=>Number.isNaN(e)||0>e||e>1)?null:.2126*e+.7152*t+.0722*o}return null}(y.background),D=a.base?.mode??(null!=W?.5>W?"dark":"light":o.mode),L=a.base??("dark"===D?t:o);return{...L,mode:D,colors:{...L.colors,...y,...d&&d.length>0?{categorical:d}:{}},typography:{...L.typography,...$?{fontFamily:$}:{},...null!=x?{legendSize:x}:{},...null!=S?{legendFontFamily:S}:{},...null!=k?{legendFontWeight:k}:{},...null!=M?{titleFontSize:M}:{},...null!=C?{titleFontFamily:C}:{},...null!=A?{titleFontWeight:A}:{},...null!=w?{tickFontFamily:w}:{},...null!=F?{tickSize:F}:{},...null!=R?{labelSize:R}:{}},...P?{aesthetics:P}:{}}}function d(e){return Math.min(255,Math.max(0,Math.round(e)))}function g(e){if("string"!=typeof e)return null;const t=e.trim().toLowerCase(),o=t.match(/^#([a-f\d]{3,4}|[a-f\d]{6}|[a-f\d]{8})$/i)?.[1];if(o){const e=o.length>4?o:o.split("").map(e=>`${e}${e}`).join("");return{r:Number.parseInt(e.slice(0,2),16),g:Number.parseInt(e.slice(2,4),16),b:Number.parseInt(e.slice(4,6),16),a:8===e.length?Number.parseInt(e.slice(6,8),16)/255:1}}const a=t.match(/^rgba?\(\s*(-?(?:\d+|\d*\.\d+))\s*,\s*(-?(?:\d+|\d*\.\d+))\s*,\s*(-?(?:\d+|\d*\.\d+))(?:\s*,\s*(-?(?:\d+|\d*\.\d+)))?\s*\)$/);if(!a)return null;const r=[Number(a[1]),Number(a[2]),Number(a[3])],i=void 0===a[4]?1:Number(a[4]);return r.some(e=>!Number.isFinite(e)||0>e||e>255)||!Number.isFinite(i)||0>i||i>1?null:{r:r[0],g:r[1],b:r[2],a:i}}function b(e,t){return 1>t.a?null:{r:d(e.r*e.a+t.r*(1-e.a)),g:d(e.g*e.a+t.g*(1-e.a)),b:d(e.b*e.a+t.b*(1-e.a)),a:1}}function v(e){return 1>e.a?null:"#"+[e.r,e.g,e.b].map(e=>d(e).toString(16).padStart(2,"0")).join("")}function $(e,t,o){const a=g(e),r=g(t);if(!a||!r)return null;const i=b({...a,a:a.a*Math.min(1,Math.max(0,o))},r);return i?v(i):null}function x(t){const o=g(t.backgroundColor),a=o?v(o):null,r=$(t.scaffoldColor,t.backgroundColor,t.scaffoldOpacity??1),i=r&&a?e(r,a):null,n=t.dataColors.map(e=>$(e,t.backgroundColor,1)).map(t=>t&&a?e(t,a):null).filter(e=>null!==e);if(null===i||n.length!==t.dataColors.length||0===n.length)return{ok:!0,status:"manual",method:"mark-to-scaffold-contrast",finding:{code:"VISUAL_HIERARCHY_MANUAL",status:"manual",message:"Visual hierarchy could not be computed from the supplied colors.",fix:"Resolve CSS variables, gradients, or named colors to solid colors and run the audit again."}};const s=Math.min(...n),l=s/i,c={weakestDataContrast:s,scaffoldContrast:i,hierarchyRatio:l},u=Math.max(1,t.minimumScaffoldContrast??1.1);return u>i?{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:c,finding:{code:"SCAFFOLD_VISIBILITY",status:"warn",message:"Reference scaffolding may be too faint to remain useful.",fix:"Increase grid or guide contrast while keeping it below the primary data marks."}}:3>s||i>Math.max(u,t.maximumScaffoldContrast??2)||Math.max(1,t.minimumHierarchyRatio??2)>l?{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:c,finding:{code:"SCAFFOLD_DOMINANCE",status:"warn",message:"Reference scaffolding competes with the primary data marks.",fix:"Increase mark contrast or lighten grid and guide colors until marks have at least twice the scaffold contrast."}}:{ok:!0,status:"pass",method:"mark-to-scaffold-contrast",evidence:c,finding:{code:"SCAFFOLD_DOMINANCE",status:"pass",message:"Primary data marks lead while reference scaffolding remains visible and subordinate."}}}var S=Object.freeze({"mark-scaffold-hierarchy":3,"palette-authorship":1,"palette-economy":1,"typographic-hierarchy":1,"theme-coherence":2,"editorial-emphasis":1}),k=Object.freeze({hierarchyRatio:2,scaffoldContrastMin:1.1,scaffoldContrastMax:2,titleScaleRatio:1.25,categoricalColorMax:7,emphasisRatioMin:.05,emphasisRatioMax:.35}),M=Object.freeze({name:"Semiotic balanced",weights:S,thresholds:k,minimumScore:70}),C=Object.freeze({name:"Aesthetics off",weights:Object.freeze(Object.fromEntries(Object.keys(S).map(e=>[e,0]))),minimumScore:0}),A=[["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"]],w=new Set(["category10","tableau10"]),F=new Set(["DonutChart","PieChart","SwimlaneChart"]),R={"mark-scaffold-hierarchy":"Mark–scaffold hierarchy","palette-authorship":"Palette authorship","palette-economy":"Palette economy","typographic-hierarchy":"Typographic hierarchy","theme-coherence":"Theme coherence","editorial-emphasis":"Editorial emphasis"};function j(e){return Math.min(1,Math.max(0,e))}function z(e,t){return Number.isFinite(e)?e:t}function N(e){return function(e){if("string"!=typeof e||""===e.trim())return;const t=g(e);return t?v(t)??`rgba(${d(t.r)},${d(t.g)},${d(t.b)},${t.a})`:e.trim().toLowerCase()}(e)}function O(e){return(Array.isArray(e)?e:e&&"object"==typeof e?Object.values(e):[e]).map(N).filter(e=>!!e)}function I(e){return Array.isArray(e)||e&&"object"==typeof e?O(e):[]}function P(e){return e.length>=4&&A.some(t=>e.length===t.length&&e.every((e,o)=>e===t[o]))}function W(e,t){const o=Array.isArray(e.data)?e.data:[];return"string"==typeof t?Array.from(new Set(o.map(e=>e[t]+""))):"function"==typeof t?Array.from(new Set(o.map((e,o)=>t(e,o)+""))):[]}function D(e,t){if(!e.evidence)return.5;const{weakestDataContrast:o,scaffoldContrast:a,hierarchyRatio:r}=e.evidence;return Math.min(j(o/3),j(a/t.scaffoldContrastMin),j(t.scaffoldContrastMax/a),j(r/t.hierarchyRatio))}function L(e,t,o,a,r,i,n){const s=o[e];return{id:e,label:R[e],status:0===s?"disabled":n??(.8>t?"warn":"pass"),score:t,weight:s,contribution:t*s,message:a,...i?.[e]?{rationale:i[e]}:{},evidence:r}}function q(e,t,r={}){const i=r.theme??o,n=r.profile??i.aesthetics??M,s={...S,...n.weights??{}};for(const e of Object.keys(s)){const t=s[e];s[e]=Number.isFinite(t)?Math.max(0,t):0}const l=function(e){const t=e.thresholds??{},o=Math.max(1,z(t.scaffoldContrastMin,k.scaffoldContrastMin)),a=j(z(t.emphasisRatioMin,k.emphasisRatioMin));return{hierarchyRatio:Math.max(1,z(t.hierarchyRatio,k.hierarchyRatio)),scaffoldContrastMin:o,scaffoldContrastMax:Math.max(o,z(t.scaffoldContrastMax,k.scaffoldContrastMax)),titleScaleRatio:Math.max(1.01,z(t.titleScaleRatio,k.titleScaleRatio)),categoricalColorMax:Math.max(1,Math.round(z(t.categoricalColorMax,k.categoricalColorMax))),emphasisRatioMin:a,emphasisRatioMax:Math.max(a,j(z(t.emphasisRatioMax,k.emphasisRatioMax)))}}(n),c=function(e,t,o){const r=I(t.colorScheme),i=O(t.color),n=W(t,t.colorBy),s=F.has(e)?W(t,t.categoryAccessor??"category"):[],l=t.colorScheme&&"object"==typeof t.colorScheme&&!Array.isArray(t.colorScheme)?t.colorScheme:void 0,c=(e,t)=>e.map((e,a)=>N(l?.[e])??("gray"===t?"#999999":o.colors.categorical.length>0?o.colors.categorical[a%o.colors.categorical.length]:"#007bff")),u=n.length>0?l?c(n,"gray"):r.length>0?r:o.colors.categorical:i.length>0?i:s.length>0&&l?c(s,"theme"):r.length>0&&!l?r:o.colors.categorical,f=u.slice(0,n.length>0||s.length>0?Math.min(u.length,Math.max(1,n.length||s.length||1)):1),m=function(e){const t=Array.isArray(e.data)?e.data:[],o=Array.isArray(e.styleRules)?e.styleRules:[],r="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",i="string"==typeof e.categoryAccessor?e.categoryAccessor:"category",n=[];for(const e of o)e.style&&"function"!=typeof e.style&&t.some((t,o)=>a(e,t,{value:Number(t[r]),category:(t[i]??"")+"",index:o}))&&n.push(...O(e.style.fill));return Array.from(new Set(n))}(t).filter(e=>!f.includes(e));return Array.from(new Set([...f,...m]))}(e,t,i),u=function(e){const t=e.colors.surface??e.colors.background,o=g(t),a=g(e.colors.background);if(!o)return t;if(1===o.a)return v(o)??t;if(!a)return t;const r=b(o,a);return r?v(r)??t:t}(i),f=x({backgroundColor:u,dataColors:c,scaffoldColor:i.colors.grid,minimumHierarchyRatio:l.hierarchyRatio,minimumScaffoldContrast:l.scaffoldContrastMin,maximumScaffoldContrast:l.scaffoldContrastMax}),m=function(e){const t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,o=[...I(e.colorScheme),...O(e.color),...O(e.fill),...O(e.stroke),...O(t?.fill),...O(t?.stroke)],a=Array.isArray(e.styleRules)?e.styleRules:[];for(const e of a)e.style&&"function"!=typeof e.style&&o.push(...O(e.style.fill),...O(e.style.stroke));return Array.from(new Set(o))}(t),h=P(i.colors.categorical.map(N).filter(e=>!!e)),p=function(e){const t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,o=[...I(e.colorScheme),...O(e.color),...O(e.fill),...O(t?.fill)],a=Array.isArray(e.styleRules)?e.styleRules:[];for(const e of a)e.style&&"function"!=typeof e.style&&o.push(...O(e.style.fill));return Array.from(new Set(o))}(t),y="string"==typeof t.colorScheme?t.colorScheme.trim().toLowerCase():void 0,d=p.length>0||y?"chart":"theme",$="chart"===d?P(p)||!!y&&w.has(y):h,C=$?.2:"chart"===d?1:.8,A=function(e){return Math.max(1,e.length)}(c),R=A>l.categoricalColorMax?j(1-(A-l.categoricalColorMax)/l.categoricalColorMax):1,q=i.typography.titleFontSize??i.typography.titleSize,E=Math.max(i.typography.tickSize,i.typography.labelSize),T=E>0?q/E:1,V=j((T-1)/(l.titleScaleRatio-1)),_=new Set([...i.colors.categorical,i.colors.primary,i.colors.secondary,i.colors.background,i.colors.surface,i.colors.text,i.colors.textSecondary,i.colors.grid,i.colors.border,i.colors.annotation].map(N).filter(e=>!!e)),H=m.filter(e=>!_.has(e)).length,U=0===m.length?1:j(1-H/m.length),Y=function(e){const t=Array.isArray(e.data)?e.data:[],o=Array.isArray(e.styleRules)?e.styleRules:[];if(0===t.length||0===o.length)return{ratio:0,authored:!1};const r="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",i="string"==typeof e.categoryAccessor?e.categoryAccessor:"category";return{ratio:t.filter((e,t)=>o.some(o=>a(o,e,{value:Number(e[r]),category:(e[i]??"")+"",index:t}))).length/t.length,authored:!0}}(t),B=Y.authored?l.emphasisRatioMin>Y.ratio?j(Y.ratio/l.emphasisRatioMin):Y.ratio>l.emphasisRatioMax?j(l.emphasisRatioMax/Y.ratio):1:.35,J=[L("mark-scaffold-hierarchy",D(f,l),s,f.finding.message,{hierarchyRatio:f.evidence?.hierarchyRatio??0,markContrast:f.evidence?.weakestDataContrast??0,scaffoldContrast:f.evidence?.scaffoldContrast??0},n.rationales,f.status),L("palette-authorship",C,s,$?"theme"===d?"The chart inherits a ubiquitous categorical default without an organizational palette decision.":"The chart explicitly selects a ubiquitous categorical palette.":"The effective palette records an authored choice beyond the ubiquitous defaults.",{paletteSource:d,ubiquitousDefault:$,colorCount:c.length},n.rationales),L("palette-economy",R,s,`${A} color role(s) are used against a policy ceiling of ${l.categoricalColorMax}.`,{colorRoles:A,maximum:l.categoricalColorMax},n.rationales),L("typographic-hierarchy",V,s,`Title-to-supporting-type scale is ${T.toFixed(2)}×.`,{titleSize:q,supportingSize:E,ratio:T},n.rationales),L("theme-coherence",U,s,`${H} of ${m.length} explicit chart color(s) fall outside the theme vocabulary.`,{explicitColors:m.length,outsideTheme:H},n.rationales),L("editorial-emphasis",B,s,Y.authored?Math.round(100*Y.ratio)+"% of marks receive authored emphasis.":"No machine-visible editorial emphasis rule is declared.",{authored:Y.authored,emphasizedRatio:Y.ratio},n.rationales)],X=J.reduce((e,t)=>e+t.weight,0),G=J.reduce((e,t)=>e+t.contribution,0),K=0===X?null:G/X*100,Q=100*j(z(n.minimumScore,M.minimumScore??70)/100);return{component:e,profile:n.name??"Unnamed aesthetic profile",ok:null===K||K>=Q,score:K,minimumScore:Q,weightedPoints:G,totalWeight:X,features:J,method:"weighted-machine-visible-features"}}export{i as themeToCSS,n as themeToTokens,y as designTokensToTheme,x as auditVisualHierarchy,S as DEFAULT_AESTHETIC_WEIGHTS,k as DEFAULT_AESTHETIC_THRESHOLDS,M as DEFAULT_AESTHETIC_PROFILE,C as AESTHETICS_OFF_PROFILE,q as evaluateAesthetics};
|
package/dist/c-CGNHBHCE.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{buildNavigationTree as e,describeChart as t,getChartRecipe as n,isJsonSafe as o,recipeIntentId as r,resolveChartRecipe as i,resolveCommunicativeAct as s}from"./c-TMCTEVVW.min.js";var a=["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","GaugeChart","FunnelChart","RadarChart","SwimlaneChart","LikertChart","LineChart","BumpChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","BubbleChart","Heatmap","QuadrantChart","MultiAxisLineChart","WaterfallChart","CandlestickChart","ConnectedScatterplot","ScatterplotMatrix","MinimapChart","ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram","TreeDiagram","Treemap","CirclePack","OrbitDiagram","ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram","RealtimeLineChart","RealtimeHistogram","TemporalHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","GauntletChart","CrucibleChart","ProcessFlowChart","PacketFlowChart","ChainReactionChart","BigNumber"],l=new Set(a),c=new Set(["tooltip","onObservation","xFormat","yFormat","valueFormat","svgAnnotationRules","tooltipContent","onHover","tickFormatTime","tickFormatValue","edgeSort","sortGroups","centerContent","frameProps","controls","oFormat","rFormat","oSort","pieceStyle","summaryStyle","nodeStyle","edgeStyle","customHoverBehavior","customClickBehavior","customDoubleClickBehavior","onBrush","onTopologyChange","backgroundGraphics","foregroundGraphics","legend","recipe","layout"]),u=new Set(["data","nodes","edges","points","areas","lines","flows"]);function d(e){if(null==e)return e;if("function"==typeof e)return;if("object"!=typeof e)return e;if(e.$$typeof)return;if(Array.isArray(e))return e.map(d).filter(e=>void 0!==e);if(e instanceof Date)return e;const t={};for(const[n,o]of Object.entries(e)){if("function"==typeof o)continue;if(o&&"object"==typeof o&&o.$$typeof)continue;const e=d(o);void 0!==e&&(t[n]=e)}return t}function p(e,t){return!!u.has(e)&&("areas"!==e||"string"!=typeof t)}var f="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e));function h(e,t,s){const u=n(e)??i(t.recipe)??i(t.recipeId);if(u)return function(e,t,n){const i=function(e,t,n){const r={};for(const[i,s]of Object.entries(e))if(null!=s&&!c.has(i)&&"recipeId"!==i&&(t||!p(i,s)))if("function"==typeof s||s?.$$typeof){if(n)throw Error(`Portable recipe prop "${i}" is not JSON-safe.`)}else if(o(s))r[i]=f(s);else if(n)throw Error(`Portable recipe prop "${i}" is not JSON-safe.`);return r}(t,!1!==n?.includeData,"portable"===e.portability),s=e.intents.map(r).filter(e=>!!e),a={name:e.name,intents:s,...e.audience?.primary?{audience:[e.audience.primary]}:{},frameFamily:e.frameFamily};if("portable"===e.portability){if(!o(i))throw Error(`Portable recipe "${e.id}" contains non-JSON-safe props or layoutConfig.`);return{component:"ChartRecipe",recipeId:e.id,portable:!0,props:i,manifest:a,version:"1",createdAt:(new Date).toISOString(),...n?.selections?{selections:n.selections}:{}}}return{component:"ChartRecipe",recipeId:e.id,portable:!1,reason:"Recipe contains or may depend on non-serializable local layout callbacks.",warnings:["This config is inspectable but cannot be rendered remotely by CLI or MCP."],props:i,manifest:a,version:"1",createdAt:(new Date).toISOString(),...n?.selections?{selections:n.selections}:{}}}(u,t,s);if(!function(e){return l.has(e)}(e))throw Error(`Unknown component "${e}". Known components: ${a.join(", ")}`);const h=!1!==s?.includeData,m={};for(const[e,n]of Object.entries(t))if(null!=n&&!c.has(e)&&(h||!p(e,n))&&"function"!=typeof n&&!n?.$$typeof)try{m[e]=f(d(n))}catch{}return{component:e,props:m,version:"1",createdAt:(new Date).toISOString(),...s?.selections?{selections:s.selections}:{}}}function m(e){const{props:t}=e,n=["<"+("LocalChartRecipe"===e.component?"ChartRecipe":e.component)];e.recipeId&&n.push(` recipeId="${e.recipeId}"`);for(const[e,o]of Object.entries(t))if("string"==typeof o)n.push(` ${e}="${o}"`);else if("boolean"==typeof o&&!0===o)n.push(" "+e);else if("boolean"==typeof o&&!1===o)n.push(` ${e}={false}`);else if("number"==typeof o)n.push(` ${e}={${o}}`);else{const t=JSON.stringify(o);n.push(80>t.length?` ${e}={${t}}`:` ${e}={${JSON.stringify(o,null,2)}}`)}return n.push("/>"),n.join("\n")}var y=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]);function g(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function v(e){return g(e)?e:void 0}function b(e){const t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:void 0}function C(e){const t=b(e);return null==t?void 0:Math.max(0,Math.floor(t))}function $(...e){return e.map(v).find(Boolean)}function S(...e){return e.find(Array.isArray)}function w(e){const t={};for(const[n,o]of Object.entries(e))void 0!==o&&(t[n]=o);return t}function P(e,t,n){return e["string"==typeof t&&t?t:n]}function A(e){return e instanceof Date?e.toISOString():"number"==typeof e?Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+"":(e??"—")+""}function x(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function D(e){return Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+""}function j(e,t,n){const o=e?.filter(e=>!0===v(e)?.sensor).length,r=v(t?.observation),i=v(r?.sensors),s=S(n?.activeSensors);return Math.max(o??0,i?Object.keys(i).length:0,s?.length??0)||void 0}function B(n,o,r={}){const{capability:i,audience:a,locale:l}=r,c=r.levels??["l1","l2","l3"],u=!1!==r.includeStructure,d=s(n,i),p=d?[...c,"l4"]:c,f=t(n,o,{levels:p,locale:l,capability:i,audience:a}),{l4:h,...m}=f.levels,B=["l1","l2","l3"].map(e=>f.levels[e]).filter(Boolean).join(" "),k={levels:m,text:f.annotations?`${f.annotations} ${B}`.trim():B,...f.annotations?{annotations:f.annotations}:{}};let O;if(d&&h){const e=(F=i)?"fits"in F||"buildProps"in F?{family:F.family}:{family:F.family,intentScores:F.intentScores}:{};O={act:d,sentence:h,family:e.family,intentScores:e.intentScores}}var F;const I=u?e(n,o,{maxLeaves:r.maxLeaves,locale:l}):void 0,R=function(e,t,n){if(!1===n)return;const o=g(n)?n:void 0,r=v(t.physics),i=$(o?.snapshot,r?.snapshot,t.physicsSnapshot,function(e){const t=v(e);return!!t&&(g(t.world)||"simulationState"in t||"liveBodyOrder"in t)}(t.snapshot)?t.snapshot:void 0),s=$(o?.evidence,r?.evidence,t.physicsEvidence,t.settledEvidence),a=$(o?.config,r?.config,i?.config,t.config),l=$(v(i?.world),v(r?.world)),c=$(v(a?.kernel),v(l?.options)),u=S(l?.bodies),d=S(l?.colliders,a?.colliders),p=S(i?.queue,r?.queue),f=S(i?.liveBodyOrder),h=S(l?.springs),m=S(i?.activeSensorPairs),P=function(e){if(!e||0===e.length)return;const t=e.map((e,t)=>{const n=v(e);if(!n)return;const o=b(n.count??n.value??n.total??n.bodies??n.events);if(null==o)return;const r=(n.label??n.id??n.name??"container "+(t+1))+"",i=null==n.id?void 0:n.id+"",s=b(n.secondary??n.secondaryCount),a=b(n.observed??n.observedCount);return w({id:i,label:r,count:o,secondary:s,secondaryLabel:"string"==typeof n.secondaryLabel?n.secondaryLabel:void 0,observed:a})}).filter(e=>null!=e);if(0===t.length)return;const n=t.reduce((e,t)=>e+t.count,0),o=t.filter(e=>e.count>0).length,r=t.slice().sort((e,t)=>t.count-e.count)[0];return{rows:t,totalCount:n,populatedCount:o,...r?{leader:r}:{}}}(function(e,t,n,o){const r=v(e.settledProjection),i=v(t?.settledProjection);return S(n?.projectionRows,n?.aggregates,e.settledProjectionRows,e.projectionRows,r?.rows,t?.settledProjectionRows,t?.projectionRows,i?.rows,o?.binCounts)}(t,r,o,s)),A=function(e,t){const n=e?.map((e,t)=>{const n=v(e);if(!n)return;const o=b(n.count)??0,r=b(n.total),i={label:(n.label??n.id??"sediment "+(t+1))+"",count:o};return null!=n.id&&(i.id=n.id+""),null!=r&&(i.total=r),i}).filter(e=>null!=e),o=C(t?.bins)??n?.length??0,r=b(t?.count)??n?.reduce((e,t)=>e+t.count,0)??0,i=b(t?.total)??n?.reduce((e,t)=>e+(t.total??0),0),s=n?.slice().sort((e,t)=>t.count-e.count)[0];if(0!==o||0!==r||i)return{bins:o,count:r,...null!=i&&i>0?{total:i}:{},...s?{leader:s}:{}}}(S(o?.sediment,r?.sediment,i?.sediment),$(o?.sedimentTotals,r?.sedimentTotals)),B=f?.length??u?.length??C(s?.bodyCount),k=function(e){if(e)return e.filter(e=>!0===v(e)?.sleeping).length}(u)??C(s?.sleepingCount),O=p?.length,F="string"==typeof i?.simulationState?i.simulationState:void 0,I="boolean"==typeof s?.settled?s.settled:F?"settled"===F:null!=B||null!=k||null!=O?null!=B&&k===B&&0===(O??0):void 0,R=v(c?.gravity),T=b(R?.x),N=b(R?.y),M=w({state:F,settled:I,elapsedSeconds:b(i?.elapsedSeconds),paused:"boolean"==typeof i?.paused?i.paused:void 0,visible:"boolean"==typeof i?.visible?i.visible:void 0,seed:b(c?.seed),gravity:null!=T&&null!=N?{x:T,y:N}:void 0,fixedDt:b(a?.fixedDt??c?.fixedDt),timeScale:b(a?.timeScale),maxSubsteps:C(a?.maxSubsteps),liveBodies:B,sleepingBodies:k,queued:O,bodyLimit:b(a?.bodyLimit),eviction:"string"==typeof a?.eviction?a.eviction:void 0}),L=w({colliders:d?.length,sensors:j(d,a,l),springs:h?.length,activeSensorPairs:m?.length}),E=Object.keys(L).length>0,G=y.has(e);if(!(Object.keys(M).length>0||E||P||A)||!G&&null==n)return;const H={simulation:M,...E?{geometry:L}:{},...P?{aggregates:P}:{},...A?{sediment:A}:{}},J=function(e){const t=[],n=e.simulation,o=[n.state??(n.settled?"settled":void 0),null!=n.liveBodies?`${n.liveBodies} live ${x(n.liveBodies,"body")}`:void 0,null!=n.sleepingBodies?n.sleepingBodies+" sleeping":void 0,null!=n.queued?n.queued+" queued":void 0,null!=n.seed?"seed "+D(n.seed):void 0,n.gravity?`gravity (${D(n.gravity.x)}, ${D(n.gravity.y)})`:void 0,null!=n.fixedDt?`fixed step ${D(n.fixedDt)}s`:void 0,null!=n.timeScale?D(n.timeScale)+"x time":void 0].filter(Boolean);o.length>0&&t.push(`Physics simulation: ${o.join("; ")}.`);const r=e.geometry;if(r){const e=[null!=r.colliders?`${r.colliders} ${x(r.colliders,"collider")}`:void 0,null!=r.sensors?`${r.sensors} ${x(r.sensors,"sensor")}`:void 0,null!=r.springs?`${r.springs} ${x(r.springs,"spring")}`:void 0,null!=r.activeSensorPairs?`${r.activeSensorPairs} active sensor ${x(r.activeSensorPairs,"pair")}`:void 0].filter(Boolean);e.length>0&&t.push(`Physics geometry: ${e.join("; ")}.`)}const i=e.aggregates;if(i){const e=i.leader,n=e?` Largest is ${e.label} with ${D(e.count)}.`:"";t.push(`Physics aggregates: ${D(i.totalCount)} settled ${x(i.totalCount,"body")} across ${i.rows.length} ${x(i.rows.length,"container")}; ${i.populatedCount} populated.${n}`)}const s=e.sediment;if(s){const e=null!=s.total?", value total "+D(s.total):"",n=s.leader?`; largest sediment bin is ${s.leader.label} with ${D(s.leader.count)}`:"";t.push(`Physics sediment: ${s.count} retained ${x(s.count,"body")} in ${s.bins} ${x(s.bins,"bin")}${e}${n}.`)}return t.join(" ")}(H);return{...H,text:J}}(n,o,r.physics),T=function(e,t,n){const o=[];if("GaugeChart"===e){"number"==typeof t.value&&Number.isFinite(t.value)&&o.push(`Current value is ${A(t.value)}.`);const e="number"==typeof t.min&&Number.isFinite(t.min)?t.min:0,n="number"==typeof t.max&&Number.isFinite(t.max)?t.max:100;o.push(`The gauge scale runs from ${A(e)} to ${A(n)}.`)}if("SankeyDiagram"===e||"ProcessSankey"===e){const r=Array.isArray(t.edges)?t.edges:[];if("ProcessSankey"===e&&Array.isArray(t.domain)&&2===t.domain.length&&o.push(`The ProcessSankey time domain runs from ${A(t.domain[0])} to ${A(t.domain[1])}.`),r.length>0){o.push(`${r.length} source flow${1===r.length?"":"s"} are supplied.`);for(const i of r.slice(0,n)){const n=P(i,t.sourceAccessor,"source"),r=P(i,t.targetAccessor,"target"),s=P(i,t.valueAccessor,"value");o.push("ProcessSankey"!==e||null==i.startTime&&null==i.endTime?`${A(n)} to ${A(r)} has value ${A(s)}.`:`${A(n)} to ${A(r)} has value ${A(s)} over ${A(i.startTime)}–${A(i.endTime)}.`)}}}if("Treemap"===e||"CirclePack"===e||"TreeDiagram"===e||"OrbitDiagram"===e){const e=v(t.data),r="string"==typeof t.childrenAccessor&&t.childrenAccessor?t.childrenAccessor:"children",i="string"==typeof t.valueAccessor&&t.valueAccessor?t.valueAccessor:"value",s="string"==typeof t.nodeIdAccessor&&t.nodeIdAccessor?t.nodeIdAccessor:"string"==typeof t.nodeIDAccessor&&t.nodeIDAccessor?t.nodeIDAccessor:"name",a=[],l=e=>{const t=Array.isArray(e[r])?e[r]:[];if(0!==t.length)for(const e of t){const t=v(e);t&&l(t)}else a.push(e)};if(e&&l(e),a.length>0){o.push(a.length+" hierarchy leaves are supplied.");for(const e of a.slice(0,n))o.push(`${A(e[s])} has value ${A(e[i])}.`)}}if(y.has(e)&&Array.isArray(t.data)){const n=t.data;o.push(`${n.length} observed source row${1===n.length?"":"s"} are supplied.`);const r="CollisionSwarmChart"===e?t.xAccessor:t.valueAccessor,i="CollisionSwarmChart"===e?"x":"value",s=n.map(e=>b(P(e,r,i))).filter(e=>null!=e);s.length>0&&o.push(`Observed ${"string"==typeof r?r:i} ranges from ${A(Math.min(...s))} to ${A(Math.max(...s))}.`)}if(0!==o.length)return{source:"chart-props",statements:o,text:"Exact chart-prop facts: "+o.join(" ")}}(n,o,Math.max(1,r.maxLeaves??200)),N=[k.text,O?.sentence,R?.text,T?.text].filter(Boolean).join(" ");return{component:n,description:k,intent:O,structure:I,physics:R,facts:T,text:N}}export{h as toConfig,m as configToJSX,B as buildReaderGrounding};
|
package/dist/c-CJYSXIFV.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){if(null==e)return()=>{};const o="function"==typeof e?e:o=>o[e];return e=>a(o(e))}function o(o,r){const a=e(o),i=e(r);return(e,o)=>{const r=i(e);return{value:r,x:a(e),y:r,category:o}}}function r(o,r){const a=e(r??"value"),i=null==o?void 0:"function"==typeof o?o:e=>e[o];return e=>{const o=i?i(e):void 0;return{value:a(e),category:null==o?void 0:o+""}}}function a(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){const o=Number(e);return Number.isFinite(o)?o:void 0}}function i(e,o,r){const i=null!=e.axis?r[e.axis]:null!=e.field?o[e.field]:r.value;if(void 0!==e.eq&&i!==e.eq)return!1;if(void 0!==e.ne&&i===e.ne)return!1;if(void 0!==e.in&&!e.in.includes(i))return!1;if(void 0===e.gt&&void 0===e.gte&&void 0===e.lt&&void 0===e.lte&&void 0===e.within&&void 0===e.outside)return!0;const t=a(i);if(void 0===t)return!1;if(void 0!==e.gt&&e.gt>=t)return!1;if(void 0!==e.gte&&e.gte>t)return!1;if(void 0!==e.lt&&t>=e.lt)return!1;if(void 0!==e.lte&&t>e.lte)return!1;if(void 0!==e.within){const[o,r]=e.within;if(o>t||t>r)return!1}if(void 0!==e.outside){const[o,r]=e.outside;if(t>=o&&r>=t)return!1}return!0}function t(e,o,r){const a=e.when;return void 0===a||!0===a||!1!==a&&("function"==typeof a?a(o,r):i(a,o,r))}function c(e,o,r){if(!o||0===o.length)return{};let a={};for(const i of o){if(!t(i,e,r))continue;const o="function"==typeof i.style?i.style(e,r):i.style;o&&(a={...a,...o})}return a}function n(e,o,r,a=e=>e){const i=e??(()=>({}));return o&&0!==o.length?(e,t)=>{const n=a(e),f={...i(e,t)};return Object.assign(f,c(n,o,r(n,t))),f}:i}function f(e,o,r){return e&&0!==e.length?(a,i)=>{const t=c(a,e,o(a,i)),n=r?r(a,i):void 0;return n?{...t,...n}:t}:r}function s(e,o,a,i){if(!e||0===e.length)return i;const t=r(o,a);return(o,r)=>{const a=o&&o.data||o,n=c(a,e,t(a)),f=i?i(o,r):void 0;return f?{...n,...f}:n}}var d=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],l={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}},u={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}},b={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:d,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"};function g(e){if(!e?.colors)return;const o=e.colors;return{primary:o.primary,secondary:o.secondary||o.primary,surface:o.surface||o.background,success:o.success,danger:o.danger,warning:o.warning,error:o.error,info:o.info,text:o.text,textSecondary:o.textSecondary,border:o.border,grid:o.grid}}function p(e){if(!e.accessibility)return e;let o=e;if(e.accessibility.colorBlindSafe&&(o={...o,colors:{...o.colors,categorical:d}}),e.accessibility.highContrast){const e="dark"===o.mode;o={...o,colors:{...o.colors,text:e?"#ffffff":"#000000",textSecondary:e?"#cccccc":"#333333",grid:e?"#666666":"#999999",border:e?"#888888":"#000000"}}}return o}var y={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"},x={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"},m={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"},S={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"},h={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"},k={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"},z={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"},w={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"},F={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"},v={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"},R={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"},q={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"},B=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"],N={danger:"#da1e28",warning:"#f1c21b",success:"#24a148",info:"#0043ce"},O={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"},A={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"},C={light:l,dark:u,"high-contrast":b,pastels:y,"pastels-dark":x,"bi-tool":m,"bi-tool-dark":S,italian:h,"italian-dark":k,tufte:z,"tufte-dark":w,journalist:F,"journalist-dark":v,playful:R,"playful-dark":q,carbon:O,"carbon-dark":A};function E(e){return Object.prototype.hasOwnProperty.call(C,e)?C[e]:void 0}function H(e){const o={"--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,r)=>{o["--semiotic-category-"+(r+1)]=e}),e.colors.focus&&(o["--semiotic-focus"]=e.colors.focus),e.colors.selection&&(o["--semiotic-selection-color"]=e.colors.selection),null!=e.colors.selectionOpacity&&(o["--semiotic-selection-opacity"]=e.colors.selectionOpacity+""),e.colors.diverging&&(o["--semiotic-diverging"]=e.colors.diverging),e.colors.annotation&&(o["--semiotic-annotation-color"]=e.colors.annotation),e.colors.success&&(o["--semiotic-success"]=e.colors.success),e.colors.danger&&(o["--semiotic-danger"]=e.colors.danger),e.colors.warning&&(o["--semiotic-warning"]=e.colors.warning),e.colors.error&&(o["--semiotic-error"]=e.colors.error),e.colors.info&&(o["--semiotic-info"]=e.colors.info),e.tooltip?.background&&(o["--semiotic-tooltip-bg"]=e.tooltip.background),e.tooltip?.text&&(o["--semiotic-tooltip-text"]=e.tooltip.text),e.tooltip?.borderRadius&&(o["--semiotic-tooltip-radius"]=e.tooltip.borderRadius),e.tooltip?.fontSize&&(o["--semiotic-tooltip-font-size"]=e.tooltip.fontSize),e.tooltip?.shadow&&(o["--semiotic-tooltip-shadow"]=e.tooltip.shadow),e.borderRadius&&(o["--semiotic-border-radius"]=e.borderRadius);const r=e.typography.legendSize??e.typography.labelSize;null!=r&&(o["--semiotic-legend-font-size"]=r+"px"),null!=e.typography.legendFontFamily&&(o["--semiotic-legend-font-family"]=e.typography.legendFontFamily),null!=e.typography.legendFontWeight&&(o["--semiotic-legend-font-weight"]=e.typography.legendFontWeight+"");const a=e.typography.titleFontSize??e.typography.titleSize;return null!=a&&(o["--semiotic-title-font-size"]=a+"px"),null!=e.typography.titleFontFamily&&(o["--semiotic-title-font-family"]=e.typography.titleFontFamily),null!=e.typography.titleFontWeight&&(o["--semiotic-title-font-weight"]=e.typography.titleFontWeight+""),null!=e.typography.tickFontFamily&&(o["--semiotic-tick-font-family"]=e.typography.tickFontFamily),null!=e.typography.tickSize&&(o["--semiotic-tick-font-size"]=e.typography.tickSize+"px"),null!=e.typography.labelSize&&(o["--semiotic-axis-label-font-size"]=e.typography.labelSize+"px"),o}export{e as makeRuleValueResolver,o as makeXYRuleContext,r as makeNodeRuleContext,i as matchesThreshold,t as ruleMatches,c as resolveStyleRules,n as composeStyleRules,f as makeStyleRuleStyleFn,s as styleRulesToNodeStyle,d as COLOR_BLIND_SAFE_CATEGORICAL,l as LIGHT_THEME,u as DARK_THEME,b as HIGH_CONTRAST_THEME,g as resolveThemeSemanticColors,p as applyThemeAccessibility,y as PASTELS_LIGHT,x as PASTELS_DARK,m as BI_TOOL_LIGHT,S as BI_TOOL_DARK,h as ITALIAN_LIGHT,k as ITALIAN_DARK,z as TUFTE_LIGHT,w as TUFTE_DARK,F as JOURNALIST_LIGHT,v as JOURNALIST_DARK,R as PLAYFUL_LIGHT,q as PLAYFUL_DARK,B as CARBON_CATEGORICAL_14,N as CARBON_ALERT,O as CARBON_LIGHT,A as CARBON_DARK,C as THEME_PRESETS,E as resolveThemePreset,H as themeToCSSVariables};
|
package/dist/c-CZF7MV67.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{buildThresholdLineSegments as t}from"./c-QSGWX53A.min.js";import{buildLinearFillGradient as e,resolveCSSColor as l,resolveCanvasFill as o,resolveCurveFactory as a}from"./c-QKHMBE2E.min.js";import{line as h}from"d3-shape";function i(t,e,l,o,a,h){if(2>e.length)return;const i=[0];for(let t=1;e.length>t;t++){const l=e[t][0]-e[t-1][0],o=e[t][1]-e[t-1][1];i.push(i[t-1]+Math.sqrt(l*l+o*o))}const n=i[i.length-1];if(0===n)return;const s=Math.min(.2*n,40);t.strokeStyle=l,t.lineWidth=o,t.lineCap=h;for(let l=0;e.length-1>l;l++){const o=(i[l]+i[l+1])/2;let h=a;s>o&&(h*=o/s),s>n-o&&(h*=(n-o)/s),t.globalAlpha=Math.max(0,h),t.beginPath(),t.moveTo(e[l][0],e[l][1]),t.lineTo(e[l+1][0],e[l+1][1]),t.stroke()}}var n=(n,s,p,r)=>{const c=s.filter(t=>"line"===t.type);for(const s of c){if(2>s.path.length)continue;const p=s._introClipFraction;void 0!==p&&1>p&&(n.save(),n.beginPath(),n.rect(0,0,r.width*p,r.height),n.clip());const c=s.style.stroke||"#007bff",f=l(n,c)||c,y=s.style.strokeWidth??2,g=s.colorThresholds,b=s.rawValues;if(n.setLineDash(s.style.strokeDasharray?s.style.strokeDasharray.split(/[\s,]+/).map(Number):[]),null!=s.style.opacity&&(n.globalAlpha=s.style.opacity),y>0&&(n.lineWidth=y),n.lineCap=s.style.strokeLinecap||"butt",s.style._edgeFade&&y>0){i(n,s.path,f,y,s.style.opacity??1,s.style.strokeLinecap||"butt"),n.globalAlpha=1,n.setLineDash([]),n.lineCap="butt";continue}const m=a(s.curve),u=g&&g.length>0&&b&&b.length===s.path.length,k=s._decayOpacities;if(y>0&&k&&k.length===s.path.length&&!u){n.strokeStyle=f;const t=s.style.opacity??1;for(let e=0;s.path.length-1>e;e++)n.globalAlpha=.5*(k[e]+k[e+1])*t,n.beginPath(),n.moveTo(s.path[e][0],s.path[e][1]),n.lineTo(s.path[e+1][0],s.path[e+1][1]),n.stroke()}else if(y>0&&!u){n.beginPath();const t=s.strokeGradient&&s.path.length>=2?e(n,s.strokeGradient,f,s.path[0][0],0,s.path[s.path.length-1][0],0):null;if(n.strokeStyle=t||f,m)h().x(t=>t[0]).y(t=>t[1]).curve(m).context(n)(s.path);else{const[t,e]=s.path[0];n.moveTo(t,e);for(let t=1;s.path.length>t;t++)n.lineTo(s.path[t][0],s.path[t][1])}n.stroke()}else if(y>0){const e=t(s.path,b,g,f);for(const t of e){n.beginPath(),n.strokeStyle=l(n,t.color)||t.color,n.moveTo(t.path[0][0],t.path[0][1]);for(let e=1;t.path.length>e;e++)n.lineTo(t.path[e][0],t.path[e][1]);n.stroke()}}if(s.style.fill&&s.style.fillOpacity&&s.style.fillOpacity>0){if(n.beginPath(),n.globalAlpha=s.style.fillOpacity,n.fillStyle=o(n,s.style.fill,s.style.fill),m&&!u)h().x(t=>t[0]).y(t=>t[1]).curve(m).context(n)(s.path);else{const[t,e]=s.path[0];n.moveTo(t,e);for(let t=1;s.path.length>t;t++)n.lineTo(s.path[t][0],s.path[t][1])}const t=s.path[0][0];n.lineTo(s.path[s.path.length-1][0],r.height),n.lineTo(t,r.height),n.closePath(),n.fill()}void 0!==p&&1>p&&n.restore(),n.globalAlpha=1,n.setLineDash([]),n.lineCap="butt"}};export{n as lineCanvasRenderer};
|
package/dist/c-D53OKBSY.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{MarginalGraphics as m}from"./c-IGH6MGJ5.min.js";import{normalizeMarginalConfig as i}from"./c-ENF72HU5.min.js";import"./c-GGISSW5E.min.js";export{m as MarginalGraphics,i as normalizeMarginalConfig};
|
package/dist/c-DADXPJXV.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useRef as t,useEffect as e}from"react";import{brush as r}from"d3-brush";import{select as n}from"d3-selection";import{jsx as s}from"react/jsx-runtime";function l({frameRef:l,cellSize:o,onBrush:i}){const c=t(null),u=o-4-4,a=o-4-4;return e(()=>{if(!c.current)return;const t=n(c.current).select(".brush-g"),e=r().extent([[0,0],[u,a]]).on("brush end",t=>{const e=l.current?.getScales();if(!e)return;if(!(r=t.selection)||!Array.isArray(r[0]))return void i(null);var r;const[[n,s],[o,c]]=t.selection,u=[[e.x.invert(n),e.y.invert(s)],[e.x.invert(o),e.y.invert(c)]];i(u)});return t.call(e),t.select(".selection").attr("fill","steelblue").attr("fill-opacity",.15).attr("stroke","steelblue").attr("stroke-width",1),()=>{e.on("brush end",null)}},[u,a,l,i]),s("svg",{ref:c,width:o,height:o,style:{position:"absolute",top:0,left:0},children:s("g",{className:"brush-g",transform:"translate(4,4)"})})}export{l as ScatterplotMatrixBrushOverlay};
|
package/dist/c-DBQ2V7CH.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{buildThresholdLineSegments as t}from"./c-QSGWX53A.min.js";import{ARC_NOOP as e,colorStopElements as l,glyphNodeToSVG as r,safeSvgId as i,sceneMarkCursor as s,svgFill as o,symbolSceneNodeToSVG as a,withSceneMarkCursor as n}from"./c-VN2HG5BS.min.js";import{hatchPatternDef as c,isHatchFill as y,resolveCurveFactory as h,symbolPathString as d}from"./c-QKHMBE2E.min.js";import*as p from"react";import{jsx as f,jsxs as u}from"react/jsx-runtime";function k(t,e){return n(function(t,e){switch(t.type){case"geoarea":{const l=t;if(!l.pathData)return null;const r=y(l.style.fill)?c(l.style.fill,`geoarea-${e}-hatch`):void 0;return u(p.Fragment,{children:[r&&f("defs",{children:r}),f("path",{d:l.pathData,fill:r?`url(#geoarea-${e}-hatch)`:o(l.style.fill,"#e0e0e0"),fillOpacity:l.style.fillOpacity??1,stroke:l.style.stroke||"none",strokeWidth:l.style.strokeWidth??.5,strokeDasharray:l.style.strokeDasharray,opacity:l._decayOpacity??1})]},"geoarea-"+e)}case"point":{const l=t,r=y(l.style.fill)?c(l.style.fill,`geopoint-${e}-hatch`):void 0;return u(p.Fragment,{children:[r&&f("defs",{children:r}),f("circle",{cx:l.x,cy:l.y,r:l.r,fill:r?`url(#geopoint-${e}-hatch)`:o(l.style.fill),fillOpacity:l.style.fillOpacity??.8,stroke:l.style.stroke,strokeWidth:l.style.strokeWidth,opacity:l._decayOpacity??l.style.opacity??1})]},"point-"+e)}case"line":{const l=t;if(2>l.path.length)return null;const r="M"+l.path.map(t=>`${t[0]},${t[1]}`).join("L");return f("path",{d:r,fill:"none",stroke:l.style.stroke||"#4e79a7",strokeWidth:l.style.strokeWidth??1.5,strokeDasharray:l.style.strokeDasharray,opacity:l.style.opacity??1},"line-"+e)}case"glyph":return r(t,t.x,t.y,"geo-glyph-"+(t.pointId??e));default:return null}}(t,e),t,"geo-cursor-"+e)}import*as m from"react";import{area as g,line as x}from"d3-shape";import*as $ from"react";import{arc as W}from"d3-shape";import{jsx as v,jsxs as O}from"react/jsx-runtime";function w(t,l){return n(function(t,l){switch(t.type){case"circle":{const e=t,r=y(e.style.fill)?c(e.style.fill,`net-circle-${l}-hatch`):void 0;return O($.Fragment,{children:[r&&v("defs",{children:r}),v("circle",{cx:e.cx,cy:e.cy,r:e.r,fill:r?`url(#net-circle-${l}-hatch)`:o(e.style.fill),stroke:e.style.stroke,strokeWidth:e.style.strokeWidth,fillOpacity:e.style.fillOpacity,strokeOpacity:e.style.strokeOpacity,opacity:e.style.opacity})]},"net-circle-"+l)}case"rect":{const e=t,r=y(e.style.fill)?c(e.style.fill,`net-rect-${l}-hatch`):void 0;return O($.Fragment,{children:[r&&v("defs",{children:r}),v("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:r?`url(#net-rect-${l}-hatch)`:o(e.style.fill),stroke:e.style.stroke,strokeWidth:e.style.strokeWidth,fillOpacity:e.style.fillOpacity,strokeOpacity:e.style.strokeOpacity,opacity:e.style.opacity})]},"net-rect-"+l)}case"arc":{const r=t,i=W().innerRadius(r.innerR).outerRadius(r.outerR).startAngle(r.startAngle+Math.PI/2).endAngle(r.endAngle+Math.PI/2)(e)||"",s=y(r.style.fill)?c(r.style.fill,`net-arc-${l}-hatch`):void 0;return O($.Fragment,{children:[s&&v("defs",{children:s}),v("path",{d:i,transform:`translate(${r.cx},${r.cy})`,fill:s?`url(#net-arc-${l}-hatch)`:o(r.style.fill),stroke:r.style.stroke,strokeWidth:r.style.strokeWidth,fillOpacity:r.style.fillOpacity,strokeOpacity:r.style.strokeOpacity,opacity:r.style.opacity})]},"net-arc-"+l)}case"symbol":{const e=t,r=d(e.symbolType,e.size,e.path);return v("path",{d:r,transform:e.rotation?`translate(${e.cx},${e.cy}) rotate(${180*e.rotation/Math.PI})`:`translate(${e.cx},${e.cy})`,fill:e.style.fill?o(e.style.fill):"none",stroke:e.style.stroke,strokeWidth:e.style.strokeWidth,fillOpacity:e.style.fillOpacity,strokeOpacity:e.style.strokeOpacity,opacity:e.style.opacity},"net-symbol-"+l)}case"glyph":return r(t,t.cx,t.cy,"net-glyph-"+(t.id??l));default:return null}}(t,l),t,"network-node-cursor-"+l)}function b(t,e){return n(function(t,e){switch(t.type){case"line":return v("line",{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:t.style.stroke||"#999",strokeWidth:t.style.strokeWidth??1,opacity:t.style.opacity},"net-edge-"+e);case"bezier":{const l=t,r=`net-bezier-${e}-hatch`,i=y(l.style.fill)?c(l.style.fill,r):void 0;return O($.Fragment,{children:[i&&v("defs",{children:i}),v("path",{d:l.pathD,fill:i?`url(#${r})`:o(l.style.fill,"#999"),fillOpacity:l.style.fillOpacity,stroke:l.style.stroke||"none",strokeWidth:l.style.strokeWidth,opacity:l.style.opacity})]},"net-edge-"+e)}case"ribbon":{const l=t,r=`net-ribbon-${e}-hatch`,i=y(l.style.fill)?c(l.style.fill,r):void 0;return O($.Fragment,{children:[i&&v("defs",{children:i}),v("path",{d:l.pathD,fill:i?`url(#${r})`:o(l.style.fill,"#999"),fillOpacity:l.style.fillOpacity,stroke:l.style.stroke||"none",strokeWidth:l.style.strokeWidth,opacity:l.style.opacity})]},"net-edge-"+e)}case"curved":{const l=t;return v("path",{d:l.pathD,fill:o(l.style.fill,"none"),stroke:l.style.stroke||"#999",strokeWidth:l.style.strokeWidth??1,opacity:l.style.opacity},"net-edge-"+e)}default:return null}}(t,e),t,"network-edge-cursor-"+e)}function P(t,e){return v("text",{x:t.x,y:t.y,textAnchor:t.anchor||"middle",dominantBaseline:t.baseline||"auto",fontSize:t.fontSize||11,fontWeight:t.fontWeight,fill:t.fill||"var(--semiotic-text, #333)",stroke:t.stroke,strokeWidth:t.strokeWidth,paintOrder:t.paintOrder,children:t.text},"net-label-"+e)}import{jsx as M,jsxs as F}from"react/jsx-runtime";function j(t,e,r,i){if(!t||2>e.length)return null;const s=l(t.stops,i);return s?M("linearGradient",{id:r,gradientUnits:"userSpaceOnUse",x1:e[0][0],y1:0,x2:e[e.length-1][0],y2:0,children:s}):null}function D(e,d,p,f=30){const u=function(e,n,d,p=30){switch(e.type){case"line":{const t=e;if(0===t.path.length)return null;const l=h(t.curve),r=l?x().x(([t])=>t).y(([,t])=>t).curve(l)(t.path)??"":"M"+t.path.map(([t,e])=>`${t},${e}`).join("L"),s=i(`${d?d+"-":""}line-${n}-stroke-gradient`),o=j(t.strokeGradient,t.path,s,t.style.stroke||"#4e79a7");return F(m.Fragment,{children:[o&&M("defs",{children:o}),M("path",{d:r,fill:"none",stroke:o?`url(#${s})`:t.style.stroke||"#4e79a7",strokeWidth:t.style.strokeWidth??2,strokeDasharray:t.style.strokeDasharray,opacity:t.style.opacity})]},"line-"+n)}case"area":{const r=e;if(0===r.topPath.length)return null;const a=h(r.curve),f=!a||2>r.topPath.length||2>r.bottomPath.length?`M${r.topPath.map(([t,e])=>`${t},${e}`).join("L")}L${[...r.bottomPath].reverse().map(([t,e])=>`${t},${e}`).join("L")}Z`:g().x(([t])=>t).y0((t,e)=>r.bottomPath[e][1]).y1(([,t])=>t).curve(a)(r.topPath)??"",u=`${d?d+"-":""}area-${n}-hatch`,k=y(r.style.fill)?c(r.style.fill,u):void 0,$=i(`${d?d+"-":""}area-${n}-gradient`),W=function(t,e){const r=t.fillGradient;if(!r||"object"!=typeof r)return null;let i=1/0;for(const[,e]of t.topPath)i=Math.min(i,e);let s=-1/0;for(const[,e]of t.bottomPath)s=Math.max(s,e);if(!Number.isFinite(i)||!Number.isFinite(s))return null;const a=l(r.stops,o(t.style.fill));return a?M("linearGradient",{id:e,gradientUnits:"userSpaceOnUse",x1:0,y1:i,x2:0,y2:s,children:a}):null}(r,$),v=W?`url(#${$})`:k?`url(#${u})`:o(r.style.fill),O=W?void 0:r.style.fillOpacity??r.style.opacity??.7,w=a?x().x(([t])=>t).y(([,t])=>t).curve(a)(r.topPath)??"":"M"+r.topPath.map(([t,e])=>`${t},${e}`).join("L"),b=s(r),P=b&&p>=0?M("path",{d:w,fill:"none",stroke:"transparent",strokeWidth:Math.max(1,2*p),strokeLinecap:"round",pointerEvents:"stroke",style:{cursor:b},"data-semiotic-mark-cursor":b,"data-semiotic-cursor-hit-target":"area-top-path","aria-hidden":"true"},`area-${n}-cursor-target`):null,D=i(`${d?d+"-":""}area-${n}-stroke-gradient`),R=!(!r.colorThresholds?.length||!r.rawValues||r.rawValues.length!==r.topPath.length),C=!!r.strokeColorBands?.length,Y=R||C?null:j(r.strokeGradient,r.topPath,D,r.style.stroke||"#4e79a7"),I=r.style.strokeWidth??2;let B=1/0,L=-1/0;for(const[t]of r.topPath)B>t&&(B=t),t>L&&(L=t);const A=C?r.strokeColorBands.map((t,e)=>i(`${d?d+"-":""}area-${n}-stroke-band-${e}`)):[],G=C?r.strokeColorBands.map((t,e)=>M("clipPath",{id:A[e],children:M("rect",{x:B-I,y:t.y,width:L-B+2*I,height:t.height})},A[e])):null,S=r.style.stroke&&"none"!==r.style.stroke?C?r.strokeColorBands.map((t,e)=>M("path",{d:w,fill:"none",stroke:t.color??o(r.style.stroke),strokeWidth:I,opacity:(r.style.opacity??1)*(t.opacity??1),clipPath:`url(#${A[e]})`},`area-${n}-stroke-band-${e}`)):R?t(r.topPath,r.rawValues,r.colorThresholds,o(r.style.stroke)).map((t,e)=>M("path",{d:"M"+t.path.map(([t,e])=>`${t},${e}`).join("L"),fill:"none",stroke:t.color,strokeWidth:I,opacity:r.style.opacity},`area-${n}-threshold-${e}`)):M("path",{d:w,fill:"none",stroke:Y?`url(#${D})`:o(r.style.stroke),strokeWidth:I,opacity:r.style.opacity}):null;if(r.clipRect){const t=`${d?d+"-":""}area-clip-${n}`;return F("g",{children:[F("defs",{children:[W,!W&&k,Y,G,M("clipPath",{id:t,children:M("rect",{x:r.clipRect.x,y:r.clipRect.y,width:r.clipRect.width,height:r.clipRect.height})})]}),F("g",{clipPath:`url(#${t})`,children:[M("path",{d:f,fill:v,fillOpacity:O,opacity:W?r.style.opacity:void 0,stroke:"none"}),S,P]})]},"area-"+n)}return F(m.Fragment,{children:[(W||k||Y||G)&&F("defs",{children:[W,!W&&k,Y,G]}),M("path",{d:f,fill:v,fillOpacity:O,opacity:W?r.style.opacity:void 0,stroke:"none"}),S,P]},"area-"+n)}case"point":{const t=e,l=`${d?d+"-":""}point-${n}-hatch`,r=y(t.style.fill)?c(t.style.fill,l):void 0;return F(m.Fragment,{children:[r&&M("defs",{children:r}),M("circle",{cx:t.x,cy:t.y,r:t.r,fill:r?`url(#${l})`:o(t.style.fill),opacity:t.style.opacity??t.style.fillOpacity??.8,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth})]},"point-"+n)}case"symbol":return a(e,n);case"glyph":return r(e,e.x,e.y,`${d??""}glyph-${e.pointId??n}`);case"rect":{const t=e,l=`${d?d+"-":""}xyrect-${n}-hatch`,r=y(t.style.fill)?c(t.style.fill,l):void 0;return F(m.Fragment,{children:[r&&M("defs",{children:r}),M("rect",{x:t.x,y:t.y,width:t.w,height:t.h,fill:r?`url(#${l})`:o(t.style.fill),opacity:t.style.opacity,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth})]},"rect-"+n)}case"heatcell":{const t=e,l={x:t.x,y:t.y,width:t.w,height:t.h,fill:t.fill,stroke:t.style?.stroke,strokeWidth:t.style?.strokeWidth,...null!=t.style?.opacity&&{opacity:t.style.opacity}};if(t.showValues&&null!=t.value&&t.w>=20&&t.h>=20){const e=t.valueFormat?t.valueFormat(t.value):Number.isInteger(t.value)?t.value+"":100>Math.abs(t.value)?1>Math.abs(t.value)?t.value.toPrecision(3):t.value.toFixed(1):t.value.toFixed(0),[r,i,s]=function(t){if(t.startsWith("#")){let e=t.slice(1);if(3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),6===e.length)return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}const e=t.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return e?[+e[1],+e[2],+e[3]]:[128,128,128]}(t.fill),o=.299*r+.587*i+.114*s>128?"#000":"#fff",a=Math.max(10,Math.min(16,.3*Math.min(t.w,t.h)));return F("g",{children:[M("rect",{...l}),M("text",{className:"semiotic-heatmap-value",x:t.x+t.w/2,y:t.y+t.h/2,textAnchor:"middle",dominantBaseline:"middle",fill:o,fontSize:a+"px",fontFamily:"var(--semiotic-font-family, sans-serif)",children:e})]},"heatcell-"+n)}return M("rect",{...l},"heatcell-"+n)}case"candlestick":{const t=e;if(t.isRange){const e=t.dotRadius??Math.max(2,t.bodyWidth/2);return F("g",{style:t.style,children:[M("line",{x1:t.x,y1:t.highY,x2:t.x,y2:t.lowY,stroke:t.wickColor,strokeWidth:t.wickWidth}),M("circle",{cx:t.x,cy:t.highY,r:e,fill:t.wickColor}),M("circle",{cx:t.x,cy:t.lowY,r:e,fill:t.wickColor})]},"candle-"+n)}const l=Math.min(t.openY,t.closeY),r=Math.max(Math.abs(t.openY-t.closeY),1),i=t.isUp?t.upColor:t.downColor;return F("g",{style:t.style,children:[M("line",{x1:t.x,y1:t.highY,x2:t.x,y2:t.lowY,stroke:t.wickColor,strokeWidth:t.wickWidth}),M("rect",{x:t.x-t.bodyWidth/2,y:l,width:t.bodyWidth,height:r,fill:i,stroke:i,strokeWidth:1})]},"candle-"+n)}default:return null}}(e,d,p,f);return"area"===e.type?u:n(u,e,"xy-cursor-"+d)}export{w as networkSceneNodeToSVG,b as networkSceneEdgeToSVG,P as networkLabelToSVG,k as geoSceneNodeToSVG,D as xySceneNodeToSVG};
|
package/dist/c-DPMVAUAW.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{annotationBudget as t,annotationDensity as e,dimFor as i,mulberry32 as n}from"./c-Q2IPZ3MU.min.js";import{isNoteAnnotation as s}from"./c-4ES5367Y.min.js";import{getMinMax as o}from"./c-GGISSW5E.min.js";function r(t){const{desired:e,minGaps:i,weights:n}=t,s=e.length;if(0===s)return[];if(i.length!==Math.max(0,s-1))throw Error("placeWithMinGap: minGaps must have desired.length - 1 entries");const o=Array(s).fill(0);for(let t=1;s>t;t++)o[t]=o[t-1]+Math.max(0,Number.isFinite(i[t-1])?i[t-1]:0);const r=[];for(let t=0;s>t;t++){const i=Math.max(Number.EPSILON,Number.isFinite(n?.[t])?n[t]:1),s=(Number.isFinite(e[t])?e[t]:0)-o[t];for(r.push({start:t,end:t,weight:i,mean:s});r.length>1;){const t=r[r.length-1],e=r[r.length-2];if(t.mean>=e.mean)break;const i=e.weight+t.weight;r.splice(r.length-2,2,{start:e.start,end:t.end,weight:i,mean:(e.mean*e.weight+t.mean*t.weight)/i})}}const a=Number.isFinite(t.min)?t.min:-1/0,c=Number.isFinite(t.max)?t.max-o[s-1]:1/0,l=a>c?a:c,d=Array(s);for(const t of r){const e=Math.max(a,Math.min(l,t.mean));for(let i=t.start;t.end>=i;i++)d[i]=e+o[i]}return d}function a(t,e){let i=0,n=t.length-1,s=-1;for(;n>=i;){const o=i+n>>>1;t[o].at>e?n=o-1:(s=o,i=o+1)}return 0>s?{at:e,before:0,after:0}:t[s]}function c(t,e=0){if(0===t.length)return{adjacentClearance:[],positions:[]};const i=[],n=[0];for(let s=0;t.length-1>s;s++){const o=t[s],r=t[s+1],c=[...new Set([...o.map(t=>t.at),...r.map(t=>t.at)])].sort((t,e)=>t-e);let l=0;for(const t of c){const e=a(o,t),i=a(r,t);l=Math.max(l,e.after+i.before)}i.push(l),n.push(n[n.length-1]+l+e)}return{adjacentClearance:i,positions:n}}function l(t,e,i,n={}){let s=[...t];if(1>=s.length)return s;let o=[...s],r=i(s),a=1;const c=Math.max(0,n.passes??6),l=Math.max(1,n.maxEvaluations??1/0);for(let t=0;c>t&&l>a;t++){const t=new Map(s.map((t,e)=>[t,e])),c=new Map,l=new Map;for(const i of e){const e=t.get(i.source),n=t.get(i.target);if(null==e||null==n)continue;const s=Number.isFinite(i.weight)&&i.weight>0?i.weight:1;c.set(i.source,(c.get(i.source)??0)+n*s),l.set(i.source,(l.get(i.source)??0)+s),c.set(i.target,(c.get(i.target)??0)+e*s),l.set(i.target,(l.get(i.target)??0)+s)}s=s.map((t,e)=>({item:t,index:e,barycenter:(c.get(t)??e)/(l.get(t)??1)})).sort((t,e)=>t.barycenter-e.barycenter||(n.compare?.(t.item,e.item)??t.index-e.index)).map(t=>t.item);const d=i(s);if(a++,r>d)r=d,o=[...s];else if(d===r)break}return o}function d(t,e,i={}){const n=[...t];if(1>=n.length)return n;let s=e(n),o=1;const r=Math.max(0,i.passes??6),a=Math.max(1,i.maxEvaluations??1/0);for(let t=0;r>t&&a>o;t++){let t=!1;for(let i=0;n.length-1>i&&a>o;i++){[n[i],n[i+1]]=[n[i+1],n[i]];const r=e(n);o++,s>r?(s=r,t=!0):[n[i],n[i+1]]=[n[i+1],n[i]]}if(!t)break}return n}function h(t,e,i={}){const n=[...t],s=n.length;if(1>=s||s>(i.maxItems??8))return n;const o=Math.max(1,i.maxEvaluations??1/0);let r=0,a=[...n],c=1/0;const l=()=>{if(r>=o)return;const t=e(n);r++,c>t&&(c=t,a=[...n])};l();const d=Array(s).fill(0);let h=0;for(;s>h&&o>r;)if(h>d[h]){const t=h%2==0?0:d[h];[n[t],n[h]]=[n[h],n[t]],l(),d[h]++,h=0}else d[h]=0,h++;return a}function u(t,e,i=()=>!0){let n=0;for(let s=0;t.length>s;s++){const[o,r]=e(t[s]);for(let a=s+1;t.length>a;a++){if(!i(t[s],t[a]))continue;const[c,l]=e(t[a]);0>(o-c)*(r-l)&&n++}}return n}import{interpolateRgb as p}from"d3-interpolate";var f=864e5,m=t=>{const e=t.config,{plot:i}=t.dimensions;if(0>=i.width||0>=i.height)return{nodes:[]};const n=t=>{const i="function"==typeof e.dateAccessor?e.dateAccessor(t):t[e.dateAccessor];return i instanceof Date?i:new Date(i)},s=t=>{const i="function"==typeof e.valueAccessor?e.valueAccessor(t):t[e.valueAccessor];return Number(i)},o=new Map;let r=null;for(const e of t.data){const t=n(e);if(!isFinite(t.getTime()))continue;null==r&&(r=t.getUTCFullYear());const i=y(t),a=s(e);o.set(i,(o.get(i)??0)+(Number.isFinite(a)?a:0))}const a=e.year??r??(new Date).getUTCFullYear();let c=1/0,l=-1/0;for(const t of o.values())c>t&&(c=t),t>l&&(l=t);c===1/0&&(c=0,l=0);const[d,h]=e.colorRamp??[t.theme.semantic.surface??"#ebedf0",t.theme.semantic.primary??"#216e39"],u=t=>{if(l===c)return d;const e=(t-c)/(l-c);return p(d,h)(e)},m=e.gutter??2,g=e.labelInset??0,x=Math.min((i.width-g-53*m)/54,(i.height-6*m)/7);if(0>=x)return{nodes:[]};const b=new Date(Date.UTC(a,0,1)),v=b.getUTCDay(),w=new Date(b.getTime()-v*f),S=[];for(let t=0;54>t;t++)for(let e=0;7>e;e++){const n=new Date(w.getTime()+(7*t+e)*f);if(n.getUTCFullYear()!==a)continue;const s=y(n),r=o.get(s),c=null==r?d:u(r);S.push({type:"rect",x:i.x+g+t*(x+m),y:i.y+e*(x+m),w:x,h:x,style:{fill:c,stroke:"none"},datum:{date:n,value:r??0}})}return{nodes:S}};function y(t){return`${t.getUTCFullYear()}-${g(t.getUTCMonth()+1)}-${g(t.getUTCDate())}`}function g(t){return 10>t?"0"+t:t+""}import{jsx as x,jsxs as b}from"react/jsx-runtime";function v(t){return x("rect",{className:t.className,x:t.x,y:t.y,width:Math.max(0,t.width),height:Math.max(0,t.height),rx:t.radius??10,ry:t.radius??10,fill:t.fill??"none",stroke:t.stroke,strokeWidth:t.strokeWidth??1.5,strokeDasharray:t.strokeDasharray,opacity:t.opacity??.6,style:{pointerEvents:"none"}},t.keyId)}function w(t,e=0){let i=1/0,n=1/0,s=-1/0,o=-1/0;for(const e of t){const t=e.r??0;i>e.x-t&&(i=e.x-t),e.x+t>s&&(s=e.x+t),n>e.y-t&&(n=e.y-t),e.y+t>o&&(o=e.y+t)}return Number.isFinite(i)?{x:i-e,y:n-e,width:s-i+2*e,height:o-n+2*e}:null}function S(t,e=0){if(!t.length)return null;const i="number"==typeof e?e:e.x??0,n="number"==typeof e?e:e.y??0;let s=1/0,o=1/0,r=-1/0,a=-1/0;for(const e of t){if(!Number.isFinite(e.x)||!Number.isFinite(e.y))continue;if(!Number.isFinite(e.width)||!Number.isFinite(e.height))continue;const t=Math.max(0,e.width),i=Math.max(0,e.height);s>e.x&&(s=e.x),o>e.y&&(o=e.y),e.x+t>r&&(r=e.x+t),e.y+i>a&&(a=e.y+i)}return Number.isFinite(s)?{x:s-i,y:o-n,width:r-s+2*i,height:a-o+2*n}:null}function M(t){const e=t.fontSize??12;return null!=t.maxWidth&&t.text.length*e*.56>t.maxWidth?null:x("text",{className:t.className,x:t.x,y:t.y,textAnchor:t.anchor??"middle",dominantBaseline:t.baseline??"middle",fontSize:e,fontWeight:t.fontWeight,fill:t.color,style:{pointerEvents:"none"},children:t.text},t.keyId)}function k(t){const e=t.spacing??8;return{def:x("pattern",{id:t.id,width:e,height:e,patternUnits:"userSpaceOnUse",patternTransform:`rotate(${t.angle??45})`,children:x("line",{x1:0,y1:0,x2:0,y2:e,stroke:t.color??"currentColor",strokeWidth:t.strokeWidth??1,opacity:t.opacity??.5})},t.id),fill:`url(#${t.id})`}}function I(t){const e=t.orient??"bottom",i="bottom"===e||"top"===e,n=t.offset??0,s=t.tickLength??6,o=t.gridLength??0,r=t.labelGap??4,a=t.fontSize??11,c=t.color??"var(--semiotic-text-secondary, #888)",l=t.gridColor??c,d=t.format??(t=>t+""),h="top"===e||"left"===e?-1:1,u=t.ticks.length-1,p=t.ticks.map((p,f)=>{const m=t.scale(p),y=n+h*s,g=n-h*o,v=y+h*r;let w;w=t.labelAnchor?t.labelAnchor:i?t.edgeAnchor&&0===f?"start":t.edgeAnchor&&f===u?"end":"middle":"left"===e?"end":"start";const S=i?"top"===e?"auto":"hanging":"middle",M=i?{x:m,y:v}:{x:v,y:m};return b("g",{children:[(s>0||o>0)&&x("line",{...i?{x1:m,x2:m,y1:y,y2:g}:{x1:y,x2:g,y1:m,y2:m},stroke:o>0?l:c,strokeWidth:1,strokeDasharray:o>0?t.gridDasharray:void 0,opacity:o>0?.7:1}),x("text",{x:M.x,y:M.y,textAnchor:w,dominantBaseline:S,fontSize:a,fontWeight:t.fontWeight,fill:c,children:d(p)})]},`tick-${p}-${f}`)});return x("g",{className:t.className,style:{pointerEvents:"none"},children:p},t.keyId)}function B(t){const e=t.stroke??"var(--semiotic-text, #f4f4f8)",i=t.strokeWidth??1,n=t.markRadius??0,s=t.labelX-t.markX,o=t.labelY-t.markY,r=Math.hypot(s,o)||1,a=t.markX+s/r*n,c=t.markY+o/r*n;let l;return l="elbow"===t.connector?`M${a},${c} L${a},${t.labelY} L${t.labelX},${t.labelY}`:"curve"===t.connector?`M${a},${c} Q${(a+t.labelX)/2},${c} ${t.labelX},${t.labelY}`:`M${a},${c} L${t.labelX},${t.labelY}`,b("g",{className:t.className,style:{pointerEvents:"none"},children:[n>0&&x("circle",{cx:t.markX,cy:t.markY,r:n,fill:"none",stroke:e,strokeWidth:i}),x("path",{d:l,fill:"none",stroke:e,strokeWidth:i}),x("text",{x:t.labelX,y:t.labelY,textAnchor:t.labelAnchor??"middle",dominantBaseline:t.labelBaseline??"hanging",fontSize:t.fontSize??11,fontWeight:t.fontWeight,fill:t.color??e,children:t.label})]},t.keyId)}import*as O from"react";import{scaleLinear as A}from"d3-scale";var q=t=>{const e=t.config,{plot:n}=t.dimensions,s=e.fields??[];if(2>s.length||0>=n.width||0>=n.height)return{nodes:[]};if(0===t.data.length)return{nodes:[]};const o=Object.create(null);for(const i of s){const n=e.domains&&Object.prototype.hasOwnProperty.call(e.domains,i)?e.domains[i]:void 0;if(Array.isArray(n)&&n.length>=2&&"number"==typeof n[0]&&Number.isFinite(n[0])&&"number"==typeof n[1]&&Number.isFinite(n[1])){o[i]=[n[0],n[1]];continue}let s=1/0,r=-1/0;for(const e of t.data){const t=Number(e[i]);Number.isFinite(t)&&(s>t&&(s=t),t>r&&(r=t))}if(Number.isFinite(s)&&Number.isFinite(r))if(s===r){const t=Math.max(.01*Math.abs(s),.5);o[i]=[s-t,r+t]}else o[i]=[s,r];else o[i]=[0,1]}const r=!1!==e.showAxes,a=r?e.axisLabelPadding??24:8,c=r?18:8,l=s.map(t=>A().domain(o[t]).range([n.y+n.height-c,n.y+a])),d=s.map((t,e)=>1===s.length?n.x+n.width/2:n.x+e/(s.length-1)*n.width),h=e.colorBy?"function"==typeof e.colorBy?e.colorBy:t=>(t[e.colorBy]??"")+"":null,u=e.opacity??.45,p=e.strokeWidth??1.25,f=t.theme.semantic.primary??"#3b6cb1",m=e.dimmedOpacity??.08,y=e.highlightFn,g=[],x=[];for(const n of t.data){const o=h?t.resolveColor(h(n)+""):f,r=!y||y(n),a=i(n,{predicate:y,baseOpacity:u,dimOpacity:m,brighten:.4}),c=r?x:g;for(let t=0;s.length-1>t;t++){const e=Number(n[s[t]]),i=Number(n[s[t+1]]);if(!Number.isFinite(e)||!Number.isFinite(i))continue;const h={type:"connector",x1:d[t],y1:l[t](e),x2:d[t+1],y2:l[t+1](i),style:{stroke:o,strokeWidth:y&&r?p+.75:p,opacity:a,fill:"none"},datum:n};c.push(h)}if(e.showPoints)for(let t=0;s.length>t;t++){const e=Number(n[s[t]]);if(!Number.isFinite(e))continue;const i={type:"point",x:d[t],y:l[t](e),r:2.5,style:{fill:o,stroke:"none",opacity:Math.min(1,a+.3)},datum:n};c.push(i)}}let b=null;if(r){const i=`var(--semiotic-border, ${t.theme.semantic.border??"#aaa"})`,r=`var(--semiotic-text, ${t.theme.semantic.text??"currentColor"})`,h=`var(--semiotic-text-secondary, ${t.theme.semantic.textSecondary??"#888"})`,u=n.y+a,p=n.y+n.height-c,f=[];for(let t=0;s.length>t;t++){const c=s[t],m=d[t],y=e.tickFormat&&Object.prototype.hasOwnProperty.call(e.tickFormat,c)?e.tickFormat[c]:void 0,g="function"==typeof y?y:t=>t.toLocaleString();f.push(O.createElement("line",{key:"pc-axis-line-"+t,x1:m,x2:m,y1:u,y2:p,stroke:i,strokeWidth:1})),f.push(M({keyId:"pc-axis-label-"+t,text:c,x:m,y:n.y+a-8,anchor:"middle",baseline:"auto",fontSize:12,fontWeight:600,color:r}));const[x,b]=o[c],v=5;for(let e=0;v>e;e++){const n=x+(b-x)*e/(v-1),s=l[t](n);f.push(O.createElement("line",{key:`pc-tick-${t}-${e}`,x1:m-3,x2:m+3,y1:s,y2:s,stroke:i,strokeWidth:1}),M({keyId:`pc-ticktext-${t}-${e}`,text:g(n),x:m+6,y:s+3,anchor:"start",baseline:"auto",fontSize:10,color:h}))}}b=O.createElement(O.Fragment,null,...f)}return{nodes:g.concat(x),overlays:b}};function C(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}function T(t){if(!t||"object"!=typeof t)return!1;const e=t;return"string"==typeof e.id&&(null==e.label||"string"==typeof e.label)&&"number"==typeof e.count&&Number.isFinite(e.count)&&Array.isArray(e.bodyIds)&&e.bodyIds.every(t=>"string"==typeof t)}function D(t,e){if("region-enter"!==e.type)return t;const i=e.region.id,n=C(t,i),s=T(n)?n:{id:i,label:e.region.label??i,count:0,bodyIds:[]};if(s.bodyIds.includes(e.bodyId))return t;const o=[...s.bodyIds,e.bodyId];return{...t,[i]:{...s,count:o.length,bodyIds:o}}}function $(t,e){return(e??Object.keys(t)).map(e=>C(t,e)).filter(T).map(t=>({label:t.label??t.id,value:t.count}))}function F(t,e){const i=e instanceof Set?e:new Set(e);return t.map(t=>{const e=t.bodyIds??[],n=e.filter(t=>!i.has(t)),s=e.length-n.length,o=t.completion?.mode??"allMembersAbsorbed",r=t.completion?.valueByBodyId,a=t=>{const e=r?C(r,t):void 0;return"number"==typeof e&&Number.isFinite(e)&&e>=0?e:1},c=e.reduce((t,e)=>t+a(e),0),l=e.reduce((t,e)=>t+(i.has(e)?a(e):0),0),d=t.completion?.threshold,h="threshold"===o?Number.isFinite(d)&&Number(d)>=0?Number(d):c:void 0;return{id:t.id,label:t.label??t.id,mode:o,complete:e.length>0&&("anyAbsorbed"===o?s>0:"threshold"===o?l>=(h??c):0===n.length),absorbed:s,total:e.length,absorbedValue:l,totalValue:c,threshold:h,missing:n}})}function N(t,e,i){return Math.max(e,Math.min(i,t))}function P(t,e,i,n,s,o={}){return{id:t,friction:o.friction,restitution:o.restitution,bodyFilter:o.bodyFilter,shape:{type:"segment",x1:e,y1:i,x2:n,y2:s,thickness:o.thickness??8}}}function L(t){const e=t.shape??"lane",i=Math.max(1,Math.round(t.width)),n=Math.max(1,Math.round(t.height)),s=t.padX??46,o=t.padY??72,r=s,a=i-s,c=o,l=n-Math.max(24,Math.round(.45*o)),d=(c+l)/2,h=Math.max(1,l-c),u=N(t.pinchRatio??.18,.06,.5),p=Number(t.pinchHeightOffset??0),f=Number.isFinite(p)?p:0,m=N(h*u+f,.06*h,.5*h),y=m/2,g=d-y,x=d+y,b=t.idPrefix??"process",v=t.friction??.58,w=t.restitution??.18,S=t.wallThickness??8,M=t.stages;if(!M.length)throw Error("processStageLayout requires at least one stage");const k=N(t.centerStageIndex??Math.floor(M.length/2),0,M.length-1),I=function(t){const e=t.reduce((t,e)=>t+(e.share??1),0);return e>0?e:t.length}(M),B=a-r;let O=r;const A=M.map((t,e)=>{const i=O,n=e===M.length-1?a:O+(t.share??1)/I*B;return O=n,{id:t.id,label:t.label,description:t.description,kind:t.kind??"stage",index:e,x0:i,x1:n,x:(i+n)/2,width:n-i,y:d,height:h}}),q=A[k],C=q.x0,T=q.x1,D=(t,i)=>{if("lane"===e)return"top"===i?c:l;if("funnel"===e){const e=N((t-r)/Math.max(1,a-r),0,1);return"top"===i?c+(g-c)*e:l+(x-l)*e}if(C>=t){const e=N((t-r)/Math.max(1,C-r),0,1);return"top"===i?c+(g-c)*e:l+(x-l)*e}if(T>=t)return"top"===i?g:x;const n=N((t-T)/Math.max(1,a-T),0,1);return"top"===i?g+(c-g)*n:x+(l-x)*n},$=A.map(t=>{const e=Math.min(D(t.x0,"top"),D(t.x1,"top")),i=Math.max(D(t.x0,"bottom"),D(t.x1,"bottom"));return{...t,y:(e+i)/2,height:Math.max(1,i-e)}}),F={thickness:S,friction:v,restitution:w},L=[];"lane"===e?L.push(P(b+"-top",r,c,a,c,F),P(b+"-bottom",r,l,a,l,F),P(b+"-left",r,c,r,l,{...F,thickness:Math.max(6,S-2)}),P(b+"-right",a,c,a,l,{...F,thickness:Math.max(6,S)})):"funnel"===e?L.push(P(b+"-top",r,c,a,g,F),P(b+"-bottom",r,l,a,x,F),P(b+"-left",r,c,r,l,{...F,thickness:Math.max(6,S-2)}),P(b+"-right",a,g,a,x,{...F,thickness:Math.max(6,S)})):L.push(P(b+"-left-top",r,c,C,g,F),P(b+"-left-bottom",r,l,C,x,F),P(b+"-center-top",C,g,T,g,F),P(b+"-center-bottom",C,x,T,x,F),P(b+"-right-top",T,g,a,c,F),P(b+"-right-bottom",T,x,a,l,F),P(b+"-left",r,c,r,l,{...F,thickness:Math.max(6,S-2)}),P(b+"-right",a,c,a,l,{...F,thickness:Math.max(6,S)}));const j=t.membraneDampingScale??.5,E=r,Y=Math.max(1,("bowtie"===e?C:a)-E),W=(t.membranes??[]).map(t=>{const e=E+N(t.offset,0,1)*Y,i=t.width??18+18*t.cost,n=h-16,s=d+.25*(t.wobble??0);return{...t,x:e,y:s,width:i,height:n}}),X=!1===t.includeMembraneRegions?[]:W.map(t=>R({id:t.id,label:t.label??t.id,description:t.description??(t.label??t.id)+" is a permeable region. It taxes energy and damps velocity while bodies overlap it.",x:t.x,y:t.y,width:t.width,height:t.height,cost:t.cost,dampingScale:t.dampingScale??j,bodyStyle:t.bodyStyle,metadata:t.metadata,semanticItem:t.semanticItem,color:t.color}));return{shape:e,width:i,height:n,padX:s,padY:o,left:r,right:a,topY:c,bottomY:l,midY:d,centerLeft:C,centerRight:T,pinchHeight:m,pinchTop:g,pinchBottom:x,stages:$,membranes:W,colliders:L,regionEffects:X,boundaryY:D}}function j(t){return{id:t.id,label:t.label,description:t.description,kind:t.kind,shape:(e=t.x,i=t.y,n=t.width,s=t.height,{type:"aabb",x:e,y:i,width:n,height:s}),bodyFilter:t.bodyFilter,collider:t.collider,colliderThickness:t.colliderThickness,friction:t.friction,restitution:t.restitution,semanticItem:t.semanticItem,metadata:t.metadata,bodyStyle:t.bodyStyle,attributes:t.attributes,onEnter:t.onEnter,onExit:t.onExit};var e,i,n,s}function E(t,e={}){const i=e.idPrefix??"stage",n=Math.max(0,e.insetX??0),s=Math.max(0,e.insetY??1);return t.stages.map(t=>{const o="function"==typeof e.metadata?e.metadata(t):e.metadata??{};return{...j({id:i?`${i}:${t.id}`:t.id,label:t.label??t.id,description:t.description,kind:"region",x:t.x,y:t.y,width:Math.max(1,t.width-2*n),height:Math.max(1,t.height-2*s),bodyFilter:e.bodyFilter,semanticItem:e.semanticItem,attributes:{primitive:"processStage",stageId:t.id,stageIndex:t.index},metadata:{...o,primitive:"processStage",stageId:t.id,stageIndex:t.index}})}})}function R(t){const e=t.dampingScale??.5,i=t.energyScale??1,n=N(t.cost,0,2);return{...j({...t,kind:t.kind??"membrane",attributes:{primitive:"membrane",membraneCost:n,..."object"==typeof t.attributes&&t.attributes?t.attributes:{}}}),damping:n*e,energyDelta:-n*i}}function Y(t){return{...j({...t,kind:t.kind??"charge-gate",attributes:{primitive:"chargeGate",..."object"==typeof t.attributes&&t.attributes?t.attributes:{}}}),charge:t.charge??!0,energyDelta:t.energyDelta,impulseOnEnter:t.impulseOnEnter}}function W(t){const e="number"==typeof t.force?{x:t.force,y:0}:t.force??{x:12,y:0};return{...j({...t,kind:t.kind??"force-field",attributes:{primitive:"routeSurface",..."object"==typeof t.attributes&&t.attributes?t.attributes:{}}}),force:e,damping:t.damping??.015}}function X(t){const e=t.pressure??t.occupancy??0,i=t.baseDamping??.08,n=t.dampingPerUnit??.12,s=t.energyPerUnit??0;return{...j({...t,kind:t.kind??"membrane",attributes:{primitive:"pressureField",pressure:e,..."object"==typeof t.attributes&&t.attributes?t.attributes:{}}}),damping:i+e*n,energyDelta:s?-e*s:void 0,force:t.force}}function z(t){const e="number"==typeof t.force?{x:t.force,y:0}:t.force;return{...j({...t,kind:t.kind??"force-field",attributes:{primitive:"capacitatedSensor",capacity:t.capacity,unitsPerSecond:t.unitsPerSecond??t.capacity,..."object"==typeof t.attributes&&t.attributes?t.attributes:{}}}),force:e,damping:t.damping,charge:t.charge??t.capacity}}function G(t){return{...j({...t,kind:t.kind??"force-field",attributes:{primitive:"portal",targetStage:t.targetStage,..."object"==typeof t.attributes&&t.attributes?t.attributes:{}}}),force:t.force,impulseOnEnter:t.impulseOnEnter,damping:t.damping??.08}}function K(t){const e="number"==typeof t.force?{x:t.force,y:0}:t.force??{x:24,y:0};return{...j({...t,kind:t.kind??"sink",attributes:{primitive:"absorb",..."object"==typeof t.attributes&&t.attributes?t.attributes:{}}}),force:e,damping:t.damping??.02,charge:t.charge??"absorbed"}}function U(t){return{...j({...t,kind:t.kind??"force-field",attributes:{primitive:"forceField",..."object"==typeof t.attributes&&t.attributes?t.attributes:{}}}),force:t.force,damping:t.damping,energyDelta:t.energyDelta}}function H(t){const e=t.x??t.anchor?.x??0,i=t.y??t.anchor?.y??0;return{id:t.id,label:t.label,description:t.description,group:t.group,bodyIds:t.bodyIds,datum:t.datum,state:t.state,x:e,y:i,width:t.width,height:t.height,anchor:t.anchor??{x:e,y:i},completion:t.completion,tether:t.tether,semanticItem:t.semanticItem}}function _(t){const e=t.idPrefix??"lane",i={thickness:t.thickness??8,friction:t.friction??.5,restitution:t.restitution??.16},n=[P(e+"-top",t.left,t.top,t.right,t.top,i),P(e+"-bottom",t.left,t.bottom,t.right,t.bottom,i)];return t.openEnds||n.push(P(e+"-left",t.left,t.top,t.left,t.bottom,i),P(e+"-right",t.right,t.top,t.right,t.bottom,i)),n}import{Fragment as V,jsx as Q,jsxs as Z}from"react/jsx-runtime";var J={flow:{fill:"rgba(59, 130, 246, 0.14)",stroke:"rgba(96, 165, 250, 0.7)",accent:"#60a5fa"},capacity:{fill:"rgba(251, 146, 60, 0.18)",stroke:"rgba(251, 146, 60, 0.85)",accent:"#fb923c"},portal:{fill:"rgba(244, 114, 182, 0.14)",stroke:"rgba(244, 114, 182, 0.7)",accent:"#f472b6"},absorb:{fill:"rgba(52, 211, 153, 0.18)",stroke:"rgba(52, 211, 153, 0.8)",accent:"#34d399"}};function tt(t,e,i){return Math.max(e,Math.min(i,t))}function et(t){return 6.2*t.length}function it(t,e){const i=t.trim();if(e>=i.length)return i;if(1>=e)return i.slice(0,1);const n=i.split(/\s+/).filter(Boolean).map(t=>t[0]).join("").toUpperCase();return n.length>1&&e>=n.length?n:e>3?i.slice(0,Math.max(1,e-2))+"..":i.slice(0,e).toUpperCase()}function nt(t,e,i="auto"){const n=Math.max(1,Math.floor(e/6.2)),s="compact"===i?it(t,n):"full"===i?t:et(t)>e?it(t,n):t;return{text:s,textLength:et(s)>e?Math.max(4,e):void 0}}function st(t,e={}){const{showFlowSpine:i=!0,showStageCounts:n=!0,showCapacityBadges:s=!0,showGroupSockets:o=!0,stageLabelMode:r="auto",outlineStages:a=!1,testId:c="process-flow-chrome"}=e,{width:l,height:d,left:h,right:u,topY:p,bottomY:f,midY:m,stages:y,groups:g=[]}=t,x=f-p;return Z("svg",{"aria-hidden":"true","data-testid":c,"data-outline-stages":a?"true":void 0,width:l,height:d,viewBox:`0 0 ${l} ${d}`,style:{position:"absolute",inset:0,pointerEvents:"none"},className:["semiotic-process-chrome",a?"semiotic-process-chrome--outline-stages":null].filter(Boolean).join(" "),children:[Q("defs",{children:Z("linearGradient",{id:"semiotic-process-floor",x1:"0",x2:"0",y1:"0",y2:"1",children:[Q("stop",{offset:"0%",stopColor:"var(--semiotic-process-floor, var(--semiotic-bg, #0f172a))",stopOpacity:"0.2"}),Q("stop",{offset:"100%",stopColor:"var(--semiotic-process-lane, var(--semiotic-surface, #1e293b))",stopOpacity:"0.55"})]})}),Q("rect",{x:0,y:0,width:l,height:d,fill:"url(#semiotic-process-floor)"}),Q("rect",{x:h-6,y:p-8,width:u-h+12,height:x+16,rx:14,fill:"var(--semiotic-process-lane, var(--semiotic-surface, #111827))",fillOpacity:.45,stroke:"var(--semiotic-process-border, var(--semiotic-border, #334155))",strokeOpacity:.95}),i?Q("line",{x1:h+8,x2:u-8,y1:m,y2:m,stroke:"var(--semiotic-process-border, var(--semiotic-border, #475569))",strokeWidth:2,strokeDasharray:"6 8",opacity:.55}):null,y.map((t,e)=>{const i=function(t){return t.absorb?"absorb":t.portalTarget?"portal":null!=t.capacity?"capacity":"flow"}(t),o=J[i],c=Math.max(12,t.width-8),l=tt(c-8,22,88),h=nt(t.label,Math.max(8,l-10),r),u="none"!==r&&c-8>=22,g=function(t){if(null!=t.capacity){const e=null!=t.queueDepth?" · q "+t.queueDepth:"";return t.capacityLabel?`${t.capacityLabel}${e}`:`cap ${Number.isInteger(t.capacity)?t.capacity+"":t.capacity.toFixed(1)}${e}`}return t.absorb?"absorb":t.portalTarget?"portal":"flow"}(t),b=nt(g,Math.max(16,c-10),"auto"),v=s&&!1!==t.showBadge&&c>=32,w=null!=t.count?`n=${t.count}${null!=t.processed?" done "+t.processed:""}`:"",S=nt(w,Math.max(16,c-8),"auto"),M=Math.max(30,p-15),k=M-13;return Z("g",{"data-stage":t.id,"data-role":i,children:[Q("rect",{className:"semiotic-process-chrome__stage-bay",x:t.x0+4,y:p+6,width:c,height:x-12,rx:10,fill:a?"none":o.fill,stroke:o.stroke,strokeWidth:a?1.85:"flow"===i?1:1.6}),y.length-1>e?Q("polygon",{points:`${t.x1-2},${m-7} ${t.x1+8},${m} ${t.x1-2},${m+7}`,fill:o.accent,opacity:.85}):null,u?Z(V,{children:[Q("rect",{className:"semiotic-process-chrome__stage-label-bg",x:t.x-l/2,y:k,width:l,height:18,rx:9,fill:"var(--semiotic-bg, #0f172a)",fillOpacity:.75,stroke:o.stroke}),Z("text",{x:t.x,y:M,textAnchor:"middle",fill:o.accent,fontSize:10,fontWeight:800,className:"semiotic-process-chrome__stage-label",textLength:h.textLength,lengthAdjust:h.textLength?"spacingAndGlyphs":void 0,children:[Q("title",{children:t.label}),h.text]})]}):null,v?Z("text",{x:t.x,y:p+22,textAnchor:"middle",fill:"var(--semiotic-process-muted, var(--semiotic-text-secondary, #94a3b8))",fontSize:9,fontWeight:700,textLength:b.textLength,lengthAdjust:b.textLength?"spacingAndGlyphs":void 0,children:[Q("title",{children:g}),b.text]}):null,n&&null!=t.count?Z("text",{x:t.x,y:Math.min(d-8,f+16),textAnchor:"middle",fill:"var(--semiotic-process-text, var(--semiotic-text, #e2e8f0))",fontSize:11,fontWeight:800,textLength:S.textLength,lengthAdjust:S.textLength?"spacingAndGlyphs":void 0,children:[Q("title",{children:w}),S.text]}):null]},t.id)}),o?g.map((t,e)=>{const i=t.total??0,n=t.absorbed??0,s=t.complete??(i>0&&n>=i),o=!s&&i>0&&n/i>=.75,r=s?"rgba(52, 211, 153, 0.35)":o?"rgba(251, 191, 36, 0.28)":"rgba(15, 23, 42, 0.75)",a=s?"#34d399":o?"#fbbf24":"var(--semiotic-border, #64748b)",c=i>0?`${n}/${i}${s?" shipped":o?" almost":""}`:"feature "+(e+1),l=tt(Math.max(54,et(t.label)+18,et(c)+16),54,104),d=nt(t.label,l-12,"auto"),h=nt(c,l-12,"auto");return Z("g",{"data-group":t.id,children:[Q("rect",{x:t.x-l/2,y:t.y-22,width:l,height:44,rx:10,fill:r,stroke:a,strokeWidth:1.5}),Z("text",{x:t.x,y:t.y-4,textAnchor:"middle",fill:"var(--semiotic-process-text, var(--semiotic-text, #f8fafc))",fontSize:10,fontWeight:800,textLength:d.textLength,lengthAdjust:d.textLength?"spacingAndGlyphs":void 0,children:[Q("title",{children:t.label}),d.text]}),Z("text",{x:t.x,y:t.y+12,textAnchor:"middle",fill:a,fontSize:9,fontWeight:700,textLength:h.textLength,lengthAdjust:h.textLength?"spacingAndGlyphs":void 0,children:[Q("title",{children:c}),h.text]})]},t.id)}):null]})}import{symbol as ot,symbolCircle as rt,symbolCross as at,symbolDiamond as ct,symbolSquare as lt,symbolStar as dt,symbolTriangle as ht,symbolWye as ut}from"d3-shape";var pt={circle:rt,square:lt,triangle:ht,diamond:ct,star:dt,cross:at,wye:ut},ft=new Set(["circle","square","triangle","diamond","star","cross","wye","chevron"]),mt=["circle","triangle","diamond","star","square","chevron","cross","wye"];function yt(t,e,i){if(i)return i;const n=t??"circle";if("chevron"===n)return function(t){const e=1.5*gt(t),i=.92*e;return`M0,${-e}L${i},${(.78*e).toFixed(3)}L0,${(.28*e).toFixed(3)}L${-i},${(.78*e).toFixed(3)}Z`}(e);const s=Object.prototype.hasOwnProperty.call(pt,n)?pt[n]:rt;return ot(s,Math.max(1,e))()??""}function gt(t){return Math.sqrt(Math.max(1,t)/Math.PI)}var xt=new Map;function bt(t,e,i){if(!i&&"circle"===(t??"circle"))return gt(e);const n=i?"p:"+i:`${t}:${Math.round(e)}`,s=xt.get(n);if(null!=s)return s;const o=(i??yt(t,e)).match(/-?\d*\.?\d+(?:e-?\d+)?/gi);let r=0;if(o)for(let t=0;o.length>t+1;t+=2){const e=+o[t],i=+o[t+1],n=Math.sqrt(e*e+i*i);n>r&&(r=n)}return r>0||(r=gt(e)),xt.size>512&&xt.clear(),xt.set(n,r),r}function vt(t,e){const i=new Map;let n=0;return s=>{const o=t(s)+"",r=e&&Object.prototype.hasOwnProperty.call(e,o)?e[o]:void 0;if(r&&ft.has(r))return r;let a=i.get(o);return a||(a=mt[n%mt.length],n++,i.set(o,a)),a}}var wt=[40,40],St=[.5,.5];function Mt(t,e){const[i,n]=t.viewBox??wt,[s,o]=t.anchor??St,r=n>0?n:1,a=Math.max(0,e)/r,c=(i>0?i:r)*a,l=r*a;return{width:c,height:l,scale:a,offsetX:-s*c,offsetY:-o*l}}function kt(t,e){const i=Mt(t,e),n=[[i.offsetX,i.offsetY],[i.offsetX+i.width,i.offsetY],[i.offsetX,i.offsetY+i.height],[i.offsetX+i.width,i.offsetY+i.height]];let s=0;for(const[t,e]of n){const i=Math.sqrt(t*t+e*e);i>s&&(s=i)}return s}function It(t,e,i,n){if("none"!==t)return"color"===t||null==t?e??n:"accent"===t?i:t}var Bt=null;function Ot(t){if("undefined"==typeof Path2D)return null;Bt||(Bt=new Map);const e=Bt.get(t);if(e)return e;const i=new Path2D(t);return Bt.size>1024&&Bt.clear(),Bt.set(t,i),i}function At(t,e,i=0,n="horizontal"){const[s,o]=t.viewBox??wt,r=Math.min(1,Math.max(0,i)),a=Math.min(1,Math.max(0,e));return a>r?r>0||1>a?"vertical"===n?{x:0,y:o*(1-a),width:s,height:o*(a-r)}:{x:s*r,y:0,width:s*(a-r),height:o}:null:{x:0,y:0,width:0,height:0}}function qt(t,e){const i=Mt(t,e);return{centerDx:i.offsetX+i.width/2,centerDy:i.offsetY+i.height/2,halfWidth:i.width/2,halfHeight:i.height/2,radius:Math.hypot(i.width,i.height)/2}}function Ct(t,e,i,n,s,o=t=>t){for(const r of e.parts){const e=Ot(r.d);if(!e)continue;const a=r.opacity??1,c=t.globalAlpha;1!==a&&(t.globalAlpha=c*a);const l=s?"none"===r.fill?void 0:s:It(r.fill,i,n);l&&(t.fillStyle=o(l),t.fill(e));const d=s?r.stroke&&"none"!==r.stroke?s:void 0:It(r.stroke??"none",i,n);d&&(t.strokeStyle=o(d),t.lineWidth=r.strokeWidth??1,t.lineCap=r.strokeLinecap??"butt",t.lineJoin=r.strokeLinejoin??"miter",t.stroke(e)),1!==a&&(t.globalAlpha=c)}}function Tt(t,e){const i=e.scales?.x??e.scales?.time;return i?null!=t.x?i(t.x):e.xAccessor&&null!=t[e.xAccessor]?i(t[e.xAccessor]):null:null}function Dt(t,e){const i=e.scales?.y??e.scales?.value;return i?null!=t.y?i(t.y):e.yAccessor&&null!=t[e.yAccessor]?i(t[e.yAccessor]):null:null}function $t(t){return null==t?null:t+""}function Ft(t,e,i){return e.stickyPositionCache?.set(t,i),i}function Nt(t,e,i){const n=t.anchor||t.lifecycle?.anchor||"fixed";if("latest"===n){if(null!=t.pointId&&i.pointNodes&&i.pointNodes.length>0)for(let n=i.pointNodes.length-1;n>=0;n--){const s=i.pointNodes[n];if(s.pointId===t.pointId)return Ft(e,i,{x:s.x,y:s.y})}const n=function(t){const e=t.data;if(!e||0===e.length)return null;const i=e[e.length-1],n=t.scales?.x??t.scales?.time,s=t.scales?.y??t.scales?.value;if(!n||!s)return null;const o=i[t.xAccessor||"x"],r=i[t.yAccessor||"y"];return null==o||null==r?null:{x:n(o),y:s(r)}}(i);return n?Ft(e,i,n):null}if("semantic"===n){const n=function(t,e,i){const n=function(t){return $t(t.provenance?.stableId??t.stableId)}(t);if(!n)return null;const s=i.pointNodes?.find(t=>$t(t.pointId)===n);if(s)return Ft(e,i,{x:s.x,y:s.y});const o=i.data?.find(t=>function(t){return $t(t.stableId??t.id??t.provenance?.stableId)}(t)===n);if(!o)return null;const r=Tt(o,i),a=Dt(o,i);return null==r||null==a?null:Ft(e,i,{x:r,y:a})}(t,e,i);if(n)return n}let s=null,o=null;if(null!=t.pointId&&i.pointNodes){const e=i.pointNodes.find(e=>e.pointId===t.pointId);e&&(s=e.x,o=e.y)}if(null!=s&&null!=o||(s=Tt(t,i),o=Dt(t,i)),null!=s&&null!=o)return Ft(e,i,{x:s,y:o});if("sticky"===n){const t=i.stickyPositionCache?.get(e);if(t)return t}return null}function Pt(t,e,i,n=50){return!(-n>t||t>(i.width||0)+n||-n>e||e>(i.height||0)+n)}var Lt=32,jt=6,Et=4,Rt=8,Yt=72;var Wt={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"};function Xt(t){if(!zt(t))return t;const e=("string"==typeof t.mobileText?t.mobileText:void 0)??("string"==typeof t.shortText?t.shortText:void 0);return!e||"string"!=typeof t.label&&null!=t.label?t:{...t,label:e}}function zt(t){return s(t)}function Gt(t,e){if(!t)return[];const i=Math.max(1,Math.floor(e/7)),n=t.split(/\s+/).filter(Boolean),s=[];let o="";for(const t of n)o&&o.length+t.length+1>i?(s.push(o),o=t):o=o?`${o} ${t}`:t;return o&&s.push(o),s}function Kt(t,e,i,n,s){const o=t+i,r=e+n;return Math.abs(i)>Math.abs(n)?{x:0>i?o-s.width-4:o+4,y:0>n?r-s.height:r,width:s.width,height:s.height}:{x:0>i?o-s.width:o,y:0>n?r-s.height-4:r+4,width:s.width,height:s.height}}function Ut(t,e){return{x:t.x-e,y:t.y-e,width:t.width+2*e,height:t.height+2*e}}function Ht(t,e){return Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x))*Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y))}function _t(t,e,i,n,s,o,r,a){const c=Ut(t,r);let l=.4*Math.hypot(e.dx,e.dy)+80*function(t,e,i,n){const s=Math.max(0,n-t.x),o=Math.max(0,n-t.y);return(s+Math.max(0,t.x+t.width-(e-n)))*t.height+(o+Math.max(0,t.y+t.height-(i-n)))*t.width}(c,s,o,a);for(const t of i)l+=12*Ht(c,t);for(const t of n)l+=4*Ht(c,t);return l}function Vt(i){const{annotations:n,context:s,defaultOffset:o=Lt,notePadding:r=jt,markPadding:a=Et,edgePadding:c=Rt,preserveManualOffsets:l=!0,routeLongConnectors:d=!0,connectorThreshold:h=Yt,density:u,progressiveDisclosure:p=!1,redundantCues:f=!1,responsive:m,mobile:y,cohesion:g,audience:x}=i,b=s.width||0,v=s.height||0,w="object"==typeof y?y:{},S=w.breakpoint??480,M=!!y&&S>=b,k=M&&!1!==w.preferShortText?n.map(Xt):n,I=M&&!u?{maxAnnotations:w.maxAnnotations??("callout-list"===w.strategy?1:2),minVisible:w.minVisible??1}:u,B=p||M&&(!1!==w.progressiveDisclosure||"callout-list"===w.strategy),O=M&&!m?w.responsive??{minWidth:S}:m,A=M&&!g?w.cohesion:g;if(0===k.length||0>=b||0>=v)return k.slice();const q=[],C=function(t,e){return(t.pointNodes||[]).map(t=>{const i=Math.max(1,t.r||1)+e;return{x:t.x-i,y:t.y-i,width:2*i,height:2*i}})}(s,a);let T=!1;const D=k.map((t,e)=>{if(!zt(t))return t;const i=function(t,e,i){if("widget"===t.type&&"number"==typeof t.px&&"number"==typeof t.py)return{x:t.px,y:t.py};const n=t.pointId??t.nodeId;if(null!=n&&i.pointNodes){const t=i.pointNodes.find(t=>t.pointId===n);if(t)return{x:t.x,y:t.y}}const s=t.coordinates,o=i.scales?.geoProjection;if(Array.isArray(s)&&s.length>=2&&o){const t=s[0],e=s[1];if("number"==typeof t&&"number"==typeof e){const i=o([t,e]);if(i&&"number"==typeof i[0]&&"number"==typeof i[1])return{x:i[0],y:i[1]}}}return i.scales||"number"!=typeof t.x||"number"!=typeof t.y?Nt(t,e,i):{x:t.x,y:t.y}}(t,e,s);if(!i)return t;const n=function(t){if("widget"===t.type)return{width:"number"==typeof t.width?t.width:32,height:"number"==typeof t.height?t.height:32};const e="number"==typeof t.wrap?t.wrap:120,i=[...Gt("string"==typeof t.title?t.title:void 0,e),...Gt("string"==typeof t.label?t.label:void 0,e)],n=i.reduce((t,e)=>Math.max(t,e.length),0);return{width:Math.max(24,Math.min(e,7*n)+10),height:Math.max(18,16*i.length+6)}}(t);if(l&&("number"==typeof(a=t).dx||"number"==typeof a.dy)){const e=function(t){return"text"===t.type||"widget"===t.type?{dx:0,dy:0}:{dx:30,dy:-30}}(t);return q.push(Ut(Kt(i.x,i.y,"number"==typeof t.dx?t.dx:e.dx,"number"==typeof t.dy?t.dy:e.dy,n),r)),t}var a;let u=null,p=1/0;for(const t of function(t){const e=1.6*t;return[{dx:t,dy:-t},{dx:-t,dy:-t},{dx:t,dy:t},{dx:-t,dy:t},{dx:t,dy:0},{dx:-t,dy:0},{dx:0,dy:-t},{dx:0,dy:t},{dx:e,dy:-e},{dx:-e,dy:-e},{dx:e,dy:e},{dx:-e,dy:e}]}(o)){const e=_t(Kt(i.x,i.y,t.dx,t.dy,n),t,q,C,b,v,r,c);p>e&&(u=t,p=e)}if(!u)return t;const f=Ut(Kt(i.x,i.y,u.dx,u.dy,n),r);q.push(f);const m=Math.hypot(u.dx,u.dy),y=d&&m>=h&&"text"!==t.type&&"widget"!==t.type?{...t.connector||{end:"arrow"},type:"curve"}:t.connector;return T=!0,{...t,dx:u.dx,dy:u.dy,...y?{connector:y}:{}}}),$=T?D:k.slice();let F=$;if(f){let t=!1;const e=$.map(e=>{const i=function(t){return"text"!==t.type||"string"!=typeof t.color||8>Math.hypot("number"==typeof t.dx?t.dx:0,"number"==typeof t.dy?t.dy:0)?t:{...t,_redundantConnector:!0}}(e);return i!==e&&(t=!0),i});F=t?e:$}{let t=!1;const e=F.map(e=>{if(!0!==e?.defensive)return e;const i=function(t){const e=t?.provenance;if(!e||"object"!=typeof e)return t;const i="string"==typeof e.source?Object.prototype.hasOwnProperty.call(Wt,e.source)?Wt[e.source]:e.source:null,n="number"==typeof e.confidence&&Number.isFinite(e.confidence)?Math.round(100*Math.max(0,Math.min(1,e.confidence)))+"%":null;if(!i&&!n)return t;if(null!=t.label&&"string"!=typeof t.label)return t;const s=[i,n].filter(Boolean).join(" · "),o="string"==typeof t.label?t.label:"";return o.includes(`(${s})`)?t:{...t,label:o?`${o} (${s})`:`(${s})`}}(e);return i!==e&&(t=!0),i});F=t?e:F}const N=new Set;if(I){const i="object"==typeof I?I:{},n=function(t){if(!t)return 1;const e=function(t){const e=t?.familiarity;if(!e)return 3;const i=Object.values(e).filter(t=>"number"==typeof t&&Number.isFinite(t));return 0===i.length?3:i.reduce((t,e)=>t+e,0)/i.length}(t);return e>2?4>e?1:.6:1.5}(x),s=1===n?i:{...i,maxAnnotations:Math.max(0,Math.round((i.maxAnnotations??t(b,v,i))*n))},{deferred:o}=e({annotations:F,width:b,height:v,...s});for(const t of o)N.add(t)}if(O&&("object"==typeof O&&"number"==typeof O.minWidth?O.minWidth:480)>=b)for(const t of F)zt(t)&&"secondary"===t.emphasis&&N.add(t);if(N.size>0)for(const t of F)!0===t?.defensive&&N.delete(t);let P;return P=0===N.size?F:B?F.map(t=>N.has(t)?{...t,_annotationDeferred:!0}:t):F.filter(t=>!N.has(t)),A?function(t,e){let i=!1;const n=t.map(t=>zt(t)?"blended"===t.cohesion||"layer"===t.cohesion?t:(i=!0,{...t,cohesion:e}):t);return i?n:t}(P,A):P}import*as Qt from"react";import{jsx as Zt}from"react/jsx-runtime";var Jt,te={isActive:!1,predicate:()=>!0};function ee(){const t=(Jt??(Jt=Qt.createContext(null)),Jt);return Qt.useContext(t)??te}var ie={seed:1,gravity:{x:0,y:980},fixedDt:1/120,cellSize:64,collisionIterations:6,velocityDamping:.995,sleepSpeed:8,sleepAfter:.35,restitution:.1,friction:.35,maxVelocity:1600,contactWakeSpeed:200},ne=1e-9,se=.005;function oe(t){return"circle"===t.type?{type:"circle",radius:t.radius}:{type:"aabb",width:t.width,height:t.height}}function re(t){return"aabb"===t.type?{type:"aabb",x:t.x,y:t.y,width:t.width,height:t.height}:{type:"segment",x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,thickness:t.thickness}}function ae(t,e,i){return Math.max(e,Math.min(i,t))}function ce(t,e,i){return Math.min(t??i,e??i)}function le(t,e,i){return ae(Math.max(t??i,e??i),0,1)}function de(t){return 0>t?-1:1}function he(t){if("circle"===t.shape.type){const e=t.shape.radius;return{minX:t.x-e,minY:t.y-e,maxX:t.x+e,maxY:t.y+e}}const e=t.shape.width/2,i=t.shape.height/2;return{minX:t.x-e,minY:t.y-i,maxX:t.x+e,maxY:t.y+i}}function ue(t){const e=t.shape;if("aabb"===e.type){const t=e.width/2,i=e.height/2;return{minX:e.x-t,minY:e.y-i,maxX:e.x+t,maxY:e.y+i}}const i=(e.thickness??0)/2;return{minX:Math.min(e.x1,e.x2)-i,minY:Math.min(e.y1,e.y2)-i,maxX:Math.max(e.x1,e.x2)+i,maxY:Math.max(e.y1,e.y2)+i}}function pe(t,e){return!(t.minX>e.maxX||e.minX>t.maxX||t.minY>e.maxY||e.minY>t.maxY)}function fe(t,e,i,n,s,o,r,a){const c=s-t,l=(i+r)/2-Math.abs(c);if(0>=l)return null;const d=o-e,h=(n+a)/2-Math.abs(d);return h>0?h>l?{nx:de(c),ny:0,penetration:l}:{nx:0,ny:de(d),penetration:h}:null}function me(t,e,i,n,s,o,r){const a=o/2,c=r/2,l=t-ae(t,n-a,n+a),d=e-ae(e,s-c,s+c),h=l*l+d*d;if(h>i*i)return null;if(ne>=h){const o=Math.abs(t-(n-a)),r=Math.abs(t-(n+a)),l=Math.abs(e-(s-c)),d=Math.abs(e-(s+c)),h=Math.min(o,r,l,d);return h===o?{nx:-1,ny:0,penetration:i+o}:h===r?{nx:1,ny:0,penetration:i+r}:h===l?{nx:0,ny:-1,penetration:i+l}:{nx:0,ny:1,penetration:i+d}}const u=Math.sqrt(h);return{nx:l/u,ny:d/u,penetration:i-u}}function ye(t,e){if("circle"===t.shape.type&&"circle"===e.shape.type)return function(t,e,i,n,s,o){const r=n-t,a=s-e,c=i+o,l=r*r+a*a;if(l>=c*c)return null;if(ne>=l)return{nx:1,ny:0,penetration:c};const d=Math.sqrt(l);return{nx:r/d,ny:a/d,penetration:c-d}}(t.x,t.y,t.shape.radius,e.x,e.y,e.shape.radius);if("aabb"===t.shape.type&&"aabb"===e.shape.type)return fe(t.x,t.y,t.shape.width,t.shape.height,e.x,e.y,e.shape.width,e.shape.height);if("circle"===t.shape.type&&"aabb"===e.shape.type){const i=me(t.x,t.y,t.shape.radius,e.x,e.y,e.shape.width,e.shape.height);return i?{nx:-i.nx,ny:-i.ny,penetration:i.penetration}:null}return"aabb"===t.shape.type&&"circle"===e.shape.type?me(e.x,e.y,e.shape.radius,t.x,t.y,t.shape.width,t.shape.height):null}function ge(t,e){const i=e.shape;return"aabb"===i.type?"circle"===t.shape.type?me(t.x,t.y,t.shape.radius,i.x,i.y,i.width,i.height):fe(i.x,i.y,i.width,i.height,t.x,t.y,t.shape.width,t.shape.height):function(t,e,i,n,s,o,r,a=0){const c=o-n,l=r-s,d=c*c+l*l,h=d>ne?ae(((t-n)*c+(e-s)*l)/d,0,1):0,u=i+a/2,p=t-(n+c*h),f=e-(s+l*h),m=p*p+f*f;if(m>=u*u)return null;if(ne>=m){const t=Math.sqrt(d);return t>ne?{nx:-l/t,ny:c/t,penetration:u}:{nx:1,ny:0,penetration:u}}const y=Math.sqrt(m);return{nx:p/y,ny:f/y,penetration:u-y}}(t.x,t.y,"circle"===t.shape.type?t.shape.radius:Math.sqrt(t.shape.width*t.shape.width+t.shape.height*t.shape.height)/2,i.x1,i.y1,i.x2,i.y2,i.thickness??0)}function xe(t,e){return`${t}\0${e}`}function be(t){const e=t.indexOf("\0");return{sensorId:t.slice(0,e),bodyId:t.slice(e+1)}}function ve(t){return{id:t.id,x:t.x,y:t.y,prevX:t.prevX,prevY:t.prevY,vx:t.vx,vy:t.vy,angle:t.angle,mass:t.mass,bodyCollisions:t.bodyCollisions,shape:oe(t.shape),sleeping:t.sleeping,datum:t.datum,index:t.index,sleepTime:t.sleepTime,restitution:t.restitution,friction:t.friction}}function we(t){return t&&"function"!=typeof t?{property:t.property,equals:t.equals,notEquals:t.notEquals,oneOf:t.oneOf?.slice(),notOneOf:t.notOneOf?.slice()}:t}function Se(t){return{id:t.id,shape:re(t.shape),sensor:t.sensor,restitution:t.restitution,friction:t.friction,bodyFilter:we(t.bodyFilter),index:t.index}}function Me(t,e){if(!e)return;let i=t;for(const t of e.split(".")){if(null==i||"object"!=typeof i)return;if(!Object.prototype.hasOwnProperty.call(i,t))return;i=i[t]}return i}function ke(t,e){return!!e?.some(e=>Object.is(t,e))}function Ie(t,e){if(!e)return!0;if("function"==typeof e)return e(t);const i=Me(t,e.property);return!("equals"in e&&!Object.is(i,e.equals)||"notEquals"in e&&Object.is(i,e.notEquals)||e.oneOf&&!ke(i,e.oneOf)||e.notOneOf&&ke(i,e.notOneOf))}function Be(t,e){return Ie(e,t.bodyFilter)}var Oe=class{constructor(t={}){this.capabilities={determinism:"strict",sensors:!0,joints:!1,ccd:!1,maxBodiesHint:5e3,worker:!1},this.bodies=new Map,this.colliders=new Map,this.springs=new Map,this.activeSensors=new Set,this.supportedThisStep=new Set,this.lastEvents=[],this.nextBodyIndex=0,this.nextColliderIndex=0,this.nextSpringIndex=0,this.options={...ie,...t},this.random=n(this.options.seed)}init(t={}){this.options={...ie,...t},this.random=n(this.options.seed),this.bodies.clear(),this.colliders.clear(),this.springs.clear(),this.activeSensors.clear(),this.lastEvents=[],this.nextBodyIndex=0,this.nextColliderIndex=0,this.nextSpringIndex=0}spawn(t){const e={id:t.id,x:t.x,y:t.y,prevX:t.x,prevY:t.y,vx:t.vx??0,vy:t.vy??0,angle:t.angle??0,mass:Math.max(ne,t.mass??1),bodyCollisions:t.bodyCollisions??!0,shape:oe(t.shape),sleeping:!1,datum:t.datum,restitution:t.restitution,friction:t.friction,index:this.nextBodyIndex,sleepTime:0};this.nextBodyIndex+=1,this.bodies.set(t.id,e)}remove(t){for(const e of t){this.bodies.delete(e);for(const t of Array.from(this.activeSensors))be(t).bodyId===e&&this.activeSensors.delete(t)}}setColliders(t){this.colliders.clear(),this.activeSensors.clear(),this.nextColliderIndex=0;for(const e of t)this.colliders.set(e.id,{...e,shape:re(e.shape),bodyFilter:we(e.bodyFilter),index:this.nextColliderIndex}),this.nextColliderIndex+=1}setConstraint(t){const e=t.id??"spring-"+this.nextSpringIndex;return this.springs.set(e,{id:e,bodyId:t.bodyId,target:t.target,restLength:t.restLength??0,stiffness:t.stiffness??40,damping:t.damping??3}),this.nextSpringIndex+=1,e}removeConstraint(t){this.springs.delete(t)}applyImpulse(t,e,i){const n=this.bodies.get(t);n&&(n.vx+=e/n.mass,n.vy+=i/n.mass,this.wake(n))}step(t=this.options.fixedDt){const e=Math.max(0,t);if(this.lastEvents=[],0===e)return;const i=this.sortedBodies();for(const t of i)t.prevX=t.x,t.prevY=t.y;this.applySprings(e);const n=this.options.maxVelocity;for(const t of i)if(!t.sleeping){if(t.vx+=this.options.gravity.x*e,t.vy+=this.options.gravity.y*e,t.vx*=this.options.velocityDamping,t.vy*=this.options.velocityDamping,n>0){const e=Math.sqrt(t.vx*t.vx+t.vy*t.vy);if(e>n){const i=n/e;t.vx*=i,t.vy*=i}}t.x+=t.vx*e,t.y+=t.vy*e}this.supportedThisStep.clear();const s=this.bodyPairKeys(i),o=this.sortedColliders().filter(t=>!t.sensor);for(let t=0;this.options.collisionIterations>t;t+=1)this.resolveBodyPairs(i,s,0===t),this.resolveColliders(i,o,0===t);this.updateSensors(i),this.updateSleeping(i,e)}settle(t=1200,e=this.options.fixedDt){let i=0;for(;t>i&&!this.allSleeping();)this.step(e),i+=1;return i}readState(t=[]){t.length=0;for(const e of this.sortedBodies())t.push({id:e.id,x:e.x,y:e.y,prevX:e.prevX,prevY:e.prevY,vx:e.vx,vy:e.vy,angle:e.angle,mass:e.mass,shape:oe(e.shape),sleeping:e.sleeping,datum:e.datum});return t}events(){return this.lastEvents.slice()}activeSensorPairs(){return Array.from(this.activeSensors).sort().map(be)}allSleeping(){for(const t of this.bodies.values())if(!t.sleeping)return!1;return!0}snapshot(){return{options:{...this.options,gravity:{...this.options.gravity}},bodies:this.sortedBodies().map(ve),colliders:this.sortedColliders().map(Se),springs:Array.from(this.springs.values()).map(t=>({...t,target:{...t.target}})),activeSensors:Array.from(this.activeSensors).sort()}}restore(t){this.options={...t.options,gravity:{...t.options.gravity}},this.random=n(this.options.seed),this.bodies.clear(),this.colliders.clear(),this.springs.clear(),this.activeSensors=new Set(t.activeSensors),this.lastEvents=[],this.nextBodyIndex=0;for(const e of t.bodies){const t=ve(e);this.bodies.set(t.id,t),this.nextBodyIndex=Math.max(this.nextBodyIndex,t.index+1)}this.nextColliderIndex=0;for(const e of t.colliders){const t=Se(e);this.colliders.set(t.id,t),this.nextColliderIndex=Math.max(this.nextColliderIndex,t.index+1)}this.nextSpringIndex=0;for(const e of t.springs){this.springs.set(e.id,{...e,target:{...e.target}});const t=/^spring-(\d+)$/.exec(e.id);t&&(this.nextSpringIndex=Math.max(this.nextSpringIndex,Number(t[1])+1))}}dispose(){this.bodies.clear(),this.colliders.clear(),this.springs.clear(),this.activeSensors.clear(),this.lastEvents=[]}sortedBodies(){return Array.from(this.bodies.values()).sort((t,e)=>t.index-e.index)}sortedColliders(){return Array.from(this.colliders.values()).sort((t,e)=>t.index-e.index)}applySprings(t){for(const e of Array.from(this.springs.values()).sort((t,e)=>t.id.localeCompare(e.id))){const i=this.bodies.get(e.bodyId);if(!i||i.sleeping)continue;const n="point"===e.target.type?e.target:this.bodies.get(e.target.bodyId);if(!n)continue;const s=n.x-i.x,o=n.y-i.y,r=Math.sqrt(s*s+o*o);if(ne>=r)continue;const a=s/r,c=o/r,l=(r-e.restLength)*e.stiffness+((("vx"in n?n.vx:0)-i.vx)*a+(("vy"in n?n.vy:0)-i.vy)*c)*e.damping;i.vx+=l*a*t/i.mass,i.vy+=l*c*t/i.mass}}resolveBodyPairs(t,e,i){for(const n of e){const[e,s]=n.split(":").map(Number),o=t[e],r=t[s];if(!o||!r)continue;const a=ye(o,r);a&&(this.resolveDynamicCollision(o,r,a),i&&this.lastEvents.push({type:"contact",bodyId:o.id,otherId:r.id,sensor:!1}))}}bodyPairKeys(t){const e=Math.max(1,this.options.cellSize),i=new Map;for(let n=0;t.length>n;n+=1){if(!1===t[n].bodyCollisions)continue;const s=he(t[n]),o=Math.floor(s.minX/e),r=Math.floor(s.maxX/e),a=Math.floor(s.minY/e),c=Math.floor(s.maxY/e);for(let t=o;r>=t;t+=1)for(let e=a;c>=e;e+=1){const s=`${t}:${e}`,o=i.get(s);o?o.push(n):i.set(s,[n])}}const n=new Set;for(const e of Array.from(i.keys()).sort()){const s=i.get(e)??[];s.sort((t,e)=>t-e);for(let e=0;s.length>e;e+=1)for(let i=e+1;s.length>i;i+=1){const o=s[e],r=s[i];!1!==t[o].bodyCollisions&&!1!==t[r].bodyCollisions&&pe(he(t[o]),he(t[r]))&&n.add(`${o}:${r}`)}}return Array.from(n).sort((t,e)=>{const[i,n]=t.split(":").map(Number),[s,o]=e.split(":").map(Number);return i===s?n-o:i-s})}resolveDynamicCollision(t,e,i){t.sleeping&&this.contactOpposesGravity(i.nx,i.ny)&&this.supportedThisStep.add(e.id),e.sleeping&&this.contactOpposesGravity(-i.nx,-i.ny)&&this.supportedThisStep.add(t.id);const n=t.sleeping?0:1/t.mass,s=e.sleeping?0:1/e.mass,o=n+s;if(ne>=o)return;const r=Math.max(0,i.penetration-se)/o;t.x-=i.nx*r*n,t.y-=i.ny*r*n,e.x+=i.nx*r*s,e.y+=i.ny*r*s;const a=(e.vx-t.vx)*i.nx+(e.vy-t.vy)*i.ny;if(a>0)return;const c=Math.abs(a),l=-(1+ce(t.restitution,e.restitution,this.options.restitution))*a/o,d=l*i.nx,h=l*i.ny;t.vx-=d*n,t.vy-=h*n,e.vx+=d*s,e.vy+=h*s,this.applyFriction(t,e,i,l,n,s),c>this.options.contactWakeSpeed&&(this.wake(t),this.wake(e))}applyFriction(t,e,i,n,s,o){const r=-i.ny,a=i.nx,c=(e.vx-t.vx)*r+(e.vy-t.vy)*a,l=s+o;if(ne>=Math.abs(c)||ne>=l)return;const d=le(t.friction,e.friction,this.options.friction),h=ae(-c/l,-n*d,n*d),u=h*r,p=h*a;t.vx-=u*s,t.vy-=p*s,e.vx+=u*o,e.vy+=p*o}resolveColliders(t,e,i){for(const n of t)for(const t of e){if(!Be(t,n))continue;if(!pe(he(n),ue(t)))continue;const e=ge(n,t);e&&(this.resolveStaticCollision(n,t,e),this.contactOpposesGravity(e.nx,e.ny)&&this.supportedThisStep.add(n.id),i&&this.lastEvents.push({type:"contact",bodyId:n.id,otherId:t.id,sensor:!1}))}}resolveStaticCollision(t,e,i){t.x+=i.nx*Math.max(0,i.penetration-se),t.y+=i.ny*Math.max(0,i.penetration-se);const n=t.vx*i.nx+t.vy*i.ny;if(0>n){const s=ce(t.restitution,e.restitution,this.options.restitution);t.vx-=(1+s)*n*i.nx,t.vy-=(1+s)*n*i.ny;const o=-i.ny,r=i.nx,a=t.vx*o+t.vy*r,c=le(t.friction,e.friction,this.options.friction);t.vx-=a*o*c,t.vy-=a*r*c}}updateSensors(t){const e=new Set,i=this.sortedColliders().filter(t=>t.sensor);for(const n of t){const t=he(n);for(const s of i){if(!Be(s,n))continue;if(!pe(t,ue(s)))continue;if(!ge(n,s))continue;const i=xe(s.id,n.id);e.add(i),this.activeSensors.has(i)||this.lastEvents.push({type:"sensor-enter",bodyId:n.id,sensorId:s.id})}}for(const t of Array.from(this.activeSensors).sort()){if(e.has(t))continue;const{sensorId:i,bodyId:n}=be(t);this.lastEvents.push({type:"sensor-exit",bodyId:n,sensorId:i})}this.activeSensors=e}updateSleeping(t,e){const i=Math.hypot(this.options.gravity.x,this.options.gravity.y)>1;for(const n of t)Math.sqrt(n.vx*n.vx+n.vy*n.vy)>=this.options.sleepSpeed||Math.sqrt((n.x-n.prevX)*(n.x-n.prevX)+(n.y-n.prevY)*(n.y-n.prevY))>=this.options.sleepSpeed*e||i&&!this.supportedThisStep.has(n.id)?n.sleeping?this.wake(n):n.sleepTime=0:(n.sleepTime+=e,n.sleeping||this.options.sleepAfter>n.sleepTime||(n.sleeping=!0,n.vx=0,n.vy=0,this.lastEvents.push({type:"sleep",bodyId:n.id})))}contactOpposesGravity(t,e){const{x:i,y:n}=this.options.gravity,s=Math.hypot(i,n);return 1e-9>=s||-.2>(t*i+e*n)/s}wake(t){t.sleeping&&this.lastEvents.push({type:"wake",bodyId:t.id}),t.sleeping=!1,t.sleepTime=0}nextRandom(){return this.random()}},Ae=["binId","targetBin","category","windowIndex","lane","group"];function qe(t,e){if(!Number.isFinite(e))return;t.count+=1,t.total+=e,t.min=Math.min(t.min,e),t.max=Math.max(t.max,e);const i=e-t.mean;t.mean+=i/t.count,t.m2+=i*(e-t.mean)}function Ce(t){return{count:t.count,total:t.total,mean:t.count>0?t.mean:0,min:t.count>0?t.min:0,max:t.count>0?t.max:0,variance:t.count>1?t.m2/(t.count-1):0}}function Te(t){return{count:t.count,total:t.total,mean:t.mean,m2:t.variance*Math.max(0,t.count-1),min:t.count>0?t.min:1/0,max:t.count>0?t.max:-1/0}}function De(t,e){if(null!=t[e])return t[e];const i=t.datum;return i&&"object"==typeof i?i[e]:void 0}function $e(t,e,i){return"function"==typeof t?t(e,i):"string"==typeof t?De(e,t):void 0}function Fe(t){if(null==t)return;const e=t+"";return e.trim()?e:void 0}function Ne(t){const e=Ce(t.value);return{id:t.id,label:t.label,count:e.count,total:e.total,bodyIds:t.bodyIds.slice(),lastBodyId:t.lastBodyId,lastDatum:t.lastDatum,x:Ce(t.x),y:Ce(t.y),value:e}}var Pe=class{constructor(t=!1){this.bins=new Map,this.nextIndex=0,this.config=t}updateConfig(t){void 0!==t&&(this.config=t,!1===t&&this.clear())}isEnabled(){return!1!==this.config}add(t){if(!1===this.config)return null;const e=this.nextIndex;this.nextIndex+=1;const i=Fe($e(this.config.binAccessor,t,e))??function(t){for(const e of Ae){const i=Fe(De(t,e));if(i)return i}return"sediment"}(t),n=Fe($e(this.config.labelAccessor,t,e))??i,s=function(t,e,i){if("number"==typeof t)return t;const n="function"==typeof t?t(e,i):"string"==typeof t?De(e,t):1,s="number"==typeof n?n:Number(n);return Number.isFinite(s)?s:1}(this.config.valueAccessor,t,e),o=Math.max(0,Math.floor(this.config.retainBodyIds??12));let r=this.bins.get(i);return r||(r={id:i,label:n,bodyIds:[],x:{count:0,total:0,mean:0,m2:0,min:1/0,max:-1/0},y:{count:0,total:0,mean:0,m2:0,min:1/0,max:-1/0},value:{count:0,total:0,mean:0,m2:0,min:1/0,max:-1/0}},this.bins.set(i,r)),r.label=n,r.lastBodyId=t.id,r.lastDatum=t.datum,qe(r.x,t.x),qe(r.y,t.y),qe(r.value,s),o>0&&(r.bodyIds.push(t.id),r.bodyIds.length>o&&(r.bodyIds=r.bodyIds.slice(r.bodyIds.length-o))),Ne(r)}clear(){this.bins.clear(),this.nextIndex=0}snapshot(){return Array.from(this.bins.values()).map(Ne)}restore(t=[]){this.bins.clear();for(const e of t)this.bins.set(e.id,{id:e.id,label:e.label,bodyIds:e.bodyIds.slice(),lastBodyId:e.lastBodyId,lastDatum:e.lastDatum,x:Te(e.x),y:Te(e.y),value:Te(e.value)});this.nextIndex=t.reduce((t,e)=>t+e.count,0)}totals(){const t=this.snapshot();return{bins:t.length,count:t.reduce((t,e)=>t+e.count,0),total:t.reduce((t,e)=>t+e.total,0)}}};function Le(t,e={}){const{baselineY:i=0,binWidth:n=24,gap:s=2,maxHeight:o=80,value:r="count",x:a}=e,c=Math.max(1,...t.map(t=>t[r]));return t.map((t,e)=>{const l=Math.max(0,t[r]/c*o),d=a?.(t,e)??e*(n+s);return{binId:t.id,label:t.label,index:e,count:t.count,total:t.total,x:d,y:i-l,width:n,height:l,meanX:t.x.mean,meanY:t.y.mean}})}var je={bodyLimit:1/0,eviction:"oldest",fixedDt:1/120,maxDeltaSeconds:.1,maxSubsteps:8,settleStepLimit:1200,timeScale:1},Ee={chartId:"physics",chartType:"physics",sensors:{},onObservation:void 0,onSimulationStateChange:void 0};function Re(t={},e=Ee){return{chartId:t.chartId??e.chartId,chartType:t.chartType??e.chartType,sensors:t.sensors??e.sensors,onObservation:t.onObservation??e.onObservation,onSimulationStateChange:t.onSimulationStateChange??e.onSimulationStateChange}}function Ye(t){return{...t,shape:{...t.shape},datum:t.datum,springs:t.springs?.map(t=>({...t,target:{...t.target}}))}}function We(t){if(t instanceof Date){const e=t.getTime();return Number.isFinite(e)?e:void 0}const e="number"==typeof t?t:"string"==typeof t&&t.trim()?Number(t):NaN;return Number.isFinite(e)?e:void 0}function Xe(t,e){if(null!=t[e])return t[e];const i=t.datum;return i&&"object"==typeof i?i[e]:void 0}function ze(t){return{...Ye(t),sequence:t.sequence,spawnAt:t.spawnAt}}function Ge(t){return t.map(t=>({...t,shape:{...t.shape},bodyFilter:t.bodyFilter&&"function"!=typeof t.bodyFilter?{...t.bodyFilter,oneOf:t.bodyFilter.oneOf?.slice(),notOneOf:t.bodyFilter.notOneOf?.slice()}:t.bodyFilter}))}function Ke(t){return!1!==t&&{...t}}function Ue(t,e){return t.spawnAt===e.spawnAt?t.sequence-e.sequence:t.spawnAt-e.spawnAt}function He(t){return{...t,gravity:{...t.gravity}}}function _e(t,e,i,n){if("circle"===t.shape.type){const s=t.x-e,o=t.y-i,r=t.shape.radius+n,a=s*s+o*o;return a>r*r?null:a}const s=Math.max(Math.abs(e-t.x)-t.shape.width/2,0),o=Math.max(Math.abs(i-t.y)-t.shape.height/2,0),r=s*s+o*o;return r>n*n?null:r}function Ve(t){const e=t.indexOf("\0");return{sensorId:t.slice(0,e),bodyId:t.slice(e+1)}}function Qe(t,e={}){const{idPrefix:i="plot",includeFloor:n=!0,includeCeiling:s=!1,includeLeftWall:o=!0,includeRightWall:r=!0,wallThickness:a=20,floorThickness:c=a}=e,l=[],d=t.x+t.width/2,h=t.y+t.height/2;return n&&l.push({id:i+"-floor",shape:{type:"aabb",x:d,y:t.y+t.height+c/2,width:t.width+2*a,height:c}}),s&&l.push({id:i+"-ceiling",shape:{type:"aabb",x:d,y:t.y-c/2,width:t.width+2*a,height:c}}),o&&l.push({id:i+"-left-wall",shape:{type:"aabb",x:t.x-a/2,y:h,width:a,height:t.height+2*c}}),r&&l.push({id:i+"-right-wall",shape:{type:"aabb",x:t.x+t.width+a/2,y:h,width:a,height:t.height+2*c}}),l}function Ze(t){const{idPrefix:e="bin",count:i,domainStart:n,domainStep:s,xScale:o,yTop:r,yBottom:a,wallThickness:c=4,includeBoundaryWalls:l=!0,includeInteriorWalls:d=!0,closedBefore:h,lidY:u=r,lidThickness:p=Math.max(2,c)}=t,f=[],m=r+(a-r)/2,y=Math.abs(a-r),g=l?i:i-1;if(d||l)for(let t=l?0:1;g>=t;t+=1){if(!d&&t>0&&i>t)continue;const r=o(n+t*s);f.push({id:`${e}-wall-${t}`,shape:{type:"aabb",x:r,y:m,width:c,height:y}})}if(null!=h)for(let t=0;i>t;t+=1){const i=n+t*s,r=i+s;if(r>=h)continue;const a=o(i),l=o(r);f.push({id:`${e}-lid-${t}`,shape:{type:"segment",x1:Math.min(a,l)+c/2,y1:u,x2:Math.max(a,l)-c/2,y2:u,thickness:p}})}return f}var Je=class{constructor(t={}){this.id="builtin",this.capabilities={...(new Oe).capabilities,engine:"builtin"},this.world=new Oe(t)}init(t={}){this.world.init(t)}spawn(t){this.world.spawn(t)}remove(t){this.world.remove(t)}setColliders(t){this.world.setColliders(t)}setConstraint(t){return this.world.setConstraint(t)}removeConstraint(t){this.world.removeConstraint(t)}applyImpulse(t,e,i){this.world.applyImpulse(t,e,i)}step(t){this.world.step(t)}settle(t,e){return this.world.settle(t,e)}readState(t){return this.world.readState(t)}events(){return this.world.events()}activeSensorPairs(){return this.world.activeSensorPairs()}allSleeping(){return this.world.allSleeping()}snapshot(){return this.world.snapshot()}restore(t){this.world.restore(t)}nextRandom(){return this.world.nextRandom()}dispose(){this.world.dispose()}};function ti(t,e={}){return t?"function"==typeof t?t(e):(t.init(e),t):function(t={}){return new Je(t)}(e)}function ei(t){const e=Number(t);if(Number.isFinite(e)&&e>0)return Math.floor(e)}var ii={data:"data",domain:"domain",layout:"layout","scene-geometry":"sceneGeometry","scene-style":"sceneStyle","data-paint":"dataPaint","interaction-paint":"interactionPaint",overlay:"overlay",accessibility:"accessibility",evidence:"evidence"};function ni(t,e){const i={...t};for(const t of e)i[ii[t]]++;return i}function si(t,e,i){const n=new Set(e);return{changeSet:{...t,...t.keys?{keys:[...t.keys]}:{}},changed:n,revisions:ni(i,n)}}var oi=class{constructor(){this.revisions={data:0,domain:0,layout:0,sceneGeometry:0,sceneStyle:0,dataPaint:0,interactionPaint:0,overlay:0,accessibility:0,evidence:0},this.latest=si({kind:"initialize"},[],this.revisions),this.listeners=new Set}get last(){return this.latest}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}record(t,e){const i=si(t,e,this.revisions);this.revisions=i.revisions,this.latest=i;for(const t of[...this.listeners])t();return i}};import{quadtree as ri}from"d3-quadtree";var ai=class{constructor(){this.maxSearchRadius=0,this.revision=-1,this.tree=null}hitTest(t,e,i,n,s,o=0,r){const a=this.ensure(t,e);if(!a)return null;let c=null,l=1/0;const d=Math.max(0,r?.searchRadius??Math.max(0,o)+this.maxSearchRadius),h=n-d,u=n+d,p=s-d,f=s+d;return a.visit((t,e,a,d,m)=>{if(h>d||e>u||p>m||a>f)return!0;if(t.length)return!1;let y=t;for(;y;){const t=y.data;if(t&&(!r?.include||r.include(t))){const e=r?.distanceSquared?r.distanceSquared(t,n,s):_e(t,n,s,Math.max(0,o));null!=e&&(l>e||e===l&&i.indexOf(t.id)>i.indexOf(c?.id??""))&&(c=t,l=e)}y=y.next}return!1}),c}ensure(t,e){if(this.tree&&this.revision===e)return this.tree;const i=t.readState();return 0===i.length?(this.tree=null,this.maxSearchRadius=0,this.revision=e,null):(this.maxSearchRadius=i.reduce((t,e)=>Math.max(t,function(t){return"circle"===t.shape.type?t.shape.radius:Math.hypot(t.shape.width,t.shape.height)/2}(e)),0),this.tree=ri().x(t=>t.x).y(t=>t.y).addAll(i),this.revision=e,this.tree)}},ci=["data","scene-geometry","data-paint","accessibility","evidence"],li=["scene-geometry","data-paint","accessibility","evidence"],di=["overlay","accessibility","evidence"],hi=(t,e)=>({retainedData:t,invalidations:e}),ui=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],pi=["scene-geometry","data-paint","accessibility","evidence"],fi=[],mi={engine:hi("rebuild",["scene-geometry","data-paint","accessibility","evidence"]),kernel:hi("preserve",pi),colliders:hi("preserve",pi),sediment:hi("preserve",pi),bodyBudget:hi("preserve",ui),bodyLimit:hi("preserve",ui),eviction:hi("preserve",ui),fixedDt:hi("preserve",fi),maxDeltaSeconds:hi("preserve",fi),maxSubsteps:hi("preserve",fi),settleStepLimit:hi("preserve",fi),timeScale:hi("preserve",fi),observation:hi("preserve",fi)},yi=hi("preserve",ui);function gi(t){let e="preserve";const i=new Set;for(const n of t){const t=mi[n]??yi;"rebuild"===t.retainedData&&(e="rebuild");for(const e of t.invalidations)i.add(e)}return{retainedData:e,invalidations:i}}var xi=["seed","fixedDt","cellSize","collisionIterations","velocityDamping","sleepSpeed","sleepAfter","restitution","friction","maxVelocity","contactWakeSpeed"];function bi(t,e){return t===e||!(!t||!e)&&t.gravity?.x===e.gravity?.x&&t.gravity?.y===e.gravity?.y&&xi.every(i=>t[i]===e[i])}function vi(t,e,i,n){return t||!e?"paused":i||!n?"running":"settled"}var wi=class{constructor(){this.seconds=0,this.speed=8,this.scratch=[]}setKernelOptions(t){this.speed=function(t){const e=t?.sleepSpeed;return"number"==typeof e&&Number.isFinite(e)&&e>0?e:8}(t)}reset(){this.seconds=0}isAtRest(){return this.seconds>=.6}refresh(t,e,i){if(i>0)return void(this.seconds=0);const n=t.readState(this.scratch),s=this.speed*this.speed;let o=!0;for(const t of n)if(!t.sleeping&&t.vx*t.vx+t.vy*t.vy>=s){o=!1;break}this.seconds=o?this.seconds+Math.max(0,e):0}},Si=class{constructor(t={}){this.activeSensorPairs=new Set,this.accumulator=0,this.bodyBudgetObservationKey="ok",this.bodySpatialIndex=new ai,this.elapsedSeconds=0,this.liveBodyOrder=[],this.nextSequence=0,this.paused=!1,this.queue=[],this.revision=0,this.updateResults=new oi,this.simulationState="settled",this.visible=!0,this.quiescence=new wi;const{bodyBudget:e,colliders:i,engine:n,kernel:s,observation:o,sediment:r,...a}=t;this.config={...je,...a},this.configInput={...t},this.bodyBudget=e??{},this.engineInput=n,this.observation=Re(o),this.sediment=new Pe(r??!1),this.world=ti(n,{fixedDt:this.config.fixedDt,...s}),this.quiescence.setKernelOptions(s),i&&this.world.setColliders(Ge(i))}updateConfig(t){const e=function(t,e){return Object.keys(t).filter(i=>"kernel"===i?!bi(t.kernel,e.kernel):t[i]!==e[i])}(t,this.configInput),{colliders:i,bodyBudget:n,engine:s,kernel:o,observation:r,sediment:a,...c}=t;if(this.config={...this.config,...c},void 0!==n&&(this.bodyBudget=n,!1===n&&(this.bodyBudgetObservationKey="ok")),s&&s!==this.engineInput){const t=this.world.snapshot();this.world.dispose(),this.engineInput=s,this.world=ti(s,t.options),this.world.restore(t),this.revision+=1}if(o&&!bi(o,this.configInput.kernel)){const t=this.world.snapshot(),e={...t.options,...o,gravity:{...t.options.gravity,...o.gravity}};this.world.restore({...t,options:e}),this.quiescence.setKernelOptions(e),this.revision+=1}r&&(this.observation=Re(r,this.observation)),this.sediment.updateConfig(a),i&&(this.world.setColliders(Ge(i)),this.revision+=1),this.configInput={...this.configInput,...t};const l=gi(e);this.updateResults.record({kind:"config",keys:e},l.invalidations)}updateConfigWithResult(t){return this.updateConfig(t),this.updateResults.last}setColliders(t){this.world.setColliders(Ge(t)),this.revision+=1,this.updateResults.record({kind:"config",keys:["colliders"]},gi(["colliders"]).invalidations)}enqueue(t,e){const i=Array.isArray(t)?t:[t],n=e?function(t,e={}){const i=We(e.startAt)??0,n=e.pacing??"immediate";if("arrival"===n){const n=t.map((t,i)=>function(t,e,i){return"function"==typeof i?We(i(t,e)):"string"==typeof i?We(Xe(t,i)):We(t.spawnAt)??We(Xe(t,"arrivalTime"))??We(Xe(t,"timestamp"))??We(Xe(t,"time"))??We(Xe(t,"eventTime"))}(t,i,e.timeAccessor)),s=n.filter(t=>null!=t),o=s.length>0?Math.min(...s):0,r=We(e.timeScale)??1,a=r>0?r:1;return t.map((t,e)=>{const s=n[e],r=null==s?0:Math.max(0,s-o);return{...Ye(t),spawnAt:i+r/a}})}if("object"==typeof n){const e=We(n.ratePerSec);if(e&&e>0)return t.map((t,n)=>({...Ye(t),spawnAt:i+n/e}))}return t.map(t=>({...Ye(t),spawnAt:i}))}(i,{...e,startAt:e.startAt??this.elapsedSeconds}):i;for(const t of n)this.queue.push({...Ye(t),sequence:this.nextSequence,spawnAt:t.spawnAt??this.elapsedSeconds}),this.nextSequence+=1;this.queue.sort(Ue),n.length>0&&(this.revision+=1),this.updateResults.record({kind:"enqueue",count:n.length},n.length?ci:[])}enqueueWithResult(t,e){return this.enqueue(t,e),this.updateResults.last}spawnNow(t){this.spawnOne(Ye(t)),this.nextSequence+=1,this.observeBodyBudget(),this.evictOverflow(),this.revision+=1,this.updateResults.record({kind:"enqueue",count:1},ci)}materializeDueSpawns(){const t=this.revision,e=[],i=[];return this.spawnDue(e,i),0===e.length||(this.observeBodyBudget(i),this.evictOverflow(i),this.syncSimulationState(i),this.revision+=1,this.updateResults.record({kind:"enqueue",count:e.length},this.revision!==t?ci:[])),e}clear(){const t=this.world.snapshot().options;this.world.init({...t,fixedDt:this.config.fixedDt}),this.activeSensorPairs.clear(),this.liveBodyOrder=[],this.queue=[],this.accumulator=0,this.elapsedSeconds=0,this.nextSequence=0,this.quiescence.reset(),this.sediment.clear(),this.bodyBudgetObservationKey="ok",this.revision+=1,this.syncSimulationState(),this.updateResults.record({kind:"clear"},ci)}tick(t){const e=this.revision,i=[],n=[],s=[],o=[],r=[];if(this.paused||!this.visible){const t=this.result(0,i,n,s,o,r,!1);return this.updateResults.record({kind:"tick",count:0},[]),t}const a=Math.max(0,Math.min(t,this.config.maxDeltaSeconds))*this.config.timeScale;this.elapsedSeconds+=a,this.spawnDue(i,r);const c=this.observeBodyBudget(r),l=this.evictOverflow(r);n.push(...l.evicted),s.push(...l.sedimented),this.syncSimulationState(r),this.accumulator+=a;let d=0;for(;this.accumulator>=this.config.fixedDt&&this.config.maxSubsteps>d;){this.world.step(this.config.fixedDt);const t=this.world.events();o.push(...t),this.observeKernelEvents(t,r),this.observeSensorTransitions(r),this.accumulator-=this.config.fixedDt,d+=1}d===this.config.maxSubsteps&&(this.accumulator=Math.min(this.accumulator,this.config.fixedDt)),this.quiescence.refresh(this.world,a,i.length),(d>0||i.length>0||n.length>0||s.length>0||o.length>0)&&(this.revision+=1);const h=this.result(d,i,n,s,o,r,void 0,c);return this.updateResults.record({kind:"tick",count:d},this.revision!==e?i.length||n.length||s.length?ci:li:[]),h}settle(t=this.config.settleStepLimit){return this.runSettle(t,!1).steps}settleWithObservations(t=this.config.settleStepLimit){return this.runSettle(t,!0)}settleHost(){return{fixedDt:this.config.fixedDt,queueSize:()=>this.queue.length,atRest:()=>this.atRest(),advanceTime:t=>{this.elapsedSeconds+=t},spawnDue:(t,e)=>this.spawnDue(t,e),observeBodyBudget:t=>this.observeBodyBudget(t),evictOverflow:t=>this.evictOverflow(t),step:t=>this.world.step(t),drainEvents:()=>this.world.events(),observeKernelEvents:(t,e)=>this.observeKernelEvents(t,e),observeSensorTransitions:t=>this.observeSensorTransitions(t),refreshQuiescence:(t,e)=>this.quiescence.refresh(this.world,t,e)}}runSettle(t,e){const i=this.revision,n=[],s=[],o=[],r=[],a=e?[]:void 0;if(e&&(this.paused||!this.visible)){const t=this.result(0,n,s,o,r,a??[],!1);return this.updateResults.record({kind:"settle",count:0},[]),t}this.spawnDue(n,a);const c=this.observeBodyBudget(a),l=this.evictOverflow(a);s.push(...l.evicted),o.push(...l.sedimented),this.syncSimulationState(a),n.length>0&&this.quiescence.reset();const d=e?{spawned:n,evicted:s,sedimented:o,events:r,observations:a}:{spawned:n},{steps:h,budget:u}=function(t,e,i){let n,s=0;for(;e>s&&(t.queueSize()>0||!t.atRest());){t.advanceTime(t.fixedDt);const e=[];if(t.spawnDue(e,i.observations),e.length>0){i.spawned.push(...e),n=t.observeBodyBudget(i.observations);const s=t.evictOverflow(i.observations);i.evicted?.push(...s.evicted),i.sedimented?.push(...s.sedimented)}t.step(t.fixedDt);const o=t.drainEvents();i.events&&(i.events.push(...o),t.observeKernelEvents(o,i.observations),t.observeSensorTransitions(i.observations)),s+=1,t.refreshQuiescence(t.fixedDt,e.length)}return{steps:s,budget:n}}(this.settleHost(),t,d),p=n.length+s.length+o.length>0;(h>0||p||r.length>0)&&(this.revision+=1);const f=this.result(h,n,s,o,r,a??[],void 0,u??c);return this.updateResults.record({kind:"settle",count:h},this.revision===i?[]:p?ci:li),f}readBodies(t=[]){return this.world.readState(t)}readSediment(){return this.sediment.snapshot()}bodyBudgetStatus(){return this.evaluateBodyBudget()}sedimentTotals(){return this.sediment.totals()}sedimentHeightfield(t={}){return Le(this.readSediment(),t)}hitTest(t,e,i=0,n){return this.bodySpatialIndex.hitTest(this.world,this.revision,this.liveBodyOrder,t,e,i,n)}events(){return this.world.events()}allSleeping(){return this.world.allSleeping()}atRest(){return this.world.allSleeping()||this.quiescence.isAtRest()}hasPendingWork(){return this.queue.length>0||!this.atRest()}queueSize(){return this.queue.length}liveBodyCount(){return this.liveBodyOrder.length}elapsed(){return this.elapsedSeconds}recordObservation(t){const{timestamp:e,chartType:i,chartId:n,...s}=t,o={...s,timestamp:e??this.elapsedSeconds,chartType:i??this.observation.chartType,chartId:n??this.observation.chartId};return this.emitObservation(o),this.updateResults.record({kind:"update",count:1},["evidence"]),o}getLastUpdateResult(){return this.updateResults.last}getUpdateSnapshot(){return this.updateResults.last}subscribeUpdateResult(t){return this.updateResults.subscribe(t)}version(){return this.revision}setPaused(t){const e=this.paused!==t;this.paused=t,this.syncSimulationState(),this.updateResults.record({kind:"pause"},e?di:[])}setVisible(t){const e=this.visible!==t;this.visible=t,this.syncSimulationState(),this.updateResults.record({kind:"visibility"},e?di:[])}remove(t){const e=new Set(t),i=new Set(this.liveBodyOrder),n=new Set(this.queue.map(t=>t.id));this.queue=this.queue.filter(t=>!e.has(t.id)),this.liveBodyOrder=this.liveBodyOrder.filter(t=>!e.has(t)),this.world.remove(t),this.removeActiveSensorPairsForBodies(e);const s=t.filter(t=>i.has(t)||n.has(t));return s.length>0&&(this.revision+=1,this.syncSimulationState()),this.updateResults.record({kind:"remove",keys:s,count:s.length},s.length?ci:[]),s}setConstraint(t){const e=this.world.setConstraint(t);return this.revision+=1,this.updateResults.record({kind:"constraint",keys:[e]},li),e}removeConstraint(t){this.world.removeConstraint(t),this.revision+=1,this.updateResults.record({kind:"constraint",keys:[t]},li)}applyImpulse(t,e,i){this.world.applyImpulse(t,e,i),this.revision+=1,this.updateResults.record({kind:"impulse",keys:[t]},li)}nextRandom(){return this.world.nextRandom()}controls(){return t=this,{applyImpulse:(e,i,n)=>t.applyImpulse(e,i,n),clear:()=>t.clear(),hitTest:(e,i,n)=>t.hitTest(e,i,n),pause:()=>t.setPaused(!0),push:(e,i)=>t.enqueue(e,i),pushMany:(e,i)=>t.enqueue(e,i),bodyBudgetStatus:()=>t.bodyBudgetStatus(),readBodies:e=>t.readBodies(e),readSediment:()=>t.readSediment(),recordObservation:e=>t.recordObservation(e),remove:e=>t.remove(e),restore:e=>t.restore(e),resume:()=>t.setPaused(!1),settle:e=>t.settle(e),settleWithObservations:e=>t.settleWithObservations(e),snapshot:()=>t.snapshot(),sedimentHeightfield:e=>t.sedimentHeightfield(e),sedimentTotals:()=>t.sedimentTotals(),step:e=>t.tick(e)};var t}snapshot(){const t=this.world.snapshot();return{accumulator:this.accumulator,activeSensorPairs:Array.from(this.activeSensorPairs).sort(),bodyBudget:Ke(this.bodyBudget),config:{...this.config,kernel:He(t.options)},elapsedSeconds:this.elapsedSeconds,paused:this.paused,queue:this.queue.map(ze),revision:this.revision,sediment:this.readSediment(),simulationState:this.simulationState,liveBodyOrder:this.liveBodyOrder.slice(),visible:this.visible,world:t}}restore(t){this.config={bodyLimit:t.config.bodyLimit,eviction:t.config.eviction,fixedDt:t.config.fixedDt,maxDeltaSeconds:t.config.maxDeltaSeconds,maxSubsteps:t.config.maxSubsteps,settleStepLimit:t.config.settleStepLimit,timeScale:t.config.timeScale},this.configInput={...t.config,bodyBudget:Ke(t.bodyBudget??{}),kernel:He(t.world.options)},this.bodyBudget=Ke(t.bodyBudget??{}),this.bodyBudgetObservationKey="ok",this.quiescence.setKernelOptions(t.world.options),this.quiescence.reset(),this.activeSensorPairs=new Set(t.activeSensorPairs),this.accumulator=t.accumulator,this.elapsedSeconds=t.elapsedSeconds,this.paused=t.paused,this.queue=t.queue.map(ze).sort(Ue),this.revision=t.revision,this.sediment.restore(t.sediment??[]),this.simulationState=t.simulationState??vi(t.paused,t.visible,t.queue.length>0,t.world.bodies.every(t=>t.sleeping)),this.liveBodyOrder=t.liveBodyOrder.slice(),this.visible=t.visible,this.nextSequence=this.queue.reduce((t,e)=>Math.max(t,e.sequence),-1)+1,this.world.restore(t.world),this.updateResults.record({kind:"restore"},ci)}spawnDue(t,e){for(;this.queue.length>0&&this.elapsedSeconds>=this.queue[0].spawnAt;){const i=this.queue.shift();if(!i)return;this.spawnOne(i,e),t.push(i.id)}}spawnOne(t,e){this.liveBodyOrder=this.liveBodyOrder.filter(e=>e!==t.id),this.removeActiveSensorPairsForBodies(new Set([t.id])),this.world.spawn(t),this.liveBodyOrder.push(t.id);for(const e of t.springs??[])this.world.setConstraint({...e,bodyId:t.id});const i=this.world.readState().find(e=>e.id===t.id);this.emitObservation({type:"physics-spawn",timestamp:this.elapsedSeconds,chartType:this.observation.chartType,chartId:this.observation.chartId,bodyId:t.id,datum:i?.datum??t.datum,x:i?.x??t.x,y:i?.y??t.y},e)}result(t,e,i,n,s,o,r,a=this.evaluateBodyBudget()){this.syncSimulationState(o);const c=this.world.allSleeping();return{budget:a,elapsedSeconds:this.elapsedSeconds,evicted:i,events:s,observations:o,queueSize:this.queue.length,revision:this.revision,shouldContinue:r??(this.queue.length>0||!this.atRest()),sleeping:c,sedimented:n,spawned:e,steps:t}}observeKernelEvents(t,e){!function(t,e,i){if(0===e.length)return;const n=new Map(t.readState().map(t=>[t.id,t]));for(const t of e){if("sleep"!==t.type)continue;const e=n.get(t.bodyId);i.emit({type:"physics-settle",timestamp:i.elapsedSeconds,chartType:i.observation.chartType,chartId:i.observation.chartId,bodyId:t.bodyId,datum:e?.datum,x:e?.x,y:e?.y})}}(this.world,t,this.observationContext(e))}observeSensorTransitions(t){this.activeSensorPairs=function(t,e,i){const n=new Set(t.activeSensorPairs().map(t=>`${t.sensorId}\0${t.bodyId}`));if(0===n.size&&0===e.size)return n;const s=new Map(t.readState().map(t=>[t.id,t])),o=(t,e)=>{const{sensorId:n,bodyId:o}=Ve(e),r=i.observation.sensors[n],a=s.get(o);i.emit({type:"enter"===t?r?.enterType??"physics-bin-enter":r?.exitType??"physics-bin-exit",timestamp:i.elapsedSeconds,chartType:i.observation.chartType,chartId:i.observation.chartId,bodyId:o,datum:a?.datum,x:a?.x,y:a?.y,sensorId:n,binId:r?.binId??n})};for(const t of Array.from(n).sort())e.has(t)||o("enter",t);for(const t of Array.from(e).sort())n.has(t)||o("exit",t);return n}(this.world,this.activeSensorPairs,this.observationContext(t))}removeActiveSensorPairsForBodies(t){!function(t,e){for(const i of t)e.has(Ve(i).bodyId)&&t.delete(i)}(this.activeSensorPairs,t)}observationContext(t){return{elapsedSeconds:this.elapsedSeconds,observation:this.observation,emit:e=>this.emitObservation(e,t)}}emitObservation(t,e){e?.push(t),this.observation.onObservation?.(t)}evaluateBodyBudget(){return function(t){const e=Math.max(0,Math.floor(t.liveBodies)),i=Math.max(0,Math.floor(t.queuedBodies??0)),n=e+i,s=ei(t.bodyLimit),o=ei(t.engineMaxBodiesHint),r=function(t,e,i){if(!1===i)return;const n=ei(i?.warnAt);return null!=n?n:null!=t?Math.max(1,Math.floor(.8*t)):null!=e?Math.max(1,Math.floor(.8*e)):void 0}(s,o,t.options),a=null==s?0:Math.max(0,e-s),c=a>0?"overflow":null==r||r>n?"ok":"warning";return{action:"overflow"!==c?"continue":t.sedimentEnabled?"sediment":t.evictionEnabled?"evict":"retain",bodyLimit:s,engineMaxBodiesHint:o,liveBodies:e,overflow:a,projectedBodies:n,queuedBodies:i,state:c,warnAt:r}}({bodyLimit:this.config.bodyLimit,engineMaxBodiesHint:this.world.capabilities.maxBodiesHint,evictionEnabled:!1!==this.config.eviction,liveBodies:this.liveBodyOrder.length,queuedBodies:this.queue.length,sedimentEnabled:this.sediment.isEnabled(),options:this.bodyBudget})}observeBodyBudget(t){const e=this.evaluateBodyBudget();if("ok"===e.state||!1===this.bodyBudget)return this.bodyBudgetObservationKey="ok",e;const i=`${e.state}:${e.action}`;return i===this.bodyBudgetObservationKey||(this.bodyBudgetObservationKey=i,this.emitObservation({type:"overflow"===e.state?"physics-budget-overflow":"physics-budget-warning",timestamp:this.elapsedSeconds,chartType:this.observation.chartType,chartId:this.observation.chartId,budgetAction:e.action,bodyLimit:e.bodyLimit,engineMaxBodiesHint:e.engineMaxBodiesHint,liveBodies:e.liveBodies,overflow:e.overflow,projectedBodies:e.projectedBodies,queuedBodies:e.queuedBodies,warnAt:e.warnAt},t)),e}syncSimulationState(t){const e=vi(this.paused,this.visible,this.queue.length>0,this.atRest());if(e===this.simulationState)return;const i=this.simulationState;this.simulationState=e,function(t,e,i){i.observation.onSimulationStateChange?.(e,t),"running"!==e&&"settled"!==e||i.emit({type:"running"===e?"sim-active":"sim-idle",timestamp:i.elapsedSeconds,chartType:i.observation.chartType,chartId:i.observation.chartId,simulationState:e,previousSimulationState:t})}(i,e,this.observationContext(t))}evictOverflow(t){const{evicted:e,sedimented:i,liveBodyOrder:n}=function(t,e,i,n,s,o){const r={evicted:[],sedimented:[],liveBodyOrder:s};if(!1===i)return r;const a=Math.max(0,Math.floor(n));if(!Number.isFinite(a))return r;const c=s.length-a;if(0>=c)return r;const l=function(t,e,i){if("sleeping-first"!==e)return i.slice();const n=new Map(t.readState().map(t=>[t.id,t.sleeping])),s=[],o=[];for(const t of i)n.get(t)?s.push(t):o.push(t);return[...s,...o]}(t,i,s),d=l.slice(0,c);if(0===d.length)return r;const h=function(t,e,i,n){const s=new Map(t.readState().map(t=>[t.id,t])),o=[];for(const t of i){const i=s.get(t);if(!i)continue;const r=e.add(i);r&&(o.push(t),n.emit({type:"physics-sediment",timestamp:n.elapsedSeconds,chartType:n.observation.chartType,chartId:n.observation.chartId,bodyId:t,datum:i.datum,x:i.x,y:i.y,binId:r.id,count:r.count,total:r.total}))}return o}(t,e,d,o);t.remove(d);const u=new Set(d);return{evicted:d,sedimented:h,liveBodyOrder:s.filter(t=>!u.has(t))}}(this.world,this.sediment,this.config.eviction,this.config.bodyLimit,this.liveBodyOrder,this.observationContext(t));return e.length>0&&(this.liveBodyOrder=n,this.removeActiveSensorPairsForBodies(new Set(e))),{evicted:e,sedimented:i}}};function Mi(t,e){const i=new Map;for(const e of t)i.set(e.id,new Set);for(const t of e)i.has(t.source)||i.set(t.source,new Set),i.has(t.target)||i.set(t.target,new Set),i.get(t.source).add(t.target);return i}function ki(t,e,i={}){const n=new Set,s=[...t.get(e)??[]];for(let e=0;s.length>e;e++){const i=s[e];n.has(i)||(n.add(i),s.push(...t.get(i)??[]))}return i.includeStart&&n.add(e),n}import{scaleLinear as Ii}from"d3-scale";function Bi(t,e,i){if(i.some(t=>null!=t.__forceRadius))return t=>t.__forceRadius??8;if(null==t)return()=>8;if("number"==typeof t)return()=>t;if("function"==typeof t)return e=>t(e)||8;const n=e||[5,20],s=[];for(const e of i){const i=e.data?.[t];"number"==typeof i&&s.push(i)}if(0===s.length)return()=>n[0];const[r,a]=o(s);if(r===a)return()=>(n[0]+n[1])/2;const c=Ii().domain([r,a]).range(n).clamp(!0);return e=>{const i=e.data?.[t];return null==i||"number"!=typeof i?n[0]:c(i)}}export{ee as useCustomLayoutSelection,r as placeWithMinGap,c as packBandsBySilhouette,l as orderByBarycenter,d as refineByAdjacentSwaps,h as orderExactSmall,u as countPairwiseCrossings,m as calendarLayout,v as roundedEnclosure,w as boundsOf,S as hullFromBoxes,M as bandLabel,k as hatchFill,I as linearAxis,B as markCallout,q as parallelCoordinatesLayout,Me as valueAtPath,Ie as matchesPhysicsBodyFilter,Le as sedimentHeightfield,Qe as collidersFromPlotBounds,Ze as collidersFromXScaleBins,oi as UpdateResultTracker,Si as PhysicsPipelineStore,D as aggregateRegionCounts,$ as regionCountsToProjectionRows,F as groupCompletionRows,L as processStageLayout,E as processStageRegions,R as membraneRegion,Y as chargeGateRegion,W as routeSurfaceRegion,X as pressureFieldRegion,z as capacitatedRegion,G as portalRegion,K as absorbRegion,U as forceFieldRegion,H as bodyGroupSpec,_ as processLaneWalls,st as processChrome,mt as SYMBOL_SEQUENCE,yt as symbolPathString,gt as symbolRadius,bt as symbolExtent,vt as makeSymbolResolver,wt as DEFAULT_GLYPH_VIEWBOX,St as DEFAULT_GLYPH_ANCHOR,Mt as glyphPlacement,kt as glyphExtent,It as resolveGlyphPaint,At as glyphFractionClipRect,qt as glyphHitGeometry,Ct as drawGlyphParts,Tt as resolveX,Dt as resolveY,Nt as resolveAnchoredPosition,Pt as isInBounds,Vt as annotationLayout,Mi as buildDirectedAdjacency,ki as reachableFrom,Bi as resolveNodeSizeFn};
|