semiotic 3.2.2 → 3.2.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.
- package/CLAUDE.md +47 -5
- package/ai/schema.json +63 -0
- package/dist/components/Tooltip/Tooltip.d.ts +6 -1
- package/dist/components/charts/index.d.ts +2 -0
- package/dist/components/charts/ordinal/BarChart.d.ts +2 -0
- package/dist/components/charts/ordinal/GaugeChart.d.ts +55 -0
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +1 -0
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +1 -0
- package/dist/components/charts/shared/hooks.d.ts +4 -1
- package/dist/components/charts/shared/types.d.ts +10 -5
- package/dist/components/charts/shared/useChartSetup.d.ts +2 -0
- package/dist/components/charts/xy/AreaChart.d.ts +17 -2
- package/dist/components/charts/xy/LineChart.d.ts +14 -3
- package/dist/components/semiotic-ordinal.d.ts +2 -0
- package/dist/components/semiotic-utils.d.ts +2 -1
- package/dist/components/semiotic.d.ts +3 -3
- package/dist/components/store/LinkedCrosshairStore.d.ts +6 -2
- package/dist/components/stream/CanvasHitTester.d.ts +13 -0
- package/dist/components/stream/OrdinalSVGOverlay.d.ts +1 -1
- package/dist/components/stream/PipelineStore.d.ts +17 -1
- package/dist/components/stream/SVGOverlay.d.ts +11 -5
- package/dist/components/stream/hitTestUtils.d.ts +15 -0
- package/dist/components/stream/ordinalTypes.d.ts +7 -1
- package/dist/components/stream/types.d.ts +54 -5
- package/dist/components/stream/xySceneBuilders/mixedScene.d.ts +12 -0
- package/dist/components/stream/xySceneBuilders/types.d.ts +15 -0
- 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.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-ordinal.d.ts +2 -0
- package/dist/semiotic-utils.d.ts +2 -1
- package/dist/semiotic-utils.min.js +1 -1
- package/dist/semiotic-utils.module.min.js +1 -1
- package/dist/semiotic.d.ts +3 -3
- 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 +8 -5
package/CLAUDE.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
- Every HOC accepts `frameProps` to pass through. TypeScript `strict: true`.
|
|
14
14
|
|
|
15
15
|
## Common Props (all HOCs)
|
|
16
|
-
`title`, `description` (overrides aria-label), `summary` (sr-only note), `width` (600), `height` (400), `responsiveWidth`, `responsiveHeight`, `margin`, `className`, `color` (uniform fill — overrides theme/colorScheme), `enableHover` (true), `tooltip` (boolean | `(datum) => ReactNode` | `{ fields?, title?, format?, style? }`), `showLegend`, `showGrid` (false), `frameProps`, `onObservation`, `onClick`, `chartId`, `loading` (false), `emptyContent`, `legendInteraction` ("none"|"highlight"|"isolate"), `legendPosition` ("right"|"left"|"top"|"bottom"), `emphasis` ("primary"|"secondary"), `annotations` (array), `accessibleTable` (true)
|
|
16
|
+
`title`, `description` (overrides aria-label), `summary` (sr-only note), `width` (600), `height` (400), `responsiveWidth`, `responsiveHeight`, `margin`, `className`, `color` (uniform fill — overrides theme/colorScheme), `enableHover` (true), `tooltip` (boolean | "multi" | `(datum) => ReactNode` | `{ fields?, title?, format?, style? }`), `showLegend`, `showGrid` (false), `frameProps`, `onObservation`, `onClick`, `chartId`, `loading` (false), `emptyContent`, `legendInteraction` ("none"|"highlight"|"isolate"), `legendPosition` ("right"|"left"|"top"|"bottom"), `emphasis` ("primary"|"secondary"), `annotations` (array), `accessibleTable` (true), `hoverHighlight` (boolean|"series" — dims non-hovered series on data mark hover), `hoverRadius` (number, default 30 — max pixel distance for hover/click hit testing)
|
|
17
17
|
|
|
18
18
|
`onClick` receives `(datum, { x, y })` — the original datum and pixel coordinates. Works on lines, bars, areas, pie slices, nodes, and geo features.
|
|
19
19
|
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
|
|
22
22
|
## XY Charts (`semiotic/xy`)
|
|
23
23
|
|
|
24
|
-
**LineChart** — `data`, `xAccessor` ("x"), `yAccessor` ("y"), `lineBy`, `lineDataAccessor` ("coordinates"), `colorBy`, `colorScheme`, `curve`, `lineWidth` (2), `showPoints`, `pointRadius` (3), `fillArea
|
|
25
|
-
**AreaChart** — LineChart props + `areaBy`, `y0Accessor` (band/ribbon), `gradientFill` (boolean|{topOpacity,bottomOpacity}), `areaOpacity` (0.7), `showLine` (true)
|
|
24
|
+
**LineChart** — `data`, `xAccessor` ("x"), `yAccessor` ("y"), `lineBy`, `lineDataAccessor` ("coordinates"), `colorBy`, `colorScheme`, `curve`, `lineWidth` (2), `showPoints`, `pointRadius` (3), `fillArea` (boolean|string[] — `true` fills all, `string[]` lists series names for per-series area fill), `areaOpacity` (0.3), `lineGradient` ({colorStops:[{offset,color}]} — horizontal gradient for line stroke), `anomaly`, `forecast`, `directLabel`, `gapStrategy` ("break"|"interpolate"|"zero"), `xScaleType`/`yScaleType` ("linear"|"log")
|
|
25
|
+
**AreaChart** — LineChart props + `areaBy`, `y0Accessor` (band/ribbon), `gradientFill` (boolean|{topOpacity,bottomOpacity}|{colorStops:[{offset,color}]}), `lineGradient` ({colorStops:[{offset,color}]}), `areaOpacity` (0.7), `showLine` (true)
|
|
26
26
|
**StackedAreaChart** — flat array + `areaBy` (required), `colorBy`, `normalize`. Do NOT use `lineBy` or `lineDataAccessor`.
|
|
27
27
|
**Scatterplot** — `data`, `xAccessor`, `yAccessor`, `colorBy`, `sizeBy`, `sizeRange`, `pointRadius` (5), `pointOpacity` (0.8), `marginalGraphics`
|
|
28
28
|
**BubbleChart** — Scatterplot + `sizeBy` (required), `sizeRange` ([5,40]), `bubbleOpacity` (0.6)
|
|
@@ -49,7 +49,9 @@
|
|
|
49
49
|
|
|
50
50
|
**LikertChart** — `data`, `categoryAccessor` ("question"), `valueAccessor` ("score", raw mode) or `levelAccessor`+`countAccessor` ("count", pre-aggregated mode), `levels` (required, ordered negative→positive), `orientation` ("horizontal"|"vertical"), `colorScheme`. Horizontal (default): diverging bar chart centered at 0% — negative levels extend left, positive right, neutral (odd count) split 50/50 across centerline. Vertical: stacked 100% bar chart. Supports any scale size (3-point to 7-point+). Raw mode aggregates integer scores automatically (1-based: score 1 → levels[0]). The `levels` array order defines polarity — first half negative, second half positive, center neutral if odd. Supports push API for streaming — accumulates raw data internally and re-aggregates percentages on each push.
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
**GaugeChart** — `value` (required), `min` (0), `max` (100), `thresholds` (array of `{ value, color, label? }` defining zones), `arcWidth` (0.3, fraction of radius), `sweep` (240°), `fillZones` (true — when false, all zones render at full color and only needle moves; used for election-needle style displays), `showNeedle` (true), `needleColor`, `centerContent` (ReactNode or `(value, min, max) => ReactNode`), `valueFormat`, `showScaleLabels` (true), `backgroundColor`. Built on top of `StreamOrdinalFrame` with `projection="radial"` and `sweepAngle` (limits pie arc to < 360°). Reuses pie/donut rendering pipeline. Zones are sorted by threshold `value` before rendering. Arc auto-sizes to fill available space with negative margins for partial sweeps.
|
|
53
|
+
|
|
54
|
+
All ordinal HOCs support `colorBy` and `colorScheme`. `categoryFormat` (`(label: string, index?: number) => string | ReactNode`) customizes individual tick labels (truncation, formatting, or custom ReactNode rendering via `<foreignObject>`). `showCategoryTicks` (default true) hides per-tick labels when false — margins auto-adjust. For distribution charts with `colorBy`, set `showCategoryTicks={false}` since the legend identifies categories.
|
|
53
55
|
|
|
54
56
|
## Network Charts (`semiotic/network`)
|
|
55
57
|
|
|
@@ -137,7 +139,7 @@ Fallback chain: `pointColor` → element color → `--semiotic-primary` CSS var
|
|
|
137
139
|
**CategoryColorProvider** — `colors` (map) or `categories` + `colorScheme`
|
|
138
140
|
Chart props: `selection`, `linkedHover`, `linkedBrush`. Hooks: `useSelection`, `useLinkedHover`, `useBrushSelection`, `useFilteredData`
|
|
139
141
|
|
|
140
|
-
**Linked crosshair** (coordinate-based hover sync): `linkedHover={{ name: "sync", mode: "x-position", xField: "time" }}` broadcasts the hovered X data value. Other charts with the same `linkedHover` name render a synced vertical crosshair at that X position. Each chart shows its own Y values independently. Use for dashboards with multiple time-series at different scales.
|
|
142
|
+
**Linked crosshair** (coordinate-based hover sync): `linkedHover={{ name: "sync", mode: "x-position", xField: "time" }}` broadcasts the hovered X data value. Other charts with the same `linkedHover` name render a synced vertical crosshair at that X position. Each chart shows its own Y values independently. Use for dashboards with multiple time-series at different scales. **Click-to-lock**: click a chart to lock the crosshair at that X position; the locked line changes to a dashed white stroke. Click again or press Escape to unlock. Locking is automatic when `linkedHover` uses `x-position` mode.
|
|
141
143
|
**ScatterplotMatrix** — `data`, `fields`, `colorBy`, `cellSize`, `hoverMode`, `brushMode`
|
|
142
144
|
**ChartContainer** — `title`, `subtitle`, `height` (400), `width` ("100%"), `status`, `loading`, `error`, `errorBoundary`, `actions` ({ export, fullscreen, copyConfig, dataSummary }), `controls`
|
|
143
145
|
**ChartGrid** — `columns` (number|"auto"), `minCellWidth` (300), `gap` (16). `emphasis="primary"` spans two columns.
|
|
@@ -290,6 +292,46 @@ Charts render with `role="group"` (outer interactive wrapper, keyboard/focus) an
|
|
|
290
292
|
- **frameProps style functions**: Bypass HOC color resolution — use `colorBy` prop instead. Frame style functions receive `(datum, categoryName)`, not `(datum, index)`.
|
|
291
293
|
- **v2 migration**: `htmlAnnotationRules` → `widget` annotations + `svgAnnotationRules`. v2 `summaryStyle` index-based coloring → v3 category-string-based.
|
|
292
294
|
- **accessibleTable**: Direct prop on HOCs. Set `accessibleTable={false}` to disable the sr-only data summary.
|
|
295
|
+
- **Format functions returning ReactNode**: `xFormat`, `yFormat`, and `categoryFormat` can return `string | ReactNode`. ReactNode labels render inside `<foreignObject>` (SVG interop). Useful for rotated, multi-line, or icon-decorated tick labels:
|
|
296
|
+
```jsx
|
|
297
|
+
<BarChart categoryFormat={(label) => <span style={{ color: "red" }}>{label}</span>} />
|
|
298
|
+
```
|
|
299
|
+
- **Per-series fillArea**: `fillArea={["seriesA", "seriesB"]}` on LineChart fills only named series while others stay as lines. Series names must match `lineBy`/`colorBy` group keys. Uses a dedicated `"mixed"` chart type internally:
|
|
300
|
+
```jsx
|
|
301
|
+
<LineChart data={data} lineBy="series" colorBy="series" fillArea={["Revenue", "Cost"]} />
|
|
302
|
+
```
|
|
303
|
+
- **Hover highlight**: `hoverHighlight="series"` dims non-hovered series on data mark hover (not just legend). Requires `colorBy` as a string field. Works on all XY and ordinal HOCs.
|
|
304
|
+
- **Click-to-lock crosshair**: In `linkedHover` x-position mode, clicking locks the crosshair (dashed white line). Hover updates are ignored while locked. Click again or press Escape to unlock. Multi-chart safe — unmounting one chart doesn't unlock another's crosshair.
|
|
305
|
+
- **Multi-color gradientFill**: `gradientFill={{ colorStops: [{offset, color}] }}` on AreaChart for semantic color bands. Supports `transparent`. Requires at least 2 stops. Offsets clamped to [0,1]:
|
|
306
|
+
```jsx
|
|
307
|
+
<AreaChart gradientFill={{ colorStops: [{ offset: 0, color: "red" }, { offset: 0.5, color: "transparent" }] }} />
|
|
308
|
+
```
|
|
309
|
+
- **Line stroke gradient**: `lineGradient={{ colorStops: [{offset, color}] }}` on LineChart/AreaChart for horizontal gradient strokes. Gradient runs from first to last X point.
|
|
310
|
+
- **Multi-point tooltip**: `tooltip="multi"` on LineChart shows all series values at hovered X with color swatches (legend-in-tooltip). Custom tooltip functions receive `datum.allSeries: Array<{group, value, color}>`:
|
|
311
|
+
```jsx
|
|
312
|
+
<LineChart data={data} lineBy="series" colorBy="series" tooltip="multi" />
|
|
313
|
+
```
|
|
314
|
+
- **Axis config** (`frameProps.axes`): Per-axis options: `includeMax: true` forces domain-max tick. `autoRotate: true` rotates bottom-axis labels 45° when crowded. `gridStyle: "dashed" | "dotted" | string` sets strokeDasharray on grid lines (requires `showGrid`):
|
|
315
|
+
```jsx
|
|
316
|
+
<LineChart showGrid frameProps={{ axes: [{ orient: "bottom", includeMax: true, autoRotate: true, gridStyle: "dashed" }] }} />
|
|
317
|
+
```
|
|
318
|
+
- **Bar baseline alignment**: Ordinal axis baseline aligns with `rScale(0)`, not chart edge. `baselinePadding={true}` restores the old padded look; default `false` is flush.
|
|
319
|
+
- **hoverRadius**: Max pixel distance for hover/click hit testing (default 30px across all frames — XY, network, geo, ordinal). Available on all XY HOCs and `StreamXYFrameProps`:
|
|
320
|
+
```jsx
|
|
321
|
+
<Scatterplot hoverRadius={60} tooltip /> {/* Larger hit area for sparse data */}
|
|
322
|
+
```
|
|
323
|
+
- **Landmark ticks**: `landmarkTicks: true` on bottom/left axis config bolds tick labels at month/year boundaries. Works with `xScaleType: "time"` for Date-aware ticks. Custom function: `landmarkTicks: (value, index) => boolean`.
|
|
324
|
+
- **xScaleType: "time"**: Creates `scaleTime` for the X axis. Ticks land on real calendar boundaries (weeks, months) instead of round numbers. Required for landmark ticks with timestamp data.
|
|
325
|
+
- **Tick deduplication**: Adjacent identical tick labels are automatically removed. Prevents duplicate labels when tick format has insufficient resolution (e.g. month-only format on weekly ticks).
|
|
326
|
+
|
|
327
|
+
## Performance
|
|
328
|
+
|
|
329
|
+
- **scalePadding**: Pixel inset on scale ranges to prevent glyph clipping at chart edges. Insets both X and Y ranges — edge data points map to N pixels from the chart boundary instead of 0px. Domain and tick values unchanged (rendered positions shift inward with the range). On `StreamXYFrame`, use `scalePadding` directly; on HOC charts, pass via `frameProps`:
|
|
330
|
+
```jsx
|
|
331
|
+
<StreamXYFrame chartType="candlestick" scalePadding={12} ... />
|
|
332
|
+
<Scatterplot data={data} pointRadius={8} frameProps={{ scalePadding: 12 }} />
|
|
333
|
+
```
|
|
334
|
+
- **Range/dumbbell plot**: Use `chartType="candlestick"` on StreamXYFrame with only `highAccessor` + `lowAccessor` (omit `openAccessor`/`closeAccessor`). Auto-detects range mode: no body rect, endpoint dots, single `rangeColor` via `candlestickStyle={{ rangeColor: "#6366f1" }}`. When `bodyWidth === 0`, body rect is skipped entirely (no invisible DOM elements).
|
|
293
335
|
|
|
294
336
|
## Performance
|
|
295
337
|
|
package/ai/schema.json
CHANGED
|
@@ -2778,6 +2778,69 @@
|
|
|
2778
2778
|
}
|
|
2779
2779
|
}
|
|
2780
2780
|
},
|
|
2781
|
+
{
|
|
2782
|
+
"type": "function",
|
|
2783
|
+
"function": {
|
|
2784
|
+
"name": "GaugeChart",
|
|
2785
|
+
"description": "Single-value gauge with threshold zones, needle indicator, and configurable sweep angle. Built on StreamOrdinalFrame radial projection.",
|
|
2786
|
+
"parameters": {
|
|
2787
|
+
"type": "object",
|
|
2788
|
+
"properties": {
|
|
2789
|
+
"value": {
|
|
2790
|
+
"type": "number",
|
|
2791
|
+
"description": "Current gauge value"
|
|
2792
|
+
},
|
|
2793
|
+
"min": {
|
|
2794
|
+
"type": "number",
|
|
2795
|
+
"default": 0
|
|
2796
|
+
},
|
|
2797
|
+
"max": {
|
|
2798
|
+
"type": "number",
|
|
2799
|
+
"default": 100
|
|
2800
|
+
},
|
|
2801
|
+
"thresholds": {
|
|
2802
|
+
"type": "array",
|
|
2803
|
+
"description": "Array of { value, color, label? } defining threshold zones. Last value should equal max.",
|
|
2804
|
+
"items": { "type": "object" }
|
|
2805
|
+
},
|
|
2806
|
+
"arcWidth": {
|
|
2807
|
+
"type": "number",
|
|
2808
|
+
"description": "Arc thickness as fraction of radius (0-1)",
|
|
2809
|
+
"default": 0.3
|
|
2810
|
+
},
|
|
2811
|
+
"sweep": {
|
|
2812
|
+
"type": "number",
|
|
2813
|
+
"description": "Arc sweep angle in degrees (gap centered at bottom)",
|
|
2814
|
+
"default": 240
|
|
2815
|
+
},
|
|
2816
|
+
"showNeedle": {
|
|
2817
|
+
"type": "boolean",
|
|
2818
|
+
"default": true
|
|
2819
|
+
},
|
|
2820
|
+
"needleColor": {
|
|
2821
|
+
"type": "string"
|
|
2822
|
+
},
|
|
2823
|
+
"valueFormat": {
|
|
2824
|
+
"type": "string",
|
|
2825
|
+
"description": "Format function for center value label"
|
|
2826
|
+
},
|
|
2827
|
+
"showScaleLabels": {
|
|
2828
|
+
"type": "boolean",
|
|
2829
|
+
"default": true
|
|
2830
|
+
},
|
|
2831
|
+
"width": {
|
|
2832
|
+
"type": "number",
|
|
2833
|
+
"default": 300
|
|
2834
|
+
},
|
|
2835
|
+
"height": {
|
|
2836
|
+
"type": "number",
|
|
2837
|
+
"default": 250
|
|
2838
|
+
}
|
|
2839
|
+
},
|
|
2840
|
+
"required": ["value"]
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2843
|
+
},
|
|
2781
2844
|
{
|
|
2782
2845
|
"type": "function",
|
|
2783
2846
|
"function": {
|
|
@@ -134,12 +134,17 @@ export declare function MultiLineTooltip(config?: MultiLineTooltipConfig): (data
|
|
|
134
134
|
/**
|
|
135
135
|
* Type for tooltip prop that chart components accept
|
|
136
136
|
*/
|
|
137
|
-
export type TooltipProp = boolean | ((data: Record<string, unknown>) => React.ReactNode) | ReturnType<typeof Tooltip> | ReturnType<typeof MultiLineTooltip> | TooltipConfig;
|
|
137
|
+
export type TooltipProp = boolean | "multi" | ((data: Record<string, unknown>) => React.ReactNode) | ReturnType<typeof Tooltip> | ReturnType<typeof MultiLineTooltip> | TooltipConfig;
|
|
138
138
|
/**
|
|
139
139
|
* The function signature that Stream Frames expect for tooltipContent.
|
|
140
140
|
* Compatible with HoverData and any Record-based hover object.
|
|
141
141
|
*/
|
|
142
142
|
export type TooltipContentFn = (d: Record<string, any>) => React.ReactNode;
|
|
143
|
+
/**
|
|
144
|
+
* Multi-point tooltip: shows all series values at the hovered X position
|
|
145
|
+
* with color swatches (legend-style). Used when tooltipMode="multi".
|
|
146
|
+
*/
|
|
147
|
+
export declare function MultiPointTooltip(): TooltipContentFn;
|
|
143
148
|
/**
|
|
144
149
|
* Convert a tooltip prop to the format Semiotic expects.
|
|
145
150
|
* Returns `false` to disable, or a `TooltipContentFn` compatible with
|
|
@@ -52,6 +52,8 @@ export { PieChart } from "./ordinal/PieChart";
|
|
|
52
52
|
export type { PieChartProps } from "./ordinal/PieChart";
|
|
53
53
|
export { DonutChart } from "./ordinal/DonutChart";
|
|
54
54
|
export type { DonutChartProps } from "./ordinal/DonutChart";
|
|
55
|
+
export { GaugeChart } from "./ordinal/GaugeChart";
|
|
56
|
+
export type { GaugeChartProps, GaugeThreshold } from "./ordinal/GaugeChart";
|
|
55
57
|
export { GroupedBarChart } from "./ordinal/GroupedBarChart";
|
|
56
58
|
export type { GroupedBarChartProps } from "./ordinal/GroupedBarChart";
|
|
57
59
|
export { SwimlaneChart } from "./ordinal/SwimlaneChart";
|
|
@@ -19,6 +19,8 @@ export interface BarChartProps<TDatum extends Record<string, any> = Record<strin
|
|
|
19
19
|
colorScheme?: string | string[];
|
|
20
20
|
sort?: boolean | "asc" | "desc" | ((a: Record<string, any>, b: Record<string, any>) => number);
|
|
21
21
|
barPadding?: number;
|
|
22
|
+
/** When true, adds padding below the 0 baseline. Default false (bars flush with axis). */
|
|
23
|
+
baselinePadding?: boolean;
|
|
22
24
|
enableHover?: boolean;
|
|
23
25
|
showGrid?: boolean;
|
|
24
26
|
showCategoryTicks?: boolean;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
|
|
3
|
+
import type { BaseChartProps } from "../shared/types";
|
|
4
|
+
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
|
+
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
6
|
+
export interface GaugeThreshold {
|
|
7
|
+
/** Upper bound of this zone (value, not percentage) */
|
|
8
|
+
value: number;
|
|
9
|
+
/** Color for this threshold zone */
|
|
10
|
+
color: string;
|
|
11
|
+
/** Optional label for the zone */
|
|
12
|
+
label?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface GaugeChartProps extends BaseChartProps {
|
|
15
|
+
/** Current gauge value */
|
|
16
|
+
value: number;
|
|
17
|
+
/** Minimum scale value (default 0) */
|
|
18
|
+
min?: number;
|
|
19
|
+
/** Maximum scale value (default 100) */
|
|
20
|
+
max?: number;
|
|
21
|
+
/** Threshold zones — ordered list of { value, color, label? }. Last threshold's value should equal max. */
|
|
22
|
+
thresholds?: GaugeThreshold[];
|
|
23
|
+
/** Color of the value arc when no thresholds defined (default: theme primary) */
|
|
24
|
+
color?: string;
|
|
25
|
+
/** Background arc color (default: var(--semiotic-grid, #e0e0e0)) */
|
|
26
|
+
backgroundColor?: string;
|
|
27
|
+
/** Arc thickness as fraction of radius (0–1, default 0.3) */
|
|
28
|
+
arcWidth?: number;
|
|
29
|
+
/** Show needle indicator (default true) */
|
|
30
|
+
showNeedle?: boolean;
|
|
31
|
+
/** Needle color (default: var(--semiotic-text, #333)) */
|
|
32
|
+
needleColor?: string;
|
|
33
|
+
/** Center content — ReactNode rendered at the gauge center. If not provided, shows the value. */
|
|
34
|
+
centerContent?: React.ReactNode | ((value: number, min: number, max: number) => React.ReactNode);
|
|
35
|
+
/** Format function for the default center value label */
|
|
36
|
+
valueFormat?: (value: number) => string;
|
|
37
|
+
/** Show scale tick labels at min, max, and threshold boundaries (default true) */
|
|
38
|
+
showScaleLabels?: boolean;
|
|
39
|
+
/** Arc sweep angle in degrees (default 240 — leaves a 120° gap at the bottom) */
|
|
40
|
+
sweep?: number;
|
|
41
|
+
/** When false, all threshold zones render at full color and only the needle indicates value. Default true (zones fill up to value). */
|
|
42
|
+
fillZones?: boolean;
|
|
43
|
+
/** Enable tooltip on arc segments */
|
|
44
|
+
tooltip?: TooltipProp;
|
|
45
|
+
/** Annotations — supports threshold markers via standard annotation system */
|
|
46
|
+
annotations?: Record<string, any>[];
|
|
47
|
+
/** Enable hover interaction (default true) */
|
|
48
|
+
enableHover?: boolean;
|
|
49
|
+
/** frameProps escape hatch */
|
|
50
|
+
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
51
|
+
}
|
|
52
|
+
export declare const GaugeChart: {
|
|
53
|
+
(props: GaugeChartProps & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
|
|
54
|
+
displayName?: string;
|
|
55
|
+
};
|
|
@@ -16,6 +16,7 @@ export interface GroupedBarChartProps<TDatum extends Record<string, any> = Recor
|
|
|
16
16
|
colorBy?: ChartAccessor<TDatum, string>;
|
|
17
17
|
colorScheme?: string | string[];
|
|
18
18
|
barPadding?: number;
|
|
19
|
+
baselinePadding?: boolean;
|
|
19
20
|
enableHover?: boolean;
|
|
20
21
|
showGrid?: boolean;
|
|
21
22
|
showCategoryTicks?: boolean;
|
|
@@ -17,6 +17,7 @@ export interface StackedBarChartProps<TDatum extends Record<string, any> = Recor
|
|
|
17
17
|
colorScheme?: string | string[];
|
|
18
18
|
normalize?: boolean;
|
|
19
19
|
barPadding?: number;
|
|
20
|
+
baselinePadding?: boolean;
|
|
20
21
|
enableHover?: boolean;
|
|
21
22
|
showGrid?: boolean;
|
|
22
23
|
showCategoryTicks?: boolean;
|
|
@@ -43,7 +43,7 @@ export declare function useSortedData(data: Array<Record<string, any>>, sort: bo
|
|
|
43
43
|
* @param unwrapData - Deprecated / no-op. Hover data is always unwrapped
|
|
44
44
|
* (stream frames wrap the raw datum in { data, time, value, x, y }).
|
|
45
45
|
*/
|
|
46
|
-
export declare function useChartSelection({ selection, linkedHover, fallbackFields, unwrapData, onObservation, chartType, chartId, onClick, }: {
|
|
46
|
+
export declare function useChartSelection({ selection, linkedHover, fallbackFields, unwrapData, onObservation, chartType, chartId, onClick, hoverHighlight, colorByField, }: {
|
|
47
47
|
selection?: SelectionConfig;
|
|
48
48
|
linkedHover?: LinkedHoverProp;
|
|
49
49
|
fallbackFields?: string[];
|
|
@@ -55,8 +55,11 @@ export declare function useChartSelection({ selection, linkedHover, fallbackFiel
|
|
|
55
55
|
x: number;
|
|
56
56
|
y: number;
|
|
57
57
|
}) => void;
|
|
58
|
+
hoverHighlight?: boolean | "series";
|
|
59
|
+
colorByField?: string;
|
|
58
60
|
}): {
|
|
59
61
|
activeSelectionHook: SelectionHookResult | null;
|
|
62
|
+
hoverSelectionHook: SelectionHookResult | null;
|
|
60
63
|
customHoverBehavior: (d: Record<string, any> | null) => void;
|
|
61
64
|
customClickBehavior: (d: Record<string, any> | null) => void;
|
|
62
65
|
/** Stable ID for this chart instance, used to suppress linked crosshair on source chart */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type React from "react";
|
|
1
2
|
import type { MarginType } from "../../types/generalTypes";
|
|
2
3
|
import type { OnObservationCallback } from "../../store/ObservationStore";
|
|
3
4
|
/**
|
|
@@ -92,6 +93,10 @@ export interface BaseChartProps {
|
|
|
92
93
|
x: number;
|
|
93
94
|
y: number;
|
|
94
95
|
}) => void;
|
|
96
|
+
/** Dim non-hovered series when hovering a data mark. "series" dims by the colorBy group key. */
|
|
97
|
+
hoverHighlight?: boolean | "series";
|
|
98
|
+
/** Max pixel distance for hover/click hit testing. Default 30. Increase for sparse charts, decrease for dense ones. */
|
|
99
|
+
hoverRadius?: number;
|
|
95
100
|
/** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
|
|
96
101
|
emphasis?: "primary" | "secondary";
|
|
97
102
|
/** Enable declarative bounded animation (enter/exit/update transitions).
|
|
@@ -109,16 +114,16 @@ export interface AxisConfig {
|
|
|
109
114
|
xLabel?: string;
|
|
110
115
|
/** Label for the y-axis */
|
|
111
116
|
yLabel?: string;
|
|
112
|
-
/** Format function for x-axis tick labels */
|
|
113
|
-
xFormat?: (d: any, index?: number, allTicks?: number[]) => string;
|
|
114
|
-
/** Format function for y-axis tick labels */
|
|
115
|
-
yFormat?: (d: any) => string;
|
|
117
|
+
/** Format function for x-axis tick labels. Return string or ReactNode for custom rendering. */
|
|
118
|
+
xFormat?: (d: any, index?: number, allTicks?: number[]) => string | React.ReactNode;
|
|
119
|
+
/** Format function for y-axis tick labels. Return string or ReactNode for custom rendering. */
|
|
120
|
+
yFormat?: (d: any) => string | React.ReactNode;
|
|
116
121
|
}
|
|
117
122
|
/**
|
|
118
123
|
* Category formatting for ordinal chart tick labels.
|
|
119
124
|
* Receives the category value and its index, returns a formatted string.
|
|
120
125
|
*/
|
|
121
|
-
export type CategoryFormatFn = (label: string, index?: number) => string;
|
|
126
|
+
export type CategoryFormatFn = (label: string, index?: number) => string | React.ReactNode;
|
|
122
127
|
/**
|
|
123
128
|
* Accessor type - can be a property name or a function
|
|
124
129
|
* @deprecated Use DataAccessor from generalTypes for generic type safety
|
|
@@ -74,19 +74,34 @@ export interface AreaChartProps<TDatum extends Record<string, any> = Record<stri
|
|
|
74
74
|
*/
|
|
75
75
|
y0Accessor?: ChartAccessor<TDatum, number>;
|
|
76
76
|
/**
|
|
77
|
-
* Gradient fill from line to baseline. Set `true` for default (80% → 5%)
|
|
78
|
-
*
|
|
77
|
+
* Gradient fill from line to baseline. Set `true` for default opacity (80% → 5%),
|
|
78
|
+
* `{ topOpacity, bottomOpacity }` for custom opacity, or
|
|
79
|
+
* `{ colorStops: [{offset, color}] }` for multi-color gradients.
|
|
79
80
|
* @default false
|
|
80
81
|
*/
|
|
81
82
|
gradientFill?: boolean | {
|
|
82
83
|
topOpacity: number;
|
|
83
84
|
bottomOpacity: number;
|
|
85
|
+
} | {
|
|
86
|
+
colorStops: Array<{
|
|
87
|
+
offset: number;
|
|
88
|
+
color: string;
|
|
89
|
+
}>;
|
|
84
90
|
};
|
|
85
91
|
/**
|
|
86
92
|
* Area opacity (flat fill, ignored when gradientFill is set)
|
|
87
93
|
* @default 0.7
|
|
88
94
|
*/
|
|
89
95
|
areaOpacity?: number;
|
|
96
|
+
/**
|
|
97
|
+
* Horizontal gradient for the line stroke. Color stops define a left-to-right gradient.
|
|
98
|
+
*/
|
|
99
|
+
lineGradient?: {
|
|
100
|
+
colorStops: Array<{
|
|
101
|
+
offset: number;
|
|
102
|
+
color: string;
|
|
103
|
+
}>;
|
|
104
|
+
};
|
|
90
105
|
/**
|
|
91
106
|
* Show line on top of area
|
|
92
107
|
* @default true
|
|
@@ -38,7 +38,7 @@ export interface LineChartProps<TDatum extends Record<string, any> = Record<stri
|
|
|
38
38
|
* Scale type for the x-axis
|
|
39
39
|
* @default "linear"
|
|
40
40
|
*/
|
|
41
|
-
xScaleType?: "linear" | "log";
|
|
41
|
+
xScaleType?: "linear" | "log" | "time";
|
|
42
42
|
/**
|
|
43
43
|
* Scale type for the y-axis
|
|
44
44
|
* @default "linear"
|
|
@@ -89,15 +89,26 @@ export interface LineChartProps<TDatum extends Record<string, any> = Record<stri
|
|
|
89
89
|
*/
|
|
90
90
|
pointRadius?: number;
|
|
91
91
|
/**
|
|
92
|
-
* Fill area under the line
|
|
92
|
+
* Fill area under the line. `true` fills all series, `string[]` lists series
|
|
93
|
+
* names (matching lineBy/colorBy group key) that get area fill while others stay as lines.
|
|
93
94
|
* @default false
|
|
94
95
|
*/
|
|
95
|
-
fillArea?: boolean;
|
|
96
|
+
fillArea?: boolean | string[];
|
|
96
97
|
/**
|
|
97
98
|
* Area opacity when fillArea is true
|
|
98
99
|
* @default 0.3
|
|
99
100
|
*/
|
|
100
101
|
areaOpacity?: number;
|
|
102
|
+
/**
|
|
103
|
+
* Horizontal gradient for the line stroke. Color stops define a left-to-right gradient.
|
|
104
|
+
* `{ colorStops: [{ offset: 0, color: "blue" }, { offset: 1, color: "red" }] }`
|
|
105
|
+
*/
|
|
106
|
+
lineGradient?: {
|
|
107
|
+
colorStops: Array<{
|
|
108
|
+
offset: number;
|
|
109
|
+
color: string;
|
|
110
|
+
}>;
|
|
111
|
+
};
|
|
101
112
|
/**
|
|
102
113
|
* Line stroke width
|
|
103
114
|
* @default 2
|
|
@@ -15,6 +15,8 @@ export { ViolinPlot } from "./charts/ordinal/ViolinPlot";
|
|
|
15
15
|
export { DotPlot } from "./charts/ordinal/DotPlot";
|
|
16
16
|
export { PieChart } from "./charts/ordinal/PieChart";
|
|
17
17
|
export { DonutChart } from "./charts/ordinal/DonutChart";
|
|
18
|
+
export { GaugeChart } from "./charts/ordinal/GaugeChart";
|
|
19
|
+
export type { GaugeChartProps, GaugeThreshold } from "./charts/ordinal/GaugeChart";
|
|
18
20
|
export { RidgelinePlot } from "./charts/ordinal/RidgelinePlot";
|
|
19
21
|
export { FunnelChart } from "./charts/ordinal/FunnelChart";
|
|
20
22
|
export { LikertChart } from "./charts/ordinal/LikertChart";
|
|
@@ -17,6 +17,7 @@ export { createHatchPattern } from "./charts/shared/hatchPattern";
|
|
|
17
17
|
export type { HatchPatternOptions } from "./charts/shared/hatchPattern";
|
|
18
18
|
export { validateProps } from "./charts/shared/validateProps";
|
|
19
19
|
export { diagnoseConfig } from "./charts/shared/diagnoseConfig";
|
|
20
|
+
export { getHitRadius } from "./stream/hitTestUtils";
|
|
20
21
|
export { toConfig, fromConfig, toURL, fromURL, copyConfig, configToJSX } from "./export/chartConfig";
|
|
21
22
|
export type { ChartConfig, ToConfigOptions, CopyFormat } from "./export/chartConfig";
|
|
22
23
|
export { serializeSelections, deserializeSelections } from "./export/selectionSerializer";
|
|
@@ -26,5 +27,5 @@ export { fromVegaLite } from "./data/fromVegaLite";
|
|
|
26
27
|
export type { VegaLiteSpec, VegaLiteEncoding } from "./data/fromVegaLite";
|
|
27
28
|
export { RingBuffer } from "./realtime/RingBuffer";
|
|
28
29
|
export { IncrementalExtent } from "./realtime/IncrementalExtent";
|
|
29
|
-
export { normalizeTooltip } from "./Tooltip/Tooltip";
|
|
30
|
+
export { normalizeTooltip, MultiPointTooltip } from "./Tooltip/Tooltip";
|
|
30
31
|
export { useReducedMotion, useHighContrast } from "./stream/useMediaPreferences";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import StreamXYFrame from "./stream/StreamXYFrame";
|
|
2
2
|
import StreamOrdinalFrame from "./stream/StreamOrdinalFrame";
|
|
3
3
|
import StreamNetworkFrame from "./stream/StreamNetworkFrame";
|
|
4
|
-
import { Scatterplot, ConnectedScatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, LikertChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, PieChart, DonutChart, GroupedBarChart, FunnelChart, SwimlaneChart, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, Treemap, CirclePack, OrbitDiagram, ScatterplotMatrix, MinimapChart, QuadrantChart, MultiAxisLineChart } from "./charts";
|
|
4
|
+
import { Scatterplot, ConnectedScatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, LikertChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, PieChart, DonutChart, GaugeChart, GroupedBarChart, FunnelChart, SwimlaneChart, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, Treemap, CirclePack, OrbitDiagram, ScatterplotMatrix, MinimapChart, QuadrantChart, MultiAxisLineChart } from "./charts";
|
|
5
5
|
import { LinkedCharts } from "./LinkedCharts";
|
|
6
6
|
import { ThemeProvider, useTheme } from "./ThemeProvider";
|
|
7
7
|
import { exportChart } from "./export/exportChart";
|
|
@@ -23,8 +23,8 @@ import { RealtimeTemporalHistogram, RealtimeHistogram } from "./charts/realtime/
|
|
|
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, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, LikertChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, PieChart, DonutChart, FunnelChart, GroupedBarChart, SwimlaneChart, Treemap, CirclePack, OrbitDiagram, ScatterplotMatrix, MinimapChart, QuadrantChart, MultiAxisLineChart, 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, StackedAreaChartProps, HeatmapProps, BubbleChartProps, BarChartProps, StackedBarChartProps, LikertChartProps, SwarmPlotProps, BoxPlotProps, HistogramProps, ViolinPlotProps, DotPlotProps, PieChartProps, DonutChartProps, FunnelChartProps, GroupedBarChartProps, SwimlaneChartProps, RidgelinePlotProps, OrbitDiagramProps, OrbitNode, ForceDirectedGraphProps, ChordDiagramProps, SankeyDiagramProps, TreeDiagramProps, TreemapProps, CirclePackProps, ScatterplotMatrixProps, MinimapChartProps, MinimapConfig, QuadrantChartProps, MultiAxisLineChartProps, MultiAxisSeriesConfig, QuadrantsConfig, QuadrantConfig, CenterlineStyle, BaseChartProps, AxisConfig, Accessor, ChartAccessor, ChartMode } from "./charts";
|
|
26
|
+
export { StreamXYFrame, StreamOrdinalFrame, StreamNetworkFrame, Scatterplot, ConnectedScatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, LikertChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, PieChart, DonutChart, GaugeChart, FunnelChart, GroupedBarChart, SwimlaneChart, Treemap, CirclePack, OrbitDiagram, ScatterplotMatrix, MinimapChart, QuadrantChart, MultiAxisLineChart, 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, StackedAreaChartProps, HeatmapProps, BubbleChartProps, BarChartProps, StackedBarChartProps, LikertChartProps, SwarmPlotProps, BoxPlotProps, HistogramProps, ViolinPlotProps, DotPlotProps, PieChartProps, DonutChartProps, GaugeChartProps, GaugeThreshold, FunnelChartProps, GroupedBarChartProps, SwimlaneChartProps, RidgelinePlotProps, OrbitDiagramProps, OrbitNode, ForceDirectedGraphProps, ChordDiagramProps, SankeyDiagramProps, TreeDiagramProps, TreemapProps, CirclePackProps, ScatterplotMatrixProps, MinimapChartProps, MinimapConfig, QuadrantChartProps, MultiAxisLineChartProps, MultiAxisSeriesConfig, QuadrantsConfig, QuadrantConfig, CenterlineStyle, BaseChartProps, AxisConfig, Accessor, ChartAccessor, ChartMode } from "./charts";
|
|
28
28
|
export type { StreamXYFrameProps, StreamXYFrameHandle, StreamChartType, RuntimeMode, SceneNode, Changeset, StreamScales, StreamLayout, CurveType, CanvasRendererFn } from "./stream/types";
|
|
29
29
|
export type { StreamRendererFn } from "./stream/renderers/types";
|
|
30
30
|
export type { StreamOrdinalFrameProps, StreamOrdinalFrameHandle, OrdinalChartType, OrdinalScales, OrdinalSceneNode } from "./stream/ordinalTypes";
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
export declare function setCrosshairPosition(name: string, xValue: number, sourceId: string): void;
|
|
2
2
|
export declare function clearCrosshairPosition(name: string, sourceId: string): void;
|
|
3
|
+
/** Toggle lock: if unlocked, lock at xValue; if locked, unlock and clear. Returns new locked state. */
|
|
4
|
+
export declare function toggleCrosshairLock(name: string, xValue: number, sourceId: string): boolean;
|
|
5
|
+
/** Force-unlock a crosshair by name. When sourceId is provided, only unlocks if it matches (safe for multi-chart unmount). */
|
|
6
|
+
export declare function unlockCrosshair(name: string, sourceId?: string): void;
|
|
3
7
|
/**
|
|
4
8
|
* Hook to read a specific crosshair position by name.
|
|
5
|
-
* Returns the X value and
|
|
6
|
-
* When name is undefined, uses a no-op subscription to avoid unnecessary re-renders.
|
|
9
|
+
* Returns the X value, sourceId, and locked state, or null if no crosshair is active.
|
|
7
10
|
*/
|
|
8
11
|
export declare function useCrosshairPosition(name: string | undefined): {
|
|
9
12
|
xValue: number;
|
|
10
13
|
sourceId: string;
|
|
14
|
+
locked?: boolean;
|
|
11
15
|
} | null;
|
|
@@ -18,6 +18,19 @@ export interface HitResult {
|
|
|
18
18
|
* use the linear scan.
|
|
19
19
|
*/
|
|
20
20
|
export declare function findNearestNode(scene: SceneNode[], px: number, py: number, maxDistance?: number, pointQuadtree?: Quadtree<PointSceneNode> | null): HitResult | null;
|
|
21
|
+
/**
|
|
22
|
+
* Find all line/area nodes at a given X pixel coordinate.
|
|
23
|
+
* For each node, interpolates the Y value at px using the path data.
|
|
24
|
+
* Used for multi-point tooltip (show all series values at the hovered X).
|
|
25
|
+
*/
|
|
26
|
+
export declare function findAllNodesAtX(scene: SceneNode[], px: number, maxXDistance?: number): Array<{
|
|
27
|
+
node: SceneNode;
|
|
28
|
+
datum: any;
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
group?: string;
|
|
32
|
+
color?: string;
|
|
33
|
+
}>;
|
|
21
34
|
/**
|
|
22
35
|
* Binary search for nearest point by time value in a RingBuffer.
|
|
23
36
|
*/
|
|
@@ -19,7 +19,7 @@ interface OrdinalSVGOverlayProps {
|
|
|
19
19
|
showCategoryTicks?: boolean;
|
|
20
20
|
oLabel?: string;
|
|
21
21
|
rLabel?: string;
|
|
22
|
-
oFormat?: (d: string, index?: number) => string;
|
|
22
|
+
oFormat?: (d: string, index?: number) => string | React.ReactNode;
|
|
23
23
|
rFormat?: (d: number) => string;
|
|
24
24
|
showGrid?: boolean;
|
|
25
25
|
title?: string | ReactNode;
|
|
@@ -9,6 +9,8 @@ export interface PipelineConfig {
|
|
|
9
9
|
windowMode: WindowMode;
|
|
10
10
|
arrowOfTime: ArrowOfTime;
|
|
11
11
|
extentPadding: number;
|
|
12
|
+
/** Pixel inset on scale ranges to prevent glyph clipping at chart edges. Default 0. */
|
|
13
|
+
scalePadding?: number;
|
|
12
14
|
maxCapacity?: number;
|
|
13
15
|
xAccessor?: string | ((d: any) => number);
|
|
14
16
|
yAccessor?: string | ((d: any) => number);
|
|
@@ -19,7 +21,7 @@ export interface PipelineConfig {
|
|
|
19
21
|
groupAccessor?: string | ((d: any) => string);
|
|
20
22
|
categoryAccessor?: string | ((d: any) => string);
|
|
21
23
|
lineDataAccessor?: string;
|
|
22
|
-
xScaleType?: "linear" | "log";
|
|
24
|
+
xScaleType?: "linear" | "log" | "time";
|
|
23
25
|
yScaleType?: "linear" | "log";
|
|
24
26
|
xExtent?: [number | undefined, number | undefined] | [number];
|
|
25
27
|
yExtent?: [number | undefined, number | undefined] | [number];
|
|
@@ -31,12 +33,26 @@ export interface PipelineConfig {
|
|
|
31
33
|
lowAccessor?: string | ((d: any) => number);
|
|
32
34
|
closeAccessor?: string | ((d: any) => number);
|
|
33
35
|
candlestickStyle?: CandlestickStyle;
|
|
36
|
+
/** Internal: set by PipelineStore when open/close accessors are both missing */
|
|
37
|
+
candlestickRangeMode?: boolean;
|
|
34
38
|
boundsAccessor?: string | ((d: any) => number);
|
|
35
39
|
boundsStyle?: any;
|
|
36
40
|
y0Accessor?: string | ((d: any) => number);
|
|
37
41
|
gradientFill?: {
|
|
38
42
|
topOpacity: number;
|
|
39
43
|
bottomOpacity: number;
|
|
44
|
+
} | {
|
|
45
|
+
colorStops: Array<{
|
|
46
|
+
offset: number;
|
|
47
|
+
color: string;
|
|
48
|
+
}>;
|
|
49
|
+
};
|
|
50
|
+
areaGroups?: Set<string>;
|
|
51
|
+
lineGradient?: {
|
|
52
|
+
colorStops: Array<{
|
|
53
|
+
offset: number;
|
|
54
|
+
color: string;
|
|
55
|
+
}>;
|
|
40
56
|
};
|
|
41
57
|
lineStyle?: any;
|
|
42
58
|
pointStyle?: (d: any) => Style & {
|
|
@@ -7,9 +7,15 @@ export interface AxisConfig {
|
|
|
7
7
|
orient: "left" | "right" | "top" | "bottom";
|
|
8
8
|
label?: string;
|
|
9
9
|
ticks?: number;
|
|
10
|
-
tickFormat?: (d: any, index?: number, allTicks?: number[]) => string;
|
|
10
|
+
tickFormat?: (d: any, index?: number, allTicks?: number[]) => string | ReactNode;
|
|
11
11
|
baseline?: boolean | "under";
|
|
12
12
|
jaggedBase?: boolean;
|
|
13
|
+
/** 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. */
|
|
14
|
+
gridStyle?: "dashed" | "dotted" | string;
|
|
15
|
+
/** Always include the domain max as a tick, even if d3 omits it. */
|
|
16
|
+
includeMax?: boolean;
|
|
17
|
+
/** Auto-rotate labels 45° when horizontal spacing is too tight. */
|
|
18
|
+
autoRotate?: boolean;
|
|
13
19
|
/** Highlight ticks at time boundaries (new month, year, etc.) with semibold text.
|
|
14
20
|
* `true` auto-detects Date boundaries. A function receives (value, index) and returns true for landmark ticks. */
|
|
15
21
|
landmarkTicks?: boolean | ((value: any, index: number) => boolean);
|
|
@@ -32,8 +38,8 @@ interface SVGOverlayProps {
|
|
|
32
38
|
yLabel?: string;
|
|
33
39
|
/** Label for the right Y axis (dual-axis charts) */
|
|
34
40
|
yLabelRight?: string;
|
|
35
|
-
xFormat?: (d: any, index?: number, allTicks?: number[]) => string;
|
|
36
|
-
yFormat?: (d: any) => string;
|
|
41
|
+
xFormat?: (d: any, index?: number, allTicks?: number[]) => string | ReactNode;
|
|
42
|
+
yFormat?: (d: any) => string | ReactNode;
|
|
37
43
|
showGrid?: boolean;
|
|
38
44
|
title?: string | ReactNode;
|
|
39
45
|
legend?: ReactNode | {
|
|
@@ -96,8 +102,8 @@ interface SVGUnderlayProps {
|
|
|
96
102
|
showAxes?: boolean;
|
|
97
103
|
axes?: AxisConfig[];
|
|
98
104
|
showGrid?: boolean;
|
|
99
|
-
xFormat?: (d: any, index?: number, allTicks?: number[]) => string;
|
|
100
|
-
yFormat?: (d: any) => string;
|
|
105
|
+
xFormat?: (d: any, index?: number, allTicks?: number[]) => string | ReactNode;
|
|
106
|
+
yFormat?: (d: any) => string | ReactNode;
|
|
101
107
|
}
|
|
102
108
|
export declare function SVGUnderlay(props: SVGUnderlayProps): React.JSX.Element | null;
|
|
103
109
|
export declare function SVGOverlay(props: SVGOverlayProps): React.JSX.Element | null;
|