@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,15 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes, ReactNode, Ref } from 'react';
|
|
2
|
+
import { type TestableProps } from '../../../utils/testId';
|
|
3
|
+
export interface LineChartEmptyProps extends HTMLAttributes<HTMLDivElement>, TestableProps {
|
|
4
|
+
ref?: Ref<HTMLDivElement>;
|
|
5
|
+
/** Body height override. Defaults to the standard plot height. */
|
|
6
|
+
height?: number;
|
|
7
|
+
/**
|
|
8
|
+
* Empty-state message. Pass the copy you want to render (`"No data"`, a
|
|
9
|
+
* localised string, or richer JSX). Omit (or pass `null`) to render only
|
|
10
|
+
* the dashed grid frame — the idiom for loading skeletons. There is no
|
|
11
|
+
* default text.
|
|
12
|
+
*/
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare const LineChartEmpty: FC<LineChartEmptyProps>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../utils/cn.js";
|
|
3
|
+
import { TestIdProvider } from "../../../utils/testId.js";
|
|
4
|
+
import { lineChartEmptyMessageClasses, lineChartEmptyMessageTextClasses, lineChartEmptyRootClasses } from "./classes.js";
|
|
5
|
+
import { LINE_CARD_HEIGHT, LINE_DEFAULT_BODY_MARGIN, LINE_GRID_DASHARRAY, LINE_HEADER_HEIGHT, LINE_X_LABEL_HEIGHT, LINE_Y_LABEL_WIDTH } from "./constants.js";
|
|
6
|
+
const DEFAULT_BODY_HEIGHT = LINE_CARD_HEIGHT - LINE_HEADER_HEIGHT;
|
|
7
|
+
const EMPTY_GRID_LINES = 3;
|
|
8
|
+
const LineChartEmpty = ({ height = DEFAULT_BODY_HEIGHT, className, children, ref, 'data-testid': testId, ...props })=>{
|
|
9
|
+
const axisY = Math.max(0, height - LINE_X_LABEL_HEIGHT);
|
|
10
|
+
const lines = Array.from({
|
|
11
|
+
length: EMPTY_GRID_LINES
|
|
12
|
+
}, (_, i)=>axisY * (i + 1) / (EMPTY_GRID_LINES + 1));
|
|
13
|
+
return /*#__PURE__*/ jsx(TestIdProvider, {
|
|
14
|
+
value: testId,
|
|
15
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
16
|
+
...props,
|
|
17
|
+
ref: ref,
|
|
18
|
+
"data-slot": "line-chart-empty",
|
|
19
|
+
"data-testid": testId,
|
|
20
|
+
className: cn(lineChartEmptyRootClasses, className),
|
|
21
|
+
style: {
|
|
22
|
+
height
|
|
23
|
+
},
|
|
24
|
+
children: [
|
|
25
|
+
/*#__PURE__*/ jsxs("svg", {
|
|
26
|
+
height: height,
|
|
27
|
+
preserveAspectRatio: "none",
|
|
28
|
+
"aria-hidden": "true",
|
|
29
|
+
className: "absolute top-0",
|
|
30
|
+
style: {
|
|
31
|
+
left: LINE_Y_LABEL_WIDTH,
|
|
32
|
+
width: `calc(100% - ${LINE_Y_LABEL_WIDTH + LINE_DEFAULT_BODY_MARGIN.right}px)`
|
|
33
|
+
},
|
|
34
|
+
"data-slot": "line-chart-empty-grid",
|
|
35
|
+
children: [
|
|
36
|
+
lines.map((y, i)=>/*#__PURE__*/ jsx("line", {
|
|
37
|
+
x1: "0",
|
|
38
|
+
x2: "100%",
|
|
39
|
+
y1: y,
|
|
40
|
+
y2: y,
|
|
41
|
+
stroke: "var(--color-border-primary-light)",
|
|
42
|
+
strokeDasharray: LINE_GRID_DASHARRAY,
|
|
43
|
+
strokeWidth: 1
|
|
44
|
+
}, i)),
|
|
45
|
+
/*#__PURE__*/ jsx("line", {
|
|
46
|
+
x1: "0",
|
|
47
|
+
x2: "100%",
|
|
48
|
+
y1: axisY,
|
|
49
|
+
y2: axisY,
|
|
50
|
+
stroke: "var(--color-border-primary-light)",
|
|
51
|
+
strokeWidth: 1,
|
|
52
|
+
"data-slot": "line-chart-empty-axis"
|
|
53
|
+
})
|
|
54
|
+
]
|
|
55
|
+
}),
|
|
56
|
+
null != children && /*#__PURE__*/ jsx("div", {
|
|
57
|
+
className: lineChartEmptyMessageClasses,
|
|
58
|
+
style: {
|
|
59
|
+
height: axisY
|
|
60
|
+
},
|
|
61
|
+
children: /*#__PURE__*/ jsx("span", {
|
|
62
|
+
className: lineChartEmptyMessageTextClasses,
|
|
63
|
+
children: children
|
|
64
|
+
})
|
|
65
|
+
})
|
|
66
|
+
]
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
LineChartEmpty.displayName = 'LineChartEmpty';
|
|
71
|
+
export { LineChartEmpty };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
export interface LineChartGridProps {
|
|
3
|
+
/** Render vertical grid lines in addition to the default horizontal ones. */
|
|
4
|
+
vertical?: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Keep the topmost horizontal grid line unconditionally. By default the line
|
|
7
|
+
* is dropped only when it would visually crowd the chart's top edge — see
|
|
8
|
+
* {@link dropEdgeGridLines} for the threshold (Figma "no top x-line" rule).
|
|
9
|
+
*/
|
|
10
|
+
keepTopLine?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Keep the bottommost horizontal grid line. By default the line is dropped
|
|
13
|
+
* because the solid `<LineChartXAxis>` axis line owns the bottom rail — set
|
|
14
|
+
* to `true` when the X-axis line is hidden and the grid should draw the
|
|
15
|
+
* bottom rail itself.
|
|
16
|
+
*/
|
|
17
|
+
keepBottomLine?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const LineChartGrid: FC<LineChartGridProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { CartesianGrid } from "recharts";
|
|
3
|
+
import { LINE_GRID_DASHARRAY } from "./constants.js";
|
|
4
|
+
import { dropEdgeGridLines } from "./lib/dropEdgeGridLines.js";
|
|
5
|
+
import { tickHorizontalCoordinates } from "./lib/tickHorizontalCoordinates.js";
|
|
6
|
+
const LineChartGrid = ({ vertical = false, keepTopLine = false, keepBottomLine = false })=>/*#__PURE__*/ jsx(CartesianGrid, {
|
|
7
|
+
strokeDasharray: LINE_GRID_DASHARRAY,
|
|
8
|
+
stroke: "var(--color-border-primary-light)",
|
|
9
|
+
vertical: vertical,
|
|
10
|
+
horizontal: dropEdgeGridLines({
|
|
11
|
+
keepTop: keepTopLine,
|
|
12
|
+
keepBottom: keepBottomLine
|
|
13
|
+
}),
|
|
14
|
+
horizontalCoordinatesGenerator: tickHorizontalCoordinates
|
|
15
|
+
});
|
|
16
|
+
LineChartGrid.displayName = 'LineChartGrid';
|
|
17
|
+
export { LineChartGrid };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../utils/cn.js";
|
|
3
|
+
import { lineChartHoverPopoverClasses } from "./classes.js";
|
|
4
|
+
const LineChartHoverPopover = ({ ref, className, children, ...props })=>/*#__PURE__*/ jsx("div", {
|
|
5
|
+
...props,
|
|
6
|
+
ref: ref,
|
|
7
|
+
"data-slot": "line-chart-hover-popover",
|
|
8
|
+
role: "tooltip",
|
|
9
|
+
"aria-live": "polite",
|
|
10
|
+
className: cn(lineChartHoverPopoverClasses, className),
|
|
11
|
+
children: children
|
|
12
|
+
});
|
|
13
|
+
LineChartHoverPopover.displayName = 'LineChartHoverPopover';
|
|
14
|
+
export { LineChartHoverPopover };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes, Ref } from 'react';
|
|
2
|
+
import type { ChartColor } from '../types';
|
|
3
|
+
export interface LineChartHoverPopoverDotProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
ref?: Ref<HTMLSpanElement>;
|
|
5
|
+
/**
|
|
6
|
+
* Dot colour. Either a built-in palette token (`'brand'`, `'red'`, …) or any
|
|
7
|
+
* CSS colour string (`'var(--color-violet-500)'`, `'#8b5cf6'`, `'oklch(…)'`).
|
|
8
|
+
* Same shape as `LineChartSeries.color`, so passing `color={series.color}`
|
|
9
|
+
* keeps the dot in sync with its line. Consumer-supplied
|
|
10
|
+
* `style.backgroundColor` still wins when present.
|
|
11
|
+
*/
|
|
12
|
+
color?: ChartColor | (string & {});
|
|
13
|
+
}
|
|
14
|
+
export declare const LineChartHoverPopoverDot: FC<LineChartHoverPopoverDotProps>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../utils/cn.js";
|
|
3
|
+
import { lineChartHoverPopoverDotClasses } from "./classes.js";
|
|
4
|
+
import { resolveSeriesColor } from "./constants.js";
|
|
5
|
+
const LineChartHoverPopoverDot = ({ color, className, style, ref, ...props })=>{
|
|
6
|
+
const backgroundColor = style?.backgroundColor ?? resolveSeriesColor(color);
|
|
7
|
+
return /*#__PURE__*/ jsx("span", {
|
|
8
|
+
...props,
|
|
9
|
+
ref: ref,
|
|
10
|
+
"data-slot": "line-chart-hover-popover-dot",
|
|
11
|
+
"aria-hidden": "true",
|
|
12
|
+
className: cn(lineChartHoverPopoverDotClasses, className),
|
|
13
|
+
style: {
|
|
14
|
+
...style,
|
|
15
|
+
backgroundColor
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
LineChartHoverPopoverDot.displayName = 'LineChartHoverPopoverDot';
|
|
20
|
+
export { LineChartHoverPopoverDot };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes, ReactNode, Ref } from 'react';
|
|
2
|
+
import type { LineChartSeries } from './LineChartContext';
|
|
3
|
+
export interface LineChartHoverPopoverRowProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
ref?: Ref<HTMLDivElement>;
|
|
5
|
+
/** Series whose colour and label feed the row. */
|
|
6
|
+
series: LineChartSeries;
|
|
7
|
+
/** Raw datum value at the active index. `null`/`undefined` renders an em-dash. */
|
|
8
|
+
value?: number | string | null;
|
|
9
|
+
/** Optional value formatter. Defaults to `Number.toLocaleString` / `String`. */
|
|
10
|
+
formatValue?: (value: number | string | null | undefined) => ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const LineChartHoverPopoverRow: FC<LineChartHoverPopoverRowProps>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../utils/cn.js";
|
|
3
|
+
import { lineChartHoverPopoverRowClasses, lineChartHoverPopoverRowDotClasses, lineChartHoverPopoverRowLabelClasses, lineChartHoverPopoverRowValueClasses } from "./classes.js";
|
|
4
|
+
import { LineChartHoverPopoverDot } from "./LineChartHoverPopoverDot.js";
|
|
5
|
+
const defaultFormatValue = (value)=>{
|
|
6
|
+
if (null == value) return '—';
|
|
7
|
+
return 'number' == typeof value ? value.toLocaleString() : String(value);
|
|
8
|
+
};
|
|
9
|
+
const LineChartHoverPopoverRow = ({ series, value, formatValue = defaultFormatValue, ref, className, children, ...props })=>/*#__PURE__*/ jsx("div", {
|
|
10
|
+
...props,
|
|
11
|
+
ref: ref,
|
|
12
|
+
"data-slot": "line-chart-hover-popover-row",
|
|
13
|
+
"data-key": series.key,
|
|
14
|
+
className: cn(lineChartHoverPopoverRowClasses, className),
|
|
15
|
+
children: children ?? /*#__PURE__*/ jsxs(Fragment, {
|
|
16
|
+
children: [
|
|
17
|
+
/*#__PURE__*/ jsx(LineChartHoverPopoverDot, {
|
|
18
|
+
color: series.color ?? 'slate',
|
|
19
|
+
className: lineChartHoverPopoverRowDotClasses
|
|
20
|
+
}),
|
|
21
|
+
/*#__PURE__*/ jsx("span", {
|
|
22
|
+
className: lineChartHoverPopoverRowLabelClasses,
|
|
23
|
+
children: series.label
|
|
24
|
+
}),
|
|
25
|
+
/*#__PURE__*/ jsx("span", {
|
|
26
|
+
className: lineChartHoverPopoverRowValueClasses,
|
|
27
|
+
children: formatValue(value)
|
|
28
|
+
})
|
|
29
|
+
]
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
LineChartHoverPopoverRow.displayName = 'LineChartHoverPopoverRow';
|
|
33
|
+
export { LineChartHoverPopoverRow };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes, Ref } from 'react';
|
|
2
|
+
export interface LineChartHoverPopoverTimestampProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
ref?: Ref<HTMLDivElement>;
|
|
4
|
+
}
|
|
5
|
+
export declare const LineChartHoverPopoverTimestamp: FC<LineChartHoverPopoverTimestampProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../utils/cn.js";
|
|
3
|
+
import { lineChartHoverPopoverTimestampClasses } from "./classes.js";
|
|
4
|
+
const LineChartHoverPopoverTimestamp = ({ ref, className, children, ...props })=>/*#__PURE__*/ jsx("div", {
|
|
5
|
+
...props,
|
|
6
|
+
ref: ref,
|
|
7
|
+
"data-slot": "line-chart-hover-popover-timestamp",
|
|
8
|
+
className: cn(lineChartHoverPopoverTimestampClasses, className),
|
|
9
|
+
children: children
|
|
10
|
+
});
|
|
11
|
+
LineChartHoverPopoverTimestamp.displayName = 'LineChartHoverPopoverTimestamp';
|
|
12
|
+
export { LineChartHoverPopoverTimestamp };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes, Ref } from 'react';
|
|
2
|
+
import type { LineChartLegendOrientation } from './LineChartContext';
|
|
3
|
+
export interface LineChartLegendProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
ref?: Ref<HTMLDivElement>;
|
|
5
|
+
/**
|
|
6
|
+
* How legend rows lay out inside the legend itself. Defaults to `'horizontal'`.
|
|
7
|
+
* Use `'vertical'` when the legend sits to the side of the chart (the consumer
|
|
8
|
+
* controls placement by JSX child order or by wrapping body+legend in an
|
|
9
|
+
* `<HStack>`). Layout-vs-orientation is the only knob the legend exposes.
|
|
10
|
+
*/
|
|
11
|
+
orientation?: LineChartLegendOrientation;
|
|
12
|
+
/** Cross-axis alignment of the legend rows. Default `'start'`. */
|
|
13
|
+
align?: 'start' | 'center' | 'end';
|
|
14
|
+
}
|
|
15
|
+
export declare const LineChartLegend: FC<LineChartLegendProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../utils/cn.js";
|
|
3
|
+
import { useTestId } from "../../../utils/testId.js";
|
|
4
|
+
import { lineChartLegendVariants } from "./classes.js";
|
|
5
|
+
const LineChartLegend = ({ orientation = 'horizontal', align = 'start', className, ref, ...props })=>{
|
|
6
|
+
const testId = useTestId('legend');
|
|
7
|
+
return /*#__PURE__*/ jsx("div", {
|
|
8
|
+
...props,
|
|
9
|
+
ref: ref,
|
|
10
|
+
"data-slot": "line-chart-legend",
|
|
11
|
+
"data-testid": testId,
|
|
12
|
+
className: cn(lineChartLegendVariants({
|
|
13
|
+
orientation,
|
|
14
|
+
align
|
|
15
|
+
}), className)
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
LineChartLegend.displayName = 'LineChartLegend';
|
|
19
|
+
export { LineChartLegend };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type FC, type HTMLAttributes, type Ref } from 'react';
|
|
2
|
+
export interface LineChartLegendItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
ref?: Ref<HTMLDivElement>;
|
|
4
|
+
/** Joins to `LineChartSeries.key`. Drives hover sync, dim, and `aria-current`. */
|
|
5
|
+
seriesKey: string;
|
|
6
|
+
/**
|
|
7
|
+
* Explicit selection state. When omitted, falls back to "not in `filteredKeys`".
|
|
8
|
+
* `true` = row is on (line drawn); `false` = row is off (line hidden, dimmed).
|
|
9
|
+
* Passing this prop fully overrides the context — useful when the legend
|
|
10
|
+
* renders rows that are not part of the chart's filter set.
|
|
11
|
+
*/
|
|
12
|
+
selected?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const LineChartLegendItem: FC<LineChartLegendItemProps>;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useContext, useMemo } from "react";
|
|
3
|
+
import { cn } from "../../../utils/cn.js";
|
|
4
|
+
import { useTestId } from "../../../utils/testId.js";
|
|
5
|
+
import { lineChartLegendItemVariants } from "./classes.js";
|
|
6
|
+
import { LineChartActiveContext, LineChartDataContext, LineChartItemContext, LineChartSelectionContext, isHoverSyncTarget } from "./LineChartContext.js";
|
|
7
|
+
const LineChartLegendItem = ({ seriesKey, selected: selectedProp, className, children, ref, onClick, onKeyDown, onMouseEnter, onMouseLeave, onFocus, onBlur, ...props })=>{
|
|
8
|
+
const testId = useTestId('legend-item');
|
|
9
|
+
const dataCtx = useContext(LineChartDataContext);
|
|
10
|
+
const { activeKey } = useContext(LineChartActiveContext);
|
|
11
|
+
const { hiddenSet } = useContext(LineChartSelectionContext);
|
|
12
|
+
const series = dataCtx?.seriesByKey.get(seriesKey);
|
|
13
|
+
const interactive = 'function' == typeof onClick;
|
|
14
|
+
const active = activeKey === seriesKey;
|
|
15
|
+
const selected = selectedProp ?? !hiddenSet.has(seriesKey);
|
|
16
|
+
const dimmed = !selected && !active && hiddenSet.size > 0;
|
|
17
|
+
const color = series?.color;
|
|
18
|
+
const label = series?.label;
|
|
19
|
+
const itemValue = useMemo(()=>({
|
|
20
|
+
seriesKey,
|
|
21
|
+
selected,
|
|
22
|
+
interactive,
|
|
23
|
+
active,
|
|
24
|
+
color,
|
|
25
|
+
label
|
|
26
|
+
}), [
|
|
27
|
+
seriesKey,
|
|
28
|
+
selected,
|
|
29
|
+
interactive,
|
|
30
|
+
active,
|
|
31
|
+
color,
|
|
32
|
+
label
|
|
33
|
+
]);
|
|
34
|
+
const setActive = dataCtx?.setActiveKey;
|
|
35
|
+
const handleMouseEnter = useCallback((event)=>{
|
|
36
|
+
onMouseEnter?.(event);
|
|
37
|
+
if (event.defaultPrevented) return;
|
|
38
|
+
setActive?.(seriesKey);
|
|
39
|
+
}, [
|
|
40
|
+
onMouseEnter,
|
|
41
|
+
setActive,
|
|
42
|
+
seriesKey
|
|
43
|
+
]);
|
|
44
|
+
const handleMouseLeave = useCallback((event)=>{
|
|
45
|
+
onMouseLeave?.(event);
|
|
46
|
+
if (event.defaultPrevented) return;
|
|
47
|
+
if (isHoverSyncTarget(event.relatedTarget)) return;
|
|
48
|
+
setActive?.(null);
|
|
49
|
+
}, [
|
|
50
|
+
onMouseLeave,
|
|
51
|
+
setActive
|
|
52
|
+
]);
|
|
53
|
+
const handleFocus = useCallback((event)=>{
|
|
54
|
+
onFocus?.(event);
|
|
55
|
+
if (event.defaultPrevented) return;
|
|
56
|
+
setActive?.(seriesKey);
|
|
57
|
+
}, [
|
|
58
|
+
onFocus,
|
|
59
|
+
setActive,
|
|
60
|
+
seriesKey
|
|
61
|
+
]);
|
|
62
|
+
const handleBlur = useCallback((event)=>{
|
|
63
|
+
onBlur?.(event);
|
|
64
|
+
if (event.defaultPrevented) return;
|
|
65
|
+
if (isHoverSyncTarget(event.relatedTarget)) return;
|
|
66
|
+
setActive?.(null);
|
|
67
|
+
}, [
|
|
68
|
+
onBlur,
|
|
69
|
+
setActive
|
|
70
|
+
]);
|
|
71
|
+
const handleKeyDown = useCallback((event)=>{
|
|
72
|
+
onKeyDown?.(event);
|
|
73
|
+
if (!interactive || event.defaultPrevented) return;
|
|
74
|
+
if ('Enter' === event.key || ' ' === event.key) {
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
event.currentTarget.click();
|
|
77
|
+
}
|
|
78
|
+
}, [
|
|
79
|
+
interactive,
|
|
80
|
+
onKeyDown
|
|
81
|
+
]);
|
|
82
|
+
return /*#__PURE__*/ jsx(LineChartItemContext.Provider, {
|
|
83
|
+
value: itemValue,
|
|
84
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
85
|
+
...props,
|
|
86
|
+
ref: ref,
|
|
87
|
+
"data-slot": "line-chart-legend-item",
|
|
88
|
+
"data-testid": testId,
|
|
89
|
+
"data-key": seriesKey,
|
|
90
|
+
"data-active": active ? 'true' : void 0,
|
|
91
|
+
"data-selected": selected ? 'true' : void 0,
|
|
92
|
+
role: interactive ? 'button' : void 0,
|
|
93
|
+
tabIndex: interactive ? 0 : void 0,
|
|
94
|
+
"aria-current": selected ? 'true' : void 0,
|
|
95
|
+
onClick: onClick,
|
|
96
|
+
onKeyDown: handleKeyDown,
|
|
97
|
+
onMouseEnter: handleMouseEnter,
|
|
98
|
+
onMouseLeave: handleMouseLeave,
|
|
99
|
+
onFocus: handleFocus,
|
|
100
|
+
onBlur: handleBlur,
|
|
101
|
+
className: cn(lineChartLegendItemVariants({
|
|
102
|
+
interactive,
|
|
103
|
+
active,
|
|
104
|
+
selected,
|
|
105
|
+
dimmed
|
|
106
|
+
}), className),
|
|
107
|
+
children: children
|
|
108
|
+
})
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
LineChartLegendItem.displayName = 'LineChartLegendItem';
|
|
112
|
+
export { LineChartLegendItem };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type FC, type MouseEvent } from 'react';
|
|
2
|
+
export interface LineChartLineProps {
|
|
3
|
+
/** Joins to `LineChartSeries.key` from the root `series` prop. */
|
|
4
|
+
seriesKey: string;
|
|
5
|
+
/** Recharts curve type. Defaults to `'monotone'`. */
|
|
6
|
+
curve?: 'linear' | 'monotone';
|
|
7
|
+
/** Force-disable the recharts mount animation. */
|
|
8
|
+
disableAnimation?: boolean;
|
|
9
|
+
/** Recharts pass-through — when `true`, the line bridges `null`/`undefined` gaps. */
|
|
10
|
+
connectNulls?: boolean;
|
|
11
|
+
/** Stroke width override. Defaults to `LINE_STROKE_WIDTH`. */
|
|
12
|
+
strokeWidth?: number;
|
|
13
|
+
onClick?: (event: MouseEvent<SVGPathElement>) => void;
|
|
14
|
+
onMouseEnter?: (event: MouseEvent<SVGPathElement>) => void;
|
|
15
|
+
onMouseLeave?: (event: MouseEvent<SVGPathElement>) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const LineChartLine: FC<LineChartLineProps>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useContext, useEffect } from "react";
|
|
3
|
+
import { Line } from "recharts";
|
|
4
|
+
import { LINE_ACTIVE_DOT_RADIUS, LINE_ANIMATION_BEGIN, LINE_ANIMATION_DURATION, LINE_DASH_DASHARRAY, LINE_INACTIVE_OPACITY, LINE_STROKE_FILL, LINE_STROKE_WIDTH, resolveSeriesColor } from "./constants.js";
|
|
5
|
+
import { LineChartActiveContext, LineChartDataContext } from "./LineChartContext.js";
|
|
6
|
+
import { warnLineChartLine } from "./lib/warn.js";
|
|
7
|
+
const wrap = (cb)=>cb ? (_props, event)=>cb(event) : void 0;
|
|
8
|
+
const LineChartLine = ({ seriesKey, curve = 'monotone', disableAnimation = false, connectNulls = false, strokeWidth = LINE_STROKE_WIDTH, onClick, onMouseEnter, onMouseLeave })=>{
|
|
9
|
+
const dataCtx = useContext(LineChartDataContext);
|
|
10
|
+
const { activeKey } = useContext(LineChartActiveContext);
|
|
11
|
+
const series = dataCtx?.seriesByKey.get(seriesKey);
|
|
12
|
+
const isHidden = dataCtx?.hiddenSet.has(seriesKey) ?? false;
|
|
13
|
+
useEffect(()=>{
|
|
14
|
+
if ('production' === process.env.NODE_ENV) return;
|
|
15
|
+
if (!dataCtx) return;
|
|
16
|
+
if (!series) warnLineChartLine(`\`seriesKey="${seriesKey}"\` does not match any entry in the root \`series\` array. The line will not render. Add the series to the schema or check the key spelling.`);
|
|
17
|
+
}, [
|
|
18
|
+
dataCtx,
|
|
19
|
+
series,
|
|
20
|
+
seriesKey
|
|
21
|
+
]);
|
|
22
|
+
if (!series || isHidden) return null;
|
|
23
|
+
const stroke = resolveSeriesColor(series.color) ?? LINE_STROKE_FILL.slate;
|
|
24
|
+
const strokeDasharray = 'dashed' === series.variant ? LINE_DASH_DASHARRAY : void 0;
|
|
25
|
+
const isActive = activeKey === seriesKey;
|
|
26
|
+
const opacity = null === activeKey || isActive ? 1 : LINE_INACTIVE_OPACITY;
|
|
27
|
+
return /*#__PURE__*/ jsx(Line, {
|
|
28
|
+
dataKey: seriesKey,
|
|
29
|
+
name: series.label,
|
|
30
|
+
type: curve,
|
|
31
|
+
stroke: stroke,
|
|
32
|
+
strokeWidth: strokeWidth,
|
|
33
|
+
strokeDasharray: strokeDasharray,
|
|
34
|
+
strokeLinecap: "round",
|
|
35
|
+
strokeLinejoin: "round",
|
|
36
|
+
dot: false,
|
|
37
|
+
activeDot: {
|
|
38
|
+
r: LINE_ACTIVE_DOT_RADIUS,
|
|
39
|
+
stroke,
|
|
40
|
+
strokeWidth: 0
|
|
41
|
+
},
|
|
42
|
+
opacity: opacity,
|
|
43
|
+
connectNulls: connectNulls,
|
|
44
|
+
isAnimationActive: disableAnimation ? false : 'auto',
|
|
45
|
+
animationBegin: LINE_ANIMATION_BEGIN,
|
|
46
|
+
animationDuration: LINE_ANIMATION_DURATION,
|
|
47
|
+
animationEasing: "ease-out",
|
|
48
|
+
onClick: wrap(onClick),
|
|
49
|
+
onMouseEnter: wrap(onMouseEnter),
|
|
50
|
+
onMouseLeave: wrap(onMouseLeave),
|
|
51
|
+
"data-slot": "line-chart-line",
|
|
52
|
+
"data-key": seriesKey,
|
|
53
|
+
"data-active": isActive ? 'true' : void 0
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
LineChartLine.displayName = 'LineChartLine';
|
|
57
|
+
export { LineChartLine };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type FC, type ReactNode } from 'react';
|
|
2
|
+
import { type LineChartDatum, type LineChartSeries } from './LineChartContext';
|
|
3
|
+
export interface LineChartTooltipRow {
|
|
4
|
+
/** Series schema for this row. */
|
|
5
|
+
series: LineChartSeries;
|
|
6
|
+
/** Raw datum value at the active index for `series.key`. */
|
|
7
|
+
value: number | string | null | undefined;
|
|
8
|
+
}
|
|
9
|
+
export interface LineChartTooltipRenderArgs {
|
|
10
|
+
/** Active datum at the cursor's nearest X position. */
|
|
11
|
+
datum: LineChartDatum;
|
|
12
|
+
/**
|
|
13
|
+
* Pre-resolved popover rows — visible series joined with their value at the
|
|
14
|
+
* active index, in render order. Lets the render-prop be "just lay it out"
|
|
15
|
+
* instead of "join + look up + format".
|
|
16
|
+
*/
|
|
17
|
+
rows: LineChartTooltipRow[];
|
|
18
|
+
/** Raw `xKey` value at the active datum. */
|
|
19
|
+
xValue: number | string;
|
|
20
|
+
}
|
|
21
|
+
export interface LineChartTooltipProps {
|
|
22
|
+
/**
|
|
23
|
+
* Render-prop override for the popover body. Receives the active datum, the
|
|
24
|
+
* pre-resolved `rows` (visible series + value pairs), and the X value at the
|
|
25
|
+
* cursor. When omitted, the default surface renders timestamp + rows.
|
|
26
|
+
*/
|
|
27
|
+
children?: (args: LineChartTooltipRenderArgs) => ReactNode;
|
|
28
|
+
/** Custom formatter for the default popover timestamp slot. */
|
|
29
|
+
xTickFormatter?: (value: unknown) => ReactNode;
|
|
30
|
+
}
|
|
31
|
+
export declare const LineChartTooltip: FC<LineChartTooltipProps>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useContext, useMemo } from "react";
|
|
3
|
+
import { Tooltip, usePlotArea } from "recharts";
|
|
4
|
+
import { lineChartTooltipCenterClasses } from "./classes.js";
|
|
5
|
+
import { HOVER_POPOVER_TOP } from "./constants.js";
|
|
6
|
+
import { LineChartDataContext, LineChartSelectionContext, LineChartZoomContext } from "./LineChartContext.js";
|
|
7
|
+
import { LineChartHoverPopover } from "./LineChartHoverPopover.js";
|
|
8
|
+
import { LineChartHoverPopoverRow } from "./LineChartHoverPopoverRow.js";
|
|
9
|
+
import { LineChartHoverPopoverTimestamp } from "./LineChartHoverPopoverTimestamp.js";
|
|
10
|
+
const TOOLTIP_CURSOR = {
|
|
11
|
+
stroke: 'var(--color-border-primary-light)',
|
|
12
|
+
strokeWidth: 1,
|
|
13
|
+
strokeDasharray: '4 4'
|
|
14
|
+
};
|
|
15
|
+
const TOOLTIP_ALLOW_ESCAPE = {
|
|
16
|
+
x: false,
|
|
17
|
+
y: false
|
|
18
|
+
};
|
|
19
|
+
const formatXValue = (value, formatter)=>{
|
|
20
|
+
if (formatter) return formatter(value);
|
|
21
|
+
return String(value);
|
|
22
|
+
};
|
|
23
|
+
const LineChartTooltip = ({ children, xTickFormatter })=>{
|
|
24
|
+
const dataCtx = useContext(LineChartDataContext);
|
|
25
|
+
const { hiddenSet } = useContext(LineChartSelectionContext);
|
|
26
|
+
const zoomCtx = useContext(LineChartZoomContext);
|
|
27
|
+
const plotArea = usePlotArea();
|
|
28
|
+
const visibleSeries = useMemo(()=>dataCtx ? dataCtx.series.filter((s)=>!hiddenSet.has(s.key)) : [], [
|
|
29
|
+
dataCtx,
|
|
30
|
+
hiddenSet
|
|
31
|
+
]);
|
|
32
|
+
if (!dataCtx) return null;
|
|
33
|
+
const centerY = plotArea ? plotArea.y + plotArea.height / 2 : HOVER_POPOVER_TOP;
|
|
34
|
+
const renderContent = ({ active, payload })=>{
|
|
35
|
+
if (!active || !payload || 0 === payload.length) return null;
|
|
36
|
+
if (zoomCtx?.drag || zoomCtx?.pending) return null;
|
|
37
|
+
const datum = payload[0]?.payload;
|
|
38
|
+
if (!datum) return null;
|
|
39
|
+
const xValue = datum[dataCtx.xKey];
|
|
40
|
+
const rows = visibleSeries.map((s)=>({
|
|
41
|
+
series: s,
|
|
42
|
+
value: datum[s.key]
|
|
43
|
+
}));
|
|
44
|
+
const body = children ? children({
|
|
45
|
+
datum,
|
|
46
|
+
rows,
|
|
47
|
+
xValue
|
|
48
|
+
}) : /*#__PURE__*/ jsxs(LineChartHoverPopover, {
|
|
49
|
+
children: [
|
|
50
|
+
/*#__PURE__*/ jsx(LineChartHoverPopoverTimestamp, {
|
|
51
|
+
children: formatXValue(xValue, xTickFormatter)
|
|
52
|
+
}),
|
|
53
|
+
rows.map((row)=>/*#__PURE__*/ jsx(LineChartHoverPopoverRow, {
|
|
54
|
+
series: row.series,
|
|
55
|
+
value: row.value
|
|
56
|
+
}, row.series.key))
|
|
57
|
+
]
|
|
58
|
+
});
|
|
59
|
+
return /*#__PURE__*/ jsx("div", {
|
|
60
|
+
className: lineChartTooltipCenterClasses,
|
|
61
|
+
children: body
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
return /*#__PURE__*/ jsx(Tooltip, {
|
|
65
|
+
cursor: zoomCtx?.drag || zoomCtx?.pending ? false : TOOLTIP_CURSOR,
|
|
66
|
+
isAnimationActive: false,
|
|
67
|
+
position: {
|
|
68
|
+
y: centerY
|
|
69
|
+
},
|
|
70
|
+
allowEscapeViewBox: TOOLTIP_ALLOW_ESCAPE,
|
|
71
|
+
content: renderContent
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
LineChartTooltip.displayName = 'LineChartTooltip';
|
|
75
|
+
export { LineChartTooltip };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Tick-spacing preset. Maps to `minTickGap` so callers don't have to think in
|
|
4
|
+
* pixels for the common case — explicit `minTickGap` still wins if passed.
|
|
5
|
+
*
|
|
6
|
+
* - `'sparse'` → 64px gap (wide labels, long ranges)
|
|
7
|
+
* - `'normal'` → 32px gap (sane default for hourly / daily timeseries)
|
|
8
|
+
* - `'dense'` → 16px gap (short labels, short ranges)
|
|
9
|
+
*/
|
|
10
|
+
export type LineChartXAxisDensity = 'sparse' | 'normal' | 'dense';
|
|
11
|
+
export interface LineChartXAxisProps {
|
|
12
|
+
/** Format the rendered tick label. Receives the raw datum value at the tick. */
|
|
13
|
+
tickFormatter?: (value: unknown, index: number) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Curated tick-spacing preset (`'sparse' | 'normal' | 'dense'`). Sets
|
|
16
|
+
* `minTickGap` to 64/32/16px respectively. Explicit `minTickGap` overrides
|
|
17
|
+
* the preset — reach for that escape hatch when no preset fits.
|
|
18
|
+
*/
|
|
19
|
+
density?: LineChartXAxisDensity;
|
|
20
|
+
/** Recharts tick interval — `0` to render every tick, the literal strings to auto-pick. */
|
|
21
|
+
interval?: number | 'preserveStart' | 'preserveEnd' | 'preserveStartEnd' | 'equidistantPreserveStart';
|
|
22
|
+
/** Recharts target tick count. */
|
|
23
|
+
tickCount?: number;
|
|
24
|
+
/** Explicit tick values. Overrides recharts' generator. */
|
|
25
|
+
ticks?: ReadonlyArray<number | string>;
|
|
26
|
+
/** Minimum gap (in pixels) between rendered tick labels. Overrides `density`. */
|
|
27
|
+
minTickGap?: number;
|
|
28
|
+
/** Recharts domain override — `['auto', 'auto']` by default. */
|
|
29
|
+
domain?: [
|
|
30
|
+
number | string | 'auto' | 'dataMin' | 'dataMax',
|
|
31
|
+
number | string | 'auto' | 'dataMin' | 'dataMax'
|
|
32
|
+
];
|
|
33
|
+
/** Padding between the plot edge and the first/last tick. */
|
|
34
|
+
padding?: {
|
|
35
|
+
left?: number;
|
|
36
|
+
right?: number;
|
|
37
|
+
} | 'gap' | 'no-gap';
|
|
38
|
+
/** Recharts axis scale type — `'category'` (default for line charts) or `'number'` for continuous X. */
|
|
39
|
+
type?: 'category' | 'number';
|
|
40
|
+
/** Render the axis area as a spacer (preserves layout, hides the labels). */
|
|
41
|
+
hideTicks?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Render the solid bottom axis line. Defaults to `true` — the line owns the
|
|
44
|
+
* bottom rail of the plot (the `<LineChartGrid>` drops its bottom horizontal
|
|
45
|
+
* grid line to avoid stacking on top of it). Pass `false` for sparkline-style
|
|
46
|
+
* plots; in that case set `<LineChartGrid keepBottomLine />` if a bottom rail
|
|
47
|
+
* is still wanted.
|
|
48
|
+
*/
|
|
49
|
+
axisLine?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export declare const LineChartXAxis: FC<LineChartXAxisProps>;
|