semiotic 3.5.2 → 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.
- package/CLAUDE.md +9 -8
- package/README.md +15 -15
- package/ai/componentMetadata.cjs +9 -2
- package/ai/dist/mcp-server.js +4 -1
- package/ai/examples.md +27 -0
- package/ai/schema.json +300 -41
- package/ai/system-prompt.md +1 -1
- package/dist/components/ThemeProvider.d.ts +2 -2
- package/dist/components/charts/index.d.ts +3 -3
- package/dist/components/charts/network/ProcessSankey.d.ts +22 -0
- package/dist/components/charts/network/SankeyDiagram.d.ts +5 -1
- package/dist/components/charts/network/Treemap.d.ts +8 -0
- package/dist/components/charts/network/processSankey/algorithm.d.ts +57 -0
- package/dist/components/charts/network/processSankey/buildScenes.d.ts +6 -0
- package/dist/components/charts/network/processSankey/streamingLayout.d.ts +13 -0
- package/dist/components/charts/ordinal/GaugeChart.d.ts +10 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +2 -0
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +24 -0
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +2 -0
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +2 -0
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +2 -0
- package/dist/components/charts/shared/gaugeGradient.d.ts +62 -0
- package/dist/components/charts/shared/hooks.d.ts +2 -2
- package/dist/components/charts/shared/streamPropsHelpers.d.ts +2 -2
- package/dist/components/charts/shared/tooltipUtils.d.ts +11 -0
- package/dist/components/charts/shared/types.d.ts +17 -2
- package/dist/components/charts/shared/useAreaSeriesSetup.d.ts +4 -1
- package/dist/components/charts/shared/useChartSetup.d.ts +4 -2
- package/dist/components/charts/shared/useCustomChartSetup.d.ts +2 -1
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +2 -0
- package/dist/components/charts/shared/withChartWrapper.d.ts +10 -3
- package/dist/components/charts/xy/AreaChart.d.ts +27 -2
- package/dist/components/charts/xy/LineChart.d.ts +26 -2
- package/dist/components/charts/xy/Scatterplot.d.ts +5 -1
- package/dist/components/semiotic-ai.d.ts +1 -1
- package/dist/components/semiotic-realtime.d.ts +3 -3
- package/dist/components/semiotic-server.d.ts +1 -0
- package/dist/components/semiotic-xy.d.ts +1 -1
- package/dist/components/semiotic.d.ts +6 -5
- package/dist/components/server/renderToStaticSVG.d.ts +4 -1
- package/dist/components/server/serverChartConfigs.d.ts +1 -0
- package/dist/components/server/staticAnnotations.d.ts +1 -1
- package/dist/components/server/staticLegend.d.ts +35 -0
- package/dist/components/server/themeResolver.d.ts +7 -1
- package/dist/components/store/ThemeStore.d.ts +9 -1
- package/dist/components/stream/AccessibleDataTable.d.ts +2 -2
- package/dist/components/stream/NetworkSVGOverlay.d.ts +2 -1
- package/dist/components/stream/OrdinalSVGOverlay.d.ts +2 -1
- package/dist/components/stream/PipelineStore.d.ts +20 -13
- package/dist/components/stream/SVGOverlay.d.ts +4 -30
- package/dist/components/stream/SceneToSVG.d.ts +1 -1
- package/dist/components/stream/accessorUtils.d.ts +2 -1
- package/dist/components/stream/geoTypes.d.ts +2 -1
- package/dist/components/stream/hoverUtils.d.ts +1 -0
- package/dist/components/stream/layouts/hierarchyLayoutPlugin.d.ts +1 -1
- package/dist/components/stream/legendRenderer.d.ts +2 -1
- package/dist/components/stream/networkTypes.d.ts +13 -1
- package/dist/components/stream/ordinalTypes.d.ts +31 -3
- package/dist/components/stream/renderers/wedgePathBuilder.d.ts +87 -0
- package/dist/components/stream/types.d.ts +110 -16
- package/dist/components/stream/xySceneBuilders/areaGradient.d.ts +20 -0
- package/dist/components/stream/xySceneBuilders/barScene.d.ts +2 -2
- package/dist/components/stream/xySceneBuilders/candlestickScene.d.ts +2 -2
- package/dist/components/stream/xySceneBuilders/heatmapScene.d.ts +2 -2
- package/dist/components/stream/xySceneBuilders/lineScene.d.ts +4 -3
- package/dist/components/stream/xySceneBuilders/pointScene.d.ts +2 -2
- package/dist/components/stream/xySceneBuilders/ribbonScene.d.ts +107 -0
- package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +2 -2
- package/dist/components/stream/xySceneBuilders/types.d.ts +9 -12
- package/dist/components/stream/xySceneBuilders/waterfallScene.d.ts +2 -2
- package/dist/components/types/legendTypes.d.ts +15 -0
- package/dist/components/types/marginType.d.ts +17 -3
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +1 -1
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-realtime.d.ts +3 -3
- package/dist/semiotic-server.d.ts +1 -0
- package/dist/semiotic-themes.min.js +1 -1
- package/dist/semiotic-themes.module.min.js +1 -1
- package/dist/semiotic-utils.min.js +1 -1
- package/dist/semiotic-utils.module.min.js +1 -1
- package/dist/semiotic-xy.d.ts +1 -1
- package/dist/semiotic.d.ts +6 -5
- package/dist/semiotic.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +25 -25
- package/dist/components/stream/xySceneBuilders/boundsScene.d.ts +0 -9
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { LIGHT_THEME, DARK_THEME, HIGH_CONTRAST_THEME } from "./store/ThemeStore";
|
|
3
|
-
import type { SemioticTheme } from "./store/ThemeStore";
|
|
3
|
+
import type { SemioticTheme, SemioticThemeUpdate } from "./store/ThemeStore";
|
|
4
4
|
import type { ThemePresetName } from "./semiotic-themes";
|
|
5
5
|
interface ThemeProviderProps {
|
|
6
6
|
/** Theme preset name (e.g. "tufte", "pastels-dark", "bi-tool") or a partial SemioticTheme object. */
|
|
7
|
-
theme?: ThemePresetName |
|
|
7
|
+
theme?: ThemePresetName | SemioticThemeUpdate;
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
}
|
|
10
10
|
declare function ThemeProviderWrapper({ theme, children }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -13,7 +13,7 @@ export type { ConnectedScatterplotProps } from "./xy/ConnectedScatterplot";
|
|
|
13
13
|
export { LineChart } from "./xy/LineChart";
|
|
14
14
|
export type { LineChartProps } from "./xy/LineChart";
|
|
15
15
|
export { AreaChart } from "./xy/AreaChart";
|
|
16
|
-
export type { AreaChartProps } from "./xy/AreaChart";
|
|
16
|
+
export type { AreaChartProps, SemanticGradientStop } from "./xy/AreaChart";
|
|
17
17
|
export { DifferenceChart } from "./xy/DifferenceChart";
|
|
18
18
|
export type { DifferenceChartProps } from "./xy/DifferenceChart";
|
|
19
19
|
export { StackedAreaChart } from "./xy/StackedAreaChart";
|
|
@@ -88,8 +88,8 @@ export { OrbitDiagram } from "./network/OrbitDiagram";
|
|
|
88
88
|
export type { OrbitDiagramProps, OrbitNode } from "./network/OrbitDiagram";
|
|
89
89
|
export { RealtimeLineChart } from "./realtime/RealtimeLineChart";
|
|
90
90
|
export type { RealtimeLineChartProps } from "./realtime/RealtimeLineChart";
|
|
91
|
-
export { RealtimeTemporalHistogram, RealtimeHistogram } from "./realtime/RealtimeHistogram";
|
|
92
|
-
export type { RealtimeTemporalHistogramProps, RealtimeHistogramProps } from "./realtime/RealtimeHistogram";
|
|
91
|
+
export { RealtimeTemporalHistogram, RealtimeHistogram, TemporalHistogram } from "./realtime/RealtimeHistogram";
|
|
92
|
+
export type { RealtimeTemporalHistogramProps, RealtimeHistogramProps, TemporalHistogramProps } from "./realtime/RealtimeHistogram";
|
|
93
93
|
export { RealtimeSwarmChart } from "./realtime/RealtimeSwarmChart";
|
|
94
94
|
export type { RealtimeSwarmChartProps } from "./realtime/RealtimeSwarmChart";
|
|
95
95
|
export { RealtimeWaterfallChart } from "./realtime/RealtimeWaterfallChart";
|
|
@@ -22,6 +22,24 @@ export interface ProcessSankeyProps<TNode extends Datum = Datum, TEdge extends D
|
|
|
22
22
|
valueAccessor?: ChartAccessor<TEdge, number>;
|
|
23
23
|
startTimeAccessor?: ChartAccessor<TEdge, TimeLike>;
|
|
24
24
|
endTimeAccessor?: ChartAccessor<TEdge, TimeLike>;
|
|
25
|
+
/**
|
|
26
|
+
* Optional accessor for the per-edge "system in" time — when
|
|
27
|
+
* `value` is added to the SOURCE node's mass. Use when the
|
|
28
|
+
* source node has an intake event distinct from when this edge
|
|
29
|
+
* departs (e.g. a patient is admitted to the ER at 7pm and
|
|
30
|
+
* transferred out at 9pm — the ER node carries the patient's
|
|
31
|
+
* weight between 7pm and 9pm). Without this, the source node's
|
|
32
|
+
* mass is synthesized as a flat baseline and the band reads as
|
|
33
|
+
* "always there." Set it and the node band climbs / falls as
|
|
34
|
+
* units arrive and depart — a true staircase profile.
|
|
35
|
+
*/
|
|
36
|
+
systemInTimeAccessor?: ChartAccessor<TEdge, TimeLike>;
|
|
37
|
+
/**
|
|
38
|
+
* Optional accessor for the per-edge "system out" time — when
|
|
39
|
+
* `value` is removed from the TARGET node's mass. Mirror of
|
|
40
|
+
* `systemInTimeAccessor` for the inbound side.
|
|
41
|
+
*/
|
|
42
|
+
systemOutTimeAccessor?: ChartAccessor<TEdge, TimeLike>;
|
|
25
43
|
/**
|
|
26
44
|
* Accessor for a node's explicit lifetime extent — a `[start, end]`
|
|
27
45
|
* tuple of time-likes. Lane spans
|
|
@@ -50,6 +68,10 @@ export interface ProcessSankeyProps<TNode extends Datum = Datum, TEdge extends D
|
|
|
50
68
|
lifetimeMode?: "full" | "half";
|
|
51
69
|
showLaneRails?: boolean;
|
|
52
70
|
showQualityReadout?: boolean;
|
|
71
|
+
/** Render the per-band node id label at the band's left edge.
|
|
72
|
+
* Default `true`. Set `false` for dense layouts where labels
|
|
73
|
+
* would overlap, or when the legend already names every band. */
|
|
74
|
+
showLabels?: boolean;
|
|
53
75
|
edgeOpacity?: number;
|
|
54
76
|
/** Tooltip content. `false` disables, `true` uses the default,
|
|
55
77
|
* or pass a `Tooltip(...)` / custom function for full control. */
|
|
@@ -4,7 +4,7 @@ import type { StreamNetworkFrameProps } from "../../stream/networkTypes";
|
|
|
4
4
|
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
5
5
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
6
6
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
7
|
-
import type { LegendInteractionMode } from "../shared/hooks";
|
|
7
|
+
import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
|
|
8
8
|
/**
|
|
9
9
|
* SankeyDiagram component props
|
|
10
10
|
*/
|
|
@@ -25,6 +25,10 @@ export interface SankeyDiagramProps<TNode extends Datum = Datum, TEdge extends D
|
|
|
25
25
|
nodeLabel?: ChartAccessor<TNode, string>;
|
|
26
26
|
showLabels?: boolean;
|
|
27
27
|
enableHover?: boolean;
|
|
28
|
+
/** Show a swatch + label legend. Defaults to `true` when `colorBy` is set. */
|
|
29
|
+
showLegend?: boolean;
|
|
30
|
+
/** Legend position. Default `"right"`. */
|
|
31
|
+
legendPosition?: LegendPosition;
|
|
28
32
|
legendInteraction?: LegendInteractionMode;
|
|
29
33
|
edgeOpacity?: number;
|
|
30
34
|
edgeSort?: (a: any, b: any) => number;
|
|
@@ -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;
|
|
@@ -11,6 +11,25 @@ export interface ProcessSankeyEdge {
|
|
|
11
11
|
value: number;
|
|
12
12
|
startTime: number;
|
|
13
13
|
endTime: number;
|
|
14
|
+
/** Optional: time at which this unit of mass actually "arrived" at
|
|
15
|
+
* the SOURCE node (e.g., the hospital admit time for an ER patient
|
|
16
|
+
* whose transfer to ICU happens later at `startTime`). Purely a
|
|
17
|
+
* rendering hint — the layout/mass profile is unchanged. The
|
|
18
|
+
* renderer cuts a rectangular slot out of the source node's band
|
|
19
|
+
* from the node's left edge up to the scaled `systemInTime`, with
|
|
20
|
+
* height equal to this edge's ribbon thickness. Edges without
|
|
21
|
+
* `systemInTime` are drawn as-is. Result: a staircase profile on
|
|
22
|
+
* the source side as units enter the system one by one.
|
|
23
|
+
* Default: undefined. */
|
|
24
|
+
systemInTime?: number;
|
|
25
|
+
/** Optional: time at which this unit of mass leaves the TARGET node
|
|
26
|
+
* (e.g., the discharge time for a patient who arrived at the ward
|
|
27
|
+
* at `endTime`). Symmetric to `systemInTime`: the renderer cuts a
|
|
28
|
+
* rectangular slot out of the target node's band from the scaled
|
|
29
|
+
* `systemOutTime` to the node's right edge, with height equal to
|
|
30
|
+
* this edge's ribbon thickness. Layout/mass profile unchanged.
|
|
31
|
+
* Default: undefined. */
|
|
32
|
+
systemOutTime?: number;
|
|
14
33
|
}
|
|
15
34
|
export interface ProcessSankeyIssue {
|
|
16
35
|
kind: string;
|
|
@@ -98,6 +117,44 @@ export declare function clampTime(t: number, domain: Domain): number;
|
|
|
98
117
|
export declare function clampSamples(samples: ProcessSankeySample[], domain: Domain): ProcessSankeySample[];
|
|
99
118
|
export declare function attachmentYRange(att: ProcessSankeyAttachment, cl: number, S: number): [number, number];
|
|
100
119
|
export declare function buildBandPath(samples: ProcessSankeySample[], cl: number, S: number, xScale: (t: number) => number, domain: Domain): string | null;
|
|
120
|
+
/**
|
|
121
|
+
* One 20-px gradient stub at an attachment with `systemInTime` /
|
|
122
|
+
* `systemOutTime`. Rendered as its own bezier scene-edge with a
|
|
123
|
+
* horizontal gradient, painted underneath the band. The band
|
|
124
|
+
* paints with `fill: none` whenever any stubs are present, so the
|
|
125
|
+
* stub gradients are the only colored regions inside the band's
|
|
126
|
+
* outline.
|
|
127
|
+
*/
|
|
128
|
+
export interface BandGradientStub {
|
|
129
|
+
/** Rect path (M-L-L-L-Z). */
|
|
130
|
+
pathD: string;
|
|
131
|
+
/** Gradient extent in screen pixels. */
|
|
132
|
+
x0: number;
|
|
133
|
+
x1: number;
|
|
134
|
+
/** Color stops — 0 = transparent end, 1 = band-color end. */
|
|
135
|
+
from: 0 | 1;
|
|
136
|
+
to: 0 | 1;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Build the per-edge 20-px gradient stubs that visualize
|
|
140
|
+
* `systemInTime` / `systemOutTime` on a node band. Each stub is
|
|
141
|
+
* a rect on the edge's attachment slot, painted with a horizontal
|
|
142
|
+
* gradient that fades the band color in (or out) over 20 screen
|
|
143
|
+
* pixels and saturates through the rest of the rect.
|
|
144
|
+
*
|
|
145
|
+
* The rect is clipped to the band's outline bounds (so cutouts don't
|
|
146
|
+
* spill outside the node shape), but the gradient extent stays at
|
|
147
|
+
* its natural `[xSysIn - FADE_PX, xSysIn]` / `[xSysOut, xSysOut + FADE_PX]`
|
|
148
|
+
* range. The canvas renderer uses pad-mode clamping for color stops
|
|
149
|
+
* outside the rect, so a stub whose fade region falls past the band's
|
|
150
|
+
* edge still paints solid band-color where it's visible — instead of
|
|
151
|
+
* collapsing to a degenerate gradient that the renderer would clamp
|
|
152
|
+
* to transparent.
|
|
153
|
+
*
|
|
154
|
+
* Pure rendering hint — layout/mass-profile unchanged. Returns an
|
|
155
|
+
* empty array when the node has no qualifying edges.
|
|
156
|
+
*/
|
|
157
|
+
export declare function buildBandCutoutsForNode(nodeId: string, edges: ProcessSankeyEdge[], layout: ProcessSankeyLayout, xScale: (t: number) => number, domain: Domain): BandGradientStub[];
|
|
101
158
|
type SlotByNode = Record<string, number>;
|
|
102
159
|
export declare function countCrossings(slotByNode: SlotByNode, edges: ProcessSankeyEdge[]): number;
|
|
103
160
|
export declare function totalEdgeLength(slotByNode: SlotByNode, edges: ProcessSankeyEdge[]): number;
|
|
@@ -14,6 +14,12 @@ export interface ProcessSankeyNormalizedEdge {
|
|
|
14
14
|
value: number;
|
|
15
15
|
startTime: number;
|
|
16
16
|
endTime: number;
|
|
17
|
+
/** Optional render-only hint: when this unit of mass actually
|
|
18
|
+
* entered the source node. Triggers a cutout in the source band. */
|
|
19
|
+
systemInTime?: number;
|
|
20
|
+
/** Optional render-only hint: when this unit of mass left the
|
|
21
|
+
* target node. Triggers a cutout in the target band. */
|
|
22
|
+
systemOutTime?: number;
|
|
17
23
|
__raw?: Datum;
|
|
18
24
|
}
|
|
19
25
|
export interface BuildScenesInput {
|
|
@@ -3,10 +3,16 @@ import type { BezierCache } from "../../../stream/networkTypes";
|
|
|
3
3
|
import type { Datum } from "../../shared/datumTypes";
|
|
4
4
|
export interface ProcessSankeyBandSpec {
|
|
5
5
|
id: string;
|
|
6
|
+
/** Outer band perimeter — same path used for fill and stroke. */
|
|
6
7
|
pathD: string;
|
|
7
8
|
fill: string;
|
|
8
9
|
stroke?: string;
|
|
9
10
|
strokeWidth?: number;
|
|
11
|
+
/** Per-edge 20-px gradient stubs (band-color fade-in for
|
|
12
|
+
* systemInTime, fade-out for systemOutTime). When at least one
|
|
13
|
+
* stub is present, the band paints outline-only and the stubs
|
|
14
|
+
* are the only colored regions inside the perimeter. */
|
|
15
|
+
gradientStubs?: BandGradientStub[];
|
|
10
16
|
/** The user's raw node datum, surfaced as `data` in HoverData. */
|
|
11
17
|
rawDatum: Datum;
|
|
12
18
|
/** Pre-computed label x/y for the node band. */
|
|
@@ -14,6 +20,13 @@ export interface ProcessSankeyBandSpec {
|
|
|
14
20
|
labelY: number;
|
|
15
21
|
labelText: string;
|
|
16
22
|
}
|
|
23
|
+
export interface BandGradientStub {
|
|
24
|
+
pathD: string;
|
|
25
|
+
x0: number;
|
|
26
|
+
x1: number;
|
|
27
|
+
from: 0 | 1;
|
|
28
|
+
to: 0 | 1;
|
|
29
|
+
}
|
|
17
30
|
export interface ProcessSankeyRibbonSpec {
|
|
18
31
|
id: string;
|
|
19
32
|
pathD: string;
|
|
@@ -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)) */
|
|
@@ -87,6 +87,8 @@ export interface RealtimeHeatmapProps<TDatum extends Datum = Datum> {
|
|
|
87
87
|
selection?: SelectionConfig;
|
|
88
88
|
/** Show a loading skeleton placeholder */
|
|
89
89
|
loading?: boolean;
|
|
90
|
+
/** Custom content rendered in place of the default skeleton while `loading` is true. */
|
|
91
|
+
loadingContent?: React.ReactNode | false;
|
|
90
92
|
/** Custom content to render when data is empty. Set to `false` to disable empty state. */
|
|
91
93
|
emptyContent?: ReactNode | false;
|
|
92
94
|
/** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
|
|
@@ -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
|
/**
|
|
@@ -103,6 +112,8 @@ export interface RealtimeHistogramProps<TDatum extends Datum = Datum> {
|
|
|
103
112
|
transition?: TransitionConfig;
|
|
104
113
|
/** Show a loading skeleton placeholder */
|
|
105
114
|
loading?: boolean;
|
|
115
|
+
/** Custom content rendered in place of the default skeleton while `loading` is true. */
|
|
116
|
+
loadingContent?: React.ReactNode | false;
|
|
106
117
|
/** Custom content to render when data is empty. Set to `false` to disable empty state. */
|
|
107
118
|
emptyContent?: ReactNode | false;
|
|
108
119
|
/** Brush configuration. `true` defaults to `{ dimension: "x", snap: "bin" }`. */
|
|
@@ -173,6 +184,19 @@ export declare const RealtimeHistogram: {
|
|
|
173
184
|
<TDatum extends Datum = Datum>(props: RealtimeHistogramProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
|
|
174
185
|
displayName?: string;
|
|
175
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
|
+
}
|
|
176
200
|
/** @deprecated Use `RealtimeHistogram` (the canonical public name) instead. The
|
|
177
201
|
* `RealtimeTemporalHistogram` alias is preserved for back-compat with code
|
|
178
202
|
* written before the rename and will be removed in a future major version. */
|
|
@@ -89,6 +89,8 @@ export interface RealtimeLineChartProps<TDatum extends Datum = Datum> {
|
|
|
89
89
|
selection?: SelectionConfig;
|
|
90
90
|
/** Show a loading skeleton placeholder */
|
|
91
91
|
loading?: boolean;
|
|
92
|
+
/** Custom content rendered in place of the default skeleton while `loading` is true. */
|
|
93
|
+
loadingContent?: React.ReactNode | false;
|
|
92
94
|
/** Custom content to render when data is empty. Set to `false` to disable empty state. */
|
|
93
95
|
emptyContent?: ReactNode | false;
|
|
94
96
|
/** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
|
|
@@ -87,6 +87,8 @@ export interface RealtimeSwarmChartProps<TDatum extends Datum = Datum> {
|
|
|
87
87
|
selection?: SelectionConfig;
|
|
88
88
|
/** Show a loading skeleton placeholder */
|
|
89
89
|
loading?: boolean;
|
|
90
|
+
/** Custom content rendered in place of the default skeleton while `loading` is true. */
|
|
91
|
+
loadingContent?: React.ReactNode | false;
|
|
90
92
|
/** Custom content to render when data is empty. Set to `false` to disable empty state. */
|
|
91
93
|
emptyContent?: ReactNode | false;
|
|
92
94
|
/** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
|
|
@@ -89,6 +89,8 @@ export interface RealtimeWaterfallChartProps<TDatum extends Datum = Datum> {
|
|
|
89
89
|
selection?: SelectionConfig;
|
|
90
90
|
/** Show a loading skeleton placeholder */
|
|
91
91
|
loading?: boolean;
|
|
92
|
+
/** Custom content rendered in place of the default skeleton while `loading` is true. */
|
|
93
|
+
loadingContent?: React.ReactNode | false;
|
|
92
94
|
/** Custom content to render when data is empty. Set to `false` to disable empty state. */
|
|
93
95
|
emptyContent?: ReactNode | false;
|
|
94
96
|
/** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
|
|
@@ -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?:
|
|
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?:
|
|
77
|
+
hoverHighlight?: HoverHighlightMode;
|
|
78
78
|
customHoverBehavior: (d: Datum | null) => void;
|
|
79
79
|
customClickBehavior: (d: Datum | null) => void;
|
|
80
80
|
/**
|
|
@@ -21,6 +21,17 @@ export interface TooltipFieldConfig {
|
|
|
21
21
|
export declare function accessorName(acc: string | ((...args: any[]) => any)): string;
|
|
22
22
|
export declare function formatVal(v: unknown): string;
|
|
23
23
|
export declare function resolveValue(d: Datum, acc: string | ((d: Datum) => any)): unknown;
|
|
24
|
+
/**
|
|
25
|
+
* Build TooltipFieldConfig rows for a `band` prop config so the default
|
|
26
|
+
* tooltip surfaces envelope values automatically. Reads from the
|
|
27
|
+
* `bands` array the hover handler synthesizes onto the datum — one
|
|
28
|
+
* row pair per configured band (low + high). String accessors are
|
|
29
|
+
* used verbatim as labels; function accessors fall back to "low"/"high".
|
|
30
|
+
*
|
|
31
|
+
* Returns an empty array when band is not configured, so the spread at
|
|
32
|
+
* the call site is a no-op for the common case.
|
|
33
|
+
*/
|
|
34
|
+
export declare function bandTooltipFields(band: unknown, valueFormat?: (v: any, ...rest: any[]) => React.ReactNode): TooltipFieldConfig[];
|
|
24
35
|
/**
|
|
25
36
|
* Build a default tooltipContent function for StreamXYFrame HOCs.
|
|
26
37
|
* Receives HoverData ({ data, time, value, x, y }) and renders
|
|
@@ -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;
|
|
@@ -78,6 +87,12 @@ export interface BaseChartProps {
|
|
|
78
87
|
chartId?: string;
|
|
79
88
|
/** Show a loading skeleton placeholder */
|
|
80
89
|
loading?: boolean;
|
|
90
|
+
/** Custom content to render in place of the default skeleton when `loading` is `true`.
|
|
91
|
+
* Sibling to `emptyContent` — use for branded loading states or progress UI.
|
|
92
|
+
* When omitted, the built-in shimmer-bar skeleton renders.
|
|
93
|
+
* Pass `false` to suppress the loading UI entirely (an outer wrapper's
|
|
94
|
+
* loading state takes over). */
|
|
95
|
+
loadingContent?: React.ReactNode | false;
|
|
81
96
|
/** Custom content to render when data is empty. Set to `false` to disable empty state. */
|
|
82
97
|
emptyContent?: React.ReactNode | false;
|
|
83
98
|
/** Uniform fill color for all data marks. Overrides colorScheme and theme categorical.
|
|
@@ -104,7 +119,7 @@ export interface BaseChartProps {
|
|
|
104
119
|
y: number;
|
|
105
120
|
}) => void;
|
|
106
121
|
/** Dim non-hovered series when hovering a data mark. Requires `colorBy`. */
|
|
107
|
-
hoverHighlight?:
|
|
122
|
+
hoverHighlight?: HoverHighlightMode;
|
|
108
123
|
/** Max pixel distance for hover/click hit testing. Default 30. Increase for sparse charts, decrease for dense ones. */
|
|
109
124
|
hoverRadius?: number;
|
|
110
125
|
/** ID accessor for remove()/update() on XY charts. Extracts a unique identifier from each datum. */
|
|
@@ -41,7 +41,7 @@ export interface AreaSeriesSetupOptions<TDatum extends Datum = Datum> {
|
|
|
41
41
|
showPoints: boolean;
|
|
42
42
|
/** Point radius when `showPoints`. @default 3 */
|
|
43
43
|
pointRadius: number;
|
|
44
|
-
xAccessor: ChartAccessor<TDatum, number>;
|
|
44
|
+
xAccessor: ChartAccessor<TDatum, number | Date | string>;
|
|
45
45
|
yAccessor: ChartAccessor<TDatum, number>;
|
|
46
46
|
xLabel?: string;
|
|
47
47
|
yLabel?: string;
|
|
@@ -52,6 +52,9 @@ export interface AreaSeriesSetupOptions<TDatum extends Datum = Datum> {
|
|
|
52
52
|
/** Field used to label the series row in the default tooltip.
|
|
53
53
|
* Typically `areaBy ?? colorBy`. */
|
|
54
54
|
groupField?: Accessor<string> | ChartAccessor<TDatum, string>;
|
|
55
|
+
/** Optional band prop — when set, the default tooltip surfaces a
|
|
56
|
+
* pair of rows per band (low + high). Threaded through verbatim. */
|
|
57
|
+
band?: unknown;
|
|
55
58
|
}
|
|
56
59
|
export interface AreaSeriesSetupResult<TDatum extends Datum = Datum> {
|
|
57
60
|
/** Flat data array ready for `<StreamXYFrame data={…} />`. Empty
|
|
@@ -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,9 +57,11 @@ export interface ChartSetupInput {
|
|
|
57
57
|
y: number;
|
|
58
58
|
}) => void;
|
|
59
59
|
/** Dim non-hovered series on data mark hover */
|
|
60
|
-
hoverHighlight?:
|
|
60
|
+
hoverHighlight?: HoverHighlightMode;
|
|
61
61
|
/** Loading state */
|
|
62
62
|
loading: boolean | undefined;
|
|
63
|
+
/** Custom content rendered in place of the default skeleton while `loading` is true. */
|
|
64
|
+
loadingContent?: ReactNode | false;
|
|
63
65
|
/** Empty content override */
|
|
64
66
|
emptyContent?: ReactNode;
|
|
65
67
|
/** Resolved width from useChartMode */
|
|
@@ -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
|
|
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
|
/**
|
|
@@ -64,6 +64,7 @@ interface DataSetupOptions extends ScaffoldOptions {
|
|
|
64
64
|
}) => void;
|
|
65
65
|
chartId?: string;
|
|
66
66
|
loading?: boolean;
|
|
67
|
+
loadingContent?: ReactNode | false;
|
|
67
68
|
emptyContent?: ReactNode;
|
|
68
69
|
}
|
|
69
70
|
interface DataSetupResult<TFrameHandle> extends ScaffoldResult<TFrameHandle> {
|
|
@@ -45,6 +45,8 @@ export interface NetworkChartSetupInput<TNode extends Datum = Datum, TEdge exten
|
|
|
45
45
|
width: number;
|
|
46
46
|
height: number;
|
|
47
47
|
loading?: boolean;
|
|
48
|
+
/** Custom content rendered in place of the default skeleton while `loading` is true. */
|
|
49
|
+
loadingContent?: ReactNode | false;
|
|
48
50
|
emptyContent?: ReactNode | false;
|
|
49
51
|
/**
|
|
50
52
|
* Which array drives the empty-state check. `"edges"` (default)
|
|
@@ -27,10 +27,17 @@ export declare function SafeRender({ componentName, width, height, children }: S
|
|
|
27
27
|
*/
|
|
28
28
|
export declare function renderEmptyState(data: any[] | undefined | null, width: number, height: number, emptyContent?: React.ReactNode | false): React.ReactElement | null;
|
|
29
29
|
/**
|
|
30
|
-
* Renders a
|
|
31
|
-
*
|
|
30
|
+
* Renders a loading placeholder while `loading` is true.
|
|
31
|
+
*
|
|
32
|
+
* When `loadingContent` is provided, it replaces the default shimmer
|
|
33
|
+
* skeleton — wrapped in the same sized container so the chart still
|
|
34
|
+
* occupies the slot it would when rendered. Pass `false` to suppress
|
|
35
|
+
* the skeleton entirely (the early-return becomes null and the chart's
|
|
36
|
+
* own loading UI takes over).
|
|
37
|
+
*
|
|
38
|
+
* Returns null when `loading` is falsy.
|
|
32
39
|
*/
|
|
33
|
-
export declare function renderLoadingState(loading: boolean | undefined, width: number, height: number): React.ReactElement | null;
|
|
40
|
+
export declare function renderLoadingState(loading: boolean | undefined, width: number, height: number, loadingContent?: React.ReactNode | false): React.ReactElement | null;
|
|
34
41
|
/** Warn if a string accessor isn't found in the first data element */
|
|
35
42
|
export declare function warnMissingField(componentName: string, data: any[] | undefined, accessorName: string, accessorValue: any): void;
|
|
36
43
|
/** Warn if data looks like the wrong shape for this chart type */
|