semiotic 3.8.0 → 3.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +12 -9
- package/README.md +39 -39
- package/ai/dist/mcp-server.js +98 -17
- package/ai/schema.json +1 -1
- package/ai/surface-manifest.json +3 -2
- package/ai/system-prompt.md +3 -2
- package/dist/__tests__/scenarios/mcpProtocolTypes.d.ts +20 -0
- package/dist/components/AccessibleNavTree.d.ts +7 -1
- package/dist/components/ai/chartClinicMetadata.generated.d.ts +15 -0
- package/dist/components/ai/useNavigationSync.d.ts +17 -2
- package/dist/components/chartContainerMobile.d.ts +9 -0
- package/dist/components/charts/geo/ChoroplethMap.d.ts +19 -2
- package/dist/components/charts/geo/DistanceCartogram.d.ts +14 -2
- package/dist/components/charts/geo/FlowMap.d.ts +10 -6
- package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +14 -2
- package/dist/components/charts/index.d.ts +6 -0
- package/dist/components/charts/network/ChordDiagram.d.ts +9 -1
- package/dist/components/charts/network/ForceDirectedGraph.d.ts +11 -0
- package/dist/components/charts/network/SankeyDiagram.d.ts +9 -1
- package/dist/components/charts/ordinal/BarChart.d.ts +21 -0
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +11 -0
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +11 -0
- package/dist/components/charts/physics/CollisionSwarmChart.d.ts +7 -0
- package/dist/components/charts/physics/EventDropChart.d.ts +7 -0
- package/dist/components/charts/physics/GaltonBoardChart.d.ts +8 -0
- package/dist/components/charts/physics/PhysicsCustomChart.d.ts +4 -25
- package/dist/components/charts/physics/PhysicsPileChart.d.ts +7 -0
- package/dist/components/charts/physics/physicsChartShared.d.ts +17 -1
- package/dist/components/charts/physics/physicsCustomLayout.d.ts +32 -0
- package/dist/components/charts/shared/AnnotationLabel.d.ts +88 -0
- package/dist/components/charts/shared/annotationActivation.d.ts +35 -0
- package/dist/components/charts/shared/annotationLabelLayout.d.ts +5 -0
- package/dist/components/charts/shared/annotationRules.d.ts +2 -1
- package/dist/components/charts/shared/chartSelectionUtils.d.ts +4 -0
- package/dist/components/charts/shared/chartSpecCore.d.ts +3 -3
- package/dist/components/charts/shared/datumTypes.d.ts +2 -0
- package/dist/components/charts/shared/diagnoseAnnotationChecks.d.ts +2 -0
- package/dist/components/charts/shared/formatUtils.d.ts +3 -3
- package/dist/components/charts/shared/hatchFill.d.ts +87 -0
- package/dist/components/charts/shared/hooks.d.ts +7 -6
- package/dist/components/charts/shared/knownChartComponents.d.ts +9 -0
- package/dist/components/charts/shared/leastSquaresRegression.d.ts +16 -0
- package/dist/components/charts/shared/mergeShapeStyle.d.ts +3 -2
- package/dist/components/charts/shared/semanticInteractions.d.ts +42 -0
- package/dist/components/charts/shared/sparseArray.d.ts +1 -1
- package/dist/components/charts/shared/streamPropsHelpers.d.ts +6 -4
- package/dist/components/charts/shared/styleRules.d.ts +205 -0
- package/dist/components/charts/shared/tooltipUtils.d.ts +22 -9
- package/dist/components/charts/shared/types.d.ts +9 -6
- package/dist/components/charts/shared/useAreaSeriesSetup.d.ts +16 -2
- package/dist/components/charts/shared/useChartSetup.d.ts +2 -2
- package/dist/components/charts/shared/useCustomChartSetup.d.ts +3 -0
- package/dist/components/charts/shared/useFrameImperativeHandle.d.ts +1 -2
- package/dist/components/charts/shared/useLikertAggregation.d.ts +4 -4
- package/dist/components/charts/shared/useOrdinalBrush.d.ts +2 -1
- package/dist/components/charts/shared/useOrdinalPieceStyle.d.ts +24 -1
- package/dist/components/charts/shared/useStreamingLegend.d.ts +1 -1
- package/dist/components/charts/shared/useXYLineStyle.d.ts +10 -0
- package/dist/components/charts/shared/useXYPointStyle.d.ts +19 -1
- package/dist/components/charts/shared/validateChartData.d.ts +7 -5
- package/dist/components/charts/shared/validationMap.d.ts +11 -2
- package/dist/components/charts/shared/validationMap.generated.d.ts +6 -0
- package/dist/components/charts/shared/withChartWrapper.d.ts +4 -3
- package/dist/components/charts/value/targetPresentation.d.ts +22 -0
- package/dist/components/charts/value/types.d.ts +5 -6
- package/dist/components/charts/xy/AreaChart.d.ts +8 -0
- package/dist/components/charts/xy/BubbleChart.d.ts +9 -0
- package/dist/components/charts/xy/ConnectedScatterplot.d.ts +7 -0
- package/dist/components/charts/xy/DifferenceChart.d.ts +1 -52
- package/dist/components/charts/xy/Heatmap.d.ts +2 -2
- package/dist/components/charts/xy/LineChart.d.ts +11 -0
- package/dist/components/charts/xy/QuadrantChart.d.ts +7 -0
- package/dist/components/charts/xy/Scatterplot.d.ts +10 -0
- package/dist/components/charts/xy/StackedAreaChart.d.ts +7 -0
- package/dist/components/charts/xy/differenceSegments.d.ts +49 -0
- package/dist/components/charts/xy/scatterplotMatrixInteractionTypes.d.ts +12 -0
- package/dist/components/controls/SentenceFilter.d.ts +97 -0
- package/dist/components/data/fromVegaLite.d.ts +19 -9
- package/dist/components/rough/createRoughRenderMode.d.ts +46 -0
- package/dist/components/semiotic-ai.d.ts +3 -1
- package/dist/components/semiotic-controls.d.ts +2 -0
- package/dist/components/semiotic-geo.d.ts +4 -0
- package/dist/components/semiotic-network.d.ts +4 -0
- package/dist/components/semiotic-ordinal.d.ts +6 -0
- package/dist/components/semiotic-physics.d.ts +4 -0
- package/dist/components/semiotic-rough.d.ts +4 -0
- package/dist/components/semiotic-utils-core.d.ts +4 -0
- package/dist/components/semiotic-xy.d.ts +4 -0
- package/dist/components/semiotic.d.ts +9 -1
- package/dist/components/server/optionalImageTypes.d.ts +37 -0
- package/dist/components/server/serverChartConfigShared.d.ts +9 -5
- package/dist/components/server/serverChartConfigs.d.ts +4 -4
- package/dist/components/server/staticAnnotations.d.ts +6 -3
- package/dist/components/server/staticLegend.d.ts +1 -1
- package/dist/components/server/staticNetwork.d.ts +4 -4
- package/dist/components/server/staticSVGChrome.d.ts +2 -2
- package/dist/components/store/ObservationStore.d.ts +21 -1
- package/dist/components/stream/AccessibleDataTable.d.ts +4 -10
- package/dist/components/stream/AriaLiveTooltip.d.ts +9 -0
- package/dist/components/stream/CanvasHitTester.d.ts +4 -4
- package/dist/components/stream/DataSourceAdapter.d.ts +1 -1
- package/dist/components/stream/FrameRuntime.d.ts +57 -0
- package/dist/components/stream/GeoParticlePool.d.ts +1 -1
- package/dist/components/stream/GeoPipelineStore.d.ts +43 -12
- package/dist/components/stream/GeoSVGOverlay.d.ts +64 -0
- package/dist/components/stream/NetworkCanvasHitTester.d.ts +2 -1
- package/dist/components/stream/NetworkPipelineStore.d.ts +24 -21
- package/dist/components/stream/NetworkSSRFrame.d.ts +17 -0
- package/dist/components/stream/NetworkSVGOverlay.d.ts +6 -0
- package/dist/components/stream/OrdinalCanvasHitTester.d.ts +2 -2
- package/dist/components/stream/OrdinalPipelineStore.d.ts +13 -13
- package/dist/components/stream/OrdinalSVGOverlay.d.ts +9 -1
- package/dist/components/stream/OrdinalStyleResolver.d.ts +12 -0
- package/dist/components/stream/ParticlePool.d.ts +1 -1
- package/dist/components/stream/PipelineStore.d.ts +12 -16
- package/dist/components/stream/SVGOverlay.d.ts +6 -0
- package/dist/components/stream/SceneGraph.d.ts +3 -3
- package/dist/components/stream/accessorUtils.d.ts +2 -2
- package/dist/components/stream/annotationAccessorResolver.d.ts +2 -2
- package/dist/components/stream/frameGraphics.d.ts +4 -0
- package/dist/components/stream/frameKeyboardNavigation.d.ts +45 -0
- package/dist/components/stream/geoPipelineHelpers.d.ts +3 -3
- package/dist/components/stream/geoPipelineUpdateResults.d.ts +34 -0
- package/dist/components/stream/geoSceneBuilder.d.ts +16 -0
- package/dist/components/stream/geoTypes.d.ts +48 -15
- package/dist/components/stream/hitTestUtils.d.ts +2 -2
- package/dist/components/stream/hoverUtils.d.ts +4 -2
- package/dist/components/stream/layouts/forceLayoutWorkerClient.d.ts +1 -0
- package/dist/components/stream/layouts/hierarchyUtils.d.ts +2 -2
- package/dist/components/stream/networkCustomLayoutRunner.d.ts +23 -0
- package/dist/components/stream/networkCustomRestyle.d.ts +15 -0
- package/dist/components/stream/networkFrameAnimation.d.ts +7 -0
- package/dist/components/stream/networkFrameHandleTypes.d.ts +39 -0
- package/dist/components/stream/networkFrameObservations.d.ts +15 -0
- package/dist/components/stream/networkFramePaint.d.ts +11 -2
- package/dist/components/stream/networkInteractionTypes.d.ts +26 -0
- package/dist/components/stream/networkPipelineConfig.d.ts +2 -2
- package/dist/components/stream/networkPipelineUpdateResults.d.ts +38 -0
- package/dist/components/stream/networkTypes.d.ts +37 -56
- package/dist/components/stream/ordinalCanvasRenderers.d.ts +2 -2
- package/dist/components/stream/ordinalPipelineUpdateResults.d.ts +20 -1
- package/dist/components/stream/ordinalSceneBuilders/types.d.ts +2 -2
- package/dist/components/stream/ordinalTypes.d.ts +30 -3
- package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +2 -0
- package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +6 -0
- package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +21 -6
- package/dist/components/stream/physics/physicsFrameObservations.d.ts +19 -0
- package/dist/components/stream/physics/physicsFrameSetup.d.ts +4 -0
- package/dist/components/stream/physics/physicsPipelineUpdateResults.d.ts +19 -1
- package/dist/components/stream/physics/usePhysicsFrameLifecyclePolicy.d.ts +3 -1
- package/dist/components/stream/pipelineConfig.d.ts +4 -2
- package/dist/components/stream/pipelineDecay.d.ts +2 -2
- package/dist/components/stream/pipelinePulse.d.ts +2 -2
- package/dist/components/stream/pipelineStoreUpdateResults.d.ts +23 -2
- package/dist/components/stream/pipelineTransitions.d.ts +1 -1
- package/dist/components/stream/pipelineUpdateContract.d.ts +7 -0
- package/dist/components/stream/pipelineUpdateStore.d.ts +21 -0
- package/dist/components/stream/renderBackend.d.ts +27 -0
- package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +15 -1
- package/dist/components/stream/renderers/geoCanvasRenderer.d.ts +3 -2
- package/dist/components/stream/renderers/networkParticleRenderer.d.ts +1 -1
- package/dist/components/stream/sceneRenderBackendTypes.d.ts +28 -0
- package/dist/components/stream/sceneRevisionDiagnostics.d.ts +31 -4
- package/dist/components/stream/streamSemanticTypes.d.ts +16 -0
- package/dist/components/stream/streamThemeTypes.d.ts +14 -0
- package/dist/components/stream/svgOverlayUtils.d.ts +10 -0
- package/dist/components/stream/test-utils/frameScheduler.d.ts +12 -0
- package/dist/components/stream/test-utils/revisionConsumption.d.ts +13 -0
- package/dist/components/stream/titleLayout.d.ts +31 -0
- package/dist/components/stream/types.d.ts +30 -65
- package/dist/components/stream/useCanvasFrameHost.d.ts +71 -0
- package/dist/components/stream/useFrame.d.ts +23 -0
- package/dist/components/stream/useLegendCategoryEmission.d.ts +3 -3
- package/dist/components/stream/useSemanticFrameInteractions.d.ts +22 -0
- package/dist/components/stream/useUpdateResultSnapshot.d.ts +7 -0
- package/dist/components/stream/xyFrameAxisTypes.d.ts +50 -0
- package/dist/components/stream/xySceneBuilders/types.d.ts +6 -5
- package/dist/controls.min.js +1 -1
- package/dist/controls.module.min.js +1 -1
- package/dist/forceLayoutWorker.js +1 -1
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics.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/rough.min.js +1 -0
- package/dist/rough.module.min.js +1 -0
- 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 +3 -1
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-controls.d.ts +2 -0
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-experimental.min.js +1 -1
- package/dist/semiotic-experimental.module.min.js +1 -1
- package/dist/semiotic-geo.d.ts +4 -0
- package/dist/semiotic-network.d.ts +4 -0
- package/dist/semiotic-ordinal.d.ts +6 -0
- package/dist/semiotic-physics.d.ts +4 -0
- package/dist/semiotic-realtime-core.min.js +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-realtime-react.min.js +1 -1
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-rough.d.ts +4 -0
- 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-utils-core.d.ts +4 -0
- 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-value.min.js +1 -1
- package/dist/semiotic-value.module.min.js +1 -1
- package/dist/semiotic-xy.d.ts +4 -0
- package/dist/semiotic.d.ts +9 -1
- 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/test-utils/capturedFrameProps.d.ts +67 -0
- package/dist/test-utils/frameMock.d.ts +12 -9
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +26 -7
|
@@ -65,7 +65,7 @@ export interface TransitionState {
|
|
|
65
65
|
* Detects entering nodes (new, no prev match) and exiting nodes (prev, no new match).
|
|
66
66
|
* Mutates scene and exitNodes in place. Returns updated state.
|
|
67
67
|
*/
|
|
68
|
-
export declare function startTransition(ctx: TransitionContext, transition: TransitionConfig, state: TransitionState, prevPositionMap: Map<string, PrevPosition>, prevPathMap: Map<string, PrevPath
|
|
68
|
+
export declare function startTransition(ctx: TransitionContext, transition: TransitionConfig, state: TransitionState, prevPositionMap: Map<string, PrevPosition>, prevPathMap: Map<string, PrevPath>, startTime?: number): TransitionState;
|
|
69
69
|
/**
|
|
70
70
|
* Advance the transition animation. Returns true if still animating.
|
|
71
71
|
* Mutates scene nodes in place.
|
|
@@ -54,9 +54,16 @@ export declare function createUpdateResult(changeSet: ChangeSet, invalidations:
|
|
|
54
54
|
* keeps revision bookkeeping out of family-specific data/layout code while
|
|
55
55
|
* preserving each store's existing mutation API.
|
|
56
56
|
*/
|
|
57
|
+
export type UpdateResultListener = () => void;
|
|
58
|
+
export interface UpdateResultStore {
|
|
59
|
+
getUpdateSnapshot(): UpdateResult;
|
|
60
|
+
subscribeUpdateResult(listener: UpdateResultListener): () => void;
|
|
61
|
+
}
|
|
57
62
|
export declare class UpdateResultTracker {
|
|
58
63
|
private revisions;
|
|
59
64
|
private latest;
|
|
65
|
+
private listeners;
|
|
60
66
|
get last(): UpdateResult;
|
|
67
|
+
subscribe(listener: UpdateResultListener): () => void;
|
|
61
68
|
record(changeSet: ChangeSet, invalidations: Iterable<Invalidation>): UpdateResult;
|
|
62
69
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { UpdateResult } from "./pipelineUpdateContract";
|
|
2
|
+
import type { CustomLayoutSelection } from "./customLayoutSelection";
|
|
3
|
+
export type { UpdateResult } from "./pipelineUpdateContract";
|
|
4
|
+
/** Shared additive update-result read and subscription surface for stream stores. */
|
|
5
|
+
export interface PipelineUpdateResultSource {
|
|
6
|
+
readonly last: UpdateResult;
|
|
7
|
+
subscribe(listener: () => void): () => void;
|
|
8
|
+
}
|
|
9
|
+
/** Public lifecycle surface installed on each stream store prototype. */
|
|
10
|
+
export interface UpdateResultStore {
|
|
11
|
+
getLastUpdateResult(): UpdateResult;
|
|
12
|
+
getUpdateSnapshot(): UpdateResult;
|
|
13
|
+
subscribeUpdateResult(listener: () => void): () => void;
|
|
14
|
+
setLayoutSelection(selection: CustomLayoutSelection | null): void;
|
|
15
|
+
markStylePaintPending(): void;
|
|
16
|
+
consumeStylePaintPending(): boolean;
|
|
17
|
+
}
|
|
18
|
+
/** Adds the shared lifecycle methods without imposing a base-class constructor. */
|
|
19
|
+
export declare function attachUpdateResultStore(target: {
|
|
20
|
+
prototype: object;
|
|
21
|
+
}): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { SceneRenderBackend, SceneRenderMode, Style } from "./types";
|
|
3
|
+
type SceneLike = {
|
|
4
|
+
type?: string;
|
|
5
|
+
datum?: unknown;
|
|
6
|
+
style?: Style;
|
|
7
|
+
};
|
|
8
|
+
/** Resolve a whole-scene or per-datum renderer. The legacy `sketchy` token
|
|
9
|
+
* stays on the existing built-in rendering path. */
|
|
10
|
+
export declare function resolveSceneRenderBackend<Node extends SceneLike>(renderMode: SceneRenderMode<Node> | undefined, node: Node): SceneRenderBackend<Node> | undefined;
|
|
11
|
+
/** Paint nodes in scene order, delegating unsupported runs to the built-in renderer. */
|
|
12
|
+
export declare function paintSceneWithBackend<Node extends SceneLike>(args: {
|
|
13
|
+
context: CanvasRenderingContext2D;
|
|
14
|
+
nodes: Node[];
|
|
15
|
+
renderMode: SceneRenderMode<Node> | undefined;
|
|
16
|
+
pixelRatio: number;
|
|
17
|
+
paintBuiltIn: (nodes: Node[]) => void;
|
|
18
|
+
}): void;
|
|
19
|
+
/** Try a backend for SSR/static SVG, then invoke the existing converter. */
|
|
20
|
+
export declare function renderSceneWithBackend<Node extends SceneLike>(args: {
|
|
21
|
+
node: Node;
|
|
22
|
+
index: number;
|
|
23
|
+
renderMode: SceneRenderMode<Node> | undefined;
|
|
24
|
+
fallback: () => React.ReactNode;
|
|
25
|
+
}): React.ReactNode;
|
|
26
|
+
export declare function resetRenderBackendWarningsForTests(): void;
|
|
27
|
+
export {};
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* mechanical bits that recur regardless of the shape being painted.
|
|
17
17
|
*/
|
|
18
18
|
import type { CurveType } from "../types";
|
|
19
|
+
import { type HatchFill } from "../../charts/shared/hatchFill";
|
|
19
20
|
import type { CurveFactory } from "d3-shape";
|
|
20
21
|
/**
|
|
21
22
|
* Structural shapes for the gradient configs the helpers accept. Kept
|
|
@@ -61,7 +62,20 @@ export declare function resolveCurveFactory(curve: CurveType | undefined): Curve
|
|
|
61
62
|
* `(typeof X === "string" ? resolveCSSColor(ctx, X) : X) || fallback`,
|
|
62
63
|
* repeated once per renderer per fill/stroke site.
|
|
63
64
|
*/
|
|
64
|
-
export declare function resolveCanvasFill(ctx: CanvasRenderingContext2D, fill: string | CanvasPattern | null | undefined, fallback: string): string | CanvasPattern;
|
|
65
|
+
export declare function resolveCanvasFill(ctx: CanvasRenderingContext2D, fill: string | HatchFill | CanvasPattern | null | undefined, fallback: string): string | CanvasPattern;
|
|
66
|
+
/**
|
|
67
|
+
* Narrow a possibly-`HatchFill` `style.fill` to the `string | CanvasPattern`
|
|
68
|
+
* a canvas `fillStyle` accepts, for the direct-assign sites that don't
|
|
69
|
+
* otherwise route through {@link resolveCanvasFill}. Returns `undefined` for a
|
|
70
|
+
* nullish (or unresolvable) fill so callers can apply their own fallback with
|
|
71
|
+
* `?? "…"`.
|
|
72
|
+
*
|
|
73
|
+
* Delegates to {@link resolveCanvasFill} so behavior stays consistent: string
|
|
74
|
+
* fills (including `var(--…)`) resolve through `resolveCSSColor` — a raw CSS
|
|
75
|
+
* variable written straight to `fillStyle` would silently paint black — and a
|
|
76
|
+
* `HatchFill` resolves to its `CanvasPattern` (or its resolved background).
|
|
77
|
+
*/
|
|
78
|
+
export declare function coerceCanvasFill(ctx: CanvasRenderingContext2D, fill: string | HatchFill | CanvasPattern | null | undefined): string | CanvasPattern | undefined;
|
|
65
79
|
/**
|
|
66
80
|
* Build a linear gradient from a `FillGradient` config. Returns `null`
|
|
67
81
|
* when the gradient cannot be constructed (fewer than two valid color
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { GeoSceneNode } from "../geoTypes";
|
|
1
|
+
import type { GeoScales, GeoSceneNode } from "../geoTypes";
|
|
2
|
+
import type { StreamLayout } from "../types";
|
|
2
3
|
/**
|
|
3
4
|
* Canvas renderer for GeoAreaSceneNode — projected geographic polygons.
|
|
4
5
|
* Uses Path2D for GPU-accelerated rendering of complex geo paths.
|
|
@@ -6,4 +7,4 @@ import type { GeoSceneNode } from "../geoTypes";
|
|
|
6
7
|
* Points and lines in a geo frame are rendered by the existing
|
|
7
8
|
* pointCanvasRenderer and lineCanvasRenderer respectively.
|
|
8
9
|
*/
|
|
9
|
-
export declare function geoCanvasRenderer(ctx: CanvasRenderingContext2D, nodes: GeoSceneNode[], _scales:
|
|
10
|
+
export declare function geoCanvasRenderer(ctx: CanvasRenderingContext2D, nodes: GeoSceneNode[], _scales: GeoScales, _layout: StreamLayout): void;
|
|
@@ -8,4 +8,4 @@ export declare function renderNetworkParticles(ctx: CanvasRenderingContext2D, po
|
|
|
8
8
|
/**
|
|
9
9
|
* Spawn particles for all edges proportional to their value.
|
|
10
10
|
*/
|
|
11
|
-
export declare function spawnNetworkParticles(pool: ParticlePool, edges: RealtimeEdge[], deltaTime: number, style: ParticleStyle): void;
|
|
11
|
+
export declare function spawnNetworkParticles(pool: ParticlePool, edges: RealtimeEdge[], deltaTime: number, style: ParticleStyle, random?: () => number): void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { Datum } from "../charts/shared/datumTypes";
|
|
3
|
+
import type { Style } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* Optional paint backend for pre-computed scene nodes. A backend may change
|
|
6
|
+
* how a mark looks, but it must not mutate the scene node: original geometry
|
|
7
|
+
* remains authoritative for interaction, focus, transitions, and accessibility.
|
|
8
|
+
*/
|
|
9
|
+
export interface SceneRenderBackend<Node = unknown> {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
cacheKey(node: Node, style: Style): string;
|
|
12
|
+
drawCanvas(args: {
|
|
13
|
+
context: CanvasRenderingContext2D;
|
|
14
|
+
node: Node;
|
|
15
|
+
style: Style;
|
|
16
|
+
pixelRatio: number;
|
|
17
|
+
}): boolean;
|
|
18
|
+
renderStaticSVG(args: {
|
|
19
|
+
node: Node;
|
|
20
|
+
style: Style;
|
|
21
|
+
key: string;
|
|
22
|
+
}): ReactNode | null;
|
|
23
|
+
}
|
|
24
|
+
/** A backend can cover the whole scene or be selected per datum. */
|
|
25
|
+
export type SceneRenderDatum<Node> = Node extends {
|
|
26
|
+
datum?: infer NodeDatum;
|
|
27
|
+
} ? Exclude<NodeDatum, undefined> | null : Datum | null;
|
|
28
|
+
export type SceneRenderMode<Node = unknown> = "sketchy" | SceneRenderBackend<Node> | ((datum: SceneRenderDatum<Node>, node: Node) => "sketchy" | SceneRenderBackend<Node> | undefined);
|
|
@@ -1,18 +1,45 @@
|
|
|
1
|
-
import type { RevisionSet, UpdateResult } from "./pipelineUpdateContract";
|
|
2
|
-
type SceneRevisionSet = Pick<RevisionSet, "sceneGeometry" | "layout" | "domain">;
|
|
3
|
-
interface SceneRevisionCheck {
|
|
1
|
+
import type { RevisionSet, UpdateResult, UpdateResultStore } from "./pipelineUpdateContract";
|
|
2
|
+
export type SceneRevisionSet = Pick<RevisionSet, "sceneGeometry" | "layout" | "domain">;
|
|
3
|
+
export interface SceneRevisionCheck {
|
|
4
4
|
revisions: SceneRevisionSet;
|
|
5
5
|
signature: string;
|
|
6
6
|
sawSignals: boolean;
|
|
7
7
|
wasUnconsumed: boolean;
|
|
8
8
|
warnUnconsumed: boolean;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
interface SceneRevisionStore extends UpdateResultStore {
|
|
11
|
+
getLastUpdateResult(): UpdateResult;
|
|
12
|
+
}
|
|
13
|
+
/** Development-only consumption and duplicate-compute diagnostics for a scene host. */
|
|
11
14
|
export declare class SceneRevisionDiagnostics {
|
|
15
|
+
private readonly hostName;
|
|
16
|
+
constructor(hostName?: string);
|
|
12
17
|
private lastConsumed;
|
|
18
|
+
private lastObserved;
|
|
13
19
|
private lastDuplicateWarning;
|
|
14
20
|
private lastUnconsumedWarning;
|
|
21
|
+
/**
|
|
22
|
+
* Accept a React external-store observation without participating in frame
|
|
23
|
+
* scheduling or paint. The imperative result passed to beforeCompute remains
|
|
24
|
+
* authoritative; retaining the high-water mark only protects development
|
|
25
|
+
* diagnostics when React observes an update between frame passes.
|
|
26
|
+
*/
|
|
27
|
+
observeUpdateResult(updateResult: UpdateResult): void;
|
|
15
28
|
beforeCompute(updateResult: UpdateResult, isTransitioning: boolean): SceneRevisionCheck;
|
|
16
29
|
afterCompute(check: SceneRevisionCheck, computedScene: boolean, dimsChanged: boolean): void;
|
|
17
30
|
}
|
|
31
|
+
/** Keep a frame's development-only revision tracker stable across renders. */
|
|
32
|
+
export declare function useSceneRevisionDiagnostics(hostName: string): import("react").RefObject<SceneRevisionDiagnostics>;
|
|
33
|
+
/** Wrap an unconditional scene build with the common revision accounting. */
|
|
34
|
+
export declare function runSceneBuild(diagnostics: SceneRevisionDiagnostics, store: SceneRevisionStore, build: () => void, isTransitioning?: boolean, dimsChanged?: boolean): void;
|
|
35
|
+
/**
|
|
36
|
+
* Observes external-store revisions without putting diagnostics on a React
|
|
37
|
+
* render path. Stores can record non-invalidating operational results during
|
|
38
|
+
* host effects, so a useSyncExternalStore subscription here could feed those
|
|
39
|
+
* diagnostics back into the host's render cycle.
|
|
40
|
+
*/
|
|
41
|
+
export declare const SceneRevisionDiagnosticsObserver: import("react").MemoExoticComponent<({ store, diagnostics }: {
|
|
42
|
+
store: UpdateResultStore;
|
|
43
|
+
diagnostics: SceneRevisionDiagnostics;
|
|
44
|
+
}) => null>;
|
|
18
45
|
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { OnObservationCallback } from "../store/ObservationStore";
|
|
2
|
+
import type { SemanticClickBehavior, SemanticHoverBehavior } from "../charts/shared/semanticInteractions";
|
|
3
|
+
import type { OnAnnotationActivateCallback } from "../charts/shared/annotationActivation";
|
|
4
|
+
/** Interaction props shared by all Stream Frame families. */
|
|
5
|
+
export interface StreamSemanticInteractionProps<Hover> {
|
|
6
|
+
customHoverBehavior?: SemanticHoverBehavior<Hover>;
|
|
7
|
+
customClickBehavior?: SemanticClickBehavior<Hover>;
|
|
8
|
+
/** Structured interaction observations, including semantic focus/activate. */
|
|
9
|
+
onObservation?: OnObservationCallback;
|
|
10
|
+
/** @internal HOC observation callback forwarded only to annotation widgets. */
|
|
11
|
+
annotationObservationCallback?: OnObservationCallback;
|
|
12
|
+
/** Chart instance identifier included in observation events. */
|
|
13
|
+
chartId?: string;
|
|
14
|
+
/** Observe activation of widget annotations without replacing widget behavior. */
|
|
15
|
+
onAnnotationActivate?: OnAnnotationActivateCallback;
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ThemeSemanticColors {
|
|
2
|
+
primary?: string;
|
|
3
|
+
secondary?: string;
|
|
4
|
+
success?: string;
|
|
5
|
+
danger?: string;
|
|
6
|
+
warning?: string;
|
|
7
|
+
error?: string;
|
|
8
|
+
info?: string;
|
|
9
|
+
text?: string;
|
|
10
|
+
textSecondary?: string;
|
|
11
|
+
border?: string;
|
|
12
|
+
grid?: string;
|
|
13
|
+
surface?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function resolveHorizontalTickAnchor(mode: "middle" | "edges" | undefined, isLeftmost: boolean, isRightmost: boolean): "start" | "middle" | "end";
|
|
2
|
+
export declare function resolveVerticalTickBaseline(mode: "middle" | "edges" | undefined, isTopmost: boolean, isBottommost: boolean): "hanging" | "middle" | "auto";
|
|
3
|
+
export declare function tickPixelExtent(ticks: Array<{
|
|
4
|
+
pixel: number;
|
|
5
|
+
}>): {
|
|
6
|
+
min: number | null;
|
|
7
|
+
max: number | null;
|
|
8
|
+
};
|
|
9
|
+
export declare function resolveGridDash(style: "dashed" | "dotted" | string | undefined): string | undefined;
|
|
10
|
+
export declare function jaggedBaselinePath(orient: "left" | "right" | "top" | "bottom", width: number, height: number): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FrameScheduler } from "../useFrame";
|
|
2
|
+
/**
|
|
3
|
+
* Deterministic rAF scheduler for frame tests. It deliberately permits zero
|
|
4
|
+
* as the first handle so tests cannot rely on truthiness for pending work.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createFrameScheduler(firstHandle?: number): {
|
|
7
|
+
scheduler: FrameScheduler;
|
|
8
|
+
requestedHandles: number[];
|
|
9
|
+
cancelledHandles: number[];
|
|
10
|
+
readonly pendingCount: number;
|
|
11
|
+
flush(timestamp?: number): void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SceneRevisionDiagnostics, type SceneRevisionCheck } from "../sceneRevisionDiagnostics";
|
|
2
|
+
import type { UpdateResult } from "../pipelineUpdateContract";
|
|
3
|
+
export interface UnconsumedSceneRevisionProbe {
|
|
4
|
+
diagnostics: SceneRevisionDiagnostics;
|
|
5
|
+
initial: SceneRevisionCheck;
|
|
6
|
+
later: SceneRevisionCheck;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Assert the contract that a later style/state result cannot conceal scene
|
|
10
|
+
* work that a host has not consumed. Callers finish the probe with
|
|
11
|
+
* `diagnostics.afterCompute(probe.later, false, false)` and assert its warning.
|
|
12
|
+
*/
|
|
13
|
+
export declare function assertUnconsumedSceneRevisionSurvivesLaterUpdate(initialResult: UpdateResult, laterResult: UpdateResult, hostName?: string): UnconsumedSceneRevisionProbe;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared title clearance for StreamFrame plot areas.
|
|
3
|
+
*
|
|
4
|
+
* Stream titles live in the outer SVG chrome while marks are translated into
|
|
5
|
+
* the plot margin. Reserving this strip before layout keeps titles from
|
|
6
|
+
* touching or overlapping the first row of marks when consumers supply a
|
|
7
|
+
* compact top margin.
|
|
8
|
+
*/
|
|
9
|
+
export interface TitleMargin {
|
|
10
|
+
top: number;
|
|
11
|
+
right: number;
|
|
12
|
+
bottom: number;
|
|
13
|
+
left: number;
|
|
14
|
+
}
|
|
15
|
+
/** Enough room for the standard 14px title plus a visible gap to the plot. */
|
|
16
|
+
export declare const MIN_TITLE_TOP_MARGIN = 36;
|
|
17
|
+
/** One horizontal legend row plus its inset when no title is present. */
|
|
18
|
+
export declare const MIN_TOP_LEGEND_MARGIN = 34;
|
|
19
|
+
/** The standard title strip plus one horizontal legend row and plot gap. */
|
|
20
|
+
export declare const MIN_TITLE_TOP_LEGEND_MARGIN = 58;
|
|
21
|
+
/** Baseline that leaves a calm outer-edge inset for the standard title face. */
|
|
22
|
+
export declare const TITLE_BASELINE = 22;
|
|
23
|
+
/** Static SVG and GIF output only render text titles in their SVG chrome. */
|
|
24
|
+
export declare function hasTextTitle(title: unknown): title is string;
|
|
25
|
+
/**
|
|
26
|
+
* Reserve the shared top chrome before any frame calculates plot geometry.
|
|
27
|
+
* A raw StreamFrame can supply both a compact margin and a top legend, so the
|
|
28
|
+
* legend's first row needs its own minimum rather than relying on HOC margins.
|
|
29
|
+
*/
|
|
30
|
+
export declare function reserveFrameChromeMargin<T extends TitleMargin>(margin: T, hasTitle: boolean, hasTopLegend?: boolean): T;
|
|
31
|
+
export declare function reserveTitleMargin<T extends TitleMargin>(margin: T, title: unknown): T;
|
|
@@ -4,27 +4,19 @@ import type { AnimateProp } from "./pipelineTransitionUtils";
|
|
|
4
4
|
import type { LegendGroup, GradientLegendConfig, LegendLayout } from "../types/legendTypes";
|
|
5
5
|
import type { ArrowOfTime, WindowMode, LineStyle, BarStyle, WaterfallStyle, SwarmStyle, HoverAnnotationConfig, HoverData, AnnotationContext, AnnotationAnchorMode } from "../realtime/types";
|
|
6
6
|
import type { Datum } from "../charts/shared/datumTypes";
|
|
7
|
+
import type { HatchFill } from "../charts/shared/hatchFill";
|
|
7
8
|
import type { CoercibleNumber } from "./accessorUtils";
|
|
8
9
|
import type { AutoPlaceAnnotations } from "../recipes/annotationLayout";
|
|
9
10
|
import type { SymbolName } from "./symbolPath";
|
|
10
11
|
import type { GlyphDef } from "./glyphDef";
|
|
12
|
+
import type { SceneRenderMode } from "./sceneRenderBackendTypes";
|
|
13
|
+
import type { StreamSemanticInteractionProps } from "./streamSemanticTypes";
|
|
14
|
+
import type { XYFrameAxisConfig } from "./xyFrameAxisTypes";
|
|
15
|
+
export type { SceneRenderBackend, SceneRenderMode } from "./sceneRenderBackendTypes";
|
|
16
|
+
export type { ThemeSemanticColors } from "./streamThemeTypes";
|
|
17
|
+
export type { AxisTickFormat, AxisTickFormatter, XYFrameAxisConfig } from "./xyFrameAxisTypes";
|
|
11
18
|
export type SceneDatum = Datum | null;
|
|
12
19
|
export type SeriesDatum = Datum[] | null;
|
|
13
|
-
export type AxisTickFormat = ((d: number, index?: number, allTicks?: number[]) => string) | ((d: string, index?: number, allTicks?: number[]) => string) | ((d: Date, index?: number, allTicks?: number[]) => string);
|
|
14
|
-
export interface ThemeSemanticColors {
|
|
15
|
-
primary?: string;
|
|
16
|
-
secondary?: string;
|
|
17
|
-
success?: string;
|
|
18
|
-
danger?: string;
|
|
19
|
-
warning?: string;
|
|
20
|
-
error?: string;
|
|
21
|
-
info?: string;
|
|
22
|
-
text?: string;
|
|
23
|
-
textSecondary?: string;
|
|
24
|
-
border?: string;
|
|
25
|
-
grid?: string;
|
|
26
|
-
surface?: string;
|
|
27
|
-
}
|
|
28
20
|
export interface DecayConfig {
|
|
29
21
|
type: "linear" | "exponential" | "step";
|
|
30
22
|
/** Exponential: half-life in buffer positions (default: bufferSize/2) */
|
|
@@ -105,8 +97,14 @@ export interface Style {
|
|
|
105
97
|
strokeWidth?: number;
|
|
106
98
|
strokeDasharray?: string;
|
|
107
99
|
strokeLinecap?: "butt" | "round" | "square";
|
|
108
|
-
/**
|
|
109
|
-
|
|
100
|
+
/**
|
|
101
|
+
* Fill for the mark. One of:
|
|
102
|
+
* - a color string (or CSS var)
|
|
103
|
+
* - a {@link HatchFill} descriptor (declarative hatch — resolves to a
|
|
104
|
+
* CanvasPattern on canvas and an SVG `<pattern>` on the SSR/overlay path)
|
|
105
|
+
* - a `CanvasPattern` (e.g. a hand-built `createHatchPattern` — canvas only)
|
|
106
|
+
*/
|
|
107
|
+
fill?: string | HatchFill | CanvasPattern;
|
|
110
108
|
fillOpacity?: number;
|
|
111
109
|
opacity?: number;
|
|
112
110
|
/** For icon/isotype bars: an image to stamp instead of filling */
|
|
@@ -578,52 +576,7 @@ export interface BandConfig<T = Datum> {
|
|
|
578
576
|
*/
|
|
579
577
|
interactive?: boolean;
|
|
580
578
|
}
|
|
581
|
-
|
|
582
|
-
* Per-axis configuration object for an XY frame's `axes: []` array.
|
|
583
|
-
* Distinct from `AxisConfig` exported from the HOC layer (which is the
|
|
584
|
-
* chart-level `xLabel` / `yLabel` / `xFormat` / `yFormat` bundle) —
|
|
585
|
-
* this type describes one axis at a time and is what
|
|
586
|
-
* `frameProps.axes[i]` consumes.
|
|
587
|
-
*
|
|
588
|
-
* Re-exported under the legacy name `AxisConfig` from `SVGOverlay.tsx`
|
|
589
|
-
* for backwards-compatibility with internal callers; new code should
|
|
590
|
-
* import this name directly.
|
|
591
|
-
*/
|
|
592
|
-
export interface XYFrameAxisConfig {
|
|
593
|
-
orient: "left" | "right" | "top" | "bottom";
|
|
594
|
-
label?: string;
|
|
595
|
-
ticks?: number;
|
|
596
|
-
/** Per-axis tick label formatter. ReactNode return is supported and
|
|
597
|
-
* renders inside a `<foreignObject>`. */
|
|
598
|
-
tickFormat?: (d: any, index?: number, allTicks?: number[]) => string | ReactNode;
|
|
599
|
-
baseline?: boolean | "under";
|
|
600
|
-
jaggedBase?: boolean;
|
|
601
|
-
/** Explicit tick values. When provided, bypasses both d3's "nice"
|
|
602
|
-
* generator and `axisExtent: "exact"` — the caller has hand-picked
|
|
603
|
-
* the positions. Pixel-distance filtering downstream still drops
|
|
604
|
-
* overlapping labels. Mirrors the ordinal frame's `rTickValues`. */
|
|
605
|
-
tickValues?: Array<number | Date>;
|
|
606
|
-
/** Grid line stroke style: `"dashed"` (6,4), `"dotted"` (2,4), or a
|
|
607
|
-
* custom strokeDasharray string. Applied to grid lines extending
|
|
608
|
-
* from ticks across the chart area. */
|
|
609
|
-
gridStyle?: "dashed" | "dotted" | string;
|
|
610
|
-
/** Always include the domain max as a tick, even if d3 omits it. */
|
|
611
|
-
includeMax?: boolean;
|
|
612
|
-
/** Auto-rotate labels 45° when horizontal spacing is too tight. */
|
|
613
|
-
autoRotate?: boolean;
|
|
614
|
-
/** Highlight ticks at time boundaries (new month, year, etc.) with
|
|
615
|
-
* semibold text. `true` auto-detects Date boundaries. A function
|
|
616
|
-
* receives (value, index) and returns true for landmark ticks. */
|
|
617
|
-
landmarkTicks?: boolean | ((value: any, index: number) => boolean);
|
|
618
|
-
/** Tick label anchoring strategy:
|
|
619
|
-
* - `"middle"` (default): all tick labels centered on the tick mark
|
|
620
|
-
* - `"edges"`: first tick label anchors to start, last to end,
|
|
621
|
-
* middles stay centered. Pairs naturally with `axisExtent: "exact"`
|
|
622
|
-
* — pins the domain to the data min/max AND keeps the extreme
|
|
623
|
-
* labels from overflowing the plot. */
|
|
624
|
-
tickAnchor?: "middle" | "edges";
|
|
625
|
-
}
|
|
626
|
-
export interface StreamXYFrameProps<T = Datum> {
|
|
579
|
+
export interface StreamXYFrameProps<T = Datum> extends StreamSemanticInteractionProps<HoverData> {
|
|
627
580
|
chartType: StreamChartType;
|
|
628
581
|
runtimeMode?: RuntimeMode;
|
|
629
582
|
data?: T[];
|
|
@@ -757,6 +710,8 @@ export interface StreamXYFrameProps<T = Datum> {
|
|
|
757
710
|
};
|
|
758
711
|
className?: string;
|
|
759
712
|
background?: string;
|
|
713
|
+
/** Optional scene paint backend. Exact scene geometry remains interactive. */
|
|
714
|
+
renderMode?: SceneRenderMode<SceneNode>;
|
|
760
715
|
lineStyle?: LineStyle | ((d: T, group?: string) => Style);
|
|
761
716
|
pointStyle?: (d: T) => Style & {
|
|
762
717
|
r?: number;
|
|
@@ -791,8 +746,6 @@ export interface StreamXYFrameProps<T = Datum> {
|
|
|
791
746
|
tickFormatValue?: (value: number) => string;
|
|
792
747
|
hoverAnnotation?: boolean | HoverAnnotationConfig;
|
|
793
748
|
tooltipContent?: (d: HoverData) => ReactNode;
|
|
794
|
-
customHoverBehavior?: (d: HoverData | null) => void;
|
|
795
|
-
customClickBehavior?: (d: HoverData | null) => void;
|
|
796
749
|
enableHover?: boolean;
|
|
797
750
|
/** Max pixel distance for hover/click hit testing. Default 30. */
|
|
798
751
|
hoverRadius?: number;
|
|
@@ -861,6 +814,18 @@ export interface StreamXYFrameProps<T = Datum> {
|
|
|
861
814
|
animate?: AnimateProp;
|
|
862
815
|
/** Frame-level data liveness indicator */
|
|
863
816
|
staleness?: StalenessConfig;
|
|
817
|
+
/** Optional rAF seam for deterministic host scheduling. */
|
|
818
|
+
frameScheduler?: import("./useFrame").FrameScheduler;
|
|
819
|
+
/** Monotonic wall-clock seam for deterministic replay, tests, or evidence capture. */
|
|
820
|
+
clock?: import("./FrameRuntime").FrameClock;
|
|
821
|
+
/** Injectable random source for frame-local stochastic work. */
|
|
822
|
+
random?: import("./FrameRuntime").FrameRandom;
|
|
823
|
+
/** Serializable deterministic random seed. Ignored when `random` is supplied. */
|
|
824
|
+
seed?: number;
|
|
825
|
+
/** Freeze logical animation time and cancel queued work while paused. */
|
|
826
|
+
paused?: boolean;
|
|
827
|
+
/** Freeze logical animation time while the page is hidden. Defaults to true for XY frames. */
|
|
828
|
+
suspendWhenHidden?: boolean;
|
|
864
829
|
/** Marginal distribution plots in axis margins (histogram, violin, ridgeline, boxplot) */
|
|
865
830
|
marginalGraphics?: MarginalGraphicsConfig;
|
|
866
831
|
/** Aggregation mode for streaming heatmap (count, sum, mean) */
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { DependencyList, MutableRefObject, ReactNode, RefObject } from "react";
|
|
3
|
+
import type { FrameMargin, UseFrameResult } from "./useFrame";
|
|
4
|
+
export interface CanvasFrameHostRuntime {
|
|
5
|
+
readonly isActive: boolean;
|
|
6
|
+
subscribe(listener: () => void): () => void;
|
|
7
|
+
}
|
|
8
|
+
export interface CanvasFrameHostStore {
|
|
9
|
+
cancelIntroAnimation?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export interface UseCanvasFrameHostInput<TStore extends object> {
|
|
12
|
+
/** The family-owned store only needs the shared hydration escape hatch. */
|
|
13
|
+
storeRef: RefObject<TStore | null>;
|
|
14
|
+
/** The family-owned retained-scene repaint flag. */
|
|
15
|
+
dirtyRef: MutableRefObject<boolean>;
|
|
16
|
+
/** Stable render closure and scheduler callbacks supplied by `useFrame`. */
|
|
17
|
+
renderFnRef: MutableRefObject<() => void>;
|
|
18
|
+
scheduleRender: () => void;
|
|
19
|
+
cancelRender: () => void;
|
|
20
|
+
/** Logical pause/visibility runtime supplied by `useFrame`. */
|
|
21
|
+
frameRuntime: CanvasFrameHostRuntime;
|
|
22
|
+
/**
|
|
23
|
+
* Opt out only when a family-specific lifecycle adapter must synchronize
|
|
24
|
+
* pause/visibility with an external runtime such as a worker. The default
|
|
25
|
+
* host policy owns ordinary canvas-frame runtime transitions.
|
|
26
|
+
*/
|
|
27
|
+
manageFrameRuntime?: boolean;
|
|
28
|
+
hydrated: boolean;
|
|
29
|
+
wasHydratingFromSSR: boolean;
|
|
30
|
+
/** Family-specific teardown such as clearing a streaming data adapter. */
|
|
31
|
+
cleanup?: () => void;
|
|
32
|
+
/**
|
|
33
|
+
* Some adapters synchronously paint their initial retained scene through a
|
|
34
|
+
* family-specific execution policy. They can skip the otherwise useful
|
|
35
|
+
* mount-time invalidation while retaining dependency-change invalidation.
|
|
36
|
+
*/
|
|
37
|
+
skipInitialCanvasPaintInvalidation?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Values that require a data-canvas repaint. Keep this list family-owned:
|
|
40
|
+
* it expresses paint semantics without teaching the host chart props or
|
|
41
|
+
* layout rules. Its length must remain stable for one host instance.
|
|
42
|
+
*/
|
|
43
|
+
canvasPaintDependencies: DependencyList;
|
|
44
|
+
}
|
|
45
|
+
export interface CanvasFrameHostResult {
|
|
46
|
+
/** Base retained-scene data layer. */
|
|
47
|
+
canvasRef: RefObject<HTMLCanvasElement | null>;
|
|
48
|
+
/** Optional family use for hover/crosshair/highlight canvas content. */
|
|
49
|
+
interactionCanvasRef: RefObject<HTMLCanvasElement | null>;
|
|
50
|
+
}
|
|
51
|
+
type FrameCanvasHost = Pick<UseFrameResult, "renderFnRef" | "scheduleRender" | "cancelRender" | "frameRuntime">;
|
|
52
|
+
type FrameCanvasHostInput<TStore extends object> = Omit<UseCanvasFrameHostInput<TStore>, "renderFnRef" | "scheduleRender" | "cancelRender" | "frameRuntime">;
|
|
53
|
+
/**
|
|
54
|
+
* Installs common canvas-host lifecycle without absorbing family render work.
|
|
55
|
+
*/
|
|
56
|
+
export declare function useCanvasFrameHost<TStore extends object>(input: UseCanvasFrameHostInput<TStore>): CanvasFrameHostResult;
|
|
57
|
+
/** Bind a family-owned store to the common scheduling runtime from useFrame. */
|
|
58
|
+
export declare function useFrameCanvasHost<TStore extends object>(frame: FrameCanvasHost, input: FrameCanvasHostInput<TStore>): CanvasFrameHostResult;
|
|
59
|
+
export interface CanvasFrameBackgroundProps {
|
|
60
|
+
children: ReactNode;
|
|
61
|
+
size: readonly [number, number];
|
|
62
|
+
margin: FrameMargin;
|
|
63
|
+
/** Preserve a family's existing SVG overflow behavior when it needs it. */
|
|
64
|
+
overflowVisible?: boolean;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The shared SVG background layer. Its coordinate translation is common;
|
|
68
|
+
* resolving graphics and choosing their contents remain family-specific.
|
|
69
|
+
*/
|
|
70
|
+
export declare function CanvasFrameBackground({ children, size, margin, overflowVisible, }: CanvasFrameBackgroundProps): React.ReactNode;
|
|
71
|
+
export {};
|
|
@@ -6,6 +6,7 @@ import { resolveAnimateConfig } from "./pipelineTransitionUtils";
|
|
|
6
6
|
import type { AnimateProp } from "./pipelineTransitionUtils";
|
|
7
7
|
import type { TransitionConfig } from "./types";
|
|
8
8
|
import type { HoverPointerCoords } from "./hoverUtils";
|
|
9
|
+
import { FrameRuntime, type FrameClock, type FrameRandom } from "./FrameRuntime";
|
|
9
10
|
/**
|
|
10
11
|
* The small scheduling surface `useFrame` needs. Keeping this separate from
|
|
11
12
|
* the browser global gives hook tests a deterministic, handle-agnostic seam
|
|
@@ -49,6 +50,16 @@ export interface UseFrameInput {
|
|
|
49
50
|
userMargin: Partial<FrameMargin> | undefined;
|
|
50
51
|
/** Frame's family-default margin. Shallow-merged with `userMargin`. */
|
|
51
52
|
marginDefault: FrameMargin;
|
|
53
|
+
/**
|
|
54
|
+
* Visual title rendered by the frame's SVG chrome. A title reserves a small
|
|
55
|
+
* top strip before plot geometry is calculated so compact caller margins do
|
|
56
|
+
* not place marks directly beneath the title.
|
|
57
|
+
*/
|
|
58
|
+
title?: ReactNode;
|
|
59
|
+
/** Optional legend; a top-positioned legend reserves its first row. */
|
|
60
|
+
legend?: unknown;
|
|
61
|
+
/** Legend placement used for shared top-chrome clearance. */
|
|
62
|
+
legendPosition?: "right" | "left" | "top" | "bottom";
|
|
52
63
|
/** Frame's `foregroundGraphics` prop. */
|
|
53
64
|
foregroundGraphics?: FrameGraphicsProp;
|
|
54
65
|
/** Frame's `backgroundGraphics` prop. */
|
|
@@ -63,6 +74,16 @@ export interface UseFrameInput {
|
|
|
63
74
|
* use the browser's `requestAnimationFrame` / `cancelAnimationFrame`.
|
|
64
75
|
*/
|
|
65
76
|
frameScheduler?: FrameScheduler;
|
|
77
|
+
/** Monotonic wall-clock seam used by the frame runtime. */
|
|
78
|
+
clock?: FrameClock;
|
|
79
|
+
/** Injectable random seam. A serializable `seed` takes effect when omitted. */
|
|
80
|
+
random?: FrameRandom;
|
|
81
|
+
/** Serializable deterministic random seed for frame-local stochastic work. */
|
|
82
|
+
seed?: number;
|
|
83
|
+
/** Freeze logical frame time while paused. Opt-in so existing frame families retain their policy. */
|
|
84
|
+
paused?: boolean;
|
|
85
|
+
/** Freeze logical frame time while the document is hidden. Opt-in per frame family. */
|
|
86
|
+
suspendWhenHidden?: boolean;
|
|
66
87
|
/**
|
|
67
88
|
* Frame's `dirtyRef` (the flag that forces a full canvas redraw on the
|
|
68
89
|
* next paint). When provided, useFrame installs a theme-change effect
|
|
@@ -109,6 +130,8 @@ export interface UseFrameResult {
|
|
|
109
130
|
introEnabled: boolean;
|
|
110
131
|
/** Stable id for the AccessibleDataTable region (hash-suffixed). */
|
|
111
132
|
tableId: string;
|
|
133
|
+
/** Shared logical clock, pause/visibility policy, and RNG seam for this host. */
|
|
134
|
+
frameRuntime: FrameRuntime;
|
|
112
135
|
/** Token of the pending rAF, or `null` if none. `0` is a valid token. */
|
|
113
136
|
rafRef: React.MutableRefObject<number | null>;
|
|
114
137
|
/** Frame assigns its render closure here. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type {
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
import type { Datum } from "../charts/shared/datumTypes";
|
|
3
3
|
import { type CategoryDomainAccessor } from "./categoryDomain";
|
|
4
4
|
/** Keep legend-category callbacks stable while reading the latest frame props. */
|
|
5
|
-
export declare function useLegendCategoryEmission(storeRef: RefObject<
|
|
5
|
+
export declare function useLegendCategoryEmission<TStore extends object, TDatum extends Datum = Datum>(storeRef: RefObject<TStore | null>, accessor: CategoryDomainAccessor<TDatum> | undefined, onChange: ((categories: string[]) => void) | undefined, readData: (store: TStore) => TDatum[]): () => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Datum } from "../charts/shared/datumTypes";
|
|
2
|
+
import { type SemanticClickBehavior, type SemanticHoverBehavior, type SemanticInteractionContext } from "../charts/shared/semanticInteractions";
|
|
3
|
+
import type { OnObservationCallback } from "../store/ObservationStore";
|
|
4
|
+
interface HoverLike {
|
|
5
|
+
data?: Datum | null;
|
|
6
|
+
x?: number;
|
|
7
|
+
y?: number;
|
|
8
|
+
}
|
|
9
|
+
interface SemanticFrameInteractionOptions<Hover extends HoverLike> {
|
|
10
|
+
customHoverBehavior?: SemanticHoverBehavior<Hover>;
|
|
11
|
+
customClickBehavior?: SemanticClickBehavior<Hover>;
|
|
12
|
+
onObservation?: OnObservationCallback;
|
|
13
|
+
chartId?: string;
|
|
14
|
+
chartType: string;
|
|
15
|
+
}
|
|
16
|
+
/** Add semantic observations around the legacy Stream Frame callbacks. */
|
|
17
|
+
export declare function useSemanticFrameInteractions<Hover extends HoverLike>({ customHoverBehavior: customHoverBehaviorProp, customClickBehavior: customClickBehaviorProp, onObservation, chartId, chartType }: SemanticFrameInteractionOptions<Hover>): {
|
|
18
|
+
customHoverBehavior: (hover: Hover | null, context?: SemanticInteractionContext) => void;
|
|
19
|
+
customClickBehavior: (hover: Hover | null, context?: SemanticInteractionContext) => void;
|
|
20
|
+
hasClickBehavior: boolean;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { UpdateResult, UpdateResultStore } from "./pipelineUpdateContract";
|
|
2
|
+
/**
|
|
3
|
+
* Read an additive pipeline update snapshot through React's external-store
|
|
4
|
+
* contract. Store mutation and frame scheduling remain imperative; consumers
|
|
5
|
+
* can use this only for React-owned inspection or diagnostics.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useUpdateResultSnapshot(store: UpdateResultStore): UpdateResult;
|