semiotic 3.5.2 → 3.5.3

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 (75) hide show
  1. package/CLAUDE.md +8 -7
  2. package/README.md +15 -15
  3. package/ai/schema.json +15 -1
  4. package/ai/system-prompt.md +1 -1
  5. package/dist/components/ThemeProvider.d.ts +2 -2
  6. package/dist/components/charts/network/ProcessSankey.d.ts +22 -0
  7. package/dist/components/charts/network/SankeyDiagram.d.ts +5 -1
  8. package/dist/components/charts/network/processSankey/algorithm.d.ts +57 -0
  9. package/dist/components/charts/network/processSankey/buildScenes.d.ts +6 -0
  10. package/dist/components/charts/network/processSankey/streamingLayout.d.ts +13 -0
  11. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +2 -0
  12. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +2 -0
  13. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +2 -0
  14. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +2 -0
  15. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +2 -0
  16. package/dist/components/charts/shared/tooltipUtils.d.ts +11 -0
  17. package/dist/components/charts/shared/types.d.ts +6 -0
  18. package/dist/components/charts/shared/useAreaSeriesSetup.d.ts +4 -1
  19. package/dist/components/charts/shared/useChartSetup.d.ts +2 -0
  20. package/dist/components/charts/shared/useCustomChartSetup.d.ts +1 -0
  21. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +2 -0
  22. package/dist/components/charts/shared/withChartWrapper.d.ts +10 -3
  23. package/dist/components/charts/xy/AreaChart.d.ts +12 -2
  24. package/dist/components/charts/xy/LineChart.d.ts +26 -2
  25. package/dist/components/charts/xy/Scatterplot.d.ts +5 -1
  26. package/dist/components/semiotic.d.ts +1 -1
  27. package/dist/components/server/renderToStaticSVG.d.ts +2 -1
  28. package/dist/components/server/serverChartConfigs.d.ts +1 -0
  29. package/dist/components/server/staticAnnotations.d.ts +1 -1
  30. package/dist/components/server/themeResolver.d.ts +7 -1
  31. package/dist/components/store/ThemeStore.d.ts +7 -1
  32. package/dist/components/stream/AccessibleDataTable.d.ts +2 -2
  33. package/dist/components/stream/PipelineStore.d.ts +20 -13
  34. package/dist/components/stream/SVGOverlay.d.ts +2 -29
  35. package/dist/components/stream/accessorUtils.d.ts +2 -1
  36. package/dist/components/stream/layouts/hierarchyLayoutPlugin.d.ts +1 -1
  37. package/dist/components/stream/networkTypes.d.ts +11 -0
  38. package/dist/components/stream/ordinalTypes.d.ts +15 -1
  39. package/dist/components/stream/renderers/wedgePathBuilder.d.ts +56 -0
  40. package/dist/components/stream/types.d.ts +108 -15
  41. package/dist/components/stream/xySceneBuilders/areaGradient.d.ts +20 -0
  42. package/dist/components/stream/xySceneBuilders/barScene.d.ts +2 -2
  43. package/dist/components/stream/xySceneBuilders/candlestickScene.d.ts +2 -2
  44. package/dist/components/stream/xySceneBuilders/heatmapScene.d.ts +2 -2
  45. package/dist/components/stream/xySceneBuilders/lineScene.d.ts +4 -3
  46. package/dist/components/stream/xySceneBuilders/pointScene.d.ts +2 -2
  47. package/dist/components/stream/xySceneBuilders/ribbonScene.d.ts +107 -0
  48. package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +2 -2
  49. package/dist/components/stream/xySceneBuilders/types.d.ts +9 -12
  50. package/dist/components/stream/xySceneBuilders/waterfallScene.d.ts +2 -2
  51. package/dist/geo.min.js +1 -1
  52. package/dist/geo.module.min.js +1 -1
  53. package/dist/network.min.js +1 -1
  54. package/dist/network.module.min.js +1 -1
  55. package/dist/ordinal.min.js +1 -1
  56. package/dist/ordinal.module.min.js +1 -1
  57. package/dist/realtime.min.js +1 -1
  58. package/dist/realtime.module.min.js +1 -1
  59. package/dist/semiotic-ai.min.js +1 -1
  60. package/dist/semiotic-ai.module.min.js +1 -1
  61. package/dist/semiotic-data.min.js +1 -1
  62. package/dist/semiotic-data.module.min.js +1 -1
  63. package/dist/semiotic-themes.min.js +1 -1
  64. package/dist/semiotic-themes.module.min.js +1 -1
  65. package/dist/semiotic-utils.min.js +1 -1
  66. package/dist/semiotic-utils.module.min.js +1 -1
  67. package/dist/semiotic.d.ts +1 -1
  68. package/dist/semiotic.min.js +1 -1
  69. package/dist/semiotic.module.min.js +1 -1
  70. package/dist/server.min.js +1 -1
  71. package/dist/server.module.min.js +1 -1
  72. package/dist/xy.min.js +1 -1
  73. package/dist/xy.module.min.js +1 -1
  74. package/package.json +16 -8
  75. package/dist/components/stream/xySceneBuilders/boundsScene.d.ts +0 -9
@@ -0,0 +1,107 @@
1
+ import type { Datum } from "../../charts/shared/datumTypes";
2
+ /**
3
+ * Ribbon scene builder — the unified primitive for painting a closed
4
+ * top/bottom envelope underneath a line/area, used by:
5
+ *
6
+ * - `boundsAccessor` (symmetric ±offset around `yAccessor`)
7
+ * - `band` (asymmetric `y0Accessor` / `y1Accessor` per BandConfig, with
8
+ * multi-band fan support)
9
+ *
10
+ * Both public APIs normalize to `ResolvedRibbon[]` at the PipelineStore
11
+ * layer; the scene builders, y-extent expansion, and tooltip enrichment
12
+ * all read that single array.
13
+ *
14
+ * Consumed by: lineScene, areaScene, mixedScene (each renders ribbons
15
+ * before lines/areas so they sit underneath in z-order).
16
+ */
17
+ import type { AreaSceneNode, Style } from "../types";
18
+ import type { XYSceneContext } from "./types";
19
+ /**
20
+ * One ribbon worth of geometry + style. The PipelineStore owns the
21
+ * normalization from `boundsAccessor` and `band` public props into this
22
+ * single internal shape.
23
+ */
24
+ export interface ResolvedRibbon {
25
+ /**
26
+ * Origin of this ribbon:
27
+ * - `"bounds"`: produced by `boundsAccessor` (decorative-only)
28
+ * - `"band"`: produced by `band` (eligible for `datum.band` tooltip
29
+ * enrichment in the hover handler)
30
+ */
31
+ kind: "bounds" | "band";
32
+ /**
33
+ * Top y-value for each datum. Return `NaN` to skip a datum entirely
34
+ * (gap behavior). Bounds resolves this from `y + offset` (collapsing
35
+ * to `y` when offset is non-finite, matching legacy behavior); band
36
+ * resolves it from `y1Accessor`.
37
+ */
38
+ getTop: (d: Datum) => number;
39
+ /**
40
+ * Bottom y-value for each datum. Same gap semantics as `getTop`.
41
+ */
42
+ getBottom: (d: Datum) => number;
43
+ /**
44
+ * Style override. When omitted, the scene builder falls back to
45
+ * `ctx.resolveBoundsStyle(group, sampleDatum)` — line color at 0.2
46
+ * fillOpacity. Functions get the first datum and group key.
47
+ */
48
+ style?: Style | ((d: Datum, group?: string) => Style);
49
+ /**
50
+ * `true` → one ribbon per group, colored to match each line.
51
+ * `false` → a single aggregate ribbon across the whole dataset.
52
+ * Bounds is always `true`. Band defaults to `true`; the public
53
+ * `BandConfig.perSeries: false` opt-out flips this.
54
+ */
55
+ perSeries: boolean;
56
+ /**
57
+ * Whether the ribbon area participates in hit testing. Bounds is
58
+ * always `false`. Band defaults to `false` but supports `interactive: true`.
59
+ */
60
+ interactive: boolean;
61
+ }
62
+ /**
63
+ * Build a single ribbon scene node for one slice of data.
64
+ *
65
+ * Iterates the data once, evaluates `getTop`/`getBottom` per datum, and
66
+ * collects coordinate pairs. Any datum with non-finite x, top, or bottom
67
+ * is skipped (gap semantics — equivalent to `gapStrategy: "break"`).
68
+ * Returns `null` when fewer than two valid points remain (a single
69
+ * point can't form a visible ribbon).
70
+ */
71
+ export declare function buildRibbonForGroup(ctx: XYSceneContext, data: Datum[], group: string, ribbon: ResolvedRibbon): AreaSceneNode | null;
72
+ /**
73
+ * Split ribbons by `perSeries` so the caller can dispatch correctly:
74
+ * per-series ribbons render once per group; aggregate ribbons render
75
+ * once across the full dataset.
76
+ */
77
+ export declare function partitionRibbons(ribbons: ResolvedRibbon[] | undefined): {
78
+ perSeries: ResolvedRibbon[];
79
+ aggregate: ResolvedRibbon[];
80
+ };
81
+ /**
82
+ * Build all aggregate ribbons (perSeries=false) for the whole dataset.
83
+ * Each ribbon emits at most one AreaSceneNode under the synthetic
84
+ * group key `__ribbon_aggregate`.
85
+ */
86
+ export declare function buildAggregateRibbons(ctx: XYSceneContext, data: Datum[], ribbons: ResolvedRibbon[]): AreaSceneNode[];
87
+ /**
88
+ * Build all per-series ribbons for one grouped data slice. Each ribbon
89
+ * in the list emits at most one AreaSceneNode for the given group.
90
+ */
91
+ export declare function buildPerSeriesRibbons(ctx: XYSceneContext, data: Datum[], group: string, ribbons: ResolvedRibbon[]): AreaSceneNode[];
92
+ /**
93
+ * Enrich a hovered datum with band values so user tooltips can read
94
+ * `datum.band = { y0, y1 }` (first band) and `datum.bands = [...]`
95
+ * (all bands). Returns a shallow copy so the original data row is
96
+ * never mutated.
97
+ *
98
+ * Bounds-sourced ribbons (`kind: "bounds"`) are intentionally excluded
99
+ * — they're decorative, and the tooltip enrichment contract is
100
+ * band-only. Returns the input datum unchanged when no band-kind
101
+ * ribbons are configured or none produce finite values at this datum.
102
+ *
103
+ * Consumed by every code path that produces a `HoverData` in
104
+ * StreamXYFrame: pointer hover, multi-mode per-series datum, and
105
+ * keyboard navigation.
106
+ */
107
+ export declare function enrichDatumWithBand(datum: Datum | null | undefined, ribbons: ResolvedRibbon[] | undefined): Datum;
@@ -6,6 +6,6 @@ import type { Datum } from "../../charts/shared/datumTypes";
6
6
  *
7
7
  * Consumed by: PipelineStore.buildSceneNodes (chartType "swarm")
8
8
  */
9
- import type { SceneNode } from "../types";
9
+ import type { PointSceneNode } from "../types";
10
10
  import type { XYSceneContext } from "./types";
11
- export declare function buildSwarmScene(ctx: XYSceneContext, data: Datum[]): SceneNode[];
11
+ export declare function buildSwarmScene(ctx: XYSceneContext, data: Datum[]): PointSceneNode[];
@@ -1,4 +1,5 @@
1
1
  import type { Datum } from "../../charts/shared/datumTypes";
2
+ import type { AreaGradientConfig } from "./areaGradient";
2
3
  /**
3
4
  * XYSceneContext — shared context passed to all XY scene builder functions.
4
5
  *
@@ -7,6 +8,7 @@ import type { Datum } from "../../charts/shared/datumTypes";
7
8
  * accessing PipelineStore instance fields directly.
8
9
  */
9
10
  import type { StreamScales, Style, CurveType, BarStyle, ThemeSemanticColors } from "../types";
11
+ import type { ResolvedRibbon } from "./ribbonScene";
10
12
  export interface XYSceneContext {
11
13
  scales: StreamScales;
12
14
  config: XYSceneConfig;
@@ -18,7 +20,10 @@ export interface XYSceneContext {
18
20
  getGroup?: (d: Datum) => string;
19
21
  getCategory?: (d: Datum) => string;
20
22
  getPointId?: (d: Datum) => string;
21
- getBounds?: (d: Datum) => number | null;
23
+ /** Resolved ribbons unified list from `boundsAccessor` + `band`. The
24
+ * scene builders iterate this once instead of carrying two parallel
25
+ * code paths. Empty when neither prop is set. */
26
+ ribbons?: ResolvedRibbon[];
22
27
  getOpen?: (d: Datum) => number;
23
28
  getHigh?: (d: Datum) => number;
24
29
  getLow?: (d: Datum) => number;
@@ -42,7 +47,7 @@ export interface XYSceneContext {
42
47
  }
43
48
  /** Subset of PipelineConfig fields that scene builders need */
44
49
  export interface XYSceneConfig {
45
- chartType: string;
50
+ chartType?: string;
46
51
  curve?: CurveType;
47
52
  colorScheme?: string | string[];
48
53
  normalize?: boolean;
@@ -50,15 +55,7 @@ export interface XYSceneConfig {
50
55
  baseline?: "zero" | "wiggle" | "silhouette";
51
56
  /** Stack order — see PipelineConfig.stackOrder. */
52
57
  stackOrder?: "key" | "insideOut" | "asc" | "desc";
53
- gradientFill?: boolean | {
54
- topOpacity?: number;
55
- bottomOpacity?: number;
56
- } | {
57
- colorStops: Array<{
58
- offset: number;
59
- color: string;
60
- }>;
61
- };
58
+ gradientFill?: AreaGradientConfig;
62
59
  areaGroups?: Set<string>;
63
60
  lineGradient?: {
64
61
  colorStops: Array<{
@@ -83,7 +80,7 @@ export interface XYSceneConfig {
83
80
  barColors?: Record<string, string>;
84
81
  /** Bar fill/stroke/strokeWidth/gap. Threaded through from RealtimeHistogram. */
85
82
  barStyle?: BarStyle;
86
- themeSemantic?: ThemeSemanticColors;
83
+ themeSemantic?: Partial<ThemeSemanticColors>;
87
84
  /** Theme sequential scheme name — fallback when colorScheme is not set (heatmap). */
88
85
  themeSequential?: string;
89
86
  /** Theme diverging scheme name — fallback when colorScheme is not set. */
@@ -8,6 +8,6 @@
8
8
  * Consumed by: PipelineStore.buildSceneNodes (chartType "waterfall")
9
9
  */
10
10
  import type { Datum } from "../../charts/shared/datumTypes";
11
- import type { SceneNode, StreamLayout } from "../types";
11
+ import type { RectSceneNode, StreamLayout } from "../types";
12
12
  import type { XYSceneContext } from "./types";
13
- export declare function buildWaterfallScene(ctx: XYSceneContext, data: Datum[], layout: StreamLayout): SceneNode[];
13
+ export declare function buildWaterfallScene(ctx: XYSceneContext, data: Datum[], layout: StreamLayout): RectSceneNode[];