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
@@ -14,9 +14,13 @@ export interface ScatterplotProps<TDatum extends Datum = Datum> extends BaseChar
14
14
  /** Array of data points. Each point should have x and y properties. */
15
15
  data?: TDatum[];
16
16
  /** Field name or function to access x values @default "x" */
17
- xAccessor?: ChartAccessor<TDatum, number>;
17
+ xAccessor?: ChartAccessor<TDatum, number | Date | string>;
18
18
  /** Field name or function to access y values @default "y" */
19
19
  yAccessor?: ChartAccessor<TDatum, number>;
20
+ /** X scale type @default "linear" */
21
+ xScaleType?: "linear" | "log" | "time";
22
+ /** Y scale type @default "linear" */
23
+ yScaleType?: "linear" | "log";
20
24
  /** Field name or function to determine point color */
21
25
  colorBy?: ChartAccessor<TDatum, string>;
22
26
  /** Color scheme for categorical data or custom colors array @default "category10" */
@@ -25,7 +25,7 @@ import { RealtimeWaterfallChart } from "./charts/realtime/RealtimeWaterfallChart
25
25
  import { RealtimeHeatmap } from "./charts/realtime/RealtimeHeatmap";
26
26
  export { StreamXYFrame, StreamOrdinalFrame, StreamNetworkFrame, Scatterplot, ConnectedScatterplot, LineChart, AreaChart, DifferenceChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, LikertChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, ForceDirectedGraph, ChordDiagram, SankeyDiagram, ProcessSankey, TreeDiagram, PieChart, DonutChart, GaugeChart, FunnelChart, GroupedBarChart, SwimlaneChart, Treemap, CirclePack, OrbitDiagram, ScatterplotMatrix, MinimapChart, QuadrantChart, MultiAxisLineChart, CandlestickChart, XYCustomChart, NetworkCustomChart, OrdinalCustomChart, LinkedCharts, ThemeProvider, useTheme, exportChart, toConfig, fromConfig, toURL, fromURL, copyConfig, configToJSX, serializeSelections, deserializeSelections, fromVegaLite, ChartErrorBoundary, ChartContainer, ChartGrid, CategoryColorProvider, useCategoryColors, ContextLayout, DetailsPanel, Tooltip, MultiLineTooltip, normalizeTooltip, RingBuffer, IncrementalExtent, RealtimeLineChart, RealtimeTemporalHistogram, RealtimeHistogram, RealtimeSwarmChart, RealtimeWaterfallChart, RealtimeHeatmap, createHatchPattern };
27
27
  export { ScatterplotProps, ConnectedScatterplotProps, LineChartProps, AreaChartProps, DifferenceChartProps, StackedAreaChartProps, HeatmapProps, BubbleChartProps, BarChartProps, StackedBarChartProps, LikertChartProps, SwarmPlotProps, BoxPlotProps, HistogramProps, ViolinPlotProps, DotPlotProps, PieChartProps, DonutChartProps, GaugeChartProps, GaugeThreshold, FunnelChartProps, GroupedBarChartProps, SwimlaneChartProps, RidgelinePlotProps, OrbitDiagramProps, OrbitNode, ForceDirectedGraphProps, ChordDiagramProps, SankeyDiagramProps, ProcessSankeyProps, ProcessSankeyTick, TreeDiagramProps, TreemapProps, CirclePackProps, ScatterplotMatrixProps, MinimapChartProps, MinimapConfig, QuadrantChartProps, MultiAxisLineChartProps, MultiAxisSeriesConfig, CandlestickChartProps, QuadrantsConfig, QuadrantConfig, CenterlineStyle, BaseChartProps, AxisConfig, Accessor, ChartAccessor, ChartMode } from "./charts";
28
- export type { StreamXYFrameProps, StreamXYFrameHandle, StreamChartType, RuntimeMode, SceneNode, Changeset, StreamScales, StreamLayout, CurveType, CanvasRendererFn } from "./stream/types";
28
+ export type { StreamXYFrameProps, StreamXYFrameHandle, StreamChartType, RuntimeMode, SceneNode, Changeset, StreamScales, StreamLayout, CurveType, CanvasRendererFn, XYFrameAxisConfig, BandConfig } from "./stream/types";
29
29
  export type { StreamRendererFn } from "./stream/renderers/types";
30
30
  export type { StreamOrdinalFrameProps, StreamOrdinalFrameHandle, OrdinalChartType, OrdinalScales, OrdinalSceneNode } from "./stream/ordinalTypes";
31
31
  export type { StreamNetworkFrameProps, StreamNetworkFrameHandle, NetworkChartType, NetworkSceneNode, NetworkSceneEdge, NetworkLabel, ThresholdAlertConfig } from "./stream/networkTypes";
@@ -22,6 +22,7 @@ import type { StreamGeoFrameProps } from "../stream/geoTypes";
22
22
  import { type ThemeInput } from "./themeResolver";
23
23
  import { CHART_CONFIGS } from "./serverChartConfigs";
24
24
  type FrameType = "xy" | "ordinal" | "network" | "geo";
25
+ type StaticFrameProps = (StreamXYFrameProps | StreamNetworkFrameProps | StreamOrdinalFrameProps | StreamGeoFrameProps) & ThemeAwareProps;
25
26
  interface ThemeAwareProps {
26
27
  theme?: ThemeInput;
27
28
  showLegend?: boolean;
@@ -35,7 +36,7 @@ interface ThemeAwareProps {
35
36
  /** Prefix for SVG element IDs — used by renderDashboard to avoid collisions */
36
37
  _idPrefix?: string;
37
38
  }
38
- export declare function renderToStaticSVG(frameType: FrameType, props: (StreamXYFrameProps | StreamNetworkFrameProps | StreamOrdinalFrameProps | StreamGeoFrameProps) & ThemeAwareProps): string;
39
+ export declare function renderToStaticSVG(frameType: FrameType, props: StaticFrameProps): string;
39
40
  export declare function renderXYToStaticSVG(props: StreamXYFrameProps & ThemeAwareProps): string;
40
41
  export declare function renderOrdinalToStaticSVG(props: StreamOrdinalFrameProps & ThemeAwareProps): string;
41
42
  export declare function renderNetworkToStaticSVG(props: StreamNetworkFrameProps & ThemeAwareProps): string;
@@ -27,6 +27,7 @@ export declare const CHART_CONFIGS: {
27
27
  };
28
28
  };
29
29
  ConnectedScatterplot: ChartConfig;
30
+ QuadrantChart: ChartConfig;
30
31
  Heatmap: ChartConfig;
31
32
  BarChart: ChartConfig;
32
33
  StackedBarChart: ChartConfig;
@@ -29,7 +29,7 @@ interface AnnotationLayout {
29
29
  height: number;
30
30
  }
31
31
  export interface StaticAnnotationConfig {
32
- annotations: Datum[];
32
+ annotations?: Datum[];
33
33
  scales: AnnotationScales;
34
34
  layout: AnnotationLayout;
35
35
  theme: SemioticTheme;
@@ -6,7 +6,12 @@
6
6
  * No CSS custom properties — everything is concrete for inline SVG.
7
7
  */
8
8
  import type { SemioticTheme } from "../store/ThemeStore";
9
- export type ThemeInput = string | Partial<SemioticTheme> | undefined;
9
+ type PartialThemeObject = Omit<Partial<SemioticTheme>, "colors" | "typography" | "tooltip"> & {
10
+ colors?: Partial<SemioticTheme["colors"]>;
11
+ typography?: Partial<SemioticTheme["typography"]>;
12
+ tooltip?: Partial<NonNullable<SemioticTheme["tooltip"]>>;
13
+ };
14
+ export type ThemeInput = string | PartialThemeObject | undefined;
10
15
  /**
11
16
  * Resolve a theme input to a full SemioticTheme object.
12
17
  *
@@ -37,3 +42,4 @@ export declare function themeStyles(theme: SemioticTheme): {
37
42
  titleFontSize: number;
38
43
  tickFontFamily: string;
39
44
  };
45
+ export {};
@@ -90,6 +90,12 @@ export interface ThemeStoreState {
90
90
  theme: SemioticTheme;
91
91
  setTheme: (theme: ThemeStoreUpdate) => void;
92
92
  }
93
- export type ThemeStoreUpdate = Partial<SemioticTheme> | "light" | "dark" | "high-contrast";
93
+ export type SemioticThemeUpdate = Omit<Partial<SemioticTheme>, "colors" | "typography" | "tooltip" | "accessibility"> & {
94
+ colors?: Partial<SemioticTheme["colors"]>;
95
+ typography?: Partial<SemioticTheme["typography"]>;
96
+ tooltip?: Partial<NonNullable<SemioticTheme["tooltip"]>>;
97
+ accessibility?: Partial<NonNullable<SemioticTheme["accessibility"]>>;
98
+ };
99
+ export type ThemeStoreUpdate = SemioticThemeUpdate | "light" | "dark" | "high-contrast";
94
100
  export declare function resolveThemeUpdate(current: SemioticTheme, theme: ThemeStoreUpdate): SemioticTheme;
95
101
  export declare const ThemeProvider: import("react").FC<import("./createStore").StoreProviderProps<ThemeStoreState>>, useThemeSelector: <R>(selector: (state: ThemeStoreState) => R) => R;
@@ -1,14 +1,14 @@
1
1
  import * as React from "react";
2
2
  /** Scene node type used by the accessible data table — accepts any frame's scene nodes */
3
3
  type AnySceneNode = {
4
- type: string;
4
+ type?: string;
5
5
  [key: string]: any;
6
6
  };
7
7
  declare const SR_ONLY_STYLE: React.CSSProperties;
8
8
  /**
9
9
  * Compute an aria-label describing the chart type and data shape from the scene graph.
10
10
  */
11
- export declare function computeCanvasAriaLabel(scene: AnySceneNode[], chartType: string): string;
11
+ export declare function computeCanvasAriaLabel(scene: AnySceneNode[] | null | undefined, chartType: string): string;
12
12
  /**
13
13
  * Compute an aria-label for network charts from scene nodes and edges.
14
14
  */
@@ -1,8 +1,10 @@
1
1
  import type { Datum } from "../charts/shared/datumTypes";
2
2
  import { type Quadtree } from "d3-quadtree";
3
3
  import { RingBuffer } from "../realtime/RingBuffer";
4
- import type { Changeset, StreamChartType, StreamScales, StreamLayout, SceneNode, PointSceneNode, CandlestickStyle, Style, ArrowOfTime, WindowMode, DecayConfig, PulseConfig, TransitionConfig, StalenessConfig, CurveType, BarStyle, ThemeSemanticColors } from "./types";
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 CoercibleNumber } from "./accessorUtils";
5
6
  import type { ActiveTransition } from "./pipelineTransitionUtils";
7
+ import type { ResolvedRibbon } from "./xySceneBuilders/ribbonScene";
6
8
  import type { CustomLayout } from "./customLayout";
7
9
  import type { MarginType } from "../types/marginType";
8
10
  export interface PipelineConfig {
@@ -20,12 +22,12 @@ export interface PipelineConfig {
20
22
  * padded domain so glyphs at the extremes don't clip the plot edge. */
21
23
  axisExtent?: import("../charts/shared/axisExtent").AxisExtentMode;
22
24
  maxCapacity?: number;
23
- xAccessor?: string | ((d: Datum) => number);
24
- yAccessor?: string | ((d: Datum) => number);
25
- timeAccessor?: string | ((d: Datum) => number);
26
- valueAccessor?: string | ((d: Datum) => number);
25
+ xAccessor?: string | ((d: Datum) => CoercibleNumber);
26
+ yAccessor?: string | ((d: Datum) => CoercibleNumber);
27
+ timeAccessor?: string | ((d: Datum) => CoercibleNumber);
28
+ valueAccessor?: string | ((d: Datum) => CoercibleNumber);
27
29
  colorAccessor?: string | ((d: Datum) => string);
28
- sizeAccessor?: string | ((d: Datum) => number);
30
+ sizeAccessor?: string | ((d: Datum) => CoercibleNumber);
29
31
  groupAccessor?: string | ((d: Datum) => string);
30
32
  categoryAccessor?: string | ((d: Datum) => string);
31
33
  lineDataAccessor?: string;
@@ -40,16 +42,17 @@ export interface PipelineConfig {
40
42
  baseline?: "zero" | "wiggle" | "silhouette";
41
43
  /** Stack order — see StreamXYFrameProps.stackOrder. */
42
44
  stackOrder?: "key" | "insideOut" | "asc" | "desc";
43
- openAccessor?: string | ((d: Datum) => number);
44
- highAccessor?: string | ((d: Datum) => number);
45
- lowAccessor?: string | ((d: Datum) => number);
46
- closeAccessor?: string | ((d: Datum) => number);
45
+ openAccessor?: string | ((d: Datum) => CoercibleNumber);
46
+ highAccessor?: string | ((d: Datum) => CoercibleNumber);
47
+ lowAccessor?: string | ((d: Datum) => CoercibleNumber);
48
+ closeAccessor?: string | ((d: Datum) => CoercibleNumber);
47
49
  candlestickStyle?: CandlestickStyle;
48
50
  /** Internal: set by PipelineStore when open/close accessors are both missing */
49
51
  candlestickRangeMode?: boolean;
50
- boundsAccessor?: string | ((d: Datum) => number);
52
+ boundsAccessor?: string | ((d: Datum) => CoercibleNumber);
51
53
  boundsStyle?: any;
52
- y0Accessor?: string | ((d: Datum) => number);
54
+ y0Accessor?: string | ((d: Datum) => CoercibleNumber);
55
+ band?: BandConfig | BandConfig[];
53
56
  gradientFill?: {
54
57
  topOpacity: number;
55
58
  bottomOpacity: number;
@@ -149,8 +152,12 @@ export declare class PipelineStore {
149
152
  private getCategory;
150
153
  private getSize;
151
154
  private getColor;
152
- private getBounds;
153
155
  private getY0;
156
+ /** Unified ribbon list — `boundsAccessor` + `band` both compose into
157
+ * this single array (see `resolveRibbons`). Read by the scene
158
+ * builders, y-extent expansion, and tooltip enrichment (which
159
+ * filters on `kind === "band"`). Empty when neither prop is set. */
160
+ resolvedRibbons: ResolvedRibbon[];
154
161
  private getOpen;
155
162
  private getHigh;
156
163
  private getLow;
@@ -1,36 +1,9 @@
1
1
  import type { Datum } from "../charts/shared/datumTypes";
2
- import type { StreamScales, MarginalGraphicsConfig } from "./types";
2
+ import type { StreamScales, MarginalGraphicsConfig, XYFrameAxisConfig } from "./types";
3
3
  import type { AnnotationContext } from "../realtime/types";
4
4
  import type { ReactNode } from "react";
5
5
  import type { LegendGroup, GradientLegendConfig } from "../types/legendTypes";
6
- export interface AxisConfig {
7
- orient: "left" | "right" | "top" | "bottom";
8
- label?: string;
9
- ticks?: number;
10
- tickFormat?: (d: any, index?: number, allTicks?: number[]) => string | ReactNode;
11
- baseline?: boolean | "under";
12
- jaggedBase?: boolean;
13
- /** Explicit tick values. When provided, bypasses both d3's "nice"
14
- * generator and `axisExtent: "exact"` — the caller has hand-picked
15
- * the positions. Pixel-distance filtering downstream still drops
16
- * overlapping labels. Accepts `number | Date`: values pass through
17
- * to the scale (d3-scale's `scaleTime` reads Dates natively;
18
- * `scaleLinear` accepts numbers — feeding a Date into a linear
19
- * scale via `valueOf()` works at runtime but `tickFormat` receives
20
- * the Date as-is, so user formatters should match the axis's
21
- * underlying scale type). Mirrors the ordinal frame's
22
- * `rTickValues` contract. */
23
- tickValues?: Array<number | Date>;
24
- /** Grid line stroke style: "dashed" (6,4), "dotted" (2,4), or a custom strokeDasharray string. Applied to grid lines extending from ticks across the chart area. */
25
- gridStyle?: "dashed" | "dotted" | string;
26
- /** Always include the domain max as a tick, even if d3 omits it. */
27
- includeMax?: boolean;
28
- /** Auto-rotate labels 45° when horizontal spacing is too tight. */
29
- autoRotate?: boolean;
30
- /** Highlight ticks at time boundaries (new month, year, etc.) with semibold text.
31
- * `true` auto-detects Date boundaries. A function receives (value, index) and returns true for landmark ticks. */
32
- landmarkTicks?: boolean | ((value: any, index: number) => boolean);
33
- }
6
+ export type AxisConfig = XYFrameAxisConfig;
34
7
  interface SVGOverlayProps {
35
8
  width: number;
36
9
  height: number;
@@ -12,6 +12,7 @@
12
12
  * the variable in the dependency array so the reference changes when behavior changes.
13
13
  */
14
14
  export declare function accessorsEquivalent(a: string | ((...args: any[]) => any) | undefined, b: string | ((...args: any[]) => any) | undefined): boolean;
15
- export declare function resolveAccessor<T extends Record<string, unknown>>(accessor: string | ((d: T) => number) | undefined, fallback: string): (d: T) => number;
15
+ export type CoercibleNumber = number | Date | string;
16
+ export declare function resolveAccessor<T extends Record<string, unknown>>(accessor: string | ((d: T) => CoercibleNumber) | undefined, fallback: string): (d: T) => number;
16
17
  export declare function resolveRawAccessor<T extends Record<string, unknown>>(accessor: string | ((d: T) => unknown) | undefined, fallback: string): (d: T) => unknown;
17
18
  export declare function resolveStringAccessor<T extends Record<string, unknown>>(accessor: string | ((d: T) => string) | undefined, fallback?: string): ((d: T) => string) | undefined;
@@ -5,7 +5,7 @@ import type { NetworkLayoutPlugin } from "../networkTypes";
5
5
  * Uses d3-hierarchy for all layout computations. This plugin is `hierarchical: true`,
6
6
  * meaning the input data is a single root node object rather than flat nodes+edges arrays.
7
7
  *
8
- * The hierarchy root is passed via `(config as any).__hierarchyRoot`, set by the store
8
+ * The hierarchy root is passed via `config.__hierarchyRoot`, set by the store
9
9
  * before calling computeLayout. The plugin builds the d3 hierarchy internally, runs the
10
10
  * appropriate layout algorithm, and populates the nodes/edges arrays.
11
11
  *
@@ -262,9 +262,20 @@ export interface NetworkLineEdge {
262
262
  export interface NetworkBezierEdge {
263
263
  type: "bezier";
264
264
  pathD: string;
265
+ /** When false, the hit tester skips this edge. Used for
266
+ * decorative scene-edges like ProcessSankey's gradient stubs —
267
+ * they paint visually but shouldn't intercept hover. */
268
+ interactive?: boolean;
265
269
  bezierCache?: BezierCache;
266
270
  style: Style;
267
271
  datum: SceneDatum;
272
+ /** Internal gradient used by circular sankey stub bands. */
273
+ _gradient?: {
274
+ x0: number;
275
+ x1: number;
276
+ from: number;
277
+ to: number;
278
+ };
268
279
  _pulseIntensity?: number;
269
280
  _pulseColor?: string;
270
281
  /** Lazily-built Path2D for hit testing; invalidated when pathD changes. */
@@ -21,8 +21,22 @@ export interface WedgeSceneNode {
21
21
  startAngle: number;
22
22
  /** End angle in radians, canvas convention */
23
23
  endAngle: number;
24
- /** Corner radius for rounded wedge arcs (d3-shape arc.cornerRadius) */
24
+ /** Corner radius for rounded wedge arcs (d3-shape arc.cornerRadius).
25
+ * When set on its own, rounds ALL FOUR corners (the d3-shape default).
26
+ * Pair with `roundedEnds` to round only the gauge's outer endpoints —
27
+ * the swimlane analogue for radial sectors: first wedge's start side
28
+ * + last wedge's end side rounded, internal zone seams stay square. */
25
29
  cornerRadius?: number;
30
+ /** Selective per-end rounding. When omitted, `cornerRadius` rounds all
31
+ * four corners. When provided, `cornerRadius` rounds ONLY the sides
32
+ * marked `true` — `{ start: true }` rounds the wedge's startAngle
33
+ * side (both inner and outer corners at that angle), `{ end: true }`
34
+ * rounds the endAngle side. The gauge scene builder uses this to
35
+ * paint outer endpoints rounded but internal zone seams square. */
36
+ roundedEnds?: {
37
+ start?: boolean;
38
+ end?: boolean;
39
+ };
26
40
  style: Style;
27
41
  datum: SceneDatum;
28
42
  category?: string;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Annular sector path builder with selective per-end corner rounding.
3
+ *
4
+ * d3-shape's `arc().cornerRadius()` rounds ALL FOUR corners of an
5
+ * annular sector uniformly — there's no built-in per-corner control.
6
+ * For gauges with multiple zones we want the gauge's OUTER endpoints
7
+ * rounded (the swimlane convention applied radially) but internal zone
8
+ * seams to stay square. This helper builds the path manually so each
9
+ * end can be opted in independently.
10
+ *
11
+ * The geometry mirrors d3's algorithm: a corner circle of radius `cr`
12
+ * is inscribed tangent to both walls (the outer/inner arc and the
13
+ * radial line at the relevant angle). The angular setback from the
14
+ * radial line is `asin(cr / (R ± cr))` — `R - cr` for outer corners
15
+ * (corner centers sit `cr` inward of the outer arc), `R + cr` for
16
+ * inner corners.
17
+ *
18
+ * Returned shape is an SVG path `d` attribute, equivalently consumable
19
+ * by Path2D in canvas. Coordinates are wedge-local (centered at
20
+ * origin); the renderer translates to `(cx, cy)`.
21
+ *
22
+ * Inputs use the **canvas angle convention** (0 = 3 o'clock, positive
23
+ * clockwise) — same as `WedgeSceneNode.startAngle/endAngle`. d3-shape
24
+ * uses 0 = 12 o'clock, so callers that pre-rotated by `+π/2` to call
25
+ * d3-arc should NOT pre-rotate when calling this helper.
26
+ */
27
+ export interface AnnularPathOptions {
28
+ innerRadius: number;
29
+ outerRadius: number;
30
+ startAngle: number;
31
+ endAngle: number;
32
+ cornerRadius?: number;
33
+ /** Round the side at startAngle (both inner + outer corners there). */
34
+ roundStart?: boolean;
35
+ /** Round the side at endAngle (both inner + outer corners there). */
36
+ roundEnd?: boolean;
37
+ }
38
+ /**
39
+ * Build the SVG path for an annular sector with per-end rounding.
40
+ *
41
+ * When `cornerRadius` is 0 or unset, OR neither `roundStart` nor
42
+ * `roundEnd` is true, the result is a plain unrounded sector — same
43
+ * shape `drawWedgeManual` would emit. When both ends are rounded with
44
+ * a single cornerRadius value, the output matches what d3-arc would
45
+ * produce. The novel case is mixed rounding: e.g. `roundStart: true,
46
+ * roundEnd: false` rounds only the gauge's leading edge.
47
+ *
48
+ * Defensive clamps:
49
+ * - `cornerRadius` is clamped to `(outerRadius - innerRadius) / 2`
50
+ * so the corner circles can't cross the ring's centerline (which
51
+ * would invert the inner radial line).
52
+ * - If the angular sweep is too small to fit two corner radii
53
+ * end-to-end on the requested side, that side falls back to
54
+ * unrounded so the path stays well-formed.
55
+ */
56
+ export declare function annularSectorPath(opts: AnnularPathOptions): string;
@@ -4,6 +4,7 @@ import type { AnimateProp } from "./pipelineTransitionUtils";
4
4
  import type { LegendGroup, GradientLegendConfig } from "../types/legendTypes";
5
5
  import type { ArrowOfTime, WindowMode, LineStyle, BarStyle, WaterfallStyle, SwarmStyle, HoverAnnotationConfig, HoverData, AnnotationContext, AnnotationAnchorMode } from "../realtime/types";
6
6
  import type { Datum } from "../charts/shared/datumTypes";
7
+ import type { CoercibleNumber } from "./accessorUtils";
7
8
  export type SceneDatum = Datum | null;
8
9
  export type SeriesDatum = Datum[] | null;
9
10
  export type AxisTickFormat = ((d: number, index?: number, allTicks?: number[]) => string) | ((d: string, index?: number, allTicks?: number[]) => string) | ((d: Date, index?: number, allTicks?: number[]) => string);
@@ -89,6 +90,10 @@ export interface Style {
89
90
  icon?: HTMLImageElement | HTMLCanvasElement;
90
91
  /** Padding between stamped icons */
91
92
  iconPadding?: number;
93
+ /** Optional radius when style callbacks drive point size directly. */
94
+ r?: number;
95
+ /** Internal geo line flag: fade line ends at projection clipping edges. */
96
+ _edgeFade?: boolean;
92
97
  }
93
98
  export type SceneNode = LineSceneNode | AreaSceneNode | PointSceneNode | RectSceneNode | HeatcellSceneNode | CandlestickSceneNode;
94
99
  export interface LineColorThreshold {
@@ -369,6 +374,86 @@ export interface StreamLayout {
369
374
  height: number;
370
375
  }
371
376
  export type CurveType = "linear" | "monotoneX" | "monotoneY" | "step" | "stepAfter" | "stepBefore" | "basis" | "cardinal" | "catmullRom" | "natural";
377
+ /**
378
+ * Asymmetric min/max envelope drawn under lines/areas. Data-driven cousin
379
+ * of `boundsAccessor` (which takes a single symmetric ±offset). Use for
380
+ * throughput min/max ribbons, percentile bands (p5–p95), SLO ranges, and
381
+ * fan charts (pass an array of bands).
382
+ *
383
+ * Painted with the parent series color at 0.2 fillOpacity by default.
384
+ * Override with `style`. Non-interactive by default; participates in
385
+ * y-extent auto-derivation so it can't clip.
386
+ */
387
+ export interface BandConfig<T = Datum> {
388
+ /** Bottom of the band — field name or accessor function. */
389
+ y0Accessor: string | ((d: T) => number);
390
+ /** Top of the band — field name or accessor function. */
391
+ y1Accessor: string | ((d: T) => number);
392
+ /**
393
+ * Style override. Defaults to the parent line/area color at 0.2
394
+ * fillOpacity, matching the `boundsStyle` cascade.
395
+ */
396
+ style?: Style | ((d: T, group?: string) => Style);
397
+ /**
398
+ * When the parent chart groups by `lineBy` / `colorBy`:
399
+ * - `true` (default): one band per group, colored to match the line
400
+ * - `false`: a single band drawn across the whole dataset (e.g. an
401
+ * aggregate min/max across all series)
402
+ */
403
+ perSeries?: boolean;
404
+ /**
405
+ * Whether the band area participates in hit testing. Defaults to
406
+ * `false` — the band is decorative; hover/click pass through to the
407
+ * line on top. Independent of the `datum.band` enrichment, which
408
+ * happens whenever a band is configured.
409
+ */
410
+ interactive?: boolean;
411
+ }
412
+ /**
413
+ * Per-axis configuration object for an XY frame's `axes: []` array.
414
+ * Distinct from `AxisConfig` exported from the HOC layer (which is the
415
+ * chart-level `xLabel` / `yLabel` / `xFormat` / `yFormat` bundle) —
416
+ * this type describes one axis at a time and is what
417
+ * `frameProps.axes[i]` consumes.
418
+ *
419
+ * Re-exported under the legacy name `AxisConfig` from `SVGOverlay.tsx`
420
+ * for backwards-compatibility with internal callers; new code should
421
+ * import this name directly.
422
+ */
423
+ export interface XYFrameAxisConfig {
424
+ orient: "left" | "right" | "top" | "bottom";
425
+ label?: string;
426
+ ticks?: number;
427
+ /** Per-axis tick label formatter. ReactNode return is supported and
428
+ * renders inside a `<foreignObject>`. */
429
+ tickFormat?: (d: any, index?: number, allTicks?: number[]) => string | ReactNode;
430
+ baseline?: boolean | "under";
431
+ jaggedBase?: boolean;
432
+ /** Explicit tick values. When provided, bypasses both d3's "nice"
433
+ * generator and `axisExtent: "exact"` — the caller has hand-picked
434
+ * the positions. Pixel-distance filtering downstream still drops
435
+ * overlapping labels. Mirrors the ordinal frame's `rTickValues`. */
436
+ tickValues?: Array<number | Date>;
437
+ /** Grid line stroke style: `"dashed"` (6,4), `"dotted"` (2,4), or a
438
+ * custom strokeDasharray string. Applied to grid lines extending
439
+ * from ticks across the chart area. */
440
+ gridStyle?: "dashed" | "dotted" | string;
441
+ /** Always include the domain max as a tick, even if d3 omits it. */
442
+ includeMax?: boolean;
443
+ /** Auto-rotate labels 45° when horizontal spacing is too tight. */
444
+ autoRotate?: boolean;
445
+ /** Highlight ticks at time boundaries (new month, year, etc.) with
446
+ * semibold text. `true` auto-detects Date boundaries. A function
447
+ * receives (value, index) and returns true for landmark ticks. */
448
+ landmarkTicks?: boolean | ((value: any, index: number) => boolean);
449
+ /** Tick label anchoring strategy:
450
+ * - `"middle"` (default): all tick labels centered on the tick mark
451
+ * - `"edges"`: first tick label anchors to start, last to end,
452
+ * middles stay centered. Pairs naturally with `axisExtent: "exact"`
453
+ * — pins the domain to the data min/max AND keeps the extreme
454
+ * labels from overflowing the plot. */
455
+ tickAnchor?: "middle" | "edges";
456
+ }
372
457
  export interface StreamXYFrameProps<T = Datum> {
373
458
  chartType: StreamChartType;
374
459
  runtimeMode?: RuntimeMode;
@@ -377,10 +462,10 @@ export interface StreamXYFrameProps<T = Datum> {
377
462
  chunkThreshold?: number;
378
463
  /** Number of items per progressive chunk (default 5000) */
379
464
  chunkSize?: number;
380
- xAccessor?: string | ((d: T) => number);
381
- yAccessor?: string | ((d: T) => number);
465
+ xAccessor?: string | ((d: T) => CoercibleNumber);
466
+ yAccessor?: string | ((d: T) => CoercibleNumber);
382
467
  colorAccessor?: string | ((d: T) => string);
383
- sizeAccessor?: string | ((d: T) => number);
468
+ sizeAccessor?: string | ((d: T) => CoercibleNumber);
384
469
  groupAccessor?: string | ((d: T) => string);
385
470
  lineDataAccessor?: string;
386
471
  curve?: CurveType;
@@ -445,6 +530,19 @@ export interface StreamXYFrameProps<T = Datum> {
445
530
  * If omitted, defaults to the line color at 0.2 opacity.
446
531
  */
447
532
  boundsStyle?: Style | ((d: T, group?: string) => Style);
533
+ /**
534
+ * Asymmetric min/max band(s) drawn under the line/area. Differs from
535
+ * `boundsAccessor` (which is a symmetric ±offset) and from `y0Accessor`
536
+ * (which replaces the area baseline). A band is a decorative envelope
537
+ * — painted under the lines, above the grid, non-interactive by default
538
+ * — driven by per-point `y0`/`y1` accessors.
539
+ *
540
+ * Pass an array for multi-band fan charts (e.g. p25/p75 inside p10/p90).
541
+ * Outer bands first; inner bands stack on top.
542
+ *
543
+ * Participates in y-extent auto-derivation when `yExtent` is not pinned.
544
+ */
545
+ band?: BandConfig<T> | Array<BandConfig<T>>;
448
546
  openAccessor?: string | ((d: T) => number);
449
547
  highAccessor?: string | ((d: T) => number);
450
548
  lowAccessor?: string | ((d: T) => number);
@@ -488,18 +586,13 @@ export interface StreamXYFrameProps<T = Datum> {
488
586
  barColors?: Record<string, string>;
489
587
  colorScheme?: string | string[];
490
588
  showAxes?: boolean;
491
- axes?: Array<{
492
- orient: "left" | "right" | "top" | "bottom";
493
- label?: string;
494
- ticks?: number;
495
- /** Explicit tick values. When provided, bypasses both d3's nice-tick
496
- * generator and `axisExtent`; pixel-distance filtering still drops
497
- * overlapping labels. Mirrors the ordinal frame's `rTickValues`. */
498
- tickValues?: Array<number | Date>;
499
- tickFormat?: AxisTickFormat;
500
- baseline?: boolean | "under";
501
- jaggedBase?: boolean;
502
- }>;
589
+ /**
590
+ * Per-axis config array. See `XYFrameAxisConfig` for the full set of
591
+ * fields — covers `tickValues`, `tickFormat`, `tickAnchor`,
592
+ * `landmarkTicks`, `autoRotate`, `gridStyle`, `includeMax`,
593
+ * `baseline`, `jaggedBase`, `label`, and `ticks`.
594
+ */
595
+ axes?: XYFrameAxisConfig[];
503
596
  xLabel?: string;
504
597
  yLabel?: string;
505
598
  /** Label for the right Y axis (dual-axis charts) */
@@ -0,0 +1,20 @@
1
+ import type { AreaSceneNode } from "../types";
2
+ type ResolvedAreaGradient = NonNullable<AreaSceneNode["fillGradient"]>;
3
+ type OpacityGradient = {
4
+ topOpacity: number;
5
+ bottomOpacity: number;
6
+ };
7
+ type ColorStopGradient = {
8
+ colorStops: Array<{
9
+ offset: number;
10
+ color: string;
11
+ }>;
12
+ };
13
+ type OpacityGradientConfig = {
14
+ topOpacity?: number;
15
+ bottomOpacity?: number;
16
+ };
17
+ export type AreaGradientConfig = boolean | OpacityGradientConfig | ColorStopGradient;
18
+ export declare const DEFAULT_AREA_GRADIENT: OpacityGradient;
19
+ export declare function resolveAreaGradient(gradient: AreaGradientConfig | undefined): ResolvedAreaGradient | undefined;
20
+ export {};
@@ -9,10 +9,10 @@ import type { Datum } from "../../charts/shared/datumTypes";
9
9
  * Dependencies: BinAccumulator (computeBins), SceneGraph (buildRectNode)
10
10
  * Consumed by: PipelineStore.buildSceneNodes (chartType "bar")
11
11
  */
12
- import type { SceneNode } from "../types";
12
+ import type { RectSceneNode } from "../types";
13
13
  import type { XYSceneContext } from "./types";
14
14
  export interface BarSceneResult {
15
- nodes: SceneNode[];
15
+ nodes: RectSceneNode[];
16
16
  /** Sorted bin boundary values (edges of all bins) for data-driven brush snapping */
17
17
  binBoundaries: number[];
18
18
  }
@@ -6,6 +6,6 @@ import type { Datum } from "../../charts/shared/datumTypes";
6
6
  *
7
7
  * Consumed by: PipelineStore.buildSceneNodes (chartType "candlestick")
8
8
  */
9
- import type { SceneNode, StreamLayout } from "../types";
9
+ import type { CandlestickSceneNode, StreamLayout } from "../types";
10
10
  import type { XYSceneContext } from "./types";
11
- export declare function buildCandlestickScene(ctx: XYSceneContext, data: Datum[], _layout: StreamLayout): SceneNode[];
11
+ export declare function buildCandlestickScene(ctx: XYSceneContext, data: Datum[], _layout: StreamLayout): CandlestickSceneNode[];
@@ -1,4 +1,4 @@
1
1
  import type { Datum } from "../../charts/shared/datumTypes";
2
- import type { SceneNode, StreamLayout } from "../types";
2
+ import type { HeatcellSceneNode, StreamLayout } from "../types";
3
3
  import type { XYSceneContext } from "./types";
4
- export declare function buildHeatmapScene(ctx: XYSceneContext, data: Datum[], layout: StreamLayout): SceneNode[];
4
+ export declare function buildHeatmapScene(ctx: XYSceneContext, data: Datum[], layout: StreamLayout): HeatcellSceneNode[];
@@ -2,10 +2,11 @@ import type { Datum } from "../../charts/shared/datumTypes";
2
2
  /**
3
3
  * Line scene builder — produces LineSceneNode[] from grouped data.
4
4
  *
5
- * Handles: color thresholds from annotations, bounds/envelope areas,
6
- * and curve type attachment for canvas interpolation.
5
+ * Handles: color thresholds from annotations, ribbon envelopes
6
+ * (boundsAccessor + band), and curve type attachment for canvas
7
+ * interpolation.
7
8
  *
8
- * Dependencies: SceneGraph (buildLineNode), boundsScene (buildBoundsForGroup)
9
+ * Dependencies: SceneGraph (buildLineNode), ribbonScene (buildRibbon*)
9
10
  * Consumed by: PipelineStore.buildSceneNodes (chartType "line")
10
11
  */
11
12
  import type { SceneNode } from "../types";
@@ -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 { SceneNode } from "../types";
11
+ import type { PointSceneNode } from "../types";
12
12
  import type { XYSceneContext } from "./types";
13
- export declare function buildPointScene(ctx: XYSceneContext, data: Datum[]): SceneNode[];
13
+ export declare function buildPointScene(ctx: XYSceneContext, data: Datum[]): PointSceneNode[];