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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Datum } from "./datumTypes";
|
|
2
|
+
import type { AxisChromeInput } from "../../legendLayout";
|
|
2
3
|
import { useChartLegendAndMargin, useLegendInteraction, DEFAULT_COLOR } from "./hooks";
|
|
3
4
|
import type { LegendInteractionMode, LegendPosition } from "./hooks";
|
|
4
5
|
import type { Accessor, SelectionConfig, LinkedHoverProp, HoverHighlightMode, MobileInteractionProp, ResolvedMobileInteractionConfig } from "./types";
|
|
@@ -8,6 +9,7 @@ import type { PartialMargin } from "../../types/marginType";
|
|
|
8
9
|
import type { SelectionHookResult } from "./selectionUtils";
|
|
9
10
|
import type { ReactElement, ReactNode } from "react";
|
|
10
11
|
import type { LegendValue } from "../../types/legendTypes";
|
|
12
|
+
import type { LegendLayout } from "../../types/legendTypes";
|
|
11
13
|
/**
|
|
12
14
|
* Input parameters for useChartSetup.
|
|
13
15
|
*
|
|
@@ -46,6 +48,8 @@ export interface ChartSetupInput {
|
|
|
46
48
|
showLegend: boolean | undefined;
|
|
47
49
|
/** Caller legend appended to inferred categorical legend groups. */
|
|
48
50
|
legend?: LegendValue;
|
|
51
|
+
/** Shared legend metrics, including any side-axis gutter. */
|
|
52
|
+
legendLayout?: LegendLayout;
|
|
49
53
|
/** User-provided margin */
|
|
50
54
|
userMargin: PartialMargin | undefined;
|
|
51
55
|
/** Mode-resolved margin defaults */
|
|
@@ -76,6 +80,14 @@ export interface ChartSetupInput {
|
|
|
76
80
|
width: number;
|
|
77
81
|
/** Resolved height from useChartMode */
|
|
78
82
|
height: number;
|
|
83
|
+
/** Whether the resolved chart mode includes a title. */
|
|
84
|
+
hasTitle?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Bottom-axis chrome, so a bottom legend reserves space outside the tick
|
|
87
|
+
* labels rather than only being drawn past them. Omit for charts with no
|
|
88
|
+
* horizontal axis (pie/donut/radial) — the gutter resolves to 0.
|
|
89
|
+
*/
|
|
90
|
+
axisChrome?: AxisChromeInput;
|
|
79
91
|
}
|
|
80
92
|
/**
|
|
81
93
|
* Output from useChartSetup.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Ref, RefObject, ReactElement, ReactNode } from "react";
|
|
2
2
|
import { useChartMode } from "./hooks";
|
|
3
3
|
import { type ChartSetupResult } from "./useChartSetup";
|
|
4
|
-
import type { Accessor, ChartMode, SelectionConfig, LinkedHoverProp, MobileInteractionProp } from "./types";
|
|
4
|
+
import type { Accessor, ChartMode, SelectionConfig, LinkedHoverProp, MobileInteractionProp, HoverHighlightMode } from "./types";
|
|
5
5
|
import type { MobileVisualizationContract } from "./auditMobileVisualization";
|
|
6
6
|
import type { ResponsiveRule } from "./responsiveRules";
|
|
7
7
|
import type { OnObservationCallback } from "../../store/ObservationStore";
|
|
@@ -9,6 +9,7 @@ import { type PartialMargin, type MarginType } from "../../types/marginType";
|
|
|
9
9
|
import type { Datum } from "./datumTypes";
|
|
10
10
|
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
11
11
|
import type { LegendValue } from "../../types/legendTypes";
|
|
12
|
+
import type { LegendInteractionMode, LegendPosition } from "./useChartLegend";
|
|
12
13
|
/**
|
|
13
14
|
* Margin shorthand → sided form. The Stream*Frame margin props only
|
|
14
15
|
* accept the sided object form, so HOCs that expose the user-friendly
|
|
@@ -67,9 +68,13 @@ interface DataSetupOptions extends ScaffoldOptions {
|
|
|
67
68
|
colorBy?: Accessor<string>;
|
|
68
69
|
/** Caller legend appended to the inferred colorBy legend. */
|
|
69
70
|
legend?: LegendValue;
|
|
71
|
+
legendInteraction?: LegendInteractionMode;
|
|
72
|
+
legendPosition?: LegendPosition;
|
|
70
73
|
/** Pass-through chart-setup inputs. */
|
|
71
74
|
selection?: SelectionConfig;
|
|
72
75
|
linkedHover?: LinkedHoverProp;
|
|
76
|
+
/** Dim sibling categories while hovering a custom-layout mark. */
|
|
77
|
+
hoverHighlight?: HoverHighlightMode;
|
|
73
78
|
onObservation?: OnObservationCallback;
|
|
74
79
|
onClick?: (datum: Datum, ev: {
|
|
75
80
|
x: number;
|
|
@@ -47,6 +47,7 @@ export interface NetworkChartSetupInput<TNode extends Datum = Datum, TEdge exten
|
|
|
47
47
|
userMargin?: PartialMargin;
|
|
48
48
|
width: number;
|
|
49
49
|
height: number;
|
|
50
|
+
hasTitle?: boolean;
|
|
50
51
|
loading?: boolean;
|
|
51
52
|
/** Custom content rendered in place of the default skeleton while `loading` is true. */
|
|
52
53
|
loadingContent?: ReactNode | false;
|
|
@@ -49,7 +49,7 @@ export declare function useStreamingLegend({ isPushMode, colorBy, colorScheme, s
|
|
|
49
49
|
};
|
|
50
50
|
streamingLegend: {
|
|
51
51
|
legendGroups: {
|
|
52
|
-
styleFn: (d: import("../../
|
|
52
|
+
styleFn: (d: import("../../semiotic-geo").LegendItem) => Record<string, string | number>;
|
|
53
53
|
type: "fill";
|
|
54
54
|
items: {
|
|
55
55
|
label: string;
|
|
@@ -7,23 +7,8 @@ import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types"
|
|
|
7
7
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
8
8
|
import { type StyleRule } from "../shared/styleRules";
|
|
9
9
|
import type { ForecastConfig, AnomalyConfig } from "../shared/statisticalOverlays";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
at: number;
|
|
13
|
-
color: string;
|
|
14
|
-
/** Optional opacity applied to this stop. */
|
|
15
|
-
opacity?: number;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Convert value-anchored `semanticGradient` stops (`{ at, color }` on the value
|
|
19
|
-
* scale, 0–100) into the frame's `gradientFill.colorStops` (offset 0 = top).
|
|
20
|
-
* Exported so the server (`renderChart`) config resolves it identically to this
|
|
21
|
-
* HOC — otherwise SSR silently drops `semanticGradient` and paints a flat area.
|
|
22
|
-
*/
|
|
23
|
-
export declare function semanticGradientToColorStops(stops: SemanticGradientStop[]): Array<{
|
|
24
|
-
offset: number;
|
|
25
|
-
color: string;
|
|
26
|
-
}>;
|
|
10
|
+
import { type ColorGradientInput, type GradientInput, type SemanticGradientInput, type SemanticGradientStopInput } from "../shared/gradient";
|
|
11
|
+
export type SemanticGradientStop = SemanticGradientStopInput;
|
|
27
12
|
/**
|
|
28
13
|
* AreaChart component props
|
|
29
14
|
*/
|
|
@@ -101,28 +86,28 @@ export interface AreaChartProps<TDatum extends Datum = Datum> extends BaseChartP
|
|
|
101
86
|
*/
|
|
102
87
|
y0Accessor?: ChartAccessor<TDatum, number>;
|
|
103
88
|
/**
|
|
104
|
-
* Gradient fill from line to baseline.
|
|
105
|
-
*
|
|
106
|
-
*
|
|
89
|
+
* Gradient fill from the line to the baseline. Offset 0 is the line/top and
|
|
90
|
+
* offset 1 is the baseline. Omit a stop color to inherit the area color.
|
|
91
|
+
* @example
|
|
92
|
+
* `{ stops: [{ offset: 0, opacity: 0.8 }, { offset: 1, opacity: 0.05 }] }`
|
|
107
93
|
* @default false
|
|
108
94
|
*/
|
|
109
|
-
gradientFill?:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
colorStops: Array<{
|
|
114
|
-
offset: number;
|
|
115
|
-
color: string;
|
|
116
|
-
}>;
|
|
117
|
-
};
|
|
118
|
-
/**
|
|
119
|
-
* Semantic area gradient stops expressed in user-facing percentages:
|
|
120
|
-
* `at: 0` is the baseline and `at: 100` is the line/top of the area.
|
|
121
|
-
* This is converted to `gradientFill.colorStops`, whose raw offsets use
|
|
122
|
-
* the renderer coordinate convention (`0` = top, `1` = baseline).
|
|
95
|
+
gradientFill?: GradientInput;
|
|
96
|
+
/**
|
|
97
|
+
* Value-anchored area gradient. Offset 0 is the resolved y-domain minimum
|
|
98
|
+
* and offset 1 is the resolved y-domain maximum.
|
|
123
99
|
* When set, this takes precedence over `gradientFill`.
|
|
100
|
+
* @example
|
|
101
|
+
* `{ stops: [{ offset: 0, color: "#4e79a7" }, { offset: 1, color: "#d62728" }] }`
|
|
102
|
+
*/
|
|
103
|
+
semanticGradient?: SemanticGradientInput;
|
|
104
|
+
/**
|
|
105
|
+
* Color the area's top-edge line with hard value bands derived from
|
|
106
|
+
* `semanticGradient`. Stop opacity is intentionally ignored for the line.
|
|
107
|
+
* Set to `false` to retain the normal solid stroke (or `lineGradient`).
|
|
108
|
+
* @default true when semanticGradient is set
|
|
124
109
|
*/
|
|
125
|
-
|
|
110
|
+
semanticLine?: boolean;
|
|
126
111
|
/**
|
|
127
112
|
* Area opacity (flat fill, ignored when gradientFill is set)
|
|
128
113
|
* @default 0.7
|
|
@@ -131,12 +116,7 @@ export interface AreaChartProps<TDatum extends Datum = Datum> extends BaseChartP
|
|
|
131
116
|
/**
|
|
132
117
|
* Horizontal gradient for the line stroke. Color stops define a left-to-right gradient.
|
|
133
118
|
*/
|
|
134
|
-
lineGradient?:
|
|
135
|
-
colorStops: Array<{
|
|
136
|
-
offset: number;
|
|
137
|
-
color: string;
|
|
138
|
-
}>;
|
|
139
|
-
};
|
|
119
|
+
lineGradient?: ColorGradientInput;
|
|
140
120
|
/**
|
|
141
121
|
* Show line on top of area
|
|
142
122
|
* @default true
|
|
@@ -280,7 +260,10 @@ export interface AreaChartProps<TDatum extends Datum = Datum> extends BaseChartP
|
|
|
280
260
|
* xAccessor="t"
|
|
281
261
|
* yAccessor="value"
|
|
282
262
|
* color="steelblue"
|
|
283
|
-
* gradientFill={{
|
|
263
|
+
* gradientFill={{ stops: [
|
|
264
|
+
* { offset: 0, opacity: 0.8 },
|
|
265
|
+
* { offset: 1, opacity: 0.05 },
|
|
266
|
+
* ] }}
|
|
284
267
|
* />
|
|
285
268
|
* ```
|
|
286
269
|
*
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ChartCapability } from "../../ai/chartCapabilityTypes";
|
|
2
|
+
/**
|
|
3
|
+
* BumpChart capability — the ranking-over-x chart. Its canonical job is the
|
|
4
|
+
* `rank` intent: several series ranked against each other at each x-column,
|
|
5
|
+
* with rank as vertical position and the crossings telling the "who overtook
|
|
6
|
+
* whom" story. The `ribbon` variant additionally encodes magnitude.
|
|
7
|
+
*
|
|
8
|
+
* Read alongside `BumpChart.tsx`; this is what makes the chart discoverable
|
|
9
|
+
* through `suggestCharts` and self-describing through `describeChart` (L4).
|
|
10
|
+
*/
|
|
11
|
+
export declare const BumpChartCapability: ChartCapability;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
3
|
+
import type { StreamXYFrameProps, Style } from "../../stream/types";
|
|
4
|
+
import type { LayoutContext, LayoutResult } from "../../stream/customLayout";
|
|
5
|
+
import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types";
|
|
6
|
+
import type { Datum } from "../shared/datumTypes";
|
|
7
|
+
import type { TooltipProp } from "../../Tooltip/Tooltip";
|
|
8
|
+
import { type StyleRule } from "../shared/styleRules";
|
|
9
|
+
import type { LegendValue } from "../../types/legendTypes";
|
|
10
|
+
import type { LegendInteractionMode, LegendPosition } from "../shared/useChartLegend";
|
|
11
|
+
export interface RankedBumpDatum<TDatum extends Datum = Datum> extends Datum {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
__bumpRaw: TDatum;
|
|
15
|
+
__bumpSeries: string;
|
|
16
|
+
__bumpColorGroup: string;
|
|
17
|
+
__bumpValue: number;
|
|
18
|
+
__bumpRank: number;
|
|
19
|
+
__bumpXValue: unknown;
|
|
20
|
+
__bumpHighlighted: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface RankedBumpData<TDatum extends Datum = Datum> {
|
|
23
|
+
data: RankedBumpDatum<TDatum>[];
|
|
24
|
+
xValues: unknown[];
|
|
25
|
+
seriesOrder: string[];
|
|
26
|
+
overallOrder: string[];
|
|
27
|
+
valueExtent: [number, number];
|
|
28
|
+
}
|
|
29
|
+
export interface RankBumpDataOptions<TDatum extends Datum = Datum> {
|
|
30
|
+
xAccessor?: ChartAccessor<TDatum, number | Date | string>;
|
|
31
|
+
yAccessor?: ChartAccessor<TDatum, number>;
|
|
32
|
+
lineBy?: ChartAccessor<TDatum, string>;
|
|
33
|
+
rankDirection?: "descending" | "ascending";
|
|
34
|
+
highlightTop?: number;
|
|
35
|
+
}
|
|
36
|
+
export declare function mapBumpAnnotations(annotations: Datum[] | undefined, xValues: unknown[]): Datum[] | undefined;
|
|
37
|
+
export declare function resolveBumpColorScheme(options: {
|
|
38
|
+
seriesOrder: string[];
|
|
39
|
+
overallOrder: string[];
|
|
40
|
+
highlightTop?: number;
|
|
41
|
+
color?: string;
|
|
42
|
+
colorScheme?: string | string[] | Record<string, string>;
|
|
43
|
+
neutralColor?: string;
|
|
44
|
+
themeCategorical?: string[];
|
|
45
|
+
themeNeutral?: string;
|
|
46
|
+
}): string | string[] | Record<string, string> | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Rank every x-column and return the flattened, frame-ready rows used by
|
|
49
|
+
* BumpChart. Ranking is ordinal and deterministic: equal values retain series
|
|
50
|
+
* first-appearance order.
|
|
51
|
+
*/
|
|
52
|
+
export declare function rankBumpData<TDatum extends Datum = Datum>(input: TDatum[], options?: RankBumpDataOptions<TDatum>): RankedBumpData<TDatum>;
|
|
53
|
+
export interface BumpLayoutConfig {
|
|
54
|
+
ribbon: boolean;
|
|
55
|
+
curve: "smooth" | "linear";
|
|
56
|
+
samplesPerSegment: number;
|
|
57
|
+
ribbonSizeRange: [number, number];
|
|
58
|
+
valueExtent: [number, number];
|
|
59
|
+
seriesOrder: string[];
|
|
60
|
+
lineWidth: number;
|
|
61
|
+
ribbonOpacity: number;
|
|
62
|
+
lineOpacity: number;
|
|
63
|
+
neutralColor?: string;
|
|
64
|
+
color?: string;
|
|
65
|
+
stroke?: string;
|
|
66
|
+
strokeWidth?: number;
|
|
67
|
+
opacity?: number;
|
|
68
|
+
styleRules?: ReadonlyArray<StyleRule>;
|
|
69
|
+
areaStyle?: (datum: Datum) => Style;
|
|
70
|
+
pointStyle?: (datum: Datum) => Style & {
|
|
71
|
+
r?: number;
|
|
72
|
+
};
|
|
73
|
+
labelStyle?: React.CSSProperties | ((datum: Datum) => React.CSSProperties);
|
|
74
|
+
showPoints: boolean;
|
|
75
|
+
pointRadius: number;
|
|
76
|
+
showLabels: boolean | "start" | "end" | "both";
|
|
77
|
+
}
|
|
78
|
+
export declare function bumpLayout(ctx: LayoutContext<BumpLayoutConfig>): LayoutResult;
|
|
79
|
+
export interface BumpChartProps<TDatum extends Datum = Datum> extends BaseChartProps, AxisConfig {
|
|
80
|
+
/** Flat observations. Each x-column is ranked from `yAccessor`. */
|
|
81
|
+
data: TDatum[];
|
|
82
|
+
/** Ranking column accessor. First-seen order determines the x-axis order. Default `"x"`. */
|
|
83
|
+
xAccessor?: ChartAccessor<TDatum, number | Date | string>;
|
|
84
|
+
/** Numeric magnitude to rank and, in ribbon mode, encode as width. Default `"y"`. */
|
|
85
|
+
yAccessor?: ChartAccessor<TDatum, number>;
|
|
86
|
+
/** Series identity accessor. Default `"series"`. */
|
|
87
|
+
lineBy?: ChartAccessor<TDatum, string>;
|
|
88
|
+
/** Highest values rank first by default; use `"ascending"` for metrics where lower is better. */
|
|
89
|
+
rankDirection?: "descending" | "ascending";
|
|
90
|
+
/** Draw magnitude-encoded, perpendicular-offset areas instead of fixed-width lines. */
|
|
91
|
+
ribbon?: boolean;
|
|
92
|
+
/** Centerline shape. Smooth uses horizontal-tangent cubic segments. Default `"smooth"`. */
|
|
93
|
+
curve?: "smooth" | "linear";
|
|
94
|
+
/** Full ribbon width range in pixels. Default `[4, 28]`. */
|
|
95
|
+
ribbonSizeRange?: [number, number];
|
|
96
|
+
/** Number of centerline samples per ranking interval. Default `12`. */
|
|
97
|
+
samplesPerSegment?: number;
|
|
98
|
+
/** Fixed line width when `ribbon` is false. Default `3`. */
|
|
99
|
+
lineWidth?: number;
|
|
100
|
+
/** Highlight only the N best series by mean rank; all others share `neutralColor`. */
|
|
101
|
+
highlightTop?: number;
|
|
102
|
+
/** Shared color for trajectories outside `highlightTop`. */
|
|
103
|
+
neutralColor?: string;
|
|
104
|
+
/** Ordered per-datum style rules. Trajectory rules resolve against each series' first observation. */
|
|
105
|
+
styleRules?: StyleRule[];
|
|
106
|
+
/** Style endpoint labels globally or per original datum. */
|
|
107
|
+
labelStyle?: React.CSSProperties | ((datum: TDatum) => React.CSSProperties);
|
|
108
|
+
colorScheme?: string | string[] | Record<string, string>;
|
|
109
|
+
ribbonOpacity?: number;
|
|
110
|
+
lineOpacity?: number;
|
|
111
|
+
showPoints?: boolean;
|
|
112
|
+
pointRadius?: number;
|
|
113
|
+
/** Endpoint labels. `true` is equivalent to `"end"`. Default `true`. */
|
|
114
|
+
showLabels?: boolean | "start" | "end" | "both";
|
|
115
|
+
showAxes?: boolean;
|
|
116
|
+
showGrid?: boolean;
|
|
117
|
+
showLegend?: boolean;
|
|
118
|
+
/** Additional legend content. */
|
|
119
|
+
legend?: LegendValue;
|
|
120
|
+
legendInteraction?: LegendInteractionMode;
|
|
121
|
+
legendPosition?: LegendPosition;
|
|
122
|
+
enableHover?: boolean;
|
|
123
|
+
/** Dim every trajectory except the hovered series. Default `true`. */
|
|
124
|
+
hoverHighlight?: boolean | "series";
|
|
125
|
+
tooltip?: TooltipProp;
|
|
126
|
+
/** Annotation objects. X coordinates may use the original x values. */
|
|
127
|
+
annotations?: Datum[];
|
|
128
|
+
/** Additional frame props, with BumpChart geometry remaining controlled. */
|
|
129
|
+
frameProps?: Partial<Omit<StreamXYFrameProps, "chartType" | "data" | "size" | "customLayout" | "layoutConfig">>;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Ranking-based bump chart. Each x-column ranks its series by `yAccessor`, and
|
|
133
|
+
* rank becomes vertical position. With `ribbon`, magnitude is encoded by true
|
|
134
|
+
* screen-space ribbon thickness instead of a vertically interpolated area.
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* // Fixed-width ranking lines, coloring only the top 3 series by mean rank.
|
|
138
|
+
* <BumpChart
|
|
139
|
+
* data={data}
|
|
140
|
+
* xAccessor="quarter"
|
|
141
|
+
* yAccessor="sales"
|
|
142
|
+
* lineBy="team"
|
|
143
|
+
* highlightTop={3}
|
|
144
|
+
* />
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* // Magnitude-encoded ribbons (width ∝ value) with ascending rank for a
|
|
148
|
+
* // "lower is better" metric.
|
|
149
|
+
* <BumpChart
|
|
150
|
+
* data={data}
|
|
151
|
+
* xAccessor="week"
|
|
152
|
+
* yAccessor="latencyMs"
|
|
153
|
+
* lineBy="service"
|
|
154
|
+
* rankDirection="ascending"
|
|
155
|
+
* ribbon
|
|
156
|
+
* />
|
|
157
|
+
*/
|
|
158
|
+
export declare const BumpChart: {
|
|
159
|
+
<TDatum extends Datum = Datum>(props: BumpChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
|
|
160
|
+
displayName?: string;
|
|
161
|
+
};
|
|
@@ -5,6 +5,7 @@ import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
|
5
5
|
import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
|
|
6
6
|
import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types";
|
|
7
7
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
8
|
+
import { type GradientInput } from "../shared/gradient";
|
|
8
9
|
export { computeDifferenceSegments } from "./differenceSegments";
|
|
9
10
|
/**
|
|
10
11
|
* DifferenceChart props
|
|
@@ -38,16 +39,8 @@ export interface DifferenceChartProps<TDatum extends Datum = Datum> extends Base
|
|
|
38
39
|
curve?: "linear" | "monotoneX" | "monotoneY" | "step" | "stepAfter" | "stepBefore" | "basis" | "cardinal" | "catmullRom";
|
|
39
40
|
/** Fill opacity for the difference region. Default `0.6`. */
|
|
40
41
|
areaOpacity?: number;
|
|
41
|
-
/** Gradient fill
|
|
42
|
-
gradientFill?:
|
|
43
|
-
topOpacity: number;
|
|
44
|
-
bottomOpacity: number;
|
|
45
|
-
} | {
|
|
46
|
-
colorStops: Array<{
|
|
47
|
-
offset: number;
|
|
48
|
-
color: string;
|
|
49
|
-
}>;
|
|
50
|
-
};
|
|
42
|
+
/** Gradient fill from each segment's tip (offset 0) to its base (offset 1). */
|
|
43
|
+
gradientFill?: GradientInput;
|
|
51
44
|
/** Enable hover annotations. */
|
|
52
45
|
enableHover?: boolean;
|
|
53
46
|
/** Show grid lines. Default `false`. */
|
|
@@ -2,6 +2,7 @@ import type { Datum } from "../shared/datumTypes";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import type { StreamXYFrameProps } from "../../stream/types";
|
|
4
4
|
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
5
|
+
import type { GradientLegendValue } from "../../types/legendTypes";
|
|
5
6
|
import type { LegendInteractionMode } from "../shared/hooks";
|
|
6
7
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
7
8
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
@@ -103,6 +104,8 @@ export interface HeatmapProps<TDatum extends Datum = Datum> extends BaseChartPro
|
|
|
103
104
|
* @default "right"
|
|
104
105
|
*/
|
|
105
106
|
legendPosition?: "right" | "left" | "top" | "bottom";
|
|
107
|
+
/** Gradient legend layout overrides. */
|
|
108
|
+
legend?: Pick<GradientLegendValue, "legendDistance">;
|
|
106
109
|
/**
|
|
107
110
|
* Legend interaction mode.
|
|
108
111
|
* - "highlight": hover dims non-hovered categories to 30% opacity
|
|
@@ -7,6 +7,7 @@ import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types"
|
|
|
7
7
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
8
8
|
import { type StyleRule } from "../shared/styleRules";
|
|
9
9
|
import type { AnomalyConfig, ForecastConfig } from "../shared/statisticalOverlays";
|
|
10
|
+
import { type ColorGradientInput } from "../shared/gradient";
|
|
10
11
|
import type { LegendValue } from "../../types/legendTypes";
|
|
11
12
|
/**
|
|
12
13
|
* LineChart component props
|
|
@@ -113,15 +114,12 @@ export interface LineChartProps<TDatum extends Datum = Datum> extends BaseChartP
|
|
|
113
114
|
*/
|
|
114
115
|
areaOpacity?: number;
|
|
115
116
|
/**
|
|
116
|
-
* Horizontal gradient
|
|
117
|
-
*
|
|
117
|
+
* Horizontal line-stroke gradient. Offset 0 is the left edge and offset 1
|
|
118
|
+
* is the right edge.
|
|
119
|
+
* @example
|
|
120
|
+
* `{ stops: [{ offset: 0, color: "blue" }, { offset: 1, color: "red" }] }`
|
|
118
121
|
*/
|
|
119
|
-
lineGradient?:
|
|
120
|
-
colorStops: Array<{
|
|
121
|
-
offset: number;
|
|
122
|
-
color: string;
|
|
123
|
-
}>;
|
|
124
|
-
};
|
|
122
|
+
lineGradient?: ColorGradientInput;
|
|
125
123
|
/**
|
|
126
124
|
* Line stroke width
|
|
127
125
|
* @default 2
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bind a library-neutral IDID capability descriptor to a Semiotic runtime
|
|
3
|
+
* capability. A portable `intentScores` field is authoritative when present;
|
|
4
|
+
* omission retains the host's ranking policy.
|
|
5
|
+
*
|
|
6
|
+
* The portable descriptor intentionally cannot contain executable `fits` or
|
|
7
|
+
* `buildProps` functions. Treating it as a complete runtime capability would
|
|
8
|
+
* therefore make every dataset appear to fit, which is precisely the kind of
|
|
9
|
+
* plausible-but-unsafe recommendation the portability layer refuses to make.
|
|
10
|
+
*
|
|
11
|
+
* This binder overlays the descriptor's portable policy (rubric, intent
|
|
12
|
+
* scores, variants, caveats, and mobile contract) onto a host-resolved
|
|
13
|
+
* capability while retaining the host's executable data-fit, prop-building,
|
|
14
|
+
* scale, quality, and numeric-contract logic.
|
|
15
|
+
*/
|
|
16
|
+
import type { ChartCapability } from "../../ai/chartCapabilityTypes";
|
|
17
|
+
import { type PortableChartCapability } from "./spec";
|
|
18
|
+
import type { PortabilityDiagnostic, PortabilityLoss, PortabilityProvenance, PortabilityStatus } from "./result";
|
|
19
|
+
/** Runtime capability plus the exact portable descriptor that shaped it. */
|
|
20
|
+
export interface BoundPortableChartCapability extends ChartCapability {
|
|
21
|
+
readonly portableDescriptor: PortableChartCapability;
|
|
22
|
+
}
|
|
23
|
+
/** Structured activation result; refused results never contain a capability. */
|
|
24
|
+
export interface PortableCapabilityBindingResult {
|
|
25
|
+
status: PortabilityStatus;
|
|
26
|
+
capability?: BoundPortableChartCapability;
|
|
27
|
+
diagnostics: readonly PortabilityDiagnostic[];
|
|
28
|
+
lossReport: readonly PortabilityLoss[];
|
|
29
|
+
provenance: PortabilityProvenance;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Activate a portable descriptor against an explicitly resolved host
|
|
33
|
+
* capability.
|
|
34
|
+
*
|
|
35
|
+
* The component ids must match. The portable rubric/intent scores are
|
|
36
|
+
* authoritative for ranking; portable variants replace host variants when the
|
|
37
|
+
* field is present (an omitted variants field means no carried variants).
|
|
38
|
+
* Host `fits`, `buildProps`, numeric contracts, scale/quality gates, and
|
|
39
|
+
* dynamic caveats remain in force.
|
|
40
|
+
*/
|
|
41
|
+
export declare function bindPortableCapability(descriptor: unknown, host: ChartCapability | undefined): PortableCapabilityBindingResult;
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
*/
|
|
11
11
|
export { IDID_SPEC_VERSION, BUILTIN_INTENT_IDS, validatePortableCapability, validatePortableAudienceProfile, validatePortableAnnotation, } from "./spec";
|
|
12
12
|
export type { BuiltInIntentId, PortableIntentId, PortableChartRubric, PortableChartVariant, PortableMobileInteractionCapability, PortableMobileLabelCapability, PortableMobileCustomCapability, PortableMobileCapability, PortableChartCapability, PortableReceptionModality, PortableAudienceTarget, PortableAudienceProfile, PortableAnnotationActorKind, PortableAnnotationSource, PortableAnnotationBasis, PortableAnnotationProvenance, PortableAnnotationFreshness, PortableAnnotationStatus, PortableAnnotationAnchor, PortableAnnotationLifecycle, PortableAnnotated, ValidationResult, } from "./spec";
|
|
13
|
+
export { bindPortableCapability } from "./capabilityBinding";
|
|
14
|
+
export type { BoundPortableChartCapability, PortableCapabilityBindingResult, } from "./capabilityBinding";
|
|
13
15
|
export { toVegaLite, toVegaLiteResult, attachIDID, readIDID, attachIDIDAnnotations, readIDIDAnnotations, } from "./vegaLite";
|
|
14
16
|
export type { IDIDVegaLiteMeta, ToVegaLiteOptions, VegaLiteExportResult, } from "./vegaLite";
|
|
15
17
|
export { fromVegaLiteResult, unwrapIDIDEnrichedVegaLiteSpec, } from "../fromVegaLite";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Screen-space geometry for magnitude-encoded bump-chart ribbons.
|
|
3
|
+
*
|
|
4
|
+
* A conventional area chart offsets both boundaries vertically. That makes a
|
|
5
|
+
* band look artificially thin when its centerline moves sharply between
|
|
6
|
+
* ranks. This helper follows the idea behind d3.svg.ribbon instead: sample the
|
|
7
|
+
* centerline, calculate its local normal, then offset by the requested radius.
|
|
8
|
+
* The visible thickness therefore stays perpendicular to the trajectory.
|
|
9
|
+
*/
|
|
10
|
+
export interface BumpRibbonPoint {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
/** Half of the desired visible ribbon thickness, in pixels. */
|
|
14
|
+
radius: number;
|
|
15
|
+
}
|
|
16
|
+
export interface BumpRibbonGeometry {
|
|
17
|
+
topPath: [number, number][];
|
|
18
|
+
bottomPath: [number, number][];
|
|
19
|
+
/** Index of the nearest input datum for every sampled path vertex. */
|
|
20
|
+
datumIndices: number[];
|
|
21
|
+
}
|
|
22
|
+
export interface BumpRibbonGeometryOptions {
|
|
23
|
+
/** Smooth horizontal-tangent Béziers or straight segments. */
|
|
24
|
+
curve?: "smooth" | "linear";
|
|
25
|
+
/** Samples emitted for each interval. Stable counts enable path animation. */
|
|
26
|
+
samplesPerSegment?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Build paired boundary paths around a bump-chart centerline.
|
|
30
|
+
*
|
|
31
|
+
* The first sample of every interval after the first is omitted because it is
|
|
32
|
+
* identical to the previous interval's final sample. Every trajectory with
|
|
33
|
+
* the same number of ranking columns therefore emits the same number of
|
|
34
|
+
* vertices, which lets StreamXYFrame interpolate paths during data updates.
|
|
35
|
+
*/
|
|
36
|
+
export declare function buildBumpRibbonGeometry(points: BumpRibbonPoint[], options?: BumpRibbonGeometryOptions): BumpRibbonGeometry;
|
|
@@ -1,8 +1,82 @@
|
|
|
1
|
-
import type { LegendLayout } from "./types/legendTypes";
|
|
1
|
+
import type { LegendLayout, LegendValue } from "./types/legendTypes";
|
|
2
2
|
export declare const DEFAULT_LEGEND_SWATCH_SIZE = 16;
|
|
3
3
|
export declare const DEFAULT_LEGEND_LABEL_GAP = 6;
|
|
4
4
|
export declare const DEFAULT_LEGEND_ITEM_GAP = 10;
|
|
5
5
|
export declare const DEFAULT_LEGEND_ROW_HEIGHT = 22;
|
|
6
|
+
export declare const DEFAULT_SIDE_LEGEND_WIDTH = 100;
|
|
7
|
+
export declare const DEFAULT_LEGEND_DISTANCE = 10;
|
|
8
|
+
/**
|
|
9
|
+
* SVG text has no useful intrinsic width until after it is mounted. Keep the
|
|
10
|
+
* estimate shared by margin calculation and rendering so side legends never
|
|
11
|
+
* reserve one width and draw into another.
|
|
12
|
+
*/
|
|
13
|
+
export declare function estimateLegendTextWidth(label: string): number;
|
|
14
|
+
/** Resolve the layout box needed by a left/right legend. */
|
|
15
|
+
export declare function resolveSideLegendWidth(legend: LegendValue | null | undefined, layout?: LegendLayout): number;
|
|
16
|
+
/** Resolve the requested gap between the legend edge and plot edge. */
|
|
17
|
+
export declare function resolveLegendDistance(legend: LegendValue | null | undefined): number;
|
|
18
|
+
/** Resolve plot-adjacent chrome reserved before a left/right legend. */
|
|
19
|
+
export declare function resolveLegendSideGutter(layout?: LegendLayout): number;
|
|
20
|
+
/**
|
|
21
|
+
* Height of the chrome a horizontal axis draws *outside* the plot rect, which
|
|
22
|
+
* a top/bottom legend has to clear.
|
|
23
|
+
*
|
|
24
|
+
* The axis renderers place tick labels on a baseline 18px past the axis line
|
|
25
|
+
* and an axis title at 40px (58px when ticks are rotated); each needs a few
|
|
26
|
+
* more pixels for descenders. A bottom legend anchored at `plotBottom +
|
|
27
|
+
* legendDistance` lands in exactly that band, so without this reservation the
|
|
28
|
+
* legend and the tick labels draw at the same y.
|
|
29
|
+
*/
|
|
30
|
+
export declare const AXIS_TICK_CHROME = 22;
|
|
31
|
+
export declare const AXIS_TITLE_CHROME = 46;
|
|
32
|
+
export declare const ROTATED_AXIS_TITLE_CHROME = 64;
|
|
33
|
+
export interface AxisChromeInput {
|
|
34
|
+
/** A horizontal axis renders on this side of the plot. */
|
|
35
|
+
hasAxis?: boolean;
|
|
36
|
+
/** An axis title (`xLabel` / `valueLabel` / `categoryLabel`) is present. */
|
|
37
|
+
hasAxisLabel?: boolean;
|
|
38
|
+
/** Tick labels are rotated, which pushes the axis title further out. */
|
|
39
|
+
rotatedTicks?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Space to reserve between the plot edge and a top/bottom legend.
|
|
43
|
+
*
|
|
44
|
+
* `legendLayout.axisGutter` is the explicit override (including `0` to opt out
|
|
45
|
+
* and restore pre-3.8.7 placement); otherwise the band is derived from the
|
|
46
|
+
* axis chrome actually being drawn, and is 0 when there is no axis on that
|
|
47
|
+
* side — so pie/donut and axes-off charts are unaffected.
|
|
48
|
+
*/
|
|
49
|
+
export declare function resolveAxisChromeGutter(input?: AxisChromeInput, layout?: LegendLayout): number;
|
|
50
|
+
/**
|
|
51
|
+
* Resolve `axisChrome` for an XY chart HOC's `useChartLegendAndMargin` call.
|
|
52
|
+
* Mirrors `server/staticXY.tsx`'s `renderStreamXYFrame` (`hasAxis:
|
|
53
|
+
* showAxes !== false`, `hasAxisLabel: !!xLabel`) so a bottom-legend chart
|
|
54
|
+
* reserves the same margin on the client as `renderChart` does on the
|
|
55
|
+
* server — leaving either side to guess (the pre-3.8.8 default) makes the
|
|
56
|
+
* client over- or under-reserve relative to the SSR output whenever a
|
|
57
|
+
* wrapped legend pushes the reservation past the 80px floor.
|
|
58
|
+
*/
|
|
59
|
+
export declare function resolveXYAxisChrome(input: {
|
|
60
|
+
showAxes?: boolean;
|
|
61
|
+
xLabel?: unknown;
|
|
62
|
+
}): AxisChromeInput;
|
|
63
|
+
/**
|
|
64
|
+
* Resolve `axisChrome` for an ordinal chart HOC's `useChartLegendAndMargin`
|
|
65
|
+
* call. Mirrors `server/staticOrdinal.tsx`'s `renderOrdinalFrame`: the
|
|
66
|
+
* bottom axis is the value axis for `"horizontal"` projection, the category
|
|
67
|
+
* axis otherwise, and radial projections draw no axis at all. See
|
|
68
|
+
* `resolveXYAxisChrome` for why this must track the server computation.
|
|
69
|
+
*/
|
|
70
|
+
export declare function resolveOrdinalAxisChrome(input: {
|
|
71
|
+
showAxes?: boolean;
|
|
72
|
+
projection?: "horizontal" | "vertical" | "radial";
|
|
73
|
+
hasCategoryLabel: boolean;
|
|
74
|
+
hasValueLabel: boolean;
|
|
75
|
+
}): AxisChromeInput;
|
|
76
|
+
/** Estimate the layout-box height used to place a top/bottom legend. */
|
|
77
|
+
export declare function resolveHorizontalLegendHeight(legend: LegendValue | null | undefined, availableWidth: number, layout?: LegendLayout): number;
|
|
78
|
+
/** Margin required to fit a side legend and its plot-edge gap. */
|
|
79
|
+
export declare function resolveSideLegendMargin(legend: LegendValue | null | undefined, layout?: LegendLayout): number;
|
|
6
80
|
export interface LegendMetrics {
|
|
7
81
|
swatchSize: number;
|
|
8
82
|
labelGap: number;
|