semiotic 3.7.4 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +60 -15
- package/README.md +135 -24
- package/agent-skill/semiotic-charts/SKILL.md +146 -0
- package/ai/cli.js +133 -45
- package/ai/componentMetadata.cjs +6 -1
- package/ai/dist/mcp-server.js +1651 -154
- package/ai/examples.md +174 -0
- package/ai/schema.json +2934 -517
- package/ai/surface-manifest.json +200 -0
- package/ai/system-prompt.md +19 -3
- package/dist/components/Annotation.d.ts +4 -0
- package/dist/components/CategoryColors.d.ts +1 -1
- package/dist/components/ChartContainer.d.ts +91 -0
- package/dist/components/ChartGrid.d.ts +11 -1
- package/dist/components/CircularBrush.d.ts +61 -0
- package/dist/components/ContextLayout.d.ts +5 -1
- package/dist/components/DataSummaryContext.d.ts +1 -0
- package/dist/components/DirectManipulationControl.d.ts +63 -0
- package/dist/components/LinkedCharts.d.ts +3 -1
- package/dist/components/MobileAnnotationCalloutList.d.ts +13 -0
- package/dist/components/MobileChartContainer.d.ts +51 -0
- package/dist/components/MobileStandardControls.d.ts +68 -0
- package/dist/components/SmallMultipleChart.d.ts +84 -0
- package/dist/components/Tooltip/FlippingTooltip.d.ts +21 -0
- package/dist/components/ai/ChartRecipe.d.ts +16 -0
- package/dist/components/ai/IntentMark.d.ts +15 -0
- package/dist/components/ai/chartCapabilities.d.ts +8 -1
- package/dist/components/ai/chartCapabilityTypes.d.ts +42 -1
- package/dist/components/ai/chartClinic.d.ts +91 -0
- package/dist/components/ai/chartRecipeRegistry.d.ts +14 -0
- package/dist/components/ai/chartRecipes.d.ts +278 -0
- package/dist/components/ai/dataPitfallsBridge.d.ts +203 -0
- package/dist/components/ai/dataQualityBridge.d.ts +201 -0
- package/dist/components/ai/describeChart.d.ts +9 -0
- package/dist/components/ai/describeRecipeChart.d.ts +16 -0
- package/dist/components/ai/generativeChart.d.ts +170 -0
- package/dist/components/ai/intentManifest.d.ts +62 -0
- package/dist/components/ai/navigationTree.d.ts +3 -0
- package/dist/components/ai/observedSceneAudit.d.ts +72 -0
- package/dist/components/ai/readerGrounding.d.ts +83 -0
- package/dist/components/ai/recipeCapability.d.ts +8 -0
- package/dist/components/ai/recipeNavigation.d.ts +13 -0
- package/dist/components/ai/recipeSemantics.d.ts +11 -0
- package/dist/components/ai/repairChartConfig.d.ts +9 -0
- package/dist/components/ai/suggestCharts.d.ts +11 -1
- package/dist/components/charts/custom/GeoCustomChart.d.ts +48 -0
- package/dist/components/charts/custom/NetworkCustomChart.d.ts +22 -3
- package/dist/components/charts/custom/OrdinalCustomChart.d.ts +8 -2
- package/dist/components/charts/custom/XYCustomChart.d.ts +11 -2
- package/dist/components/charts/geo/DistanceCartogram.d.ts +1 -1
- package/dist/components/charts/geo/FlowMap.d.ts +1 -1
- package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +1 -1
- package/dist/components/charts/geo/index.d.ts +2 -0
- package/dist/components/charts/index.d.ts +29 -1
- package/dist/components/charts/network/ChordDiagram.d.ts +1 -1
- package/dist/components/charts/network/CirclePack.d.ts +1 -1
- package/dist/components/charts/network/ForceDirectedGraph.d.ts +15 -5
- package/dist/components/charts/network/OrbitDiagram.d.ts +1 -1
- package/dist/components/charts/network/ProcessSankey.d.ts +1 -1
- package/dist/components/charts/network/SankeyDiagram.d.ts +1 -1
- package/dist/components/charts/network/TreeDiagram.d.ts +1 -1
- package/dist/components/charts/network/Treemap.d.ts +1 -1
- package/dist/components/charts/network/useForceLayout.d.ts +17 -0
- package/dist/components/charts/ordinal/BarChart.d.ts +1 -1
- package/dist/components/charts/ordinal/BoxPlot.d.ts +1 -1
- package/dist/components/charts/ordinal/DonutChart.d.ts +1 -1
- package/dist/components/charts/ordinal/DotPlot.d.ts +1 -1
- package/dist/components/charts/ordinal/FunnelChart.d.ts +1 -1
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +1 -1
- package/dist/components/charts/ordinal/Histogram.d.ts +1 -1
- package/dist/components/charts/ordinal/PieChart.d.ts +1 -1
- package/dist/components/charts/ordinal/RidgelinePlot.d.ts +1 -1
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +1 -1
- package/dist/components/charts/ordinal/SwarmPlot.d.ts +8 -1
- package/dist/components/charts/ordinal/SwimlaneChart.d.ts +1 -1
- package/dist/components/charts/ordinal/ViolinPlot.d.ts +1 -1
- package/dist/components/charts/physics/ChainReactionChart.d.ts +9 -0
- package/dist/components/charts/physics/CollisionSwarmChart.capability.d.ts +2 -0
- package/dist/components/charts/physics/CollisionSwarmChart.d.ts +47 -0
- package/dist/components/charts/physics/EventDropChart.capability.d.ts +2 -0
- package/dist/components/charts/physics/EventDropChart.d.ts +53 -0
- package/dist/components/charts/physics/GaltonBoardChart.capability.d.ts +2 -0
- package/dist/components/charts/physics/GaltonBoardChart.d.ts +66 -0
- package/dist/components/charts/physics/GauntletChart.capability.d.ts +2 -0
- package/dist/components/charts/physics/GauntletChart.d.ts +73 -0
- package/dist/components/charts/physics/PhysicalFlowChart.capability.d.ts +2 -0
- package/dist/components/charts/physics/PhysicalFlowChart.d.ts +63 -0
- package/dist/components/charts/physics/PhysicsCustomChart.d.ts +120 -0
- package/dist/components/charts/physics/PhysicsPileChart.capability.d.ts +2 -0
- package/dist/components/charts/physics/PhysicsPileChart.d.ts +53 -0
- package/dist/components/charts/physics/ProcessFlowChart.capability.d.ts +2 -0
- package/dist/components/charts/physics/ProcessFlowChart.d.ts +96 -0
- package/dist/components/charts/physics/chainReactionOverlay.d.ts +22 -0
- package/dist/components/charts/physics/chainReactionRuntime.d.ts +37 -0
- package/dist/components/charts/physics/chainReactionTypes.d.ts +97 -0
- package/dist/components/charts/physics/collisionSwarmPhysics.d.ts +27 -0
- package/dist/components/charts/physics/dependencyMachine.d.ts +188 -0
- package/dist/components/charts/physics/eventDropPhysics.d.ts +64 -0
- package/dist/components/charts/physics/galtonBoardPhysics.d.ts +28 -0
- package/dist/components/charts/physics/gauntletChartProps.d.ts +67 -0
- package/dist/components/charts/physics/gauntletChrome.d.ts +33 -0
- package/dist/components/charts/physics/gauntletController.d.ts +73 -0
- package/dist/components/charts/physics/gauntletEffects.d.ts +36 -0
- package/dist/components/charts/physics/gauntletPhysics.d.ts +71 -0
- package/dist/components/charts/physics/gauntletRuntime.d.ts +42 -0
- package/dist/components/charts/physics/gauntletTypes.d.ts +213 -0
- package/dist/components/charts/physics/physicalFlowPhysics.d.ts +57 -0
- package/dist/components/charts/physics/physicsChartShared.d.ts +41 -0
- package/dist/components/charts/physics/physicsChartUtils.d.ts +18 -0
- package/dist/components/charts/physics/physicsEncoding.d.ts +142 -0
- package/dist/components/charts/physics/physicsHocHandle.d.ts +53 -0
- package/dist/components/charts/physics/physicsHocUtils.d.ts +128 -0
- package/dist/components/charts/physics/physicsPilePhysics.d.ts +41 -0
- package/dist/components/charts/physics/physicsProcessPrimitives.d.ts +38 -0
- package/dist/components/charts/physics/processFlowPhysics.d.ts +97 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +9 -1
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +9 -1
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +30 -1
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +16 -2
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +9 -1
- package/dist/components/charts/realtime/aggregate.d.ts +51 -0
- package/dist/components/charts/realtime/eventTime.d.ts +26 -0
- package/dist/components/charts/shared/auditMobileVisualization.d.ts +91 -0
- package/dist/components/charts/shared/chartDefinitionPilot.d.ts +145 -0
- package/dist/components/charts/shared/chartFamilySets.d.ts +20 -0
- package/dist/components/charts/shared/chartSpecCore.d.ts +165 -0
- package/dist/components/charts/shared/chartSpecs.d.ts +8 -127
- package/dist/components/charts/shared/chartSpecsGeo.d.ts +2 -0
- package/dist/components/charts/shared/chartSpecsNetwork.d.ts +2 -0
- package/dist/components/charts/shared/chartSpecsOrdinal.d.ts +2 -0
- package/dist/components/charts/shared/chartSpecsPhysics.d.ts +2 -0
- package/dist/components/charts/shared/chartSpecsRealtime.d.ts +2 -0
- package/dist/components/charts/shared/chartSpecsValue.d.ts +2 -0
- package/dist/components/charts/shared/chartSpecsXY.d.ts +2 -0
- package/dist/components/charts/shared/colorContrast.d.ts +3 -0
- package/dist/components/charts/shared/colorPalettes.d.ts +2 -0
- package/dist/components/charts/shared/colorUtils.d.ts +17 -13
- package/dist/components/charts/shared/diagnoseAnnotationChecks.d.ts +4 -0
- package/dist/components/charts/shared/diagnoseConfig.d.ts +9 -14
- package/dist/components/charts/shared/diagnoseMisleadingChecks.d.ts +9 -0
- package/dist/components/charts/shared/diagnosePhysicsChecks.d.ts +3 -0
- package/dist/components/charts/shared/diagnoseTypes.d.ts +10 -0
- package/dist/components/charts/shared/hooks.d.ts +28 -5
- package/dist/components/charts/shared/minMax.d.ts +3 -0
- package/dist/components/charts/shared/motionEncoding.d.ts +145 -0
- package/dist/components/charts/shared/radialGeometry.d.ts +0 -18
- package/dist/components/charts/shared/responsiveRules.d.ts +56 -0
- package/dist/components/charts/shared/smartTooltip.d.ts +27 -0
- package/dist/components/charts/shared/statisticalOverlays.d.ts +35 -0
- package/dist/components/charts/shared/streamPropsHelpers.d.ts +12 -2
- package/dist/components/charts/shared/temporalStrings.d.ts +7 -0
- package/dist/components/charts/shared/tooltipUtils.d.ts +2 -0
- package/dist/components/charts/shared/types.d.ts +49 -1
- package/dist/components/charts/shared/useChartSetup.d.ts +10 -3
- package/dist/components/charts/shared/useCustomChartSetup.d.ts +15 -6
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +6 -2
- package/dist/components/charts/shared/useOrdinalPieceStyle.d.ts +1 -1
- package/dist/components/charts/shared/useStreamingLegend.d.ts +1 -1
- package/dist/components/charts/shared/useSyncedPushData.d.ts +49 -0
- package/dist/components/charts/shared/validateChartData.d.ts +1 -1
- package/dist/components/charts/shared/validationMap.d.ts +0 -11
- package/dist/components/charts/xy/AreaChart.d.ts +1 -1
- package/dist/components/charts/xy/BubbleChart.d.ts +1 -1
- package/dist/components/charts/xy/LineChart.d.ts +1 -1
- package/dist/components/charts/xy/MinimapChart.d.ts +1 -1
- package/dist/components/charts/xy/MultiAxisLineChart.d.ts +2 -2
- package/dist/components/charts/xy/QuadrantChart.d.ts +1 -1
- package/dist/components/charts/xy/Scatterplot.d.ts +10 -1
- package/dist/components/charts/xy/ScatterplotMatrix.d.ts +11 -1
- package/dist/components/charts/xy/StackedAreaChart.d.ts +9 -4
- package/dist/components/controls/controlAudit.d.ts +24 -0
- package/dist/components/controls/controlContract.d.ts +57 -0
- package/dist/components/data/fromArrow.d.ts +54 -0
- package/dist/components/data/fromFlintChart.d.ts +74 -0
- package/dist/components/data/fromMermaid.d.ts +47 -0
- package/dist/components/data/fromObservablePlot.d.ts +69 -0
- package/dist/components/data/fromVegaLite.d.ts +27 -0
- package/dist/components/data/portability/index.d.ts +17 -0
- package/dist/components/data/portability/result.d.ts +52 -0
- package/dist/components/data/portability/spec.d.ts +160 -0
- package/dist/components/data/portability/vegaLite.d.ts +80 -0
- package/dist/components/export/chartConfig.d.ts +11 -0
- package/dist/components/realtime/ReorderBuffer.d.ts +54 -0
- package/dist/components/realtime/RunningStats.d.ts +66 -0
- package/dist/components/realtime/WindowAccumulator.d.ts +105 -0
- package/dist/components/realtime/parseWindowDuration.d.ts +12 -0
- package/dist/components/realtime/types.d.ts +11 -0
- package/dist/components/recipes/annotationLayout.d.ts +29 -0
- package/dist/components/recipes/axisFixedForce.d.ts +119 -0
- package/dist/components/recipes/boba.d.ts +23 -0
- package/dist/components/recipes/customTooltip.d.ts +31 -0
- package/dist/components/recipes/cyclical.d.ts +39 -0
- package/dist/components/recipes/edgeRouter.d.ts +103 -0
- package/dist/components/recipes/forceLayout.d.ts +48 -0
- package/dist/components/recipes/forceLayoutAsync.d.ts +17 -0
- package/dist/components/recipes/gofishBobaHandwritten.d.ts +3 -0
- package/dist/components/recipes/gofishDisplayListFixtures.generated.d.ts +37 -0
- package/dist/components/recipes/gofishIR.d.ts +215 -0
- package/dist/components/recipes/gofishIRExamples.d.ts +38 -0
- package/dist/components/recipes/intervalLanes.d.ts +87 -0
- package/dist/components/recipes/intervals.d.ts +80 -0
- package/dist/components/recipes/isometricLandmarks.d.ts +88 -0
- package/dist/components/recipes/isotypeGlyphs.d.ts +17 -0
- package/dist/components/recipes/mermaidDag.d.ts +44 -0
- package/dist/components/recipes/mobileAnnotationStrategy.d.ts +48 -0
- package/dist/components/recipes/mobileChartFamilyRecipes.d.ts +59 -0
- package/dist/components/recipes/networkAnalysis.d.ts +102 -0
- package/dist/components/recipes/networkLayouts.d.ts +83 -0
- package/dist/components/recipes/packedClusterMatrix.d.ts +166 -0
- package/dist/components/recipes/physics.d.ts +122 -0
- package/dist/components/recipes/physicsReference.d.ts +102 -0
- package/dist/components/recipes/processAggregates.d.ts +32 -0
- package/dist/components/recipes/processChrome.d.ts +67 -0
- package/dist/components/recipes/processJourney.d.ts +54 -0
- package/dist/components/recipes/processPhysics.d.ts +300 -0
- package/dist/components/recipes/processVolumeGeometry.d.ts +28 -0
- package/dist/components/recipes/radialCoords.d.ts +69 -0
- package/dist/components/recipes/random.d.ts +2 -0
- package/dist/components/recipes/recipeChrome.d.ts +191 -0
- package/dist/components/recipes/recipeGlyph.d.ts +42 -0
- package/dist/components/recipes/recipeLegend.d.ts +109 -0
- package/dist/components/recipes/recipeUtils.d.ts +157 -0
- package/dist/components/recipes/runs.d.ts +59 -0
- package/dist/components/recipes/tokenEncoding.d.ts +157 -0
- package/dist/components/recipes/tokenLayer.d.ts +79 -0
- package/dist/components/recipes/unitize.d.ts +108 -0
- package/dist/components/recipes/vector.d.ts +28 -0
- package/dist/components/recipes/waffle.d.ts +43 -0
- package/dist/components/semiotic-ai-core.d.ts +47 -0
- package/dist/components/semiotic-ai.d.ts +52 -4
- package/dist/components/semiotic-controls.d.ts +18 -0
- package/dist/components/semiotic-data.d.ts +2 -0
- package/dist/components/semiotic-experimental.d.ts +49 -0
- package/dist/components/semiotic-geo.d.ts +11 -0
- package/dist/components/semiotic-network.d.ts +14 -1
- package/dist/components/semiotic-ordinal.d.ts +10 -0
- package/dist/components/semiotic-physics-matter.d.ts +10 -0
- package/dist/components/semiotic-physics-rapier.d.ts +9 -0
- package/dist/components/semiotic-physics.d.ts +56 -0
- package/dist/components/semiotic-realtime-core.d.ts +34 -0
- package/dist/components/semiotic-realtime-react.d.ts +10 -0
- package/dist/components/semiotic-realtime.d.ts +4 -22
- package/dist/components/semiotic-recipes-core.d.ts +92 -0
- package/dist/components/semiotic-recipes-react.d.ts +7 -0
- package/dist/components/semiotic-recipes.d.ts +4 -26
- package/dist/components/semiotic-server-edge.d.ts +8 -0
- package/dist/components/semiotic-server-node.d.ts +5 -0
- package/dist/components/semiotic-server.d.ts +2 -2
- package/dist/components/semiotic-themes-core.d.ts +53 -0
- package/dist/components/semiotic-themes-react.d.ts +4 -0
- package/dist/components/semiotic-themes.d.ts +6 -74
- package/dist/components/semiotic-utils-core.d.ts +46 -0
- package/dist/components/semiotic-utils-react.d.ts +5 -0
- package/dist/components/semiotic-utils.d.ts +3 -39
- package/dist/components/semiotic-xy.d.ts +10 -0
- package/dist/components/semiotic.d.ts +39 -7
- package/dist/components/server/animatedGif.d.ts +36 -0
- package/dist/components/server/renderEvidence.d.ts +1 -1
- package/dist/components/server/renderToStaticSVG.d.ts +3 -35
- package/dist/components/server/serverChartConfigShared.d.ts +17 -0
- package/dist/components/server/serverChartConfigs.d.ts +19 -9
- package/dist/components/server/serverChartConfigsCustom.d.ts +5 -0
- package/dist/components/server/serverChartConfigsGeo.d.ts +9 -0
- package/dist/components/server/serverChartConfigsNetwork.d.ts +8 -0
- package/dist/components/server/serverChartConfigsOrdinal.d.ts +16 -0
- package/dist/components/server/serverChartConfigsPhysics.d.ts +9 -0
- package/dist/components/server/serverChartConfigsXY.d.ts +11 -0
- package/dist/components/server/staticGeo.d.ts +4 -0
- package/dist/components/server/staticLegend.d.ts +1 -1
- package/dist/components/server/staticNetwork.d.ts +8 -0
- package/dist/components/server/staticOrdinal.d.ts +11 -0
- package/dist/components/server/staticPhysics.d.ts +3 -0
- package/dist/components/server/staticSVGChrome.d.ts +110 -0
- package/dist/components/server/staticXY.d.ts +4 -0
- package/dist/components/store/ObservationStore.d.ts +23 -3
- package/dist/components/store/SelectionStore.d.ts +1 -1
- package/dist/components/store/ThemeStore.d.ts +1 -1
- package/dist/components/store/TooltipStore.d.ts +1 -1
- package/dist/components/store/createStore.d.ts +1 -1
- package/dist/components/store/designTokens.d.ts +15 -0
- package/dist/components/store/themeSerialization.d.ts +32 -0
- package/dist/components/store/useChartInterrogation.d.ts +9 -0
- package/dist/components/stream/AccessibleDataTable.d.ts +3 -13
- package/dist/components/stream/FocusRing.d.ts +4 -2
- package/dist/components/stream/GeoCanvasHitTester.d.ts +1 -1
- package/dist/components/stream/GeoPipelineStore.d.ts +28 -0
- package/dist/components/stream/NetworkHtmlMarksLayer.d.ts +44 -0
- package/dist/components/stream/NetworkPipelineStore.d.ts +62 -25
- package/dist/components/stream/NetworkSVGOverlay.d.ts +15 -0
- package/dist/components/stream/OrdinalPipelineStore.d.ts +64 -2
- package/dist/components/stream/PipelineStore.d.ts +100 -162
- package/dist/components/stream/SceneGraph.d.ts +14 -2
- package/dist/components/stream/StreamGeoFrame.d.ts +1 -1
- package/dist/components/stream/StreamNetworkFrame.d.ts +1 -1
- package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -1
- package/dist/components/stream/StreamXYFrame.d.ts +2 -18
- package/dist/components/stream/accessibleDataRows.d.ts +33 -0
- package/dist/components/stream/accessorUtils.d.ts +23 -10
- package/dist/components/stream/brushAccessibility.d.ts +25 -0
- package/dist/components/stream/canvasBackground.d.ts +24 -0
- package/dist/components/stream/canvasSetup.d.ts +4 -1
- package/dist/components/stream/customLayout.d.ts +20 -0
- package/dist/components/stream/customLayoutDiagnostics.d.ts +11 -0
- package/dist/components/stream/customLayoutFailure.d.ts +33 -0
- package/dist/components/stream/customLayoutPalette.d.ts +19 -9
- package/dist/components/stream/customLayoutSelection.d.ts +52 -0
- package/dist/components/stream/frameThemeColors.d.ts +24 -0
- package/dist/components/stream/geoAnnotationAnchors.d.ts +14 -0
- package/dist/components/stream/geoCartogram.d.ts +17 -0
- package/dist/components/stream/geoCustomLayout.d.ts +59 -0
- package/dist/components/stream/geoDefaultTooltip.d.ts +11 -0
- package/dist/components/stream/geoFrameHelpers.d.ts +34 -0
- package/dist/components/stream/geoPipelineHelpers.d.ts +46 -0
- package/dist/components/stream/geoTypes.d.ts +56 -7
- package/dist/components/stream/glyphDef.d.ts +98 -0
- package/dist/components/stream/hitTarget.d.ts +170 -0
- package/dist/components/stream/hoverUtils.d.ts +3 -0
- package/dist/components/stream/keyboardNav.d.ts +4 -1
- package/dist/components/stream/layouts/forceLayoutPlugin.d.ts +9 -1
- package/dist/components/stream/layouts/forceLayoutWorkerClient.d.ts +57 -0
- package/dist/components/stream/networkBezier.d.ts +10 -0
- package/dist/components/stream/networkColorAccessors.d.ts +49 -0
- package/dist/components/stream/networkCustomLayout.d.ts +66 -1
- package/dist/components/stream/networkDefaultTooltip.d.ts +10 -0
- package/dist/components/stream/networkFrameInteraction.d.ts +37 -0
- package/dist/components/stream/networkFramePaint.d.ts +43 -0
- package/dist/components/stream/networkPipelineConfig.d.ts +22 -0
- package/dist/components/stream/networkPipelineHelpers.d.ts +12 -0
- package/dist/components/stream/networkRealtimeEncoding.d.ts +41 -0
- package/dist/components/stream/networkTypes.d.ts +104 -5
- package/dist/components/stream/ordinalCanvasRenderers.d.ts +7 -0
- package/dist/components/stream/ordinalCustomLayout.d.ts +17 -1
- package/dist/components/stream/ordinalDataIndex.d.ts +5 -0
- package/dist/components/stream/ordinalDefaultTooltip.d.ts +10 -0
- package/dist/components/stream/ordinalDomain.d.ts +38 -0
- package/dist/components/stream/ordinalPipelineUpdateResults.d.ts +12 -0
- package/dist/components/stream/ordinalPulse.d.ts +10 -0
- package/dist/components/stream/ordinalPulseResources.d.ts +3 -0
- package/dist/components/stream/ordinalSceneBuilders/sceneBuilderMap.d.ts +5 -0
- package/dist/components/stream/ordinalSceneBuilders/types.d.ts +2 -0
- package/dist/components/stream/ordinalSpatialIndex.d.ts +9 -0
- package/dist/components/stream/ordinalTypes.d.ts +56 -8
- package/dist/components/stream/paintNeeds.d.ts +31 -0
- package/dist/components/stream/physics/CapacityQueueController.d.ts +5 -0
- package/dist/components/stream/physics/CapacityQueueTypes.d.ts +134 -0
- package/dist/components/stream/physics/MatterPhysicsEngineAdapter.d.ts +42 -0
- package/dist/components/stream/physics/PhysicsAccessibility.d.ts +48 -0
- package/dist/components/stream/physics/PhysicsAnnotations.d.ts +58 -0
- package/dist/components/stream/physics/PhysicsBodyBudget.d.ts +26 -0
- package/dist/components/stream/physics/PhysicsBodySpatialIndex.d.ts +10 -0
- package/dist/components/stream/physics/PhysicsCanvasTheme.d.ts +26 -0
- package/dist/components/stream/physics/PhysicsControllers.d.ts +75 -0
- package/dist/components/stream/physics/PhysicsEngineAdapter.d.ts +59 -0
- package/dist/components/stream/physics/PhysicsEngineConformance.d.ts +23 -0
- package/dist/components/stream/physics/PhysicsEvidence.d.ts +25 -0
- package/dist/components/stream/physics/PhysicsKernel.d.ts +207 -0
- package/dist/components/stream/physics/PhysicsOptionalEngineAdapters.d.ts +12 -0
- package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +84 -0
- package/dist/components/stream/physics/PhysicsPipelineTypes.d.ts +181 -0
- package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +72 -0
- package/dist/components/stream/physics/PhysicsSediment.d.ts +69 -0
- package/dist/components/stream/physics/PhysicsSettledSVG.d.ts +18 -0
- package/dist/components/stream/physics/PhysicsSettledScene.d.ts +21 -0
- package/dist/components/stream/physics/PhysicsWorkerClient.d.ts +24 -0
- package/dist/components/stream/physics/PhysicsWorkerProtocol.d.ts +101 -0
- package/dist/components/stream/physics/PhysicsWorkerRuntime.d.ts +5 -0
- package/dist/components/stream/physics/RapierPhysicsEngineAdapter.d.ts +18 -0
- package/dist/components/stream/physics/ServiceOperationsControllers.d.ts +27 -0
- package/dist/components/stream/physics/ServiceOperationsTypes.d.ts +89 -0
- package/dist/components/stream/physics/StreamPhysicsFrame.d.ts +6 -0
- package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +302 -0
- package/dist/components/stream/physics/physicsBodyCanvas.d.ts +27 -0
- package/dist/components/stream/physics/physicsPipelineControls.d.ts +4 -0
- package/dist/components/stream/physics/physicsPipelineHelpers.d.ts +41 -0
- package/dist/components/stream/physics/physicsPipelineObservations.d.ts +14 -0
- package/dist/components/stream/physics/physicsPipelineUpdateResults.d.ts +9 -0
- package/dist/components/stream/physics/physicsRegionRuntime.d.ts +54 -0
- package/dist/components/stream/physics/physicsSemanticUI.d.ts +20 -0
- package/dist/components/stream/physics/usePhysicsFrameLifecyclePolicy.d.ts +16 -0
- package/dist/components/stream/pipelineBufferUtils.d.ts +26 -0
- package/dist/components/stream/pipelineConfig.d.ts +177 -0
- package/dist/components/stream/pipelineDecay.d.ts +20 -2
- package/dist/components/stream/pipelineDomainResolution.d.ts +62 -0
- package/dist/components/stream/pipelineIdentityOps.d.ts +26 -0
- package/dist/components/stream/pipelinePulse.d.ts +16 -2
- package/dist/components/stream/pipelineRibbons.d.ts +41 -0
- package/dist/components/stream/pipelineSpatialIndex.d.ts +12 -0
- package/dist/components/stream/pipelineStoreUpdateResults.d.ts +12 -0
- package/dist/components/stream/pipelineStyleResolvers.d.ts +46 -0
- package/dist/components/stream/pipelineTransitions.d.ts +2 -0
- package/dist/components/stream/pipelineUpdateContract.d.ts +62 -0
- package/dist/components/stream/pulseFrameRefresh.d.ts +22 -0
- package/dist/components/stream/renderers/glyphCanvasRenderer.d.ts +6 -0
- package/dist/components/stream/renderers/networkSymbolRenderer.d.ts +2 -0
- package/dist/components/stream/renderers/resolveCSSColor.d.ts +6 -0
- package/dist/components/stream/renderers/symbolCanvasRenderer.d.ts +2 -0
- package/dist/components/stream/sceneRevisionDiagnostics.d.ts +18 -0
- package/dist/components/stream/stalenessBands.d.ts +28 -0
- package/dist/components/stream/streamStoreSync.d.ts +37 -0
- package/dist/components/stream/symbolPath.d.ts +24 -0
- package/dist/components/stream/types.d.ts +206 -9
- package/dist/components/stream/useFrame.d.ts +21 -2
- package/dist/components/stream/useHydration.d.ts +6 -0
- package/dist/components/stream/useLegendCategoryEmission.d.ts +5 -0
- package/dist/components/stream/useStalenessCheck.d.ts +6 -1
- package/dist/components/stream/workerModuleUrl.d.ts +10 -0
- package/dist/components/stream/xyAnnotationAnchors.d.ts +13 -0
- package/dist/components/stream/xyCanvasRenderers.d.ts +7 -0
- package/dist/components/stream/xyCrosshair.d.ts +11 -0
- package/dist/components/stream/xyDateTicks.d.ts +9 -0
- package/dist/components/stream/xyDefaultTooltip.d.ts +10 -0
- package/dist/components/stream/xySceneBuilders/pointScene.d.ts +2 -2
- package/dist/components/stream/xySceneBuilders/types.d.ts +9 -4
- package/dist/controls.min.js +2 -0
- package/dist/controls.module.min.js +2 -0
- package/dist/forceLayoutWorker.js +1 -0
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics-matter.min.js +1 -0
- package/dist/physics-matter.module.min.js +1 -0
- package/dist/physics-rapier.min.js +1 -0
- package/dist/physics-rapier.module.min.js +1 -0
- package/dist/physics.min.js +2 -0
- package/dist/physics.module.min.js +2 -0
- package/dist/physicsWorker.js +1 -0
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/semiotic-ai-chunk-OG7BQUUW.module.min.js +2 -0
- package/dist/semiotic-ai-core.d.ts +47 -0
- package/dist/semiotic-ai-core.min.js +1 -0
- package/dist/semiotic-ai-core.module.min.js +1 -0
- package/dist/semiotic-ai-statisticalOverlays-CY4WKR4A.module.min.js +2 -0
- package/dist/semiotic-ai.d.ts +52 -4
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-chunk-3FSVZ46U.module.min.js +2 -0
- package/dist/semiotic-controls.d.ts +18 -0
- package/dist/semiotic-data.d.ts +2 -0
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-experimental.d.ts +49 -0
- package/dist/semiotic-experimental.min.js +1 -0
- package/dist/semiotic-experimental.module.min.js +1 -0
- package/dist/semiotic-geo.d.ts +11 -0
- package/dist/semiotic-network.d.ts +14 -1
- package/dist/semiotic-ordinal.d.ts +10 -0
- package/dist/semiotic-physics-matter.d.ts +10 -0
- package/dist/semiotic-physics-rapier.d.ts +9 -0
- package/dist/semiotic-physics.d.ts +56 -0
- package/dist/semiotic-realtime-core.d.ts +34 -0
- package/dist/semiotic-realtime-core.min.js +1 -0
- package/dist/semiotic-realtime-core.module.min.js +1 -0
- package/dist/semiotic-realtime-react.d.ts +10 -0
- package/dist/semiotic-realtime-react.min.js +2 -0
- package/dist/semiotic-realtime-react.module.min.js +2 -0
- package/dist/semiotic-realtime.d.ts +4 -22
- package/dist/semiotic-recipes-core.d.ts +92 -0
- package/dist/semiotic-recipes-core.min.js +1 -0
- package/dist/semiotic-recipes-core.module.min.js +1 -0
- package/dist/semiotic-recipes-react.d.ts +7 -0
- package/dist/semiotic-recipes-react.min.js +2 -0
- package/dist/semiotic-recipes-react.module.min.js +2 -0
- package/dist/semiotic-recipes.d.ts +4 -26
- package/dist/semiotic-recipes.min.js +1 -1
- package/dist/semiotic-recipes.module.min.js +1 -1
- package/dist/semiotic-server-edge.d.ts +8 -0
- package/dist/semiotic-server-edge.min.js +1 -0
- package/dist/semiotic-server-edge.module.min.js +1 -0
- package/dist/semiotic-server-node.d.ts +5 -0
- package/dist/semiotic-server-node.min.js +1 -0
- package/dist/semiotic-server-node.module.min.js +1 -0
- package/dist/semiotic-server.d.ts +2 -2
- package/dist/semiotic-statisticalOverlays-UOMSFKVJ.module.min.js +2 -0
- package/dist/semiotic-themes-core.d.ts +53 -0
- package/dist/semiotic-themes-core.min.js +1 -0
- package/dist/semiotic-themes-core.module.min.js +1 -0
- package/dist/semiotic-themes-react.d.ts +4 -0
- package/dist/semiotic-themes-react.min.js +2 -0
- package/dist/semiotic-themes-react.module.min.js +2 -0
- package/dist/semiotic-themes.d.ts +6 -74
- package/dist/semiotic-themes.min.js +1 -2
- package/dist/semiotic-themes.module.min.js +1 -2
- package/dist/semiotic-utils-core.d.ts +46 -0
- package/dist/semiotic-utils-core.min.js +1 -0
- package/dist/semiotic-utils-core.module.min.js +1 -0
- package/dist/semiotic-utils-react.d.ts +5 -0
- package/dist/semiotic-utils-react.min.js +2 -0
- package/dist/semiotic-utils-react.module.min.js +2 -0
- package/dist/semiotic-utils.d.ts +3 -39
- package/dist/semiotic-utils.min.js +1 -2
- package/dist/semiotic-utils.module.min.js +1 -2
- package/dist/semiotic-value.min.js +1 -1
- package/dist/semiotic-value.module.min.js +1 -1
- package/dist/semiotic-xy.d.ts +10 -0
- package/dist/semiotic.d.ts +39 -7
- package/dist/semiotic.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/xy-chunk-IWD6IB6V.module.min.js +2 -0
- package/dist/xy-statisticalOverlays-7RWG6LJT.module.min.js +2 -0
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +246 -86
- package/spec/README.md +152 -0
- package/spec/bindings/README.md +35 -0
- package/spec/bindings/vega-lite.mjs +112 -0
- package/spec/v0.1/annotation-provenance.schema.json +127 -0
- package/spec/v0.1/audience-profile.schema.json +67 -0
- package/spec/v0.1/chart-capability.schema.json +186 -0
- package/dist/semiotic-ai-statisticalOverlays-C2PPlmXv.js +0 -1
- package/dist/semiotic-statisticalOverlays-C3DsOgr_.js +0 -1
- package/dist/xy-statisticalOverlays-C2PPlmXv.js +0 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured failure information emitted when a custom layout throws.
|
|
3
|
+
*
|
|
4
|
+
* Custom layouts run inside imperative stores so an exception cannot reach a
|
|
5
|
+
* React error boundary. Keep this deliberately small and serializable enough
|
|
6
|
+
* for an app's error UI, telemetry, or an imperative frame-handle readback.
|
|
7
|
+
*/
|
|
8
|
+
export type CustomLayoutFamily = "xy" | "ordinal" | "geo" | "network";
|
|
9
|
+
export type CustomLayoutFailureRecovery = "preserved-last-good-scene" | "empty-scene";
|
|
10
|
+
export interface CustomLayoutFailureDiagnostic {
|
|
11
|
+
/** Stable machine-readable failure code. */
|
|
12
|
+
code: "CUSTOM_LAYOUT_ERROR";
|
|
13
|
+
severity: "error";
|
|
14
|
+
phase: "layout";
|
|
15
|
+
/** Frame family whose layout callback threw. */
|
|
16
|
+
component: CustomLayoutFamily;
|
|
17
|
+
/** The callback surface that threw. */
|
|
18
|
+
source: "customLayout" | "customNetworkLayout";
|
|
19
|
+
/** Human-readable summary suitable for a non-blocking error UI. */
|
|
20
|
+
message: string;
|
|
21
|
+
/** A safe, serializable summary of the thrown value. */
|
|
22
|
+
error: {
|
|
23
|
+
name: string;
|
|
24
|
+
message: string;
|
|
25
|
+
};
|
|
26
|
+
/** Whether a prior custom-layout scene remained visible. */
|
|
27
|
+
recovery: CustomLayoutFailureRecovery;
|
|
28
|
+
/** Convenience mirror of `recovery` for simple caller branching. */
|
|
29
|
+
preservedLastGoodScene: boolean;
|
|
30
|
+
/** Store revision at which the failed layout attempt occurred. */
|
|
31
|
+
affectedRevision: number;
|
|
32
|
+
}
|
|
33
|
+
export declare function createCustomLayoutFailureDiagnostic(component: CustomLayoutFamily, error: unknown, preservedLastGoodScene: boolean, affectedRevision: number): CustomLayoutFailureDiagnostic;
|
|
@@ -7,11 +7,15 @@ import { schemeCategory10 } from "../charts/shared/colorPalettes";
|
|
|
7
7
|
* call this helper.
|
|
8
8
|
*
|
|
9
9
|
* Precedence:
|
|
10
|
-
* 1.
|
|
11
|
-
*
|
|
10
|
+
* 1. Object map `{ key: color }` — its values become the palette (so
|
|
11
|
+
* `theme.categorical` reflects the map). Pair with `buildResolveColor`,
|
|
12
|
+
* which returns the *exact* mapped color per key; this palette only
|
|
13
|
+
* feeds unmapped keys and `theme.categorical`.
|
|
14
|
+
* 2. Explicit `colorScheme` array — used as-is.
|
|
15
|
+
* 3. Named scheme string (e.g. "tableau10") — looked up in
|
|
12
16
|
* `COLOR_SCHEMES`. Unknown names fall through.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
17
|
+
* 4. Theme categorical (when non-empty).
|
|
18
|
+
* 5. The provided fallback palette.
|
|
15
19
|
*
|
|
16
20
|
* @param colorScheme `colorScheme` from the chart's pipeline config
|
|
17
21
|
* @param themeCategorical `themeCategorical` from theme resolution
|
|
@@ -19,11 +23,17 @@ import { schemeCategory10 } from "../charts/shared/colorPalettes";
|
|
|
19
23
|
* Network passes `schemeCategory10`; ordinal passes
|
|
20
24
|
* `STREAMING_PALETTE`. Caller's choice.
|
|
21
25
|
*/
|
|
22
|
-
export declare function resolveCustomLayoutPalette(colorScheme: string | string[] | undefined, themeCategorical: string[] | undefined, fallback: readonly string[]): readonly string[];
|
|
26
|
+
export declare function resolveCustomLayoutPalette(colorScheme: string | string[] | Record<string, string> | undefined, themeCategorical: string[] | undefined, fallback: readonly string[]): readonly string[];
|
|
23
27
|
/**
|
|
24
|
-
* Build a stable
|
|
25
|
-
*
|
|
26
|
-
*
|
|
28
|
+
* Build a stable key → color resolver. Used by the network and ordinal
|
|
29
|
+
* customLayout contexts so the same key always returns the same color for
|
|
30
|
+
* the lifetime of the closure.
|
|
31
|
+
*
|
|
32
|
+
* When `colorScheme` is an object map `{ key: color }`, a key present in the
|
|
33
|
+
* map resolves to its *exact* color (the documented "exact per-category
|
|
34
|
+
* colors" contract); keys absent from the map hash into `palette` as usual.
|
|
35
|
+
* Non-object `colorScheme` values are ignored here — pass the already-resolved
|
|
36
|
+
* `palette` from `resolveCustomLayoutPalette` for those.
|
|
27
37
|
*/
|
|
28
|
-
export declare function buildResolveColor(palette: readonly string[]): (key: string) => string;
|
|
38
|
+
export declare function buildResolveColor(palette: readonly string[], colorScheme?: string | string[] | Record<string, string>): (key: string) => string;
|
|
29
39
|
export { schemeCategory10, STREAMING_PALETTE };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { Datum } from "../charts/shared/datumTypes";
|
|
3
|
+
/**
|
|
4
|
+
* The shared-selection state projected to a custom layout — both into the layout
|
|
5
|
+
* context (`ctx.selection`) and, via {@link useCustomLayoutSelection}, into the
|
|
6
|
+
* layout's React `overlays` subtree.
|
|
7
|
+
*
|
|
8
|
+
* `isActive` is `false` when no selection clause is present (treat every mark as
|
|
9
|
+
* selected). `predicate(datum)` returns `true` when the raw datum matches the
|
|
10
|
+
* active selection.
|
|
11
|
+
*/
|
|
12
|
+
export interface CustomLayoutSelection {
|
|
13
|
+
isActive: boolean;
|
|
14
|
+
predicate: (datum: Datum) => boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Provided by the Stream Frames around a custom layout's `overlays`. The value
|
|
18
|
+
* is the chart's resolved selection; it updates on hover/selection change
|
|
19
|
+
* **without** the frame re-running the layout — so an overlay that subscribes
|
|
20
|
+
* via {@link useCustomLayoutSelection} restyles itself while sceneNodes, the
|
|
21
|
+
* canvas paint, and the quadtree stay untouched.
|
|
22
|
+
*/
|
|
23
|
+
export declare function CustomLayoutSelectionProvider({ value, children, }: {
|
|
24
|
+
value: CustomLayoutSelection | null;
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
}): React.ReactElement;
|
|
27
|
+
/**
|
|
28
|
+
* Read the chart's resolved selection from inside a custom layout's `overlays`.
|
|
29
|
+
*
|
|
30
|
+
* Subscribing components re-render on selection/hover change **without a
|
|
31
|
+
* relayout** — the frame swaps only the context value, never rebuilding the
|
|
32
|
+
* scene. This is the read side of the styling channel; pair it with the
|
|
33
|
+
* `restyle` callback on the layout result to dim/highlight **canvas** marks
|
|
34
|
+
* without re-positioning.
|
|
35
|
+
*
|
|
36
|
+
* Returns an inactive selection (`isActive: false`, predicate always `true`)
|
|
37
|
+
* when called outside a custom chart, so overlays render fully-lit by default.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* function ClusterLabel({ datum, x, y }) {
|
|
42
|
+
* const { isActive, predicate } = useCustomLayoutSelection()
|
|
43
|
+
* const dim = isActive && !predicate(datum)
|
|
44
|
+
* return <text x={x} y={y} opacity={dim ? 0.15 : 1}>{datum.label}</text>
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare function useCustomLayoutSelection(): CustomLayoutSelection;
|
|
49
|
+
/** Wrap a custom layout's overlay node in the selection provider (no-op for a
|
|
50
|
+
* null node, so an empty overlay layer stays empty rather than becoming a
|
|
51
|
+
* provider element). Used by the Stream Frames. */
|
|
52
|
+
export declare function wrapWithCustomLayoutSelection(node: React.ReactNode, selection: CustomLayoutSelection | null): React.ReactNode;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface FrameThemeColors {
|
|
2
|
+
axisStroke: string;
|
|
3
|
+
tickText: string;
|
|
4
|
+
crosshair: string;
|
|
5
|
+
hoverFill: string;
|
|
6
|
+
hoverStroke: string;
|
|
7
|
+
pointRing: string;
|
|
8
|
+
/** Primary accent — crosshair / highlight fallback when datum has no color. */
|
|
9
|
+
primary: string;
|
|
10
|
+
/** Chart background from `--semiotic-bg` / surface tokens (may be empty). */
|
|
11
|
+
background: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const LIGHT_FRAME_THEME: FrameThemeColors;
|
|
14
|
+
/**
|
|
15
|
+
* Append a 2-char hex alpha to an existing CSS color.
|
|
16
|
+
* Expands 3-char hex; converts rgb() to rgba(); passes other forms through.
|
|
17
|
+
*/
|
|
18
|
+
export declare function withAlpha(color: string, alphaHex: string): string;
|
|
19
|
+
export declare function resolveFrameThemeColors(el: HTMLElement | null): FrameThemeColors;
|
|
20
|
+
/** Version-keyed cache for a frame instance's theme colors. */
|
|
21
|
+
export declare function createFrameThemeColorCache(): {
|
|
22
|
+
resolve(el: HTMLElement | null): FrameThemeColors;
|
|
23
|
+
invalidate(): void;
|
|
24
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Harvest annotation anchors from a geo scene graph.
|
|
3
|
+
* Point marks pass through; glyph marks contribute drawn-bounds center + radius
|
|
4
|
+
* so `{ pointId }` annotations resolve against pictograms too.
|
|
5
|
+
*/
|
|
6
|
+
import type { GeoSceneNode } from "./geoTypes";
|
|
7
|
+
import type { SceneNode } from "./types";
|
|
8
|
+
export type GeoAnnotationAnchor = {
|
|
9
|
+
pointId?: string;
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
r: number;
|
|
13
|
+
};
|
|
14
|
+
export declare function collectGeoAnnotationAnchors(scene: (GeoSceneNode | SceneNode)[] | undefined): GeoAnnotationAnchor[] | undefined;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Distance-cartogram projection of geo point scene nodes.
|
|
3
|
+
* Mutates point/line positions in place; returns layout metadata for overlays.
|
|
4
|
+
*/
|
|
5
|
+
import type { DistanceCartogramConfig, GeoSceneNode } from "./geoTypes";
|
|
6
|
+
import type { StreamLayout } from "./types";
|
|
7
|
+
export type GeoCartogramLayout = {
|
|
8
|
+
cx: number;
|
|
9
|
+
cy: number;
|
|
10
|
+
maxCost: number;
|
|
11
|
+
availableRadius: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Apply a distance cartogram transform to the scene.
|
|
15
|
+
* Returns layout info when applied, or null when skipped.
|
|
16
|
+
*/
|
|
17
|
+
export declare function applyDistanceCartogram(scene: GeoSceneNode[], transform: DistanceCartogramConfig, layout: StreamLayout, areasLength: number): GeoCartogramLayout | null;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { Datum } from "../charts/shared/datumTypes";
|
|
3
|
+
import type { MarginType } from "../types/marginType";
|
|
4
|
+
import type { GeoScales, GeoSceneNode } from "./geoTypes";
|
|
5
|
+
import type { CustomLayoutSelection } from "./customLayoutSelection";
|
|
6
|
+
import type { Style, ThemeSemanticColors } from "./types";
|
|
7
|
+
/**
|
|
8
|
+
* Custom-layout escape hatch for `StreamGeoFrame`.
|
|
9
|
+
*
|
|
10
|
+
* The frame resolves and fits the geographic projection before invoking the
|
|
11
|
+
* layout. The layout may use those geographic scales, replace the built-in
|
|
12
|
+
* geometry entirely, or combine both approaches while continuing to emit the
|
|
13
|
+
* GeoFrame scene primitives (`geoarea`, `point`, and `line`).
|
|
14
|
+
*/
|
|
15
|
+
export type GeoCustomLayout<C extends object = Record<string, unknown>> = (ctx: GeoLayoutContext<C>) => GeoLayoutResult;
|
|
16
|
+
export interface GeoLayoutContext<C extends object = Record<string, unknown>> {
|
|
17
|
+
/** Geographic areas supplied to the frame. */
|
|
18
|
+
areas: GeoJSON.Feature[];
|
|
19
|
+
/** Buffered point data supplied through props or the push API. */
|
|
20
|
+
points: Datum[];
|
|
21
|
+
/** Line/flow records supplied to the frame. */
|
|
22
|
+
lines: Datum[];
|
|
23
|
+
/** Frame-fitted projection helpers. */
|
|
24
|
+
scales: GeoScales;
|
|
25
|
+
/** Plot-local geometry. Scene-node coordinates are relative to this plot. */
|
|
26
|
+
dimensions: {
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
margin: MarginType;
|
|
30
|
+
plot: {
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
width: number;
|
|
34
|
+
height: number;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
/** Theme-resolved semantic and categorical colors. */
|
|
38
|
+
theme: {
|
|
39
|
+
semantic: ThemeSemanticColors;
|
|
40
|
+
categorical: string[];
|
|
41
|
+
};
|
|
42
|
+
/** Resolve a stable categorical color from the active palette. */
|
|
43
|
+
resolveColor: (key: string) => string;
|
|
44
|
+
/** User configuration threaded through `layoutConfig`. */
|
|
45
|
+
config: C;
|
|
46
|
+
/** Shared-selection projection, when the chart participates in one. */
|
|
47
|
+
selection?: CustomLayoutSelection | null;
|
|
48
|
+
}
|
|
49
|
+
export interface GeoLayoutResult {
|
|
50
|
+
/** Geo scene nodes rendered on canvas and serialized for SSR. */
|
|
51
|
+
nodes?: GeoSceneNode[];
|
|
52
|
+
/** SVG graphics composited above the canvas. */
|
|
53
|
+
overlays?: ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* Selection-only style updates that do not require rebuilding geometry.
|
|
56
|
+
* Patches are merged onto the node's original emitted style.
|
|
57
|
+
*/
|
|
58
|
+
restyle?: (node: GeoSceneNode, selection: CustomLayoutSelection | null) => Partial<Style> | void;
|
|
59
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default geo hover tooltip for StreamGeoFrame.
|
|
3
|
+
* Uses shared `defaultTooltipStyle` for theme CSS-var consistency.
|
|
4
|
+
*/
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import type { HoverData } from "../realtime/types";
|
|
7
|
+
type GeoTooltipData = HoverData | null;
|
|
8
|
+
declare function DefaultGeoTooltip({ data }: {
|
|
9
|
+
data: GeoTooltipData;
|
|
10
|
+
}): React.JSX.Element | null;
|
|
11
|
+
export { DefaultGeoTooltip };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Small StreamGeoFrame helpers: particle conservation defaults, zoom chrome,
|
|
3
|
+
* projection name resolution, and hit-canvas context acquisition.
|
|
4
|
+
*/
|
|
5
|
+
import type * as React from "react";
|
|
6
|
+
import type { Selection } from "d3-selection";
|
|
7
|
+
import type { ZoomTransform } from "d3-zoom";
|
|
8
|
+
import type { Datum } from "../charts/shared/datumTypes";
|
|
9
|
+
import type { ProjectionName, ProjectionProp } from "./geoTypes";
|
|
10
|
+
export declare const DEFAULT_GEO_MARGIN: {
|
|
11
|
+
top: number;
|
|
12
|
+
right: number;
|
|
13
|
+
bottom: number;
|
|
14
|
+
left: number;
|
|
15
|
+
};
|
|
16
|
+
export declare const DEFAULT_GEO_HOVER_RADIUS = 30;
|
|
17
|
+
export declare function shouldConserveGeoParticles(): boolean;
|
|
18
|
+
export declare function defaultGeoParticleMaxPerLine(): number;
|
|
19
|
+
export declare function defaultGeoParticleSpawnRate(): number;
|
|
20
|
+
export declare const zoomButtonStyle: React.CSSProperties;
|
|
21
|
+
export type GeoFeatureLike = Datum & {
|
|
22
|
+
properties?: Datum;
|
|
23
|
+
geometry?: unknown;
|
|
24
|
+
data?: Datum;
|
|
25
|
+
};
|
|
26
|
+
export type HitCanvas = HTMLCanvasElement | OffscreenCanvas;
|
|
27
|
+
export type HitCanvasContext = CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D;
|
|
28
|
+
export type GeoZoomSelection = Selection<HTMLDivElement, unknown, null, undefined>;
|
|
29
|
+
export interface GeoZoomControlBehavior {
|
|
30
|
+
scaleBy(selection: GeoZoomSelection, factor: number): void;
|
|
31
|
+
transform(selection: GeoZoomSelection, transform: ZoomTransform | Pick<ZoomTransform, "k">): void;
|
|
32
|
+
}
|
|
33
|
+
export declare function resolveProjectionName(projection: ProjectionProp): ProjectionName | null;
|
|
34
|
+
export declare function ensureHitCanvasContext(canvas: HitCanvas | null): HitCanvasContext | null;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure geo pipeline helpers — projection resolution, accessors, themed defaults,
|
|
3
|
+
* anti-meridian path splitting, and flow-style arc/offset builders.
|
|
4
|
+
* Extracted from GeoPipelineStore so the store class stays orchestration-only.
|
|
5
|
+
*/
|
|
6
|
+
import type { GeoProjection } from "d3-geo";
|
|
7
|
+
import type { GeoPipelineConfig, ProjectionProp } from "./geoTypes";
|
|
8
|
+
import type { Style } from "./types";
|
|
9
|
+
import type { Datum } from "../charts/shared/datumTypes";
|
|
10
|
+
export declare function resolveProjection(prop: ProjectionProp | undefined): GeoProjection;
|
|
11
|
+
export declare function makeGeoNumericAccessor(acc: string | ((d: Datum) => number) | undefined, fallback: string): (d: Datum) => number;
|
|
12
|
+
export declare function makeLineDataAccessor(acc: string | ((d: Datum) => any[]) | undefined): (d: Datum) => any[];
|
|
13
|
+
export declare function resolveGeoStyle(styleProp: Style | ((d: Datum) => Style) | undefined, datum: any, defaults: Style): Style;
|
|
14
|
+
export declare function themedDefaultArea(config: GeoPipelineConfig): Style;
|
|
15
|
+
export declare function themedDefaultPoint(config: GeoPipelineConfig): Style & {
|
|
16
|
+
r?: number;
|
|
17
|
+
};
|
|
18
|
+
export declare function themedDefaultLine(config: GeoPipelineConfig): Style;
|
|
19
|
+
/**
|
|
20
|
+
* Detect screen-space jumps in a projected path that indicate the line
|
|
21
|
+
* has wrapped around the edge of the projection (anti-meridian crossing).
|
|
22
|
+
* Split the path at those jumps and return an array of continuous segments.
|
|
23
|
+
*
|
|
24
|
+
* A jump is detected when consecutive screen-space points are further apart
|
|
25
|
+
* than `threshold` pixels (default: half the viewport width).
|
|
26
|
+
*/
|
|
27
|
+
export declare function splitAntiMeridianPath(screenPath: [number, number][], viewportWidth: number): [number, number][][];
|
|
28
|
+
/**
|
|
29
|
+
* Build a quadratic arc path between two screen-space points.
|
|
30
|
+
* The arc bulges perpendicular to the straight line (right of the
|
|
31
|
+
* direction of travel in screen coords), with height proportional to distance.
|
|
32
|
+
*/
|
|
33
|
+
export declare function buildArcPath(start: [number, number], end: [number, number], segments?: number): [number, number][];
|
|
34
|
+
/**
|
|
35
|
+
* Build an offset version of a densified geo screen path.
|
|
36
|
+
* Shifts each point along its local normal so the great-circle curvature
|
|
37
|
+
* is preserved while visually separating overlapping flows.
|
|
38
|
+
*/
|
|
39
|
+
export declare function buildOffsetGeoPath(screenPath: [number, number][], strokeWidth: number): [number, number][];
|
|
40
|
+
/**
|
|
41
|
+
* Build an offset path — shift a straight line perpendicular to its direction.
|
|
42
|
+
* All flows are offset to their left by half their stroke width plus padding.
|
|
43
|
+
* Bidirectional pairs (A->B and B->A) naturally separate because their
|
|
44
|
+
* left-hand normals point to opposite sides.
|
|
45
|
+
*/
|
|
46
|
+
export declare function buildOffsetPath(start: [number, number], end: [number, number], _flow: any, _allFlows: any[], strokeWidth: number): [number, number][];
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import type { GeoProjection, GeoPath, GeoPermissibleObjects } from "d3-geo";
|
|
3
3
|
import type { GradientLegendConfig, LegendGroup, LegendLayout } from "../types/legendTypes";
|
|
4
|
-
import type { Style, DecayConfig, PulseConfig, TransitionConfig, StalenessConfig, SceneDatum, PointSceneNode, ThemeSemanticColors } from "./types";
|
|
4
|
+
import type { Style, DecayConfig, PulseConfig, TransitionConfig, StalenessConfig, SceneDatum, PointSceneNode, GlyphSceneNode, ThemeSemanticColors, SceneAccessibilityMetadata } from "./types";
|
|
5
5
|
import type { AnimateProp } from "./pipelineTransitionUtils";
|
|
6
6
|
import type { HoverAnnotationConfig, HoverData } from "../realtime/types";
|
|
7
7
|
import type { GeoParticleStyle } from "./GeoParticlePool";
|
|
8
8
|
import type { Datum } from "../charts/shared/datumTypes";
|
|
9
9
|
import type { AutoPlaceAnnotations } from "../recipes/annotationLayout";
|
|
10
|
+
import type { MarginType } from "../types/marginType";
|
|
11
|
+
import type { GeoCustomLayout } from "./geoCustomLayout";
|
|
12
|
+
import type { CustomLayoutSelection } from "./customLayoutSelection";
|
|
13
|
+
import type { CustomLayoutFailureDiagnostic } from "./customLayoutFailure";
|
|
10
14
|
export type ProjectionProp = GeoProjection | ProjectionName | ProjectionConfig;
|
|
11
15
|
export type ProjectionName = "mercator" | "equalEarth" | "albersUsa" | "orthographic" | "naturalEarth" | "equirectangular";
|
|
12
16
|
export interface ProjectionConfig {
|
|
@@ -41,6 +45,8 @@ export interface GeoAreaSceneNode {
|
|
|
41
45
|
screenArea: number;
|
|
42
46
|
style: Style;
|
|
43
47
|
datum: SceneDatum;
|
|
48
|
+
accessibleDatum?: SceneAccessibilityMetadata["accessibleDatum"];
|
|
49
|
+
accessibility?: SceneAccessibilityMetadata["accessibility"];
|
|
44
50
|
group?: string;
|
|
45
51
|
interactive?: boolean;
|
|
46
52
|
/** Lazily-cached Path2D parsed from pathData (avoids re-parsing on every hit test) */
|
|
@@ -54,10 +60,13 @@ export interface GeoLineSceneNode {
|
|
|
54
60
|
path: [number, number][];
|
|
55
61
|
style: Style;
|
|
56
62
|
datum: SceneDatum;
|
|
63
|
+
accessibleDatum?: SceneAccessibilityMetadata["accessibleDatum"];
|
|
64
|
+
accessibility?: SceneAccessibilityMetadata["accessibility"];
|
|
57
65
|
group?: string;
|
|
58
66
|
}
|
|
59
|
-
/** Union of all scene node types that GeoFrame produces
|
|
60
|
-
|
|
67
|
+
/** Union of all scene node types that GeoFrame produces. `GlyphSceneNode`
|
|
68
|
+
* joins for custom geo layouts — projected pictograms standing on the map. */
|
|
69
|
+
export type GeoSceneNode = GeoAreaSceneNode | PointSceneNode | GlyphSceneNode | GeoLineSceneNode;
|
|
61
70
|
export interface GeoScales {
|
|
62
71
|
projection: GeoProjection;
|
|
63
72
|
geoPath: GeoPath<any, GeoPermissibleObjects>;
|
|
@@ -67,7 +76,12 @@ export interface GeoScales {
|
|
|
67
76
|
export interface GeoPipelineConfig {
|
|
68
77
|
projection: ProjectionProp;
|
|
69
78
|
projectionExtent?: [[number, number], [number, number]];
|
|
70
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* Auto-fit padding as a **fraction** of the plot (0–0.5), not pixels.
|
|
81
|
+
* `0.1` insets the fitted geography 10% from each edge. A value `>= 1` is
|
|
82
|
+
* almost always a pixel mistake and collapses the projection off-canvas.
|
|
83
|
+
* @default 0
|
|
84
|
+
*/
|
|
71
85
|
fitPadding?: number;
|
|
72
86
|
xAccessor?: string | ((d: Datum) => number);
|
|
73
87
|
yAccessor?: string | ((d: Datum) => number);
|
|
@@ -80,7 +94,7 @@ export interface GeoPipelineConfig {
|
|
|
80
94
|
r?: number;
|
|
81
95
|
};
|
|
82
96
|
lineStyle?: Style | ((d: Datum, group?: string) => Style);
|
|
83
|
-
colorScheme?: string | string[]
|
|
97
|
+
colorScheme?: string | string[] | Record<string, string>;
|
|
84
98
|
/** Theme-resolved semantic role colors — default fallback before hardcoded hex. See `ThemeSemanticColors` in ./types. */
|
|
85
99
|
themeSemantic?: ThemeSemanticColors;
|
|
86
100
|
/** Theme sequential scheme name — fallback for ChoroplethMap when colorScheme is not set. */
|
|
@@ -99,15 +113,36 @@ export interface GeoPipelineConfig {
|
|
|
99
113
|
pointIdAccessor?: string | ((d: Datum) => string);
|
|
100
114
|
/** ID accessor on line data — required for `removeLine` by id. */
|
|
101
115
|
lineIdAccessor?: string | ((d: Datum) => string);
|
|
116
|
+
customLayout?: GeoCustomLayout;
|
|
117
|
+
layoutConfig?: object;
|
|
118
|
+
layoutMargin?: MarginType;
|
|
119
|
+
layoutSelection?: CustomLayoutSelection | null;
|
|
120
|
+
/** Receives structured information if `customLayout` throws. */
|
|
121
|
+
onLayoutError?: (diagnostic: CustomLayoutFailureDiagnostic) => void;
|
|
122
|
+
themeCategorical?: string[];
|
|
102
123
|
}
|
|
103
124
|
export interface StreamGeoFrameProps<T = Datum> {
|
|
104
125
|
projection: ProjectionProp;
|
|
105
126
|
projectionExtent?: [[number, number], [number, number]];
|
|
106
|
-
/**
|
|
127
|
+
/**
|
|
128
|
+
* Auto-fit padding as a **fraction** of the plot (0–0.5), not pixels.
|
|
129
|
+
* `0.1` insets the fitted geography 10% from each edge. A value `>= 1` is
|
|
130
|
+
* almost always a pixel mistake and collapses the projection off-canvas.
|
|
131
|
+
* @default 0
|
|
132
|
+
*/
|
|
107
133
|
fitPadding?: number;
|
|
108
134
|
areas?: GeoJSON.Feature[];
|
|
109
135
|
points?: T[];
|
|
110
136
|
lines?: T[];
|
|
137
|
+
/** Replace built-in area/line/point scene construction with a custom layout. */
|
|
138
|
+
customLayout?: GeoCustomLayout;
|
|
139
|
+
/** User configuration threaded to `GeoLayoutContext.config`. */
|
|
140
|
+
layoutConfig?: object;
|
|
141
|
+
/** Shared-selection projection supplied by `GeoCustomChart`. */
|
|
142
|
+
layoutSelection?: CustomLayoutSelection | null;
|
|
143
|
+
/** Receives structured information if `customLayout` throws. The prior
|
|
144
|
+
* successful scene remains visible when one is available. */
|
|
145
|
+
onLayoutError?: (diagnostic: CustomLayoutFailureDiagnostic) => void;
|
|
111
146
|
xAccessor?: string | ((d: T) => number);
|
|
112
147
|
yAccessor?: string | ((d: T) => number);
|
|
113
148
|
lineDataAccessor?: string | ((d: T) => Datum[]);
|
|
@@ -160,7 +195,7 @@ export interface StreamGeoFrameProps<T = Datum> {
|
|
|
160
195
|
r?: number;
|
|
161
196
|
};
|
|
162
197
|
lineStyle?: Style | ((d: Datum, group?: string) => Style);
|
|
163
|
-
colorScheme?: string | string[]
|
|
198
|
+
colorScheme?: string | string[] | Record<string, string>;
|
|
164
199
|
/**
|
|
165
200
|
* Categorical color field. For ChoroplethMap reads from area `properties`
|
|
166
201
|
* (or top-level fallback); for ProportionalSymbolMap reads from each point.
|
|
@@ -173,6 +208,12 @@ export interface StreamGeoFrameProps<T = Datum> {
|
|
|
173
208
|
enableHover?: boolean;
|
|
174
209
|
hoverAnnotation?: boolean | HoverAnnotationConfig;
|
|
175
210
|
tooltipContent?: (d: HoverData) => ReactNode;
|
|
211
|
+
/**
|
|
212
|
+
* Allow chart-local tooltips to extend beyond the frame bounds.
|
|
213
|
+
* Useful when a non-portal tooltip should overlap adjacent chart chrome.
|
|
214
|
+
* @default false
|
|
215
|
+
*/
|
|
216
|
+
allowTooltipOverflow?: boolean;
|
|
176
217
|
customClickBehavior?: (d: HoverData | null) => void;
|
|
177
218
|
customHoverBehavior?: (d: HoverData | null) => void;
|
|
178
219
|
annotations?: Datum[];
|
|
@@ -244,4 +285,12 @@ export interface StreamGeoFrameHandle {
|
|
|
244
285
|
resetZoom(): void;
|
|
245
286
|
/** Get current data points */
|
|
246
287
|
getData(): Datum[];
|
|
288
|
+
/** The most recent custom layout result — host readback so pages that need
|
|
289
|
+
* the computed placement don't re-run the layout. Null before the first
|
|
290
|
+
* layout or when no custom layout is configured. A failed retry retains the
|
|
291
|
+
* prior good result; inspect `getLayoutFailure()` to distinguish recovery. */
|
|
292
|
+
getCustomLayout(): import("./geoCustomLayout").GeoLayoutResult | null;
|
|
293
|
+
/** The most recent custom-layout failure, or null after a successful retry,
|
|
294
|
+
* clear, or explicit removal of `customLayout`. */
|
|
295
|
+
getLayoutFailure(): CustomLayoutFailureDiagnostic | null;
|
|
247
296
|
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Glyph definitions — the composite-pictogram sibling of `symbolPath.ts`.
|
|
3
|
+
*
|
|
4
|
+
* A `symbol` scene node is one path; a `glyph` scene node is a small
|
|
5
|
+
* multi-part vector pictogram (an ISOTYPE sign: a server cabinet with accent
|
|
6
|
+
* vents, a factory with windows) defined once in definition space and stamped
|
|
7
|
+
* per datum with per-node color, accent, size, and partial fill. The same
|
|
8
|
+
* `GlyphDef` renders identically on canvas (`drawGlyphParts`), in SVG/SSR
|
|
9
|
+
* (`SceneToSVG`), and in any React chrome the host draws, because everything
|
|
10
|
+
* reads these helpers.
|
|
11
|
+
*
|
|
12
|
+
* Paint roles, not colors: parts declare `fill: "color" | "accent"` (or a
|
|
13
|
+
* literal CSS color) and the node supplies the actual paints — one definition
|
|
14
|
+
* serves every category/status recoloring, exactly how classic pictogram
|
|
15
|
+
* plates reused one cut in many inks.
|
|
16
|
+
*/
|
|
17
|
+
/** One drawable part of a glyph, in definition coordinates. */
|
|
18
|
+
export interface GlyphPart {
|
|
19
|
+
/** SVG path data in definition (viewBox) coordinates. */
|
|
20
|
+
d: string;
|
|
21
|
+
/**
|
|
22
|
+
* Fill paint: `"color"` (the node's primary paint), `"accent"` (the node's
|
|
23
|
+
* accent paint), `"none"`, or a literal CSS color. @default "color"
|
|
24
|
+
*/
|
|
25
|
+
fill?: "color" | "accent" | "none" | (string & {});
|
|
26
|
+
/** Stroke paint, same tokens as `fill`. @default "none" */
|
|
27
|
+
stroke?: "color" | "accent" | "none" | (string & {});
|
|
28
|
+
/** Stroke width in definition units — scales with the glyph. */
|
|
29
|
+
strokeWidth?: number;
|
|
30
|
+
/** Part opacity, multiplied into the node's opacity. */
|
|
31
|
+
opacity?: number;
|
|
32
|
+
strokeLinecap?: "butt" | "round" | "square";
|
|
33
|
+
strokeLinejoin?: "miter" | "round" | "bevel";
|
|
34
|
+
}
|
|
35
|
+
/** A reusable multi-part pictogram definition. */
|
|
36
|
+
export interface GlyphDef {
|
|
37
|
+
/** Definition-space box `[width, height]` the parts are drawn in. @default [40, 40] */
|
|
38
|
+
viewBox?: [number, number];
|
|
39
|
+
/**
|
|
40
|
+
* Which point of the viewBox lands on the node's `(x, y)`, as fractions.
|
|
41
|
+
* `[0.5, 0.5]` centers the glyph (the default); `[0.5, 1]` anchors its feet
|
|
42
|
+
* — the "standing on a baseline/terrain" pictogram convention.
|
|
43
|
+
*/
|
|
44
|
+
anchor?: [number, number];
|
|
45
|
+
parts: GlyphPart[];
|
|
46
|
+
}
|
|
47
|
+
export declare const DEFAULT_GLYPH_VIEWBOX: [number, number];
|
|
48
|
+
export declare const DEFAULT_GLYPH_ANCHOR: [number, number];
|
|
49
|
+
/** Resolved placement of a glyph node: scale plus the top-left corner offset
|
|
50
|
+
* from the node's (x, y), honoring the definition's anchor. */
|
|
51
|
+
export interface GlyphPlacement {
|
|
52
|
+
width: number;
|
|
53
|
+
height: number;
|
|
54
|
+
scale: number;
|
|
55
|
+
/** Add to the node's x to get the drawn top-left corner. */
|
|
56
|
+
offsetX: number;
|
|
57
|
+
/** Add to the node's y to get the drawn top-left corner. */
|
|
58
|
+
offsetY: number;
|
|
59
|
+
}
|
|
60
|
+
/** Size is the rendered **height** in px; width follows the viewBox aspect.
|
|
61
|
+
* (Pictogram sizing is a height, unlike the d3-symbol area convention.) */
|
|
62
|
+
export declare function glyphPlacement(def: GlyphDef, size: number): GlyphPlacement;
|
|
63
|
+
/** Radius from the node's (x, y) that bounds the drawn glyph — used for hit
|
|
64
|
+
* testing and keyboard-navigation focus geometry. */
|
|
65
|
+
export declare function glyphExtent(def: GlyphDef, size: number): number;
|
|
66
|
+
/**
|
|
67
|
+
* Resolve a part's paint token against the node's paints. Returns `undefined`
|
|
68
|
+
* for `"none"`/absent so callers can skip the fill/stroke entirely.
|
|
69
|
+
*/
|
|
70
|
+
export declare function resolveGlyphPaint(token: string | undefined, color: string | undefined, accent: string | undefined, fallback?: string): string | undefined;
|
|
71
|
+
export declare function getGlyphPath2D(d: string): Path2D | null;
|
|
72
|
+
/** The shared fraction geometry for partial glyph fills: the clip rect in
|
|
73
|
+
* definition space covering `[fractionStart, fraction]` of the glyph. */
|
|
74
|
+
export declare function glyphFractionClipRect(def: GlyphDef, fraction: number, fractionStart?: number, direction?: "horizontal" | "vertical"): {
|
|
75
|
+
x: number;
|
|
76
|
+
y: number;
|
|
77
|
+
width: number;
|
|
78
|
+
height: number;
|
|
79
|
+
} | null;
|
|
80
|
+
/** Hit/focus geometry of a glyph node: the drawn bounds' center offset from
|
|
81
|
+
* the node's (x, y) plus its half-extents — shared by the four hit testers
|
|
82
|
+
* and the keyboard-nav extractors so pointer and focus agree exactly. */
|
|
83
|
+
export declare function glyphHitGeometry(def: GlyphDef, size: number): {
|
|
84
|
+
centerDx: number;
|
|
85
|
+
centerDy: number;
|
|
86
|
+
halfWidth: number;
|
|
87
|
+
halfHeight: number;
|
|
88
|
+
radius: number;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Paint a glyph's parts onto a canvas context. The caller has already
|
|
92
|
+
* translated/scaled into definition space (via {@link glyphPlacement}) and
|
|
93
|
+
* set global alpha; this draws parts with the node's paints. `paintOverride`
|
|
94
|
+
* paints every part in one flat color — the ghost-silhouette pass under a
|
|
95
|
+
* partial fill. `resolvePaint` maps a computed paint through the renderer's
|
|
96
|
+
* CSS-var resolution before it hits the canvas.
|
|
97
|
+
*/
|
|
98
|
+
export declare function drawGlyphParts(ctx: CanvasRenderingContext2D, def: GlyphDef, color: string | undefined, accent: string | undefined, paintOverride?: string, resolvePaint?: (paint: string) => string): void;
|