semiotic 3.8.5 → 3.8.7
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 +37 -10
- package/README.md +83 -56
- package/ai/behaviorContracts.cjs +88 -3
- package/ai/componentMetadata.cjs +5 -10
- package/ai/dist/mcp-server.js +99 -10
- package/ai/examples.md +198 -9
- package/ai/schema.json +2002 -165
- package/ai/surface-manifest.json +14 -10
- package/ai/system-prompt.md +9 -3
- package/dist/{chunk-chartContainerDataAudit-74TLKIP6.module.min.js → chunk-chartContainerDataAudit-JDSVSKGM.module.min.js} +1 -1
- package/dist/chunk-chunk-2JGJ5GUG.module.min.js +1 -0
- package/dist/chunk-chunk-2YAZHXL4.module.min.js +2 -0
- package/dist/chunk-chunk-3NGIKFD6.module.min.js +1 -0
- package/dist/{chunk-chunk-G7WFWHAD.module.min.js → chunk-chunk-4ITOQRXM.module.min.js} +1 -1
- package/dist/chunk-chunk-5SD6BHVW.module.min.js +2 -0
- package/dist/chunk-chunk-6V5VQVCT.module.min.js +2 -0
- package/dist/chunk-chunk-7TTBHSAG.module.min.js +2 -0
- package/dist/chunk-chunk-7ZDJSYKI.module.min.js +2 -0
- package/dist/chunk-chunk-BGHPD3RA.module.min.js +1 -0
- package/dist/chunk-chunk-BMRZ2SPU.module.min.js +2 -0
- package/dist/chunk-chunk-BNGBEY7N.module.min.js +2 -0
- package/dist/chunk-chunk-C7APLVQD.module.min.js +2 -0
- package/dist/chunk-chunk-DGWFBOGB.module.min.js +1 -0
- package/dist/chunk-chunk-DIVE2DRA.module.min.js +2 -0
- package/dist/chunk-chunk-FBUNUIPV.module.min.js +2 -0
- package/dist/chunk-chunk-FQPKOAIH.module.min.js +2 -0
- package/dist/chunk-chunk-FRO4TRXK.module.min.js +2 -0
- package/dist/chunk-chunk-G7QVPZUD.module.min.js +2 -0
- package/dist/chunk-chunk-GBPYV4FP.module.min.js +2 -0
- package/dist/chunk-chunk-GU2EJIDJ.module.min.js +2 -0
- package/dist/chunk-chunk-J5QD4RAM.module.min.js +2 -0
- package/dist/{chunk-chunk-LJLS6DY7.module.min.js → chunk-chunk-JWXLNZSM.module.min.js} +1 -1
- package/dist/chunk-chunk-KXAFCCDB.module.min.js +2 -0
- package/dist/chunk-chunk-LG7YKJAK.module.min.js +2 -0
- package/dist/{chunk-chunk-I36PJ4OC.module.min.js → chunk-chunk-LVHDZAT3.module.min.js} +1 -1
- package/dist/chunk-chunk-LWITSR2O.module.min.js +2 -0
- package/dist/chunk-chunk-MX35T6RX.module.min.js +2 -0
- package/dist/chunk-chunk-NH4MEAKP.module.min.js +2 -0
- package/dist/chunk-chunk-NJETWX42.module.min.js +2 -0
- package/dist/chunk-chunk-NW25WGLS.module.min.js +2 -0
- package/dist/{chunk-chunk-TMWIZL3K.module.min.js → chunk-chunk-OI7R7EJB.module.min.js} +1 -1
- package/dist/chunk-chunk-ONMLEXHR.module.min.js +2 -0
- package/dist/chunk-chunk-OY66GCE6.module.min.js +1 -0
- package/dist/chunk-chunk-PZFT457G.module.min.js +1 -0
- package/dist/chunk-chunk-Q3WW6JGR.module.min.js +1 -0
- package/dist/chunk-chunk-Q6XKQTOQ.module.min.js +1 -0
- package/dist/chunk-chunk-RJRM2E6P.module.min.js +1 -0
- package/dist/chunk-chunk-RPL7WYXI.module.min.js +1 -0
- package/dist/chunk-chunk-SV4XAZ3Q.module.min.js +1 -0
- package/dist/chunk-chunk-TSCFL235.module.min.js +1 -0
- package/dist/chunk-chunk-UOQRPGPK.module.min.js +2 -0
- package/dist/chunk-chunk-V3OAKG32.module.min.js +1 -0
- package/dist/chunk-chunk-WLOIUMWG.module.min.js +2 -0
- package/dist/chunk-chunk-XEGXX4F7.module.min.js +1 -0
- package/dist/chunk-chunk-XFRBLXYM.module.min.js +1 -0
- package/dist/chunk-chunk-Z2AJERX5.module.min.js +2 -0
- package/dist/chunk-chunk-ZXYDYAB7.module.min.js +2 -0
- package/dist/components/ai/SemioticVACPBridge.d.ts +22 -0
- package/dist/components/ai/chartCapabilities.d.ts +5 -3
- package/dist/components/ai/conversationArc.d.ts +2 -176
- package/dist/components/ai/conversationArcTypes.d.ts +202 -0
- package/dist/components/ai/readerGrounding.d.ts +12 -0
- package/dist/components/ai/vacpAdapter.d.ts +13 -0
- package/dist/components/ai/vacpAdapterActions.d.ts +2 -0
- package/dist/components/ai/vacpAdapterModel.d.ts +7 -0
- package/dist/components/ai/vacpAdapterRuntime.d.ts +26 -0
- package/dist/components/ai/vacpAdapterState.d.ts +3 -0
- package/dist/components/ai/vacpAdapterTypes.d.ts +169 -0
- package/dist/components/ai/vacpTypes.d.ts +160 -0
- package/dist/components/charts/custom/XYCustomChart.d.ts +3 -0
- package/dist/components/charts/geo/DistanceCartogram.d.ts +1 -1
- package/dist/components/charts/index.d.ts +7 -4
- package/dist/components/charts/ordinal/BarChart.d.ts +7 -14
- package/dist/components/charts/ordinal/GaugeChart.d.ts +3 -0
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +3 -0
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +3 -0
- package/dist/components/charts/ordinal/SwimlaneChart.d.ts +4 -14
- package/dist/components/charts/physics/ChainReactionChart.capability.d.ts +9 -0
- package/dist/components/charts/physics/ChainReactionChart.d.ts +29 -0
- package/dist/components/charts/physics/CollisionSwarmChart.d.ts +1 -1
- package/dist/components/charts/physics/EventDropChart.d.ts +7 -2
- package/dist/components/charts/physics/GaltonBoardChart.d.ts +1 -1
- package/dist/components/charts/physics/{PhysicsPileChart.capability.d.ts → PacketFlowChart.capability.d.ts} +1 -1
- package/dist/components/charts/physics/{PhysicalFlowChart.d.ts → PacketFlowChart.d.ts} +22 -6
- package/dist/components/charts/physics/PhysicsCustomChart.d.ts +1 -1
- package/dist/components/charts/physics/ProcessFlowChart.d.ts +7 -4
- package/dist/components/charts/physics/{PhysicalFlowChart.capability.d.ts → UnitPileChart.capability.d.ts} +1 -1
- package/dist/components/charts/physics/{PhysicsPileChart.d.ts → UnitPileChart.d.ts} +19 -6
- package/dist/components/charts/physics/crucibleChartProps.d.ts +1 -1
- package/dist/components/charts/physics/crucibleChartUtils.d.ts +9 -0
- package/dist/components/charts/physics/gauntletChartProps.d.ts +6 -1
- package/dist/components/charts/physics/gauntletTerminal.d.ts +61 -0
- package/dist/components/charts/physics/packetFlowSemantics.d.ts +6 -0
- package/dist/components/charts/physics/physicsHocUtils.d.ts +45 -2
- package/dist/components/charts/shared/auditAccessibilityStyles.d.ts +9 -0
- package/dist/components/charts/shared/chartSpecCore.d.ts +2 -4
- package/dist/components/charts/shared/gaugeGradient.d.ts +4 -8
- package/dist/components/charts/shared/gradient.d.ts +35 -0
- package/dist/components/charts/shared/hatchFill.d.ts +3 -10
- package/dist/components/charts/shared/hooks.d.ts +2 -50
- package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
- package/dist/components/charts/shared/streamPropsHelpers.d.ts +1 -2
- package/dist/components/charts/shared/useChartLegend.d.ts +65 -0
- package/dist/components/charts/shared/useChartSetup.d.ts +12 -0
- package/dist/components/charts/shared/useCustomChartSetup.d.ts +6 -1
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +1 -0
- package/dist/components/charts/shared/useStreamingLegend.d.ts +1 -1
- package/dist/components/charts/xy/AreaChart.d.ts +25 -42
- package/dist/components/charts/xy/BumpChart.capability.d.ts +11 -0
- package/dist/components/charts/xy/BumpChart.d.ts +161 -0
- package/dist/components/charts/xy/DifferenceChart.d.ts +3 -10
- package/dist/components/charts/xy/Heatmap.d.ts +3 -0
- package/dist/components/charts/xy/LineChart.d.ts +6 -8
- package/dist/components/data/portability/capabilityBinding.d.ts +41 -0
- package/dist/components/data/portability/index.d.ts +2 -0
- package/dist/components/geometry/bumpRibbonGeometry.d.ts +36 -0
- package/dist/components/legendLayout.d.ts +75 -1
- package/dist/components/recipes/geographicDotGrid.d.ts +82 -0
- package/dist/components/recipes/geographicGrid.d.ts +100 -0
- package/dist/components/recipes/physics.d.ts +2 -0
- package/dist/components/recipes/physicsStageGeography.d.ts +137 -0
- package/dist/components/semiotic-ai.d.ts +6 -4
- package/dist/components/semiotic-experimental-vacp.d.ts +11 -0
- package/dist/components/semiotic-experimental.d.ts +6 -3
- package/dist/components/semiotic-geo.d.ts +5 -0
- package/dist/components/semiotic-network.d.ts +1 -0
- package/dist/components/semiotic-ordinal.d.ts +2 -0
- package/dist/components/semiotic-physics.d.ts +10 -6
- package/dist/components/semiotic-realtime-core.d.ts +1 -0
- package/dist/components/semiotic-recipes-core.d.ts +6 -1
- package/dist/components/semiotic-server-edge.d.ts +1 -1
- package/dist/components/semiotic-server.d.ts +1 -1
- package/dist/components/semiotic-xy.d.ts +4 -0
- package/dist/components/semiotic.d.ts +4 -4
- package/dist/components/server/renderEvidence.d.ts +1 -1
- package/dist/components/server/renderToStaticSVG.d.ts +2 -1
- package/dist/components/server/serverChartConfigHeatmap.d.ts +6 -0
- package/dist/components/server/serverChartConfigNetworkStyles.d.ts +12 -0
- package/dist/components/server/serverChartConfigShared.d.ts +16 -0
- package/dist/components/server/serverChartConfigs.d.ts +3 -2
- package/dist/components/server/serverChartConfigsPhysics.d.ts +2 -2
- package/dist/components/server/serverChartConfigsXY.d.ts +1 -1
- package/dist/components/server/staticLegend.d.ts +10 -2
- package/dist/components/server/staticSVGChrome.d.ts +14 -6
- package/dist/components/server/staticValue.d.ts +8 -0
- package/dist/components/stream/GeoSVGOverlay.d.ts +4 -10
- package/dist/components/stream/NetworkSVGOverlay.d.ts +2 -6
- package/dist/components/stream/OrdinalSVGOverlay.d.ts +2 -6
- package/dist/components/stream/SVGOverlay.d.ts +2 -6
- package/dist/components/stream/StalenessBadge.d.ts +2 -6
- package/dist/components/stream/geoPipelineConfig.d.ts +10 -0
- package/dist/components/stream/geoTypes.d.ts +3 -6
- package/dist/components/stream/legendRenderer.d.ts +10 -6
- package/dist/components/stream/ordinalTypes.d.ts +7 -31
- package/dist/components/stream/physics/PhysicsEvidence.d.ts +37 -0
- package/dist/components/stream/physics/PhysicsKernel.d.ts +1 -0
- package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +9 -0
- package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +2 -6
- package/dist/components/stream/physics/PhysicsSettledScene.d.ts +5 -0
- package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +2 -6
- package/dist/components/stream/physics/physicsFramePipelineConfig.d.ts +19 -0
- package/dist/components/stream/physics/physicsPipelineSettle.d.ts +52 -0
- package/dist/components/stream/physics/physicsRegionRuntime.d.ts +23 -0
- package/dist/components/stream/pipelineConfig.d.ts +7 -15
- package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +9 -69
- package/dist/components/stream/renderers/cornerRadii.d.ts +2 -9
- package/dist/components/stream/renderers/thresholdLineSegments.d.ts +12 -0
- package/dist/components/stream/sceneToSVGShared.d.ts +3 -5
- package/dist/components/stream/types.d.ts +34 -56
- package/dist/components/stream/xySceneBuilders/areaGradient.d.ts +4 -20
- package/dist/components/stream/xySceneBuilders/types.d.ts +6 -6
- package/dist/components/types/legendTypes.d.ts +31 -6
- package/dist/controls.min.js +1 -1
- package/dist/controls.module.min.js +1 -1
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.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.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/physicsWorker.js +1 -1
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +6 -4
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-experimental-vacp.d.ts +11 -0
- package/dist/semiotic-experimental-vacp.min.js +1 -0
- package/dist/semiotic-experimental-vacp.module.min.js +1 -0
- package/dist/semiotic-experimental.d.ts +6 -3
- package/dist/semiotic-experimental.min.js +2 -1
- package/dist/semiotic-experimental.module.min.js +2 -1
- package/dist/semiotic-geo.d.ts +5 -0
- package/dist/semiotic-network.d.ts +1 -0
- package/dist/semiotic-ordinal.d.ts +2 -0
- package/dist/semiotic-physics.d.ts +10 -6
- package/dist/semiotic-realtime-core.d.ts +1 -0
- package/dist/semiotic-realtime-core.min.js +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-recipes-core.d.ts +6 -1
- package/dist/semiotic-recipes-core.min.js +1 -1
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes.min.js +1 -1
- package/dist/semiotic-recipes.module.min.js +1 -1
- package/dist/semiotic-server-edge.d.ts +1 -1
- package/dist/semiotic-server-edge.min.js +1 -1
- package/dist/semiotic-server-edge.module.min.js +1 -1
- package/dist/semiotic-server-node.min.js +1 -1
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-server.d.ts +1 -1
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic-utils.min.js +1 -1
- package/dist/semiotic-utils.module.min.js +1 -1
- package/dist/semiotic-xy.d.ts +4 -0
- package/dist/semiotic.d.ts +4 -4
- 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 +18 -2
- package/spec/README.md +94 -2
- package/spec/bindings/README.md +14 -3
- package/spec/v0.1/examples/annotation-provenance-reviewed-revision.json +27 -0
- package/spec/v0.1/examples/annotation-provenance-watcher-threshold.json +21 -0
- package/spec/v0.1/examples/audience-profile-executive-review.json +24 -0
- package/spec/v0.1/examples/audience-profile-incident-operators.json +42 -0
- package/spec/v0.1/examples/chart-capability-bar-comparison.json +48 -0
- package/spec/v0.1/examples/chart-capability-service-flow.json +54 -0
- package/dist/chunk-chunk-4AANPFOX.module.min.js +0 -2
- package/dist/chunk-chunk-5I3UZV4Q.module.min.js +0 -2
- package/dist/chunk-chunk-5RKXZQ2P.module.min.js +0 -1
- package/dist/chunk-chunk-74CCPVXB.module.min.js +0 -1
- package/dist/chunk-chunk-7ALTGHK6.module.min.js +0 -1
- package/dist/chunk-chunk-ANYDWOZF.module.min.js +0 -1
- package/dist/chunk-chunk-AVBI6GDT.module.min.js +0 -1
- package/dist/chunk-chunk-BANTPINB.module.min.js +0 -2
- package/dist/chunk-chunk-C4YA6TDR.module.min.js +0 -1
- package/dist/chunk-chunk-C57LR3YG.module.min.js +0 -1
- package/dist/chunk-chunk-CKMD5NV3.module.min.js +0 -2
- package/dist/chunk-chunk-CO5KQMGH.module.min.js +0 -1
- package/dist/chunk-chunk-CWQ5YIHX.module.min.js +0 -2
- package/dist/chunk-chunk-E6TXX6MI.module.min.js +0 -1
- package/dist/chunk-chunk-GMQ5AYTD.module.min.js +0 -1
- package/dist/chunk-chunk-JCG72SGW.module.min.js +0 -2
- package/dist/chunk-chunk-K3DMEW22.module.min.js +0 -1
- package/dist/chunk-chunk-KT2VAZMZ.module.min.js +0 -1
- package/dist/chunk-chunk-L6EA5V3G.module.min.js +0 -2
- package/dist/chunk-chunk-LJPCLYSC.module.min.js +0 -2
- package/dist/chunk-chunk-LRIFN2HK.module.min.js +0 -1
- package/dist/chunk-chunk-N5DDKCCF.module.min.js +0 -1
- package/dist/chunk-chunk-NEVE562N.module.min.js +0 -1
- package/dist/chunk-chunk-NLO44TOS.module.min.js +0 -2
- package/dist/chunk-chunk-PZJ2SBLL.module.min.js +0 -2
- package/dist/chunk-chunk-QSQVBIJA.module.min.js +0 -1
- package/dist/chunk-chunk-QUJ6TTLY.module.min.js +0 -1
- package/dist/chunk-chunk-RBIDBUT4.module.min.js +0 -2
- package/dist/chunk-chunk-RCF52Z42.module.min.js +0 -2
- package/dist/chunk-chunk-RFLAG356.module.min.js +0 -1
- package/dist/chunk-chunk-RPU4IZAV.module.min.js +0 -2
- package/dist/chunk-chunk-SKMBCFIL.module.min.js +0 -2
- package/dist/chunk-chunk-TAE7W424.module.min.js +0 -2
- package/dist/chunk-chunk-TUBMTZMU.module.min.js +0 -2
- package/dist/chunk-chunk-UFFEXJQY.module.min.js +0 -1
- package/dist/chunk-chunk-XSCHTS4D.module.min.js +0 -2
- package/dist/chunk-chunk-XXWSHGPL.module.min.js +0 -2
- package/dist/chunk-chunk-ZOAQDIJO.module.min.js +0 -1
- package/dist/chunk-chunk-ZXIXAPRE.module.min.js +0 -2
- package/dist/chunk-statisticalOverlays-QGDLRUHX.module.min.js +0 -1
- package/dist/chunk-statisticalOverlays-T77OKLDY.module.min.js +0 -1
|
@@ -4,8 +4,8 @@ import type { StyleRule } from "../shared/styleRules";
|
|
|
4
4
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
5
5
|
import { type PhysicalFlowCoordinateMode, type PhysicalFlowPathConstraint, type PhysicalFlowRawPath } from "./physicsChartUtils";
|
|
6
6
|
import { type PhysicsFrameHandle } from "./physicsHocHandle";
|
|
7
|
-
import { type PhysicsHocFrameProps, type PhysicsSharedChartProps, type TooltipProp } from "./physicsHocUtils";
|
|
8
|
-
export interface
|
|
7
|
+
import { type PhysicsHocFrameProps, type PhysicsRerunMS, type PhysicsSharedChartProps, type TooltipProp } from "./physicsHocUtils";
|
|
8
|
+
export interface PacketFlowChartProps<TNode extends Datum = Datum, TLink extends Datum = Datum> extends Omit<BaseChartProps, "margin" | "selection">, PhysicsSharedChartProps {
|
|
9
9
|
nodes?: TNode[];
|
|
10
10
|
links?: TLink[];
|
|
11
11
|
edges?: TLink[];
|
|
@@ -37,15 +37,22 @@ export interface PhysicalFlowChartProps<TNode extends Datum = Datum, TLink exten
|
|
|
37
37
|
styleRules?: StyleRule[];
|
|
38
38
|
seed?: number;
|
|
39
39
|
tooltip?: TooltipProp;
|
|
40
|
+
/**
|
|
41
|
+
* Replay the seeded simulation this many milliseconds after it settles.
|
|
42
|
+
* Omit or pass `null` for a single run; `0` replays on the next timer turn.
|
|
43
|
+
*/
|
|
44
|
+
rerunMS?: PhysicsRerunMS;
|
|
40
45
|
paused?: boolean;
|
|
41
46
|
frameProps?: PhysicsHocFrameProps<"config">;
|
|
42
47
|
}
|
|
48
|
+
/** @deprecated Renamed to {@link PacketFlowChartProps} in 3.9.0. */
|
|
49
|
+
export type PhysicalFlowChartProps<TNode extends Datum = Datum, TLink extends Datum = Datum> = PacketFlowChartProps<TNode, TLink>;
|
|
43
50
|
/**
|
|
44
51
|
* Physics-backed flow chart that sends packet bodies along authored routes while retaining a static throughput layer.
|
|
45
52
|
*
|
|
46
53
|
* @example
|
|
47
54
|
* ```tsx
|
|
48
|
-
* <
|
|
55
|
+
* <PacketFlowChart
|
|
49
56
|
* nodes={[{ id: "in", x: 0.1, y: 0.5 }, { id: "out", x: 0.9, y: 0.5 }]}
|
|
50
57
|
* links={[{ source: "in", target: "out", value: 40 }]}
|
|
51
58
|
* coordinateMode="normalized"
|
|
@@ -54,7 +61,7 @@ export interface PhysicalFlowChartProps<TNode extends Datum = Datum, TLink exten
|
|
|
54
61
|
*
|
|
55
62
|
* @example
|
|
56
63
|
* ```tsx
|
|
57
|
-
* <
|
|
64
|
+
* <PacketFlowChart
|
|
58
65
|
* nodes={ports}
|
|
59
66
|
* edges={routes}
|
|
60
67
|
* pathAccessor="path"
|
|
@@ -63,8 +70,17 @@ export interface PhysicalFlowChartProps<TNode extends Datum = Datum, TLink exten
|
|
|
63
70
|
* />
|
|
64
71
|
* ```
|
|
65
72
|
*/
|
|
73
|
+
export declare const PacketFlowChart: {
|
|
74
|
+
<TNode extends Datum = Datum, TLink extends Datum = Datum>(props: PacketFlowChartProps<TNode, TLink> & React.RefAttributes<PhysicsFrameHandle>): React.ReactElement | null;
|
|
75
|
+
displayName?: string;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* @deprecated Renamed to {@link PacketFlowChart} in 3.9.0. Sends discrete packets along authored routes; "Physical" named the substrate and told a reader nothing about the reading protocol.
|
|
79
|
+
* The alias stays exported indefinitely for existing imports; new code and
|
|
80
|
+
* every registry (schema, capabilities, MCP, server configs) use `PacketFlowChart`.
|
|
81
|
+
*/
|
|
66
82
|
export declare const PhysicalFlowChart: {
|
|
67
|
-
<TNode extends Datum = Datum, TLink extends Datum = Datum>(props:
|
|
83
|
+
<TNode extends Datum = Datum, TLink extends Datum = Datum>(props: PacketFlowChartProps<TNode, TLink> & React.RefAttributes<PhysicsFrameHandle>): React.ReactElement | null;
|
|
68
84
|
displayName?: string;
|
|
69
85
|
};
|
|
70
|
-
export default
|
|
86
|
+
export default PacketFlowChart;
|
|
@@ -62,7 +62,7 @@ export interface PhysicsCustomLayoutResult {
|
|
|
62
62
|
}
|
|
63
63
|
export type PhysicsCustomLayout<TDatum extends Datum = Datum, TConfig extends object = Record<string, unknown>> = (ctx: PhysicsCustomLayoutContext<TDatum, TConfig>) => PhysicsCustomLayoutResult;
|
|
64
64
|
export type PhysicsCustomSpawnDatumResult = PhysicsDatumSpawnResult | PhysicsQueuedSpawn | PhysicsQueuedSpawn[];
|
|
65
|
-
export interface PhysicsCustomChartProps<TDatum extends Datum = Datum, TConfig extends object = Record<string, unknown>> extends Omit<BaseChartProps, "margin">, PhysicsSharedChartProps {
|
|
65
|
+
export interface PhysicsCustomChartProps<TDatum extends Datum = Datum, TConfig extends object = Record<string, unknown>> extends Omit<BaseChartProps, "margin" | "selection">, PhysicsSharedChartProps {
|
|
66
66
|
data?: TDatum[];
|
|
67
67
|
layout: PhysicsCustomLayout<TDatum, TConfig>;
|
|
68
68
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { type
|
|
2
|
+
import { type StreamPhysicsFrameProps } from "../../stream/physics/StreamPhysicsFrame";
|
|
3
3
|
import { type CapacityQueueSnapshot } from "../../stream/physics/PhysicsControllers";
|
|
4
4
|
import { type ProcessChromeOptions } from "../../recipes/processChrome";
|
|
5
5
|
import type { Datum } from "../shared/datumTypes";
|
|
6
6
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
7
7
|
import { type ProcessFlowProjectionMetadata, type ProcessFlowStageDef } from "./physicsChartUtils";
|
|
8
8
|
import { type PhysicsFrameHandle } from "./physicsHocHandle";
|
|
9
|
-
import { type PhysicsHocFrameProps, type PhysicsSharedChartProps, type TooltipProp } from "./physicsHocUtils";
|
|
9
|
+
import { type PhysicsHocFrameProps, type PhysicsRerunMS, type PhysicsSharedChartProps, type TooltipProp } from "./physicsHocUtils";
|
|
10
10
|
export type { ProcessFlowStageDef, ProcessFlowProjectionMetadata };
|
|
11
11
|
export interface ProcessFlowChartProps<TDatum extends Datum = Datum> extends Omit<BaseChartProps, "margin" | "selection">, PhysicsSharedChartProps {
|
|
12
12
|
data?: TDatum[];
|
|
@@ -35,6 +35,11 @@ export interface ProcessFlowChartProps<TDatum extends Datum = Datum> extends Omi
|
|
|
35
35
|
springDamping?: number;
|
|
36
36
|
tooltip?: TooltipProp;
|
|
37
37
|
paused?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Replay the seeded simulation this many milliseconds after it settles.
|
|
40
|
+
* Omit or pass `null` for a single run; `0` replays on the next timer turn.
|
|
41
|
+
*/
|
|
42
|
+
rerunMS?: PhysicsRerunMS;
|
|
38
43
|
initialSpawnPacing?: StreamPhysicsFrameProps["initialSpawnPacing"];
|
|
39
44
|
/**
|
|
40
45
|
* When true (default), stages with `capacity` install live FIFO queue
|
|
@@ -43,8 +48,6 @@ export interface ProcessFlowChartProps<TDatum extends Datum = Datum> extends Omi
|
|
|
43
48
|
liveCapacity?: boolean;
|
|
44
49
|
/** Live capacity metrics callback (queue depth, processed count per region). */
|
|
45
50
|
onCapacityChange?: (stats: CapacityQueueSnapshot[]) => void;
|
|
46
|
-
/** Shared selection (process body restyle without relayout). */
|
|
47
|
-
selection?: PhysicsBodySelection | null;
|
|
48
51
|
/**
|
|
49
52
|
* Soft body budget: caps live bodies via pipeline bodyLimit (evict oldest).
|
|
50
53
|
* Use for infinite/long streams with sediment-style history in the readout.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ChartCapability } from "../../ai/chartCapabilityTypes";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const UnitPileChartCapability: ChartCapability;
|
|
@@ -3,8 +3,8 @@ import type { Datum } from "../shared/datumTypes";
|
|
|
3
3
|
import type { BaseChartProps, ChartAccessor, ChartMode } from "../shared/types";
|
|
4
4
|
import type { StyleRule } from "../shared/styleRules";
|
|
5
5
|
import { type PhysicsFrameHandle } from "./physicsHocHandle";
|
|
6
|
-
import { type PhysicsHocFrameProps, type PhysicsSharedChartProps, type PhysicsSimulationMode, type TooltipProp } from "./physicsHocUtils";
|
|
7
|
-
export interface
|
|
6
|
+
import { type PhysicsHocFrameProps, type PhysicsRerunMS, type PhysicsSharedChartProps, type PhysicsSimulationMode, type TooltipProp } from "./physicsHocUtils";
|
|
7
|
+
export interface UnitPileChartProps<TDatum extends Datum = Datum> extends Omit<BaseChartProps, "margin" | "mode" | "selection">, PhysicsSharedChartProps {
|
|
8
8
|
data?: TDatum[];
|
|
9
9
|
size?: [number, number];
|
|
10
10
|
categoryAccessor?: ChartAccessor<TDatum, string>;
|
|
@@ -30,15 +30,22 @@ export interface PhysicsPileChartProps<TDatum extends Datum = Datum> extends Omi
|
|
|
30
30
|
showProjection?: boolean;
|
|
31
31
|
sediment?: boolean;
|
|
32
32
|
tooltip?: TooltipProp;
|
|
33
|
+
/**
|
|
34
|
+
* Replay the seeded simulation this many milliseconds after it settles.
|
|
35
|
+
* Omit or pass `null` for a single run; `0` replays on the next timer turn.
|
|
36
|
+
*/
|
|
37
|
+
rerunMS?: PhysicsRerunMS;
|
|
33
38
|
paused?: boolean;
|
|
34
39
|
frameProps?: PhysicsHocFrameProps<"config">;
|
|
35
40
|
}
|
|
41
|
+
/** @deprecated Renamed to {@link UnitPileChartProps} in 3.9.0. */
|
|
42
|
+
export type PhysicsPileChartProps<TDatum extends Datum = Datum> = UnitPileChartProps<TDatum>;
|
|
36
43
|
/**
|
|
37
44
|
* Physics-backed unit pile chart that converts category values into repeated bodies and a readable settled projection.
|
|
38
45
|
*
|
|
39
46
|
* @example
|
|
40
47
|
* ```tsx
|
|
41
|
-
* <
|
|
48
|
+
* <UnitPileChart
|
|
42
49
|
* data={[{ category: "A", value: 12 }, { category: "B", value: 8 }]}
|
|
43
50
|
* categoryAccessor="category"
|
|
44
51
|
* valueAccessor="value"
|
|
@@ -48,7 +55,7 @@ export interface PhysicsPileChartProps<TDatum extends Datum = Datum> extends Omi
|
|
|
48
55
|
*
|
|
49
56
|
* @example
|
|
50
57
|
* ```tsx
|
|
51
|
-
* <
|
|
58
|
+
* <UnitPileChart
|
|
52
59
|
* mode="mechanical"
|
|
53
60
|
* mechanicalCategories={["North", "South", "West"]}
|
|
54
61
|
* mechanicalCount={90}
|
|
@@ -56,5 +63,11 @@ export interface PhysicsPileChartProps<TDatum extends Datum = Datum> extends Omi
|
|
|
56
63
|
* />
|
|
57
64
|
* ```
|
|
58
65
|
*/
|
|
59
|
-
export declare const
|
|
60
|
-
|
|
66
|
+
export declare const UnitPileChart: React.ForwardRefExoticComponent<UnitPileChartProps<Datum> & React.RefAttributes<PhysicsFrameHandle>>;
|
|
67
|
+
/**
|
|
68
|
+
* @deprecated Renamed to {@link UnitPileChart} in 3.9.0. Unitizes category values into countable bodies; the substrate is an implementation detail, not the reading.
|
|
69
|
+
* The alias stays exported indefinitely for existing imports; new code and
|
|
70
|
+
* every registry (schema, capabilities, MCP, server configs) use `UnitPileChart`.
|
|
71
|
+
*/
|
|
72
|
+
export declare const PhysicsPileChart: React.ForwardRefExoticComponent<UnitPileChartProps<Datum> & React.RefAttributes<PhysicsFrameHandle>>;
|
|
73
|
+
export default UnitPileChart;
|
|
@@ -32,7 +32,7 @@ export type CrucibleSnapshotAt = number | {
|
|
|
32
32
|
progress?: number;
|
|
33
33
|
};
|
|
34
34
|
export type CrucibleColorBy<TDatum extends Datum = Datum> = "category" | "status" | "outlet" | "product" | ChartAccessor<TDatum, string>;
|
|
35
|
-
export interface CrucibleChartProps<TDatum extends Datum = Datum> extends Omit<BaseChartProps, "margin" | "onClick">, PhysicsSharedChartProps {
|
|
35
|
+
export interface CrucibleChartProps<TDatum extends Datum = Datum> extends Omit<BaseChartProps, "margin" | "onClick" | "selection">, PhysicsSharedChartProps {
|
|
36
36
|
/** Controlled, bounded source charge. CrucibleChart has no live push API. */
|
|
37
37
|
data: TDatum[];
|
|
38
38
|
/** Ordered furnace program. Every phase must have a unique id and duration. */
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Datum } from "../shared/datumTypes";
|
|
2
|
+
import type { CrucibleColorBy, CrucibleControls } from "./crucibleChartProps";
|
|
3
|
+
import type { CrucibleComponentState, CrucibleRunState } from "./crucibleTypes";
|
|
4
|
+
export declare function numericCrucibleSeed(seed: number | string | undefined): number;
|
|
5
|
+
export declare function boundedCruciblePlaybackRate(value: unknown): number;
|
|
6
|
+
export declare function resolveCrucibleControls(controls: boolean | CrucibleControls | undefined): Required<CrucibleControls>;
|
|
7
|
+
export declare function crucibleColorKey<TDatum extends Datum>(component: CrucibleComponentState<TDatum>, colorBy: CrucibleColorBy<TDatum>, index: number): string;
|
|
8
|
+
export declare function crucibleColorForKey(key: string): string;
|
|
9
|
+
export declare function crucibleStateSummary<TDatum extends Datum>(state: CrucibleRunState<TDatum>, amountLabel?: string): string;
|
|
@@ -9,7 +9,7 @@ import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
|
9
9
|
import type { PhysicsProcessBodyGroup } from "./physicsProcessPrimitives";
|
|
10
10
|
import type { PhysicsHocFrameProps, PhysicsRerunMS, PhysicsSharedChartProps, TooltipProp } from "./physicsHocUtils";
|
|
11
11
|
import type { GauntletEvent, GauntletGate, GauntletLayout, GauntletProjectPlacement, GauntletProjectState, GauntletPropertyDefinition } from "./gauntletTypes";
|
|
12
|
-
export interface GauntletChartProps<TDatum extends Datum = Datum> extends Omit<BaseChartProps, "margin">, PhysicsSharedChartProps {
|
|
12
|
+
export interface GauntletChartProps<TDatum extends Datum = Datum> extends Omit<BaseChartProps, "margin" | "selection">, PhysicsSharedChartProps {
|
|
13
13
|
data?: TDatum[];
|
|
14
14
|
size?: [number, number];
|
|
15
15
|
idAccessor?: ChartAccessor<TDatum, string>;
|
|
@@ -43,6 +43,11 @@ export interface GauntletChartProps<TDatum extends Datum = Datum> extends Omit<B
|
|
|
43
43
|
positiveProperties: Map<string, GauntletPropertyDefinition>;
|
|
44
44
|
}) => string;
|
|
45
45
|
paused?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Deterministic seed, matching every other physics HOC. An explicit
|
|
48
|
+
* `frameProps.config.kernel.seed` still wins so existing snapshots hold.
|
|
49
|
+
*/
|
|
50
|
+
seed?: number;
|
|
46
51
|
/**
|
|
47
52
|
* Replay the full compound simulation this many milliseconds after it
|
|
48
53
|
* settles. Omit or pass `null` for a single run; `0` replays on the next
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gauntlet terminal state — the end of the authored tape, computed without
|
|
3
|
+
* running the simulation.
|
|
4
|
+
*
|
|
5
|
+
* ## Why this exists
|
|
6
|
+
*
|
|
7
|
+
* Every event-tape physics chart owes the same contract: **its end state must be
|
|
8
|
+
* computable from the authored inputs alone.** If the outcome only exists as the
|
|
9
|
+
* residue of a simulation, then reduced motion, SSR, snapshot export, and
|
|
10
|
+
* `describeChart` cannot state it, and the chart is a movie rather than a
|
|
11
|
+
* reading. `CrucibleChart` satisfies this by compiling `terminalState` /
|
|
12
|
+
* `terminalSpawns`; `ChainReactionChart` satisfies it by deriving task state from
|
|
13
|
+
* the data at `currentTime`. Gauntlet had no such function — this is it.
|
|
14
|
+
*
|
|
15
|
+
* The fold below mirrors the live `runGauntletTick` state path exactly (same
|
|
16
|
+
* `applyGauntletEffect` / `recordGauntletEvent` / viability / final-outcome
|
|
17
|
+
* order), so the pure answer and the simulated answer agree. Terminal means the
|
|
18
|
+
* tape has fully run: every authored event is due, including capacity-gated
|
|
19
|
+
* ones, because at terminal every gate visit has been processed.
|
|
20
|
+
*
|
|
21
|
+
* ## The one thing this cannot predict
|
|
22
|
+
*
|
|
23
|
+
* `GauntletChart` has a **second outcome source that is not in the tape**: with
|
|
24
|
+
* `crashDetection` enabled (the default), a core whose simulated trajectory
|
|
25
|
+
* touches the crash line is killed and its outcome is overridden to
|
|
26
|
+
* `"bad_design_crash"`. That is a genuine physics-derived finding, and no pure
|
|
27
|
+
* function can compute it — it depends on the trajectory.
|
|
28
|
+
*
|
|
29
|
+
* So this resolver returns the **authored-tape terminal state**. It equals the
|
|
30
|
+
* simulated settled state whenever the run does not crash (notably with
|
|
31
|
+
* `crashDetection={false}`, where the tape is the whole story). When crash
|
|
32
|
+
* detection is armed, treat the pure result as "the outcome the plan earns on
|
|
33
|
+
* paper" and the simulated `killed` / `crashX` fields as the physical override.
|
|
34
|
+
* Charts that need a fully authored reading should disable crash detection.
|
|
35
|
+
*/
|
|
36
|
+
import type { Datum } from "../shared/datumTypes";
|
|
37
|
+
import type { GauntletEvent, GauntletLayout, GauntletProjectState, GauntletPropertyDefinition, GauntletViabilityFn } from "./gauntletTypes";
|
|
38
|
+
export interface GauntletTerminalOptions<TDatum extends Datum = Datum> {
|
|
39
|
+
/** Initial project states, as `createInitialState` produces them. */
|
|
40
|
+
projects: readonly GauntletProjectState<TDatum>[];
|
|
41
|
+
/** Authored tape, or the per-project function form. */
|
|
42
|
+
events?: readonly GauntletEvent[] | ((project: GauntletProjectState<TDatum>, layout: GauntletLayout) => readonly GauntletEvent[]);
|
|
43
|
+
layout: GauntletLayout;
|
|
44
|
+
positiveProperties: Map<string, GauntletPropertyDefinition>;
|
|
45
|
+
negativeProperties: Map<string, GauntletPropertyDefinition>;
|
|
46
|
+
viability?: GauntletViabilityFn<TDatum>;
|
|
47
|
+
outcome?: (project: GauntletProjectState<TDatum>, context: {
|
|
48
|
+
layout: GauntletLayout;
|
|
49
|
+
negativeProperties: Map<string, GauntletPropertyDefinition>;
|
|
50
|
+
positiveProperties: Map<string, GauntletPropertyDefinition>;
|
|
51
|
+
}) => string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Fold one project's whole authored tape into its terminal state.
|
|
55
|
+
*
|
|
56
|
+
* Pure: no store, no kernel, no clock. Given the same inputs it returns the
|
|
57
|
+
* same state, which is what makes it usable for SSR and snapshot export.
|
|
58
|
+
*/
|
|
59
|
+
export declare function resolveGauntletTerminalState<TDatum extends Datum = Datum>(project: GauntletProjectState<TDatum>, options: GauntletTerminalOptions<TDatum>): GauntletProjectState<TDatum>;
|
|
60
|
+
/** Terminal state for every project in a run. */
|
|
61
|
+
export declare function resolveGauntletTerminalStates<TDatum extends Datum = Datum>(options: GauntletTerminalOptions<TDatum>): GauntletProjectState<TDatum>[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PhysicsSemanticItem } from "../../stream/physics/StreamPhysicsFrame";
|
|
2
|
+
import type { PhysicalFlowProjectionMetadata } from "./physicsChartUtils";
|
|
3
|
+
export declare function formatPhysicalFlowThroughput(value: number): string;
|
|
4
|
+
export declare function physicalFlowPathD(points: PhysicalFlowProjectionMetadata["links"][number]["path"]): string;
|
|
5
|
+
/** Build keyboard/reader targets from the authored throughput routes. */
|
|
6
|
+
export declare function physicalFlowSemanticItems(metadata: PhysicalFlowProjectionMetadata | undefined): PhysicsSemanticItem[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { FrameGraphicsProp } from "../../stream/useFrame";
|
|
3
|
-
import type { PhysicsSemanticItem, StreamPhysicsFrameProps } from "../../stream/physics/StreamPhysicsFrame";
|
|
3
|
+
import type { PhysicsBodySelection, PhysicsSemanticItem, StreamPhysicsFrameProps } from "../../stream/physics/StreamPhysicsFrame";
|
|
4
4
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
5
|
import type { Datum } from "../shared/datumTypes";
|
|
6
|
-
import type { BaseChartProps, ChartMode } from "../shared/types";
|
|
6
|
+
import type { BaseChartProps, ChartMode, LinkedHoverProp, SelectionConfig } from "../shared/types";
|
|
7
7
|
import { type ChartModeResult } from "../shared/hooks";
|
|
8
8
|
export type PhysicsHocFrameProps<TOmitted extends keyof StreamPhysicsFrameProps = never> = Partial<Omit<StreamPhysicsFrameProps, "initialSpawns" | "initialSpawnPacing" | "size" | TOmitted>>;
|
|
9
9
|
/**
|
|
@@ -18,7 +18,48 @@ export type PhysicsSharedChartProps = {
|
|
|
18
18
|
legendPosition?: StreamPhysicsFrameProps["legendPosition"];
|
|
19
19
|
legendLayout?: StreamPhysicsFrameProps["legendLayout"];
|
|
20
20
|
svgAnnotationRules?: StreamPhysicsFrameProps["svgAnnotationRules"];
|
|
21
|
+
/**
|
|
22
|
+
* Shared selection. Pass a `{ name }` config to join the selection store
|
|
23
|
+
* (cross-highlight inside `LinkedCharts`), or a resolved
|
|
24
|
+
* `{ isActive, predicate }` body predicate directly.
|
|
25
|
+
*/
|
|
26
|
+
selection?: PhysicsChartSelection;
|
|
27
|
+
/** Emit hover into the shared selection store for cross-chart highlighting. */
|
|
28
|
+
linkedHover?: LinkedHoverProp;
|
|
21
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* What a physics HOC's `selection` prop accepts.
|
|
32
|
+
*
|
|
33
|
+
* `SelectionConfig` (`{ name }`) joins the shared selection store, so physics
|
|
34
|
+
* bodies cross-highlight inside `LinkedCharts` like every other family.
|
|
35
|
+
* `PhysicsBodySelection` (`{ isActive, predicate }`) stays available as the
|
|
36
|
+
* direct escape hatch for hosts that resolve a body predicate themselves.
|
|
37
|
+
*/
|
|
38
|
+
export type PhysicsChartSelection = SelectionConfig | PhysicsBodySelection | null;
|
|
39
|
+
export interface PhysicsSelectionOptions {
|
|
40
|
+
selection?: PhysicsChartSelection;
|
|
41
|
+
linkedHover?: LinkedHoverProp;
|
|
42
|
+
colorBy?: unknown;
|
|
43
|
+
chartType: string;
|
|
44
|
+
chartId?: string;
|
|
45
|
+
onObservation?: BaseChartProps["onObservation"];
|
|
46
|
+
onClick?: BaseChartProps["onClick"];
|
|
47
|
+
onBodyHover?: StreamPhysicsFrameProps["onBodyHover"];
|
|
48
|
+
fallbackFields?: string[];
|
|
49
|
+
unwrapSourceDatum?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface PhysicsSelectionResult {
|
|
52
|
+
selection: PhysicsBodySelection | null;
|
|
53
|
+
onBodyHover?: StreamPhysicsFrameProps["onBodyHover"];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Wire a physics HOC into the shared selection store.
|
|
57
|
+
*
|
|
58
|
+
* The store resolves a predicate over *data*, while the frame wants a predicate
|
|
59
|
+
* over *bodies*, so the resolved predicate is lifted through `body.datum`.
|
|
60
|
+
* Bodies with no datum (walls, pegs, chrome) never match a data selection.
|
|
61
|
+
*/
|
|
62
|
+
export declare function usePhysicsSelection(options: PhysicsSelectionOptions): PhysicsSelectionResult;
|
|
22
63
|
/** Galton / pile sampling mode (orthogonal to ChartMode display modes). */
|
|
23
64
|
export type PhysicsSimulationMode = "sample" | "mechanical";
|
|
24
65
|
/** Delay between a settled physics run and a fresh seeded replay. */
|
|
@@ -128,6 +169,8 @@ export declare function resolvePhysicsFrameSharedProps(props: Pick<BaseChartProp
|
|
|
128
169
|
legendLayout?: StreamPhysicsFrameProps["legendLayout"];
|
|
129
170
|
svgAnnotationRules?: StreamPhysicsFrameProps["svgAnnotationRules"];
|
|
130
171
|
}, frameProps: Partial<StreamPhysicsFrameProps> | undefined, semanticItems?: PhysicsSemanticItem[], modeExtras?: {
|
|
172
|
+
/** Resolved body predicate from {@link usePhysicsSelection}. */
|
|
173
|
+
selection?: PhysicsBodySelection | null;
|
|
131
174
|
chartMode?: ChartMode;
|
|
132
175
|
className?: string;
|
|
133
176
|
title?: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Datum } from "./datumTypes";
|
|
2
|
+
/**
|
|
3
|
+
* Statically detect the serializable HatchFill form styleRules can carry.
|
|
4
|
+
* Function-valued rule styles may also return hatches at runtime, but the
|
|
5
|
+
* config-only audit cannot inspect those honestly.
|
|
6
|
+
*/
|
|
7
|
+
export declare function hasDeclaredHatchFill(props: Datum): boolean;
|
|
8
|
+
/** True only when every declared hex color belongs to the safe palette. */
|
|
9
|
+
export declare function usesCvdSafePalette(colorScheme: unknown): boolean;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Single source of truth for per-chart prop specifications
|
|
3
|
-
*
|
|
4
|
-
* Three downstream consumers used to maintain their own per-chart entries:
|
|
2
|
+
* Single source of truth for per-chart prop specifications consumed by:
|
|
5
3
|
* - `ai/schema.json` (LLM tool definitions)
|
|
6
4
|
* - `src/components/charts/shared/validationMap.ts` (runtime prop validation)
|
|
7
5
|
* - `ai/componentMetadata.cjs` (category buckets)
|
|
8
6
|
*
|
|
9
|
-
*
|
|
7
|
+
* `validationMap.generated.ts` and `ai/schema.json` are generated from
|
|
10
8
|
* this registry — run `npm run docs:chart-specs:schema` to refresh both after
|
|
11
9
|
* editing a spec. `componentMetadata.cjs` is still
|
|
12
10
|
* hand-edited but gated for parity by the registry: `check:chart-specs` (run
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import type { Datum } from "./datumTypes";
|
|
2
|
+
import type { ColorGradientInput, GradientConfig, GradientStop } from "./gradient";
|
|
2
3
|
export interface GaugeThresholdLike {
|
|
3
4
|
value: number;
|
|
4
5
|
color: string;
|
|
5
6
|
label?: string;
|
|
6
7
|
}
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
color: string;
|
|
10
|
-
}
|
|
11
|
-
export interface GaugeGradientFill {
|
|
12
|
-
colorStops: GaugeGradientStop[];
|
|
13
|
-
}
|
|
8
|
+
export type GaugeGradientStop = GradientStop;
|
|
9
|
+
export type GaugeGradientFill = ColorGradientInput;
|
|
14
10
|
export interface GaugeArcDatum extends Datum {
|
|
15
11
|
category: string;
|
|
16
12
|
value: number;
|
|
@@ -48,7 +44,7 @@ interface BuildGaugeArcModelOptions {
|
|
|
48
44
|
backgroundColor: string;
|
|
49
45
|
fillZones: boolean;
|
|
50
46
|
showScaleLabels: boolean;
|
|
51
|
-
gradientFill?:
|
|
47
|
+
gradientFill?: GradientConfig;
|
|
52
48
|
gradientSteps?: number;
|
|
53
49
|
}
|
|
54
50
|
/**
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface GradientStop {
|
|
2
|
+
/** Position along the gradient, clamped to 0–1. */
|
|
3
|
+
offset: number;
|
|
4
|
+
/** Stop color. Omit to inherit the mark's resolved color. */
|
|
5
|
+
color?: string;
|
|
6
|
+
/** Stop opacity, clamped to 0–1. */
|
|
7
|
+
opacity?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface GradientConfig {
|
|
10
|
+
stops: GradientStop[];
|
|
11
|
+
}
|
|
12
|
+
interface ColorStopsConfig {
|
|
13
|
+
colorStops: Array<{
|
|
14
|
+
offset: number;
|
|
15
|
+
color: string;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
interface OpacityEndpointsConfig {
|
|
19
|
+
topOpacity?: number;
|
|
20
|
+
bottomOpacity?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface SemanticGradientStopInput {
|
|
23
|
+
at: number;
|
|
24
|
+
color: string;
|
|
25
|
+
opacity?: number;
|
|
26
|
+
}
|
|
27
|
+
export type GradientInput = GradientConfig | boolean | ColorStopsConfig | OpacityEndpointsConfig;
|
|
28
|
+
export type ColorGradientInput = GradientConfig | ColorStopsConfig;
|
|
29
|
+
export type SemanticGradientInput = GradientConfig | SemanticGradientStopInput[];
|
|
30
|
+
export declare const DEFAULT_GRADIENT: GradientConfig;
|
|
31
|
+
export declare function normalizeGradient(input: GradientInput | null | undefined, defaultGradient?: GradientConfig): GradientConfig | undefined;
|
|
32
|
+
export declare function normalizeColorGradient(input: ColorGradientInput | null | undefined): GradientConfig | undefined;
|
|
33
|
+
export declare function normalizeSemanticGradient(input: SemanticGradientInput | null | undefined): GradientConfig | undefined;
|
|
34
|
+
export declare function reverseGradient(gradient: GradientConfig): GradientConfig;
|
|
35
|
+
export {};
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Declarative hatch-fill descriptor
|
|
3
|
-
*
|
|
2
|
+
* Declarative hatch-fill descriptor that renders as a diagonal-line pattern
|
|
3
|
+
* on both rendering backends.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* `createHatchPattern` (→ `CanvasPattern`) and an SVG `<pattern>` builder
|
|
7
|
-
* (`hatchFill` recipe / `createSVGHatchPattern`). A caller had to know
|
|
8
|
-
* which medium they were painting into and hand-produce the right thing —
|
|
9
|
-
* which is why a `CanvasPattern` returned from a `pieceStyle` silently
|
|
10
|
-
* collapses to a solid color in SSR (`svgFill` drops non-string fills).
|
|
11
|
-
*
|
|
12
|
-
* `HatchFill` closes that gap: it is a plain, serializable descriptor that
|
|
5
|
+
* `HatchFill` is a plain, serializable descriptor that
|
|
13
6
|
* can be set directly as `style.fill`. The canvas renderer resolves it to a
|
|
14
7
|
* `CanvasPattern` (`resolveHatchCanvasPattern`); the SVG serializer resolves
|
|
15
8
|
* it to a `<pattern>` def + `url(#id)` (`hatchPatternDef` / `hatchFillId`).
|
|
@@ -2,9 +2,7 @@ export { DEFAULT_COLOR } from "./colorUtils";
|
|
|
2
2
|
import type { SelectionHookResult } from "./selectionUtils";
|
|
3
3
|
import type { OnObservationCallback } from "../../store/ObservationStore";
|
|
4
4
|
import type { Accessor, SelectionConfig, LinkedHoverProp, ChartMode, HoverHighlightMode, ResolvedMobileInteractionConfig } from "./types";
|
|
5
|
-
import type { MarginType, PartialMargin } from "../../types/marginType";
|
|
6
5
|
import type { TransitionConfig } from "../../stream/types";
|
|
7
|
-
import type { LegendValue } from "../../types/legendTypes";
|
|
8
6
|
import type { Datum } from "./datumTypes";
|
|
9
7
|
import type { ChartModeInput, ChartModeResult } from "./chartMode";
|
|
10
8
|
export { DISABLED_MOBILE_INTERACTION, MOBILE_INTERACTION_DEFAULTS, MOBILE_INTERACTION_MIN_HIT_RADIUS, MOBILE_INTERACTION_TARGET_SIZE, isChartMode, resolveChartMode, resolveMobileInteraction, } from "./chartMode";
|
|
@@ -96,54 +94,8 @@ export declare function getCrosshairProps(linkedHover: unknown, crosshairSourceI
|
|
|
96
94
|
linkedCrosshairName: string;
|
|
97
95
|
linkedCrosshairSourceId: string;
|
|
98
96
|
} | undefined;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
* Consolidates the shouldShowLegend / createLegend / margin merge / right-margin
|
|
102
|
-
* expansion pattern that every chart with color encoding repeats.
|
|
103
|
-
*/
|
|
104
|
-
export type LegendPosition = "right" | "left" | "top" | "bottom";
|
|
105
|
-
export declare function useChartLegendAndMargin({ data, colorBy, colorScale, showLegend, legendPosition, userMargin, defaults, categories, additionalLegend, }: {
|
|
106
|
-
data: Array<Datum>;
|
|
107
|
-
colorBy: Accessor<string> | undefined;
|
|
108
|
-
colorScale: ((v: string) => string) | undefined;
|
|
109
|
-
showLegend: boolean | undefined;
|
|
110
|
-
legendPosition?: LegendPosition;
|
|
111
|
-
userMargin: PartialMargin | undefined;
|
|
112
|
-
defaults?: MarginType;
|
|
113
|
-
categories?: string[];
|
|
114
|
-
/** Caller legend composed after the chart's inferred categorical groups. */
|
|
115
|
-
additionalLegend?: LegendValue;
|
|
116
|
-
}): {
|
|
117
|
-
legend: LegendValue | undefined;
|
|
118
|
-
margin: MarginType;
|
|
119
|
-
legendPosition: LegendPosition;
|
|
120
|
-
};
|
|
121
|
-
export type LegendInteractionMode = "highlight" | "isolate" | "none";
|
|
122
|
-
export interface LegendInteractionState {
|
|
123
|
-
highlightedCategory: string | null;
|
|
124
|
-
isolatedCategories: Set<string>;
|
|
125
|
-
onLegendHover: (item: {
|
|
126
|
-
label: string;
|
|
127
|
-
} | null) => void;
|
|
128
|
-
onLegendClick: (item: {
|
|
129
|
-
label: string;
|
|
130
|
-
}) => void;
|
|
131
|
-
/** Selection predicate that dims non-matching data — use with wrapStyleWithSelection */
|
|
132
|
-
legendSelectionHook: {
|
|
133
|
-
isActive: boolean;
|
|
134
|
-
predicate: (d: Datum) => boolean;
|
|
135
|
-
} | null;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Hook managing legend highlight/isolate interaction.
|
|
139
|
-
* - "highlight": hover over a legend item produces a selection hook that
|
|
140
|
-
* `wrapStyleWithSelection` uses to dim non-matching data. The actual
|
|
141
|
-
* dim opacity resolves in this order: per-chart
|
|
142
|
-
* `selection.unselectedOpacity` → `theme.colors.selectionOpacity` →
|
|
143
|
-
* `DEFAULT_SELECTION_OPACITY` fallback.
|
|
144
|
-
* - "isolate": click toggles category visibility; click all to reset
|
|
145
|
-
*/
|
|
146
|
-
export declare function useLegendInteraction(mode: LegendInteractionMode | undefined, colorBy: string | ((d: Datum) => string) | undefined, allCategories: string[]): LegendInteractionState;
|
|
97
|
+
export { useChartLegendAndMargin, useLegendInteraction, } from "./useChartLegend";
|
|
98
|
+
export type { LegendPosition, LegendInteractionMode, LegendInteractionState, } from "./useChartLegend";
|
|
147
99
|
/**
|
|
148
100
|
* React-facing alias for {@link resolveChartMode}. Mode resolution is kept
|
|
149
101
|
* pure so non-React renderers (notably semiotic/server) consume the exact same
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* This compact registry is intentionally separate from validation metadata:
|
|
6
6
|
* config serialization only needs chart-name membership.
|
|
7
7
|
*/
|
|
8
|
-
export declare const KNOWN_CHART_COMPONENTS: readonly ["BarChart", "StackedBarChart", "GroupedBarChart", "SwarmPlot", "BoxPlot", "Histogram", "ViolinPlot", "RidgelinePlot", "DotPlot", "PieChart", "DonutChart", "GaugeChart", "FunnelChart", "SwimlaneChart", "LikertChart", "LineChart", "AreaChart", "DifferenceChart", "StackedAreaChart", "Scatterplot", "BubbleChart", "Heatmap", "QuadrantChart", "MultiAxisLineChart", "CandlestickChart", "ConnectedScatterplot", "ScatterplotMatrix", "MinimapChart", "ForceDirectedGraph", "SankeyDiagram", "ProcessSankey", "ChordDiagram", "TreeDiagram", "Treemap", "CirclePack", "OrbitDiagram", "ChoroplethMap", "ProportionalSymbolMap", "FlowMap", "DistanceCartogram", "RealtimeLineChart", "RealtimeHistogram", "TemporalHistogram", "RealtimeSwarmChart", "RealtimeWaterfallChart", "RealtimeHeatmap", "GaltonBoardChart", "EventDropChart", "
|
|
8
|
+
export declare const KNOWN_CHART_COMPONENTS: readonly ["BarChart", "StackedBarChart", "GroupedBarChart", "SwarmPlot", "BoxPlot", "Histogram", "ViolinPlot", "RidgelinePlot", "DotPlot", "PieChart", "DonutChart", "GaugeChart", "FunnelChart", "SwimlaneChart", "LikertChart", "LineChart", "BumpChart", "AreaChart", "DifferenceChart", "StackedAreaChart", "Scatterplot", "BubbleChart", "Heatmap", "QuadrantChart", "MultiAxisLineChart", "CandlestickChart", "ConnectedScatterplot", "ScatterplotMatrix", "MinimapChart", "ForceDirectedGraph", "SankeyDiagram", "ProcessSankey", "ChordDiagram", "TreeDiagram", "Treemap", "CirclePack", "OrbitDiagram", "ChoroplethMap", "ProportionalSymbolMap", "FlowMap", "DistanceCartogram", "RealtimeLineChart", "RealtimeHistogram", "TemporalHistogram", "RealtimeSwarmChart", "RealtimeWaterfallChart", "RealtimeHeatmap", "GaltonBoardChart", "EventDropChart", "UnitPileChart", "CollisionSwarmChart", "GauntletChart", "CrucibleChart", "ProcessFlowChart", "PacketFlowChart", "ChainReactionChart", "BigNumber"];
|
|
9
9
|
export declare function isKnownChartComponent(componentName: string): boolean;
|
|
@@ -18,8 +18,7 @@ import type { AutoPlaceAnnotations } from "../../recipes/annotationLayout";
|
|
|
18
18
|
* and the user's tooltip body reads only fields it knows about.
|
|
19
19
|
*
|
|
20
20
|
* Typing the helper's return at the wider `HoverData` shape lets either
|
|
21
|
-
* source flow through without a cast at the call site
|
|
22
|
-
* inline form HOCs used before this refactor.
|
|
21
|
+
* source flow through without a cast at the call site.
|
|
23
22
|
*/
|
|
24
23
|
type FrameTooltipContent = (d: HoverData) => ReactNode;
|
|
25
24
|
/**
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Accessor } from "./types";
|
|
2
|
+
import type { MarginType, PartialMargin } from "../../types/marginType";
|
|
3
|
+
import type { LegendLayout, LegendValue } from "../../types/legendTypes";
|
|
4
|
+
import { type AxisChromeInput } from "../../legendLayout";
|
|
5
|
+
import type { Datum } from "./datumTypes";
|
|
6
|
+
/**
|
|
7
|
+
* Hook to create a legend and compute margins with legend-aware adjustment.
|
|
8
|
+
* Consolidates the shouldShowLegend / createLegend / margin merge / right-margin
|
|
9
|
+
* expansion pattern that every chart with color encoding repeats.
|
|
10
|
+
*/
|
|
11
|
+
export type LegendPosition = "right" | "left" | "top" | "bottom";
|
|
12
|
+
export declare function useChartLegendAndMargin({ data, colorBy, colorScale, showLegend, legendPosition, userMargin, defaults, categories, additionalLegend, chartWidth, legendLayout, hasTitle, axisChrome, }: {
|
|
13
|
+
data: Array<Datum>;
|
|
14
|
+
colorBy: Accessor<string> | undefined;
|
|
15
|
+
colorScale: ((v: string) => string) | undefined;
|
|
16
|
+
showLegend: boolean | undefined;
|
|
17
|
+
legendPosition?: LegendPosition;
|
|
18
|
+
userMargin: PartialMargin | undefined;
|
|
19
|
+
defaults?: MarginType;
|
|
20
|
+
categories?: string[];
|
|
21
|
+
/** Caller legend composed after the chart's inferred categorical groups. */
|
|
22
|
+
additionalLegend?: LegendValue;
|
|
23
|
+
/** Total chart width, used to estimate wrapping for top/bottom legends. */
|
|
24
|
+
chartWidth?: number;
|
|
25
|
+
/** Legend metrics shared with the renderer. */
|
|
26
|
+
legendLayout?: LegendLayout;
|
|
27
|
+
/** Reserve the chart-title band above a top legend. */
|
|
28
|
+
hasTitle?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Axis chrome on the legend's side. A top/bottom legend is placed outside
|
|
31
|
+
* this band, so the reserved margin has to include it or the legend lands
|
|
32
|
+
* past the canvas edge.
|
|
33
|
+
*/
|
|
34
|
+
axisChrome?: AxisChromeInput;
|
|
35
|
+
}): {
|
|
36
|
+
legend: LegendValue | undefined;
|
|
37
|
+
margin: MarginType;
|
|
38
|
+
legendPosition: LegendPosition;
|
|
39
|
+
};
|
|
40
|
+
export type LegendInteractionMode = "highlight" | "isolate" | "none";
|
|
41
|
+
export interface LegendInteractionState {
|
|
42
|
+
highlightedCategory: string | null;
|
|
43
|
+
isolatedCategories: Set<string>;
|
|
44
|
+
onLegendHover: (item: {
|
|
45
|
+
label: string;
|
|
46
|
+
} | null) => void;
|
|
47
|
+
onLegendClick: (item: {
|
|
48
|
+
label: string;
|
|
49
|
+
}) => void;
|
|
50
|
+
/** Selection predicate that dims non-matching data — use with wrapStyleWithSelection */
|
|
51
|
+
legendSelectionHook: {
|
|
52
|
+
isActive: boolean;
|
|
53
|
+
predicate: (d: Datum) => boolean;
|
|
54
|
+
} | null;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Hook managing legend highlight/isolate interaction.
|
|
58
|
+
* - "highlight": hover over a legend item produces a selection hook that
|
|
59
|
+
* `wrapStyleWithSelection` uses to dim non-matching data. The actual
|
|
60
|
+
* dim opacity resolves in this order: per-chart
|
|
61
|
+
* `selection.unselectedOpacity` → `theme.colors.selectionOpacity` →
|
|
62
|
+
* `DEFAULT_SELECTION_OPACITY` fallback.
|
|
63
|
+
* - "isolate": click toggles category visibility; click all to reset
|
|
64
|
+
*/
|
|
65
|
+
export declare function useLegendInteraction(mode: LegendInteractionMode | undefined, colorBy: string | ((d: Datum) => string) | undefined, allCategories: string[]): LegendInteractionState;
|