semiotic 3.5.3 → 3.5.4

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 (63) hide show
  1. package/CLAUDE.md +2 -2
  2. package/README.md +5 -5
  3. package/ai/componentMetadata.cjs +9 -2
  4. package/ai/dist/mcp-server.js +4 -1
  5. package/ai/examples.md +27 -0
  6. package/ai/schema.json +286 -41
  7. package/ai/system-prompt.md +1 -1
  8. package/dist/components/charts/index.d.ts +3 -3
  9. package/dist/components/charts/network/Treemap.d.ts +8 -0
  10. package/dist/components/charts/ordinal/GaugeChart.d.ts +10 -0
  11. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +22 -0
  12. package/dist/components/charts/shared/gaugeGradient.d.ts +62 -0
  13. package/dist/components/charts/shared/hooks.d.ts +2 -2
  14. package/dist/components/charts/shared/streamPropsHelpers.d.ts +2 -2
  15. package/dist/components/charts/shared/types.d.ts +11 -2
  16. package/dist/components/charts/shared/useChartSetup.d.ts +2 -2
  17. package/dist/components/charts/shared/useCustomChartSetup.d.ts +1 -1
  18. package/dist/components/charts/xy/AreaChart.d.ts +15 -0
  19. package/dist/components/semiotic-ai.d.ts +1 -1
  20. package/dist/components/semiotic-realtime.d.ts +3 -3
  21. package/dist/components/semiotic-server.d.ts +1 -0
  22. package/dist/components/semiotic-xy.d.ts +1 -1
  23. package/dist/components/semiotic.d.ts +5 -4
  24. package/dist/components/server/renderToStaticSVG.d.ts +2 -0
  25. package/dist/components/server/staticLegend.d.ts +35 -0
  26. package/dist/components/store/ThemeStore.d.ts +2 -0
  27. package/dist/components/stream/NetworkSVGOverlay.d.ts +2 -1
  28. package/dist/components/stream/OrdinalSVGOverlay.d.ts +2 -1
  29. package/dist/components/stream/SVGOverlay.d.ts +2 -1
  30. package/dist/components/stream/SceneToSVG.d.ts +1 -1
  31. package/dist/components/stream/geoTypes.d.ts +2 -1
  32. package/dist/components/stream/hoverUtils.d.ts +1 -0
  33. package/dist/components/stream/legendRenderer.d.ts +2 -1
  34. package/dist/components/stream/networkTypes.d.ts +2 -1
  35. package/dist/components/stream/ordinalTypes.d.ts +16 -2
  36. package/dist/components/stream/renderers/wedgePathBuilder.d.ts +31 -0
  37. package/dist/components/stream/types.d.ts +2 -1
  38. package/dist/components/types/legendTypes.d.ts +15 -0
  39. package/dist/components/types/marginType.d.ts +17 -3
  40. package/dist/geo.min.js +1 -1
  41. package/dist/geo.module.min.js +1 -1
  42. package/dist/network.min.js +1 -1
  43. package/dist/network.module.min.js +1 -1
  44. package/dist/ordinal.min.js +1 -1
  45. package/dist/ordinal.module.min.js +1 -1
  46. package/dist/realtime.min.js +1 -1
  47. package/dist/realtime.module.min.js +1 -1
  48. package/dist/semiotic-ai.d.ts +1 -1
  49. package/dist/semiotic-ai.min.js +1 -1
  50. package/dist/semiotic-ai.module.min.js +1 -1
  51. package/dist/semiotic-realtime.d.ts +3 -3
  52. package/dist/semiotic-server.d.ts +1 -0
  53. package/dist/semiotic-utils.min.js +1 -1
  54. package/dist/semiotic-utils.module.min.js +1 -1
  55. package/dist/semiotic-xy.d.ts +1 -1
  56. package/dist/semiotic.d.ts +5 -4
  57. package/dist/semiotic.min.js +1 -1
  58. package/dist/semiotic.module.min.js +1 -1
  59. package/dist/server.min.js +1 -1
  60. package/dist/server.module.min.js +1 -1
  61. package/dist/xy.min.js +1 -1
  62. package/dist/xy.module.min.js +1 -1
  63. package/package.json +13 -21
@@ -19,6 +19,14 @@ export interface TreemapProps<TNode extends Datum = Datum> extends BaseChartProp
19
19
  nodeLabel?: ChartAccessor<TNode, string>;
20
20
  padding?: number;
21
21
  paddingTop?: number;
22
+ /**
23
+ * Per-node style overlay. The returned style is merged on top of
24
+ * Treemap's built-in colorBy/colorByDepth/default fill, then primitive
25
+ * props and selection state are applied. Use this for root hiding,
26
+ * custom borders, or per-depth opacity without re-implementing color
27
+ * encoding.
28
+ */
29
+ nodeStyle?: (d: Datum) => Datum;
22
30
  enableHover?: boolean;
23
31
  legendInteraction?: LegendInteractionMode;
24
32
  tooltip?: TooltipProp;
@@ -4,6 +4,7 @@ import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
4
4
  import type { BaseChartProps } from "../shared/types";
5
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
6
  import type { RealtimeFrameHandle } from "../../realtime/types";
7
+ import { type GaugeGradientFill } from "../shared/gaugeGradient";
7
8
  export interface GaugeThreshold {
8
9
  /** Upper bound of this zone (value, not percentage) */
9
10
  value: number;
@@ -21,6 +22,15 @@ export interface GaugeChartProps extends BaseChartProps {
21
22
  max?: number;
22
23
  /** Threshold zones — ordered list of { value, color, label? }. Last threshold's value should equal max. */
23
24
  thresholds?: GaugeThreshold[];
25
+ /**
26
+ * Arc-length gradient for the gauge band.
27
+ *
28
+ * The gradient is sampled along the visible filled arc from sweep start
29
+ * toward the current value. If `fillZones` is false, the entire arc uses
30
+ * the gradient. If `fillZones` is true, the unfilled remainder stays on
31
+ * `backgroundColor`.
32
+ */
33
+ gradientFill?: GaugeGradientFill;
24
34
  /** Color of the value arc when no thresholds defined (default: theme primary) */
25
35
  color?: string;
26
36
  /** Background arc color (default: var(--semiotic-grid, #e0e0e0)) */
@@ -6,6 +6,7 @@ import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
6
6
  import type { ChartMode, ChartAccessor, SelectionConfig } from "../shared/types";
7
7
  import type { OnObservationCallback } from "../../store/ObservationStore";
8
8
  import type { Datum } from "../shared/datumTypes";
9
+ export type RealtimeHistogramDirection = "up" | "down";
9
10
  export interface RealtimeHistogramProps<TDatum extends Datum = Datum> {
10
11
  /** Display mode: "primary" (full chrome), "context" (compact), "sparkline" (inline) */
11
12
  mode?: ChartMode;
@@ -44,6 +45,14 @@ export interface RealtimeHistogramProps<TDatum extends Datum = Datum> {
44
45
  timeExtent?: [number, number];
45
46
  /** Fixed value domain */
46
47
  valueExtent?: [number, number];
48
+ /**
49
+ * Direction bars grow from the baseline.
50
+ * "up" uses the normal y-domain. "down" flips the resolved value
51
+ * domain so bars grow downward from the top, useful for mirrored
52
+ * histogram layouts. Explicit valueExtent is reversed.
53
+ * @default "up"
54
+ */
55
+ direction?: RealtimeHistogramDirection;
47
56
  /** Extent padding factor */
48
57
  extentPadding?: number;
49
58
  /**
@@ -175,6 +184,19 @@ export declare const RealtimeHistogram: {
175
184
  <TDatum extends Datum = Datum>(props: RealtimeHistogramProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
176
185
  displayName?: string;
177
186
  };
187
+ export interface TemporalHistogramProps<TDatum extends Datum = Datum> extends Omit<RealtimeHistogramProps<TDatum>, "data" | "windowSize" | "windowMode"> {
188
+ /** Static data array for a bounded temporal histogram. */
189
+ data: TDatum[];
190
+ }
191
+ /**
192
+ * Static-data sibling for temporal histograms. Use this when the data is a
193
+ * bounded array rather than a ref-driven stream; the realtime push API is not
194
+ * part of this public surface.
195
+ */
196
+ export declare function TemporalHistogram<TDatum extends Datum = Datum>(props: TemporalHistogramProps<TDatum>): import("react/jsx-runtime").JSX.Element;
197
+ export declare namespace TemporalHistogram {
198
+ var displayName: string;
199
+ }
178
200
  /** @deprecated Use `RealtimeHistogram` (the canonical public name) instead. The
179
201
  * `RealtimeTemporalHistogram` alias is preserved for back-compat with code
180
202
  * written before the rename and will be removed in a future major version. */
@@ -0,0 +1,62 @@
1
+ import type { Datum } from "./datumTypes";
2
+ export interface GaugeThresholdLike {
3
+ value: number;
4
+ color: string;
5
+ label?: string;
6
+ }
7
+ export interface GaugeGradientStop {
8
+ offset: number;
9
+ color: string;
10
+ }
11
+ export interface GaugeGradientFill {
12
+ colorStops: GaugeGradientStop[];
13
+ }
14
+ export interface GaugeArcDatum extends Datum {
15
+ category: string;
16
+ value: number;
17
+ _zone?: string;
18
+ _isFill: boolean;
19
+ _pctStart?: number;
20
+ _pct?: number;
21
+ _roundedEnds?: {
22
+ start?: boolean;
23
+ end?: boolean;
24
+ };
25
+ _nonInteractive?: boolean;
26
+ /** Pre-computed gradient colors for the rendered band. Each entry is
27
+ * the color for one equal-angle slice across the band's full angular
28
+ * span. The wedge renderer reads this and paints the slices itself
29
+ * inside a clip-mask shaped like the wedge's rounded outline. */
30
+ _gradientBand?: {
31
+ colors: string[];
32
+ };
33
+ }
34
+ export interface GaugeArcModel {
35
+ gaugeData: GaugeArcDatum[];
36
+ pieceStyle: (d: Datum, category?: string) => {
37
+ fill: string;
38
+ opacity?: number;
39
+ };
40
+ gaugeAnnotations: Datum[];
41
+ }
42
+ interface BuildGaugeArcModelOptions {
43
+ min: number;
44
+ max: number;
45
+ value: number;
46
+ thresholds?: GaugeThresholdLike[];
47
+ fillColor?: string;
48
+ backgroundColor: string;
49
+ fillZones: boolean;
50
+ showScaleLabels: boolean;
51
+ gradientFill?: GaugeGradientFill;
52
+ gradientSteps?: number;
53
+ }
54
+ /**
55
+ * Build the synthetic wedge data model used by GaugeChart.
56
+ *
57
+ * When `gradientFill` is provided, the visible fill is split into many thin
58
+ * slices and sampled against the supplied color stops so color changes along
59
+ * the arc length rather than by threshold zone.
60
+ */
61
+ export declare function buildGaugeArcModel(options: BuildGaugeArcModelOptions): GaugeArcModel;
62
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { createLegend } from "./legendUtils";
2
2
  import type { SelectionHookResult } from "./selectionUtils";
3
3
  import type { OnObservationCallback } from "../../store/ObservationStore";
4
- import type { Accessor, SelectionConfig, LinkedHoverProp, ChartMode } from "./types";
4
+ import type { Accessor, SelectionConfig, LinkedHoverProp, ChartMode, HoverHighlightMode } from "./types";
5
5
  import type { MarginType, PartialMargin } from "../../types/marginType";
6
6
  import type { TransitionConfig } from "../../stream/types";
7
7
  import type { Datum } from "./datumTypes";
@@ -76,7 +76,7 @@ export declare function useChartSelection({ selection, linkedHover, fallbackFiel
76
76
  x: number;
77
77
  y: number;
78
78
  }) => void;
79
- hoverHighlight?: boolean;
79
+ hoverHighlight?: HoverHighlightMode;
80
80
  colorByField?: string;
81
81
  }): {
82
82
  activeSelectionHook: SelectionHookResult | null;
@@ -2,7 +2,7 @@ import type { ReactNode } from "react";
2
2
  import type { Datum } from "./datumTypes";
3
3
  import { type TooltipProp } from "../../Tooltip/Tooltip";
4
4
  import type { HoverData } from "../../realtime/types";
5
- import type { LinkedHoverProp, SelectionConfig } from "./types";
5
+ import type { HoverHighlightMode, LinkedHoverProp, SelectionConfig } from "./types";
6
6
  import type { OnObservationCallback } from "../../store/ObservationStore";
7
7
  import type { AnimateProp } from "../../stream/pipelineTransitionUtils";
8
8
  /**
@@ -74,7 +74,7 @@ export declare function buildCustomBehaviorProps(input: {
74
74
  x: number;
75
75
  y: number;
76
76
  }) => void) | undefined;
77
- hoverHighlight?: boolean;
77
+ hoverHighlight?: HoverHighlightMode;
78
78
  customHoverBehavior: (d: Datum | null) => void;
79
79
  customClickBehavior: (d: Datum | null) => void;
80
80
  /**
@@ -43,6 +43,13 @@ export type LinkedBrushProp = string | {
43
43
  * User-provided props always override mode defaults.
44
44
  */
45
45
  export type ChartMode = "primary" | "context" | "sparkline";
46
+ /**
47
+ * Hover highlighting mode.
48
+ * `true` and `"series"` both dim non-hovered series/categories; the string
49
+ * form is accepted for compatibility with wrapper libraries that expose a
50
+ * more explicit per-series mode.
51
+ */
52
+ export type HoverHighlightMode = boolean | "series";
46
53
  /**
47
54
  * Base props shared across all chart components
48
55
  */
@@ -55,7 +62,9 @@ export interface BaseChartProps {
55
62
  height?: number;
56
63
  /** Margin around the chart. Accepts a number (same on all sides) or an object
57
64
  * with any subset of `top`/`bottom`/`left`/`right`. Missing sides fall back
58
- * to the chart-mode defaults. */
65
+ * to the chart-mode defaults. Use `"auto"` or `null` for a side to explicitly
66
+ * allow chart auto-reservation, e.g. `margin={{ right: "auto" }}` with a
67
+ * right-side legend. */
59
68
  margin?: PartialMargin;
60
69
  /** Auto-match width to parent container. Default: false */
61
70
  responsiveWidth?: boolean;
@@ -110,7 +119,7 @@ export interface BaseChartProps {
110
119
  y: number;
111
120
  }) => void;
112
121
  /** Dim non-hovered series when hovering a data mark. Requires `colorBy`. */
113
- hoverHighlight?: boolean;
122
+ hoverHighlight?: HoverHighlightMode;
114
123
  /** Max pixel distance for hover/click hit testing. Default 30. Increase for sparse charts, decrease for dense ones. */
115
124
  hoverRadius?: number;
116
125
  /** ID accessor for remove()/update() on XY charts. Extracts a unique identifier from each datum. */
@@ -1,7 +1,7 @@
1
1
  import type { Datum } from "./datumTypes";
2
2
  import { useChartLegendAndMargin, useLegendInteraction, DEFAULT_COLOR } from "./hooks";
3
3
  import type { LegendInteractionMode, LegendPosition } from "./hooks";
4
- import type { Accessor, SelectionConfig, LinkedHoverProp } from "./types";
4
+ import type { Accessor, SelectionConfig, LinkedHoverProp, HoverHighlightMode } from "./types";
5
5
  import type { OnObservationCallback } from "../../store/ObservationStore";
6
6
  import type { PartialMargin } from "../../types/marginType";
7
7
  import type { SelectionHookResult } from "./selectionUtils";
@@ -57,7 +57,7 @@ export interface ChartSetupInput {
57
57
  y: number;
58
58
  }) => void;
59
59
  /** Dim non-hovered series on data mark hover */
60
- hoverHighlight?: boolean;
60
+ hoverHighlight?: HoverHighlightMode;
61
61
  /** Loading state */
62
62
  loading: boolean | undefined;
63
63
  /** Custom content rendered in place of the default skeleton while `loading` is true. */
@@ -3,7 +3,7 @@ import { useChartMode } from "./hooks";
3
3
  import { type ChartSetupResult } from "./useChartSetup";
4
4
  import type { ChartMode, SelectionConfig, LinkedHoverProp } from "./types";
5
5
  import type { OnObservationCallback } from "../../store/ObservationStore";
6
- import type { PartialMargin, MarginType } from "../../types/marginType";
6
+ import { type PartialMargin, type MarginType } from "../../types/marginType";
7
7
  import type { Datum } from "./datumTypes";
8
8
  import type { RealtimeFrameHandle } from "../../realtime/types";
9
9
  /**
@@ -6,6 +6,13 @@ import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
6
6
  import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types";
7
7
  import { type TooltipProp } from "../../Tooltip/Tooltip";
8
8
  import type { ForecastConfig, AnomalyConfig } from "../shared/statisticalOverlays";
9
+ export interface SemanticGradientStop {
10
+ /** Percent from baseline to line/top. 0 = baseline, 100 = line/top. */
11
+ at: number;
12
+ color: string;
13
+ /** Optional opacity applied to this stop. */
14
+ opacity?: number;
15
+ }
9
16
  /**
10
17
  * AreaChart component props
11
18
  */
@@ -90,6 +97,14 @@ export interface AreaChartProps<TDatum extends Datum = Datum> extends BaseChartP
90
97
  color: string;
91
98
  }>;
92
99
  };
100
+ /**
101
+ * Semantic area gradient stops expressed in user-facing percentages:
102
+ * `at: 0` is the baseline and `at: 100` is the line/top of the area.
103
+ * This is converted to `gradientFill.colorStops`, whose raw offsets use
104
+ * the renderer coordinate convention (`0` = top, `1` = baseline).
105
+ * When set, this takes precedence over `gradientFill`.
106
+ */
107
+ semanticGradient?: SemanticGradientStop[];
93
108
  /**
94
109
  * Area opacity (flat fill, ignored when gradientFill is set)
95
110
  * @default 0.7
@@ -37,7 +37,7 @@ export { Treemap } from "./charts/network/Treemap";
37
37
  export { CirclePack } from "./charts/network/CirclePack";
38
38
  export { OrbitDiagram } from "./charts/network/OrbitDiagram";
39
39
  export { RealtimeLineChart } from "./charts/realtime/RealtimeLineChart";
40
- export { RealtimeHistogram } from "./charts/realtime/RealtimeHistogram";
40
+ export { RealtimeHistogram, TemporalHistogram } from "./charts/realtime/RealtimeHistogram";
41
41
  export { RealtimeSwarmChart } from "./charts/realtime/RealtimeSwarmChart";
42
42
  export { RealtimeWaterfallChart } from "./charts/realtime/RealtimeWaterfallChart";
43
43
  export { RealtimeHeatmap } from "./charts/realtime/RealtimeHeatmap";
@@ -7,13 +7,13 @@ import StreamNetworkFrame from "./stream/StreamNetworkFrame";
7
7
  import { RingBuffer } from "./realtime/RingBuffer";
8
8
  import { IncrementalExtent } from "./realtime/IncrementalExtent";
9
9
  import { RealtimeLineChart } from "./charts/realtime/RealtimeLineChart";
10
- import { RealtimeHistogram } from "./charts/realtime/RealtimeHistogram";
10
+ import { RealtimeHistogram, TemporalHistogram } from "./charts/realtime/RealtimeHistogram";
11
11
  import { RealtimeSwarmChart } from "./charts/realtime/RealtimeSwarmChart";
12
12
  import { RealtimeWaterfallChart } from "./charts/realtime/RealtimeWaterfallChart";
13
13
  import { RealtimeHeatmap } from "./charts/realtime/RealtimeHeatmap";
14
- export { StreamXYFrame, StreamNetworkFrame, RingBuffer, IncrementalExtent, RealtimeLineChart, RealtimeHistogram, RealtimeSwarmChart, RealtimeWaterfallChart, RealtimeHeatmap };
14
+ export { StreamXYFrame, StreamNetworkFrame, RingBuffer, IncrementalExtent, RealtimeLineChart, RealtimeHistogram, TemporalHistogram, RealtimeSwarmChart, RealtimeWaterfallChart, RealtimeHeatmap };
15
15
  export type { RealtimeLineChartProps } from "./charts/realtime/RealtimeLineChart";
16
- export type { RealtimeHistogramProps } from "./charts/realtime/RealtimeHistogram";
16
+ export type { RealtimeHistogramProps, TemporalHistogramProps } from "./charts/realtime/RealtimeHistogram";
17
17
  export type { RealtimeSwarmChartProps } from "./charts/realtime/RealtimeSwarmChart";
18
18
  export type { RealtimeWaterfallChartProps } from "./charts/realtime/RealtimeWaterfallChart";
19
19
  export type { RealtimeHeatmapProps } from "./charts/realtime/RealtimeHeatmap";
@@ -1,5 +1,6 @@
1
1
  export { renderToStaticSVG, renderXYToStaticSVG, renderOrdinalToStaticSVG, renderNetworkToStaticSVG, renderGeoToStaticSVG, renderChart, renderToImage, renderDashboard, } from "./server/renderToStaticSVG";
2
2
  export type { RenderToImageOptions, DashboardChart, DashboardLayout, RenderDashboardOptions, } from "./server/renderToStaticSVG";
3
+ export type { LegendLayout } from "./types/legendTypes";
3
4
  export { renderToAnimatedGif, generateFrameSVGs, generateFrameSequence } from "./server/animatedGif";
4
5
  export type { AnimatedGifOptions } from "./server/animatedGif";
5
6
  export { resolveTheme, themeStyles } from "./server/themeResolver";
@@ -21,7 +21,7 @@ export { XYCustomChart } from "./charts/custom/XYCustomChart";
21
21
  export type { StreamXYFrameProps, StreamXYFrameHandle } from "./stream/types";
22
22
  export type { CustomLayout, LayoutContext, LayoutResult } from "./stream/customLayout";
23
23
  export type { LineChartProps } from "./charts/xy/LineChart";
24
- export type { AreaChartProps } from "./charts/xy/AreaChart";
24
+ export type { AreaChartProps, SemanticGradientStop } from "./charts/xy/AreaChart";
25
25
  export type { DifferenceChartProps } from "./charts/xy/DifferenceChart";
26
26
  export type { StackedAreaChartProps } from "./charts/xy/StackedAreaChart";
27
27
  export type { ScatterplotProps } from "./charts/xy/Scatterplot";
@@ -19,12 +19,13 @@ import { Tooltip, MultiLineTooltip, normalizeTooltip } from "./Tooltip/Tooltip";
19
19
  import { RingBuffer } from "./realtime/RingBuffer";
20
20
  import { IncrementalExtent } from "./realtime/IncrementalExtent";
21
21
  import { RealtimeLineChart } from "./charts/realtime/RealtimeLineChart";
22
- import { RealtimeTemporalHistogram, RealtimeHistogram } from "./charts/realtime/RealtimeHistogram";
22
+ import { RealtimeTemporalHistogram, RealtimeHistogram, TemporalHistogram } from "./charts/realtime/RealtimeHistogram";
23
23
  import { RealtimeSwarmChart } from "./charts/realtime/RealtimeSwarmChart";
24
24
  import { RealtimeWaterfallChart } from "./charts/realtime/RealtimeWaterfallChart";
25
25
  import { RealtimeHeatmap } from "./charts/realtime/RealtimeHeatmap";
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
- 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";
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, TemporalHistogram, RealtimeSwarmChart, RealtimeWaterfallChart, RealtimeHeatmap, createHatchPattern };
27
+ export type { LegendLayout } from "./types/legendTypes";
28
+ export { ScatterplotProps, ConnectedScatterplotProps, LineChartProps, AreaChartProps, SemanticGradientStop, 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
29
  export type { StreamXYFrameProps, StreamXYFrameHandle, StreamChartType, RuntimeMode, SceneNode, Changeset, StreamScales, StreamLayout, CurveType, CanvasRendererFn, XYFrameAxisConfig, BandConfig } from "./stream/types";
29
30
  export type { StreamRendererFn } from "./stream/renderers/types";
30
31
  export type { StreamOrdinalFrameProps, StreamOrdinalFrameHandle, OrdinalChartType, OrdinalScales, OrdinalSceneNode } from "./stream/ordinalTypes";
@@ -57,7 +58,7 @@ export { darkenColor, lightenColor } from "./charts/shared/colorManipulation";
57
58
  export type { TooltipProp, TooltipConfig, TooltipField, MultiLineTooltipConfig } from "./Tooltip/Tooltip";
58
59
  export type { ArrowOfTime, WindowMode, ThresholdType, LineStyle, BarStyle, WaterfallStyle, SwarmStyle, AnnotationContext, AnnotationAnchorMode, CrosshairStyle, HoverAnnotationConfig, HoverData } from "./realtime/types";
59
60
  export type { RealtimeLineChartProps } from "./charts/realtime/RealtimeLineChart";
60
- export type { RealtimeTemporalHistogramProps, RealtimeHistogramProps } from "./charts/realtime/RealtimeHistogram";
61
+ export type { RealtimeTemporalHistogramProps, RealtimeHistogramProps, TemporalHistogramProps } from "./charts/realtime/RealtimeHistogram";
61
62
  export type { RealtimeSwarmChartProps } from "./charts/realtime/RealtimeSwarmChart";
62
63
  export type { RealtimeWaterfallChartProps } from "./charts/realtime/RealtimeWaterfallChart";
63
64
  export type { RealtimeHeatmapProps } from "./charts/realtime/RealtimeHeatmap";
@@ -1,4 +1,5 @@
1
1
  import type { Datum } from "../charts/shared/datumTypes";
2
+ import type { LegendLayout } from "../types/legendTypes";
2
3
  /**
3
4
  * Server-side rendering of Semiotic charts to standalone SVG strings.
4
5
  *
@@ -33,6 +34,7 @@ interface ThemeAwareProps {
33
34
  background?: string;
34
35
  className?: string;
35
36
  legendPosition?: "right" | "left" | "top" | "bottom";
37
+ legendLayout?: LegendLayout;
36
38
  /** Prefix for SVG element IDs — used by renderDashboard to avoid collisions */
37
39
  _idPrefix?: string;
38
40
  }
@@ -7,6 +7,21 @@
7
7
  import * as React from "react";
8
8
  import type { SemioticTheme } from "../store/ThemeStore";
9
9
  import type { Datum } from "../charts/shared/datumTypes";
10
+ import type { GradientLegendConfig, LegendGroup, LegendLayout } from "../types/legendTypes";
11
+ interface LegendItemLayout {
12
+ category: string;
13
+ width: number;
14
+ x: number;
15
+ y: number;
16
+ }
17
+ interface StaticLegendMetrics {
18
+ items: LegendItemLayout[];
19
+ width: number;
20
+ height: number;
21
+ swatchSize: number;
22
+ labelOffset: number;
23
+ swatchRadius: number;
24
+ }
10
25
  export interface StaticLegendConfig {
11
26
  /** Category labels to show in legend */
12
27
  categories: string[];
@@ -28,13 +43,33 @@ export interface StaticLegendConfig {
28
43
  };
29
44
  /** Title presence (affects top-position offset) */
30
45
  hasTitle?: boolean;
46
+ /** SSR legend layout controls */
47
+ legendLayout?: LegendLayout;
48
+ /** Optional id namespace used for generated SVG ids */
49
+ idPrefix?: string;
50
+ }
51
+ export interface StaticLegendGroupsConfig extends Omit<StaticLegendConfig, "categories" | "colorScheme"> {
52
+ legendGroups: LegendGroup[];
53
+ }
54
+ export interface StaticGradientLegendConfig extends Omit<StaticLegendConfig, "categories" | "colorScheme"> {
55
+ gradient: GradientLegendConfig;
31
56
  }
57
+ export declare function measureStaticLegend(config: StaticLegendConfig): Omit<StaticLegendMetrics, "items" | "labelOffset" | "swatchRadius">;
58
+ export declare function measureStaticLegendGroups(config: StaticLegendGroupsConfig): Omit<StaticLegendMetrics, "items" | "labelOffset" | "swatchRadius">;
59
+ export declare function measureStaticGradientLegend(config: StaticGradientLegendConfig): {
60
+ width: number;
61
+ height: number;
62
+ swatchSize: number;
63
+ };
32
64
  /**
33
65
  * Render a static legend as SVG elements.
34
66
  * Returns null if no categories to show.
35
67
  */
36
68
  export declare function renderStaticLegend(config: StaticLegendConfig): React.ReactNode;
69
+ export declare function renderStaticLegendGroups(config: StaticLegendGroupsConfig): React.ReactNode;
70
+ export declare function renderStaticGradientLegend(config: StaticGradientLegendConfig): React.ReactNode;
37
71
  /**
38
72
  * Extract unique categories from data using an accessor.
39
73
  */
40
74
  export declare function extractCategories(data: any[], accessor: string | ((d: Datum) => string) | undefined): string[];
75
+ export {};
@@ -34,6 +34,8 @@ export interface SemioticTheme {
34
34
  textSecondary: string;
35
35
  grid: string;
36
36
  border: string;
37
+ /** Separator/border color for cell-like marks such as treemap tiles and heatmap cells. Falls back to `border`. */
38
+ cellBorder?: string;
37
39
  focus?: string;
38
40
  /** Linked hover/selection highlight color */
39
41
  selection?: string;
@@ -1,7 +1,7 @@
1
1
  import type { Datum } from "../charts/shared/datumTypes";
2
2
  import type { ReactNode } from "react";
3
3
  import type { NetworkLabel } from "./networkTypes";
4
- import type { LegendGroup, GradientLegendConfig } from "../types/legendTypes";
4
+ import type { LegendGroup, GradientLegendConfig, LegendLayout } from "../types/legendTypes";
5
5
  type AnnotationAnchorNode = {
6
6
  type: string;
7
7
  datum: Datum | null;
@@ -43,6 +43,7 @@ export interface NetworkSVGOverlayProps {
43
43
  legendHighlightedCategory?: string | null;
44
44
  legendIsolatedCategories?: Set<string>;
45
45
  legendPosition?: "right" | "left" | "top" | "bottom";
46
+ legendLayout?: LegendLayout;
46
47
  /** User-provided SVG elements on top */
47
48
  foregroundGraphics?: ReactNode;
48
49
  /** Scene nodes for annotation positioning */
@@ -3,7 +3,7 @@ import * as React from "react";
3
3
  import type { OrdinalScales } from "./ordinalTypes";
4
4
  import type { AnnotationContext } from "../realtime/types";
5
5
  import type { ReactNode } from "react";
6
- import type { LegendGroup, GradientLegendConfig } from "../types/legendTypes";
6
+ import type { LegendGroup, GradientLegendConfig, LegendLayout } from "../types/legendTypes";
7
7
  import { type AxisExtentMode } from "../charts/shared/axisExtent";
8
8
  interface OrdinalSVGOverlayProps {
9
9
  width: number;
@@ -49,6 +49,7 @@ interface OrdinalSVGOverlayProps {
49
49
  legendHighlightedCategory?: string | null;
50
50
  legendIsolatedCategories?: Set<string>;
51
51
  legendPosition?: "right" | "left" | "top" | "bottom";
52
+ legendLayout?: LegendLayout;
52
53
  foregroundGraphics?: ReactNode;
53
54
  annotations?: Datum[];
54
55
  svgAnnotationRules?: (annotation: Datum, index: number, context: AnnotationContext) => ReactNode;
@@ -2,7 +2,7 @@ import type { Datum } from "../charts/shared/datumTypes";
2
2
  import type { StreamScales, MarginalGraphicsConfig, XYFrameAxisConfig } from "./types";
3
3
  import type { AnnotationContext } from "../realtime/types";
4
4
  import type { ReactNode } from "react";
5
- import type { LegendGroup, GradientLegendConfig } from "../types/legendTypes";
5
+ import type { LegendGroup, GradientLegendConfig, LegendLayout } from "../types/legendTypes";
6
6
  export type AxisConfig = XYFrameAxisConfig;
7
7
  interface SVGOverlayProps {
8
8
  width: number;
@@ -51,6 +51,7 @@ interface SVGOverlayProps {
51
51
  legendIsolatedCategories?: Set<string>;
52
52
  /** Legend position relative to chart area */
53
53
  legendPosition?: "right" | "left" | "top" | "bottom";
54
+ legendLayout?: LegendLayout;
54
55
  foregroundGraphics?: ReactNode;
55
56
  marginalGraphics?: MarginalGraphicsConfig;
56
57
  xValues?: number[];
@@ -13,7 +13,7 @@ export declare function xySceneNodeToSVG(node: SceneNode, i: number, idPrefix?:
13
13
  export declare function networkSceneNodeToSVG(node: NetworkSceneNode, i: number): React.ReactNode;
14
14
  export declare function networkSceneEdgeToSVG(edge: NetworkSceneEdge, i: number): React.ReactNode;
15
15
  export declare function networkLabelToSVG(label: NetworkLabel, i: number): React.ReactNode;
16
- export declare function ordinalSceneNodeToSVG(node: OrdinalSceneNode, i: number): React.ReactNode;
16
+ export declare function ordinalSceneNodeToSVG(node: OrdinalSceneNode, i: number, idPrefix?: string): React.ReactNode;
17
17
  export declare function geoSceneNodeToSVG(node: GeoSceneNode, i: number): React.ReactNode;
18
18
  /**
19
19
  * Returns true when running in a true server/Node.js context where
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { GeoProjection, GeoPath, GeoPermissibleObjects } from "d3-geo";
3
- import type { GradientLegendConfig, LegendGroup } from "../types/legendTypes";
3
+ import type { GradientLegendConfig, LegendGroup, LegendLayout } from "../types/legendTypes";
4
4
  import type { Style, DecayConfig, PulseConfig, TransitionConfig, StalenessConfig, SceneDatum, PointSceneNode, ThemeSemanticColors } from "./types";
5
5
  import type { AnimateProp } from "./pipelineTransitionUtils";
6
6
  import type { HoverAnnotationConfig, HoverData } from "../realtime/types";
@@ -191,6 +191,7 @@ export interface StreamGeoFrameProps<T = Datum> {
191
191
  gradient: GradientLegendConfig;
192
192
  };
193
193
  legendPosition?: "right" | "left" | "top" | "bottom";
194
+ legendLayout?: LegendLayout;
194
195
  legendHoverBehavior?: (item: {
195
196
  label: string;
196
197
  } | null) => void;
@@ -19,6 +19,7 @@ export interface HoverPointerCoords {
19
19
  clientX: number;
20
20
  clientY: number;
21
21
  }
22
+ export declare function normalizeHoverDatum(rawDatum: any): any;
22
23
  /**
23
24
  * Build a HoverData object from a raw datum and pixel coordinates.
24
25
  * The raw datum is preserved as `hover.data` for tooltip / callback
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
- import type { LegendGroup, GradientLegendConfig } from "../types/legendTypes";
2
+ import type { LegendGroup, GradientLegendConfig, LegendLayout } from "../types/legendTypes";
3
3
  export interface LegendRenderConfig {
4
4
  legend: ReactNode | {
5
5
  legendGroups: LegendGroup[];
@@ -15,6 +15,7 @@ export interface LegendRenderConfig {
15
15
  left: number;
16
16
  };
17
17
  legendPosition?: "right" | "left" | "top" | "bottom";
18
+ legendLayout?: LegendLayout;
18
19
  title?: string | ReactNode;
19
20
  legendHoverBehavior?: (item: {
20
21
  label: string;
@@ -1,7 +1,7 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { OnObservationCallback } from "../store/ObservationStore";
3
3
  import type { HoverData, AnnotationContext } from "../realtime/types";
4
- import type { LegendGroup } from "../types/legendTypes";
4
+ import type { LegendGroup, LegendLayout } from "../types/legendTypes";
5
5
  import type { Style, DecayConfig, PulseConfig, TransitionConfig, StalenessConfig, ThemeSemanticColors, SceneDatum } from "./types";
6
6
  import type { AnimateProp } from "./pipelineTransitionUtils";
7
7
  import type { Datum } from "../charts/shared/datumTypes";
@@ -523,6 +523,7 @@ export interface StreamNetworkFrameProps<T = Datum> {
523
523
  legendGroups: LegendGroup[];
524
524
  };
525
525
  legendPosition?: "right" | "left" | "top" | "bottom";
526
+ legendLayout?: LegendLayout;
526
527
  legendHoverBehavior?: (item: {
527
528
  label: string;
528
529
  } | null) => void;
@@ -3,7 +3,7 @@ import type { ScaleLinear, ScaleBand } from "d3-scale";
3
3
  import type { WindowMode, HoverAnnotationConfig, HoverData, AnnotationContext } from "../realtime/types";
4
4
  import type { Style, SceneDatum, DecayConfig, PulseConfig, TransitionConfig, StalenessConfig, ThemeSemanticColors } from "./types";
5
5
  import type { AnimateProp } from "./pipelineTransitionUtils";
6
- import type { LegendGroup } from "../types/legendTypes";
6
+ import type { GradientLegendConfig, LegendGroup, LegendLayout } from "../types/legendTypes";
7
7
  import type { Datum } from "../charts/shared/datumTypes";
8
8
  export type OrdinalChartType = "bar" | "clusterbar" | "point" | "swarm" | "pie" | "donut" | "boxplot" | "violin" | "histogram" | "ridgeline" | "timeline" | "funnel" | "bar-funnel" | "swimlane" | "custom";
9
9
  export interface OrdinalScales {
@@ -37,6 +37,19 @@ export interface WedgeSceneNode {
37
37
  start?: boolean;
38
38
  end?: boolean;
39
39
  };
40
+ /** Render the wedge's interior as N equal angular slices, each filled
41
+ * with the corresponding color from `colors`. The wedge's own shape
42
+ * (incl. `cornerRadius` + `roundedEnds`) is used as a clip mask so
43
+ * only the slice geometry shows through the rounded outline. Used by
44
+ * GaugeChart's gradient-fill mode: the band reads as one continuous
45
+ * rounded arc with a gradient sampled along its length, without any
46
+ * individual slice (which would be far too narrow to host its own
47
+ * rounded corners) needing to round. Slices are an internal
48
+ * rendering detail — they do not appear as separate scene nodes,
49
+ * participate in hit testing, or transition independently. */
50
+ _gradientBand?: {
51
+ colors: string[];
52
+ };
40
53
  style: Style;
41
54
  datum: SceneDatum;
42
55
  category?: string;
@@ -373,7 +386,7 @@ export interface StreamOrdinalFrameProps<T = Datum> {
373
386
  legend?: ReactNode | {
374
387
  legendGroups: LegendGroup[];
375
388
  } | {
376
- gradient: import("../types/legendTypes").GradientLegendConfig;
389
+ gradient: GradientLegendConfig;
377
390
  };
378
391
  legendHoverBehavior?: (item: {
379
392
  label: string;
@@ -384,6 +397,7 @@ export interface StreamOrdinalFrameProps<T = Datum> {
384
397
  legendHighlightedCategory?: string | null;
385
398
  legendIsolatedCategories?: Set<string>;
386
399
  legendPosition?: "right" | "left" | "top" | "bottom";
400
+ legendLayout?: LegendLayout;
387
401
  /** Accessor used to report the current legend category domain in push mode. */
388
402
  legendCategoryAccessor?: string | ((d: T) => string);
389
403
  /** Fires when the current legend category domain changes after scene rebuilds. */