semiotic 3.7.4 → 3.7.5
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 +10 -7
- package/README.md +36 -19
- package/ai/schema.json +221 -1
- package/ai/system-prompt.md +2 -1
- package/dist/components/Annotation.d.ts +4 -0
- package/dist/components/DataSummaryContext.d.ts +1 -0
- package/dist/components/ai/chartCapabilityTypes.d.ts +16 -0
- package/dist/components/ai/dataPitfallsBridge.d.ts +101 -0
- package/dist/components/ai/dataQualityBridge.d.ts +201 -0
- package/dist/components/ai/describeChart.d.ts +2 -0
- package/dist/components/ai/generativeChart.d.ts +145 -0
- package/dist/components/charts/custom/NetworkCustomChart.d.ts +14 -1
- package/dist/components/charts/ordinal/SwarmPlot.d.ts +7 -0
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +21 -0
- package/dist/components/charts/realtime/aggregate.d.ts +51 -0
- package/dist/components/charts/realtime/eventTime.d.ts +26 -0
- package/dist/components/charts/shared/colorPalettes.d.ts +2 -0
- package/dist/components/charts/shared/colorUtils.d.ts +1 -12
- package/dist/components/charts/shared/minMax.d.ts +3 -0
- package/dist/components/charts/shared/radialGeometry.d.ts +0 -18
- package/dist/components/charts/shared/smartTooltip.d.ts +27 -0
- package/dist/components/charts/shared/statisticalOverlays.d.ts +35 -0
- package/dist/components/charts/shared/tooltipUtils.d.ts +2 -0
- package/dist/components/charts/shared/useChartSetup.d.ts +1 -1
- package/dist/components/charts/shared/useCustomChartSetup.d.ts +1 -1
- package/dist/components/charts/shared/validateChartData.d.ts +1 -1
- package/dist/components/charts/xy/Scatterplot.d.ts +9 -0
- package/dist/components/data/fromArrow.d.ts +54 -0
- package/dist/components/data/fromMermaid.d.ts +47 -0
- package/dist/components/data/fromObservablePlot.d.ts +69 -0
- package/dist/components/data/portability/index.d.ts +14 -0
- package/dist/components/data/portability/spec.d.ts +129 -0
- package/dist/components/data/portability/vegaLite.d.ts +62 -0
- package/dist/components/realtime/ReorderBuffer.d.ts +54 -0
- package/dist/components/realtime/RunningStats.d.ts +66 -0
- package/dist/components/realtime/WindowAccumulator.d.ts +105 -0
- package/dist/components/realtime/parseWindowDuration.d.ts +12 -0
- package/dist/components/recipes/customTooltip.d.ts +31 -0
- package/dist/components/recipes/gofish.d.ts +207 -0
- package/dist/components/recipes/gofishBoba.d.ts +23 -0
- package/dist/components/recipes/gofishIR.d.ts +169 -0
- package/dist/components/recipes/gofishIRExamples.d.ts +89 -0
- package/dist/components/recipes/gofishInterpreter.d.ts +52 -0
- package/dist/components/recipes/gofishLambdas.d.ts +145 -0
- package/dist/components/recipes/mermaidDag.d.ts +44 -0
- package/dist/components/recipes/packedClusterMatrix.d.ts +166 -0
- package/dist/components/recipes/recipeChrome.d.ts +100 -0
- package/dist/components/recipes/recipeLegend.d.ts +57 -0
- package/dist/components/recipes/recipeUtils.d.ts +105 -0
- package/dist/components/semiotic-ai.d.ts +6 -0
- package/dist/components/semiotic-data.d.ts +2 -0
- package/dist/components/semiotic-experimental.d.ts +20 -0
- package/dist/components/semiotic-network.d.ts +3 -1
- package/dist/components/semiotic-ordinal.d.ts +2 -0
- package/dist/components/semiotic-realtime.d.ts +9 -1
- package/dist/components/semiotic-recipes.d.ts +18 -1
- package/dist/components/semiotic-themes.d.ts +2 -0
- package/dist/components/semiotic-xy.d.ts +2 -0
- package/dist/components/semiotic.d.ts +4 -0
- package/dist/components/store/ObservationStore.d.ts +21 -2
- package/dist/components/store/SelectionStore.d.ts +1 -1
- package/dist/components/store/ThemeStore.d.ts +1 -1
- package/dist/components/store/TooltipStore.d.ts +1 -1
- package/dist/components/store/createStore.d.ts +1 -1
- package/dist/components/store/designTokens.d.ts +15 -0
- package/dist/components/stream/NetworkHtmlMarksLayer.d.ts +44 -0
- package/dist/components/stream/NetworkPipelineStore.d.ts +32 -0
- package/dist/components/stream/NetworkSVGOverlay.d.ts +12 -0
- package/dist/components/stream/OrdinalPipelineStore.d.ts +18 -0
- package/dist/components/stream/PipelineStore.d.ts +27 -0
- package/dist/components/stream/SceneGraph.d.ts +5 -1
- package/dist/components/stream/customLayout.d.ts +20 -0
- package/dist/components/stream/customLayoutDiagnostics.d.ts +11 -0
- package/dist/components/stream/customLayoutSelection.d.ts +52 -0
- package/dist/components/stream/networkCustomLayout.d.ts +66 -1
- package/dist/components/stream/networkTypes.d.ts +29 -1
- package/dist/components/stream/ordinalCustomLayout.d.ts +17 -1
- package/dist/components/stream/ordinalSceneBuilders/types.d.ts +2 -0
- package/dist/components/stream/ordinalTypes.d.ts +19 -3
- package/dist/components/stream/renderers/networkSymbolRenderer.d.ts +2 -0
- package/dist/components/stream/renderers/symbolCanvasRenderer.d.ts +2 -0
- package/dist/components/stream/stalenessBands.d.ts +28 -0
- package/dist/components/stream/symbolPath.d.ts +24 -0
- package/dist/components/stream/types.d.ts +72 -3
- package/dist/components/stream/useStalenessCheck.d.ts +6 -1
- package/dist/components/stream/xySceneBuilders/pointScene.d.ts +2 -2
- package/dist/components/stream/xySceneBuilders/types.d.ts +5 -0
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/semiotic-ai-semiotic-ai-u954ylUn.js +2 -0
- package/dist/semiotic-ai-statisticalOverlays-CU7jW05Q.js +1 -0
- package/dist/semiotic-ai.d.ts +6 -0
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-data.d.ts +2 -0
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-experimental.d.ts +20 -0
- package/dist/semiotic-experimental.min.js +1 -0
- package/dist/semiotic-experimental.module.min.js +1 -0
- package/dist/semiotic-network.d.ts +3 -1
- package/dist/semiotic-ordinal.d.ts +2 -0
- package/dist/semiotic-realtime.d.ts +9 -1
- package/dist/semiotic-recipes.d.ts +18 -1
- package/dist/semiotic-recipes.min.js +1 -1
- package/dist/semiotic-recipes.module.min.js +1 -1
- package/dist/semiotic-semiotic-BmrYbi99.js +2 -0
- package/dist/semiotic-statisticalOverlays-IjZw8Lsu.js +1 -0
- package/dist/semiotic-themes.d.ts +2 -0
- package/dist/semiotic-themes.min.js +1 -1
- package/dist/semiotic-themes.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 +2 -0
- package/dist/semiotic.d.ts +4 -0
- 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-semiotic-xy-Dufu3D0-.js +2 -0
- package/dist/xy-statisticalOverlays-3Ni9bRph.js +1 -0
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +11 -3
- package/dist/semiotic-ai-statisticalOverlays-C2PPlmXv.js +0 -1
- package/dist/semiotic-statisticalOverlays-C3DsOgr_.js +0 -1
- package/dist/xy-statisticalOverlays-C2PPlmXv.js +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Experimental entry point for temporary adapters and unstable previews.
|
|
3
|
+
*
|
|
4
|
+
* Anything imported from "semiotic/experimental" is intentionally outside
|
|
5
|
+
* Semiotic's stable public API. Exports may be renamed, moved, or removed
|
|
6
|
+
* without a deprecation window and are excluded from stable API-surface and
|
|
7
|
+
* bundle-size gates.
|
|
8
|
+
*/
|
|
9
|
+
export { EXPERIMENTAL_GOFISH_ADAPTER_NAME, unstable_fromGofishIR, } from "./recipes/gofishIR";
|
|
10
|
+
export type { GofishIRDocument as UnstableGofishIRDocument, GofishChartConfig as UnstableGofishChartConfig, GofishChartFamily as UnstableGofishChartFamily, FromGofishIROptions as UnstableFromGofishIROptions, } from "./recipes/gofishIR";
|
|
11
|
+
export { registerGofishLambda as unstable_registerGofishLambda, unregisterGofishLambda as unstable_unregisterGofishLambda, } from "./recipes/gofishLambdas";
|
|
12
|
+
export type { GofishLambda as UnstableGofishLambda, } from "./recipes/gofishLambdas";
|
|
13
|
+
export { gofishIRExamples as unstable_gofishIRExamples, flowerIR as unstable_gofishFlowerIR, bottleIR as unstable_gofishBottleIR, polarRibbonIR as unstable_gofishPolarRibbonIR, titanicCircleTreemapIR as unstable_gofishTitanicCircleTreemapIR, pythonMemoryIR as unstable_gofishPythonMemoryIR, bobaIR as unstable_gofishBobaIR, } from "./recipes/gofishIRExamples";
|
|
14
|
+
export type { GofishIRExample as UnstableGofishIRExample } from "./recipes/gofishIRExamples";
|
|
15
|
+
export { IDID_SPEC_VERSION, BUILTIN_INTENT_IDS as unstable_BUILTIN_INTENT_IDS, validatePortableCapability as unstable_validatePortableCapability, validatePortableAudienceProfile as unstable_validatePortableAudienceProfile, validatePortableAnnotation as unstable_validatePortableAnnotation, toVegaLite as unstable_toVegaLite, attachIDID as unstable_attachIDID, readIDID as unstable_readIDID, attachIDIDAnnotations as unstable_attachIDIDAnnotations, readIDIDAnnotations as unstable_readIDIDAnnotations, } from "./data/portability";
|
|
16
|
+
export { fromObservablePlot as unstable_fromObservablePlot } from "./data/fromObservablePlot";
|
|
17
|
+
export { fromMermaid as unstable_fromMermaid } from "./data/fromMermaid";
|
|
18
|
+
export type { MermaidResult as UnstableMermaidResult, MermaidNode as UnstableMermaidNode, MermaidEdge as UnstableMermaidEdge, MermaidDirection as UnstableMermaidDirection, MermaidNodeShape as UnstableMermaidNodeShape, } from "./data/fromMermaid";
|
|
19
|
+
export type { ObservablePlotSpec as UnstableObservablePlotSpec, ObservablePlotMark as UnstableObservablePlotMark, ObservablePlotMarkOptions as UnstableObservablePlotMarkOptions, ObservablePlotScale as UnstableObservablePlotScale, ObservablePlotChannel as UnstableObservablePlotChannel, } from "./data/fromObservablePlot";
|
|
20
|
+
export type { BuiltInIntentId as UnstableBuiltInIntentId, PortableIntentId as UnstablePortableIntentId, PortableChartRubric as UnstablePortableChartRubric, PortableChartVariant as UnstablePortableChartVariant, PortableChartCapability as UnstablePortableChartCapability, PortableReceptionModality as UnstablePortableReceptionModality, PortableAudienceTarget as UnstablePortableAudienceTarget, PortableAudienceProfile as UnstablePortableAudienceProfile, PortableAnnotationProvenance as UnstablePortableAnnotationProvenance, PortableAnnotationLifecycle as UnstablePortableAnnotationLifecycle, PortableAnnotated as UnstablePortableAnnotated, ValidationResult as UnstablePortabilityValidationResult, IDIDVegaLiteMeta as UnstableIDIDVegaLiteMeta, } from "./data/portability";
|
|
@@ -13,6 +13,8 @@ export { CirclePack } from "./charts/network/CirclePack";
|
|
|
13
13
|
export { OrbitDiagram } from "./charts/network/OrbitDiagram";
|
|
14
14
|
export { ProcessSankey } from "./charts/network/ProcessSankey";
|
|
15
15
|
export { NetworkCustomChart } from "./charts/custom/NetworkCustomChart";
|
|
16
|
+
export { useCustomLayoutSelection } from "./stream/customLayoutSelection";
|
|
17
|
+
export type { CustomLayoutSelection } from "./stream/customLayoutSelection";
|
|
16
18
|
export type { StreamNetworkFrameProps, StreamNetworkFrameHandle, NetworkChartType, NetworkSceneNode, NetworkSceneEdge, NetworkLabel, ThresholdAlertConfig } from "./stream/networkTypes";
|
|
17
19
|
export type { ForceDirectedGraphProps } from "./charts/network/ForceDirectedGraph";
|
|
18
20
|
export type { SankeyDiagramProps } from "./charts/network/SankeyDiagram";
|
|
@@ -23,6 +25,6 @@ export type { TreemapProps } from "./charts/network/Treemap";
|
|
|
23
25
|
export type { CirclePackProps } from "./charts/network/CirclePack";
|
|
24
26
|
export type { OrbitDiagramProps } from "./charts/network/OrbitDiagram";
|
|
25
27
|
export type { NetworkCustomChartProps } from "./charts/custom/NetworkCustomChart";
|
|
26
|
-
export type { NetworkCustomLayout, NetworkLayoutContext, NetworkLayoutResult, } from "./stream/networkCustomLayout";
|
|
28
|
+
export type { NetworkCustomLayout, NetworkLayoutContext, NetworkLayoutResult, NetworkHtmlMark, } from "./stream/networkCustomLayout";
|
|
27
29
|
export { validateProcessSankey, formatProcessSankeyIssue, } from "./charts/network/processSankey/algorithm";
|
|
28
30
|
export type { ProcessSankeyNode as ProcessSankeyValidatorNode, ProcessSankeyEdge as ProcessSankeyValidatorEdge, ProcessSankeyIssue, } from "./charts/network/processSankey/algorithm";
|
|
@@ -21,6 +21,8 @@ export { RidgelinePlot } from "./charts/ordinal/RidgelinePlot";
|
|
|
21
21
|
export { FunnelChart } from "./charts/ordinal/FunnelChart";
|
|
22
22
|
export { LikertChart } from "./charts/ordinal/LikertChart";
|
|
23
23
|
export { OrdinalCustomChart } from "./charts/custom/OrdinalCustomChart";
|
|
24
|
+
export { useCustomLayoutSelection } from "./stream/customLayoutSelection";
|
|
25
|
+
export type { CustomLayoutSelection } from "./stream/customLayoutSelection";
|
|
24
26
|
export { createHatchPattern } from "./charts/shared/hatchPattern";
|
|
25
27
|
export type { HatchPatternOptions } from "./charts/shared/hatchPattern";
|
|
26
28
|
export type { StreamOrdinalFrameProps, StreamOrdinalFrameHandle, OrdinalChartType, OrdinalScales, OrdinalSceneNode } from "./stream/ordinalTypes";
|
|
@@ -6,12 +6,20 @@ import StreamXYFrame from "./stream/StreamXYFrame";
|
|
|
6
6
|
import StreamNetworkFrame from "./stream/StreamNetworkFrame";
|
|
7
7
|
import { RingBuffer } from "./realtime/RingBuffer";
|
|
8
8
|
import { IncrementalExtent } from "./realtime/IncrementalExtent";
|
|
9
|
+
import { RunningStats } from "./realtime/RunningStats";
|
|
10
|
+
import { WindowAccumulator, statValue, bandBounds } from "./realtime/WindowAccumulator";
|
|
11
|
+
import { parseWindowDuration } from "./realtime/parseWindowDuration";
|
|
12
|
+
import { ReorderBuffer } from "./realtime/ReorderBuffer";
|
|
9
13
|
import { RealtimeLineChart } from "./charts/realtime/RealtimeLineChart";
|
|
10
14
|
import { RealtimeHistogram, TemporalHistogram } from "./charts/realtime/RealtimeHistogram";
|
|
11
15
|
import { RealtimeSwarmChart } from "./charts/realtime/RealtimeSwarmChart";
|
|
12
16
|
import { RealtimeWaterfallChart } from "./charts/realtime/RealtimeWaterfallChart";
|
|
13
17
|
import { RealtimeHeatmap } from "./charts/realtime/RealtimeHeatmap";
|
|
14
|
-
export { StreamXYFrame, StreamNetworkFrame, RingBuffer, IncrementalExtent, RealtimeLineChart, RealtimeHistogram, TemporalHistogram, RealtimeSwarmChart, RealtimeWaterfallChart, RealtimeHeatmap };
|
|
18
|
+
export { StreamXYFrame, StreamNetworkFrame, RingBuffer, IncrementalExtent, RunningStats, WindowAccumulator, statValue, bandBounds, parseWindowDuration, ReorderBuffer, RealtimeLineChart, RealtimeHistogram, TemporalHistogram, RealtimeSwarmChart, RealtimeWaterfallChart, RealtimeHeatmap };
|
|
19
|
+
export type { WindowType, AggregateStat, AggregateBand, WindowAccumulatorConfig, AggregatedWindow, } from "./realtime/WindowAccumulator";
|
|
20
|
+
export type { AggregateConfig } from "./charts/realtime/aggregate";
|
|
21
|
+
export type { LatePolicy, ReorderBufferConfig, ReorderResult, } from "./realtime/ReorderBuffer";
|
|
22
|
+
export type { EventTimeConfig } from "./charts/realtime/eventTime";
|
|
15
23
|
export type { RealtimeLineChartProps } from "./charts/realtime/RealtimeLineChart";
|
|
16
24
|
export type { RealtimeHistogramProps, TemporalHistogramProps } from "./charts/realtime/RealtimeHistogram";
|
|
17
25
|
export type { RealtimeSwarmChartProps } from "./charts/realtime/RealtimeSwarmChart";
|
|
@@ -15,6 +15,10 @@ export { dagreLayout } from "./recipes/dagre";
|
|
|
15
15
|
export type { DagreConfig } from "./recipes/dagre";
|
|
16
16
|
export { lineageDagLayout } from "./recipes/lineageDag";
|
|
17
17
|
export type { LineageDagConfig, LineageLod, LineageStoreSlot } from "./recipes/lineageDag";
|
|
18
|
+
export { mermaidDagLayout } from "./recipes/mermaidDag";
|
|
19
|
+
export type { MermaidDagConfig } from "./recipes/mermaidDag";
|
|
20
|
+
export { packedClusterMatrix } from "./recipes/packedClusterMatrix";
|
|
21
|
+
export type { PackedClusterMatrixConfig } from "./recipes/packedClusterMatrix";
|
|
18
22
|
export { marimekkoLayout } from "./recipes/marimekko";
|
|
19
23
|
export type { MarimekkoConfig } from "./recipes/marimekko";
|
|
20
24
|
export { bulletLayout } from "./recipes/bullet";
|
|
@@ -26,5 +30,18 @@ export type { AnnotationLayoutConfig, AnnotationLayoutOptions, AutoPlaceAnnotati
|
|
|
26
30
|
export { annotationDensity, annotationBudget, DEFAULT_AREA_PER_ANNOTATION } from "./recipes/annotationDensity";
|
|
27
31
|
export type { AnnotationDensityConfig, AnnotationDensityOptions, AnnotationDensityResult, } from "./recipes/annotationDensity";
|
|
28
32
|
export type { CustomLayout, LayoutContext, LayoutResult, } from "./stream/customLayout";
|
|
29
|
-
export type { NetworkCustomLayout, NetworkLayoutContext, NetworkLayoutResult, } from "./stream/networkCustomLayout";
|
|
33
|
+
export type { NetworkCustomLayout, NetworkLayoutContext, NetworkLayoutResult, NetworkHtmlMark, } from "./stream/networkCustomLayout";
|
|
30
34
|
export type { OrdinalCustomLayout, OrdinalLayoutContext, OrdinalLayoutResult, } from "./stream/ordinalCustomLayout";
|
|
35
|
+
export { shade, makeShade, readField, groupBy } from "./recipes/recipeUtils";
|
|
36
|
+
export { dimFor, matchesHighlight, signatureKey, LayoutCache } from "./recipes/recipeUtils";
|
|
37
|
+
export type { DimOptions, HighlightMatch } from "./recipes/recipeUtils";
|
|
38
|
+
export { symbolPathString, symbolRadius, symbolExtent, SYMBOL_SEQUENCE } from "./stream/symbolPath";
|
|
39
|
+
export type { NetworkSymbolName } from "./stream/symbolPath";
|
|
40
|
+
export { roundedEnclosure, boundsOf, bandLabel, markCallout } from "./recipes/recipeChrome";
|
|
41
|
+
export type { RoundedEnclosureProps, BandLabelProps, MarkCalloutProps, CalloutConnector, } from "./recipes/recipeChrome";
|
|
42
|
+
export { legendGroupsFrom } from "./recipes/recipeLegend";
|
|
43
|
+
export type { LegendGroupsInput } from "./recipes/recipeLegend";
|
|
44
|
+
export { useCustomLayoutSelection } from "./stream/customLayoutSelection";
|
|
45
|
+
export type { CustomLayoutSelection } from "./stream/customLayoutSelection";
|
|
46
|
+
export { buildTooltipEntries, extractTooltipDatum, formatTooltipValue, } from "./recipes/customTooltip";
|
|
47
|
+
export type { CustomTooltipEntry, CustomTooltipEntryOptions, } from "./recipes/customTooltip";
|
|
@@ -79,3 +79,5 @@ export declare function themeToCSS(theme: SemioticTheme, selector?: string): str
|
|
|
79
79
|
* ```
|
|
80
80
|
*/
|
|
81
81
|
export declare function themeToTokens(theme: SemioticTheme): Datum;
|
|
82
|
+
export { designTokensToTheme } from "./store/designTokens";
|
|
83
|
+
export type { DesignTokensToThemeOptions } from "./store/designTokens";
|
|
@@ -18,6 +18,8 @@ export { QuadrantChart } from "./charts/xy/QuadrantChart";
|
|
|
18
18
|
export { MultiAxisLineChart } from "./charts/xy/MultiAxisLineChart";
|
|
19
19
|
export { CandlestickChart } from "./charts/xy/CandlestickChart";
|
|
20
20
|
export { XYCustomChart } from "./charts/custom/XYCustomChart";
|
|
21
|
+
export { useCustomLayoutSelection } from "./stream/customLayoutSelection";
|
|
22
|
+
export type { CustomLayoutSelection } from "./stream/customLayoutSelection";
|
|
21
23
|
export type { StreamXYFrameProps, StreamXYFrameHandle } from "./stream/types";
|
|
22
24
|
export type { CustomLayout, LayoutContext, LayoutResult } from "./stream/customLayout";
|
|
23
25
|
export type { LineChartProps } from "./charts/xy/LineChart";
|
|
@@ -33,6 +33,8 @@ export type { StreamNetworkFrameProps, StreamNetworkFrameHandle, NetworkChartTyp
|
|
|
33
33
|
export type { SelectionConfig, LinkedHoverProp, LinkedBrushProp } from "./charts/shared/types";
|
|
34
34
|
export type { LinkedChartsProps } from "./LinkedCharts";
|
|
35
35
|
export { useSelection, useSelectionActions, useLinkedHover, useBrushSelection, useFilteredData } from "./LinkedCharts";
|
|
36
|
+
export { useCustomLayoutSelection } from "./stream/customLayoutSelection";
|
|
37
|
+
export type { CustomLayoutSelection } from "./stream/customLayoutSelection";
|
|
36
38
|
export type { UseSelectionOptions, UseSelectionResult, UseSelectionActionsResult, UseLinkedHoverOptions, UseLinkedHoverResult, UseBrushSelectionOptions, UseBrushSelectionResult } from "./LinkedCharts";
|
|
37
39
|
export { useChartObserver } from "./LinkedCharts";
|
|
38
40
|
export type { UseChartObserverOptions, UseChartObserverResult } from "./LinkedCharts";
|
|
@@ -62,6 +64,8 @@ export type { HatchPatternOptions } from "./charts/shared/hatchPattern";
|
|
|
62
64
|
export { smartTickFormat, adaptiveTimeTicks } from "./charts/shared/formatUtils";
|
|
63
65
|
export { darkenColor, lightenColor } from "./charts/shared/colorManipulation";
|
|
64
66
|
export type { TooltipProp, TooltipConfig, TooltipField, MultiLineTooltipConfig } from "./Tooltip/Tooltip";
|
|
67
|
+
export { smartTooltipEntries } from "./charts/shared/tooltipUtils";
|
|
68
|
+
export type { SmartTooltipEntry, SmartTooltipResult } from "./charts/shared/tooltipUtils";
|
|
65
69
|
export type { ArrowOfTime, WindowMode, ThresholdType, LineStyle, BarStyle, WaterfallStyle, SwarmStyle, AnnotationContext, AnnotationAnchorMode, CrosshairStyle, HoverAnnotationConfig, HoverData } from "./realtime/types";
|
|
66
70
|
export type { RealtimeLineChartProps } from "./charts/realtime/RealtimeLineChart";
|
|
67
71
|
export type { RealtimeTemporalHistogramProps, RealtimeHistogramProps, TemporalHistogramProps } from "./charts/realtime/RealtimeHistogram";
|
|
@@ -45,7 +45,26 @@ export interface ClickObservation extends ObservationBase {
|
|
|
45
45
|
export interface ClickEndObservation extends ObservationBase {
|
|
46
46
|
type: "click-end";
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Emitted when an event-time stream receives a record outside its
|
|
50
|
+
* lateness/grace window (see `ReorderBuffer`). Surfaces lateness as an
|
|
51
|
+
* observable signal — for stream diagnostics — rather than silently
|
|
52
|
+
* dropping it.
|
|
53
|
+
*/
|
|
54
|
+
export interface LateDataObservation extends ObservationBase {
|
|
55
|
+
type: "late-data";
|
|
56
|
+
/** The late datum that arrived outside the grace window. */
|
|
57
|
+
datum: Datum;
|
|
58
|
+
/** Event-time of the late datum. */
|
|
59
|
+
eventTime: number;
|
|
60
|
+
/** Watermark (largest event-time seen) when it arrived. */
|
|
61
|
+
watermark: number;
|
|
62
|
+
/** Whether it was dropped or kept, per the late policy. */
|
|
63
|
+
policy: "drop" | "keep";
|
|
64
|
+
/** Running total of late events seen on this chart. */
|
|
65
|
+
lateCount: number;
|
|
66
|
+
}
|
|
67
|
+
export type ChartObservation = HoverObservation | HoverEndObservation | BrushObservation | BrushEndObservation | SelectionObservation | SelectionEndObservation | ClickObservation | ClickEndObservation | LateDataObservation;
|
|
49
68
|
export type OnObservationCallback = (observation: ChartObservation) => void;
|
|
50
69
|
export interface ObservationStoreState {
|
|
51
70
|
/** Ring buffer of recent observations (newest last). Mutated in place for perf. */
|
|
@@ -56,5 +75,5 @@ export interface ObservationStoreState {
|
|
|
56
75
|
pushObservation: (observation: ChartObservation) => void;
|
|
57
76
|
clearObservations: () => void;
|
|
58
77
|
}
|
|
59
|
-
export declare const ObservationProvider: import("react").FC<import("./createStore").StoreProviderProps<ObservationStoreState>>, useObservationSelector: <R>(selector: (state: ObservationStoreState) => R) => R;
|
|
78
|
+
export declare const ObservationProvider: import("react").FC<import("./createStore").StoreProviderProps<ObservationStoreState>>, useObservationSelector: <R>(selector: (state: ObservationStoreState) => R, equalityFn?: ((a: R, b: R) => boolean) | undefined) => R;
|
|
60
79
|
export {};
|
|
@@ -27,4 +27,4 @@ export interface SelectionStoreState {
|
|
|
27
27
|
clearSelection: (selectionName: string) => void;
|
|
28
28
|
}
|
|
29
29
|
export declare function buildPredicate(selection: Selection, requestingClientId?: string): (d: Datum) => boolean;
|
|
30
|
-
export declare const SelectionProvider: import("react").FC<import("./createStore").StoreProviderProps<SelectionStoreState>>, useSelectionSelector: <R>(selector: (state: SelectionStoreState) => R) => R;
|
|
30
|
+
export declare const SelectionProvider: import("react").FC<import("./createStore").StoreProviderProps<SelectionStoreState>>, useSelectionSelector: <R>(selector: (state: SelectionStoreState) => R, equalityFn?: ((a: R, b: R) => boolean) | undefined) => R;
|
|
@@ -100,4 +100,4 @@ export type SemioticThemeUpdate = Omit<Partial<SemioticTheme>, "colors" | "typog
|
|
|
100
100
|
};
|
|
101
101
|
export type ThemeStoreUpdate = SemioticThemeUpdate | "light" | "dark" | "high-contrast";
|
|
102
102
|
export declare function resolveThemeUpdate(current: SemioticTheme, theme: ThemeStoreUpdate): SemioticTheme;
|
|
103
|
-
export declare const ThemeProvider: import("react").FC<import("./createStore").StoreProviderProps<ThemeStoreState>>, useThemeSelector: <R>(selector: (state: ThemeStoreState) => R) => R;
|
|
103
|
+
export declare const ThemeProvider: import("react").FC<import("./createStore").StoreProviderProps<ThemeStoreState>>, useThemeSelector: <R>(selector: (state: ThemeStoreState) => R, equalityFn?: ((a: R, b: R) => boolean) | undefined) => R;
|
|
@@ -2,5 +2,5 @@ interface TooltipStoreState {
|
|
|
2
2
|
tooltip: unknown;
|
|
3
3
|
changeTooltip: (tooltip: unknown) => void;
|
|
4
4
|
}
|
|
5
|
-
declare const TooltipProvider: import("react").FC<import("./createStore").StoreProviderProps<TooltipStoreState>>, useTooltip: <R>(selector: (state: TooltipStoreState) => R) => R;
|
|
5
|
+
declare const TooltipProvider: import("react").FC<import("./createStore").StoreProviderProps<TooltipStoreState>>, useTooltip: <R>(selector: (state: TooltipStoreState) => R, equalityFn?: ((a: R, b: R) => boolean) | undefined) => R;
|
|
6
6
|
export { TooltipProvider, useTooltip };
|
|
@@ -3,4 +3,4 @@ export interface StoreProviderProps<T> {
|
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
initialState?: Partial<T>;
|
|
5
5
|
}
|
|
6
|
-
export declare function createStore<T>(fn: (set: (updater: (current: T) => Partial<T>) => void) => T): [React.FC<StoreProviderProps<T>>, <R>(selector: (state: T) => R) => R];
|
|
6
|
+
export declare function createStore<T>(fn: (set: (updater: (current: T) => Partial<T>) => void) => T): [React.FC<StoreProviderProps<T>>, <R>(selector: (state: T) => R, equalityFn?: (a: R, b: R) => boolean) => R];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Datum } from "../charts/shared/datumTypes";
|
|
2
|
+
import type { SemioticTheme } from "./ThemeStore";
|
|
3
|
+
type ColorRole = "primary" | "secondary" | "background" | "surface" | "text" | "textSecondary" | "border" | "grid" | "focus" | "annotation" | "success" | "danger" | "warning" | "error" | "info";
|
|
4
|
+
export interface DesignTokensToThemeOptions {
|
|
5
|
+
/** Theme to merge resolved roles onto. Defaults to LIGHT/DARK by detected bg. */
|
|
6
|
+
base?: SemioticTheme;
|
|
7
|
+
/** Pin a role to a token path, e.g. `{ primary: "color.brand.500" }`. */
|
|
8
|
+
mapping?: Partial<Record<ColorRole | "fontFamily" | "categorical", string>>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Build a `SemioticTheme` from a W3C Design Tokens object. Inverse of
|
|
12
|
+
* `themeToTokens`; round-trips exactly for tokens under a `semiotic.*` group.
|
|
13
|
+
*/
|
|
14
|
+
export declare function designTokensToTheme(tokens: Datum, options?: DesignTokensToThemeOptions): SemioticTheme;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { NetworkHtmlMark } from "./networkCustomLayout";
|
|
3
|
+
import type { CustomLayoutSelection } from "./customLayoutSelection";
|
|
4
|
+
export interface NetworkHtmlMarksLayerProps {
|
|
5
|
+
/** Marks emitted by the custom layout (`NetworkLayoutResult.htmlMarks`). */
|
|
6
|
+
marks: NetworkHtmlMark[] | undefined;
|
|
7
|
+
/** The frame's margin — the layer is offset by it so marks align with the
|
|
8
|
+
* canvas and SVG `overlays`, which translate their content by the same. */
|
|
9
|
+
margin: {
|
|
10
|
+
top: number;
|
|
11
|
+
left: number;
|
|
12
|
+
};
|
|
13
|
+
/** Shared-selection projection, provided so mark content can subscribe via
|
|
14
|
+
* `useCustomLayoutSelection()` and restyle on selection change without a
|
|
15
|
+
* relayout (parity with the SVG `overlays` subtree). `null` when unwired. */
|
|
16
|
+
selection?: CustomLayoutSelection | null;
|
|
17
|
+
/**
|
|
18
|
+
* Pixels beyond each visible edge of the scrolling viewport for which marks are
|
|
19
|
+
* still mounted (so a scroll reveals already-present DOM, not blank space).
|
|
20
|
+
* Marks farther than this off-screen are not rendered at all. Defaults to 400.
|
|
21
|
+
*/
|
|
22
|
+
overscan?: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Renders a custom network layout's {@link NetworkHtmlMark}s into one
|
|
26
|
+
* absolutely-positioned DOM layer above the canvas and SVG `overlays`.
|
|
27
|
+
*
|
|
28
|
+
* Each mark is its own positioned element, keyed by `id`, so the browser can
|
|
29
|
+
* composite `opacity`/`transform`/`visibility` changes on the mark's content
|
|
30
|
+
* without re-rasterizing it (the win over SVG `<foreignObject>`), and a
|
|
31
|
+
* position-only layout re-run repositions without remounting. The wrapper sets
|
|
32
|
+
* only placement + sizing + `pointer-events`; everything visual comes from
|
|
33
|
+
* `content`.
|
|
34
|
+
*
|
|
35
|
+
* Marks are viewport-culled against the nearest scrollable ancestor (plus
|
|
36
|
+
* `overscan`): a mark more than `overscan` px outside the visible window is not
|
|
37
|
+
* in the DOM at all, so a large topology mounts only roughly a viewport's worth
|
|
38
|
+
* regardless of total size, and the per-hover/paint cost stays bounded. When
|
|
39
|
+
* there's no scrollable ancestor (the content fits) every mark renders.
|
|
40
|
+
*
|
|
41
|
+
* Returns `null` when there are no marks, so layouts that don't use the feature
|
|
42
|
+
* render no extra DOM.
|
|
43
|
+
*/
|
|
44
|
+
export declare function NetworkHtmlMarksLayer({ marks, margin, selection, overscan, }: NetworkHtmlMarksLayerProps): React.ReactElement | null;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ParticlePool } from "./ParticlePool";
|
|
2
|
+
import type { NetworkHtmlMark } from "./networkCustomLayout";
|
|
3
|
+
import type { CustomLayoutSelection } from "./customLayoutSelection";
|
|
2
4
|
import type { ActiveTransition } from "./pipelineTransitionUtils";
|
|
3
5
|
import { type Quadtree } from "d3-quadtree";
|
|
4
6
|
import type { NetworkPipelineConfig, NetworkSceneNode, NetworkSceneEdge, NetworkCircleNode, NetworkLabel, RealtimeNode, RealtimeEdge, EdgePush } from "./networkTypes";
|
|
@@ -29,6 +31,21 @@ export declare class NetworkPipelineStore {
|
|
|
29
31
|
labels: NetworkLabel[];
|
|
30
32
|
/** Overlays returned from customNetworkLayout (consumed by StreamNetworkFrame). */
|
|
31
33
|
customLayoutOverlays: import("react").ReactNode;
|
|
34
|
+
/** HTML marks returned from customNetworkLayout — positioned DOM nodes the
|
|
35
|
+
* frame renders in a layer above the canvas/overlays (consumed by
|
|
36
|
+
* StreamNetworkFrame). Empty for built-in chart types. */
|
|
37
|
+
customLayoutHtmlMarks: NetworkHtmlMark[];
|
|
38
|
+
private _customLayoutDiagnosticsWarned;
|
|
39
|
+
/** Per-frame restyle callbacks from the custom layout result. When set, the
|
|
40
|
+
* frame routes selection changes through `restyleScene()` (style-only repaint)
|
|
41
|
+
* instead of a full `buildScene()`. */
|
|
42
|
+
private _customRestyle;
|
|
43
|
+
private _customRestyleEdge;
|
|
44
|
+
/** True when the active custom layout supplied a `restyle`/`restyleEdge`. */
|
|
45
|
+
hasCustomRestyle: boolean;
|
|
46
|
+
/** Base (as-emitted) style per mark, so a restyle pass starts from the layout's
|
|
47
|
+
* own style rather than compounding patches across selection changes. */
|
|
48
|
+
private _baseStyles;
|
|
32
49
|
private _nodeQuadtree;
|
|
33
50
|
private _maxNodeRadius;
|
|
34
51
|
/** Bumped whenever sceneNodes is rebuilt; keys the quadtree cache. */
|
|
@@ -108,6 +125,21 @@ export declare class NetworkPipelineStore {
|
|
|
108
125
|
/**
|
|
109
126
|
* Build the scene graph from current layout positions.
|
|
110
127
|
*/
|
|
128
|
+
/** Update the selection the layout reads at the next `buildScene`, without
|
|
129
|
+
* triggering a rebuild. The frame calls this on selection change; whether it
|
|
130
|
+
* then repaints (restyle) or rebuilds is the frame's decision. */
|
|
131
|
+
setLayoutSelection(selection: CustomLayoutSelection | null): void;
|
|
132
|
+
/** Snapshot each mark's as-emitted style so {@link restyleScene} can re-apply
|
|
133
|
+
* patches from the original rather than compounding. */
|
|
134
|
+
private snapshotBaseStyles;
|
|
135
|
+
/**
|
|
136
|
+
* Re-apply the custom layout's `restyle`/`restyleEdge` to the existing scene
|
|
137
|
+
* for `selection`, mutating styles **in place** off each mark's base style.
|
|
138
|
+
* Does NOT bump the scene revision — positions are unchanged, so the quadtree
|
|
139
|
+
* stays valid and no relayout/repack happens. The frame repaints the canvas
|
|
140
|
+
* after calling this. No-op when the layout supplied no restyle callbacks.
|
|
141
|
+
*/
|
|
142
|
+
restyleScene(selection: CustomLayoutSelection | null): void;
|
|
111
143
|
buildScene(size: [number, number]): void;
|
|
112
144
|
/**
|
|
113
145
|
* Lazily (re)build the circle-node spatial index. Only built when the scene
|
|
@@ -19,10 +19,22 @@ type AnnotationAnchorNode = {
|
|
|
19
19
|
r?: number;
|
|
20
20
|
/** Arc nodes (chord, radial) carry an outer radius. */
|
|
21
21
|
outerR?: number;
|
|
22
|
+
/** Symbol nodes (the per-datum glyph channel) carry a d3-symbol area. */
|
|
23
|
+
size?: number;
|
|
22
24
|
};
|
|
23
25
|
type NetworkAnnotationContext = AnnotationContext & {
|
|
24
26
|
sceneNodes?: AnnotationAnchorNode[];
|
|
25
27
|
};
|
|
28
|
+
/** Anchor id for a scene node — used to resolve `pointId`-anchored annotations
|
|
29
|
+
* to a mark a layout emitted (incl. custom-layout marks). Exported for tests. */
|
|
30
|
+
export declare function nodeAnchorId(node: AnnotationAnchorNode): string | undefined;
|
|
31
|
+
/** Center + effective radius of a scene node for annotation anchoring. Exported
|
|
32
|
+
* for tests. */
|
|
33
|
+
export declare function nodeCenter(node: AnnotationAnchorNode): {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
r: number;
|
|
37
|
+
} | null;
|
|
26
38
|
export interface NetworkSVGOverlayProps {
|
|
27
39
|
width: number;
|
|
28
40
|
height: number;
|
|
@@ -20,6 +20,7 @@ import { type Quadtree } from "d3-quadtree";
|
|
|
20
20
|
import type { OrdinalPipelineConfig, OrdinalScales, OrdinalSceneNode, OrdinalColumn, OrdinalLayout } from "./ordinalTypes";
|
|
21
21
|
import type { Changeset, PointSceneNode } from "./types";
|
|
22
22
|
import type { ActiveTransition } from "./pipelineTransitionUtils";
|
|
23
|
+
import type { CustomLayoutSelection } from "./customLayoutSelection";
|
|
23
24
|
export declare class OrdinalPipelineStore {
|
|
24
25
|
private buffer;
|
|
25
26
|
private rExtent;
|
|
@@ -33,6 +34,7 @@ export declare class OrdinalPipelineStore {
|
|
|
33
34
|
private getStack;
|
|
34
35
|
private getGroup;
|
|
35
36
|
private getColor;
|
|
37
|
+
private getSymbol;
|
|
36
38
|
private getConnector;
|
|
37
39
|
private getDataId;
|
|
38
40
|
/** Discovered categories in insertion order */
|
|
@@ -55,6 +57,13 @@ export declare class OrdinalPipelineStore {
|
|
|
55
57
|
columns: Record<string, OrdinalColumn>;
|
|
56
58
|
/** Overlays returned from customLayout (consumed by StreamOrdinalFrame). */
|
|
57
59
|
customLayoutOverlays: import("react").ReactNode;
|
|
60
|
+
private _customLayoutDiagnosticsWarned;
|
|
61
|
+
/** Per-frame restyle callback from the custom layout result (see OrdinalLayoutResult.restyle). */
|
|
62
|
+
private _customRestyle;
|
|
63
|
+
/** True when the active custom layout supplied a `restyle`. */
|
|
64
|
+
hasCustomRestyle: boolean;
|
|
65
|
+
/** Base (as-emitted) style per node, so restyle passes don't compound. */
|
|
66
|
+
private _baseStyles;
|
|
58
67
|
version: number;
|
|
59
68
|
/** Bumped whenever the buffer is mutated. Used to invalidate per-frame caches. */
|
|
60
69
|
private _dataVersion;
|
|
@@ -142,5 +151,14 @@ export declare class OrdinalPipelineStore {
|
|
|
142
151
|
get size(): number;
|
|
143
152
|
getOAccessor(): (d: Datum) => string;
|
|
144
153
|
getRAccessor(): (d: Datum) => number;
|
|
154
|
+
/** Update the selection the layout reads at the next rebuild, without one. */
|
|
155
|
+
setLayoutSelection(selection: CustomLayoutSelection | null): void;
|
|
156
|
+
private applyCustomRestyle;
|
|
157
|
+
/**
|
|
158
|
+
* Re-apply the custom layout's `restyle` to the existing scene for
|
|
159
|
+
* `selection`, off each node's base style — no relayout, no quadtree rebuild.
|
|
160
|
+
* No-op when the layout supplied no `restyle`.
|
|
161
|
+
*/
|
|
162
|
+
restyleScene(selection: CustomLayoutSelection | null): void;
|
|
145
163
|
updateConfig(config: Partial<OrdinalPipelineConfig>): void;
|
|
146
164
|
}
|
|
@@ -2,10 +2,12 @@ import type { Datum } from "../charts/shared/datumTypes";
|
|
|
2
2
|
import { type Quadtree } from "d3-quadtree";
|
|
3
3
|
import { RingBuffer } from "../realtime/RingBuffer";
|
|
4
4
|
import type { Changeset, StreamChartType, StreamScales, StreamLayout, SceneNode, PointSceneNode, CandlestickStyle, Style, ArrowOfTime, WindowMode, DecayConfig, PulseConfig, TransitionConfig, StalenessConfig, CurveType, BarStyle, ThemeSemanticColors, BandConfig } from "./types";
|
|
5
|
+
import type { SymbolName } from "./symbolPath";
|
|
5
6
|
import { type CoercibleNumber } from "./accessorUtils";
|
|
6
7
|
import type { ActiveTransition } from "./pipelineTransitionUtils";
|
|
7
8
|
import type { ResolvedRibbon } from "./xySceneBuilders/ribbonScene";
|
|
8
9
|
import type { CustomLayout } from "./customLayout";
|
|
10
|
+
import type { CustomLayoutSelection } from "./customLayoutSelection";
|
|
9
11
|
import type { MarginType } from "../types/marginType";
|
|
10
12
|
export interface PipelineConfig {
|
|
11
13
|
chartType: StreamChartType;
|
|
@@ -28,6 +30,10 @@ export interface PipelineConfig {
|
|
|
28
30
|
valueAccessor?: string | ((d: Datum) => CoercibleNumber);
|
|
29
31
|
colorAccessor?: string | ((d: Datum) => string);
|
|
30
32
|
sizeAccessor?: string | ((d: Datum) => CoercibleNumber);
|
|
33
|
+
/** Categorical accessor → glyph shape (scatter/bubble). Emits SymbolSceneNodes. */
|
|
34
|
+
symbolAccessor?: string | ((d: Datum) => string);
|
|
35
|
+
/** Explicit `{category → shape}` map; unmapped categories auto-assign. */
|
|
36
|
+
symbolMap?: Record<string, SymbolName>;
|
|
31
37
|
groupAccessor?: string | ((d: Datum) => string);
|
|
32
38
|
categoryAccessor?: string | ((d: Datum) => string);
|
|
33
39
|
lineDataAccessor?: string;
|
|
@@ -139,6 +145,9 @@ export interface PipelineConfig {
|
|
|
139
145
|
layoutConfig?: object;
|
|
140
146
|
/** Resolved margin — passed through so LayoutContext.dimensions.margin reflects what the frame actually used. */
|
|
141
147
|
layoutMargin?: MarginType;
|
|
148
|
+
/** Resolved shared selection projected into LayoutContext.selection. Owned by
|
|
149
|
+
* a dedicated frame effect (kept off the rebuild-triggering path). */
|
|
150
|
+
layoutSelection?: CustomLayoutSelection | null;
|
|
142
151
|
}
|
|
143
152
|
export declare class PipelineStore {
|
|
144
153
|
private buffer;
|
|
@@ -152,6 +161,7 @@ export declare class PipelineStore {
|
|
|
152
161
|
private getCategory;
|
|
153
162
|
private getSize;
|
|
154
163
|
private getColor;
|
|
164
|
+
private getSymbol;
|
|
155
165
|
private getY0;
|
|
156
166
|
/** Unified ribbon list — `boundsAccessor` + `band` both compose into
|
|
157
167
|
* this single array (see `resolveRibbons`). Read by the scene
|
|
@@ -207,6 +217,13 @@ export declare class PipelineStore {
|
|
|
207
217
|
version: number;
|
|
208
218
|
/** Overlays returned from customLayout (consumed by StreamXYFrame for SVGOverlay). */
|
|
209
219
|
customLayoutOverlays: import("react").ReactNode;
|
|
220
|
+
private _customLayoutDiagnosticsWarned;
|
|
221
|
+
/** Per-frame restyle callback from the custom layout result (see LayoutResult.restyle). */
|
|
222
|
+
private _customRestyle;
|
|
223
|
+
/** True when the active custom layout supplied a `restyle`. */
|
|
224
|
+
hasCustomRestyle: boolean;
|
|
225
|
+
/** Base (as-emitted) style per node, so restyle passes don't compound. */
|
|
226
|
+
private _baseStyles;
|
|
210
227
|
/** True when the x accessor returns Date objects (auto-detected on first data ingestion) */
|
|
211
228
|
xIsDate: boolean;
|
|
212
229
|
private _quadtree;
|
|
@@ -339,5 +356,15 @@ export declare class PipelineStore {
|
|
|
339
356
|
getXAccessor(): (d: Datum) => number;
|
|
340
357
|
getYAccessor(): (d: Datum) => number;
|
|
341
358
|
getCategoryAccessor(): ((d: Datum) => string) | undefined;
|
|
359
|
+
/** Update the selection the layout reads at the next rebuild, without
|
|
360
|
+
* triggering one. The frame then either repaints (restyle) or rebuilds. */
|
|
361
|
+
setLayoutSelection(selection: CustomLayoutSelection | null): void;
|
|
362
|
+
private applyCustomRestyle;
|
|
363
|
+
/**
|
|
364
|
+
* Re-apply the custom layout's `restyle` to the existing scene for
|
|
365
|
+
* `selection`, off each node's base style — no relayout, no quadtree rebuild
|
|
366
|
+
* (positions are unchanged). No-op when the layout supplied no `restyle`.
|
|
367
|
+
*/
|
|
368
|
+
restyleScene(selection: CustomLayoutSelection | null): void;
|
|
342
369
|
updateConfig(config: Partial<PipelineConfig>): void;
|
|
343
370
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { SceneNode, LineSceneNode, AreaSceneNode, PointSceneNode, RectSceneNode, HeatcellSceneNode, Style, StreamScales, CurveType } from "./types";
|
|
1
|
+
import type { SceneNode, LineSceneNode, AreaSceneNode, PointSceneNode, SymbolSceneNode, RectSceneNode, HeatcellSceneNode, Style, StreamScales, CurveType } from "./types";
|
|
2
|
+
import type { SymbolName } from "./symbolPath";
|
|
2
3
|
import type { Datum } from "../charts/shared/datumTypes";
|
|
3
4
|
export declare function buildLineNode(data: Datum[], scales: StreamScales, xGet: (d: Datum) => number, yGet: (d: Datum) => number, style: Style, group?: string): LineSceneNode;
|
|
4
5
|
export declare function buildAreaNode(data: Datum[], scales: StreamScales, xGet: (d: Datum) => number, yGet: (d: Datum) => number, baselineY: number, style: Style, group?: string, y0Get?: (d: Datum) => number): AreaSceneNode;
|
|
@@ -26,6 +27,9 @@ export declare function buildStackedAreaNodes(groups: {
|
|
|
26
27
|
stackedTops: StackedTops;
|
|
27
28
|
};
|
|
28
29
|
export declare function buildPointNode(datum: Datum, scales: StreamScales, xGet: (d: Datum) => number, yGet: (d: Datum) => number, r: number, style: Style, pointId?: string): PointSceneNode | null;
|
|
30
|
+
/** Build a {@link SymbolSceneNode} — the glyph sibling of {@link buildPointNode}.
|
|
31
|
+
* `size` is the d3-symbol area (px²); convert from a target radius with πr². */
|
|
32
|
+
export declare function buildSymbolNode(datum: Datum, scales: StreamScales, xGet: (d: Datum) => number, yGet: (d: Datum) => number, size: number, symbolType: SymbolName, style: Style, pointId?: string): SymbolSceneNode | null;
|
|
29
33
|
export declare function buildRectNode(x: number, y: number, w: number, h: number, style: Style, datum: any, group?: string): RectSceneNode;
|
|
30
34
|
export declare function buildHeatcellNode(x: number, y: number, w: number, h: number, fill: string, datum: any, options?: {
|
|
31
35
|
value?: number;
|
|
@@ -2,6 +2,7 @@ import type { ReactNode } from "react";
|
|
|
2
2
|
import type { Datum } from "../charts/shared/datumTypes";
|
|
3
3
|
import type { MarginType } from "../types/marginType";
|
|
4
4
|
import type { SceneNode, StreamScales, Style, ThemeSemanticColors } from "./types";
|
|
5
|
+
import type { CustomLayoutSelection } from "./customLayoutSelection";
|
|
5
6
|
/**
|
|
6
7
|
* customLayout — escape hatch for bespoke chart geometry.
|
|
7
8
|
*
|
|
@@ -57,12 +58,31 @@ export interface LayoutContext<C extends object = Record<string, unknown>> {
|
|
|
57
58
|
resolveColor: (group: string, datum?: Datum) => string;
|
|
58
59
|
/** User-supplied config blob threaded through `layoutConfig`. */
|
|
59
60
|
config: C;
|
|
61
|
+
/**
|
|
62
|
+
* Shared-selection projection (from `selection` / `linkedHover`). `null` when
|
|
63
|
+
* the chart isn't wired to a selection store. Dim/highlight by
|
|
64
|
+
* `selection.predicate(datum)`. For selection-driven styling that shouldn't
|
|
65
|
+
* pay a relayout, express it via {@link LayoutResult.restyle} (canvas) /
|
|
66
|
+
* `useCustomLayoutSelection` (overlays) instead of recomputing geometry here.
|
|
67
|
+
*/
|
|
68
|
+
selection?: CustomLayoutSelection | null;
|
|
60
69
|
}
|
|
61
70
|
export interface LayoutResult {
|
|
62
71
|
/** Scene nodes to render. Get hit testing, transitions, decay, SSR for free. */
|
|
63
72
|
nodes?: SceneNode[];
|
|
64
73
|
/** SVG overlays composited above the canvas (labels, annotations). */
|
|
65
74
|
overlays?: ReactNode;
|
|
75
|
+
/**
|
|
76
|
+
* **Per-frame restyle of canvas marks, without re-positioning.** When present,
|
|
77
|
+
* a selection/hover change re-applies styles to the existing scene nodes and
|
|
78
|
+
* repaints — it does NOT re-run the layout or rebuild the point quadtree.
|
|
79
|
+
* Return a style patch merged onto the node's *base* style; return nothing to
|
|
80
|
+
* leave it unchanged. Providing it opts the chart into the cheap selection
|
|
81
|
+
* path (hover stays O(nodes) paint, not O(nodes) relayout); omit it and
|
|
82
|
+
* selection changes re-run the layout. Pairs with `useCustomLayoutSelection`
|
|
83
|
+
* for the `overlays`.
|
|
84
|
+
*/
|
|
85
|
+
restyle?: (node: SceneNode, selection: CustomLayoutSelection | null) => Partial<Style> | void;
|
|
66
86
|
}
|
|
67
87
|
/**
|
|
68
88
|
* Note on extents: customLayout v1 does not return extents. Layouts that
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface CustomLayoutDiagnosticNode {
|
|
3
|
+
datum?: unknown;
|
|
4
|
+
}
|
|
5
|
+
export interface CustomLayoutDiagnosticsOptions {
|
|
6
|
+
label: string;
|
|
7
|
+
nodes: readonly CustomLayoutDiagnosticNode[];
|
|
8
|
+
overlays?: ReactNode;
|
|
9
|
+
warned: Set<string>;
|
|
10
|
+
}
|
|
11
|
+
export declare function warnCustomLayoutDiagnostics(options: CustomLayoutDiagnosticsOptions): void;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { Datum } from "../charts/shared/datumTypes";
|
|
3
|
+
/**
|
|
4
|
+
* The shared-selection state projected to a custom layout — both into the layout
|
|
5
|
+
* context (`ctx.selection`) and, via {@link useCustomLayoutSelection}, into the
|
|
6
|
+
* layout's React `overlays` subtree.
|
|
7
|
+
*
|
|
8
|
+
* `isActive` is `false` when no selection clause is present (treat every mark as
|
|
9
|
+
* selected). `predicate(datum)` returns `true` when the raw datum matches the
|
|
10
|
+
* active selection.
|
|
11
|
+
*/
|
|
12
|
+
export interface CustomLayoutSelection {
|
|
13
|
+
isActive: boolean;
|
|
14
|
+
predicate: (datum: Datum) => boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Provided by the Stream Frames around a custom layout's `overlays`. The value
|
|
18
|
+
* is the chart's resolved selection; it updates on hover/selection change
|
|
19
|
+
* **without** the frame re-running the layout — so an overlay that subscribes
|
|
20
|
+
* via {@link useCustomLayoutSelection} restyles itself while sceneNodes, the
|
|
21
|
+
* canvas paint, and the quadtree stay untouched.
|
|
22
|
+
*/
|
|
23
|
+
export declare function CustomLayoutSelectionProvider({ value, children, }: {
|
|
24
|
+
value: CustomLayoutSelection | null;
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
}): React.ReactElement;
|
|
27
|
+
/**
|
|
28
|
+
* Read the chart's resolved selection from inside a custom layout's `overlays`.
|
|
29
|
+
*
|
|
30
|
+
* Subscribing components re-render on selection/hover change **without a
|
|
31
|
+
* relayout** — the frame swaps only the context value, never rebuilding the
|
|
32
|
+
* scene. This is the read side of the styling channel; pair it with the
|
|
33
|
+
* `restyle` callback on the layout result to dim/highlight **canvas** marks
|
|
34
|
+
* without re-positioning.
|
|
35
|
+
*
|
|
36
|
+
* Returns an inactive selection (`isActive: false`, predicate always `true`)
|
|
37
|
+
* when called outside a custom chart, so overlays render fully-lit by default.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* function ClusterLabel({ datum, x, y }) {
|
|
42
|
+
* const { isActive, predicate } = useCustomLayoutSelection()
|
|
43
|
+
* const dim = isActive && !predicate(datum)
|
|
44
|
+
* return <text x={x} y={y} opacity={dim ? 0.15 : 1}>{datum.label}</text>
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare function useCustomLayoutSelection(): CustomLayoutSelection;
|
|
49
|
+
/** Wrap a custom layout's overlay node in the selection provider (no-op for a
|
|
50
|
+
* null node, so an empty overlay layer stays empty rather than becoming a
|
|
51
|
+
* provider element). Used by the Stream Frames. */
|
|
52
|
+
export declare function wrapWithCustomLayoutSelection(node: React.ReactNode, selection: CustomLayoutSelection | null): React.ReactNode;
|