semiotic 3.7.3 → 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.
Files changed (138) hide show
  1. package/CLAUDE.md +13 -7
  2. package/README.md +36 -20
  3. package/ai/schema.json +221 -1
  4. package/ai/system-prompt.md +2 -1
  5. package/dist/components/Annotation.d.ts +4 -0
  6. package/dist/components/DataSummaryContext.d.ts +1 -0
  7. package/dist/components/LinkedCharts.d.ts +2 -2
  8. package/dist/components/ai/chartCapabilityTypes.d.ts +16 -0
  9. package/dist/components/ai/dataPitfallsBridge.d.ts +101 -0
  10. package/dist/components/ai/dataQualityBridge.d.ts +201 -0
  11. package/dist/components/ai/describeChart.d.ts +2 -0
  12. package/dist/components/ai/generativeChart.d.ts +145 -0
  13. package/dist/components/charts/custom/NetworkCustomChart.d.ts +15 -2
  14. package/dist/components/charts/ordinal/SwarmPlot.d.ts +7 -0
  15. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +21 -0
  16. package/dist/components/charts/realtime/aggregate.d.ts +51 -0
  17. package/dist/components/charts/realtime/eventTime.d.ts +26 -0
  18. package/dist/components/charts/shared/colorPalettes.d.ts +2 -0
  19. package/dist/components/charts/shared/colorUtils.d.ts +1 -12
  20. package/dist/components/charts/shared/minMax.d.ts +3 -0
  21. package/dist/components/charts/shared/radialGeometry.d.ts +0 -18
  22. package/dist/components/charts/shared/smartTooltip.d.ts +27 -0
  23. package/dist/components/charts/shared/statisticalOverlays.d.ts +35 -0
  24. package/dist/components/charts/shared/tooltipUtils.d.ts +2 -0
  25. package/dist/components/charts/shared/useChartSetup.d.ts +1 -1
  26. package/dist/components/charts/shared/useCustomChartSetup.d.ts +1 -1
  27. package/dist/components/charts/shared/validateChartData.d.ts +1 -1
  28. package/dist/components/charts/xy/Scatterplot.d.ts +9 -0
  29. package/dist/components/data/fromArrow.d.ts +54 -0
  30. package/dist/components/data/fromMermaid.d.ts +47 -0
  31. package/dist/components/data/fromObservablePlot.d.ts +69 -0
  32. package/dist/components/data/portability/index.d.ts +14 -0
  33. package/dist/components/data/portability/spec.d.ts +129 -0
  34. package/dist/components/data/portability/vegaLite.d.ts +62 -0
  35. package/dist/components/realtime/ReorderBuffer.d.ts +54 -0
  36. package/dist/components/realtime/RunningStats.d.ts +66 -0
  37. package/dist/components/realtime/WindowAccumulator.d.ts +105 -0
  38. package/dist/components/realtime/parseWindowDuration.d.ts +12 -0
  39. package/dist/components/recipes/customTooltip.d.ts +31 -0
  40. package/dist/components/recipes/gofish.d.ts +207 -0
  41. package/dist/components/recipes/gofishBoba.d.ts +23 -0
  42. package/dist/components/recipes/gofishIR.d.ts +169 -0
  43. package/dist/components/recipes/gofishIRExamples.d.ts +89 -0
  44. package/dist/components/recipes/gofishInterpreter.d.ts +52 -0
  45. package/dist/components/recipes/gofishLambdas.d.ts +145 -0
  46. package/dist/components/recipes/lineageDag.d.ts +129 -0
  47. package/dist/components/recipes/mermaidDag.d.ts +44 -0
  48. package/dist/components/recipes/packedClusterMatrix.d.ts +166 -0
  49. package/dist/components/recipes/recipeChrome.d.ts +100 -0
  50. package/dist/components/recipes/recipeLegend.d.ts +57 -0
  51. package/dist/components/recipes/recipeUtils.d.ts +105 -0
  52. package/dist/components/semiotic-ai.d.ts +6 -0
  53. package/dist/components/semiotic-data.d.ts +2 -0
  54. package/dist/components/semiotic-experimental.d.ts +20 -0
  55. package/dist/components/semiotic-network.d.ts +3 -1
  56. package/dist/components/semiotic-ordinal.d.ts +2 -0
  57. package/dist/components/semiotic-realtime.d.ts +9 -1
  58. package/dist/components/semiotic-recipes.d.ts +20 -1
  59. package/dist/components/semiotic-themes.d.ts +2 -0
  60. package/dist/components/semiotic-xy.d.ts +2 -0
  61. package/dist/components/semiotic.d.ts +6 -2
  62. package/dist/components/store/ObservationStore.d.ts +21 -2
  63. package/dist/components/store/SelectionStore.d.ts +1 -1
  64. package/dist/components/store/ThemeStore.d.ts +1 -1
  65. package/dist/components/store/TooltipStore.d.ts +1 -1
  66. package/dist/components/store/createStore.d.ts +1 -1
  67. package/dist/components/store/designTokens.d.ts +15 -0
  68. package/dist/components/store/useSelection.d.ts +22 -0
  69. package/dist/components/stream/NetworkHtmlMarksLayer.d.ts +44 -0
  70. package/dist/components/stream/NetworkPipelineStore.d.ts +32 -0
  71. package/dist/components/stream/NetworkSVGOverlay.d.ts +12 -0
  72. package/dist/components/stream/OrdinalPipelineStore.d.ts +18 -0
  73. package/dist/components/stream/PipelineStore.d.ts +27 -0
  74. package/dist/components/stream/SceneGraph.d.ts +5 -1
  75. package/dist/components/stream/customLayout.d.ts +20 -0
  76. package/dist/components/stream/customLayoutDiagnostics.d.ts +11 -0
  77. package/dist/components/stream/customLayoutSelection.d.ts +52 -0
  78. package/dist/components/stream/networkCustomLayout.d.ts +101 -1
  79. package/dist/components/stream/networkTypes.d.ts +38 -1
  80. package/dist/components/stream/ordinalCustomLayout.d.ts +17 -1
  81. package/dist/components/stream/ordinalSceneBuilders/types.d.ts +2 -0
  82. package/dist/components/stream/ordinalTypes.d.ts +19 -3
  83. package/dist/components/stream/renderers/networkSymbolRenderer.d.ts +2 -0
  84. package/dist/components/stream/renderers/symbolCanvasRenderer.d.ts +2 -0
  85. package/dist/components/stream/stalenessBands.d.ts +28 -0
  86. package/dist/components/stream/symbolPath.d.ts +24 -0
  87. package/dist/components/stream/types.d.ts +72 -3
  88. package/dist/components/stream/useStalenessCheck.d.ts +6 -1
  89. package/dist/components/stream/xySceneBuilders/pointScene.d.ts +2 -2
  90. package/dist/components/stream/xySceneBuilders/types.d.ts +5 -0
  91. package/dist/geo.min.js +1 -1
  92. package/dist/geo.module.min.js +1 -1
  93. package/dist/network.min.js +1 -1
  94. package/dist/network.module.min.js +1 -1
  95. package/dist/ordinal.min.js +1 -1
  96. package/dist/ordinal.module.min.js +1 -1
  97. package/dist/realtime.min.js +1 -1
  98. package/dist/realtime.module.min.js +1 -1
  99. package/dist/semiotic-ai-semiotic-ai-u954ylUn.js +2 -0
  100. package/dist/semiotic-ai-statisticalOverlays-CU7jW05Q.js +1 -0
  101. package/dist/semiotic-ai.d.ts +6 -0
  102. package/dist/semiotic-ai.min.js +1 -1
  103. package/dist/semiotic-ai.module.min.js +1 -1
  104. package/dist/semiotic-data.d.ts +2 -0
  105. package/dist/semiotic-data.min.js +1 -1
  106. package/dist/semiotic-data.module.min.js +1 -1
  107. package/dist/semiotic-experimental.d.ts +20 -0
  108. package/dist/semiotic-experimental.min.js +1 -0
  109. package/dist/semiotic-experimental.module.min.js +1 -0
  110. package/dist/semiotic-network.d.ts +3 -1
  111. package/dist/semiotic-ordinal.d.ts +2 -0
  112. package/dist/semiotic-realtime.d.ts +9 -1
  113. package/dist/semiotic-recipes.d.ts +20 -1
  114. package/dist/semiotic-recipes.min.js +1 -1
  115. package/dist/semiotic-recipes.module.min.js +1 -1
  116. package/dist/semiotic-semiotic-BmrYbi99.js +2 -0
  117. package/dist/semiotic-statisticalOverlays-IjZw8Lsu.js +1 -0
  118. package/dist/semiotic-themes.d.ts +2 -0
  119. package/dist/semiotic-themes.min.js +1 -1
  120. package/dist/semiotic-themes.module.min.js +1 -1
  121. package/dist/semiotic-utils.min.js +1 -1
  122. package/dist/semiotic-utils.module.min.js +1 -1
  123. package/dist/semiotic-value.min.js +1 -1
  124. package/dist/semiotic-value.module.min.js +1 -1
  125. package/dist/semiotic-xy.d.ts +2 -0
  126. package/dist/semiotic.d.ts +6 -2
  127. package/dist/semiotic.min.js +1 -1
  128. package/dist/semiotic.module.min.js +1 -1
  129. package/dist/server.min.js +1 -1
  130. package/dist/server.module.min.js +1 -1
  131. package/dist/xy-semiotic-xy-Dufu3D0-.js +2 -0
  132. package/dist/xy-statisticalOverlays-3Ni9bRph.js +1 -0
  133. package/dist/xy.min.js +1 -1
  134. package/dist/xy.module.min.js +1 -1
  135. package/package.json +11 -3
  136. package/dist/semiotic-ai-statisticalOverlays-C2PPlmXv.js +0 -1
  137. package/dist/semiotic-statisticalOverlays-C3DsOgr_.js +0 -1
  138. package/dist/xy-statisticalOverlays-C2PPlmXv.js +0 -1
@@ -0,0 +1,57 @@
1
+ import type { LegendGroup } from "../types/legendTypes";
2
+ import { type NetworkSymbolName } from "../stream/symbolPath";
3
+ /**
4
+ * `legendGroupsFrom` — build the `LegendGroup[]` a custom-layout recipe passes
5
+ * through `frameProps.legend` (`{ legendGroups }`). All three custom-chart HOCs
6
+ * disable the built-in legend because the *layout* owns color/shape/size; without
7
+ * this, authors hand-roll the `LegendGroup` shape (its `styleFn`, custom-glyph
8
+ * `type` render functions, swatch sizing). This closes that gap without the frame
9
+ * having to guess the author's encoding — the recipe declares each channel and
10
+ * gets back a ready-to-render array.
11
+ *
12
+ * One group is emitted per provided channel, in order: **color → symbol → size**.
13
+ * Pure / SSR-safe.
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * <NetworkCustomChart
18
+ * layout={packedClusterMatrix}
19
+ * frameProps={{ legend: { legendGroups: legendGroupsFrom({
20
+ * colorMap: CATEGORY_COLORS, colorLabel: "Category",
21
+ * symbolMap: CLASS_SHAPES, symbolLabel: "Class",
22
+ * sizeStops: [200, 2000, 8000], sizeRadius: r, sizeLabel: "Mass (kg)",
23
+ * }) } }}
24
+ * />
25
+ * ```
26
+ */
27
+ export interface LegendGroupsInput {
28
+ /** `{category → color}` map → one swatch per entry, in insertion order. */
29
+ colorMap?: Record<string, string>;
30
+ /** Or explicit category keys, with `color` resolving each to a color. */
31
+ keys?: string[];
32
+ /** Resolve a key → color (e.g. a recipe's `ctx.resolveColor`). Used with `keys`. */
33
+ color?: (key: string) => string;
34
+ /** Color-group heading. @default "" */
35
+ colorLabel?: string;
36
+ /** Color swatch glyph — a filled square or a line stroke. @default "fill" */
37
+ colorType?: "fill" | "line";
38
+ /** `{category → glyph shape}` map → one shape swatch per entry. */
39
+ symbolMap?: Record<string, NetworkSymbolName>;
40
+ /** Fill for the shape swatches (shape, not color, is the encoding here).
41
+ * @default "var(--semiotic-text, currentColor)" */
42
+ symbolColor?: string;
43
+ /** Symbol-group heading. @default "" */
44
+ symbolLabel?: string;
45
+ /** Reference values → circle swatches sized by the mark scale. */
46
+ sizeStops?: number[];
47
+ /** Map a value → radius (px) — pass the recipe's own radius scale so the
48
+ * legend circles match the marks exactly. Required to draw the size group. */
49
+ sizeRadius?: (v: number) => number;
50
+ /** Format a size stop for its label. @default `String` */
51
+ sizeFormat?: (v: number) => string;
52
+ /** Size swatch circle fill. @default "var(--semiotic-text, currentColor)" */
53
+ sizeColor?: string;
54
+ /** Size-group heading. @default "" */
55
+ sizeLabel?: string;
56
+ }
57
+ export declare function legendGroupsFrom(input: LegendGroupsInput): LegendGroup[];
@@ -5,6 +5,21 @@ import type { Datum } from "../charts/shared/datumTypes";
5
5
  * the boundary and lets the layout body call a single function.
6
6
  */
7
7
  export declare function resolveAccessor<T = unknown>(a: string | ((d: Datum) => T)): (d: Datum) => T;
8
+ /**
9
+ * Read a field off a network-ingest wrapper (`node.data.<key>`) or the node
10
+ * itself, with a fallback. Network recipes receive `RealtimeNode`/`RealtimeEdge`
11
+ * wrappers whose user data lives under `.data`; several recipes (lineageDag,
12
+ * mermaidDag, packedClusterMatrix, …) each re-declared this identical reader, so
13
+ * it lives here once. Returns `unknown` — narrow at the call site.
14
+ */
15
+ export declare function readField(d: unknown, key: string, fallback: unknown): unknown;
16
+ /**
17
+ * Group items into a `Map` keyed by a derived string. Insertion order is
18
+ * preserved both for keys and within each bucket — recipes rely on stable
19
+ * ordering for deterministic layout. Several recipes re-declared this; it lives
20
+ * here once.
21
+ */
22
+ export declare function groupBy<T>(items: readonly T[], key: (item: T) => string): Map<string, T[]>;
8
23
  /**
9
24
  * Build a datum object whose own-properties are safe to set from
10
25
  * user-supplied accessor names. `Object.create(null)` produces a
@@ -25,3 +40,93 @@ export declare function resolveAccessor<T = unknown>(a: string | ((d: Datum) =>
25
40
  * scattered across each recipe's inner loops.
26
41
  */
27
42
  export declare function createSafeDatum(populate: (set: (key: string, value: unknown) => void) => void): Datum;
43
+ /**
44
+ * A `{field, value}` highlight target — or an array of them, AND-combined (a
45
+ * datum must match every entry to count as a match, e.g. a region×orbit cell).
46
+ * `value` is coerced to a string before comparison; a nullish `value` matches
47
+ * anything (so `{ field, value: null }` is a no-op constraint).
48
+ */
49
+ export type HighlightMatch = {
50
+ field: string;
51
+ value: unknown;
52
+ } | ReadonlyArray<{
53
+ field: string;
54
+ value: unknown;
55
+ }>;
56
+ /**
57
+ * Whether `datum` satisfies a `{field, value}` highlight (or every entry of an
58
+ * array). A nullish/empty `highlight` matches everything — the "no highlight
59
+ * active" case. Several recipes hand-rolled this exact field/value loop.
60
+ */
61
+ export declare function matchesHighlight(datum: Datum, highlight: HighlightMatch | null | undefined): boolean;
62
+ export interface DimOptions {
63
+ /** A datum is lit only if this predicate passes (e.g. a shared-selection
64
+ * predicate, or `parallelCoordinates`'s `highlightFn`). Omit ⇒ no constraint. */
65
+ predicate?: ((d: Datum) => boolean) | null;
66
+ /** A datum is lit only if it matches this `{field, value}` (or all, for an
67
+ * array). Omit ⇒ no constraint. Composes with `predicate` (both must pass). */
68
+ highlight?: HighlightMatch | null;
69
+ /** Opacity used when no cue is active (nothing is dimmed). @default 1 */
70
+ baseOpacity?: number;
71
+ /** Opacity for marks that don't match an active cue. @default 0.16 */
72
+ dimOpacity?: number;
73
+ /** Additive opacity boost for matching marks when a cue is active, capped at 1
74
+ * (e.g. `parallelCoordinates` lifts its 0.45 line opacity by 0.4 on match). @default 0 */
75
+ brighten?: number;
76
+ }
77
+ /**
78
+ * The highlight/dim opacity rule, shared across custom-layout recipes. A mark is
79
+ * "lit" when it satisfies **every** active cue (`highlight` AND `predicate`); if
80
+ * no cue is active nothing is dimmed and every mark gets `baseOpacity`. Lit marks
81
+ * get `min(1, baseOpacity + brighten)`, dimmed marks get `dimOpacity`.
82
+ *
83
+ * This is the one rule `packedClusterMatrix` and `parallelCoordinates` each
84
+ * hand-rolled; centralizing it keeps the "matching marks stay lit, the rest dim"
85
+ * behavior identical. (Recipes whose dimming composes several cues with priority
86
+ * and rescue rules — e.g. `lineageDag`'s reach-set-over-selection — keep their
87
+ * bespoke logic; this helper is for the common AND-of-cues case.)
88
+ */
89
+ export declare function dimFor(datum: Datum, opts?: DimOptions): number;
90
+ /**
91
+ * Join layout-affecting inputs into a stable content-signature string. Pass the
92
+ * primitives that change the geometry (dimensions, gaps, orders, a per-datum
93
+ * fingerprint) — NOT styling/interaction inputs (color, shade, highlight) — so a
94
+ * re-style or a returning resize reuses a cached layout instead of recomputing it.
95
+ * Pairs with {@link LayoutCache}.
96
+ */
97
+ export declare function signatureKey(parts: ReadonlyArray<string | number | boolean | null | undefined>): string;
98
+ /**
99
+ * A tiny bounded geometry cache for expensive layouts (force packing, tree/DAG
100
+ * positioning). Key it with a {@link signatureKey} of the layout-affecting inputs
101
+ * so re-styling on interaction never re-runs the layout.
102
+ *
103
+ * **The sharp edge:** on `NetworkCustomChart`/`*CustomChart`, `ctx.nodes` is a
104
+ * *fresh array each `buildScene`* and a `layoutConfig` change re-runs the layout
105
+ * without re-ingesting topology — so cache by *content* (a fingerprint of the
106
+ * data), never by array identity. Over `maxSize` distinct keys it clears wholesale
107
+ * (these layouts churn a handful of signatures, not thousands).
108
+ */
109
+ export declare class LayoutCache<V> {
110
+ private readonly maxSize;
111
+ private store;
112
+ constructor(maxSize?: number);
113
+ get(key: string): V | undefined;
114
+ set(key: string, value: V): void;
115
+ /** Return the cached value for `key`, or compute + store it on a miss. */
116
+ getOrCompute(key: string, compute: () => V): V;
117
+ clear(): void;
118
+ get size(): number;
119
+ }
120
+ /**
121
+ * A reusable lightness shader for one base color. Interpolating in CIELAB keeps
122
+ * the hue and chroma roughly fixed while only lightness moves, so a categorical
123
+ * hue can carry a second *continuous* channel as shade (e.g. age, recency).
124
+ *
125
+ * The returned function takes `t ∈ [0,1]`: `0` lightens toward white, `1`
126
+ * darkens toward black, `0.5` returns the base. `strength` (0..1) caps how far
127
+ * each direction travels. Pure / SSR-safe — no DOM. Build once per base color
128
+ * (it captures two interpolators) and call per datum.
129
+ */
130
+ export declare function makeShade(baseColor: string, strength?: number): (t: number) => string;
131
+ /** One-shot form of {@link makeShade}: perceptual lightness shade of `baseColor`. */
132
+ export declare function shade(baseColor: string, t: number, strength?: number): string;
@@ -78,6 +78,12 @@ export { describeChart, resolveCommunicativeAct, communicativeActForIntent } fro
78
78
  export type { DescribeChartResult, DescribeChartOptions, DescribeLevel, CommunicativeAct, DescribeCapabilityContext } from "./ai/describeChart";
79
79
  export { buildReaderGrounding } from "./ai/readerGrounding";
80
80
  export type { ChartReaderGrounding, ChartReaderGroundingOptions, ChartReaderGroundingIntent } from "./ai/readerGrounding";
81
+ export { buildDataPitfallsBridge, toDataPitfallsChain } from "./ai/dataPitfallsBridge";
82
+ export type { DataPitfallsBridgeOptions, DataPitfallsBridgeResult, DataPitfallsChainInput, DataPitfallsChainStage, DataPitfallsDocumentInput, DataPitfallsImageInput, DataPitfallsImageMediaType, DataPitfallsImageSource, DataPitfallsRenderedChart, DataPitfallsSlideContent, DataPitfallsSlidesInput, DataPitfallsSingleArtifactInput, DataPitfallsTextInput } from "./ai/dataPitfallsBridge";
83
+ export { dataQualityToAnnotations, fromDbtArtifacts, fromGreatExpectations } from "./ai/dataQualityBridge";
84
+ export type { DataQualityStatus, DataQualityCheckKind, DataQualityResult, DataQualityAnnotationOptions, DataQualityAnnotationsResult, UnplacedDataQualityResult, DbtArtifacts, GEValidationResult } from "./ai/dataQualityBridge";
85
+ export { prepareChart, chartGenerationTool, toAnthropicTool, toOpenAITool, createChartToolHandler } from "./ai/generativeChart";
86
+ export type { RenderFn, PrepareChartInput, PrepareChartOptions, PrepareChartResult, ChartToolDefinition, ChartToolOptions } from "./ai/generativeChart";
81
87
  export { buildNavigationTree, flattenVisible, countNodes } from "./ai/navigationTree";
82
88
  export type { NavTreeNode, NavTreeRole, BuildNavigationTreeOptions } from "./ai/navigationTree";
83
89
  export { AccessibleNavTree } from "./AccessibleNavTree";
@@ -5,4 +5,6 @@
5
5
  export { bin, rollup, groupBy, pivot } from "./data/transforms";
6
6
  export { fromVegaLite } from "./data/fromVegaLite";
7
7
  export type { VegaLiteSpec, VegaLiteEncoding } from "./data/fromVegaLite";
8
+ export { fromArrow } from "./data/fromArrow";
9
+ export type { ArrowTableLike, ArrowColumnLike, ArrowFieldLike, ArrowSchemaLike, FromArrowOptions, } from "./data/fromArrow";
8
10
  export { mergeData } from "./geo/mergeData";
@@ -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";
@@ -13,6 +13,12 @@ export { flextreeLayout } from "./recipes/flextree";
13
13
  export type { FlextreeConfig } from "./recipes/flextree";
14
14
  export { dagreLayout } from "./recipes/dagre";
15
15
  export type { DagreConfig } from "./recipes/dagre";
16
+ export { lineageDagLayout } from "./recipes/lineageDag";
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";
16
22
  export { marimekkoLayout } from "./recipes/marimekko";
17
23
  export type { MarimekkoConfig } from "./recipes/marimekko";
18
24
  export { bulletLayout } from "./recipes/bullet";
@@ -24,5 +30,18 @@ export type { AnnotationLayoutConfig, AnnotationLayoutOptions, AutoPlaceAnnotati
24
30
  export { annotationDensity, annotationBudget, DEFAULT_AREA_PER_ANNOTATION } from "./recipes/annotationDensity";
25
31
  export type { AnnotationDensityConfig, AnnotationDensityOptions, AnnotationDensityResult, } from "./recipes/annotationDensity";
26
32
  export type { CustomLayout, LayoutContext, LayoutResult, } from "./stream/customLayout";
27
- export type { NetworkCustomLayout, NetworkLayoutContext, NetworkLayoutResult, } from "./stream/networkCustomLayout";
33
+ export type { NetworkCustomLayout, NetworkLayoutContext, NetworkLayoutResult, NetworkHtmlMark, } from "./stream/networkCustomLayout";
28
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";
@@ -32,8 +32,10 @@ export type { StreamOrdinalFrameProps, StreamOrdinalFrameHandle, OrdinalChartTyp
32
32
  export type { StreamNetworkFrameProps, StreamNetworkFrameHandle, NetworkChartType, NetworkSceneNode, NetworkSceneEdge, NetworkLabel, ThresholdAlertConfig } from "./stream/networkTypes";
33
33
  export type { SelectionConfig, LinkedHoverProp, LinkedBrushProp } from "./charts/shared/types";
34
34
  export type { LinkedChartsProps } from "./LinkedCharts";
35
- export { useSelection, useLinkedHover, useBrushSelection, useFilteredData } from "./LinkedCharts";
36
- export type { UseSelectionOptions, UseSelectionResult, UseLinkedHoverOptions, UseLinkedHoverResult, UseBrushSelectionOptions, UseBrushSelectionResult } from "./LinkedCharts";
35
+ export { useSelection, useSelectionActions, useLinkedHover, useBrushSelection, useFilteredData } from "./LinkedCharts";
36
+ export { useCustomLayoutSelection } from "./stream/customLayoutSelection";
37
+ export type { CustomLayoutSelection } from "./stream/customLayoutSelection";
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";
39
41
  export type { ChartObservation, OnObservationCallback } from "./store/ObservationStore";
@@ -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
- export type ChartObservation = HoverObservation | HoverEndObservation | BrushObservation | BrushEndObservation | SelectionObservation | SelectionEndObservation | ClickObservation | ClickEndObservation;
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 {};
@@ -23,6 +23,28 @@ export interface UseSelectionResult {
23
23
  clientId: string;
24
24
  }
25
25
  export declare function useSelection(options: UseSelectionOptions): UseSelectionResult;
26
+ export interface UseSelectionActionsResult {
27
+ /** Set a point selection (categorical values) under this client's clause. */
28
+ selectPoints: (fieldValues: Record<string, unknown[]>) => void;
29
+ /** Clear this client's clause. */
30
+ clear: () => void;
31
+ /** This client's ID. */
32
+ clientId: string;
33
+ }
34
+ /**
35
+ * Write-only access to a named selection that **does not subscribe** to the
36
+ * selection state — selecting only the stable `setClause`/`clearClause`
37
+ * actions, so the calling component never re-renders when the selection
38
+ * changes.
39
+ *
40
+ * Use this when a *container* needs to push a selection (e.g. from a hover
41
+ * handler) but only the leaf consumers (the charts reading the selection)
42
+ * should re-render. Pairs with `LinkedCharts` for the
43
+ * provider-at-top / consumers-at-leaves pattern: the writer stays out of the
44
+ * re-render path, avoiding per-interaction reconciliation + allocation in the
45
+ * container subtree. For read + write, use `useSelection`.
46
+ */
47
+ export declare function useSelectionActions(name: string, clientId?: string): UseSelectionActionsResult;
26
48
  export interface UseLinkedHoverOptions {
27
49
  /** Selection name. Defaults to "hover" */
28
50
  name?: string;
@@ -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
  }