semiotic 3.8.8 → 3.9.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/README.md +82 -66
- package/agent-skill/semiotic-charts/SKILL.md +11 -2
- package/ai/behaviorContracts.cjs +33 -3
- package/ai/cli.js +53 -2
- package/ai/componentMetadata.cjs +15 -0
- package/ai/dist/mcp-server.js +1530 -611
- package/ai/examples.md +48 -42
- package/{CLAUDE.md → ai/reference.md} +46 -24
- package/ai/schema.json +10704 -825
- package/ai/surface-manifest.json +643 -2
- package/ai/system-prompt.md +83 -130
- package/dist/c-3BLJEQNG.min.js +1 -0
- package/dist/c-3KZD6AXJ.min.js +1 -0
- package/dist/c-4TWEX5HG.min.js +1 -0
- package/dist/c-52TEGIUJ.min.js +1 -0
- package/dist/c-5YCIX3VZ.min.js +1 -0
- package/dist/c-6FEKTA3U.min.js +1 -0
- package/dist/c-6O5EVOPH.min.js +1 -0
- package/dist/c-74HEEZGK.min.js +1 -0
- package/dist/c-AKAF6JAD.min.js +1 -0
- package/dist/c-BBKITSXB.min.js +1 -0
- package/dist/c-BWNB6USU.min.js +1 -0
- package/dist/c-C25ENHIK.min.js +1 -0
- package/dist/c-CDR5AO3R.min.js +1 -0
- package/dist/c-COHXCW3Q.min.js +1 -0
- package/dist/{chunk-scatterplotMatrixBrushOverlay-SDIZSN66.module.min.js → c-DADXPJXV.min.js} +0 -1
- package/dist/c-E3JFRRMI.min.js +1 -0
- package/dist/c-EBFPQHHO.min.js +1 -0
- package/dist/c-G36WS6LN.min.js +1 -0
- package/dist/c-GIKRQI4X.min.js +1 -0
- package/dist/c-GPYOFETM.min.js +1 -0
- package/dist/c-IDUHYYSI.min.js +1 -0
- package/dist/{chunk-chunk-FQPKOAIH.module.min.js → c-IUHFPMHD.min.js} +0 -1
- package/dist/c-J5G56TUH.min.js +1 -0
- package/dist/c-JAZ73J32.min.js +1 -0
- package/dist/c-KG3NXHAL.min.js +1 -0
- package/dist/c-KII3PLZE.min.js +1 -0
- package/dist/c-LIXGXMNS.min.js +1 -0
- package/dist/c-LVEY6D6B.min.js +1 -0
- package/dist/c-M4Y3BHFR.min.js +1 -0
- package/dist/c-MAIICR2Z.min.js +1 -0
- package/dist/c-MG5DM6VE.min.js +1 -0
- package/dist/{chunk-minimapBrushOverlay-JU57U7NM.module.min.js → c-MNF2S4AA.min.js} +0 -1
- package/dist/c-MT3WBK7M.min.js +1 -0
- package/dist/c-NY3JWV2K.min.js +1 -0
- package/dist/c-O6U6K4CW.min.js +1 -0
- package/dist/c-OCI56QF2.min.js +1 -0
- package/dist/c-OQ7M4AGV.min.js +1 -0
- package/dist/c-OXYMVK7Q.min.js +1 -0
- package/dist/c-PPWDL5ZI.min.js +1 -0
- package/dist/c-QHF5YON3.min.js +1 -0
- package/dist/c-RR3GO5SW.min.js +1 -0
- package/dist/{chunk-chunk-J5QD4RAM.module.min.js → c-RSVIHIQ4.min.js} +0 -1
- package/dist/{chunk-chunk-EMO5NUGE.module.min.js → c-S2BXNNJN.min.js} +0 -1
- package/dist/{chunk-chunk-YCQYG6J5.module.min.js → c-SLGMUBUL.min.js} +0 -1
- package/dist/c-SUILCHWU.min.js +1 -0
- package/dist/c-TZW3JGJ5.min.js +1 -0
- package/dist/c-US5ZFT6E.min.js +1 -0
- package/dist/{chunk-chunk-RZH7VZYS.module.min.js → c-USFMFKIH.min.js} +0 -1
- package/dist/c-UUKVD4WB.min.js +1 -0
- package/dist/{chunk-chunk-SV4XAZ3Q.module.min.js → c-VGW3VG3I.min.js} +0 -1
- package/dist/c-W3CE4A4S.min.js +1 -0
- package/dist/{chunk-chunk-2NVFEB7P.module.min.js → c-WJCD5EUY.min.js} +0 -1
- package/dist/{chunk-chunk-2JGJ5GUG.module.min.js → c-X5UBGU2V.min.js} +0 -1
- package/dist/c-YDAY2WFR.min.js +1 -0
- package/dist/c-ZOWWU34K.min.js +1 -0
- package/dist/components/AccessibleNavTree.d.ts +1 -1
- package/dist/components/CategoryColors.d.ts +1 -1
- package/dist/components/GradientLegend.d.ts +14 -0
- package/dist/components/Legend.d.ts +2 -7
- package/dist/components/LinkedCharts.d.ts +1 -1
- package/dist/components/MobileAnnotationCalloutList.d.ts +1 -1
- package/dist/components/ObservationReadout.d.ts +45 -0
- package/dist/components/ThemeProvider.d.ts +4 -4
- package/dist/components/Tooltip/FlippingTooltip.d.ts +5 -7
- package/dist/components/Tooltip/Tooltip.d.ts +83 -5
- package/dist/components/Tooltip/tooltipChrome.d.ts +43 -0
- package/dist/components/ai/chartCapabilityTypes.d.ts +86 -2
- package/dist/components/ai/chartClinic.d.ts +2 -0
- package/dist/components/ai/deriveProfileFields.d.ts +40 -0
- package/dist/components/ai/evaluateChart.d.ts +85 -0
- package/dist/components/ai/fieldPolicy.d.ts +7 -0
- package/dist/components/ai/fieldRoles.d.ts +24 -0
- package/dist/components/ai/generativeChart.d.ts +18 -2
- package/dist/components/ai/inferIntent.d.ts +26 -2
- package/dist/components/ai/intents.d.ts +35 -0
- package/dist/components/ai/navigationTree.d.ts +2 -2
- package/dist/components/ai/observedSceneAudit.d.ts +2 -1
- package/dist/components/ai/profileData.d.ts +11 -0
- package/dist/components/ai/repairChartConfig.d.ts +2 -3
- package/dist/components/ai/semanticEvidence.d.ts +4 -0
- package/dist/components/ai/semanticViability.d.ts +11 -0
- package/dist/components/ai/semanticViabilityRegistry.d.ts +5 -0
- package/dist/components/ai/streamingTypes.d.ts +4 -0
- package/dist/components/ai/suggestCharts.d.ts +5 -6
- package/dist/components/ai/suggestDashboard.d.ts +2 -3
- package/dist/components/ai/suggestStreamCharts.d.ts +1 -1
- package/dist/components/ai/suggestStretchCharts.d.ts +2 -3
- package/dist/components/ai/suggestionPropContracts.d.ts +20 -0
- package/dist/components/ai/variantDiscovery.d.ts +3 -1
- package/dist/components/charts/custom/NetworkCustomChart.d.ts +3 -0
- package/dist/components/charts/custom/OrdinalCustomChart.d.ts +3 -0
- package/dist/components/charts/custom/XYCustomChart.d.ts +1 -1
- package/dist/components/charts/geo/ChoroplethMap.d.ts +3 -1
- package/dist/components/charts/geo/DistanceCartogram.d.ts +2 -7
- package/dist/components/charts/geo/cartogramOverlay.d.ts +28 -0
- package/dist/components/charts/index.d.ts +4 -3
- package/dist/components/charts/network/ProcessSankey.d.ts +2 -136
- package/dist/components/charts/network/ProcessSankeyProps.d.ts +139 -0
- package/dist/components/charts/network/Treemap.d.ts +2 -1
- package/dist/components/charts/network/processSankey/boundaryHubOrdering.d.ts +23 -0
- package/dist/components/charts/network/processSankey/layoutGeometry.d.ts +2 -0
- package/dist/components/charts/network/processSankey/ordering.d.ts +3 -41
- package/dist/components/charts/network/processSankey/orderingTypes.d.ts +32 -0
- package/dist/components/charts/network/processSankey/packing.d.ts +1 -1
- package/dist/components/charts/network/processSankey/packingCache.d.ts +1 -1
- package/dist/components/charts/network/processSankey/packingOptimization.d.ts +72 -0
- package/dist/components/charts/ordinal/BarChart.d.ts +4 -3
- package/dist/components/charts/ordinal/FunnelChart.d.ts +2 -0
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +3 -2
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +4 -3
- package/dist/components/charts/ordinal/SwimlaneChart.d.ts +2 -2
- package/dist/components/charts/physics/GaltonBoardChart.d.ts +2 -9
- package/dist/components/charts/physics/GauntletChart.d.ts +10 -41
- package/dist/components/charts/physics/ProcessFlowChart.d.ts +1 -1
- package/dist/components/charts/physics/chainReactionAccessibleTable.d.ts +9 -0
- package/dist/components/charts/physics/chainReactionRuntime.d.ts +2 -1
- package/dist/components/charts/physics/chainReactionTypes.d.ts +6 -1
- package/dist/components/charts/physics/crucibleBodyRenderers.d.ts +2 -2
- package/dist/components/charts/physics/crucibleClone.d.ts +6 -0
- package/dist/components/charts/physics/crucibleEffects.d.ts +1 -2
- package/dist/components/charts/physics/crucibleRecord.d.ts +7 -0
- package/dist/components/charts/physics/gauntletChrome.d.ts +4 -4
- package/dist/components/charts/physics/gauntletPhysics.d.ts +1 -0
- package/dist/components/charts/physics/gauntletPublic.d.ts +4 -0
- package/dist/components/charts/physics/packetFlowOverlay.d.ts +7 -0
- package/dist/components/charts/physics/physicsChartLayout.d.ts +8 -0
- package/dist/components/charts/physics/physicsChartShared.d.ts +3 -1
- package/dist/components/charts/physics/physicsChartUtils.d.ts +1 -1
- package/dist/components/charts/physics/physicsHocUtils.d.ts +26 -13
- package/dist/components/charts/physics/physicsProjectionOverlays.d.ts +24 -0
- package/dist/components/charts/physics/processFlowOverlays.d.ts +9 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +17 -12
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +12 -7
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +37 -14
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +23 -14
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +22 -13
- package/dist/components/charts/realtime/aggregate.d.ts +4 -1
- package/dist/components/charts/realtime/eventTime.d.ts +4 -0
- package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +27 -0
- package/dist/components/charts/realtime/realtimeChartTypes.d.ts +30 -0
- package/dist/components/charts/realtime/useRealtimeCategoryColors.d.ts +30 -0
- package/dist/components/charts/shared/FrameTextAnnotationSVG.d.ts +10 -0
- package/dist/components/charts/shared/annotationActivation.d.ts +3 -7
- package/dist/components/charts/shared/annotationBandFill.d.ts +6 -0
- package/dist/components/charts/shared/annotationDispatch.d.ts +31 -0
- package/dist/components/charts/shared/annotationIdentity.d.ts +8 -0
- package/dist/components/charts/shared/annotationRules.d.ts +1 -15
- package/dist/components/charts/shared/boundedCategoryRegistry.d.ts +8 -0
- package/dist/components/charts/shared/chainReactionChartSpec.d.ts +3 -0
- package/dist/components/charts/shared/chartMode.d.ts +3 -2
- package/dist/components/charts/shared/chartSpecCore.d.ts +1 -0
- package/dist/components/charts/shared/formatUtils.d.ts +40 -9
- package/dist/components/charts/shared/frameTextAnnotation.d.ts +63 -0
- package/dist/components/charts/shared/gradient.d.ts +16 -0
- package/dist/components/charts/shared/hatchFill.d.ts +15 -0
- package/dist/components/charts/shared/hooks.d.ts +4 -4
- package/dist/components/charts/shared/legendUtils.d.ts +1 -0
- package/dist/components/charts/shared/streamPropsHelpers.d.ts +3 -1
- package/dist/components/charts/shared/styleRules.d.ts +9 -2
- package/dist/components/charts/shared/styleRulesWireSchema.d.ts +353 -0
- package/dist/components/charts/shared/types.d.ts +26 -10
- package/dist/components/charts/shared/useChartLegend.d.ts +43 -9
- package/dist/components/charts/shared/useChartSetup.d.ts +3 -1
- package/dist/components/charts/shared/useCustomChartSetup.d.ts +5 -2
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +5 -1
- package/dist/components/charts/shared/useOrdinalBrush.d.ts +3 -3
- package/dist/components/charts/shared/useStreamingLegend.d.ts +6 -1
- package/dist/components/charts/value/types.d.ts +1 -1
- package/dist/components/charts/xy/BubbleChart.d.ts +1 -1
- package/dist/components/charts/xy/BumpChart.capability.d.ts +14 -1
- package/dist/components/charts/xy/BumpChart.d.ts +13 -73
- package/dist/components/charts/xy/BumpChart.semanticViability.d.ts +5 -0
- package/dist/components/charts/xy/CandlestickChart.d.ts +2 -2
- package/dist/components/charts/xy/LineChart.d.ts +2 -2
- package/dist/components/charts/xy/Scatterplot.d.ts +1 -1
- package/dist/components/charts/xy/bumpData.d.ts +44 -0
- package/dist/components/charts/xy/bumpIdentity.d.ts +2 -0
- package/dist/components/charts/xy/bumpLayout.d.ts +45 -0
- package/dist/components/charts/xy/bumpTooltip.d.ts +20 -0
- package/dist/components/legendLayout.d.ts +131 -4
- package/dist/components/realtime/ReorderBuffer.d.ts +2 -0
- package/dist/components/realtime/types.d.ts +10 -1
- package/dist/components/recipes/balanceSnapshotsToFlows.d.ts +42 -0
- package/dist/components/recipes/directedReachability.d.ts +14 -0
- package/dist/components/recipes/gofishDisplayListFixtures.generated.d.ts +6 -6
- package/dist/components/recipes/gridObservatory.d.ts +1 -1
- package/dist/components/recipes/networkAnalysis.d.ts +1 -18
- package/dist/components/recipes/physics.d.ts +7 -4
- package/dist/components/recipes/processPhysics.d.ts +0 -1
- package/dist/components/recipes/waffle.d.ts +7 -4
- package/dist/components/semiotic-ai-core.d.ts +13 -4
- package/dist/components/semiotic-ai-observations.d.ts +3 -0
- package/dist/components/semiotic-ai.d.ts +16 -9
- package/dist/components/semiotic-client-shared.d.ts +10 -0
- package/dist/components/semiotic-experimental.d.ts +1 -1
- package/dist/components/semiotic-geo.d.ts +4 -1
- package/dist/components/semiotic-network.d.ts +7 -4
- package/dist/components/semiotic-ordinal.d.ts +4 -1
- package/dist/components/semiotic-physics.d.ts +11 -4
- package/dist/components/semiotic-realtime-core.d.ts +11 -4
- package/dist/components/semiotic-realtime-react.d.ts +4 -3
- package/dist/components/semiotic-realtime.d.ts +3 -1
- package/dist/components/semiotic-recipes-core.d.ts +7 -5
- package/dist/components/semiotic-server-edge.d.ts +3 -2
- package/dist/components/semiotic-server.d.ts +3 -2
- package/dist/components/semiotic-themes-core.d.ts +5 -48
- package/dist/components/semiotic-utils-core.d.ts +11 -5
- package/dist/components/semiotic-utils-react.d.ts +2 -0
- package/dist/components/semiotic-xy.d.ts +4 -1
- package/dist/components/semiotic.d.ts +68 -25
- package/dist/components/server/animatedGif.d.ts +1 -1
- package/dist/components/server/renderEvidence.d.ts +25 -2
- package/dist/components/server/renderToStaticSVG.d.ts +15 -7
- package/dist/components/server/serverChartConfigShared.d.ts +8 -1
- package/dist/components/server/serverChartConfigs.d.ts +1 -0
- package/dist/components/server/serverChartConfigsNetwork.d.ts +3 -3
- package/dist/components/server/serverChartConfigsNetworkChord.d.ts +2 -0
- package/dist/components/server/serverChartConfigsNetworkForce.d.ts +2 -0
- package/dist/components/server/serverChartConfigsNetworkHierarchy.d.ts +3 -0
- package/dist/components/server/serverChartConfigsXY.d.ts +3 -3
- package/dist/components/server/serverChartConfigsXYBubble.d.ts +5 -0
- package/dist/components/server/serverChartConfigsXYBump.d.ts +7 -0
- package/dist/components/server/serverChartConfigsXYScatter.d.ts +5 -0
- package/dist/components/server/staticAnnotationFallbacks.d.ts +10 -0
- package/dist/components/server/staticAnnotations.d.ts +28 -1
- package/dist/components/server/staticAxisTickLabel.d.ts +13 -0
- package/dist/components/server/staticLegend.d.ts +1 -1
- package/dist/components/server/staticLegendMargin.d.ts +41 -0
- package/dist/components/server/staticOrdinal.d.ts +8 -2
- package/dist/components/server/staticPhysics.d.ts +13 -1
- package/dist/components/server/staticPhysicsChrome.d.ts +20 -0
- package/dist/components/server/staticRawLegend.d.ts +15 -0
- package/dist/components/server/staticSVGChrome.d.ts +16 -55
- package/dist/components/server/staticXYAxes.d.ts +27 -0
- package/dist/components/server/staticXYAxisTicks.d.ts +39 -0
- package/dist/components/server/staticXYGrid.d.ts +11 -0
- package/dist/components/server/themeResolver.d.ts +5 -1
- package/dist/components/store/ThemeStore.d.ts +2 -98
- package/dist/components/store/designTokens.d.ts +1 -1
- package/dist/components/store/themeCSSVariables.d.ts +10 -0
- package/dist/components/store/themeCore.d.ts +91 -0
- package/dist/components/store/themePresets.d.ts +81 -0
- package/dist/components/store/themeSerialization.d.ts +2 -1
- package/dist/components/stream/AccessibleDataTable.d.ts +12 -14
- package/dist/components/stream/AccessibleTablePortalImpl.d.ts +6 -0
- package/dist/components/stream/GeoTileRenderer.d.ts +3 -0
- package/dist/components/stream/NetworkCanvasHitTester.d.ts +3 -1
- package/dist/components/stream/NetworkSSRFrame.d.ts +2 -1
- package/dist/components/stream/NetworkSVGOverlay.d.ts +3 -31
- package/dist/components/stream/OrdinalCanvasHitTester.d.ts +2 -0
- package/dist/components/stream/SVGChartTitle.d.ts +9 -0
- package/dist/components/stream/SVGOverlay.d.ts +1 -21
- package/dist/components/stream/SVGUnderlay.d.ts +24 -0
- package/dist/components/stream/SceneToSVG.d.ts +1 -1
- package/dist/components/stream/StreamGeoFrame.d.ts +1 -1
- package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -1
- package/dist/components/stream/StreamXYFrame.d.ts +1 -1
- package/dist/components/stream/accessibleDataRows.d.ts +11 -0
- package/dist/components/stream/accessibleDataTableModel.d.ts +40 -0
- package/dist/components/stream/accessibleTableTypes.d.ts +11 -0
- package/dist/components/stream/axisTickUtils.d.ts +19 -0
- package/dist/components/stream/canvasBackground.d.ts +10 -0
- package/dist/components/stream/canvasSetup.d.ts +24 -4
- package/dist/components/stream/frameCursorInteraction.d.ts +25 -0
- package/dist/components/stream/frameDefaultMargins.d.ts +37 -0
- package/dist/components/stream/frameGraphics.d.ts +18 -0
- package/dist/components/stream/frameGraphicsSubscription.d.ts +26 -0
- package/dist/components/stream/frameLegendOptions.d.ts +18 -0
- package/dist/components/stream/geoFrameCursorInteraction.d.ts +9 -0
- package/dist/components/stream/geoFrameHelpers.d.ts +29 -1
- package/dist/components/stream/geoTypes.d.ts +12 -11
- package/dist/components/stream/hitTarget.d.ts +61 -2
- package/dist/components/stream/moduleWorkerSession.d.ts +6 -0
- package/dist/components/stream/networkAnnotationAnchors.d.ts +37 -0
- package/dist/components/stream/networkCustomLayout.d.ts +2 -2
- package/dist/components/stream/networkFrameCursorInteraction.d.ts +12 -0
- package/dist/components/stream/networkFrameInteraction.d.ts +2 -0
- package/dist/components/stream/networkFramePaint.d.ts +15 -0
- package/dist/components/stream/networkPipelineConfig.d.ts +1 -1
- package/dist/components/stream/networkTypes.d.ts +32 -32
- package/dist/components/stream/normalizeXYData.d.ts +7 -0
- package/dist/components/stream/ordinalFrameCursorInteraction.d.ts +7 -0
- package/dist/components/stream/ordinalFrameInteraction.d.ts +29 -0
- package/dist/components/stream/ordinalSceneSVG.d.ts +10 -0
- package/dist/components/stream/ordinalTypes.d.ts +12 -4
- package/dist/components/stream/physics/PhysicsBodySpatialIndex.d.ts +9 -1
- package/dist/components/stream/physics/PhysicsCanvasTheme.d.ts +25 -0
- package/dist/components/stream/physics/PhysicsControllers.d.ts +0 -3
- package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +4 -1
- package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +3 -24
- package/dist/components/stream/physics/PhysicsSettledSVG.d.ts +9 -21
- package/dist/components/stream/physics/PhysicsSettledSVGElement.d.ts +37 -0
- package/dist/components/stream/physics/PhysicsSettledScene.d.ts +7 -3
- package/dist/components/stream/physics/StreamPhysicsFrame.d.ts +1 -1
- package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +25 -4
- package/dist/components/stream/physics/physicsAnnotationContext.d.ts +19 -0
- package/dist/components/stream/physics/physicsBodyCanvas.d.ts +4 -0
- package/dist/components/stream/physics/physicsSettledChrome.d.ts +7 -0
- package/dist/components/stream/physics/usePhysicsCanvasPointer.d.ts +32 -0
- package/dist/components/stream/physics/usePhysicsSemanticNavigation.d.ts +36 -0
- package/dist/components/stream/pipelineConfig.d.ts +8 -17
- package/dist/components/stream/pipelineDomainResolution.d.ts +2 -2
- package/dist/components/stream/renderBackend.d.ts +2 -0
- package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +13 -2
- package/dist/components/stream/renderers/resolveCSSColor.d.ts +7 -0
- package/dist/components/stream/responsiveSize.d.ts +17 -0
- package/dist/components/stream/sceneCursor.d.ts +41 -0
- package/dist/components/stream/sceneRevisionDiagnostics.d.ts +1 -1
- package/dist/components/stream/svgOverlayUtils.d.ts +22 -1
- package/dist/components/stream/types.d.ts +33 -13
- package/dist/components/stream/useCanvasFrameHost.d.ts +12 -1
- package/dist/components/stream/useFrame.d.ts +24 -1
- package/dist/components/stream/useResponsiveSize.d.ts +6 -1
- package/dist/components/stream/useStalenessCheck.d.ts +1 -1
- package/dist/components/stream/xyFrameAxisTypes.d.ts +20 -4
- package/dist/components/stream/xyFrameCursorInteraction.d.ts +6 -0
- package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +1 -1
- package/dist/components/stream/xySceneBuilders/types.d.ts +6 -26
- package/dist/components/types/legendTypes.d.ts +6 -0
- package/dist/components/types/marginType.d.ts +7 -8
- package/dist/controls.min.js +1 -1
- package/dist/controls.module.min.js +1 -1
- package/dist/forceLayoutWorker.js +1 -1
- 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.module.min.js +1 -1
- package/dist/physics-rapier.module.min.js +1 -1
- package/dist/physics.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/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/rough.min.js +1 -1
- package/dist/rough.module.min.js +1 -1
- package/dist/semiotic-ai-core.d.ts +13 -4
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +16 -9
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-client-cjs-shared.min.js +1 -0
- package/dist/semiotic-client-glyph.module.min.js +2 -0
- package/dist/semiotic-client-responsive.module.min.js +2 -0
- package/dist/semiotic-client-shared.module.min.js +2 -0
- package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +2 -0
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +2 -0
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +2 -0
- package/dist/semiotic-experimental-node.module.min.js +2 -0
- package/dist/semiotic-experimental-react-shared.module.min.js +2 -0
- 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-experimental.min.js +1 -1
- package/dist/semiotic-experimental.module.min.js +1 -1
- package/dist/semiotic-geo.d.ts +4 -1
- package/dist/semiotic-network.d.ts +7 -4
- package/dist/semiotic-ordinal.d.ts +4 -1
- package/dist/semiotic-physics.d.ts +11 -4
- package/dist/semiotic-realtime-core.d.ts +11 -4
- package/dist/semiotic-realtime-core.min.js +2 -1
- package/dist/semiotic-realtime-core.module.min.js +2 -1
- package/dist/semiotic-realtime-react.d.ts +4 -3
- package/dist/semiotic-realtime-react.min.js +1 -1
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-realtime.d.ts +3 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +1 -0
- package/dist/semiotic-recipes-core.d.ts +7 -5
- package/dist/semiotic-recipes-core.min.js +9 -1
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes-geo-cjs.min.js +1 -0
- package/dist/semiotic-recipes-react.min.js +1 -1
- package/dist/semiotic-recipes-react.module.min.js +1 -1
- package/dist/semiotic-recipes.min.js +7 -1
- package/dist/semiotic-recipes.module.min.js +2 -1
- package/dist/semiotic-server-edge-node.module.min.js +1 -0
- package/dist/semiotic-server-edge.d.ts +3 -2
- 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-server.d.ts +3 -2
- package/dist/semiotic-themes-core.d.ts +5 -48
- package/dist/semiotic-themes-core.min.js +1 -1
- package/dist/semiotic-themes-core.module.min.js +1 -1
- package/dist/semiotic-themes-react.min.js +1 -1
- package/dist/semiotic-themes-react.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 +11 -5
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic-utils-react.d.ts +2 -0
- package/dist/semiotic-utils-react.min.js +1 -1
- package/dist/semiotic-utils-react.module.min.js +1 -1
- package/dist/semiotic-utils.min.js +2 -1
- package/dist/semiotic-utils.module.min.js +2 -1
- package/dist/semiotic-value.min.js +1 -1
- package/dist/semiotic-value.module.min.js +1 -1
- package/dist/semiotic-xy.d.ts +4 -1
- package/dist/semiotic.d.ts +68 -25
- 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.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +53 -19
- package/dist/__tests__/scenarios/mcpProtocolTypes.d.ts +0 -20
- package/dist/chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js +0 -2
- package/dist/chunk-XYBrushOverlay-ECZJJLAJ.module.min.js +0 -1
- package/dist/chunk-XYBrushOverlay-EP2SV3UI.module.min.js +0 -2
- package/dist/chunk-chartContainerDataAudit-IQ3NBN3Q.module.min.js +0 -2
- package/dist/chunk-chunk-2B3AIKUZ.module.min.js +0 -2
- package/dist/chunk-chunk-2CXCXRB4.module.min.js +0 -1
- package/dist/chunk-chunk-3GCILWPB.module.min.js +0 -2
- package/dist/chunk-chunk-46KRGJQP.module.min.js +0 -1
- package/dist/chunk-chunk-4ITOQRXM.module.min.js +0 -2
- package/dist/chunk-chunk-4MLLQUGW.module.min.js +0 -2
- package/dist/chunk-chunk-57RBPDBQ.module.min.js +0 -2
- package/dist/chunk-chunk-5UKL5W76.module.min.js +0 -2
- package/dist/chunk-chunk-5VVNW5AZ.module.min.js +0 -1
- package/dist/chunk-chunk-66PCWJUG.module.min.js +0 -1
- package/dist/chunk-chunk-6V5VQVCT.module.min.js +0 -2
- package/dist/chunk-chunk-7LE56WAE.module.min.js +0 -2
- package/dist/chunk-chunk-7T25U75Z.module.min.js +0 -2
- package/dist/chunk-chunk-ACLDBMRH.module.min.js +0 -2
- package/dist/chunk-chunk-AF53TBSN.module.min.js +0 -2
- package/dist/chunk-chunk-BTZYH2IE.module.min.js +0 -1
- package/dist/chunk-chunk-BWV55BZK.module.min.js +0 -2
- package/dist/chunk-chunk-BZNOAHJV.module.min.js +0 -2
- package/dist/chunk-chunk-CD6PVVS3.module.min.js +0 -2
- package/dist/chunk-chunk-DTSNLGRK.module.min.js +0 -2
- package/dist/chunk-chunk-FC3NZWYR.module.min.js +0 -2
- package/dist/chunk-chunk-FEPXDKJP.module.min.js +0 -1
- package/dist/chunk-chunk-FJ76HWQZ.module.min.js +0 -1
- package/dist/chunk-chunk-FRGBMTZR.module.min.js +0 -1
- package/dist/chunk-chunk-G75OPF5N.module.min.js +0 -2
- package/dist/chunk-chunk-H5IFO6CU.module.min.js +0 -2
- package/dist/chunk-chunk-HADHLMY5.module.min.js +0 -1
- package/dist/chunk-chunk-HBFA4NN6.module.min.js +0 -1
- package/dist/chunk-chunk-HCNDE26Q.module.min.js +0 -2
- package/dist/chunk-chunk-IY7RYD4S.module.min.js +0 -1
- package/dist/chunk-chunk-J3QOW4OE.module.min.js +0 -0
- package/dist/chunk-chunk-J3XWETBJ.module.min.js +0 -2
- package/dist/chunk-chunk-JJ4BSUYL.module.min.js +0 -2
- package/dist/chunk-chunk-JRHXQGEV.module.min.js +0 -2
- package/dist/chunk-chunk-KTWEBFMX.module.min.js +0 -2
- package/dist/chunk-chunk-L6FFYGYS.module.min.js +0 -1
- package/dist/chunk-chunk-LJDH3WV3.module.min.js +0 -2
- package/dist/chunk-chunk-LSJUXBMF.module.min.js +0 -1
- package/dist/chunk-chunk-N3Q33XCB.module.min.js +0 -2
- package/dist/chunk-chunk-NWIGA3UK.module.min.js +0 -1
- package/dist/chunk-chunk-OG3TTJGJ.module.min.js +0 -2
- package/dist/chunk-chunk-OZK46A5U.module.min.js +0 -1
- package/dist/chunk-chunk-PMR47KRY.module.min.js +0 -2
- package/dist/chunk-chunk-Q2YADC2V.module.min.js +0 -2
- package/dist/chunk-chunk-QQJNG23C.module.min.js +0 -2
- package/dist/chunk-chunk-RGJ6TKAH.module.min.js +0 -2
- package/dist/chunk-chunk-ROP4HI7H.module.min.js +0 -2
- package/dist/chunk-chunk-SFLUSZ73.module.min.js +0 -2
- package/dist/chunk-chunk-TCMHJWFJ.module.min.js +0 -1
- package/dist/chunk-chunk-TSCFL235.module.min.js +0 -1
- package/dist/chunk-chunk-U66USBWU.module.min.js +0 -1
- package/dist/chunk-chunk-UEZ6SHW5.module.min.js +0 -2
- package/dist/chunk-chunk-UOQRPGPK.module.min.js +0 -2
- package/dist/chunk-chunk-VUWYT7DY.module.min.js +0 -2
- package/dist/chunk-chunk-W5HWGQMD.module.min.js +0 -2
- package/dist/chunk-chunk-WFHZHWT7.module.min.js +0 -1
- package/dist/chunk-chunk-WGROBM3I.module.min.js +0 -2
- package/dist/chunk-chunk-WSDJFBKX.module.min.js +0 -2
- package/dist/chunk-chunk-YHNZCPOZ.module.min.js +0 -2
- package/dist/chunk-chunk-YWZB3KPI.module.min.js +0 -2
- package/dist/chunk-statisticalOverlays-HMYYSGPE.module.min.js +0 -2
- package/dist/components/stream/test-utils/frameScheduler.d.ts +0 -12
- package/dist/components/stream/test-utils/revisionConsumption.d.ts +0 -13
- package/dist/test-utils/canvasMock.d.ts +0 -86
- package/dist/test-utils/capturedFrameProps.d.ts +0 -67
- package/dist/test-utils/frameMock.d.ts +0 -81
- package/dist/test-utils/ordinalFixtures.d.ts +0 -48
- /package/dist/{chunk-chunk-JJ2OOIET.module.min.js → c-GGISSW5E.min.js} +0 -0
- /package/dist/{chunk-chunk-SIRIJ3DY.module.min.js → c-N4G2L7ID.min.js} +0 -0
- /package/dist/{chunk-chunk-CA3YDW6F.module.min.js → c-S6U5CGT5.min.js} +0 -0
- /package/dist/components/recipes/{mobileAnnotationStrategy.d.ts → mobileAnnotationBehavior.d.ts} +0 -0
package/ai/system-prompt.md
CHANGED
|
@@ -1,144 +1,95 @@
|
|
|
1
1
|
# Semiotic — React Data Visualization
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
##
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
-
|
|
51
|
-
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
- **EventDropChart** — `data`, `timeAccessor` ("time"), `arrivalAccessor` ("arrivalTime"), `windows={{size}}`, `watermark={{delay}}`, `timeScale`, `colorBy`, `size`. Event-time arrival replay and late/watermark windows.
|
|
63
|
-
- **UnitPileChart** — `data`, `categoryAccessor` ("category"), `valueAccessor` ("value"), `mode` ("sample"|"mechanical"), `mechanicalCount`, `mechanicalCategories`, `unitValue`, `colorBy`, `showProjection`, `size`. Unitized category piles; mechanical mode can generate a seeded no-data capacity sketch; default projection overlay keeps exact totals readable; raise `unitValue` for large values.
|
|
64
|
-
- **CollisionSwarmChart** — `data`, `xAccessor` ("x"), optional `groupAccessor`, `radiusAccessor`, `xExtent`, `collisionIterations`, `settle`, `showProjection`, `colorBy`, `size`. Collision-relaxed dot-strip/swarm chart that preserves quantitative axis position and optional group lanes.
|
|
65
|
-
- **PhysicsCustomChart** — `data`, `layout(ctx)`, `layoutConfig`, `config`, `colorBy`, `size`. Escape hatch for bespoke physics scenes; layouts return bodies/colliders/sensors plus optional SVG overlays.
|
|
66
|
-
|
|
67
|
-
### Push API on HOC charts
|
|
68
|
-
Many HOC charts support the push API via `forwardRef`. **Omit the `data` prop** (do NOT pass `data={[]}`) and push imperatively:
|
|
3
|
+
Use family subpath imports such as `semiotic/xy`, `semiotic/ordinal`,
|
|
4
|
+
`semiotic/network`, `semiotic/geo`, or `semiotic/realtime` in production code.
|
|
5
|
+
Use `semiotic/ai` or `semiotic/ai/core` for generation helpers. Current bundle
|
|
6
|
+
measurements live in the README and the complete AI reference.
|
|
7
|
+
|
|
8
|
+
## Agent Workflow
|
|
9
|
+
|
|
10
|
+
Keep retrieval narrow: start with this prompt, then fetch one relevant component
|
|
11
|
+
schema with the MCP `getSchema` tool or
|
|
12
|
+
`npx semiotic-ai --schema <Component>`, and one nearby example only when needed.
|
|
13
|
+
Do not load the complete schema, example catalog, or full reference into every
|
|
14
|
+
request.
|
|
15
|
+
|
|
16
|
+
1. Identify the data shape, communicative intent, audience, and delivery mode
|
|
17
|
+
(static/serialized or React push).
|
|
18
|
+
2. Use `suggestCharts` when the component is not already determined, then verify
|
|
19
|
+
the selected component's exact schema instead of guessing props.
|
|
20
|
+
3. Produce a serializable `{ component, props }` proposal before translating it
|
|
21
|
+
to JSX; import chart components from their family subpath in production code.
|
|
22
|
+
4. Validate with `prepareChart`, `diagnoseConfig`, or `evaluateChart`, or
|
|
23
|
+
`npx semiotic-ai --doctor`; repair reported contract failures.
|
|
24
|
+
5. When a renderer is available, require non-empty render evidence and run the
|
|
25
|
+
accessibility audit before presenting the result.
|
|
26
|
+
|
|
27
|
+
## Selection Map
|
|
28
|
+
|
|
29
|
+
- Flat observations: XY charts for trends/relationships; ordinal charts for
|
|
30
|
+
categorical comparison, ranking, distribution, and part-to-whole.
|
|
31
|
+
- Trees: `TreeDiagram`, `Treemap`, `CirclePack`, or animated `OrbitDiagram`.
|
|
32
|
+
- Nodes/edges: `ForceDirectedGraph`, `SankeyDiagram`, `ProcessSankey`, or
|
|
33
|
+
`ChordDiagram`. Prefer these HOCs to `StreamNetworkFrame` unless the task
|
|
34
|
+
needs lower-level streaming control.
|
|
35
|
+
- Geographic rows/features: charts from `semiotic/geo`.
|
|
36
|
+
- Live time-windowed observations: Realtime HOCs from `semiotic/realtime`.
|
|
37
|
+
- A single focal value: `BigNumber` from `semiotic/value`.
|
|
38
|
+
- Physics charts: use only when motion has data meaning and keep an exact,
|
|
39
|
+
readable settled projection.
|
|
40
|
+
|
|
41
|
+
This map narrows discovery; it does not define props. Use `suggestCharts` and
|
|
42
|
+
the selected component's exact schema for the final choice.
|
|
43
|
+
|
|
44
|
+
Before profiling GraphQL or database rows, declare record keys through
|
|
45
|
+
`identifiers` (or `fieldRoles: { key: "identifier" }`). Identifier fields are
|
|
46
|
+
identity, not quantitative measures or unique-value categories.
|
|
47
|
+
|
|
48
|
+
## Delivery Modes
|
|
49
|
+
|
|
50
|
+
- Static JSX, SSR, MCP rendering, and serialized configurations keep the
|
|
51
|
+
initial data snapshot in the component's real data prop.
|
|
52
|
+
- React push mode omits `data` entirely and mutates through a ref. Do not pass
|
|
53
|
+
`data={[]}`. Supply the schema's stable ID accessor before using `remove` or
|
|
54
|
+
`update`.
|
|
55
|
+
- Realtime HOCs require a valid time field (default `time`) for windowing; set
|
|
56
|
+
`timeAccessor` when the field has another name.
|
|
57
|
+
- Stream Frames are low-level escape hatches. Network-frame callbacks receive
|
|
58
|
+
`RealtimeNode`/`RealtimeEdge` wrappers rather than raw rows.
|
|
59
|
+
|
|
60
|
+
Push example:
|
|
61
|
+
|
|
69
62
|
```jsx
|
|
70
63
|
const chartRef = useRef()
|
|
71
64
|
chartRef.current.push({ x: 1, y: 2 })
|
|
72
65
|
<Scatterplot ref={chartRef} xAccessor="x" yAccessor="y" />
|
|
73
66
|
```
|
|
74
|
-
Methods: `push(datum)`, `pushMany(data)`, `remove(id)` (requires `pointIdAccessor`/`dataIdAccessor`), `update(id, updater)`, `clear()`, `getData()`. Network HOC refs use `remove()`/`update()` for node operations. Edge-level methods (`removeNode`, `removeEdge`, `updateNode`, `updateEdge`) are on `StreamNetworkFrameHandle`. Geo charts: `update()` is implemented as remove+push internally. Streaming-specific props (`windowSize`, `decay`, `pulse`) go in `frameProps`. Supported: XY charts, ordinal charts, network charts (ForceDirectedGraph, SankeyDiagram, ChordDiagram), ProportionalSymbolMap, DistanceCartogram. Not supported: hierarchy charts (TreeDiagram, Treemap, CirclePack, OrbitDiagram), ChoroplethMap, FlowMap, ScatterplotMatrix.
|
|
75
|
-
|
|
76
|
-
For advanced streaming control, use Stream Frames (`StreamXYFrame`, `StreamOrdinalFrame`, `StreamNetworkFrame`) with `runtimeMode="streaming"` and ref-based push.
|
|
77
|
-
|
|
78
|
-
## ChartContainer
|
|
79
|
-
- **ChartContainer** — wrapper with title, subtitle, status indicator, toolbar. `title`, `subtitle`, `height` (default **400** — always set this to match your chart height), `width` ("100%"), `status` ("live"|"stale"|"error"), `loading`, `error`, `actions`, `style`
|
|
80
|
-
- When using with `size={[w, h]}`, set `height={h}` on the container or you'll get extra whitespace.
|
|
81
|
-
|
|
82
|
-
## Common Props (all components)
|
|
83
|
-
`width`, `height`, `margin`, `title`, `description`, `summary`, `accessibleTable`, `colorBy`, `colorScheme`, `enableHover`, `tooltip`, `showLegend`, `className`, `frameProps`, `onObservation`, `onClick`, `emphasis` ("primary"|"secondary")
|
|
84
|
-
|
|
85
|
-
Use `title` for the visible chart name, `description` for a concise accessible description, `summary` for a screen-reader-only takeaway and interaction guidance, and `accessibleTable` for the data-table fallback. For generated L1–L3 descriptions or a screen-reader navigation tree, use `ChartContainer` with `chartConfig` plus `describe` and/or `navigable`.
|
|
86
|
-
|
|
87
|
-
### tooltip
|
|
88
|
-
`true` (default) | `false` | `(datum) => ReactNode` (function receives your raw data) | config `{ fields?, title?, format?, style? }`
|
|
89
|
-
|
|
90
|
-
### onClick
|
|
91
|
-
`onClick={(datum, { x, y }) => ...}` — called when a data element is clicked. Receives the original datum and pixel coordinates. Works on lines, bars, areas, pie slices, nodes, and geo features.
|
|
92
|
-
|
|
93
|
-
### onObservation
|
|
94
|
-
Callback receiving `ChartObservation`. Pointer exploration emits `hover`/`click`; keyboard or structured traversal additionally emits semantic `focus`/`activate` with `inputType: "keyboard"|"pointer"|"touch"|"navigation-tree"`. Stable widget annotations emit `annotation-activate` with `annotationId`. Events also include `timestamp`, `chartType`, and optional `chartId`; datum events carry your original data object. Hover-end/click-end events omit `datum`.
|
|
95
|
-
|
|
96
|
-
### emphasis
|
|
97
|
-
`emphasis="primary"` makes a chart span two columns inside a `ChartGrid`.
|
|
98
|
-
|
|
99
|
-
## Annotations (all chart families)
|
|
100
|
-
- Give interactive `widget` annotations an `id`, `stableId`, or `provenance.stableId`; activation identity never falls back to array index. Observe widget activation on Stream Frames with `onAnnotationActivate`, or on HOCs through `frameProps.onAnnotationActivate`.
|
|
101
|
-
- `annotations={[{ type: "y-threshold", value: 200, label: "SLA limit", color: "#e45050", labelPosition: "right" }]}` — horizontal reference line (works on XY and vertical ordinal charts). `labelPosition`: "left"|"center"|"right"
|
|
102
|
-
- `annotations={[{ type: "x-threshold", value: 50, label: "Cutoff", labelPosition: "top" }]}` — vertical reference line. `labelPosition`: "top"|"center"|"bottom"
|
|
103
|
-
- `annotations={[{ type: "callout-circle", x: 5, y: 20, label: "Peak", radius: 12 }]}` — data-bound callout; use `callout-rect` with `width`/`height` for a rectangular subject
|
|
104
|
-
- `annotations={[{ type: "category-highlight", category: "Q3 2024", color: "#4589ff", opacity: 0.15 }]}` — highlight a category column/row in ordinal charts
|
|
105
|
-
- `annotations={[{ type: "widget", time: 42, latency: 850, dy: -10, content: <span>Alert</span> }]}` — place React element at data coordinates
|
|
106
|
-
- `annotations={[{ type: "enclose", coordinates: [datum1, datum2], label: "Cluster" }]}` — circle enclosing data points
|
|
107
|
-
- `autoPlaceAnnotations={{ density: true, progressiveDisclosure: true, redundantCues: true }}` — opt-in placement, clutter management, and non-color association support
|
|
108
|
-
- Annotation metadata: `emphasis`, `defensive`, `provenance`, and `lifecycle`; use `applyAnnotationLifecycle`, `applyAnnotationStatus`, and `filterAnnotationsByStatus` from `semiotic/ai`
|
|
109
|
-
|
|
110
|
-
## ISOTYPE & Icon Size Guidance
|
|
111
|
-
- Repeated pictograms, semantic icons, and glyph tokens should be visibly legible in the final rendered layout. Treat 16px as the minimum intended rendered icon dimension for ISOTYPE/icon-array designs.
|
|
112
|
-
- This is design guidance, not a Semiotic-enforced minimum. Low-level helpers may default smaller for dense or sparkline-like contexts, so set `tokenSize`, glyph `size`, SVG slots, or wrapping explicitly when producing AI-authored examples.
|
|
113
|
-
- If the available width would shrink icons below that visual floor, wrap the tokens into multiple rows/columns, reduce the number of visible tokens, change the unit value, or choose a non-icon encoding instead of shipping tiny pictograms.
|
|
114
|
-
|
|
115
|
-
## Theming & Brand Styling
|
|
116
|
-
All charts respond to CSS custom properties on any ancestor:
|
|
117
|
-
```css
|
|
118
|
-
.my-theme {
|
|
119
|
-
--semiotic-bg: #1a1a2e; /* chart background */
|
|
120
|
-
--semiotic-text: #ededed; /* primary text */
|
|
121
|
-
--semiotic-text-secondary: #aaa; /* tick labels */
|
|
122
|
-
--semiotic-grid: #333; /* grid lines */
|
|
123
|
-
--semiotic-border: #555; /* axis lines */
|
|
124
|
-
--semiotic-font-family: Georgia, serif;
|
|
125
|
-
--semiotic-tooltip-bg: #1a1a2e;
|
|
126
|
-
--semiotic-tooltip-text: #ededed;
|
|
127
|
-
--semiotic-tooltip-radius: 8px;
|
|
128
|
-
}
|
|
129
|
-
```
|
|
130
|
-
Or use ThemeProvider with 15 named presets: `<ThemeProvider theme="tufte">`, `"tufte-dark"`, `"pastels"`, `"bi-tool"`, `"italian"`, `"journalist"`, `"playful"` (each with `-dark` variant), `"dark"`, `"high-contrast"`.
|
|
131
|
-
|
|
132
|
-
**Color resolution**: When `colorBy` is set, charts use: CategoryColorProvider/LinkedCharts category map > explicit `colorScheme` fallback > ThemeProvider `colors.categorical` > `"category10"`. No need to pass `colorScheme` on every chart when using ThemeProvider.
|
|
133
67
|
|
|
134
|
-
|
|
68
|
+
Available ref methods vary by component; the exact schema/capability metadata is
|
|
69
|
+
authoritative.
|
|
135
70
|
|
|
136
|
-
|
|
71
|
+
## Accessibility, Interaction, and Composition
|
|
137
72
|
|
|
138
|
-
|
|
73
|
+
- Chart HOCs commonly support `title`, `description`, `summary`,
|
|
74
|
+
`accessibleTable`, `onClick`, and `onObservation`; verify the selected schema.
|
|
75
|
+
Value components have their own contract.
|
|
76
|
+
- Use `ChartContainer` when generated descriptions, structured navigation,
|
|
77
|
+
status, notifications, or shared actions are needed. Match its height to a
|
|
78
|
+
child chart that uses explicit dimensions.
|
|
79
|
+
- Interactive widget annotations need `id`, `stableId`, or
|
|
80
|
+
`provenance.stableId`. Use `autoPlaceAnnotations` for density, progressive
|
|
81
|
+
disclosure, and redundant association cues; keep provenance/lifecycle
|
|
82
|
+
metadata when claims are agent-authored.
|
|
83
|
+
- Repeated pictograms should normally render at least 16px. If they do not fit,
|
|
84
|
+
wrap/reduce them, raise the unit value, or choose another encoding.
|
|
139
85
|
|
|
140
|
-
|
|
86
|
+
## Theming
|
|
141
87
|
|
|
88
|
+
Use `ThemeProvider` from `semiotic/themes/react`, presets and serialization from
|
|
89
|
+
`semiotic/themes`, and semantic CSS variables such as `--semiotic-danger` for
|
|
90
|
+
scoped role overrides. Use `colorBy` for categorical data and
|
|
91
|
+
`CategoryColorProvider`/`LinkedCharts` for stable cross-chart category colors.
|
|
92
|
+
`COLOR_BLIND_SAFE_CATEGORICAL` is available from `semiotic/themes`.
|
|
142
93
|
|
|
143
94
|
## Behavior Contracts
|
|
144
95
|
|
|
@@ -147,6 +98,7 @@ Or use ThemeProvider with 15 named presets: `<ThemeProvider theme="tufte">`, `"t
|
|
|
147
98
|
These rules are generated from `ai/behaviorContracts.cjs` and are consumed by `semiotic-ai --doctor`, MCP resources, and docs checks.
|
|
148
99
|
|
|
149
100
|
- **Accessible chart text uses direct chart props** (`accessibility.description-props`): High-level charts expose title for the visible name, description for a concise accessible description, summary for a screen-reader-only takeaway and interaction guidance, and accessibleTable for the data-table fallback.
|
|
101
|
+
- **Cursor styling does not create behavior** (`interaction.cursor-is-presentation-only`): Cursor values in realtime props, retained mark styles, styleRules, and custom hit targets change pointer presentation only. They do not install click handlers, keyboard activation, observations, or accessibility semantics.
|
|
150
102
|
- **Data required by usage mode** (`props.data-required-by-usage-mode`): Static usage (`renderChart`, MCP previews, SSR snapshots, and copy/paste examples with immediate data) requires data in props. React push mode selects live ingestion by omitting data and mutating through a ref.
|
|
151
103
|
- **Categorical color precedence** (`color.category-precedence`): When colorBy is set, CategoryColorProvider/LinkedCharts category maps win for mapped categories. Unmapped categories fall back to explicit colorScheme, then ThemeProvider colors.categorical, then the built-in categorical fallback.
|
|
152
104
|
- **Required prop combinations** (`props.required-combinations`): Some chart families need semantic props beyond data. These combinations are enforced by validation/schema for static configs and remain required in push mode unless explicitly noted.
|
|
@@ -165,7 +117,8 @@ These rules are generated from `ai/behaviorContracts.cjs` and are consumed by `s
|
|
|
165
117
|
|
|
166
118
|
## Key Patterns
|
|
167
119
|
- **Percentile band + main line**: Layer `<AreaChart yAccessor="p95" y0Accessor="p5" showLine={false} />` + `<LineChart yAccessor="p50" />`. AreaChart's `showLine` only draws the top edge, NOT a separate main line.
|
|
168
|
-
- **SSR**: `renderChart("BarChart", props)` from `semiotic/server` — uses HOC names. Also `"Sparkline"` (no axes, 2px margins). `renderChartWithEvidence()` returns `{ svg, evidence }` (mark counts by scene type, axis domains, empty flag, annotation count, accessible name)
|
|
120
|
+
- **SSR**: `renderChart("BarChart", props)` from `semiotic/server` — uses HOC names. Also `"Sparkline"` (no axes, 2px margins). `renderChartWithEvidence()` returns `{ svg, evidence }` (mark counts by scene type, axis domains, empty flag, semantic status/diagnostics, annotation count, accessible name). Check `empty`/`markCount` for paint and `semanticStatus` separately for meaning; `degenerate` marks are not trustworthy even when paint `status` is `ok`, while `not-assessed` means no capability check exists. `renderToImage()` (PNG), `renderToAnimatedGif()` (GIF), `renderDashboard()` (multi-chart). All accept `theme`. Required props: StackedBarChart needs `stackBy`, GroupedBarChart needs `groupBy`, StackedAreaChart needs `areaBy`, BubbleChart needs `sizeBy`, FunnelChart uses `stepAccessor`, GaugeChart needs `value` (`thresholds` optional).
|
|
121
|
+
- **Serializable chart-adjacent text**: use a `frame-text` annotation instead of splicing server SVG. It anchors to the resolved plot rectangle without data coordinates: `{ type: "frame-text", text: "100", position: "bottom-right", dy: 16 }`. Positions cover the plot's nine edge/center anchors; `dx`/`dy` may move text into a caller-reserved margin. The same annotation renders in CSR and SSR.
|
|
169
122
|
- **CLI**: `npx semiotic-ai --list` shows components/import paths/renderability; `npx semiotic-ai --schema GaugeChart` prints one component schema with metadata; `--doctor` validates props JSON and behavior contracts.
|
|
170
123
|
- **MCP**: `npx semiotic-mcp` exposes schema, chart suggestion, token-encoding suggestion (`suggestTokenEncoding` for ISOTYPE/dot/icon arrays), diagnosis, accessibility, grounding, issue, theme, static render (`renderChart`), and ChatGPT Apps render (`renderInteractiveChart`) tools. Resources include `semiotic://schema`, `semiotic://components`, `semiotic://behavior-contracts`, `semiotic://system-prompt`, `semiotic://examples`, and the widget template `ui://semiotic/chart-widget.html`. Prompts: `build-semiotic-chart`, `debug-semiotic-chart`.
|
|
171
124
|
- **Data Pitfalls bridge**: `toDataPitfallsChain(component, props, { rendered, context, narrative })` from `semiotic/ai` returns a dependency-free `datapitfalls` chain input containing config, JSX, reader grounding, diagnostics, accessibility audit, and optional render evidence/image.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",opacity:0},e=8;function r(t){return null==t?void 0:t+""}function i(e){const i=r(e.id);return{type:"point",x:e.x,y:e.y,r:e.r??8,style:{...t,cursor:e.cursor},datum:e.datum,pointId:i,_transitionKey:i}}function c(t){return i(t)}function a(e){const[[r,i],[c,a]]=e.bounds;return{type:"geoarea",pathData:e.pathData,centroid:e.centroid,bounds:e.bounds,screenArea:e.screenArea??Math.abs((c-r)*(a-i)),style:{...t,cursor:e.cursor},datum:e.datum,group:e.group,interactive:!0}}function s(e){return{type:"rect",x:e.x,y:e.y,w:e.width,h:e.height,style:{...t,cursor:e.cursor},datum:e.datum,group:e.group,_transitionKey:r(e.id)}}function u(e){const i=r(e.id);return"width"in e&&"height"in e?{type:"rect",x:e.x,y:e.y,w:e.width,h:e.height,style:{...t,cursor:e.cursor},datum:e.datum,id:i,label:e.label,accessibleDatum:e.accessibleDatum,accessibility:e.accessibility}:{type:"circle",cx:e.x,cy:e.y,r:e.r??8,style:{...t,cursor:e.cursor},datum:e.datum,id:i,label:e.label,accessibleDatum:e.accessibleDatum,accessibility:e.accessibility}}function n(e){const i={style:{...t,cursor:e.cursor},datum:e.datum,id:r(e.id),label:e.label,accessibleDatum:e.accessibleDatum,accessibility:e.accessibility,interactive:e.interactive??!0};return"pathD"in e?{type:e.type??"curved",pathD:e.pathD,...i}:{type:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,...i}}export{e as DEFAULT_HIT_RADIUS,i as hitTargetPoint,c as geoHitTarget,a as geoAreaHitTarget,s as hitTargetRect,u as networkHitTarget,n as networkEdgeHitTarget};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{STREAMING_PALETTE as e,createColorScale as t,distinctCategories as r,filterSparseArray as o,getCrosshairProps as n,renderEmptyState as a,renderLoadingState as i,resolveExplicitColor as l,resolveMobileInteraction as c,useCategoryColors as u,useChartLegendAndMargin as s,useChartMode as g,useChartSelection as d,useColorScale as h,useLegendInteraction as m,useThemeCategorical as y}from"./c-GIKRQI4X.min.js";import{useThemeSelector as p}from"./c-YDAY2WFR.min.js";import{useMemo as f}from"react";function v(e){const t=p(e=>e.theme.colors.selectionOpacity);return f(()=>{if(void 0!==e||void 0!==t)return{name:e?.name??"",...e,unselectedOpacity:e?.unselectedOpacity??t}},[e,t])}import{useCallback as L,useMemo as b,useState as C}from"react";function k(g){const{data:p,rawData:f,colorBy:k,colorScheme:H,legendInteraction:S,legendPosition:w,selection:I,linkedHover:M,fallbackFields:D,unwrapData:R=!1,onObservation:B,chartType:F,chartId:P,showLegend:A,legend:T,legendLayout:x,frameLegend:O,userMargin:W,marginDefaults:_,onClick:G,hoverHighlight:j,mobileInteraction:z,mobileSemantics:N,loading:Y,loadingContent:K,emptyContent:Q,width:V,height:X,hasTitle:q,axisChrome:E}=g,J=void 0===f,U=b(()=>o(p),[p]),[Z,$]=C([]),ee=L(e=>{$(t=>t.length===e.length&&t.every((t,r)=>t===e[r])?t:e)},[]),te="string"==typeof k?k:void 0,re=b(()=>c(z,{width:V,mobileSemantics:N}),[z,V,N]),{activeSelectionHook:oe,hoverSelectionHook:ne,customHoverBehavior:ae,customClickBehavior:ie,crosshairSourceId:le}=d({selection:I,linkedHover:M,fallbackFields:D,unwrapData:R,onObservation:B,chartType:F,chartId:P,onClick:G,hoverHighlight:j,colorByField:te,mobileInteraction:re}),ce=n(M,le),ue=h(U,k,H),se=b(()=>r(U,k),[U,k]),ge=b(()=>J&&Z.length>0?Z:se,[J,Z,se]),de=m(S,k,ge),he=b(()=>ne||(de.legendSelectionHook?de.legendSelectionHook:oe),[ne,de.legendSelectionHook,oe]),me=v(I),ye=y(),pe=u(),fe=b(()=>{if(ue)return ue;if(!k||0===ge.length)return;const r=Array.isArray(H)&&H.length>0||"string"==typeof H&&H.length>0?H:ye&&ye.length>0?ye:e,o="__streamCat",n=ge.map(e=>({[o]:e})),a=t(n,o,r);return e=>(pe?l(pe,e):void 0)??a(e)??"#999"},[ue,k,ge,H,ye,pe]),{legend:ve,margin:Le,legendPosition:be,legendLayout:Ce,legendMarginReserved:ke}=s({data:U,colorBy:k,colorScale:fe,showLegend:A,legendPosition:w,userMargin:W,defaults:_,categories:ge,additionalLegend:T,chartWidth:V,chartHeight:X,legendLayout:x,frameLegend:O,hasTitle:q,axisChrome:E}),He=b(()=>{const e={};return ve&&(e.legend=ve,e.legendPosition=be,ke&&(e.__legendMarginReservedFor=ve),Ce&&(e.legendLayout=Ce)),S&&"none"!==S&&(e.legendHoverBehavior=de.onLegendHover,e.legendClickBehavior=de.onLegendClick,e.legendHighlightedCategory=de.highlightedCategory,e.legendIsolatedCategories=de.isolatedCategories),J&&k&&(e.legendCategoryAccessor=k,e.onCategoriesChange=ee),e},[ve,be,Ce,ke,S,de.onLegendHover,de.onLegendClick,de.highlightedCategory,de.isolatedCategories,J,k,ee]),Se=Array.isArray(f)?o(f):f,we=i(Y,V,X,K),Ie=we?null:a(Se,V,X,Q);return{data:U,colorScale:ue,allCategories:ge,legendState:de,effectiveSelectionHook:he,activeSelectionHook:oe,customHoverBehavior:ae,customClickBehavior:ie,mobileInteraction:re,legend:ve,margin:Le,legendPosition:be,earlyReturn:we||Ie||null,legendBehaviorProps:He,crosshairProps:ce,resolvedSelection:me}}import{useImperativeHandle as H,useRef as S}from"react";function w(e,t){const{variant:r,frameRef:o,overrides:n}=t,a=S(n);a.current=n,H(e,()=>{const e=function(e,t){if("xy"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.remove(t)??[],update:(t,r)=>e.current?.update(t,r)??[],replace:t=>e.current?.replace?.(t),clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getScales:()=>e.current?.getScales()??null,getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("network"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>{const r=Array.isArray(t)?t:[t],o=e.current?.getTopology()?.nodes??[],n=[];for(const t of r){const r=o.find(e=>e.id===t);r&&n.push({...r.data??{},id:t}),e.current?.removeNode(t)}return n},update:(t,r)=>(Array.isArray(t)?t:[t]).flatMap(t=>{const o=e.current?.updateNode(t,r);return o?[{...o,id:t}]:[]}),clear:()=>e.current?.clear(),getData:()=>e.current?.getTopology()?.nodes?.map(e=>e.data)??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("geo-points"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.removePoint(t)??[],update:(t,r)=>{const o=e.current?.removePoint(t)??[];for(const t of o)e.current?.push(r(t));return o},clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}const r=t;return{push:e=>r.current?.pushLine(e),pushMany:e=>r.current?.pushManyLines(e),remove:e=>r.current?.removeLine(e)??[],update:(e,t)=>{const o=r.current?.removeLine(e)??[];for(const e of o)r.current?.pushLine(t(e));return o},clear:()=>r.current?.clear(),getData:()=>r.current?.getLines()??[],getCustomLayout:()=>r.current?.getCustomLayout?.()??null,getLayoutFailure:()=>r.current?.getLayoutFailure?.()??null}}(r,o);return new Proxy(e,{get(e,t,r){if("string"==typeof t){const e=a.current?.[t];if("function"==typeof e)return e}return Reflect.get(e,t,r)},has:(e,t)=>!("string"!=typeof t||!a.current||!(t in a.current))||Reflect.has(e,t)})},[])}function I(e,t){if(!function(e){return void 0!==e.stroke||void 0!==e.strokeWidth||void 0!==e.opacity}(t))return e??((...e)=>({}));const r={};return void 0!==t.stroke&&(r.stroke=t.stroke),void 0!==t.strokeWidth&&(r.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(r.opacity=t.opacity),e?(...t)=>({...e(...t)||{},...r}):(...e)=>({...r})}function M(e){if(null==e)return;if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};const t={};return"number"==typeof e.top&&(t.top=e.top),"number"==typeof e.right&&(t.right=e.right),"number"==typeof e.bottom&&(t.bottom=e.bottom),"number"==typeof e.left&&(t.left=e.left),t}import{useMemo as D,useRef as R}from"react";function B(e){const t=R(null);return w(e.imperativeRef,{variant:e.imperativeVariant,frameRef:t}),{frameRef:t,resolved:g(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),normalizedMargin:D(()=>M(e.margin),[e.margin])}}function F(e){const t=B(e),{resolved:r,normalizedMargin:o}=t,n=k({data:e.data??[],rawData:e.data,colorBy:e.colorBy,colorScheme:e.colorScheme,legendInteraction:e.legendInteraction,legendPosition:e.legendPosition,frameLegend:e.frameLegend,selection:e.selection,linkedHover:e.linkedHover,hoverHighlight:e.hoverHighlight,fallbackFields:"string"==typeof e.colorBy?[e.colorBy]:[],unwrapData:e.unwrapData,onObservation:e.onObservation,onClick:e.onClick,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,chartType:e.chartTypeLabel,chartId:e.chartId,showLegend:r.showLegend,legend:e.legend,userMargin:o,marginDefaults:r.marginDefaults,loading:e.loading,loadingContent:e.loadingContent,emptyContent:e.emptyContent,width:r.width,height:r.height});return{...t,safeData:n.data,setup:n,earlyReturn:n.earlyReturn}}export{v as useResolvedSelection,k as useChartSetup,w as useFrameImperativeHandle,I as mergeShapeStyle,M as normalizePartialMargin,B as useCustomChartScaffold,F as useCustomChartSetup};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getMinMax as t}from"./c-GGISSW5E.min.js";function e(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}function i(t,e){const{when:i}=t,r=e.width,n=e.height,s=function(t){if("number"==typeof t.height&&t.height>0)return t.width/t.height}(e),a=function(t){if("number"==typeof t.height&&t.height>0)return t.height>t.width?"portrait":"landscape"}(e);return!("number"==typeof i.minWidth&&i.minWidth>r||"number"==typeof i.maxWidth&&r>i.maxWidth||"number"==typeof i.minHeight&&("number"!=typeof n||i.minHeight>n)||"number"==typeof i.maxHeight&&("number"!=typeof n||n>i.maxHeight)||"number"==typeof i.minAspectRatio&&("number"!=typeof s||i.minAspectRatio>s)||"number"==typeof i.maxAspectRatio&&("number"!=typeof s||s>i.maxAspectRatio)||i.orientation&&a!==i.orientation)}function r(t,r,n=t.responsiveRules){if(!Array.isArray(n)||0===n.length)return{props:t,matches:[]};const s=n.map((t,e)=>({rule:t,index:e})).filter(t=>i(t.rule,r)).sort((t,e)=>("number"==typeof t.rule.priority?t.rule.priority:t.index)-("number"==typeof e.rule.priority?e.rule.priority:e.index));return{props:s.reduce((t,i)=>function(t,i){const r={...t,...i};for(const n of["margin","frameProps","mobileSemantics","style"])e(t[n])&&e(i[n])&&(r[n]={...t[n],...i[n]});return"string"==typeof t.className&&"string"==typeof i.className&&(r.className=`${t.className} ${i.className}`),r}(t,i.rule.transform),t),matches:s}}function n(t){if(null==t)return()=>{};const e="function"==typeof t?t:e=>e[t];return t=>o(e(t))}function s(t,e){const i=n(t),r=n(e);return(t,e)=>{const n=r(t);return{value:n,x:i(t),y:n,category:e}}}function a(t,e){const i=n(e??"value"),r=null==t?void 0:"function"==typeof t?t:e=>e[t];return t=>{const e=r?r(t):void 0;return{value:i(t),category:null==e?void 0:e+""}}}function o(t){if("number"==typeof t)return Number.isFinite(t)?t:void 0;if("string"==typeof t&&""!==t.trim()){const e=Number(t);return Number.isFinite(e)?e:void 0}}function c(t,e,i){const r=null!=t.axis?i[t.axis]:null!=t.field?e[t.field]:i.value;if(void 0!==t.eq&&r!==t.eq)return!1;if(void 0!==t.ne&&r===t.ne)return!1;if(void 0!==t.in&&!t.in.includes(r))return!1;if(void 0===t.gt&&void 0===t.gte&&void 0===t.lt&&void 0===t.lte&&void 0===t.within&&void 0===t.outside)return!0;const n=o(r);if(void 0===n)return!1;if(void 0!==t.gt&&t.gt>=n)return!1;if(void 0!==t.gte&&t.gte>n)return!1;if(void 0!==t.lt&&n>=t.lt)return!1;if(void 0!==t.lte&&n>t.lte)return!1;if(void 0!==t.within){const[e,i]=t.within;if(e>n||n>i)return!1}if(void 0!==t.outside){const[e,i]=t.outside;if(n>=e&&i>=n)return!1}return!0}function u(t,e,i){const r=t.when;return void 0===r||!0===r||!1!==r&&("function"==typeof r?r(e,i):c(r,e,i))}function h(t,e,i){if(!e||0===e.length)return{};let r={};for(const n of e){if(!u(n,t,i))continue;const e="function"==typeof n.style?n.style(t,i):n.style;e&&(r={...r,...e})}return r}function f(t,e,i,r=t=>t){const n=t??(()=>({}));return e&&0!==e.length?(t,s)=>{const a=r(t),o={...n(t,s)};return Object.assign(o,h(a,e,i(a,s))),o}:n}function l(t,e,i){return t&&0!==t.length?(r,n)=>{const s=h(r,t,e(r,n)),a=i?i(r,n):void 0;return a?{...s,...a}:s}:i}function p(t,e,i,r){if(!t||0===t.length)return r;const n=a(e,i);return(e,i)=>{const s=e&&e.data||e,a=h(s,t,n(s)),o=r?r(e,i):void 0;return o?{...a,...o}:a}}function d(t,e=.5){const i=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(t);if(!i)return t;const r=Math.round(parseInt(i[1],16)*(1-e)),n=Math.round(parseInt(i[2],16)*(1-e)),s=Math.round(parseInt(i[3],16)*(1-e));return`#${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`}function m(t,e=.5){const i=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(t);if(!i)return t;const r=Math.round(parseInt(i[1],16)+(255-parseInt(i[1],16))*e),n=Math.round(parseInt(i[2],16)+(255-parseInt(i[2],16))*e),s=Math.round(parseInt(i[3],16)+(255-parseInt(i[3],16))*e);return`#${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`}function y(t=240){const e=360-t,i=180+e/2,r=i*Math.PI/180;return{sweepRad:t*Math.PI/180,gapDeg:e,startAngleDeg:i,startAngleRad:r,offsetRad:-Math.PI/2+r}}function g(t,e,i,r,n){const s=i-e||1;return n+(Math.max(e,Math.min(i,t))-e)/s*r}function _(e=240){const{sweepRad:i,offsetRad:r}=y(e),n=[[Math.cos(r),Math.sin(r)],[Math.cos(r+i),Math.sin(r+i)],[0,0]];for(let t=0;2*Math.PI>t;t+=Math.PI/2)((t-r)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)>i+.001||n.push([Math.cos(t),Math.sin(t)]);const s=n.map(t=>t[0]),a=n.map(t=>t[1]),[o,c]=t(s),[u,h]=t(a);return{minX:o,maxX:c,minY:u,maxY:h,width:c-o,height:h-u,cx:(o+c)/2,cy:(u+h)/2}}function b(t){return{type:"hatch",background:t.background,stroke:t.stroke,lineWidth:t.lineWidth,spacing:t.spacing,angle:t.angle}}var v=null;function x(t={},e){const{background:i="transparent",stroke:r="#000",lineWidth:n=1.5,spacing:s=6,angle:a=45}=t,o={background:i,stroke:r,lineWidth:n,spacing:s,angle:a},c=Math.max(8,Math.ceil(2*s));let u;try{u=function(t){return"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(t,t):(v||(v=document.createElement("canvas")),v.width=t,v.height=t,v)}(c)}catch{return b(o)}const h=u.getContext("2d");if(!h)return b(o);i&&"transparent"!==i?(h.fillStyle=i,h.fillRect(0,0,c,c)):h.clearRect(0,0,c,c),h.strokeStyle=r,h.lineWidth=n,h.lineCap="square";const f=a*Math.PI/180;if(45===a||-45===a){const t=a>0?1:-1;for(let e=-c;2*c>=e;e+=s)h.beginPath(),h.moveTo(e,0),h.lineTo(e+t*c,c),h.stroke()}else{h.save(),h.translate(c/2,c/2),h.rotate(f);const t=2*c;for(let e=-t;t>=e;e+=s)h.beginPath(),h.moveTo(-t,e),h.lineTo(t,e),h.stroke();h.restore()}return(e||h).createPattern(u,"repeat")}import{jsx as A,jsxs as S}from"react/jsx-runtime";function M(t){return"object"==typeof t&&null!==t&&"hatch"===t.type}function N(t){return["hatch",t.background??"transparent",t.stroke??"#000",t.lineWidth??1.5,t.spacing??6,t.angle??45,t.lineOpacity??1].join("|")}function k(t,e){let i=2166136261;const r=N(e);for(let t=0;r.length>t;t++)i^=r.charCodeAt(t),i=Math.imul(i,16777619);return`${t}-hatch-${(i>>>0).toString(36)}`}function w(t,e){const{background:i="transparent",stroke:r="#000",lineWidth:n=1.5,spacing:s=6,angle:a=45,lineOpacity:o=1}=t,c=Math.max(8,Math.ceil(2*s));return S("pattern",{id:e,width:c,height:c,patternUnits:"userSpaceOnUse",patternTransform:0!==a?`rotate(${a})`:void 0,children:[i&&"transparent"!==i&&A("rect",{width:c,height:c,fill:i}),A("line",{x1:0,y1:0,x2:0,y2:c,stroke:r,strokeWidth:n,strokeOpacity:o}),A("line",{x1:s,y1:0,x2:s,y2:c,stroke:r,strokeWidth:n,strokeOpacity:o})]},e)}function I(t,e,i="#4e79a7"){if(M(t)){const i=k(e,t);return{fill:`url(#${i})`,def:w(t,i)}}return t&&"string"==typeof t?{fill:t}:{fill:i}}function E(t,e,i,r){if(!t||"object"!=typeof t)return;const n=t;if(!Array.isArray(n.stops))return;const s=n.stops.flatMap(t=>{if(!t||"object"!=typeof t)return[];const{offset:e,color:i,opacity:n}=t;return"number"==typeof e&&Number.isFinite(e)?[{offset:Math.max(0,Math.min(1,e)),color:"string"==typeof i&&i?i:r,opacity:"number"==typeof n&&Number.isFinite(n)?Math.max(0,Math.min(1,n)):void 0}]:[]}).sort((t,e)=>t.offset-e.offset);if(!s.length)return;const a="horizontal"===n.direction?"horizontal":"vertical"===n.direction?"vertical":i,o=e+"-gradient";return{fill:`url(#${o})`,def:A("linearGradient",{id:o,x1:0,y1:0,x2:"horizontal"===a?"100%":0,y2:"vertical"===a?"100%":0,children:s.map((t,e)=>A("stop",{offset:100*t.offset+"%",stopColor:t.color,stopOpacity:t.opacity},`${t.offset}-${e}`))},o)}}var z=class{constructor(t){if(this._capacity=t,this.head=0,this._size=0,1>t)throw Error("RingBuffer capacity must be at least 1");this.buffer=Array(t)}push(t){let e;return this._size===this._capacity?e=this.buffer[this.head]:this._size++,this.buffer[this.head]=t,this.head=(this.head+1)%this._capacity,e}pushMany(t){const e=[];for(const i of t){const t=this.push(i);void 0!==t&&e.push(t)}return e}get(t){if(t>=0&&this._size>t)return this.buffer[(this.head-this._size+t+this._capacity)%this._capacity]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let t=0;return{next:()=>this._size>t?{done:!1,value:this.get(t++)}:{done:!0,value:void 0}}}forEach(t){const e=(this.head-this._size+this._capacity)%this._capacity;for(let i=0;this._size>i;i++)t(this.buffer[(e+i)%this._capacity],i)}toArray(){const t=Array(this._size),e=(this.head-this._size+this._capacity)%this._capacity;for(let i=0;this._size>i;i++)t[i]=this.buffer[(e+i)%this._capacity];return t}resize(t){if(1>t)throw Error("RingBuffer capacity must be at least 1");const e=this.toArray();let i=0,r=[];e.length>t&&(i=e.length-t,r=e.slice(0,i)),this._capacity=t,this.buffer=Array(t),this.head=0,this._size=0;for(let t=i;e.length>t;t++)this.push(e[t]);return r}update(t,e){const i=[],r=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;this._size>n;n++){const s=(r+n)%this._capacity,a=this.buffer[s];if(t(a)){let t;t="object"!=typeof a||null===a?a:Array.isArray(a)?[...a]:{...a},i.push(t),this.buffer[s]=e(a)}}return i}remove(t){const e=[],i=[];if(this.forEach(r=>{t(r)?i.push(r):e.push(r)}),0===i.length)return i;this.buffer=Array(this._capacity),this.head=0,this._size=0;for(const t of e)this.push(t);return i}clear(){this.buffer=Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}},P=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(t){Number.isFinite(t)&&(this._min>t&&(this._min=t),t>this._max&&(this._max=t))}evict(t){t!==this._min&&t!==this._max||(this._dirty=!0)}recalculate(t,e){this._min=1/0,this._max=-1/0;for(const i of t){const t=e?e(i):i;Number.isFinite(t)&&(this._min>t&&(this._min=t),t>this._max&&(this._max=t))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}};function R(t,e=30){return Math.max((t??4)+5,12,e)}function $(t){return t instanceof Date?t:"number"==typeof t&&t>1e9?new Date(t):null}function O(t,e){const i=$(t);if(!i)return!1;const r=$(e);return!r||i.getFullYear()!==r.getFullYear()||i.getMonth()!==r.getMonth()}function T(t){const e=[],i=t.domain;null==i?e.push({severity:"error",code:"PROCESS_SANKEY_MISSING_DOMAIN",message:"ProcessSankey requires domain: [tStart, tEnd].",fix:"Pass domain={[start, end]} as numbers or Date-compatible values."}):Array.isArray(i)&&2===i.length&&Number.isFinite(Number(i[0]))&&Number.isFinite(Number(i[1]))||e.push({severity:"error",code:"PROCESS_SANKEY_BAD_DOMAIN",message:"domain must be a 2-tuple of finite times.",fix:"Use domain={[t0, t1]} with t0 <= t1."});const r=t.edges;if(Array.isArray(r)&&r.length>0){const t=r[0];null!=t.startTime&&null!=t.endTime||e.push({severity:"warning",code:"PROCESS_SANKEY_EDGE_TIMES",message:"Edges should carry startTime and endTime for temporal layout.",fix:"Add startTime/endTime fields or set startTimeAccessor/endTimeAccessor."})}const n=t.nodes,s=Array.isArray(n)?n.length:0;return!0!==t.showLabels||24>s||e.push({severity:"warning",code:"PROCESS_SANKEY_LABEL_DENSITY",message:`showLabels={true} with ${s} nodes may overcrowd the plot.`,fix:'Use showLabels="auto" with optional labelPriorityAccessor / maxLabels.'}),80>(Array.isArray(r)?r.length:0)||null!=t.layoutExecution||"off"===t.packing||e.push({severity:"warning",code:"PROCESS_SANKEY_WORKER_HINT",message:"Dense ProcessSankey layouts benefit from worker packing/order.",fix:'layoutExecution defaults to "auto"; set layoutExecution="worker" or raise layoutWorkerThreshold deliberately.'}),e}var W=/^\d{4}-\d{1,2}$/;function D(t){const e=t.trim();if(!e||!Number.isNaN(Number(e)))return NaN;const i=W.test(e)?e+"-01":e;if(i===e&&10>e.length)return NaN;const r=Date.parse(i);return Number.isFinite(r)?r:NaN}function C(t){return t instanceof Date?t.getTime():"string"==typeof t?D(t):+t}function F(t){const e=t.provenance,i=t.id??t.stableId??e?.stableId;return null==i||""===i?void 0:i+""}export{i as responsiveRuleMatches,r as resolveResponsiveRules,n as makeRuleValueResolver,s as makeXYRuleContext,a as makeNodeRuleContext,c as matchesThreshold,u as ruleMatches,h as resolveStyleRules,f as composeStyleRules,l as makeStyleRuleStyleFn,p as styleRulesToNodeStyle,d as darkenColor,m as lightenColor,y as sweepToAngles,g as valueToAngle,_ as computeArcBoundingBox,T as diagnoseProcessSankeyProps,x as createHatchPattern,M as isHatchFill,N as hatchFillKey,k as hatchFillId,w as hatchPatternDef,I as resolveSvgFill,E as resolveAnnotationGradient,z as RingBuffer,P as IncrementalExtent,D as parseDateLikeString,C as coerceDateLikeValue,F as annotationStableId,R as getHitRadius,O as isTimeLandmark};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useBrushAccessibility as r}from"./c-USFMFKIH.min.js";import{useRef as t,useEffect as e}from"react";import{select as n}from"d3-selection";import{brushX as c,brushY as u}from"d3-brush";import{jsx as l,jsxs as i}from"react/jsx-runtime";function o({width:o,height:s,totalWidth:a,totalHeight:h,margin:m,scales:d,onBrush:f}){const p=t(null),v=t(null),b=t(f);b.current=f;const g=t(d);g.current=d;const M=t(!1),x=t(null),w="horizontal"===d?.projection,y=t(w);y.current=w;const j=r({label:"Ordinal value range brush",onAction:r=>{const t=g.current,e=v.current;if(!t||!e||!p.current)return;const c=n(p.current).select(".brush-g");if("clear"===r.type)return M.current=!0,c.call(e.move,null),M.current=!1,x.current=null,void b.current(null);if(("left"===r.direction||"right"===r.direction)!=!!y.current)return;const u=t.r.domain(),[l,i]=[Math.min(...u),Math.max(...u)],o=(i-l)/20,s=x.current?.r??[l+.4*(i-l),l+.6*(i-l)],a="left"===r.direction||"down"===r.direction?-1:1;let[h,m]=s;if(r.resize)0>a?h=Math.max(l,h-o):m=Math.min(i,m+o);else{const r=m-h;h=Math.max(l,Math.min(i-r,h+a*o)),m=h+r}const d={r:[h,m]};M.current=!0,c.call(e.move,y.current?[t.r(h),t.r(m)]:[t.r(m),t.r(h)]),M.current=!1,x.current=d,b.current(d)}});return e(()=>{if(!p.current)return;const r=n(p.current).select(".brush-g"),t=w?c():u();return t.extent([[0,0],[o,s]]),t.on("brush end",r=>{if(M.current)return;const t=g.current;if(!t)return;if(!r.selection)return x.current=null,void b.current(null);const[e,n]=r.selection;let c;c=y.current?[t.r.invert(e),t.r.invert(n)]:[t.r.invert(n),t.r.invert(e)];const u={r:c};x.current=u,b.current(u)}),r.call(t),v.current=t,r.select(".selection").attr("fill","steelblue").attr("fill-opacity",.15).attr("stroke","steelblue").attr("stroke-width",1),()=>{t.on("brush end",null),v.current=null}},[o,s,w]),e(()=>{if(!d||!v.current||!x.current)return;if(!p.current)return;const r=x.current,t=n(p.current).select(".brush-g"),e=d.r(r.r[0]),c=d.r(r.r[1]);w?(M.current=!0,t.call(v.current.move,[e,c]),M.current=!1):(M.current=!0,t.call(v.current.move,[c,e]),M.current=!1)},[d,w]),i("svg",{ref:p,width:a,height:h,...j.svgProps,style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[l("title",{children:j.svgProps["aria-label"]}),l("desc",{id:j.descriptionId,children:j.description}),l("g",{className:"brush-g",transform:`translate(${m.left},${m.top})`,style:{pointerEvents:"all"}})]})}export{o as OrdinalBrushOverlay};
|