@wallarm-org/design-system 0.35.0 → 0.36.0
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/dist/components/Attribute/AttributeActionsTarget.js +1 -1
- package/dist/components/Ip/IpList/IpListHorizontal.js +1 -1
- package/dist/components/OverflowList/OverflowList.js +1 -1
- package/dist/components/Popover/PopoverContent.js +1 -1
- package/dist/components/SimpleCharts/LineChart/LineChart.d.ts +70 -0
- package/dist/components/SimpleCharts/LineChart/LineChart.figma.d.ts +1 -0
- package/dist/components/SimpleCharts/LineChart/LineChart.figma.js +163 -0
- package/dist/components/SimpleCharts/LineChart/LineChart.js +136 -0
- package/dist/components/SimpleCharts/LineChart/LineChartBody.d.ts +12 -0
- package/dist/components/SimpleCharts/LineChart/LineChartBody.js +66 -0
- package/dist/components/SimpleCharts/LineChart/LineChartContext.d.ts +151 -0
- package/dist/components/SimpleCharts/LineChart/LineChartContext.js +16 -0
- package/dist/components/SimpleCharts/LineChart/LineChartEmpty.d.ts +15 -0
- package/dist/components/SimpleCharts/LineChart/LineChartEmpty.js +71 -0
- package/dist/components/SimpleCharts/LineChart/LineChartGrid.d.ts +19 -0
- package/dist/components/SimpleCharts/LineChart/LineChartGrid.js +17 -0
- package/dist/components/SimpleCharts/LineChart/LineChartHoverPopover.d.ts +5 -0
- package/dist/components/SimpleCharts/LineChart/LineChartHoverPopover.js +14 -0
- package/dist/components/SimpleCharts/LineChart/LineChartHoverPopoverDot.d.ts +14 -0
- package/dist/components/SimpleCharts/LineChart/LineChartHoverPopoverDot.js +20 -0
- package/dist/components/SimpleCharts/LineChart/LineChartHoverPopoverRow.d.ts +12 -0
- package/dist/components/SimpleCharts/LineChart/LineChartHoverPopoverRow.js +33 -0
- package/dist/components/SimpleCharts/LineChart/LineChartHoverPopoverTimestamp.d.ts +5 -0
- package/dist/components/SimpleCharts/LineChart/LineChartHoverPopoverTimestamp.js +12 -0
- package/dist/components/SimpleCharts/LineChart/LineChartLegend.d.ts +15 -0
- package/dist/components/SimpleCharts/LineChart/LineChartLegend.js +19 -0
- package/dist/components/SimpleCharts/LineChart/LineChartLegendItem.d.ts +14 -0
- package/dist/components/SimpleCharts/LineChart/LineChartLegendItem.js +112 -0
- package/dist/components/SimpleCharts/LineChart/LineChartLine.d.ts +17 -0
- package/dist/components/SimpleCharts/LineChart/LineChartLine.js +57 -0
- package/dist/components/SimpleCharts/LineChart/LineChartTooltip.d.ts +31 -0
- package/dist/components/SimpleCharts/LineChart/LineChartTooltip.js +75 -0
- package/dist/components/SimpleCharts/LineChart/LineChartXAxis.d.ts +51 -0
- package/dist/components/SimpleCharts/LineChart/LineChartXAxis.js +34 -0
- package/dist/components/SimpleCharts/LineChart/LineChartYAxis.d.ts +24 -0
- package/dist/components/SimpleCharts/LineChart/LineChartYAxis.js +30 -0
- package/dist/components/SimpleCharts/LineChart/LineChartZoomBrush.d.ts +32 -0
- package/dist/components/SimpleCharts/LineChart/LineChartZoomBrush.js +104 -0
- package/dist/components/SimpleCharts/LineChart/LineChartZoomPopover.d.ts +5 -0
- package/dist/components/SimpleCharts/LineChart/LineChartZoomPopover.js +14 -0
- package/dist/components/SimpleCharts/LineChart/LineChartZoomPopoverConfirm.d.ts +5 -0
- package/dist/components/SimpleCharts/LineChart/LineChartZoomPopoverConfirm.js +14 -0
- package/dist/components/SimpleCharts/LineChart/LineChartZoomPopoverRange.d.ts +5 -0
- package/dist/components/SimpleCharts/LineChart/LineChartZoomPopoverRange.js +12 -0
- package/dist/components/SimpleCharts/LineChart/classes.d.ts +28 -0
- package/dist/components/SimpleCharts/LineChart/classes.js +95 -0
- package/dist/components/SimpleCharts/LineChart/constants.d.ts +25 -0
- package/dist/components/SimpleCharts/LineChart/constants.js +26 -0
- package/dist/components/SimpleCharts/LineChart/hooks/index.d.ts +5 -0
- package/dist/components/SimpleCharts/LineChart/hooks/index.js +6 -0
- package/dist/components/SimpleCharts/LineChart/hooks/useLineChartActiveKey.d.ts +33 -0
- package/dist/components/SimpleCharts/LineChart/hooks/useLineChartActiveKey.js +33 -0
- package/dist/components/SimpleCharts/LineChart/hooks/useLineChartDataWarnings.d.ts +18 -0
- package/dist/components/SimpleCharts/LineChart/hooks/useLineChartDataWarnings.js +47 -0
- package/dist/components/SimpleCharts/LineChart/hooks/useLineChartZoomState.d.ts +37 -0
- package/dist/components/SimpleCharts/LineChart/hooks/useLineChartZoomState.js +111 -0
- package/dist/components/SimpleCharts/LineChart/hooks/useZoomDragListeners.d.ts +16 -0
- package/dist/components/SimpleCharts/LineChart/hooks/useZoomDragListeners.js +27 -0
- package/dist/components/SimpleCharts/LineChart/hooks/useZoomPendingListeners.d.ts +21 -0
- package/dist/components/SimpleCharts/LineChart/hooks/useZoomPendingListeners.js +35 -0
- package/dist/components/SimpleCharts/LineChart/index.d.ts +19 -0
- package/dist/components/SimpleCharts/LineChart/index.js +19 -0
- package/dist/components/SimpleCharts/LineChart/lib/dropEdgeGridLines.d.ts +30 -0
- package/dist/components/SimpleCharts/LineChart/lib/dropEdgeGridLines.js +48 -0
- package/dist/components/SimpleCharts/LineChart/lib/formatRange.d.ts +9 -0
- package/dist/components/SimpleCharts/LineChart/lib/formatRange.js +7 -0
- package/dist/components/SimpleCharts/LineChart/lib/sampleData.d.ts +15 -0
- package/dist/components/SimpleCharts/LineChart/lib/sampleData.js +109 -0
- package/dist/components/SimpleCharts/LineChart/lib/tickHorizontalCoordinates.d.ts +15 -0
- package/dist/components/SimpleCharts/LineChart/lib/tickHorizontalCoordinates.js +13 -0
- package/dist/components/SimpleCharts/LineChart/lib/warn.d.ts +4 -0
- package/dist/components/SimpleCharts/LineChart/lib/warn.js +6 -0
- package/dist/components/SimpleCharts/PieChart/PieChartContext.js +5 -2
- package/dist/components/SimpleCharts/PieChart/constants.d.ts +1 -2
- package/dist/components/SimpleCharts/PieChart/constants.js +2 -15
- package/dist/components/SimpleCharts/hooks/index.d.ts +1 -0
- package/dist/components/SimpleCharts/hooks/index.js +2 -0
- package/dist/components/SimpleCharts/hooks/useChartTimeFormatters.d.ts +21 -0
- package/dist/components/SimpleCharts/hooks/useChartTimeFormatters.js +33 -0
- package/dist/components/SimpleCharts/index.d.ts +3 -0
- package/dist/components/SimpleCharts/index.js +4 -1
- package/dist/components/SimpleCharts/lib/chartPalette.d.ts +10 -0
- package/dist/components/SimpleCharts/lib/chartPalette.js +20 -0
- package/dist/components/SimpleCharts/lib/hoverSync.d.ts +9 -0
- package/dist/components/SimpleCharts/lib/hoverSync.js +5 -0
- package/dist/components/SimpleCharts/lib/index.d.ts +2 -0
- package/dist/components/SimpleCharts/lib/index.js +3 -0
- package/dist/components/SimpleCharts/lib/timeFormatters.d.ts +25 -0
- package/dist/components/SimpleCharts/lib/timeFormatters.js +57 -0
- package/dist/hooks/useOverflowItems.js +1 -1
- package/dist/metadata/components.json +3665 -2
- package/dist/utils/formatDateTime.d.ts +4 -0
- package/dist/utils/formatDateTime.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import { XAxis } from "recharts";
|
|
4
|
+
import { LINE_AXIS_TICK_TEXT_PROPS } from "./constants.js";
|
|
5
|
+
import { LineChartDataContext } from "./LineChartContext.js";
|
|
6
|
+
const DENSITY_MIN_TICK_GAP = {
|
|
7
|
+
sparse: 64,
|
|
8
|
+
normal: 32,
|
|
9
|
+
dense: 16
|
|
10
|
+
};
|
|
11
|
+
const AXIS_LINE_PROPS = {
|
|
12
|
+
stroke: 'var(--color-border-primary-light)'
|
|
13
|
+
};
|
|
14
|
+
const LineChartXAxis = ({ tickFormatter, density, interval, tickCount, ticks, minTickGap, domain, padding, type, hideTicks = false, axisLine = true })=>{
|
|
15
|
+
const dataCtx = useContext(LineChartDataContext);
|
|
16
|
+
const xKey = dataCtx?.xKey ?? 'x';
|
|
17
|
+
const resolvedMinTickGap = minTickGap ?? (density ? DENSITY_MIN_TICK_GAP[density] : void 0);
|
|
18
|
+
return /*#__PURE__*/ jsx(XAxis, {
|
|
19
|
+
dataKey: xKey,
|
|
20
|
+
type: type,
|
|
21
|
+
tickLine: false,
|
|
22
|
+
axisLine: axisLine ? AXIS_LINE_PROPS : false,
|
|
23
|
+
tick: hideTicks ? false : LINE_AXIS_TICK_TEXT_PROPS,
|
|
24
|
+
tickFormatter: tickFormatter,
|
|
25
|
+
interval: interval,
|
|
26
|
+
tickCount: tickCount,
|
|
27
|
+
ticks: ticks,
|
|
28
|
+
minTickGap: resolvedMinTickGap,
|
|
29
|
+
domain: domain,
|
|
30
|
+
padding: padding
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
LineChartXAxis.displayName = 'LineChartXAxis';
|
|
34
|
+
export { LineChartXAxis };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
export interface LineChartYAxisProps {
|
|
3
|
+
/** Format the rendered tick label. */
|
|
4
|
+
tickFormatter?: (value: unknown, index: number) => string;
|
|
5
|
+
/** Recharts target tick count. */
|
|
6
|
+
tickCount?: number;
|
|
7
|
+
/** Explicit tick values. Overrides recharts' generator. */
|
|
8
|
+
ticks?: ReadonlyArray<number | string>;
|
|
9
|
+
/** Recharts domain override. */
|
|
10
|
+
domain?: [
|
|
11
|
+
number | string | 'auto' | 'dataMin' | 'dataMax',
|
|
12
|
+
number | string | 'auto' | 'dataMin' | 'dataMax'
|
|
13
|
+
];
|
|
14
|
+
/** Padding between the plot edge and the first/last tick. */
|
|
15
|
+
padding?: {
|
|
16
|
+
top?: number;
|
|
17
|
+
bottom?: number;
|
|
18
|
+
};
|
|
19
|
+
/** Y-label gutter width. Defaults to the Figma-mandated `LINE_Y_LABEL_WIDTH` (38px). */
|
|
20
|
+
width?: number;
|
|
21
|
+
/** Render the axis area as a spacer (preserves layout, hides the labels). */
|
|
22
|
+
hideTicks?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const LineChartYAxis: FC<LineChartYAxisProps>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Text, YAxis } from "recharts";
|
|
3
|
+
import { LINE_AXIS_TICK_TEXT_PROPS, LINE_Y_LABEL_WIDTH } from "./constants.js";
|
|
4
|
+
const renderTick = (props)=>{
|
|
5
|
+
const { x, y, payload, visibleTicksCount, textAnchor, verticalAnchor, tickFormatter, index } = props;
|
|
6
|
+
if (index === visibleTicksCount - 1) return null;
|
|
7
|
+
const value = tickFormatter ? tickFormatter(payload.value, payload.index) : payload.value;
|
|
8
|
+
return /*#__PURE__*/ jsx(Text, {
|
|
9
|
+
x: x,
|
|
10
|
+
y: y,
|
|
11
|
+
textAnchor: textAnchor,
|
|
12
|
+
verticalAnchor: verticalAnchor,
|
|
13
|
+
...LINE_AXIS_TICK_TEXT_PROPS,
|
|
14
|
+
children: value
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
const LineChartYAxis = ({ tickFormatter, tickCount, ticks, domain, padding, width = LINE_Y_LABEL_WIDTH, hideTicks = false })=>/*#__PURE__*/ jsx(YAxis, {
|
|
18
|
+
width: width,
|
|
19
|
+
tickLine: false,
|
|
20
|
+
axisLine: false,
|
|
21
|
+
tick: hideTicks ? false : renderTick,
|
|
22
|
+
tickFormatter: tickFormatter,
|
|
23
|
+
tickCount: tickCount,
|
|
24
|
+
ticks: ticks,
|
|
25
|
+
domain: domain,
|
|
26
|
+
padding: padding,
|
|
27
|
+
interval: 0
|
|
28
|
+
});
|
|
29
|
+
LineChartYAxis.displayName = 'LineChartYAxis';
|
|
30
|
+
export { LineChartYAxis };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type FC, type ReactNode } from 'react';
|
|
2
|
+
import { type LineChartZoomRange } from './LineChartContext';
|
|
3
|
+
export interface LineChartZoomBrushProps {
|
|
4
|
+
/** When `true` the zoom interaction is removed entirely. */
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
/** Override the default range text rendered inside the popover. */
|
|
7
|
+
formatRange?: (range: LineChartZoomRange) => ReactNode;
|
|
8
|
+
/** Override the default "Zoom in" label on the confirm button. */
|
|
9
|
+
confirmLabel?: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Portal target for the floating range/confirm popover. Defaults to
|
|
12
|
+
* `document.body`. Pass a dialog/modal node to keep the popover inside the
|
|
13
|
+
* focus-trapped subtree — without this the portal escapes the focus context
|
|
14
|
+
* and tabbing from the confirm button lands outside the dialog.
|
|
15
|
+
*/
|
|
16
|
+
container?: HTMLElement | null;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Enables Chrome DevTools-style drag-to-zoom on the chart plot. Two-phase:
|
|
20
|
+
*
|
|
21
|
+
* 1. The user drags on the plot → gray `<ReferenceArea>` follows the cursor,
|
|
22
|
+
* and a floating popover shows the formatted range live.
|
|
23
|
+
* 2. The user releases → selection stays put, popover surfaces a "Zoom in"
|
|
24
|
+
* button. Clicking it (or pressing Enter) fires `onZoomChange` with the
|
|
25
|
+
* selected range. Escape, clicking outside the popover, or starting a new
|
|
26
|
+
* drag dismisses without emitting.
|
|
27
|
+
*
|
|
28
|
+
* Mount once as a child of `<LineChartBody>` (anywhere — order does not matter
|
|
29
|
+
* since recharts picks `<ReferenceArea>` up by component type). Pair with a
|
|
30
|
+
* "Zoom out" affordance in your chart header that calls `setRange(null)`.
|
|
31
|
+
*/
|
|
32
|
+
export declare const LineChartZoomBrush: FC<LineChartZoomBrushProps>;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useContext, useEffect, useMemo, useRef } from "react";
|
|
3
|
+
import { createPortal } from "react-dom";
|
|
4
|
+
import { ReferenceArea } from "recharts";
|
|
5
|
+
import { lineChartZoomCursorPopoverClasses } from "./classes.js";
|
|
6
|
+
import { useZoomPendingListeners } from "./hooks/useZoomPendingListeners.js";
|
|
7
|
+
import { LineChartDataContext, LineChartZoomContext } from "./LineChartContext.js";
|
|
8
|
+
import { LineChartZoomPopover } from "./LineChartZoomPopover.js";
|
|
9
|
+
import { LineChartZoomPopoverConfirm } from "./LineChartZoomPopoverConfirm.js";
|
|
10
|
+
import { LineChartZoomPopoverRange } from "./LineChartZoomPopoverRange.js";
|
|
11
|
+
import { formatRange as formatRange_js_formatRange } from "./lib/formatRange.js";
|
|
12
|
+
const POPOVER_OFFSET_X = 12;
|
|
13
|
+
const POPOVER_OFFSET_Y = 12;
|
|
14
|
+
const LineChartZoomBrush = ({ disabled = false, formatRange = formatRange_js_formatRange, confirmLabel = 'Zoom in', container })=>{
|
|
15
|
+
const dataCtx = useContext(LineChartDataContext);
|
|
16
|
+
const zoomCtx = useContext(LineChartZoomContext);
|
|
17
|
+
const popoverRef = useRef(null);
|
|
18
|
+
const registerEnabled = zoomCtx?.registerEnabled;
|
|
19
|
+
useEffect(()=>{
|
|
20
|
+
if (disabled || !registerEnabled) return;
|
|
21
|
+
return registerEnabled();
|
|
22
|
+
}, [
|
|
23
|
+
disabled,
|
|
24
|
+
registerEnabled
|
|
25
|
+
]);
|
|
26
|
+
const drag = zoomCtx?.drag ?? null;
|
|
27
|
+
const pending = zoomCtx?.pending ?? null;
|
|
28
|
+
const cancelPending = zoomCtx?.cancelPending;
|
|
29
|
+
const confirmZoom = zoomCtx?.confirmZoom;
|
|
30
|
+
const rootRef = zoomCtx?.rootRef;
|
|
31
|
+
useZoomPendingListeners({
|
|
32
|
+
enabled: null !== pending,
|
|
33
|
+
rootRef,
|
|
34
|
+
popoverRef,
|
|
35
|
+
onConfirm: confirmZoom,
|
|
36
|
+
onCancel: cancelPending
|
|
37
|
+
});
|
|
38
|
+
const range = useMemo(()=>{
|
|
39
|
+
if (drag && dataCtx) {
|
|
40
|
+
const lo = Math.min(drag.startIndex, drag.endIndex);
|
|
41
|
+
const hi = Math.max(drag.startIndex, drag.endIndex);
|
|
42
|
+
const fromDatum = dataCtx.data[lo];
|
|
43
|
+
const toDatum = dataCtx.data[hi];
|
|
44
|
+
if (!fromDatum || !toDatum) return null;
|
|
45
|
+
const from = fromDatum[dataCtx.xKey];
|
|
46
|
+
const to = toDatum[dataCtx.xKey];
|
|
47
|
+
if (null == from || null == to) return null;
|
|
48
|
+
return {
|
|
49
|
+
fromIndex: lo,
|
|
50
|
+
toIndex: hi,
|
|
51
|
+
from,
|
|
52
|
+
to
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return pending?.range ?? null;
|
|
56
|
+
}, [
|
|
57
|
+
drag,
|
|
58
|
+
pending,
|
|
59
|
+
dataCtx
|
|
60
|
+
]);
|
|
61
|
+
if (disabled || !dataCtx || !zoomCtx) return null;
|
|
62
|
+
const popoverPosition = drag ?? pending ?? null;
|
|
63
|
+
const isPending = null !== pending;
|
|
64
|
+
const popoverContent = range && popoverPosition ? /*#__PURE__*/ jsx("div", {
|
|
65
|
+
ref: popoverRef,
|
|
66
|
+
"data-slot": "line-chart-zoom-cursor-popover",
|
|
67
|
+
"data-zoom-state": isPending ? 'pending' : 'dragging',
|
|
68
|
+
className: lineChartZoomCursorPopoverClasses,
|
|
69
|
+
style: {
|
|
70
|
+
top: popoverPosition.clientY - POPOVER_OFFSET_Y,
|
|
71
|
+
left: popoverPosition.clientX + POPOVER_OFFSET_X,
|
|
72
|
+
transform: 'translateY(-100%)',
|
|
73
|
+
pointerEvents: isPending ? 'auto' : 'none'
|
|
74
|
+
},
|
|
75
|
+
onMouseDown: (e)=>e.stopPropagation(),
|
|
76
|
+
children: /*#__PURE__*/ jsxs(LineChartZoomPopover, {
|
|
77
|
+
children: [
|
|
78
|
+
/*#__PURE__*/ jsx(LineChartZoomPopoverRange, {
|
|
79
|
+
children: formatRange(range)
|
|
80
|
+
}),
|
|
81
|
+
/*#__PURE__*/ jsx(LineChartZoomPopoverConfirm, {
|
|
82
|
+
onClick: zoomCtx.confirmZoom,
|
|
83
|
+
children: confirmLabel
|
|
84
|
+
})
|
|
85
|
+
]
|
|
86
|
+
})
|
|
87
|
+
}) : null;
|
|
88
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
89
|
+
children: [
|
|
90
|
+
range ? /*#__PURE__*/ jsx(ReferenceArea, {
|
|
91
|
+
x1: range.from,
|
|
92
|
+
x2: range.to,
|
|
93
|
+
fill: "var(--color-states-primary-hover)",
|
|
94
|
+
fillOpacity: 1,
|
|
95
|
+
stroke: "var(--color-border-primary-light)",
|
|
96
|
+
strokeOpacity: 1,
|
|
97
|
+
ifOverflow: "visible"
|
|
98
|
+
}) : null,
|
|
99
|
+
popoverContent ? /*#__PURE__*/ createPortal(popoverContent, container ?? document.body) : null
|
|
100
|
+
]
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
LineChartZoomBrush.displayName = 'LineChartZoomBrush';
|
|
104
|
+
export { LineChartZoomBrush };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../utils/cn.js";
|
|
3
|
+
import { lineChartZoomPopoverClasses } from "./classes.js";
|
|
4
|
+
const LineChartZoomPopover = ({ ref, className, children, ...props })=>/*#__PURE__*/ jsx("div", {
|
|
5
|
+
...props,
|
|
6
|
+
ref: ref,
|
|
7
|
+
"data-slot": "line-chart-zoom-popover",
|
|
8
|
+
role: "dialog",
|
|
9
|
+
"aria-modal": "false",
|
|
10
|
+
className: cn(lineChartZoomPopoverClasses, className),
|
|
11
|
+
children: children
|
|
12
|
+
});
|
|
13
|
+
LineChartZoomPopover.displayName = 'LineChartZoomPopover';
|
|
14
|
+
export { LineChartZoomPopover };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, FC, Ref } from 'react';
|
|
2
|
+
export interface LineChartZoomPopoverConfirmProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
ref?: Ref<HTMLButtonElement>;
|
|
4
|
+
}
|
|
5
|
+
export declare const LineChartZoomPopoverConfirm: FC<LineChartZoomPopoverConfirmProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../utils/cn.js";
|
|
3
|
+
import { lineChartZoomPopoverConfirmClasses } from "./classes.js";
|
|
4
|
+
const LineChartZoomPopoverConfirm = ({ ref, className, children, type = 'button', ...props })=>/*#__PURE__*/ jsx("button", {
|
|
5
|
+
...props,
|
|
6
|
+
ref: ref,
|
|
7
|
+
type: type,
|
|
8
|
+
"data-slot": "line-chart-zoom-popover-confirm",
|
|
9
|
+
"aria-keyshortcuts": "Enter",
|
|
10
|
+
className: cn(lineChartZoomPopoverConfirmClasses, className),
|
|
11
|
+
children: children
|
|
12
|
+
});
|
|
13
|
+
LineChartZoomPopoverConfirm.displayName = 'LineChartZoomPopoverConfirm';
|
|
14
|
+
export { LineChartZoomPopoverConfirm };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../utils/cn.js";
|
|
3
|
+
import { lineChartZoomPopoverRangeClasses } from "./classes.js";
|
|
4
|
+
const LineChartZoomPopoverRange = ({ ref, className, children, ...props })=>/*#__PURE__*/ jsx("div", {
|
|
5
|
+
...props,
|
|
6
|
+
ref: ref,
|
|
7
|
+
"data-slot": "line-chart-zoom-popover-range",
|
|
8
|
+
className: cn(lineChartZoomPopoverRangeClasses, className),
|
|
9
|
+
children: children
|
|
10
|
+
});
|
|
11
|
+
LineChartZoomPopoverRange.displayName = 'LineChartZoomPopoverRange';
|
|
12
|
+
export { LineChartZoomPopoverRange };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const lineChartRootClasses: string;
|
|
2
|
+
export declare const lineChartBodyClasses: string;
|
|
3
|
+
export declare const lineChartBodyZoomEnabledClasses: string;
|
|
4
|
+
export declare const lineChartZoomCursorPopoverClasses: string;
|
|
5
|
+
export declare const lineChartLegendVariants: (props?: ({
|
|
6
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
7
|
+
align?: "end" | "start" | "center" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export declare const lineChartLegendItemVariants: (props?: ({
|
|
10
|
+
interactive?: boolean | null | undefined;
|
|
11
|
+
active?: boolean | null | undefined;
|
|
12
|
+
selected?: boolean | null | undefined;
|
|
13
|
+
dimmed?: boolean | null | undefined;
|
|
14
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
|
+
export declare const lineChartHoverPopoverClasses: string;
|
|
16
|
+
export declare const lineChartHoverPopoverTimestampClasses: string;
|
|
17
|
+
export declare const lineChartHoverPopoverRowClasses: string;
|
|
18
|
+
export declare const lineChartHoverPopoverRowDotClasses: string;
|
|
19
|
+
export declare const lineChartHoverPopoverRowLabelClasses: string;
|
|
20
|
+
export declare const lineChartHoverPopoverRowValueClasses: string;
|
|
21
|
+
export declare const lineChartHoverPopoverDotClasses: string;
|
|
22
|
+
export declare const lineChartZoomPopoverClasses: string;
|
|
23
|
+
export declare const lineChartZoomPopoverRangeClasses: string;
|
|
24
|
+
export declare const lineChartZoomPopoverConfirmClasses: string;
|
|
25
|
+
export declare const lineChartTooltipCenterClasses = "-translate-y-1/2";
|
|
26
|
+
export declare const lineChartEmptyRootClasses: string;
|
|
27
|
+
export declare const lineChartEmptyMessageClasses: string;
|
|
28
|
+
export declare const lineChartEmptyMessageTextClasses: string;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
const lineChartRootClasses = "relative w-full flex flex-col min-h-0";
|
|
3
|
+
const lineChartBodyClasses = "relative flex-1 min-h-0 min-w-0 [&_*]:outline-none";
|
|
4
|
+
const lineChartBodyZoomEnabledClasses = "select-none [&_.recharts-wrapper]:cursor-crosshair!";
|
|
5
|
+
const lineChartZoomCursorPopoverClasses = "fixed z-30 pointer-events-none";
|
|
6
|
+
const lineChartLegendVariants = cva('flex', {
|
|
7
|
+
variants: {
|
|
8
|
+
orientation: {
|
|
9
|
+
horizontal: 'flex-row flex-wrap items-center gap-6 pl-12 py-2',
|
|
10
|
+
vertical: 'flex-col gap-6 px-12 py-2 max-w-160'
|
|
11
|
+
},
|
|
12
|
+
align: {
|
|
13
|
+
start: '',
|
|
14
|
+
center: '',
|
|
15
|
+
end: ''
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
compoundVariants: [
|
|
19
|
+
{
|
|
20
|
+
orientation: 'horizontal',
|
|
21
|
+
align: 'start',
|
|
22
|
+
class: 'justify-start'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
orientation: 'horizontal',
|
|
26
|
+
align: 'center',
|
|
27
|
+
class: 'justify-center'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
orientation: 'horizontal',
|
|
31
|
+
align: 'end',
|
|
32
|
+
class: 'justify-end'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
orientation: 'vertical',
|
|
36
|
+
align: 'start',
|
|
37
|
+
class: 'items-start'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
orientation: 'vertical',
|
|
41
|
+
align: 'center',
|
|
42
|
+
class: 'items-center'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
orientation: 'vertical',
|
|
46
|
+
align: 'end',
|
|
47
|
+
class: 'items-end'
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
defaultVariants: {
|
|
51
|
+
orientation: 'horizontal',
|
|
52
|
+
align: 'start'
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
const lineChartLegendItemVariants = cva("group/line-chart-legend-item relative flex items-center gap-4 px-4 py-2 rounded-4 transition-colors outline-none", {
|
|
56
|
+
variants: {
|
|
57
|
+
interactive: {
|
|
58
|
+
true: "cursor-pointer focus-visible:bg-states-primary-hover focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-primary",
|
|
59
|
+
false: ''
|
|
60
|
+
},
|
|
61
|
+
active: {
|
|
62
|
+
true: 'bg-states-primary-hover',
|
|
63
|
+
false: 'hover:bg-states-primary-hover'
|
|
64
|
+
},
|
|
65
|
+
selected: {
|
|
66
|
+
true: '',
|
|
67
|
+
false: 'opacity-40'
|
|
68
|
+
},
|
|
69
|
+
dimmed: {
|
|
70
|
+
true: 'opacity-60',
|
|
71
|
+
false: ''
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
defaultVariants: {
|
|
75
|
+
interactive: false,
|
|
76
|
+
active: false,
|
|
77
|
+
selected: true,
|
|
78
|
+
dimmed: false
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
const lineChartHoverPopoverClasses = "bg-bg-surface-2 border border-border-primary-light rounded-12 shadow-md px-12 py-8 min-w-160 flex flex-col gap-4 pointer-events-none";
|
|
82
|
+
const lineChartHoverPopoverTimestampClasses = "text-xs font-medium text-text-primary";
|
|
83
|
+
const lineChartHoverPopoverRowClasses = "relative h-16 w-full pl-12 flex items-center gap-8 text-xs font-mono text-text-primary";
|
|
84
|
+
const lineChartHoverPopoverRowDotClasses = "absolute left-0 top-4";
|
|
85
|
+
const lineChartHoverPopoverRowLabelClasses = "truncate min-w-0 font-normal";
|
|
86
|
+
const lineChartHoverPopoverRowValueClasses = "ml-auto shrink-0 font-medium";
|
|
87
|
+
const lineChartHoverPopoverDotClasses = "inline-block size-8 rounded-2";
|
|
88
|
+
const lineChartZoomPopoverClasses = "bg-bg-surface-2 border border-border-primary-light rounded-12 shadow-md px-12 py-8 min-w-160 flex flex-col gap-8";
|
|
89
|
+
const lineChartZoomPopoverRangeClasses = "text-xs font-medium text-text-primary whitespace-nowrap";
|
|
90
|
+
const lineChartZoomPopoverConfirmClasses = "inline-flex items-center justify-center h-24 px-8 w-full rounded-8 bg-states-brand-default-alt text-text-brand text-sm font-medium transition-colors outline-none hover:bg-states-brand-hover focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-brand";
|
|
91
|
+
const lineChartTooltipCenterClasses = '-translate-y-1/2';
|
|
92
|
+
const lineChartEmptyRootClasses = "relative w-full";
|
|
93
|
+
const lineChartEmptyMessageClasses = "absolute top-0 left-0 right-0 flex items-center justify-center";
|
|
94
|
+
const lineChartEmptyMessageTextClasses = "px-8 bg-bg-surface-1 text-xs font-mono text-text-secondary";
|
|
95
|
+
export { lineChartBodyClasses, lineChartBodyZoomEnabledClasses, lineChartEmptyMessageClasses, lineChartEmptyMessageTextClasses, lineChartEmptyRootClasses, lineChartHoverPopoverClasses, lineChartHoverPopoverDotClasses, lineChartHoverPopoverRowClasses, lineChartHoverPopoverRowDotClasses, lineChartHoverPopoverRowLabelClasses, lineChartHoverPopoverRowValueClasses, lineChartHoverPopoverTimestampClasses, lineChartLegendItemVariants, lineChartLegendVariants, lineChartRootClasses, lineChartTooltipCenterClasses, lineChartZoomCursorPopoverClasses, lineChartZoomPopoverClasses, lineChartZoomPopoverConfirmClasses, lineChartZoomPopoverRangeClasses };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export { CHART_PALETTE_FILL as LINE_STROKE_FILL, resolveChartColor as resolveSeriesColor, } from '../lib/chartPalette';
|
|
2
|
+
export declare const LINE_STROKE_WIDTH = 2;
|
|
3
|
+
export declare const LINE_DASH_DASHARRAY = "6 4";
|
|
4
|
+
export declare const LINE_ACTIVE_DOT_RADIUS = 4;
|
|
5
|
+
export declare const LINE_GRID_DASHARRAY = "4 4";
|
|
6
|
+
export declare const LINE_ANIMATION_DURATION = 400;
|
|
7
|
+
export declare const LINE_ANIMATION_BEGIN = 0;
|
|
8
|
+
export declare const LINE_INACTIVE_OPACITY = 0.3;
|
|
9
|
+
export declare const LINE_CARD_HEIGHT = 196;
|
|
10
|
+
export declare const LINE_HEADER_HEIGHT = 32;
|
|
11
|
+
export declare const LINE_X_LABEL_HEIGHT = 16;
|
|
12
|
+
export declare const LINE_Y_LABEL_WIDTH = 38;
|
|
13
|
+
export declare const LINE_DEFAULT_BODY_MARGIN: {
|
|
14
|
+
top: number;
|
|
15
|
+
right: number;
|
|
16
|
+
bottom: number;
|
|
17
|
+
left: number;
|
|
18
|
+
};
|
|
19
|
+
export declare const HOVER_POPOVER_TOP = 8;
|
|
20
|
+
export declare const LINE_AXIS_TICK_TEXT_PROPS: {
|
|
21
|
+
readonly fill: "var(--color-text-secondary)";
|
|
22
|
+
readonly fontSize: 10;
|
|
23
|
+
readonly fontFamily: "var(--font-sans)";
|
|
24
|
+
readonly fontWeight: 400;
|
|
25
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CHART_PALETTE_FILL, resolveChartColor } from "../lib/chartPalette.js";
|
|
2
|
+
const LINE_STROKE_WIDTH = 2;
|
|
3
|
+
const LINE_DASH_DASHARRAY = '6 4';
|
|
4
|
+
const LINE_ACTIVE_DOT_RADIUS = 4;
|
|
5
|
+
const LINE_GRID_DASHARRAY = '4 4';
|
|
6
|
+
const LINE_ANIMATION_DURATION = 400;
|
|
7
|
+
const LINE_ANIMATION_BEGIN = 0;
|
|
8
|
+
const LINE_INACTIVE_OPACITY = 0.3;
|
|
9
|
+
const LINE_CARD_HEIGHT = 196;
|
|
10
|
+
const LINE_HEADER_HEIGHT = 32;
|
|
11
|
+
const LINE_X_LABEL_HEIGHT = 16;
|
|
12
|
+
const LINE_Y_LABEL_WIDTH = 38;
|
|
13
|
+
const LINE_DEFAULT_BODY_MARGIN = {
|
|
14
|
+
top: 0,
|
|
15
|
+
right: 12,
|
|
16
|
+
bottom: 0,
|
|
17
|
+
left: 0
|
|
18
|
+
};
|
|
19
|
+
const HOVER_POPOVER_TOP = 8;
|
|
20
|
+
const LINE_AXIS_TICK_TEXT_PROPS = {
|
|
21
|
+
fill: 'var(--color-text-secondary)',
|
|
22
|
+
fontSize: 10,
|
|
23
|
+
fontFamily: 'var(--font-sans)',
|
|
24
|
+
fontWeight: 400
|
|
25
|
+
};
|
|
26
|
+
export { HOVER_POPOVER_TOP, LINE_ACTIVE_DOT_RADIUS, LINE_ANIMATION_BEGIN, LINE_ANIMATION_DURATION, LINE_AXIS_TICK_TEXT_PROPS, LINE_CARD_HEIGHT, LINE_DASH_DASHARRAY, LINE_DEFAULT_BODY_MARGIN, LINE_GRID_DASHARRAY, LINE_HEADER_HEIGHT, LINE_INACTIVE_OPACITY, CHART_PALETTE_FILL as LINE_STROKE_FILL, LINE_STROKE_WIDTH, LINE_X_LABEL_HEIGHT, LINE_Y_LABEL_WIDTH, resolveChartColor as resolveSeriesColor };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { useLineChartActiveKey } from './useLineChartActiveKey';
|
|
2
|
+
export { useLineChartDataWarnings } from './useLineChartDataWarnings';
|
|
3
|
+
export { useLineChartZoomState } from './useLineChartZoomState';
|
|
4
|
+
export { useZoomDragListeners } from './useZoomDragListeners';
|
|
5
|
+
export { useZoomPendingListeners } from './useZoomPendingListeners';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { useLineChartActiveKey } from "./useLineChartActiveKey.js";
|
|
2
|
+
import { useLineChartDataWarnings } from "./useLineChartDataWarnings.js";
|
|
3
|
+
import { useLineChartZoomState } from "./useLineChartZoomState.js";
|
|
4
|
+
import { useZoomDragListeners } from "./useZoomDragListeners.js";
|
|
5
|
+
import { useZoomPendingListeners } from "./useZoomPendingListeners.js";
|
|
6
|
+
export { useLineChartActiveKey, useLineChartDataWarnings, useLineChartZoomState, useZoomDragListeners, useZoomPendingListeners };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { LineChartSeries } from '../LineChartContext';
|
|
2
|
+
interface UseLineChartActiveKeyResult {
|
|
3
|
+
/**
|
|
4
|
+
* Resolved active key after normalising stale values against the live
|
|
5
|
+
* `seriesByKey` map. `null` whenever the controlled value points at a key
|
|
6
|
+
* that no longer exists in `series`.
|
|
7
|
+
*/
|
|
8
|
+
activeKey: string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Setter that deduplicates per-pixel mousemove/hover events and forwards to
|
|
11
|
+
* the controlled callback. Use this instead of writing state directly so
|
|
12
|
+
* consumer callbacks don't fire with the same value frame after frame.
|
|
13
|
+
*/
|
|
14
|
+
setActiveKey: (key: string | null) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Controlled/uncontrolled active-series key with two safety nets:
|
|
18
|
+
*
|
|
19
|
+
* 1. If the controlled key points at a series that has disappeared (filter,
|
|
20
|
+
* schema change, refresh) the hook pushes `null` back through
|
|
21
|
+
* `onActiveKeyChange` so sibling charts stop highlighting a stale key.
|
|
22
|
+
* 2. The setter dedupes against a ref so per-pixel hover events don't keep
|
|
23
|
+
* firing the callback after `useState` already bailed out.
|
|
24
|
+
*
|
|
25
|
+
* Refs are synced during render so parent-driven external resets flow through
|
|
26
|
+
* without a stale comparison.
|
|
27
|
+
*/
|
|
28
|
+
export declare const useLineChartActiveKey: ({ controlledActiveKey, onActiveKeyChange, seriesByKey, }: {
|
|
29
|
+
controlledActiveKey: string | null | undefined;
|
|
30
|
+
onActiveKeyChange: ((key: string | null) => void) | undefined;
|
|
31
|
+
seriesByKey: Map<string, LineChartSeries>;
|
|
32
|
+
}) => UseLineChartActiveKeyResult;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef } from "react";
|
|
2
|
+
import { useControlled } from "../../../../hooks/index.js";
|
|
3
|
+
const useLineChartActiveKey = ({ controlledActiveKey, onActiveKeyChange, seriesByKey })=>{
|
|
4
|
+
const [activeKeyValue, setInternalActiveKey] = useControlled({
|
|
5
|
+
controlled: controlledActiveKey,
|
|
6
|
+
default: null
|
|
7
|
+
});
|
|
8
|
+
const rawActiveKey = activeKeyValue ?? null;
|
|
9
|
+
const activeKey = null !== rawActiveKey && seriesByKey.has(rawActiveKey) ? rawActiveKey : null;
|
|
10
|
+
useEffect(()=>{
|
|
11
|
+
if (null != controlledActiveKey && !seriesByKey.has(controlledActiveKey)) onActiveKeyChange?.(null);
|
|
12
|
+
}, [
|
|
13
|
+
controlledActiveKey,
|
|
14
|
+
seriesByKey,
|
|
15
|
+
onActiveKeyChange
|
|
16
|
+
]);
|
|
17
|
+
const lastActiveKeyRef = useRef(void 0);
|
|
18
|
+
lastActiveKeyRef.current = activeKey;
|
|
19
|
+
const setActiveKey = useCallback((key)=>{
|
|
20
|
+
if (lastActiveKeyRef.current === key) return;
|
|
21
|
+
lastActiveKeyRef.current = key;
|
|
22
|
+
setInternalActiveKey(key);
|
|
23
|
+
onActiveKeyChange?.(key);
|
|
24
|
+
}, [
|
|
25
|
+
setInternalActiveKey,
|
|
26
|
+
onActiveKeyChange
|
|
27
|
+
]);
|
|
28
|
+
return {
|
|
29
|
+
activeKey,
|
|
30
|
+
setActiveKey
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export { useLineChartActiveKey };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { LineChartDatum, LineChartSeries } from '../LineChartContext';
|
|
2
|
+
/**
|
|
3
|
+
* Dev-only sanity checks. Surfaces three classes of caller mistake as
|
|
4
|
+
* `console.warn` so the chart fails loudly in development instead of silently
|
|
5
|
+
* rendering a broken plot:
|
|
6
|
+
*
|
|
7
|
+
* - `xKey` missing on datums (Recharts would draw gaps or break ordering)
|
|
8
|
+
* - `data` not sorted ascending by `xKey` (Recharts assumes an ordered domain)
|
|
9
|
+
* - `series[].key` not present on any datum (line renders empty)
|
|
10
|
+
*
|
|
11
|
+
* Production builds short-circuit before any iteration to avoid the per-render
|
|
12
|
+
* cost on large datasets.
|
|
13
|
+
*/
|
|
14
|
+
export declare const useLineChartDataWarnings: ({ data, series, xKey, }: {
|
|
15
|
+
data: LineChartDatum[];
|
|
16
|
+
series: LineChartSeries[];
|
|
17
|
+
xKey: string;
|
|
18
|
+
}) => void;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { warnLineChart } from "../lib/warn.js";
|
|
3
|
+
const compareX = (a, b)=>{
|
|
4
|
+
if ('number' == typeof a && 'number' == typeof b) return a - b;
|
|
5
|
+
if ('string' == typeof a && 'string' == typeof b) return a < b ? -1 : a > b ? 1 : 0;
|
|
6
|
+
return 0;
|
|
7
|
+
};
|
|
8
|
+
const useLineChartDataWarnings = ({ data, series, xKey })=>{
|
|
9
|
+
useEffect(()=>{
|
|
10
|
+
if ('production' === process.env.NODE_ENV) return;
|
|
11
|
+
if (0 === data.length) return;
|
|
12
|
+
let xKeyMissingCount = 0;
|
|
13
|
+
for (const d of data){
|
|
14
|
+
const v = d[xKey];
|
|
15
|
+
if (null == v) xKeyMissingCount++;
|
|
16
|
+
}
|
|
17
|
+
if (xKeyMissingCount > 0) warnLineChart(`\`xKey="${xKey}"\` is missing on ${xKeyMissingCount} of ${data.length} datums. Recharts uses this key for the X axis; missing values will produce gaps or break ordering. Provide the key on every datum or pass a different \`xKey\`.`);
|
|
18
|
+
let unsortedAt = null;
|
|
19
|
+
for(let i = 1; i < data.length; i++){
|
|
20
|
+
const prev = data[i - 1]?.[xKey];
|
|
21
|
+
const curr = data[i]?.[xKey];
|
|
22
|
+
if (void 0 !== prev && void 0 !== curr && null !== prev && null !== curr) {
|
|
23
|
+
if (compareX(prev, curr) > 0) {
|
|
24
|
+
unsortedAt = i;
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (null !== unsortedAt) warnLineChart(`\`data\` is not sorted ascending by \`xKey="${xKey}"\` (first inversion at index ${unsortedAt}). Recharts assumes an ordered X domain — unsorted data will draw the line backwards. Sort upstream.`);
|
|
30
|
+
const seenKeys = new Set();
|
|
31
|
+
for (const d of data){
|
|
32
|
+
for (const s of series){
|
|
33
|
+
if (seenKeys.has(s.key)) continue;
|
|
34
|
+
const v = d[s.key];
|
|
35
|
+
if (null != v) seenKeys.add(s.key);
|
|
36
|
+
}
|
|
37
|
+
if (seenKeys.size === series.length) break;
|
|
38
|
+
}
|
|
39
|
+
const missingSeries = series.filter((s)=>!seenKeys.has(s.key)).map((s)=>s.key);
|
|
40
|
+
if (missingSeries.length > 0) warnLineChart(`series whose \`key\` does not appear on any datum: ${missingSeries.map((k)=>`"${k}"`).join(', ')}. These lines will render empty. Drop the series or check the key spelling.`);
|
|
41
|
+
}, [
|
|
42
|
+
data,
|
|
43
|
+
series,
|
|
44
|
+
xKey
|
|
45
|
+
]);
|
|
46
|
+
};
|
|
47
|
+
export { useLineChartDataWarnings };
|