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
@@ -6,6 +6,7 @@ import type { ArrowOfTime, WindowMode, LineStyle, BarStyle, WaterfallStyle, Swar
6
6
  import type { Datum } from "../charts/shared/datumTypes";
7
7
  import type { CoercibleNumber } from "./accessorUtils";
8
8
  import type { AutoPlaceAnnotations } from "../recipes/annotationLayout";
9
+ import type { SymbolName } from "./symbolPath";
9
10
  export type SceneDatum = Datum | null;
10
11
  export type SeriesDatum = Datum[] | null;
11
12
  export type AxisTickFormat = ((d: number, index?: number, allTicks?: number[]) => string) | ((d: string, index?: number, allTicks?: number[]) => string) | ((d: Date, index?: number, allTicks?: number[]) => string);
@@ -47,14 +48,34 @@ export interface TransitionConfig {
47
48
  easing?: "ease-out" | "linear";
48
49
  }
49
50
  export interface StalenessConfig {
50
- /** ms without data before "stale" (default: 5000) */
51
+ /**
52
+ * ms without data before "stale" (default: 5000). In graded mode this
53
+ * is the base TTL the lifecycle bands are measured against — `aging`
54
+ * begins here, `stale` at 1.5×, `expired` at 3× (overridable).
55
+ */
51
56
  threshold?: number;
52
- /** Canvas alpha when stale (default: 0.5) */
57
+ /** Canvas alpha when stale, binary mode (default: 0.5) */
53
58
  dimOpacity?: number;
54
59
  /** Render LIVE/STALE badge (default: false) */
55
60
  showBadge?: boolean;
56
61
  /** Badge position (default: "top-right") */
57
62
  badgePosition?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
63
+ /**
64
+ * Opt into graded (banded) staleness. Instead of a single live→stale
65
+ * flip at `threshold`, frames that support graded staleness dim
66
+ * progressively through fresh → aging → stale → expired as idle time
67
+ * crosses multiples of `threshold`, sharing one schedule with per-datum
68
+ * decay and annotation freshness. (Currently honored by `StreamXYFrame`,
69
+ * which backs the realtime XY charts; other frames treat it as binary.)
70
+ * `true` uses the default per-band opacities; pass an object to override
71
+ * the band thresholds or opacities.
72
+ */
73
+ graded?: boolean | {
74
+ /** Multiples of `threshold` marking each band edge (see LifecycleBandThresholds). */
75
+ thresholds?: import("../realtime/lifecycleBands").LifecycleBandThresholds;
76
+ /** Per-band canvas alpha override. Missing bands use the defaults. */
77
+ opacities?: Partial<Record<import("../realtime/lifecycleBands").LifecycleBand, number>>;
78
+ };
58
79
  }
59
80
  export type MarginalType = "histogram" | "violin" | "ridgeline" | "boxplot";
60
81
  export interface MarginalConfig {
@@ -96,7 +117,7 @@ export interface Style {
96
117
  /** Internal geo line flag: fade line ends at projection clipping edges. */
97
118
  _edgeFade?: boolean;
98
119
  }
99
- export type SceneNode = LineSceneNode | AreaSceneNode | PointSceneNode | RectSceneNode | HeatcellSceneNode | CandlestickSceneNode;
120
+ export type SceneNode = LineSceneNode | AreaSceneNode | PointSceneNode | SymbolSceneNode | RectSceneNode | HeatcellSceneNode | CandlestickSceneNode;
100
121
  export interface LineColorThreshold {
101
122
  value: number;
102
123
  color: string;
@@ -219,6 +240,46 @@ export interface PointSceneNode {
219
240
  /** Stable identity key for transition tracking */
220
241
  _transitionKey?: string;
221
242
  }
243
+ /**
244
+ * Symbol node — the per-datum **shape channel**, shared with the network and
245
+ * ordinal pipelines. A glyph drawn from a `d3-shape` symbol path (or a custom
246
+ * `path`), painted on canvas and in SVG/SSR via the shared `symbolPath` helpers,
247
+ * and hit-tested + keyboard-navigated as a unit. Emitted by custom XY layouts
248
+ * and by Scatterplot's `symbolBy` encoding. Uses `x`/`y` like its sibling
249
+ * `PointSceneNode` (the network variant uses `cx`/`cy`).
250
+ */
251
+ export interface SymbolSceneNode {
252
+ type: "symbol";
253
+ x: number;
254
+ y: number;
255
+ /** d3-symbol area in px² — drives the glyph's drawn size. */
256
+ size: number;
257
+ /** Named shape. Ignored when `path` is set. @default "circle" */
258
+ symbolType?: SymbolName;
259
+ /** Pre-built SVG path string, origin-centered — overrides `symbolType`. */
260
+ path?: string;
261
+ /** Rotation in radians about (x, y). */
262
+ rotation?: number;
263
+ style: Style;
264
+ datum: SceneDatum;
265
+ /** Optional unique identifier for point-anchored annotations. */
266
+ pointId?: string;
267
+ /** Pulse glow intensity 0–1 (set by PipelineStore when pulse is active). */
268
+ _pulseIntensity?: number;
269
+ /** Pulse glow color. */
270
+ _pulseColor?: string;
271
+ /** Pulse glow radius in px. */
272
+ _pulseGlowRadius?: number;
273
+ /** Animation target fields (set during transitions). */
274
+ _targetX?: number;
275
+ _targetY?: number;
276
+ _targetR?: number;
277
+ _targetOpacity?: number;
278
+ /** Per-datum decay opacity (set by PipelineStore.applyDecay). */
279
+ _decayOpacity?: number;
280
+ /** Stable identity key for transition tracking. */
281
+ _transitionKey?: string;
282
+ }
222
283
  export interface RectSceneNode {
223
284
  type: "rect";
224
285
  x: number;
@@ -467,6 +528,10 @@ export interface StreamXYFrameProps<T = Datum> {
467
528
  yAccessor?: string | ((d: T) => CoercibleNumber);
468
529
  colorAccessor?: string | ((d: T) => string);
469
530
  sizeAccessor?: string | ((d: T) => CoercibleNumber);
531
+ /** Categorical accessor → glyph shape (scatter/bubble). */
532
+ symbolAccessor?: string | ((d: T) => string);
533
+ /** Explicit `{category → shape}` map for `symbolAccessor`; unmapped auto-assign. */
534
+ symbolMap?: Record<string, SymbolName>;
470
535
  groupAccessor?: string | ((d: T) => string);
471
536
  lineDataAccessor?: string;
472
537
  curve?: CurveType;
@@ -712,6 +777,10 @@ export interface StreamXYFrameProps<T = Datum> {
712
777
  * signature) flow through without casts; layouts narrow via their
713
778
  * own `CustomLayout<TConfig>` parameterization. */
714
779
  layoutConfig?: object;
780
+ /** Resolved shared selection projected into `LayoutContext.selection`. Kept off
781
+ * the rebuild path — a change restyles (if the layout returned `restyle`) or
782
+ * rebuilds, never re-ingests. */
783
+ layoutSelection?: import("./customLayoutSelection").CustomLayoutSelection | null;
715
784
  }
716
785
  export interface StreamXYFrameHandle<T = Datum> {
717
786
  push(datum: T): void;
@@ -4,10 +4,15 @@ interface StoreWithIngestTime {
4
4
  }
5
5
  /**
6
6
  * Shared hook that polls a store's `lastIngestTime` on a 1-second interval
7
- * and manages staleness state. When staleness changes it sets
7
+ * and manages staleness state. When the resolved staleness changes it sets
8
8
  * `dirtyRef.current = true` and calls `scheduleRender()` so the canvas
9
9
  * repaints with the appropriate dimming.
10
10
  *
11
+ * Handles both binary staleness (a single live→stale flip) and graded
12
+ * staleness (progressive dimming through fresh → aging → stale → expired):
13
+ * a repaint is scheduled whenever the resolved *band* changes, so the
14
+ * graded ramp advances even though `isStale` may already be true.
15
+ *
11
16
  * Call this hook after `storeRef`, `dirtyRef`, and `scheduleRender` are
12
17
  * declared. The `isStale` / `setIsStale` state must live in the caller
13
18
  * so that the `useState` call order stays unchanged.
@@ -8,6 +8,6 @@ import type { Datum } from "../../charts/shared/datumTypes";
8
8
  * Dependencies: SceneGraph (buildPointNode)
9
9
  * Consumed by: PipelineStore.buildSceneNodes (chartTypes "scatter", "bubble")
10
10
  */
11
- import type { PointSceneNode } from "../types";
11
+ import type { PointSceneNode, SymbolSceneNode } from "../types";
12
12
  import type { XYSceneContext } from "./types";
13
- export declare function buildPointScene(ctx: XYSceneContext, data: Datum[]): PointSceneNode[];
13
+ export declare function buildPointScene(ctx: XYSceneContext, data: Datum[]): (PointSceneNode | SymbolSceneNode)[];
@@ -8,6 +8,7 @@ import type { AreaGradientConfig } from "./areaGradient";
8
8
  * accessing PipelineStore instance fields directly.
9
9
  */
10
10
  import type { StreamScales, Style, CurveType, BarStyle, ThemeSemanticColors } from "../types";
11
+ import type { SymbolName } from "../symbolPath";
11
12
  import type { ResolvedRibbon } from "./ribbonScene";
12
13
  export interface XYSceneContext {
13
14
  scales: StreamScales;
@@ -17,6 +18,8 @@ export interface XYSceneContext {
17
18
  getY0?: (d: Datum) => number | null;
18
19
  getSize?: (d: Datum) => number;
19
20
  getColor?: (d: Datum) => string;
21
+ /** Categorical accessor → glyph shape (scatter/bubble symbolBy). */
22
+ getSymbol?: (d: Datum) => string;
20
23
  getGroup?: (d: Datum) => string;
21
24
  getCategory?: (d: Datum) => string;
22
25
  getPointId?: (d: Datum) => string;
@@ -68,6 +71,8 @@ export interface XYSceneConfig {
68
71
  r?: number;
69
72
  };
70
73
  sizeRange?: [number, number];
74
+ /** Explicit `{category → shape}` map for symbolBy; unmapped auto-assign. */
75
+ symbolMap?: Record<string, SymbolName>;
71
76
  xAccessor?: string | ((d: Datum) => any);
72
77
  yAccessor?: string | ((d: Datum) => any);
73
78
  valueAccessor?: string | ((d: Datum) => any);