@structyl/primitives 1.0.0 → 1.1.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/LICENSE +1 -1
- package/README.md +3 -3
- package/dist/index.cjs +232 -143
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +66 -100
- package/dist/index.d.ts +66 -100
- package/dist/index.mjs +232 -143
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -4
package/dist/index.cjs
CHANGED
|
@@ -6496,7 +6496,7 @@ var Timeline = {
|
|
|
6496
6496
|
Content: TimelineContent
|
|
6497
6497
|
};
|
|
6498
6498
|
var ClickAwayListener = React62__namespace.forwardRef(
|
|
6499
|
-
({ children, onClickAway }, ref) => {
|
|
6499
|
+
({ children, onClickAway, style, ...rest }, ref) => {
|
|
6500
6500
|
const localRef = React62__namespace.useRef(null);
|
|
6501
6501
|
const composedRef = hooks.useComposedRefs(ref, localRef);
|
|
6502
6502
|
React62__namespace.useEffect(() => {
|
|
@@ -6514,7 +6514,7 @@ var ClickAwayListener = React62__namespace.forwardRef(
|
|
|
6514
6514
|
document.removeEventListener("touchstart", handlePointer);
|
|
6515
6515
|
};
|
|
6516
6516
|
}, [onClickAway]);
|
|
6517
|
-
return /* @__PURE__ */ React62__namespace.createElement("span", { ref: composedRef, style: { display: "contents" } }, children);
|
|
6517
|
+
return /* @__PURE__ */ React62__namespace.createElement("span", { ref: composedRef, ...rest, style: { display: "contents", ...style } }, children);
|
|
6518
6518
|
}
|
|
6519
6519
|
);
|
|
6520
6520
|
ClickAwayListener.displayName = "ClickAwayListener";
|
|
@@ -6541,7 +6541,7 @@ function parsePlacement(placement) {
|
|
|
6541
6541
|
return { side, align: align ?? "center" };
|
|
6542
6542
|
}
|
|
6543
6543
|
var Popper8 = React62__namespace.forwardRef(
|
|
6544
|
-
({ open, anchorEl: anchorElProp, placement = "bottom", children, className, style, keepMounted = false, disablePortal = false, container }, ref) => {
|
|
6544
|
+
({ open, anchorEl: anchorElProp, placement = "bottom", children, className, style, keepMounted = false, disablePortal = false, container, ...rest }, ref) => {
|
|
6545
6545
|
const virtualRef = React62__namespace.useRef({ getBoundingClientRect: () => getAnchorEl(anchorElProp)?.getBoundingClientRect() ?? new DOMRect() });
|
|
6546
6546
|
React62__namespace.useEffect(() => {
|
|
6547
6547
|
virtualRef.current.getBoundingClientRect = () => getAnchorEl(anchorElProp)?.getBoundingClientRect() ?? new DOMRect();
|
|
@@ -6555,6 +6555,7 @@ var Popper8 = React62__namespace.forwardRef(
|
|
|
6555
6555
|
side,
|
|
6556
6556
|
align,
|
|
6557
6557
|
sideOffset: 4,
|
|
6558
|
+
...rest,
|
|
6558
6559
|
style: { display: !open ? "none" : void 0, ...style },
|
|
6559
6560
|
className
|
|
6560
6561
|
},
|
|
@@ -7632,39 +7633,40 @@ var NextButton = React62__namespace.forwardRef((props, forwardedRef) => {
|
|
|
7632
7633
|
);
|
|
7633
7634
|
});
|
|
7634
7635
|
NextButton.displayName = "Calendar.NextButton";
|
|
7635
|
-
var Heading = ({
|
|
7636
|
-
format = { month: "long", year: "numeric" },
|
|
7637
|
-
locale
|
|
7638
|
-
}) => {
|
|
7636
|
+
var Heading = React62__namespace.forwardRef((props, forwardedRef) => {
|
|
7637
|
+
const { format = { month: "long", year: "numeric" }, locale, ...rest } = props;
|
|
7639
7638
|
const ctx = useCalendarContext("Calendar.Heading");
|
|
7640
|
-
return /* @__PURE__ */ React62__namespace.createElement(
|
|
7641
|
-
};
|
|
7639
|
+
return /* @__PURE__ */ React62__namespace.createElement(core.Primitive.span, { ...rest, ref: forwardedRef, "aria-live": "polite" }, new Intl.DateTimeFormat(locale ?? ctx.locale, format).format(ctx.displayMonth));
|
|
7640
|
+
});
|
|
7642
7641
|
Heading.displayName = "Calendar.Heading";
|
|
7643
7642
|
var Grid2 = React62__namespace.forwardRef(
|
|
7644
7643
|
(props, forwardedRef) => /* @__PURE__ */ React62__namespace.createElement("table", { role: "grid", ...props, ref: forwardedRef })
|
|
7645
7644
|
);
|
|
7646
7645
|
Grid2.displayName = "Calendar.Grid";
|
|
7647
|
-
var GridHead = (
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
};
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7646
|
+
var GridHead = React62__namespace.forwardRef(
|
|
7647
|
+
(props, forwardedRef) => {
|
|
7648
|
+
const { locale, format = "narrow", ...rest } = props;
|
|
7649
|
+
const ctx = useCalendarContext("Calendar.GridHead");
|
|
7650
|
+
const fmt3 = new Intl.DateTimeFormat(locale ?? ctx.locale, { weekday: format });
|
|
7651
|
+
const days = Array.from({ length: 7 }, (_, i) => {
|
|
7652
|
+
const d = addDays(new Date(2024, 0, 7), i + ctx.weekStartsOn);
|
|
7653
|
+
return {
|
|
7654
|
+
label: ctx.dayOfWeekFormatter?.(d) ?? fmt3.format(d),
|
|
7655
|
+
date: d
|
|
7656
|
+
};
|
|
7657
|
+
});
|
|
7658
|
+
return /* @__PURE__ */ React62__namespace.createElement("thead", { ...rest, ref: forwardedRef }, /* @__PURE__ */ React62__namespace.createElement("tr", null, ctx.displayWeekNumber ? /* @__PURE__ */ React62__namespace.createElement("th", { scope: "col", "aria-label": "Week number" }, "#") : null, days.map((day, i) => /* @__PURE__ */ React62__namespace.createElement("th", { key: i, scope: "col", "aria-label": new Intl.DateTimeFormat(locale ?? ctx.locale, { weekday: "long" }).format(day.date) }, day.label))));
|
|
7659
|
+
}
|
|
7660
|
+
);
|
|
7662
7661
|
GridHead.displayName = "Calendar.GridHead";
|
|
7663
|
-
var GridBody = (
|
|
7664
|
-
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
|
|
7662
|
+
var GridBody = React62__namespace.forwardRef(
|
|
7663
|
+
(props, forwardedRef) => {
|
|
7664
|
+
const { children, ...rest } = props;
|
|
7665
|
+
const ctx = useCalendarContext("Calendar.GridBody");
|
|
7666
|
+
const weeks = getDaysGrid(ctx.displayMonth, ctx.weekStartsOn, ctx.fixedWeekNumber);
|
|
7667
|
+
return /* @__PURE__ */ React62__namespace.createElement("tbody", { ...rest, ref: forwardedRef }, weeks.map((week, wi) => /* @__PURE__ */ React62__namespace.createElement("tr", { key: wi }, ctx.displayWeekNumber ? /* @__PURE__ */ React62__namespace.createElement("td", { role: "gridcell", "aria-label": `Week ${getWeekNumber(week[0] ?? ctx.displayMonth)}` }, getWeekNumber(week[0] ?? ctx.displayMonth)) : null, week.map((day, di) => /* @__PURE__ */ React62__namespace.createElement("td", { key: di, role: "gridcell" }, children(day, { isOutsideMonth: !isSameMonth(day, ctx.displayMonth) }))))));
|
|
7668
|
+
}
|
|
7669
|
+
);
|
|
7668
7670
|
GridBody.displayName = "Calendar.GridBody";
|
|
7669
7671
|
function getWeekNumber(date) {
|
|
7670
7672
|
const target = startOfDay(date);
|
|
@@ -9318,10 +9320,12 @@ var List5 = React62__namespace.forwardRef(
|
|
|
9318
9320
|
(props, forwardedRef) => /* @__PURE__ */ React62__namespace.createElement(core.Primitive.ul, { ...props, ref: forwardedRef })
|
|
9319
9321
|
);
|
|
9320
9322
|
List5.displayName = "FileUpload.List";
|
|
9321
|
-
var Item13 = (
|
|
9322
|
-
|
|
9323
|
-
|
|
9324
|
-
};
|
|
9323
|
+
var Item13 = React62__namespace.forwardRef(
|
|
9324
|
+
({ file, children, ...rest }, forwardedRef) => {
|
|
9325
|
+
const ctx = useFileUploadContext("FileUpload.Item");
|
|
9326
|
+
return /* @__PURE__ */ React62__namespace.createElement(core.Primitive.li, { ...rest, "data-file-name": file.name, ref: forwardedRef }, children ?? /* @__PURE__ */ React62__namespace.createElement(React62__namespace.Fragment, null, /* @__PURE__ */ React62__namespace.createElement("span", null, file.name), " ", /* @__PURE__ */ React62__namespace.createElement("button", { type: "button", onClick: () => ctx.removeFile(file), "aria-label": `Remove ${file.name}` }, "\xD7")));
|
|
9327
|
+
}
|
|
9328
|
+
);
|
|
9325
9329
|
Item13.displayName = "FileUpload.Item";
|
|
9326
9330
|
var Trigger18 = React62__namespace.forwardRef(
|
|
9327
9331
|
(props, forwardedRef) => {
|
|
@@ -10233,11 +10237,11 @@ var Input8 = React62__namespace.forwardRef(
|
|
|
10233
10237
|
}
|
|
10234
10238
|
);
|
|
10235
10239
|
Input8.displayName = "TagsInput.Input";
|
|
10236
|
-
var Tag = ({ index, children }) => {
|
|
10240
|
+
var Tag = ({ index, children, ...rest }) => {
|
|
10237
10241
|
const ctx = useTagsInputContext("TagsInput.Tag");
|
|
10238
10242
|
const tag = ctx.tags[index];
|
|
10239
10243
|
if (tag === void 0) return null;
|
|
10240
|
-
return /* @__PURE__ */ React62__namespace.createElement(core.Primitive.span, { "data-tag-index": index }, children ?? /* @__PURE__ */ React62__namespace.createElement(React62__namespace.Fragment, null, tag, " ", /* @__PURE__ */ React62__namespace.createElement("button", { type: "button", onClick: () => ctx.removeTag(index), "aria-label": `Remove ${tag}` }, "\xD7")));
|
|
10244
|
+
return /* @__PURE__ */ React62__namespace.createElement(core.Primitive.span, { "data-tag-index": index, ...rest }, children ?? /* @__PURE__ */ React62__namespace.createElement(React62__namespace.Fragment, null, tag, " ", /* @__PURE__ */ React62__namespace.createElement("button", { type: "button", onClick: () => ctx.removeTag(index), "aria-label": `Remove ${tag}` }, "\xD7")));
|
|
10241
10245
|
};
|
|
10242
10246
|
Tag.displayName = "TagsInput.Tag";
|
|
10243
10247
|
var Items = ({ children }) => {
|
|
@@ -10363,15 +10367,16 @@ var Items2 = ({ children }) => {
|
|
|
10363
10367
|
return /* @__PURE__ */ React62__namespace.createElement(React62__namespace.Fragment, null, items.map((item, i) => children(item, i, ctx.highlighted === i)));
|
|
10364
10368
|
};
|
|
10365
10369
|
Items2.displayName = "Mentions.Items";
|
|
10366
|
-
var Item15 = ({ suggestion, index, children }) => {
|
|
10370
|
+
var Item15 = ({ suggestion, index, children, ...rest }) => {
|
|
10367
10371
|
const ctx = useMentionsContext("Mentions.Item");
|
|
10368
10372
|
return /* @__PURE__ */ React62__namespace.createElement(
|
|
10369
10373
|
core.Primitive.div,
|
|
10370
10374
|
{
|
|
10371
10375
|
role: "option",
|
|
10372
10376
|
"data-highlighted": ctx.highlighted === index ? "" : void 0,
|
|
10373
|
-
|
|
10374
|
-
|
|
10377
|
+
...rest,
|
|
10378
|
+
onPointerMove: utils.composeEventHandlers(rest.onPointerMove, () => ctx.setHighlighted(index)),
|
|
10379
|
+
onClick: utils.composeEventHandlers(rest.onClick, () => ctx.selectSuggestion(suggestion))
|
|
10375
10380
|
},
|
|
10376
10381
|
children ?? suggestion.label
|
|
10377
10382
|
);
|
|
@@ -11482,9 +11487,11 @@ var Root44 = React62__namespace.forwardRef(
|
|
|
11482
11487
|
height: heightProp = 300,
|
|
11483
11488
|
margin: marginProp,
|
|
11484
11489
|
className,
|
|
11490
|
+
style,
|
|
11485
11491
|
accessibilityLabel = "Chart",
|
|
11486
11492
|
accessibilityMode = false,
|
|
11487
|
-
children
|
|
11493
|
+
children,
|
|
11494
|
+
...rest
|
|
11488
11495
|
}, ref) => {
|
|
11489
11496
|
const containerRef = React62__namespace.useRef(null);
|
|
11490
11497
|
const composedRef = useMergedRef(ref, containerRef);
|
|
@@ -11647,8 +11654,10 @@ var Root44 = React62__namespace.forwardRef(
|
|
|
11647
11654
|
width: widthProp ? width : "100%",
|
|
11648
11655
|
display: "flex",
|
|
11649
11656
|
flexDirection: isRow ? "row" : "column",
|
|
11650
|
-
alignItems: isRow ? "center" : "stretch"
|
|
11651
|
-
|
|
11657
|
+
alignItems: isRow ? "center" : "stretch",
|
|
11658
|
+
...style
|
|
11659
|
+
},
|
|
11660
|
+
...rest
|
|
11652
11661
|
},
|
|
11653
11662
|
accessibilityMode && /* @__PURE__ */ React62__namespace.createElement(A11yPatternDefs, null),
|
|
11654
11663
|
/* @__PURE__ */ React62__namespace.createElement(
|
|
@@ -11676,13 +11685,14 @@ var Grid3 = React62__namespace.forwardRef(
|
|
|
11676
11685
|
horizontal = true,
|
|
11677
11686
|
vertical = false,
|
|
11678
11687
|
strokeDasharray = "3 3",
|
|
11679
|
-
className
|
|
11688
|
+
className,
|
|
11689
|
+
...rest
|
|
11680
11690
|
}, ref) => {
|
|
11681
11691
|
const ctx = useCartesianContext("Chart.Grid");
|
|
11682
11692
|
const { dimensions, yDomain, xDomain, isBand, xScale } = ctx;
|
|
11683
11693
|
const { innerWidth, innerHeight } = dimensions;
|
|
11684
11694
|
const yTicks = niceLinearTicks(yDomain[0], yDomain[1], 5);
|
|
11685
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", {
|
|
11695
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { "aria-hidden": "true", ...rest, ref, className }, horizontal && yTicks.map((tick) => {
|
|
11686
11696
|
const y = linearScale2(yDomain, [innerHeight, 0])(tick);
|
|
11687
11697
|
return /* @__PURE__ */ React62__namespace.createElement(
|
|
11688
11698
|
"line",
|
|
@@ -11724,7 +11734,8 @@ var XAxis = React62__namespace.forwardRef(
|
|
|
11724
11734
|
tickFormatter,
|
|
11725
11735
|
hideLine = false,
|
|
11726
11736
|
hideTicks = false,
|
|
11727
|
-
className
|
|
11737
|
+
className,
|
|
11738
|
+
...rest
|
|
11728
11739
|
}, ref) => {
|
|
11729
11740
|
const ctx = useCartesianContext("Chart.XAxis");
|
|
11730
11741
|
const { dimensions, xDomain, isBand, xScale } = ctx;
|
|
@@ -11739,7 +11750,7 @@ var XAxis = React62__namespace.forwardRef(
|
|
|
11739
11750
|
if (tickFormatter) return tickFormatter(v);
|
|
11740
11751
|
return String(v);
|
|
11741
11752
|
};
|
|
11742
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, transform: `translate(0, ${innerHeight})`, className }, !hideLine && /* @__PURE__ */ React62__namespace.createElement("line", { x1: 0, y1: 0, x2: innerWidth, y2: 0, stroke: "currentColor", strokeOpacity: 0.3 }), !hideTicks && displayTicks.map((tick, i) => {
|
|
11753
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, transform: `translate(0, ${innerHeight})`, className }, !hideLine && /* @__PURE__ */ React62__namespace.createElement("line", { x1: 0, y1: 0, x2: innerWidth, y2: 0, stroke: "currentColor", strokeOpacity: 0.3 }), !hideTicks && displayTicks.map((tick, i) => {
|
|
11743
11754
|
const x = xScale(tick);
|
|
11744
11755
|
return /* @__PURE__ */ React62__namespace.createElement("g", { key: i, transform: `translate(${x}, 0)` }, /* @__PURE__ */ React62__namespace.createElement("line", { y1: 0, y2: 4, stroke: "currentColor", strokeOpacity: 0.5 }), /* @__PURE__ */ React62__namespace.createElement(
|
|
11745
11756
|
"text",
|
|
@@ -11774,7 +11785,8 @@ var YAxis = React62__namespace.forwardRef(
|
|
|
11774
11785
|
tickFormatter,
|
|
11775
11786
|
hideLine = false,
|
|
11776
11787
|
hideTicks = false,
|
|
11777
|
-
className
|
|
11788
|
+
className,
|
|
11789
|
+
...rest
|
|
11778
11790
|
}, ref) => {
|
|
11779
11791
|
const ctx = useCartesianContext("Chart.YAxis");
|
|
11780
11792
|
const { yDomain, dimensions } = ctx;
|
|
@@ -11787,7 +11799,7 @@ var YAxis = React62__namespace.forwardRef(
|
|
|
11787
11799
|
return String(v);
|
|
11788
11800
|
};
|
|
11789
11801
|
const yScale = linearScale2(yDomain, [innerHeight, 0]);
|
|
11790
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className }, !hideLine && /* @__PURE__ */ React62__namespace.createElement("line", { x1: 0, y1: 0, x2: 0, y2: innerHeight, stroke: "currentColor", strokeOpacity: 0.3 }), !hideTicks && ticks.map((tick) => {
|
|
11802
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className }, !hideLine && /* @__PURE__ */ React62__namespace.createElement("line", { x1: 0, y1: 0, x2: 0, y2: innerHeight, stroke: "currentColor", strokeOpacity: 0.3 }), !hideTicks && ticks.map((tick) => {
|
|
11791
11803
|
const y = yScale(tick);
|
|
11792
11804
|
return /* @__PURE__ */ React62__namespace.createElement("g", { key: tick, transform: `translate(0, ${y})` }, /* @__PURE__ */ React62__namespace.createElement("line", { x1: -4, y1: 0, x2: 0, y2: 0, stroke: "currentColor", strokeOpacity: 0.5 }), /* @__PURE__ */ React62__namespace.createElement(
|
|
11793
11805
|
"text",
|
|
@@ -11909,7 +11921,8 @@ var Bar = React62__namespace.forwardRef(
|
|
|
11909
11921
|
labelFormatter,
|
|
11910
11922
|
highlightScope,
|
|
11911
11923
|
onClick,
|
|
11912
|
-
className
|
|
11924
|
+
className,
|
|
11925
|
+
...rest
|
|
11913
11926
|
}, ref) => {
|
|
11914
11927
|
const ctx = useCartesianContext("Chart.Bar");
|
|
11915
11928
|
const {
|
|
@@ -11934,7 +11947,7 @@ var Bar = React62__namespace.forwardRef(
|
|
|
11934
11947
|
if (orientation === "horizontal") {
|
|
11935
11948
|
const xValueScale = linearScale2(yDomain, [0, innerWidth]);
|
|
11936
11949
|
const x0 = xValueScale(0);
|
|
11937
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className, "aria-label": name ?? dataKey }, data.map((row, i) => {
|
|
11950
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className, "aria-label": name ?? dataKey }, data.map((row, i) => {
|
|
11938
11951
|
const value = row[dataKey];
|
|
11939
11952
|
if (typeof value !== "number") return null;
|
|
11940
11953
|
const xVal = isBand ? row[xDataKey] : i;
|
|
@@ -12010,7 +12023,7 @@ var Bar = React62__namespace.forwardRef(
|
|
|
12010
12023
|
}));
|
|
12011
12024
|
}
|
|
12012
12025
|
const y0 = yScale(0);
|
|
12013
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className, "aria-label": name ?? dataKey }, data.map((row, i) => {
|
|
12026
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className, "aria-label": name ?? dataKey }, data.map((row, i) => {
|
|
12014
12027
|
const value = row[dataKey];
|
|
12015
12028
|
if (typeof value !== "number") return null;
|
|
12016
12029
|
const xVal = isBand ? row[xDataKey] : i;
|
|
@@ -12100,7 +12113,8 @@ var Line = React62__namespace.forwardRef(
|
|
|
12100
12113
|
strokeDasharray,
|
|
12101
12114
|
highlightScope,
|
|
12102
12115
|
onClick,
|
|
12103
|
-
className
|
|
12116
|
+
className,
|
|
12117
|
+
...rest
|
|
12104
12118
|
}, ref) => {
|
|
12105
12119
|
const ctx = useCartesianContext("Chart.Line");
|
|
12106
12120
|
const {
|
|
@@ -12139,7 +12153,7 @@ var Line = React62__namespace.forwardRef(
|
|
|
12139
12153
|
const validPoints = rawPoints.filter((p) => p !== null);
|
|
12140
12154
|
if (validPoints.length === 0) return null;
|
|
12141
12155
|
const lineOpacity = highlightScope && activeIndex !== null ? resolveOpacity(seriesIndex, seriesIndex, seriesIndex, activeIndex, highlightScope) : 1;
|
|
12142
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className, "aria-label": name ?? dataKey }, /* @__PURE__ */ React62__namespace.createElement(
|
|
12156
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className, "aria-label": name ?? dataKey }, /* @__PURE__ */ React62__namespace.createElement(
|
|
12143
12157
|
"path",
|
|
12144
12158
|
{
|
|
12145
12159
|
d: pathD,
|
|
@@ -12221,7 +12235,9 @@ var Area2 = React62__namespace.forwardRef(
|
|
|
12221
12235
|
connectNulls: _connectNulls = false,
|
|
12222
12236
|
highlightScope,
|
|
12223
12237
|
fillByValue = false,
|
|
12224
|
-
className
|
|
12238
|
+
className,
|
|
12239
|
+
style,
|
|
12240
|
+
...rest
|
|
12225
12241
|
}, ref) => {
|
|
12226
12242
|
const ctx = useCartesianContext("Chart.Area");
|
|
12227
12243
|
const {
|
|
@@ -12253,7 +12269,7 @@ var Area2 = React62__namespace.forwardRef(
|
|
|
12253
12269
|
const aboveColor = resolvedColor;
|
|
12254
12270
|
const belowColor = palette[2] ?? "hsl(var(--chart-3))";
|
|
12255
12271
|
const areaOpacity = highlightScope && activeIndex !== null ? resolveOpacity(seriesIndex, seriesIndex, seriesIndex, activeIndex, highlightScope) : 1;
|
|
12256
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className, "aria-label": name ?? dataKey, style: { opacity: areaOpacity, transition: "opacity 150ms ease" } }, fillByValue && /* @__PURE__ */ React62__namespace.createElement("defs", null, /* @__PURE__ */ React62__namespace.createElement("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1" }, /* @__PURE__ */ React62__namespace.createElement("stop", { offset: `${zeroY / innerHeight * 100}%`, stopColor: aboveColor, stopOpacity: fillOpacity }), /* @__PURE__ */ React62__namespace.createElement("stop", { offset: `${zeroY / innerHeight * 100}%`, stopColor: belowColor, stopOpacity: fillOpacity }))), /* @__PURE__ */ React62__namespace.createElement(
|
|
12272
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className, "aria-label": name ?? dataKey, style: { opacity: areaOpacity, transition: "opacity 150ms ease", ...style } }, fillByValue && /* @__PURE__ */ React62__namespace.createElement("defs", null, /* @__PURE__ */ React62__namespace.createElement("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1" }, /* @__PURE__ */ React62__namespace.createElement("stop", { offset: `${zeroY / innerHeight * 100}%`, stopColor: aboveColor, stopOpacity: fillOpacity }), /* @__PURE__ */ React62__namespace.createElement("stop", { offset: `${zeroY / innerHeight * 100}%`, stopColor: belowColor, stopOpacity: fillOpacity }))), /* @__PURE__ */ React62__namespace.createElement(
|
|
12257
12273
|
"path",
|
|
12258
12274
|
{
|
|
12259
12275
|
d: areaD,
|
|
@@ -12284,7 +12300,8 @@ var Scatter = React62__namespace.forwardRef(
|
|
|
12284
12300
|
markerShape = "circle",
|
|
12285
12301
|
highlightScope,
|
|
12286
12302
|
onClick,
|
|
12287
|
-
className
|
|
12303
|
+
className,
|
|
12304
|
+
...rest
|
|
12288
12305
|
}, ref) => {
|
|
12289
12306
|
const ctx = useCartesianContext("Chart.Scatter");
|
|
12290
12307
|
const {
|
|
@@ -12298,7 +12315,7 @@ var Scatter = React62__namespace.forwardRef(
|
|
|
12298
12315
|
} = ctx;
|
|
12299
12316
|
const seriesIndex = ctx.registerSeries(name ?? xKey);
|
|
12300
12317
|
const resolvedColor = color ?? palette[seriesIndex % palette.length] ?? palette[0] ?? "hsl(var(--chart-1))";
|
|
12301
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className, "aria-label": name ?? `${xKey} vs ${yKey}` }, data.map((row, i) => {
|
|
12318
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className, "aria-label": name ?? `${xKey} vs ${yKey}` }, data.map((row, i) => {
|
|
12302
12319
|
const xVal = row[xKey];
|
|
12303
12320
|
const yVal = row[yKey];
|
|
12304
12321
|
if (typeof xVal !== "number" || typeof yVal !== "number") return null;
|
|
@@ -12367,7 +12384,8 @@ var Bubble = React62__namespace.forwardRef(
|
|
|
12367
12384
|
minRadius = 4,
|
|
12368
12385
|
maxRadius = 40,
|
|
12369
12386
|
onClick,
|
|
12370
|
-
className
|
|
12387
|
+
className,
|
|
12388
|
+
...rest
|
|
12371
12389
|
}, ref) => {
|
|
12372
12390
|
const ctx = useCartesianContext("Chart.Bubble");
|
|
12373
12391
|
const {
|
|
@@ -12389,7 +12407,7 @@ var Bubble = React62__namespace.forwardRef(
|
|
|
12389
12407
|
const maxSize = Math.max(...sizeValues);
|
|
12390
12408
|
const sizeRange = maxSize - minSize || 1;
|
|
12391
12409
|
const sizeScale = (value) => minRadius + (value - minSize) / sizeRange * (maxRadius - minRadius);
|
|
12392
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className, "aria-label": name ?? `${xKey} vs ${yKey}` }, data.map((row, i) => {
|
|
12410
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className, "aria-label": name ?? `${xKey} vs ${yKey}` }, data.map((row, i) => {
|
|
12393
12411
|
const xVal = row[xKey];
|
|
12394
12412
|
const yVal = row[yKey];
|
|
12395
12413
|
const sizeVal = row[sizeKey];
|
|
@@ -12458,7 +12476,9 @@ var Tooltip = React62__namespace.forwardRef(
|
|
|
12458
12476
|
border,
|
|
12459
12477
|
borderRadius = 8,
|
|
12460
12478
|
boxShadow = "0 4px 12px rgba(0,0,0,0.15)",
|
|
12461
|
-
fontSize = 12
|
|
12479
|
+
fontSize = 12,
|
|
12480
|
+
style: styleProp,
|
|
12481
|
+
...rest
|
|
12462
12482
|
}, ref) => {
|
|
12463
12483
|
const ctx = useSharedTooltip("Chart.Tooltip");
|
|
12464
12484
|
const { tooltip } = ctx;
|
|
@@ -12470,6 +12490,7 @@ var Tooltip = React62__namespace.forwardRef(
|
|
|
12470
12490
|
return /* @__PURE__ */ React62__namespace.createElement(
|
|
12471
12491
|
"div",
|
|
12472
12492
|
{
|
|
12493
|
+
...rest,
|
|
12473
12494
|
ref,
|
|
12474
12495
|
role: "status",
|
|
12475
12496
|
"aria-live": "polite",
|
|
@@ -12485,14 +12506,16 @@ var Tooltip = React62__namespace.forwardRef(
|
|
|
12485
12506
|
top: tooltip.y,
|
|
12486
12507
|
transform: "translate(-50%, calc(-100% - 8px))",
|
|
12487
12508
|
pointerEvents: "none",
|
|
12488
|
-
zIndex: 50
|
|
12509
|
+
zIndex: 50,
|
|
12510
|
+
...styleProp
|
|
12489
12511
|
};
|
|
12490
12512
|
if (content) {
|
|
12491
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, style, className }, content(tooltip));
|
|
12513
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, style, className }, content(tooltip));
|
|
12492
12514
|
}
|
|
12493
12515
|
return /* @__PURE__ */ React62__namespace.createElement(
|
|
12494
12516
|
"div",
|
|
12495
12517
|
{
|
|
12518
|
+
...rest,
|
|
12496
12519
|
ref,
|
|
12497
12520
|
style,
|
|
12498
12521
|
className
|
|
@@ -12536,7 +12559,9 @@ var Legend = React62__namespace.forwardRef(
|
|
|
12536
12559
|
renderEntry,
|
|
12537
12560
|
iconType = "square",
|
|
12538
12561
|
iconSize = 12,
|
|
12539
|
-
className
|
|
12562
|
+
className,
|
|
12563
|
+
style,
|
|
12564
|
+
...rest
|
|
12540
12565
|
}, ref) => {
|
|
12541
12566
|
const ctx = useSharedTooltip("Chart.Legend");
|
|
12542
12567
|
const entries = ctx.legendEntries;
|
|
@@ -12588,11 +12613,12 @@ var Legend = React62__namespace.forwardRef(
|
|
|
12588
12613
|
const order = position === "top" || position === "left" ? -1 : 1;
|
|
12589
12614
|
const isVertical = position === "left" || position === "right";
|
|
12590
12615
|
if (content) {
|
|
12591
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className, style: { order }, "aria-label": "Chart legend" }, content(entries));
|
|
12616
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style: { order, ...style }, "aria-label": "Chart legend" }, content(entries));
|
|
12592
12617
|
}
|
|
12593
12618
|
return /* @__PURE__ */ React62__namespace.createElement(
|
|
12594
12619
|
"div",
|
|
12595
12620
|
{
|
|
12621
|
+
...rest,
|
|
12596
12622
|
ref,
|
|
12597
12623
|
className,
|
|
12598
12624
|
style: {
|
|
@@ -12602,7 +12628,8 @@ var Legend = React62__namespace.forwardRef(
|
|
|
12602
12628
|
gap: 12,
|
|
12603
12629
|
justifyContent: "center",
|
|
12604
12630
|
padding: isVertical ? "0 8px" : "8px 0",
|
|
12605
|
-
order
|
|
12631
|
+
order,
|
|
12632
|
+
...style
|
|
12606
12633
|
},
|
|
12607
12634
|
"aria-label": "Chart legend"
|
|
12608
12635
|
},
|
|
@@ -12619,8 +12646,10 @@ var PieRoot = React62__namespace.forwardRef(
|
|
|
12619
12646
|
width = 400,
|
|
12620
12647
|
height = 400,
|
|
12621
12648
|
className,
|
|
12649
|
+
style,
|
|
12622
12650
|
accessibilityLabel = "Pie chart",
|
|
12623
|
-
children
|
|
12651
|
+
children,
|
|
12652
|
+
...rest
|
|
12624
12653
|
}, ref) => {
|
|
12625
12654
|
const cx = width / 2;
|
|
12626
12655
|
const cy = height / 2;
|
|
@@ -12649,13 +12678,15 @@ var PieRoot = React62__namespace.forwardRef(
|
|
|
12649
12678
|
return /* @__PURE__ */ React62__namespace.createElement(SharedTooltipProvider, { tooltip, setTooltip, legendEntries }, /* @__PURE__ */ React62__namespace.createElement(PieProvider, { ...contextValue }, /* @__PURE__ */ React62__namespace.createElement(
|
|
12650
12679
|
"div",
|
|
12651
12680
|
{
|
|
12681
|
+
...rest,
|
|
12652
12682
|
ref,
|
|
12653
12683
|
className,
|
|
12654
12684
|
style: {
|
|
12655
12685
|
position: "relative",
|
|
12656
12686
|
display: "inline-flex",
|
|
12657
12687
|
flexDirection: isRow ? "row" : "column",
|
|
12658
|
-
alignItems: isRow ? "center" : "center"
|
|
12688
|
+
alignItems: isRow ? "center" : "center",
|
|
12689
|
+
...style
|
|
12659
12690
|
}
|
|
12660
12691
|
},
|
|
12661
12692
|
/* @__PURE__ */ React62__namespace.createElement(
|
|
@@ -12689,7 +12720,8 @@ var Pie = React62__namespace.forwardRef(
|
|
|
12689
12720
|
arcLabel,
|
|
12690
12721
|
arcLabelMinAngle = 5,
|
|
12691
12722
|
onClick,
|
|
12692
|
-
className
|
|
12723
|
+
className,
|
|
12724
|
+
...rest
|
|
12693
12725
|
}, ref) => {
|
|
12694
12726
|
const ctx = usePieContext("Chart.Pie");
|
|
12695
12727
|
const { data, cx, cy, palette, setTooltip } = ctx;
|
|
@@ -12717,7 +12749,7 @@ var Pie = React62__namespace.forwardRef(
|
|
|
12717
12749
|
const sliceAngleDeg = Math.abs(sliceAngle * (180 / Math.PI));
|
|
12718
12750
|
return { startAngle: sliceStart, endAngle: sliceEnd, value, name: sliceName, color: sliceColor, index: i, d, sliceAngleDeg };
|
|
12719
12751
|
});
|
|
12720
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className }, slices.map((slice) => {
|
|
12752
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className }, slices.map((slice) => {
|
|
12721
12753
|
const isHovered = hovered === slice.index;
|
|
12722
12754
|
const expandedRadius = isHovered ? radius + 6 : radius;
|
|
12723
12755
|
const expandedInner = isHovered && innerRadius > 0 ? innerRadius - 2 : innerRadius;
|
|
@@ -12808,8 +12840,10 @@ var RadarRoot = React62__namespace.forwardRef(
|
|
|
12808
12840
|
width = 400,
|
|
12809
12841
|
height = 400,
|
|
12810
12842
|
className,
|
|
12843
|
+
style,
|
|
12811
12844
|
accessibilityLabel = "Radar chart",
|
|
12812
|
-
children
|
|
12845
|
+
children,
|
|
12846
|
+
...rest
|
|
12813
12847
|
}, ref) => {
|
|
12814
12848
|
const cx = width / 2;
|
|
12815
12849
|
const cy = height / 2;
|
|
@@ -12853,13 +12887,15 @@ var RadarRoot = React62__namespace.forwardRef(
|
|
|
12853
12887
|
return /* @__PURE__ */ React62__namespace.createElement(SharedTooltipProvider, { tooltip, setTooltip, legendEntries }, /* @__PURE__ */ React62__namespace.createElement(RadarProvider, { ...contextValue }, /* @__PURE__ */ React62__namespace.createElement(
|
|
12854
12888
|
"div",
|
|
12855
12889
|
{
|
|
12890
|
+
...rest,
|
|
12856
12891
|
ref,
|
|
12857
12892
|
className,
|
|
12858
12893
|
style: {
|
|
12859
12894
|
position: "relative",
|
|
12860
12895
|
display: "inline-flex",
|
|
12861
12896
|
flexDirection: isRow ? "row" : "column",
|
|
12862
|
-
alignItems: "center"
|
|
12897
|
+
alignItems: "center",
|
|
12898
|
+
...style
|
|
12863
12899
|
}
|
|
12864
12900
|
},
|
|
12865
12901
|
/* @__PURE__ */ React62__namespace.createElement(
|
|
@@ -12880,12 +12916,12 @@ var RadarRoot = React62__namespace.forwardRef(
|
|
|
12880
12916
|
);
|
|
12881
12917
|
RadarRoot.displayName = "Chart.RadarRoot";
|
|
12882
12918
|
var PolarGrid = React62__namespace.forwardRef(
|
|
12883
|
-
({ rings = 5, shape = "sharp", className }, ref) => {
|
|
12919
|
+
({ rings = 5, shape = "sharp", className, ...rest }, ref) => {
|
|
12884
12920
|
const ctx = useRadarContext("Chart.PolarGrid");
|
|
12885
12921
|
const { cx, cy, radius, angleKeys } = ctx;
|
|
12886
12922
|
const angleStep = 2 * Math.PI / Math.max(angleKeys.length, 3);
|
|
12887
12923
|
const spokeCount = Math.max(angleKeys.length, 3);
|
|
12888
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className, "aria-hidden": "true" }, Array.from({ length: rings }, (_, i) => {
|
|
12924
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className, "aria-hidden": "true" }, Array.from({ length: rings }, (_, i) => {
|
|
12889
12925
|
const r = radius / rings * (i + 1);
|
|
12890
12926
|
if (shape === "circular") {
|
|
12891
12927
|
return /* @__PURE__ */ React62__namespace.createElement(
|
|
@@ -12938,11 +12974,11 @@ var PolarGrid = React62__namespace.forwardRef(
|
|
|
12938
12974
|
);
|
|
12939
12975
|
PolarGrid.displayName = "Chart.PolarGrid";
|
|
12940
12976
|
var PolarAngleAxis = React62__namespace.forwardRef(
|
|
12941
|
-
({ dataKey: _dataKey, className }, ref) => {
|
|
12977
|
+
({ dataKey: _dataKey, className, ...rest }, ref) => {
|
|
12942
12978
|
const ctx = useRadarContext("Chart.PolarAngleAxis");
|
|
12943
12979
|
const { cx, cy, radius, angleKeys } = ctx;
|
|
12944
12980
|
const angleStep = 2 * Math.PI / Math.max(angleKeys.length, 1);
|
|
12945
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className }, angleKeys.map((key, i) => {
|
|
12981
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className }, angleKeys.map((key, i) => {
|
|
12946
12982
|
const angle = i * angleStep - Math.PI / 2;
|
|
12947
12983
|
const labelRadius = radius + 18;
|
|
12948
12984
|
const x = Math.round((cx + labelRadius * Math.cos(angle)) * 1e4) / 1e4;
|
|
@@ -12966,7 +13002,7 @@ var PolarAngleAxis = React62__namespace.forwardRef(
|
|
|
12966
13002
|
);
|
|
12967
13003
|
PolarAngleAxis.displayName = "Chart.PolarAngleAxis";
|
|
12968
13004
|
var Radar = React62__namespace.forwardRef(
|
|
12969
|
-
({ dataKey, color, name, fillOpacity = 0.25, fillArea = true, showMark: showMarkProp = true, dot: dotAlias, className }, ref) => {
|
|
13005
|
+
({ dataKey, color, name, fillOpacity = 0.25, fillArea = true, showMark: showMarkProp = true, dot: dotAlias, className, ...rest }, ref) => {
|
|
12970
13006
|
const showMark = dotAlias !== void 0 ? dotAlias : showMarkProp;
|
|
12971
13007
|
const ctx = useRadarContext("Chart.Radar");
|
|
12972
13008
|
const { data, cx, cy, radius, angleKeys, palette } = ctx;
|
|
@@ -12983,7 +13019,7 @@ var Radar = React62__namespace.forwardRef(
|
|
|
12983
13019
|
const normalised = values.map((v) => v / maxVal);
|
|
12984
13020
|
const seriesColor = color ?? palette[0] ?? "hsl(var(--chart-1))";
|
|
12985
13021
|
const pathD = buildRadarPath(normalised, cx, cy, radius);
|
|
12986
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className, "aria-label": name ?? dataKey }, /* @__PURE__ */ React62__namespace.createElement(
|
|
13022
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className, "aria-label": name ?? dataKey }, /* @__PURE__ */ React62__namespace.createElement(
|
|
12987
13023
|
"path",
|
|
12988
13024
|
{
|
|
12989
13025
|
d: pathD,
|
|
@@ -13022,7 +13058,9 @@ var Heatmap = React62__namespace.forwardRef(
|
|
|
13022
13058
|
height = 300,
|
|
13023
13059
|
margin: marginProp,
|
|
13024
13060
|
className,
|
|
13025
|
-
|
|
13061
|
+
style,
|
|
13062
|
+
accessibilityLabel = "Heatmap",
|
|
13063
|
+
...rest
|
|
13026
13064
|
}, ref) => {
|
|
13027
13065
|
const margin = { ...DEFAULT_MARGIN, ...marginProp };
|
|
13028
13066
|
const innerWidth = Math.max(0, width - margin.left - margin.right);
|
|
@@ -13046,7 +13084,7 @@ var Heatmap = React62__namespace.forwardRef(
|
|
|
13046
13084
|
return colorRange[0];
|
|
13047
13085
|
};
|
|
13048
13086
|
const cellOpacity = (norm) => 0.1 + norm * 0.9;
|
|
13049
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
13087
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
13050
13088
|
"svg",
|
|
13051
13089
|
{
|
|
13052
13090
|
role: "img",
|
|
@@ -13107,8 +13145,10 @@ var Treemap = React62__namespace.forwardRef(
|
|
|
13107
13145
|
padding = 4,
|
|
13108
13146
|
colors,
|
|
13109
13147
|
className,
|
|
13148
|
+
style,
|
|
13110
13149
|
accessibilityLabel = "Treemap",
|
|
13111
|
-
onNodeClick
|
|
13150
|
+
onNodeClick,
|
|
13151
|
+
...rest
|
|
13112
13152
|
}, ref) => {
|
|
13113
13153
|
const palette = colors ?? DEFAULT_PALETTE;
|
|
13114
13154
|
const nodes = squarifyTreemap(data, 0, 0, width, height, padding);
|
|
@@ -13153,7 +13193,7 @@ var Treemap = React62__namespace.forwardRef(
|
|
|
13153
13193
|
node.name
|
|
13154
13194
|
), node.children?.map((child) => renderNode(child, depth + 1)));
|
|
13155
13195
|
};
|
|
13156
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
13196
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
13157
13197
|
"svg",
|
|
13158
13198
|
{
|
|
13159
13199
|
role: "img",
|
|
@@ -13211,14 +13251,16 @@ var Funnel = React62__namespace.forwardRef(
|
|
|
13211
13251
|
curve = "linear",
|
|
13212
13252
|
gap = 0,
|
|
13213
13253
|
className,
|
|
13254
|
+
style,
|
|
13214
13255
|
accessibilityLabel = "Funnel chart",
|
|
13215
|
-
onSegmentClick
|
|
13256
|
+
onSegmentClick,
|
|
13257
|
+
...rest
|
|
13216
13258
|
}, ref) => {
|
|
13217
13259
|
const margin = { top: 10, right: 80, bottom: 10, left: 80 };
|
|
13218
13260
|
const innerWidth = Math.max(0, width - margin.left - margin.right);
|
|
13219
13261
|
const innerHeight = Math.max(0, height - margin.top - margin.bottom);
|
|
13220
13262
|
const segments = computeFunnelLayout(data, margin.left, margin.top, innerWidth, innerHeight, Math.max(gap, 0));
|
|
13221
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
13263
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
13222
13264
|
"svg",
|
|
13223
13265
|
{
|
|
13224
13266
|
role: "img",
|
|
@@ -13311,7 +13353,9 @@ var Gauge = React62__namespace.forwardRef(
|
|
|
13311
13353
|
width = 200,
|
|
13312
13354
|
height = 150,
|
|
13313
13355
|
className,
|
|
13314
|
-
|
|
13356
|
+
style,
|
|
13357
|
+
accessibilityLabel,
|
|
13358
|
+
...rest
|
|
13315
13359
|
}, ref) => {
|
|
13316
13360
|
const outerRadius = Math.min(width, height * 1.3) / 2 - 4;
|
|
13317
13361
|
const gaugeData = computeGaugeArcs(
|
|
@@ -13344,7 +13388,7 @@ var Gauge = React62__namespace.forwardRef(
|
|
|
13344
13388
|
return value.toLocaleString();
|
|
13345
13389
|
})();
|
|
13346
13390
|
const a11yLabel = accessibilityLabel ?? `Gauge: ${value} out of ${max}`;
|
|
13347
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
13391
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
13348
13392
|
"svg",
|
|
13349
13393
|
{
|
|
13350
13394
|
role: "img",
|
|
@@ -13421,8 +13465,10 @@ var GaugeContainer = React62__namespace.forwardRef(
|
|
|
13421
13465
|
height = 200,
|
|
13422
13466
|
thickness = 20,
|
|
13423
13467
|
className,
|
|
13468
|
+
style,
|
|
13424
13469
|
accessibilityLabel,
|
|
13425
|
-
children
|
|
13470
|
+
children,
|
|
13471
|
+
...rest
|
|
13426
13472
|
}, ref) => {
|
|
13427
13473
|
const cx = width / 2;
|
|
13428
13474
|
const cy = height / 2;
|
|
@@ -13442,7 +13488,7 @@ var GaugeContainer = React62__namespace.forwardRef(
|
|
|
13442
13488
|
innerRadius,
|
|
13443
13489
|
fraction
|
|
13444
13490
|
};
|
|
13445
|
-
return /* @__PURE__ */ React62__namespace.createElement(GaugeProvider, { ...contextValue }, /* @__PURE__ */ React62__namespace.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
13491
|
+
return /* @__PURE__ */ React62__namespace.createElement(GaugeProvider, { ...contextValue }, /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
13446
13492
|
"svg",
|
|
13447
13493
|
{
|
|
13448
13494
|
role: "img",
|
|
@@ -13458,7 +13504,7 @@ var GaugeContainer = React62__namespace.forwardRef(
|
|
|
13458
13504
|
);
|
|
13459
13505
|
GaugeContainer.displayName = "Chart.GaugeContainer";
|
|
13460
13506
|
var GaugeValueArc = React62__namespace.forwardRef(
|
|
13461
|
-
({ color, colorStops, className }, ref) => {
|
|
13507
|
+
({ color, colorStops, className, style, ...rest }, ref) => {
|
|
13462
13508
|
const ctx = useGaugeContext("Chart.GaugeValueArc");
|
|
13463
13509
|
const { cx, cy, outerRadius, innerRadius, fraction, startAngle, endAngle } = ctx;
|
|
13464
13510
|
let fillColor = color ?? DEFAULT_PALETTE[0] ?? "hsl(var(--chart-1))";
|
|
@@ -13479,18 +13525,19 @@ var GaugeValueArc = React62__namespace.forwardRef(
|
|
|
13479
13525
|
return /* @__PURE__ */ React62__namespace.createElement(
|
|
13480
13526
|
"path",
|
|
13481
13527
|
{
|
|
13528
|
+
...rest,
|
|
13482
13529
|
ref,
|
|
13483
13530
|
d: fillPath,
|
|
13484
13531
|
fill: fillColor,
|
|
13485
13532
|
className,
|
|
13486
|
-
style: { transition: "d 400ms ease" }
|
|
13533
|
+
style: { transition: "d 400ms ease", ...style }
|
|
13487
13534
|
}
|
|
13488
13535
|
);
|
|
13489
13536
|
}
|
|
13490
13537
|
);
|
|
13491
13538
|
GaugeValueArc.displayName = "Chart.GaugeValueArc";
|
|
13492
13539
|
var GaugeReferenceArc = React62__namespace.forwardRef(
|
|
13493
|
-
({ color, className }, ref) => {
|
|
13540
|
+
({ color, className, ...rest }, ref) => {
|
|
13494
13541
|
const ctx = useGaugeContext("Chart.GaugeReferenceArc");
|
|
13495
13542
|
const { cx, cy, outerRadius, innerRadius, startAngle, endAngle } = ctx;
|
|
13496
13543
|
const toRad = (deg) => deg * Math.PI / 180;
|
|
@@ -13500,6 +13547,7 @@ var GaugeReferenceArc = React62__namespace.forwardRef(
|
|
|
13500
13547
|
return /* @__PURE__ */ React62__namespace.createElement(
|
|
13501
13548
|
"path",
|
|
13502
13549
|
{
|
|
13550
|
+
...rest,
|
|
13503
13551
|
ref,
|
|
13504
13552
|
d: trackPath,
|
|
13505
13553
|
fill: color ?? "currentColor",
|
|
@@ -13541,7 +13589,9 @@ var CandlestickChart = React62__namespace.forwardRef(
|
|
|
13541
13589
|
bullColor = "hsl(var(--chart-2, 160 60% 45%))",
|
|
13542
13590
|
bearColor = "hsl(var(--chart-5, 340 75% 55%))",
|
|
13543
13591
|
className,
|
|
13544
|
-
|
|
13592
|
+
style,
|
|
13593
|
+
accessibilityLabel = "Candlestick chart",
|
|
13594
|
+
...rest
|
|
13545
13595
|
}, ref) => {
|
|
13546
13596
|
const margin = { ...DEFAULT_MARGIN, ...marginProp };
|
|
13547
13597
|
const innerWidth = Math.max(0, width - margin.left - margin.right);
|
|
@@ -13564,7 +13614,7 @@ var CandlestickChart = React62__namespace.forwardRef(
|
|
|
13564
13614
|
candleWidth
|
|
13565
13615
|
);
|
|
13566
13616
|
const yTicks = niceLinearTicks(minPrice, maxPrice, 5);
|
|
13567
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
13617
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
13568
13618
|
"svg",
|
|
13569
13619
|
{
|
|
13570
13620
|
role: "img",
|
|
@@ -13661,11 +13711,15 @@ var SparkLine = React62__namespace.forwardRef(
|
|
|
13661
13711
|
showHighlight = false,
|
|
13662
13712
|
yMin,
|
|
13663
13713
|
yMax,
|
|
13664
|
-
className
|
|
13714
|
+
className,
|
|
13715
|
+
style,
|
|
13716
|
+
onMouseMove,
|
|
13717
|
+
onMouseLeave,
|
|
13718
|
+
...rest
|
|
13665
13719
|
}, ref) => {
|
|
13666
13720
|
const [hoverState, setHoverState] = React62__namespace.useState(null);
|
|
13667
13721
|
if (data.length === 0) {
|
|
13668
|
-
return /* @__PURE__ */ React62__namespace.createElement("svg", { ref, width, height, className });
|
|
13722
|
+
return /* @__PURE__ */ React62__namespace.createElement("svg", { ...rest, ref, width, height, className, style, onMouseMove, onMouseLeave });
|
|
13669
13723
|
}
|
|
13670
13724
|
const minVal = yMin !== void 0 ? yMin : Math.min(...data);
|
|
13671
13725
|
const maxVal = yMax !== void 0 ? yMax : Math.max(...data);
|
|
@@ -13680,12 +13734,15 @@ var SparkLine = React62__namespace.forwardRef(
|
|
|
13680
13734
|
return /* @__PURE__ */ React62__namespace.createElement(
|
|
13681
13735
|
"svg",
|
|
13682
13736
|
{
|
|
13737
|
+
...rest,
|
|
13683
13738
|
ref,
|
|
13684
13739
|
width,
|
|
13685
13740
|
height,
|
|
13686
13741
|
className,
|
|
13687
13742
|
"aria-hidden": "true",
|
|
13688
|
-
style: { display: "block" }
|
|
13743
|
+
style: { display: "block", ...style },
|
|
13744
|
+
onMouseMove,
|
|
13745
|
+
onMouseLeave
|
|
13689
13746
|
},
|
|
13690
13747
|
data.map((v, i) => {
|
|
13691
13748
|
const barH = Math.max(1, (v - minVal) / range * innerH);
|
|
@@ -13741,14 +13798,15 @@ var SparkLine = React62__namespace.forwardRef(
|
|
|
13741
13798
|
return /* @__PURE__ */ React62__namespace.createElement(
|
|
13742
13799
|
"svg",
|
|
13743
13800
|
{
|
|
13801
|
+
...rest,
|
|
13744
13802
|
ref,
|
|
13745
13803
|
width,
|
|
13746
13804
|
height,
|
|
13747
13805
|
className,
|
|
13748
13806
|
"aria-hidden": "true",
|
|
13749
|
-
style: { display: "block", position: "relative" },
|
|
13750
|
-
onMouseMove: showTooltip || showHighlight ? handleMouseMove : void 0,
|
|
13751
|
-
onMouseLeave: showTooltip || showHighlight ? handleMouseLeave : void 0
|
|
13807
|
+
style: { display: "block", position: "relative", ...style },
|
|
13808
|
+
onMouseMove: utils.composeEventHandlers(onMouseMove, showTooltip || showHighlight ? handleMouseMove : void 0),
|
|
13809
|
+
onMouseLeave: utils.composeEventHandlers(onMouseLeave, showTooltip || showHighlight ? handleMouseLeave : void 0)
|
|
13752
13810
|
},
|
|
13753
13811
|
area && /* @__PURE__ */ React62__namespace.createElement("polygon", { points: areaPoints, fill: color, fillOpacity: 0.15 }),
|
|
13754
13812
|
/* @__PURE__ */ React62__namespace.createElement(
|
|
@@ -13807,7 +13865,8 @@ var RangeBar = React62__namespace.forwardRef(
|
|
|
13807
13865
|
color,
|
|
13808
13866
|
name,
|
|
13809
13867
|
radius = 3,
|
|
13810
|
-
className
|
|
13868
|
+
className,
|
|
13869
|
+
...rest
|
|
13811
13870
|
}, ref) => {
|
|
13812
13871
|
const ctx = useCartesianContext("Chart.RangeBar");
|
|
13813
13872
|
const {
|
|
@@ -13823,7 +13882,7 @@ var RangeBar = React62__namespace.forwardRef(
|
|
|
13823
13882
|
const { innerHeight: _innerHeight } = dimensions;
|
|
13824
13883
|
const seriesIndex = ctx.registerSeries(name ?? lowKey);
|
|
13825
13884
|
const resolvedColor = color ?? palette[seriesIndex % palette.length] ?? palette[0] ?? "hsl(var(--chart-1))";
|
|
13826
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className, "aria-label": name ?? `${lowKey}\u2013${highKey}` }, data.map((row, i) => {
|
|
13885
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className, "aria-label": name ?? `${lowKey}\u2013${highKey}` }, data.map((row, i) => {
|
|
13827
13886
|
const low = row[lowKey];
|
|
13828
13887
|
const high = row[highKey];
|
|
13829
13888
|
if (typeof low !== "number" || typeof high !== "number") return null;
|
|
@@ -13860,14 +13919,15 @@ var ReferenceLine = React62__namespace.forwardRef(
|
|
|
13860
13919
|
label,
|
|
13861
13920
|
stroke = "hsl(var(--chart-5, 340 75% 55%))",
|
|
13862
13921
|
strokeDasharray = "4 4",
|
|
13863
|
-
className
|
|
13922
|
+
className,
|
|
13923
|
+
...rest
|
|
13864
13924
|
}, ref) => {
|
|
13865
13925
|
const ctx = useCartesianContext("Chart.ReferenceLine");
|
|
13866
13926
|
const { dimensions, yScale, xScale } = ctx;
|
|
13867
13927
|
const { innerWidth, innerHeight } = dimensions;
|
|
13868
13928
|
if (yValue !== void 0) {
|
|
13869
13929
|
const y = yScale(yValue);
|
|
13870
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className, "aria-label": label ? `Reference: ${label}` : "Reference line" }, /* @__PURE__ */ React62__namespace.createElement(
|
|
13930
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className, "aria-label": label ? `Reference: ${label}` : "Reference line" }, /* @__PURE__ */ React62__namespace.createElement(
|
|
13871
13931
|
"line",
|
|
13872
13932
|
{
|
|
13873
13933
|
x1: 0,
|
|
@@ -13893,7 +13953,7 @@ var ReferenceLine = React62__namespace.forwardRef(
|
|
|
13893
13953
|
}
|
|
13894
13954
|
if (xValue !== void 0) {
|
|
13895
13955
|
const x = xScale(xValue);
|
|
13896
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className, "aria-label": label ? `Reference: ${label}` : "Reference line" }, /* @__PURE__ */ React62__namespace.createElement(
|
|
13956
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className, "aria-label": label ? `Reference: ${label}` : "Reference line" }, /* @__PURE__ */ React62__namespace.createElement(
|
|
13897
13957
|
"line",
|
|
13898
13958
|
{
|
|
13899
13959
|
x1: x,
|
|
@@ -13929,7 +13989,8 @@ var ReferenceArea = React62__namespace.forwardRef(
|
|
|
13929
13989
|
x2: x2Prop,
|
|
13930
13990
|
fill = "hsl(var(--chart-1))",
|
|
13931
13991
|
fillOpacity = 0.15,
|
|
13932
|
-
className
|
|
13992
|
+
className,
|
|
13993
|
+
...rest
|
|
13933
13994
|
}, ref) => {
|
|
13934
13995
|
const ctx = useCartesianContext("Chart.ReferenceArea");
|
|
13935
13996
|
const { dimensions, yScale, xScale } = ctx;
|
|
@@ -13942,7 +14003,7 @@ var ReferenceArea = React62__namespace.forwardRef(
|
|
|
13942
14003
|
const rectY = Math.min(y1, y2);
|
|
13943
14004
|
const rectW = Math.abs(x2 - x1);
|
|
13944
14005
|
const rectH = Math.abs(y2 - y1);
|
|
13945
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className, "aria-hidden": "true" }, /* @__PURE__ */ React62__namespace.createElement(
|
|
14006
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className, "aria-hidden": "true" }, /* @__PURE__ */ React62__namespace.createElement(
|
|
13946
14007
|
"rect",
|
|
13947
14008
|
{
|
|
13948
14009
|
x: rectX,
|
|
@@ -13964,8 +14025,10 @@ var RadialBarRoot = React62__namespace.forwardRef(
|
|
|
13964
14025
|
height = 400,
|
|
13965
14026
|
gap = 4,
|
|
13966
14027
|
className,
|
|
14028
|
+
style,
|
|
13967
14029
|
accessibilityLabel = "Radial bar chart",
|
|
13968
|
-
children
|
|
14030
|
+
children,
|
|
14031
|
+
...rest
|
|
13969
14032
|
}, ref) => {
|
|
13970
14033
|
const cx = width / 2;
|
|
13971
14034
|
const cy = height / 2;
|
|
@@ -13980,7 +14043,7 @@ var RadialBarRoot = React62__namespace.forwardRef(
|
|
|
13980
14043
|
palette: DEFAULT_PALETTE,
|
|
13981
14044
|
gap
|
|
13982
14045
|
},
|
|
13983
|
-
/* @__PURE__ */ React62__namespace.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
14046
|
+
/* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
13984
14047
|
"svg",
|
|
13985
14048
|
{
|
|
13986
14049
|
role: "img",
|
|
@@ -14004,7 +14067,8 @@ var RadialBar = React62__namespace.forwardRef(
|
|
|
14004
14067
|
innerRadius: innerRadiusFraction = 0.2,
|
|
14005
14068
|
outerRadius: outerRadiusFraction = 0.9,
|
|
14006
14069
|
layout = "vertical",
|
|
14007
|
-
className
|
|
14070
|
+
className,
|
|
14071
|
+
...rest
|
|
14008
14072
|
}, ref) => {
|
|
14009
14073
|
const ctx = useRadialBarContext("Chart.RadialBar");
|
|
14010
14074
|
const { data, cx, cy, maxRadius, palette, gap } = ctx;
|
|
@@ -14022,7 +14086,7 @@ var RadialBar = React62__namespace.forwardRef(
|
|
|
14022
14086
|
const barThickness = trackThickness;
|
|
14023
14087
|
const startAngle = -Math.PI / 2;
|
|
14024
14088
|
const fullAngle = 2 * Math.PI;
|
|
14025
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className }, data.map((row, i) => {
|
|
14089
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className }, data.map((row, i) => {
|
|
14026
14090
|
const value = values[i] ?? 0;
|
|
14027
14091
|
const fraction = value / maxValue;
|
|
14028
14092
|
const trackOuterR = outerR - i * (trackThickness + gap);
|
|
@@ -14102,13 +14166,15 @@ var Waterfall = React62__namespace.forwardRef(
|
|
|
14102
14166
|
height = 300,
|
|
14103
14167
|
margin: marginProp,
|
|
14104
14168
|
className,
|
|
14105
|
-
|
|
14169
|
+
style,
|
|
14170
|
+
accessibilityLabel = "Waterfall chart",
|
|
14171
|
+
...rest
|
|
14106
14172
|
}, ref) => {
|
|
14107
14173
|
const margin = { top: 20, right: 20, bottom: 40, left: 50, ...marginProp };
|
|
14108
14174
|
const innerWidth = Math.max(0, width - margin.left - margin.right);
|
|
14109
14175
|
const innerHeight = Math.max(0, height - margin.top - margin.bottom);
|
|
14110
14176
|
if (data.length === 0) {
|
|
14111
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className });
|
|
14177
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style });
|
|
14112
14178
|
}
|
|
14113
14179
|
const bars = [];
|
|
14114
14180
|
let running = 0;
|
|
@@ -14130,7 +14196,7 @@ var Waterfall = React62__namespace.forwardRef(
|
|
|
14130
14196
|
const yScale = linearScale2(yDomain, [innerHeight, 0]);
|
|
14131
14197
|
const y0 = yScale(0);
|
|
14132
14198
|
const barW = xScale.bandwidth * 0.7;
|
|
14133
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
14199
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
14134
14200
|
"svg",
|
|
14135
14201
|
{
|
|
14136
14202
|
role: "img",
|
|
@@ -14238,7 +14304,9 @@ var Sankey = React62__namespace.forwardRef(
|
|
|
14238
14304
|
nodeAlignment = "justify",
|
|
14239
14305
|
showLinkValues = false,
|
|
14240
14306
|
className,
|
|
14241
|
-
|
|
14307
|
+
style,
|
|
14308
|
+
accessibilityLabel = "Sankey diagram",
|
|
14309
|
+
...rest
|
|
14242
14310
|
}, ref) => {
|
|
14243
14311
|
const nodeMap = /* @__PURE__ */ new Map();
|
|
14244
14312
|
for (const n of nodes) {
|
|
@@ -14384,7 +14452,7 @@ var Sankey = React62__namespace.forwardRef(
|
|
|
14384
14452
|
midY: (y1 + y2) / 2
|
|
14385
14453
|
});
|
|
14386
14454
|
}
|
|
14387
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
14455
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
14388
14456
|
"svg",
|
|
14389
14457
|
{
|
|
14390
14458
|
role: "img",
|
|
@@ -14453,15 +14521,17 @@ var Pyramid = React62__namespace.forwardRef(
|
|
|
14453
14521
|
height = 300,
|
|
14454
14522
|
labelPosition: _labelPosition = "center",
|
|
14455
14523
|
className,
|
|
14524
|
+
style,
|
|
14456
14525
|
accessibilityLabel = "Pyramid chart",
|
|
14457
|
-
onSegmentClick
|
|
14526
|
+
onSegmentClick,
|
|
14527
|
+
...rest
|
|
14458
14528
|
}, ref) => {
|
|
14459
14529
|
const margin = { top: 10, right: 80, bottom: 10, left: 80 };
|
|
14460
14530
|
const innerWidth = Math.max(0, width - margin.left - margin.right);
|
|
14461
14531
|
const innerHeight = Math.max(0, height - margin.top - margin.bottom);
|
|
14462
14532
|
const reversed = [...data].reverse();
|
|
14463
14533
|
const segments = computeFunnelLayout(reversed, margin.left, margin.top, innerWidth, innerHeight, 4);
|
|
14464
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
14534
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
14465
14535
|
"svg",
|
|
14466
14536
|
{
|
|
14467
14537
|
role: "img",
|
|
@@ -14534,13 +14604,15 @@ var Gantt = React62__namespace.forwardRef(
|
|
|
14534
14604
|
height = 300,
|
|
14535
14605
|
margin: marginProp,
|
|
14536
14606
|
className,
|
|
14537
|
-
|
|
14607
|
+
style,
|
|
14608
|
+
accessibilityLabel = "Gantt chart",
|
|
14609
|
+
...rest
|
|
14538
14610
|
}, ref) => {
|
|
14539
14611
|
const margin = { top: 10, right: 20, bottom: 30, left: 120, ...marginProp };
|
|
14540
14612
|
const innerWidth = Math.max(0, width - margin.left - margin.right);
|
|
14541
14613
|
const innerHeight = Math.max(0, height - margin.top - margin.bottom);
|
|
14542
14614
|
if (tasks.length === 0) {
|
|
14543
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className });
|
|
14615
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style });
|
|
14544
14616
|
}
|
|
14545
14617
|
const timeMin = Math.min(...tasks.map((t) => t.start));
|
|
14546
14618
|
const timeMax = Math.max(...tasks.map((t) => t.end));
|
|
@@ -14550,7 +14622,7 @@ var Gantt = React62__namespace.forwardRef(
|
|
|
14550
14622
|
const rowHeight = Math.max(12, innerHeight / tasks.length - 4);
|
|
14551
14623
|
const barPad = Math.min(4, rowHeight * 0.15);
|
|
14552
14624
|
const timeTicks = niceLinearTicks(timeDomain[0], timeDomain[1], 6);
|
|
14553
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
14625
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
14554
14626
|
"svg",
|
|
14555
14627
|
{
|
|
14556
14628
|
role: "img",
|
|
@@ -14636,8 +14708,10 @@ var RadialLineRoot = React62__namespace.forwardRef(
|
|
|
14636
14708
|
width = 400,
|
|
14637
14709
|
height = 400,
|
|
14638
14710
|
className,
|
|
14711
|
+
style,
|
|
14639
14712
|
accessibilityLabel = "Radial line chart",
|
|
14640
|
-
children
|
|
14713
|
+
children,
|
|
14714
|
+
...rest
|
|
14641
14715
|
}, ref) => {
|
|
14642
14716
|
const cx = width / 2;
|
|
14643
14717
|
const cy = height / 2;
|
|
@@ -14682,13 +14756,15 @@ var RadialLineRoot = React62__namespace.forwardRef(
|
|
|
14682
14756
|
/* @__PURE__ */ React62__namespace.createElement(
|
|
14683
14757
|
"div",
|
|
14684
14758
|
{
|
|
14759
|
+
...rest,
|
|
14685
14760
|
ref,
|
|
14686
14761
|
className,
|
|
14687
14762
|
style: {
|
|
14688
14763
|
position: "relative",
|
|
14689
14764
|
display: "inline-flex",
|
|
14690
14765
|
flexDirection: isRow ? "row" : "column",
|
|
14691
|
-
alignItems: "center"
|
|
14766
|
+
alignItems: "center",
|
|
14767
|
+
...style
|
|
14692
14768
|
}
|
|
14693
14769
|
},
|
|
14694
14770
|
/* @__PURE__ */ React62__namespace.createElement(
|
|
@@ -14721,7 +14797,8 @@ var RadialLine = React62__namespace.forwardRef(
|
|
|
14721
14797
|
dot = false,
|
|
14722
14798
|
dotRadius = 3,
|
|
14723
14799
|
strokeWidth = 2,
|
|
14724
|
-
className
|
|
14800
|
+
className,
|
|
14801
|
+
...rest
|
|
14725
14802
|
}, ref) => {
|
|
14726
14803
|
const ctx = useRadialLineContext("Chart.RadialLine");
|
|
14727
14804
|
const { data, cx, cy, radius, nameKeys, palette } = ctx;
|
|
@@ -14763,7 +14840,7 @@ var RadialLine = React62__namespace.forwardRef(
|
|
|
14763
14840
|
}
|
|
14764
14841
|
areaD += " Z";
|
|
14765
14842
|
}
|
|
14766
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className, "aria-label": dataKey }, area && areaD && /* @__PURE__ */ React62__namespace.createElement(
|
|
14843
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className, "aria-label": dataKey }, area && areaD && /* @__PURE__ */ React62__namespace.createElement(
|
|
14767
14844
|
"path",
|
|
14768
14845
|
{
|
|
14769
14846
|
d: areaD,
|
|
@@ -14804,13 +14881,15 @@ var Histogram = React62__namespace.forwardRef(
|
|
|
14804
14881
|
margin: marginProp,
|
|
14805
14882
|
showGrid = true,
|
|
14806
14883
|
className,
|
|
14807
|
-
|
|
14884
|
+
style,
|
|
14885
|
+
accessibilityLabel = "Histogram",
|
|
14886
|
+
...rest
|
|
14808
14887
|
}, ref) => {
|
|
14809
14888
|
const margin = { top: 10, right: 20, bottom: 40, left: 50, ...marginProp };
|
|
14810
14889
|
const innerWidth = Math.max(0, width - margin.left - margin.right);
|
|
14811
14890
|
const innerHeight = Math.max(0, height - margin.top - margin.bottom);
|
|
14812
14891
|
if (data.length === 0) {
|
|
14813
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className });
|
|
14892
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style });
|
|
14814
14893
|
}
|
|
14815
14894
|
const minVal = Math.min(...data);
|
|
14816
14895
|
const maxVal = Math.max(...data);
|
|
@@ -14824,7 +14903,7 @@ var Histogram = React62__namespace.forwardRef(
|
|
|
14824
14903
|
const yScale = linearScale2([0, maxCount], [innerHeight, 0]);
|
|
14825
14904
|
const barW = innerWidth / binCount;
|
|
14826
14905
|
const yTicks = niceLinearTicks(0, maxCount, 5);
|
|
14827
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
14906
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
14828
14907
|
"svg",
|
|
14829
14908
|
{
|
|
14830
14909
|
role: "img",
|
|
@@ -14906,13 +14985,15 @@ var Boxplot = React62__namespace.forwardRef(
|
|
|
14906
14985
|
margin: marginProp,
|
|
14907
14986
|
orientation = "vertical",
|
|
14908
14987
|
className,
|
|
14909
|
-
|
|
14988
|
+
style,
|
|
14989
|
+
accessibilityLabel = "Box plot",
|
|
14990
|
+
...rest
|
|
14910
14991
|
}, ref) => {
|
|
14911
14992
|
const margin = { top: 20, right: 20, bottom: 40, left: 50, ...marginProp };
|
|
14912
14993
|
const innerWidth = Math.max(0, width - margin.left - margin.right);
|
|
14913
14994
|
const innerHeight = Math.max(0, height - margin.top - margin.bottom);
|
|
14914
14995
|
if (data.length === 0) {
|
|
14915
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className });
|
|
14996
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style });
|
|
14916
14997
|
}
|
|
14917
14998
|
const allVals = data.flatMap((d) => [d.min, d.q1, d.median, d.q3, d.max, ...d.outliers ?? []]);
|
|
14918
14999
|
const yMin = Math.min(...allVals);
|
|
@@ -14925,7 +15006,7 @@ var Boxplot = React62__namespace.forwardRef(
|
|
|
14925
15006
|
if (isHorizontal) {
|
|
14926
15007
|
const yBand = bandScale(names, [0, innerHeight], 0.2, 0.2);
|
|
14927
15008
|
const xValueScale = linearScale2(yDomain, [0, innerWidth]);
|
|
14928
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62__namespace.createElement("svg", { role: "img", "aria-label": accessibilityLabel, width, height, style: { display: "block" } }, /* @__PURE__ */ React62__namespace.createElement("title", null, accessibilityLabel), /* @__PURE__ */ React62__namespace.createElement("g", { transform: `translate(${margin.left},${margin.top})` }, valueTicks.map((tick) => {
|
|
15009
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62__namespace.createElement("svg", { role: "img", "aria-label": accessibilityLabel, width, height, style: { display: "block" } }, /* @__PURE__ */ React62__namespace.createElement("title", null, accessibilityLabel), /* @__PURE__ */ React62__namespace.createElement("g", { transform: `translate(${margin.left},${margin.top})` }, valueTicks.map((tick) => {
|
|
14929
15010
|
const x = xValueScale(tick);
|
|
14930
15011
|
return /* @__PURE__ */ React62__namespace.createElement("g", { key: tick, transform: `translate(${x}, 0)` }, /* @__PURE__ */ React62__namespace.createElement("line", { x1: 0, y1: 0, x2: 0, y2: innerHeight, stroke: "currentColor", strokeOpacity: 0.08 }), /* @__PURE__ */ React62__namespace.createElement("text", { x: 0, y: innerHeight + 14, textAnchor: "middle", fontSize: 10, fill: "currentColor", fillOpacity: 0.6 }, tick));
|
|
14931
15012
|
}), data.map((entry, i) => {
|
|
@@ -14942,7 +15023,7 @@ var Boxplot = React62__namespace.forwardRef(
|
|
|
14942
15023
|
}
|
|
14943
15024
|
const xBand = bandScale(names, [0, innerWidth], 0.2, 0.2);
|
|
14944
15025
|
const yScale = linearScale2(yDomain, [innerHeight, 0]);
|
|
14945
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
15026
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
14946
15027
|
"svg",
|
|
14947
15028
|
{
|
|
14948
15029
|
role: "img",
|
|
@@ -15099,8 +15180,10 @@ var Sunburst = React62__namespace.forwardRef(
|
|
|
15099
15180
|
height = 400,
|
|
15100
15181
|
innerRadius = 0,
|
|
15101
15182
|
className,
|
|
15183
|
+
style,
|
|
15102
15184
|
accessibilityLabel = "Sunburst chart",
|
|
15103
|
-
onNodeClick
|
|
15185
|
+
onNodeClick,
|
|
15186
|
+
...rest
|
|
15104
15187
|
}, ref) => {
|
|
15105
15188
|
const cx = width / 2;
|
|
15106
15189
|
const cy = height / 2;
|
|
@@ -15109,7 +15192,7 @@ var Sunburst = React62__namespace.forwardRef(
|
|
|
15109
15192
|
layoutSunburst(data, 0, 2 * Math.PI, 0, layoutNodes);
|
|
15110
15193
|
const maxD = maxDepth(data);
|
|
15111
15194
|
const ringThickness = maxD > 0 ? (outerRadius - innerRadius) / (maxD + 1) : outerRadius - innerRadius;
|
|
15112
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
15195
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
15113
15196
|
"svg",
|
|
15114
15197
|
{
|
|
15115
15198
|
role: "img",
|
|
@@ -15187,7 +15270,9 @@ var Chord = React62__namespace.forwardRef(
|
|
|
15187
15270
|
height = 500,
|
|
15188
15271
|
padAngle = 0.05,
|
|
15189
15272
|
className,
|
|
15190
|
-
|
|
15273
|
+
style,
|
|
15274
|
+
accessibilityLabel = "Chord diagram",
|
|
15275
|
+
...rest
|
|
15191
15276
|
}, ref) => {
|
|
15192
15277
|
const cx = width / 2;
|
|
15193
15278
|
const cy = height / 2;
|
|
@@ -15195,7 +15280,7 @@ var Chord = React62__namespace.forwardRef(
|
|
|
15195
15280
|
const innerRadius = outerRadius * 0.85;
|
|
15196
15281
|
const n = Math.min(data.length, labels.length);
|
|
15197
15282
|
if (n === 0) {
|
|
15198
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className });
|
|
15283
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style });
|
|
15199
15284
|
}
|
|
15200
15285
|
const palette = colors ?? DEFAULT_PALETTE;
|
|
15201
15286
|
const rowSums = data.slice(0, n).map(
|
|
@@ -15256,7 +15341,7 @@ var Chord = React62__namespace.forwardRef(
|
|
|
15256
15341
|
chordPaths.push({ path, color: group.color });
|
|
15257
15342
|
}
|
|
15258
15343
|
}
|
|
15259
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
15344
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
15260
15345
|
"svg",
|
|
15261
15346
|
{
|
|
15262
15347
|
role: "img",
|
|
@@ -15314,7 +15399,8 @@ var RangeArea = React62__namespace.forwardRef(
|
|
|
15314
15399
|
name,
|
|
15315
15400
|
fillOpacity = 0.3,
|
|
15316
15401
|
curve = "catmullRom",
|
|
15317
|
-
className
|
|
15402
|
+
className,
|
|
15403
|
+
...rest
|
|
15318
15404
|
}, ref) => {
|
|
15319
15405
|
const ctx = useCartesianContext("Chart.RangeArea");
|
|
15320
15406
|
const {
|
|
@@ -15339,7 +15425,7 @@ var RangeArea = React62__namespace.forwardRef(
|
|
|
15339
15425
|
});
|
|
15340
15426
|
if (highPoints.length === 0) return null;
|
|
15341
15427
|
const areaD = buildAreaPath(highPoints, lowPoints, curve);
|
|
15342
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className, "aria-label": name ?? `${highKey}\u2013${lowKey}` }, /* @__PURE__ */ React62__namespace.createElement(
|
|
15428
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className, "aria-label": name ?? `${highKey}\u2013${lowKey}` }, /* @__PURE__ */ React62__namespace.createElement(
|
|
15343
15429
|
"path",
|
|
15344
15430
|
{
|
|
15345
15431
|
d: areaD,
|
|
@@ -15364,7 +15450,9 @@ var LinearGauge = React62__namespace.forwardRef(
|
|
|
15364
15450
|
label,
|
|
15365
15451
|
cornerRadius = 8,
|
|
15366
15452
|
className,
|
|
15367
|
-
|
|
15453
|
+
style,
|
|
15454
|
+
accessibilityLabel,
|
|
15455
|
+
...rest
|
|
15368
15456
|
}, ref) => {
|
|
15369
15457
|
const fraction = Math.min(1, Math.max(0, (value - min) / (max - min)));
|
|
15370
15458
|
const labelPad = showLabel ? 52 : 8;
|
|
@@ -15388,7 +15476,7 @@ var LinearGauge = React62__namespace.forwardRef(
|
|
|
15388
15476
|
return `${Math.round(fraction * 100)}%`;
|
|
15389
15477
|
})();
|
|
15390
15478
|
const a11yLabel = accessibilityLabel ?? `Gauge: ${value} of ${max}`;
|
|
15391
|
-
return /* @__PURE__ */ React62__namespace.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
15479
|
+
return /* @__PURE__ */ React62__namespace.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62__namespace.createElement(
|
|
15392
15480
|
"svg",
|
|
15393
15481
|
{
|
|
15394
15482
|
role: "progressbar",
|
|
@@ -15443,11 +15531,11 @@ var LinearGauge = React62__namespace.forwardRef(
|
|
|
15443
15531
|
);
|
|
15444
15532
|
LinearGauge.displayName = "Chart.LinearGauge";
|
|
15445
15533
|
var PieCenterLabel = React62__namespace.forwardRef(
|
|
15446
|
-
({ children, className }, ref) => {
|
|
15534
|
+
({ children, className, ...rest }, ref) => {
|
|
15447
15535
|
const ctx = usePieContext("Chart.PieCenterLabel");
|
|
15448
15536
|
const { cx, cy } = ctx;
|
|
15449
15537
|
if (typeof children === "string" || typeof children === "number") {
|
|
15450
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className }, /* @__PURE__ */ React62__namespace.createElement(
|
|
15538
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className }, /* @__PURE__ */ React62__namespace.createElement(
|
|
15451
15539
|
"text",
|
|
15452
15540
|
{
|
|
15453
15541
|
x: cx,
|
|
@@ -15461,7 +15549,7 @@ var PieCenterLabel = React62__namespace.forwardRef(
|
|
|
15461
15549
|
children
|
|
15462
15550
|
));
|
|
15463
15551
|
}
|
|
15464
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className }, /* @__PURE__ */ React62__namespace.createElement(
|
|
15552
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className }, /* @__PURE__ */ React62__namespace.createElement(
|
|
15465
15553
|
"foreignObject",
|
|
15466
15554
|
{
|
|
15467
15555
|
x: cx - 50,
|
|
@@ -15493,7 +15581,8 @@ var GaugePointer = React62__namespace.forwardRef(
|
|
|
15493
15581
|
color = "currentColor",
|
|
15494
15582
|
length: lengthFraction = 0.7,
|
|
15495
15583
|
width: baseWidth = 6,
|
|
15496
|
-
className
|
|
15584
|
+
className,
|
|
15585
|
+
...rest
|
|
15497
15586
|
}, ref) => {
|
|
15498
15587
|
const ctx = useGaugeContext("Chart.GaugePointer");
|
|
15499
15588
|
const { cx, cy, outerRadius, fraction, startAngle, endAngle } = ctx;
|
|
@@ -15511,7 +15600,7 @@ var GaugePointer = React62__namespace.forwardRef(
|
|
|
15511
15600
|
const by1 = cy + halfBase * Math.sin(perpAngle);
|
|
15512
15601
|
const bx2 = cx - halfBase * Math.cos(perpAngle);
|
|
15513
15602
|
const by2 = cy - halfBase * Math.sin(perpAngle);
|
|
15514
|
-
return /* @__PURE__ */ React62__namespace.createElement("g", { ref, className }, /* @__PURE__ */ React62__namespace.createElement(
|
|
15603
|
+
return /* @__PURE__ */ React62__namespace.createElement("g", { ...rest, ref, className }, /* @__PURE__ */ React62__namespace.createElement(
|
|
15515
15604
|
"polygon",
|
|
15516
15605
|
{
|
|
15517
15606
|
points: `${fmt(bx1)},${fmt(by1)} ${fmt(bx2)},${fmt(by2)} ${fmt(tipX)},${fmt(tipY)}`,
|