@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.mjs
CHANGED
|
@@ -6473,7 +6473,7 @@ var Timeline = {
|
|
|
6473
6473
|
Content: TimelineContent
|
|
6474
6474
|
};
|
|
6475
6475
|
var ClickAwayListener = React62.forwardRef(
|
|
6476
|
-
({ children, onClickAway }, ref) => {
|
|
6476
|
+
({ children, onClickAway, style, ...rest }, ref) => {
|
|
6477
6477
|
const localRef = React62.useRef(null);
|
|
6478
6478
|
const composedRef = useComposedRefs(ref, localRef);
|
|
6479
6479
|
React62.useEffect(() => {
|
|
@@ -6491,7 +6491,7 @@ var ClickAwayListener = React62.forwardRef(
|
|
|
6491
6491
|
document.removeEventListener("touchstart", handlePointer);
|
|
6492
6492
|
};
|
|
6493
6493
|
}, [onClickAway]);
|
|
6494
|
-
return /* @__PURE__ */ React62.createElement("span", { ref: composedRef, style: { display: "contents" } }, children);
|
|
6494
|
+
return /* @__PURE__ */ React62.createElement("span", { ref: composedRef, ...rest, style: { display: "contents", ...style } }, children);
|
|
6495
6495
|
}
|
|
6496
6496
|
);
|
|
6497
6497
|
ClickAwayListener.displayName = "ClickAwayListener";
|
|
@@ -6518,7 +6518,7 @@ function parsePlacement(placement) {
|
|
|
6518
6518
|
return { side, align: align ?? "center" };
|
|
6519
6519
|
}
|
|
6520
6520
|
var Popper8 = React62.forwardRef(
|
|
6521
|
-
({ open, anchorEl: anchorElProp, placement = "bottom", children, className, style, keepMounted = false, disablePortal = false, container }, ref) => {
|
|
6521
|
+
({ open, anchorEl: anchorElProp, placement = "bottom", children, className, style, keepMounted = false, disablePortal = false, container, ...rest }, ref) => {
|
|
6522
6522
|
const virtualRef = React62.useRef({ getBoundingClientRect: () => getAnchorEl(anchorElProp)?.getBoundingClientRect() ?? new DOMRect() });
|
|
6523
6523
|
React62.useEffect(() => {
|
|
6524
6524
|
virtualRef.current.getBoundingClientRect = () => getAnchorEl(anchorElProp)?.getBoundingClientRect() ?? new DOMRect();
|
|
@@ -6532,6 +6532,7 @@ var Popper8 = React62.forwardRef(
|
|
|
6532
6532
|
side,
|
|
6533
6533
|
align,
|
|
6534
6534
|
sideOffset: 4,
|
|
6535
|
+
...rest,
|
|
6535
6536
|
style: { display: !open ? "none" : void 0, ...style },
|
|
6536
6537
|
className
|
|
6537
6538
|
},
|
|
@@ -7609,39 +7610,40 @@ var NextButton = React62.forwardRef((props, forwardedRef) => {
|
|
|
7609
7610
|
);
|
|
7610
7611
|
});
|
|
7611
7612
|
NextButton.displayName = "Calendar.NextButton";
|
|
7612
|
-
var Heading = ({
|
|
7613
|
-
format = { month: "long", year: "numeric" },
|
|
7614
|
-
locale
|
|
7615
|
-
}) => {
|
|
7613
|
+
var Heading = React62.forwardRef((props, forwardedRef) => {
|
|
7614
|
+
const { format = { month: "long", year: "numeric" }, locale, ...rest } = props;
|
|
7616
7615
|
const ctx = useCalendarContext("Calendar.Heading");
|
|
7617
|
-
return /* @__PURE__ */ React62.createElement(
|
|
7618
|
-
};
|
|
7616
|
+
return /* @__PURE__ */ React62.createElement(Primitive.span, { ...rest, ref: forwardedRef, "aria-live": "polite" }, new Intl.DateTimeFormat(locale ?? ctx.locale, format).format(ctx.displayMonth));
|
|
7617
|
+
});
|
|
7619
7618
|
Heading.displayName = "Calendar.Heading";
|
|
7620
7619
|
var Grid2 = React62.forwardRef(
|
|
7621
7620
|
(props, forwardedRef) => /* @__PURE__ */ React62.createElement("table", { role: "grid", ...props, ref: forwardedRef })
|
|
7622
7621
|
);
|
|
7623
7622
|
Grid2.displayName = "Calendar.Grid";
|
|
7624
|
-
var GridHead = (
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
|
|
7628
|
-
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
};
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7623
|
+
var GridHead = React62.forwardRef(
|
|
7624
|
+
(props, forwardedRef) => {
|
|
7625
|
+
const { locale, format = "narrow", ...rest } = props;
|
|
7626
|
+
const ctx = useCalendarContext("Calendar.GridHead");
|
|
7627
|
+
const fmt3 = new Intl.DateTimeFormat(locale ?? ctx.locale, { weekday: format });
|
|
7628
|
+
const days = Array.from({ length: 7 }, (_, i) => {
|
|
7629
|
+
const d = addDays(new Date(2024, 0, 7), i + ctx.weekStartsOn);
|
|
7630
|
+
return {
|
|
7631
|
+
label: ctx.dayOfWeekFormatter?.(d) ?? fmt3.format(d),
|
|
7632
|
+
date: d
|
|
7633
|
+
};
|
|
7634
|
+
});
|
|
7635
|
+
return /* @__PURE__ */ React62.createElement("thead", { ...rest, ref: forwardedRef }, /* @__PURE__ */ React62.createElement("tr", null, ctx.displayWeekNumber ? /* @__PURE__ */ React62.createElement("th", { scope: "col", "aria-label": "Week number" }, "#") : null, days.map((day, i) => /* @__PURE__ */ React62.createElement("th", { key: i, scope: "col", "aria-label": new Intl.DateTimeFormat(locale ?? ctx.locale, { weekday: "long" }).format(day.date) }, day.label))));
|
|
7636
|
+
}
|
|
7637
|
+
);
|
|
7639
7638
|
GridHead.displayName = "Calendar.GridHead";
|
|
7640
|
-
var GridBody = (
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7639
|
+
var GridBody = React62.forwardRef(
|
|
7640
|
+
(props, forwardedRef) => {
|
|
7641
|
+
const { children, ...rest } = props;
|
|
7642
|
+
const ctx = useCalendarContext("Calendar.GridBody");
|
|
7643
|
+
const weeks = getDaysGrid(ctx.displayMonth, ctx.weekStartsOn, ctx.fixedWeekNumber);
|
|
7644
|
+
return /* @__PURE__ */ React62.createElement("tbody", { ...rest, ref: forwardedRef }, weeks.map((week, wi) => /* @__PURE__ */ React62.createElement("tr", { key: wi }, ctx.displayWeekNumber ? /* @__PURE__ */ React62.createElement("td", { role: "gridcell", "aria-label": `Week ${getWeekNumber(week[0] ?? ctx.displayMonth)}` }, getWeekNumber(week[0] ?? ctx.displayMonth)) : null, week.map((day, di) => /* @__PURE__ */ React62.createElement("td", { key: di, role: "gridcell" }, children(day, { isOutsideMonth: !isSameMonth(day, ctx.displayMonth) }))))));
|
|
7645
|
+
}
|
|
7646
|
+
);
|
|
7645
7647
|
GridBody.displayName = "Calendar.GridBody";
|
|
7646
7648
|
function getWeekNumber(date) {
|
|
7647
7649
|
const target = startOfDay(date);
|
|
@@ -9295,10 +9297,12 @@ var List5 = React62.forwardRef(
|
|
|
9295
9297
|
(props, forwardedRef) => /* @__PURE__ */ React62.createElement(Primitive.ul, { ...props, ref: forwardedRef })
|
|
9296
9298
|
);
|
|
9297
9299
|
List5.displayName = "FileUpload.List";
|
|
9298
|
-
var Item13 = (
|
|
9299
|
-
|
|
9300
|
-
|
|
9301
|
-
};
|
|
9300
|
+
var Item13 = React62.forwardRef(
|
|
9301
|
+
({ file, children, ...rest }, forwardedRef) => {
|
|
9302
|
+
const ctx = useFileUploadContext("FileUpload.Item");
|
|
9303
|
+
return /* @__PURE__ */ React62.createElement(Primitive.li, { ...rest, "data-file-name": file.name, ref: forwardedRef }, children ?? /* @__PURE__ */ React62.createElement(React62.Fragment, null, /* @__PURE__ */ React62.createElement("span", null, file.name), " ", /* @__PURE__ */ React62.createElement("button", { type: "button", onClick: () => ctx.removeFile(file), "aria-label": `Remove ${file.name}` }, "\xD7")));
|
|
9304
|
+
}
|
|
9305
|
+
);
|
|
9302
9306
|
Item13.displayName = "FileUpload.Item";
|
|
9303
9307
|
var Trigger18 = React62.forwardRef(
|
|
9304
9308
|
(props, forwardedRef) => {
|
|
@@ -10210,11 +10214,11 @@ var Input8 = React62.forwardRef(
|
|
|
10210
10214
|
}
|
|
10211
10215
|
);
|
|
10212
10216
|
Input8.displayName = "TagsInput.Input";
|
|
10213
|
-
var Tag = ({ index, children }) => {
|
|
10217
|
+
var Tag = ({ index, children, ...rest }) => {
|
|
10214
10218
|
const ctx = useTagsInputContext("TagsInput.Tag");
|
|
10215
10219
|
const tag = ctx.tags[index];
|
|
10216
10220
|
if (tag === void 0) return null;
|
|
10217
|
-
return /* @__PURE__ */ React62.createElement(Primitive.span, { "data-tag-index": index }, children ?? /* @__PURE__ */ React62.createElement(React62.Fragment, null, tag, " ", /* @__PURE__ */ React62.createElement("button", { type: "button", onClick: () => ctx.removeTag(index), "aria-label": `Remove ${tag}` }, "\xD7")));
|
|
10221
|
+
return /* @__PURE__ */ React62.createElement(Primitive.span, { "data-tag-index": index, ...rest }, children ?? /* @__PURE__ */ React62.createElement(React62.Fragment, null, tag, " ", /* @__PURE__ */ React62.createElement("button", { type: "button", onClick: () => ctx.removeTag(index), "aria-label": `Remove ${tag}` }, "\xD7")));
|
|
10218
10222
|
};
|
|
10219
10223
|
Tag.displayName = "TagsInput.Tag";
|
|
10220
10224
|
var Items = ({ children }) => {
|
|
@@ -10340,15 +10344,16 @@ var Items2 = ({ children }) => {
|
|
|
10340
10344
|
return /* @__PURE__ */ React62.createElement(React62.Fragment, null, items.map((item, i) => children(item, i, ctx.highlighted === i)));
|
|
10341
10345
|
};
|
|
10342
10346
|
Items2.displayName = "Mentions.Items";
|
|
10343
|
-
var Item15 = ({ suggestion, index, children }) => {
|
|
10347
|
+
var Item15 = ({ suggestion, index, children, ...rest }) => {
|
|
10344
10348
|
const ctx = useMentionsContext("Mentions.Item");
|
|
10345
10349
|
return /* @__PURE__ */ React62.createElement(
|
|
10346
10350
|
Primitive.div,
|
|
10347
10351
|
{
|
|
10348
10352
|
role: "option",
|
|
10349
10353
|
"data-highlighted": ctx.highlighted === index ? "" : void 0,
|
|
10350
|
-
|
|
10351
|
-
|
|
10354
|
+
...rest,
|
|
10355
|
+
onPointerMove: composeEventHandlers(rest.onPointerMove, () => ctx.setHighlighted(index)),
|
|
10356
|
+
onClick: composeEventHandlers(rest.onClick, () => ctx.selectSuggestion(suggestion))
|
|
10352
10357
|
},
|
|
10353
10358
|
children ?? suggestion.label
|
|
10354
10359
|
);
|
|
@@ -11459,9 +11464,11 @@ var Root44 = React62.forwardRef(
|
|
|
11459
11464
|
height: heightProp = 300,
|
|
11460
11465
|
margin: marginProp,
|
|
11461
11466
|
className,
|
|
11467
|
+
style,
|
|
11462
11468
|
accessibilityLabel = "Chart",
|
|
11463
11469
|
accessibilityMode = false,
|
|
11464
|
-
children
|
|
11470
|
+
children,
|
|
11471
|
+
...rest
|
|
11465
11472
|
}, ref) => {
|
|
11466
11473
|
const containerRef = React62.useRef(null);
|
|
11467
11474
|
const composedRef = useMergedRef(ref, containerRef);
|
|
@@ -11624,8 +11631,10 @@ var Root44 = React62.forwardRef(
|
|
|
11624
11631
|
width: widthProp ? width : "100%",
|
|
11625
11632
|
display: "flex",
|
|
11626
11633
|
flexDirection: isRow ? "row" : "column",
|
|
11627
|
-
alignItems: isRow ? "center" : "stretch"
|
|
11628
|
-
|
|
11634
|
+
alignItems: isRow ? "center" : "stretch",
|
|
11635
|
+
...style
|
|
11636
|
+
},
|
|
11637
|
+
...rest
|
|
11629
11638
|
},
|
|
11630
11639
|
accessibilityMode && /* @__PURE__ */ React62.createElement(A11yPatternDefs, null),
|
|
11631
11640
|
/* @__PURE__ */ React62.createElement(
|
|
@@ -11653,13 +11662,14 @@ var Grid3 = React62.forwardRef(
|
|
|
11653
11662
|
horizontal = true,
|
|
11654
11663
|
vertical = false,
|
|
11655
11664
|
strokeDasharray = "3 3",
|
|
11656
|
-
className
|
|
11665
|
+
className,
|
|
11666
|
+
...rest
|
|
11657
11667
|
}, ref) => {
|
|
11658
11668
|
const ctx = useCartesianContext("Chart.Grid");
|
|
11659
11669
|
const { dimensions, yDomain, xDomain, isBand, xScale } = ctx;
|
|
11660
11670
|
const { innerWidth, innerHeight } = dimensions;
|
|
11661
11671
|
const yTicks = niceLinearTicks(yDomain[0], yDomain[1], 5);
|
|
11662
|
-
return /* @__PURE__ */ React62.createElement("g", {
|
|
11672
|
+
return /* @__PURE__ */ React62.createElement("g", { "aria-hidden": "true", ...rest, ref, className }, horizontal && yTicks.map((tick) => {
|
|
11663
11673
|
const y = linearScale2(yDomain, [innerHeight, 0])(tick);
|
|
11664
11674
|
return /* @__PURE__ */ React62.createElement(
|
|
11665
11675
|
"line",
|
|
@@ -11701,7 +11711,8 @@ var XAxis = React62.forwardRef(
|
|
|
11701
11711
|
tickFormatter,
|
|
11702
11712
|
hideLine = false,
|
|
11703
11713
|
hideTicks = false,
|
|
11704
|
-
className
|
|
11714
|
+
className,
|
|
11715
|
+
...rest
|
|
11705
11716
|
}, ref) => {
|
|
11706
11717
|
const ctx = useCartesianContext("Chart.XAxis");
|
|
11707
11718
|
const { dimensions, xDomain, isBand, xScale } = ctx;
|
|
@@ -11716,7 +11727,7 @@ var XAxis = React62.forwardRef(
|
|
|
11716
11727
|
if (tickFormatter) return tickFormatter(v);
|
|
11717
11728
|
return String(v);
|
|
11718
11729
|
};
|
|
11719
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, transform: `translate(0, ${innerHeight})`, className }, !hideLine && /* @__PURE__ */ React62.createElement("line", { x1: 0, y1: 0, x2: innerWidth, y2: 0, stroke: "currentColor", strokeOpacity: 0.3 }), !hideTicks && displayTicks.map((tick, i) => {
|
|
11730
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, transform: `translate(0, ${innerHeight})`, className }, !hideLine && /* @__PURE__ */ React62.createElement("line", { x1: 0, y1: 0, x2: innerWidth, y2: 0, stroke: "currentColor", strokeOpacity: 0.3 }), !hideTicks && displayTicks.map((tick, i) => {
|
|
11720
11731
|
const x = xScale(tick);
|
|
11721
11732
|
return /* @__PURE__ */ React62.createElement("g", { key: i, transform: `translate(${x}, 0)` }, /* @__PURE__ */ React62.createElement("line", { y1: 0, y2: 4, stroke: "currentColor", strokeOpacity: 0.5 }), /* @__PURE__ */ React62.createElement(
|
|
11722
11733
|
"text",
|
|
@@ -11751,7 +11762,8 @@ var YAxis = React62.forwardRef(
|
|
|
11751
11762
|
tickFormatter,
|
|
11752
11763
|
hideLine = false,
|
|
11753
11764
|
hideTicks = false,
|
|
11754
|
-
className
|
|
11765
|
+
className,
|
|
11766
|
+
...rest
|
|
11755
11767
|
}, ref) => {
|
|
11756
11768
|
const ctx = useCartesianContext("Chart.YAxis");
|
|
11757
11769
|
const { yDomain, dimensions } = ctx;
|
|
@@ -11764,7 +11776,7 @@ var YAxis = React62.forwardRef(
|
|
|
11764
11776
|
return String(v);
|
|
11765
11777
|
};
|
|
11766
11778
|
const yScale = linearScale2(yDomain, [innerHeight, 0]);
|
|
11767
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className }, !hideLine && /* @__PURE__ */ React62.createElement("line", { x1: 0, y1: 0, x2: 0, y2: innerHeight, stroke: "currentColor", strokeOpacity: 0.3 }), !hideTicks && ticks.map((tick) => {
|
|
11779
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className }, !hideLine && /* @__PURE__ */ React62.createElement("line", { x1: 0, y1: 0, x2: 0, y2: innerHeight, stroke: "currentColor", strokeOpacity: 0.3 }), !hideTicks && ticks.map((tick) => {
|
|
11768
11780
|
const y = yScale(tick);
|
|
11769
11781
|
return /* @__PURE__ */ React62.createElement("g", { key: tick, transform: `translate(0, ${y})` }, /* @__PURE__ */ React62.createElement("line", { x1: -4, y1: 0, x2: 0, y2: 0, stroke: "currentColor", strokeOpacity: 0.5 }), /* @__PURE__ */ React62.createElement(
|
|
11770
11782
|
"text",
|
|
@@ -11886,7 +11898,8 @@ var Bar = React62.forwardRef(
|
|
|
11886
11898
|
labelFormatter,
|
|
11887
11899
|
highlightScope,
|
|
11888
11900
|
onClick,
|
|
11889
|
-
className
|
|
11901
|
+
className,
|
|
11902
|
+
...rest
|
|
11890
11903
|
}, ref) => {
|
|
11891
11904
|
const ctx = useCartesianContext("Chart.Bar");
|
|
11892
11905
|
const {
|
|
@@ -11911,7 +11924,7 @@ var Bar = React62.forwardRef(
|
|
|
11911
11924
|
if (orientation === "horizontal") {
|
|
11912
11925
|
const xValueScale = linearScale2(yDomain, [0, innerWidth]);
|
|
11913
11926
|
const x0 = xValueScale(0);
|
|
11914
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className, "aria-label": name ?? dataKey }, data.map((row, i) => {
|
|
11927
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className, "aria-label": name ?? dataKey }, data.map((row, i) => {
|
|
11915
11928
|
const value = row[dataKey];
|
|
11916
11929
|
if (typeof value !== "number") return null;
|
|
11917
11930
|
const xVal = isBand ? row[xDataKey] : i;
|
|
@@ -11987,7 +12000,7 @@ var Bar = React62.forwardRef(
|
|
|
11987
12000
|
}));
|
|
11988
12001
|
}
|
|
11989
12002
|
const y0 = yScale(0);
|
|
11990
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className, "aria-label": name ?? dataKey }, data.map((row, i) => {
|
|
12003
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className, "aria-label": name ?? dataKey }, data.map((row, i) => {
|
|
11991
12004
|
const value = row[dataKey];
|
|
11992
12005
|
if (typeof value !== "number") return null;
|
|
11993
12006
|
const xVal = isBand ? row[xDataKey] : i;
|
|
@@ -12077,7 +12090,8 @@ var Line = React62.forwardRef(
|
|
|
12077
12090
|
strokeDasharray,
|
|
12078
12091
|
highlightScope,
|
|
12079
12092
|
onClick,
|
|
12080
|
-
className
|
|
12093
|
+
className,
|
|
12094
|
+
...rest
|
|
12081
12095
|
}, ref) => {
|
|
12082
12096
|
const ctx = useCartesianContext("Chart.Line");
|
|
12083
12097
|
const {
|
|
@@ -12116,7 +12130,7 @@ var Line = React62.forwardRef(
|
|
|
12116
12130
|
const validPoints = rawPoints.filter((p) => p !== null);
|
|
12117
12131
|
if (validPoints.length === 0) return null;
|
|
12118
12132
|
const lineOpacity = highlightScope && activeIndex !== null ? resolveOpacity(seriesIndex, seriesIndex, seriesIndex, activeIndex, highlightScope) : 1;
|
|
12119
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className, "aria-label": name ?? dataKey }, /* @__PURE__ */ React62.createElement(
|
|
12133
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className, "aria-label": name ?? dataKey }, /* @__PURE__ */ React62.createElement(
|
|
12120
12134
|
"path",
|
|
12121
12135
|
{
|
|
12122
12136
|
d: pathD,
|
|
@@ -12198,7 +12212,9 @@ var Area2 = React62.forwardRef(
|
|
|
12198
12212
|
connectNulls: _connectNulls = false,
|
|
12199
12213
|
highlightScope,
|
|
12200
12214
|
fillByValue = false,
|
|
12201
|
-
className
|
|
12215
|
+
className,
|
|
12216
|
+
style,
|
|
12217
|
+
...rest
|
|
12202
12218
|
}, ref) => {
|
|
12203
12219
|
const ctx = useCartesianContext("Chart.Area");
|
|
12204
12220
|
const {
|
|
@@ -12230,7 +12246,7 @@ var Area2 = React62.forwardRef(
|
|
|
12230
12246
|
const aboveColor = resolvedColor;
|
|
12231
12247
|
const belowColor = palette[2] ?? "hsl(var(--chart-3))";
|
|
12232
12248
|
const areaOpacity = highlightScope && activeIndex !== null ? resolveOpacity(seriesIndex, seriesIndex, seriesIndex, activeIndex, highlightScope) : 1;
|
|
12233
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className, "aria-label": name ?? dataKey, style: { opacity: areaOpacity, transition: "opacity 150ms ease" } }, fillByValue && /* @__PURE__ */ React62.createElement("defs", null, /* @__PURE__ */ React62.createElement("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1" }, /* @__PURE__ */ React62.createElement("stop", { offset: `${zeroY / innerHeight * 100}%`, stopColor: aboveColor, stopOpacity: fillOpacity }), /* @__PURE__ */ React62.createElement("stop", { offset: `${zeroY / innerHeight * 100}%`, stopColor: belowColor, stopOpacity: fillOpacity }))), /* @__PURE__ */ React62.createElement(
|
|
12249
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className, "aria-label": name ?? dataKey, style: { opacity: areaOpacity, transition: "opacity 150ms ease", ...style } }, fillByValue && /* @__PURE__ */ React62.createElement("defs", null, /* @__PURE__ */ React62.createElement("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1" }, /* @__PURE__ */ React62.createElement("stop", { offset: `${zeroY / innerHeight * 100}%`, stopColor: aboveColor, stopOpacity: fillOpacity }), /* @__PURE__ */ React62.createElement("stop", { offset: `${zeroY / innerHeight * 100}%`, stopColor: belowColor, stopOpacity: fillOpacity }))), /* @__PURE__ */ React62.createElement(
|
|
12234
12250
|
"path",
|
|
12235
12251
|
{
|
|
12236
12252
|
d: areaD,
|
|
@@ -12261,7 +12277,8 @@ var Scatter = React62.forwardRef(
|
|
|
12261
12277
|
markerShape = "circle",
|
|
12262
12278
|
highlightScope,
|
|
12263
12279
|
onClick,
|
|
12264
|
-
className
|
|
12280
|
+
className,
|
|
12281
|
+
...rest
|
|
12265
12282
|
}, ref) => {
|
|
12266
12283
|
const ctx = useCartesianContext("Chart.Scatter");
|
|
12267
12284
|
const {
|
|
@@ -12275,7 +12292,7 @@ var Scatter = React62.forwardRef(
|
|
|
12275
12292
|
} = ctx;
|
|
12276
12293
|
const seriesIndex = ctx.registerSeries(name ?? xKey);
|
|
12277
12294
|
const resolvedColor = color ?? palette[seriesIndex % palette.length] ?? palette[0] ?? "hsl(var(--chart-1))";
|
|
12278
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className, "aria-label": name ?? `${xKey} vs ${yKey}` }, data.map((row, i) => {
|
|
12295
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className, "aria-label": name ?? `${xKey} vs ${yKey}` }, data.map((row, i) => {
|
|
12279
12296
|
const xVal = row[xKey];
|
|
12280
12297
|
const yVal = row[yKey];
|
|
12281
12298
|
if (typeof xVal !== "number" || typeof yVal !== "number") return null;
|
|
@@ -12344,7 +12361,8 @@ var Bubble = React62.forwardRef(
|
|
|
12344
12361
|
minRadius = 4,
|
|
12345
12362
|
maxRadius = 40,
|
|
12346
12363
|
onClick,
|
|
12347
|
-
className
|
|
12364
|
+
className,
|
|
12365
|
+
...rest
|
|
12348
12366
|
}, ref) => {
|
|
12349
12367
|
const ctx = useCartesianContext("Chart.Bubble");
|
|
12350
12368
|
const {
|
|
@@ -12366,7 +12384,7 @@ var Bubble = React62.forwardRef(
|
|
|
12366
12384
|
const maxSize = Math.max(...sizeValues);
|
|
12367
12385
|
const sizeRange = maxSize - minSize || 1;
|
|
12368
12386
|
const sizeScale = (value) => minRadius + (value - minSize) / sizeRange * (maxRadius - minRadius);
|
|
12369
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className, "aria-label": name ?? `${xKey} vs ${yKey}` }, data.map((row, i) => {
|
|
12387
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className, "aria-label": name ?? `${xKey} vs ${yKey}` }, data.map((row, i) => {
|
|
12370
12388
|
const xVal = row[xKey];
|
|
12371
12389
|
const yVal = row[yKey];
|
|
12372
12390
|
const sizeVal = row[sizeKey];
|
|
@@ -12435,7 +12453,9 @@ var Tooltip = React62.forwardRef(
|
|
|
12435
12453
|
border,
|
|
12436
12454
|
borderRadius = 8,
|
|
12437
12455
|
boxShadow = "0 4px 12px rgba(0,0,0,0.15)",
|
|
12438
|
-
fontSize = 12
|
|
12456
|
+
fontSize = 12,
|
|
12457
|
+
style: styleProp,
|
|
12458
|
+
...rest
|
|
12439
12459
|
}, ref) => {
|
|
12440
12460
|
const ctx = useSharedTooltip("Chart.Tooltip");
|
|
12441
12461
|
const { tooltip } = ctx;
|
|
@@ -12447,6 +12467,7 @@ var Tooltip = React62.forwardRef(
|
|
|
12447
12467
|
return /* @__PURE__ */ React62.createElement(
|
|
12448
12468
|
"div",
|
|
12449
12469
|
{
|
|
12470
|
+
...rest,
|
|
12450
12471
|
ref,
|
|
12451
12472
|
role: "status",
|
|
12452
12473
|
"aria-live": "polite",
|
|
@@ -12462,14 +12483,16 @@ var Tooltip = React62.forwardRef(
|
|
|
12462
12483
|
top: tooltip.y,
|
|
12463
12484
|
transform: "translate(-50%, calc(-100% - 8px))",
|
|
12464
12485
|
pointerEvents: "none",
|
|
12465
|
-
zIndex: 50
|
|
12486
|
+
zIndex: 50,
|
|
12487
|
+
...styleProp
|
|
12466
12488
|
};
|
|
12467
12489
|
if (content) {
|
|
12468
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, style, className }, content(tooltip));
|
|
12490
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, style, className }, content(tooltip));
|
|
12469
12491
|
}
|
|
12470
12492
|
return /* @__PURE__ */ React62.createElement(
|
|
12471
12493
|
"div",
|
|
12472
12494
|
{
|
|
12495
|
+
...rest,
|
|
12473
12496
|
ref,
|
|
12474
12497
|
style,
|
|
12475
12498
|
className
|
|
@@ -12513,7 +12536,9 @@ var Legend = React62.forwardRef(
|
|
|
12513
12536
|
renderEntry,
|
|
12514
12537
|
iconType = "square",
|
|
12515
12538
|
iconSize = 12,
|
|
12516
|
-
className
|
|
12539
|
+
className,
|
|
12540
|
+
style,
|
|
12541
|
+
...rest
|
|
12517
12542
|
}, ref) => {
|
|
12518
12543
|
const ctx = useSharedTooltip("Chart.Legend");
|
|
12519
12544
|
const entries = ctx.legendEntries;
|
|
@@ -12565,11 +12590,12 @@ var Legend = React62.forwardRef(
|
|
|
12565
12590
|
const order = position === "top" || position === "left" ? -1 : 1;
|
|
12566
12591
|
const isVertical = position === "left" || position === "right";
|
|
12567
12592
|
if (content) {
|
|
12568
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className, style: { order }, "aria-label": "Chart legend" }, content(entries));
|
|
12593
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style: { order, ...style }, "aria-label": "Chart legend" }, content(entries));
|
|
12569
12594
|
}
|
|
12570
12595
|
return /* @__PURE__ */ React62.createElement(
|
|
12571
12596
|
"div",
|
|
12572
12597
|
{
|
|
12598
|
+
...rest,
|
|
12573
12599
|
ref,
|
|
12574
12600
|
className,
|
|
12575
12601
|
style: {
|
|
@@ -12579,7 +12605,8 @@ var Legend = React62.forwardRef(
|
|
|
12579
12605
|
gap: 12,
|
|
12580
12606
|
justifyContent: "center",
|
|
12581
12607
|
padding: isVertical ? "0 8px" : "8px 0",
|
|
12582
|
-
order
|
|
12608
|
+
order,
|
|
12609
|
+
...style
|
|
12583
12610
|
},
|
|
12584
12611
|
"aria-label": "Chart legend"
|
|
12585
12612
|
},
|
|
@@ -12596,8 +12623,10 @@ var PieRoot = React62.forwardRef(
|
|
|
12596
12623
|
width = 400,
|
|
12597
12624
|
height = 400,
|
|
12598
12625
|
className,
|
|
12626
|
+
style,
|
|
12599
12627
|
accessibilityLabel = "Pie chart",
|
|
12600
|
-
children
|
|
12628
|
+
children,
|
|
12629
|
+
...rest
|
|
12601
12630
|
}, ref) => {
|
|
12602
12631
|
const cx = width / 2;
|
|
12603
12632
|
const cy = height / 2;
|
|
@@ -12626,13 +12655,15 @@ var PieRoot = React62.forwardRef(
|
|
|
12626
12655
|
return /* @__PURE__ */ React62.createElement(SharedTooltipProvider, { tooltip, setTooltip, legendEntries }, /* @__PURE__ */ React62.createElement(PieProvider, { ...contextValue }, /* @__PURE__ */ React62.createElement(
|
|
12627
12656
|
"div",
|
|
12628
12657
|
{
|
|
12658
|
+
...rest,
|
|
12629
12659
|
ref,
|
|
12630
12660
|
className,
|
|
12631
12661
|
style: {
|
|
12632
12662
|
position: "relative",
|
|
12633
12663
|
display: "inline-flex",
|
|
12634
12664
|
flexDirection: isRow ? "row" : "column",
|
|
12635
|
-
alignItems: isRow ? "center" : "center"
|
|
12665
|
+
alignItems: isRow ? "center" : "center",
|
|
12666
|
+
...style
|
|
12636
12667
|
}
|
|
12637
12668
|
},
|
|
12638
12669
|
/* @__PURE__ */ React62.createElement(
|
|
@@ -12666,7 +12697,8 @@ var Pie = React62.forwardRef(
|
|
|
12666
12697
|
arcLabel,
|
|
12667
12698
|
arcLabelMinAngle = 5,
|
|
12668
12699
|
onClick,
|
|
12669
|
-
className
|
|
12700
|
+
className,
|
|
12701
|
+
...rest
|
|
12670
12702
|
}, ref) => {
|
|
12671
12703
|
const ctx = usePieContext("Chart.Pie");
|
|
12672
12704
|
const { data, cx, cy, palette, setTooltip } = ctx;
|
|
@@ -12694,7 +12726,7 @@ var Pie = React62.forwardRef(
|
|
|
12694
12726
|
const sliceAngleDeg = Math.abs(sliceAngle * (180 / Math.PI));
|
|
12695
12727
|
return { startAngle: sliceStart, endAngle: sliceEnd, value, name: sliceName, color: sliceColor, index: i, d, sliceAngleDeg };
|
|
12696
12728
|
});
|
|
12697
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className }, slices.map((slice) => {
|
|
12729
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className }, slices.map((slice) => {
|
|
12698
12730
|
const isHovered = hovered === slice.index;
|
|
12699
12731
|
const expandedRadius = isHovered ? radius + 6 : radius;
|
|
12700
12732
|
const expandedInner = isHovered && innerRadius > 0 ? innerRadius - 2 : innerRadius;
|
|
@@ -12785,8 +12817,10 @@ var RadarRoot = React62.forwardRef(
|
|
|
12785
12817
|
width = 400,
|
|
12786
12818
|
height = 400,
|
|
12787
12819
|
className,
|
|
12820
|
+
style,
|
|
12788
12821
|
accessibilityLabel = "Radar chart",
|
|
12789
|
-
children
|
|
12822
|
+
children,
|
|
12823
|
+
...rest
|
|
12790
12824
|
}, ref) => {
|
|
12791
12825
|
const cx = width / 2;
|
|
12792
12826
|
const cy = height / 2;
|
|
@@ -12830,13 +12864,15 @@ var RadarRoot = React62.forwardRef(
|
|
|
12830
12864
|
return /* @__PURE__ */ React62.createElement(SharedTooltipProvider, { tooltip, setTooltip, legendEntries }, /* @__PURE__ */ React62.createElement(RadarProvider, { ...contextValue }, /* @__PURE__ */ React62.createElement(
|
|
12831
12865
|
"div",
|
|
12832
12866
|
{
|
|
12867
|
+
...rest,
|
|
12833
12868
|
ref,
|
|
12834
12869
|
className,
|
|
12835
12870
|
style: {
|
|
12836
12871
|
position: "relative",
|
|
12837
12872
|
display: "inline-flex",
|
|
12838
12873
|
flexDirection: isRow ? "row" : "column",
|
|
12839
|
-
alignItems: "center"
|
|
12874
|
+
alignItems: "center",
|
|
12875
|
+
...style
|
|
12840
12876
|
}
|
|
12841
12877
|
},
|
|
12842
12878
|
/* @__PURE__ */ React62.createElement(
|
|
@@ -12857,12 +12893,12 @@ var RadarRoot = React62.forwardRef(
|
|
|
12857
12893
|
);
|
|
12858
12894
|
RadarRoot.displayName = "Chart.RadarRoot";
|
|
12859
12895
|
var PolarGrid = React62.forwardRef(
|
|
12860
|
-
({ rings = 5, shape = "sharp", className }, ref) => {
|
|
12896
|
+
({ rings = 5, shape = "sharp", className, ...rest }, ref) => {
|
|
12861
12897
|
const ctx = useRadarContext("Chart.PolarGrid");
|
|
12862
12898
|
const { cx, cy, radius, angleKeys } = ctx;
|
|
12863
12899
|
const angleStep = 2 * Math.PI / Math.max(angleKeys.length, 3);
|
|
12864
12900
|
const spokeCount = Math.max(angleKeys.length, 3);
|
|
12865
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className, "aria-hidden": "true" }, Array.from({ length: rings }, (_, i) => {
|
|
12901
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className, "aria-hidden": "true" }, Array.from({ length: rings }, (_, i) => {
|
|
12866
12902
|
const r = radius / rings * (i + 1);
|
|
12867
12903
|
if (shape === "circular") {
|
|
12868
12904
|
return /* @__PURE__ */ React62.createElement(
|
|
@@ -12915,11 +12951,11 @@ var PolarGrid = React62.forwardRef(
|
|
|
12915
12951
|
);
|
|
12916
12952
|
PolarGrid.displayName = "Chart.PolarGrid";
|
|
12917
12953
|
var PolarAngleAxis = React62.forwardRef(
|
|
12918
|
-
({ dataKey: _dataKey, className }, ref) => {
|
|
12954
|
+
({ dataKey: _dataKey, className, ...rest }, ref) => {
|
|
12919
12955
|
const ctx = useRadarContext("Chart.PolarAngleAxis");
|
|
12920
12956
|
const { cx, cy, radius, angleKeys } = ctx;
|
|
12921
12957
|
const angleStep = 2 * Math.PI / Math.max(angleKeys.length, 1);
|
|
12922
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className }, angleKeys.map((key, i) => {
|
|
12958
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className }, angleKeys.map((key, i) => {
|
|
12923
12959
|
const angle = i * angleStep - Math.PI / 2;
|
|
12924
12960
|
const labelRadius = radius + 18;
|
|
12925
12961
|
const x = Math.round((cx + labelRadius * Math.cos(angle)) * 1e4) / 1e4;
|
|
@@ -12943,7 +12979,7 @@ var PolarAngleAxis = React62.forwardRef(
|
|
|
12943
12979
|
);
|
|
12944
12980
|
PolarAngleAxis.displayName = "Chart.PolarAngleAxis";
|
|
12945
12981
|
var Radar = React62.forwardRef(
|
|
12946
|
-
({ dataKey, color, name, fillOpacity = 0.25, fillArea = true, showMark: showMarkProp = true, dot: dotAlias, className }, ref) => {
|
|
12982
|
+
({ dataKey, color, name, fillOpacity = 0.25, fillArea = true, showMark: showMarkProp = true, dot: dotAlias, className, ...rest }, ref) => {
|
|
12947
12983
|
const showMark = dotAlias !== void 0 ? dotAlias : showMarkProp;
|
|
12948
12984
|
const ctx = useRadarContext("Chart.Radar");
|
|
12949
12985
|
const { data, cx, cy, radius, angleKeys, palette } = ctx;
|
|
@@ -12960,7 +12996,7 @@ var Radar = React62.forwardRef(
|
|
|
12960
12996
|
const normalised = values.map((v) => v / maxVal);
|
|
12961
12997
|
const seriesColor = color ?? palette[0] ?? "hsl(var(--chart-1))";
|
|
12962
12998
|
const pathD = buildRadarPath(normalised, cx, cy, radius);
|
|
12963
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className, "aria-label": name ?? dataKey }, /* @__PURE__ */ React62.createElement(
|
|
12999
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className, "aria-label": name ?? dataKey }, /* @__PURE__ */ React62.createElement(
|
|
12964
13000
|
"path",
|
|
12965
13001
|
{
|
|
12966
13002
|
d: pathD,
|
|
@@ -12999,7 +13035,9 @@ var Heatmap = React62.forwardRef(
|
|
|
12999
13035
|
height = 300,
|
|
13000
13036
|
margin: marginProp,
|
|
13001
13037
|
className,
|
|
13002
|
-
|
|
13038
|
+
style,
|
|
13039
|
+
accessibilityLabel = "Heatmap",
|
|
13040
|
+
...rest
|
|
13003
13041
|
}, ref) => {
|
|
13004
13042
|
const margin = { ...DEFAULT_MARGIN, ...marginProp };
|
|
13005
13043
|
const innerWidth = Math.max(0, width - margin.left - margin.right);
|
|
@@ -13023,7 +13061,7 @@ var Heatmap = React62.forwardRef(
|
|
|
13023
13061
|
return colorRange[0];
|
|
13024
13062
|
};
|
|
13025
13063
|
const cellOpacity = (norm) => 0.1 + norm * 0.9;
|
|
13026
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62.createElement(
|
|
13064
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62.createElement(
|
|
13027
13065
|
"svg",
|
|
13028
13066
|
{
|
|
13029
13067
|
role: "img",
|
|
@@ -13084,8 +13122,10 @@ var Treemap = React62.forwardRef(
|
|
|
13084
13122
|
padding = 4,
|
|
13085
13123
|
colors,
|
|
13086
13124
|
className,
|
|
13125
|
+
style,
|
|
13087
13126
|
accessibilityLabel = "Treemap",
|
|
13088
|
-
onNodeClick
|
|
13127
|
+
onNodeClick,
|
|
13128
|
+
...rest
|
|
13089
13129
|
}, ref) => {
|
|
13090
13130
|
const palette = colors ?? DEFAULT_PALETTE;
|
|
13091
13131
|
const nodes = squarifyTreemap(data, 0, 0, width, height, padding);
|
|
@@ -13130,7 +13170,7 @@ var Treemap = React62.forwardRef(
|
|
|
13130
13170
|
node.name
|
|
13131
13171
|
), node.children?.map((child) => renderNode(child, depth + 1)));
|
|
13132
13172
|
};
|
|
13133
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62.createElement(
|
|
13173
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62.createElement(
|
|
13134
13174
|
"svg",
|
|
13135
13175
|
{
|
|
13136
13176
|
role: "img",
|
|
@@ -13188,14 +13228,16 @@ var Funnel = React62.forwardRef(
|
|
|
13188
13228
|
curve = "linear",
|
|
13189
13229
|
gap = 0,
|
|
13190
13230
|
className,
|
|
13231
|
+
style,
|
|
13191
13232
|
accessibilityLabel = "Funnel chart",
|
|
13192
|
-
onSegmentClick
|
|
13233
|
+
onSegmentClick,
|
|
13234
|
+
...rest
|
|
13193
13235
|
}, ref) => {
|
|
13194
13236
|
const margin = { top: 10, right: 80, bottom: 10, left: 80 };
|
|
13195
13237
|
const innerWidth = Math.max(0, width - margin.left - margin.right);
|
|
13196
13238
|
const innerHeight = Math.max(0, height - margin.top - margin.bottom);
|
|
13197
13239
|
const segments = computeFunnelLayout(data, margin.left, margin.top, innerWidth, innerHeight, Math.max(gap, 0));
|
|
13198
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62.createElement(
|
|
13240
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62.createElement(
|
|
13199
13241
|
"svg",
|
|
13200
13242
|
{
|
|
13201
13243
|
role: "img",
|
|
@@ -13288,7 +13330,9 @@ var Gauge = React62.forwardRef(
|
|
|
13288
13330
|
width = 200,
|
|
13289
13331
|
height = 150,
|
|
13290
13332
|
className,
|
|
13291
|
-
|
|
13333
|
+
style,
|
|
13334
|
+
accessibilityLabel,
|
|
13335
|
+
...rest
|
|
13292
13336
|
}, ref) => {
|
|
13293
13337
|
const outerRadius = Math.min(width, height * 1.3) / 2 - 4;
|
|
13294
13338
|
const gaugeData = computeGaugeArcs(
|
|
@@ -13321,7 +13365,7 @@ var Gauge = React62.forwardRef(
|
|
|
13321
13365
|
return value.toLocaleString();
|
|
13322
13366
|
})();
|
|
13323
13367
|
const a11yLabel = accessibilityLabel ?? `Gauge: ${value} out of ${max}`;
|
|
13324
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62.createElement(
|
|
13368
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62.createElement(
|
|
13325
13369
|
"svg",
|
|
13326
13370
|
{
|
|
13327
13371
|
role: "img",
|
|
@@ -13398,8 +13442,10 @@ var GaugeContainer = React62.forwardRef(
|
|
|
13398
13442
|
height = 200,
|
|
13399
13443
|
thickness = 20,
|
|
13400
13444
|
className,
|
|
13445
|
+
style,
|
|
13401
13446
|
accessibilityLabel,
|
|
13402
|
-
children
|
|
13447
|
+
children,
|
|
13448
|
+
...rest
|
|
13403
13449
|
}, ref) => {
|
|
13404
13450
|
const cx = width / 2;
|
|
13405
13451
|
const cy = height / 2;
|
|
@@ -13419,7 +13465,7 @@ var GaugeContainer = React62.forwardRef(
|
|
|
13419
13465
|
innerRadius,
|
|
13420
13466
|
fraction
|
|
13421
13467
|
};
|
|
13422
|
-
return /* @__PURE__ */ React62.createElement(GaugeProvider, { ...contextValue }, /* @__PURE__ */ React62.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62.createElement(
|
|
13468
|
+
return /* @__PURE__ */ React62.createElement(GaugeProvider, { ...contextValue }, /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62.createElement(
|
|
13423
13469
|
"svg",
|
|
13424
13470
|
{
|
|
13425
13471
|
role: "img",
|
|
@@ -13435,7 +13481,7 @@ var GaugeContainer = React62.forwardRef(
|
|
|
13435
13481
|
);
|
|
13436
13482
|
GaugeContainer.displayName = "Chart.GaugeContainer";
|
|
13437
13483
|
var GaugeValueArc = React62.forwardRef(
|
|
13438
|
-
({ color, colorStops, className }, ref) => {
|
|
13484
|
+
({ color, colorStops, className, style, ...rest }, ref) => {
|
|
13439
13485
|
const ctx = useGaugeContext("Chart.GaugeValueArc");
|
|
13440
13486
|
const { cx, cy, outerRadius, innerRadius, fraction, startAngle, endAngle } = ctx;
|
|
13441
13487
|
let fillColor = color ?? DEFAULT_PALETTE[0] ?? "hsl(var(--chart-1))";
|
|
@@ -13456,18 +13502,19 @@ var GaugeValueArc = React62.forwardRef(
|
|
|
13456
13502
|
return /* @__PURE__ */ React62.createElement(
|
|
13457
13503
|
"path",
|
|
13458
13504
|
{
|
|
13505
|
+
...rest,
|
|
13459
13506
|
ref,
|
|
13460
13507
|
d: fillPath,
|
|
13461
13508
|
fill: fillColor,
|
|
13462
13509
|
className,
|
|
13463
|
-
style: { transition: "d 400ms ease" }
|
|
13510
|
+
style: { transition: "d 400ms ease", ...style }
|
|
13464
13511
|
}
|
|
13465
13512
|
);
|
|
13466
13513
|
}
|
|
13467
13514
|
);
|
|
13468
13515
|
GaugeValueArc.displayName = "Chart.GaugeValueArc";
|
|
13469
13516
|
var GaugeReferenceArc = React62.forwardRef(
|
|
13470
|
-
({ color, className }, ref) => {
|
|
13517
|
+
({ color, className, ...rest }, ref) => {
|
|
13471
13518
|
const ctx = useGaugeContext("Chart.GaugeReferenceArc");
|
|
13472
13519
|
const { cx, cy, outerRadius, innerRadius, startAngle, endAngle } = ctx;
|
|
13473
13520
|
const toRad = (deg) => deg * Math.PI / 180;
|
|
@@ -13477,6 +13524,7 @@ var GaugeReferenceArc = React62.forwardRef(
|
|
|
13477
13524
|
return /* @__PURE__ */ React62.createElement(
|
|
13478
13525
|
"path",
|
|
13479
13526
|
{
|
|
13527
|
+
...rest,
|
|
13480
13528
|
ref,
|
|
13481
13529
|
d: trackPath,
|
|
13482
13530
|
fill: color ?? "currentColor",
|
|
@@ -13518,7 +13566,9 @@ var CandlestickChart = React62.forwardRef(
|
|
|
13518
13566
|
bullColor = "hsl(var(--chart-2, 160 60% 45%))",
|
|
13519
13567
|
bearColor = "hsl(var(--chart-5, 340 75% 55%))",
|
|
13520
13568
|
className,
|
|
13521
|
-
|
|
13569
|
+
style,
|
|
13570
|
+
accessibilityLabel = "Candlestick chart",
|
|
13571
|
+
...rest
|
|
13522
13572
|
}, ref) => {
|
|
13523
13573
|
const margin = { ...DEFAULT_MARGIN, ...marginProp };
|
|
13524
13574
|
const innerWidth = Math.max(0, width - margin.left - margin.right);
|
|
@@ -13541,7 +13591,7 @@ var CandlestickChart = React62.forwardRef(
|
|
|
13541
13591
|
candleWidth
|
|
13542
13592
|
);
|
|
13543
13593
|
const yTicks = niceLinearTicks(minPrice, maxPrice, 5);
|
|
13544
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62.createElement(
|
|
13594
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62.createElement(
|
|
13545
13595
|
"svg",
|
|
13546
13596
|
{
|
|
13547
13597
|
role: "img",
|
|
@@ -13638,11 +13688,15 @@ var SparkLine = React62.forwardRef(
|
|
|
13638
13688
|
showHighlight = false,
|
|
13639
13689
|
yMin,
|
|
13640
13690
|
yMax,
|
|
13641
|
-
className
|
|
13691
|
+
className,
|
|
13692
|
+
style,
|
|
13693
|
+
onMouseMove,
|
|
13694
|
+
onMouseLeave,
|
|
13695
|
+
...rest
|
|
13642
13696
|
}, ref) => {
|
|
13643
13697
|
const [hoverState, setHoverState] = React62.useState(null);
|
|
13644
13698
|
if (data.length === 0) {
|
|
13645
|
-
return /* @__PURE__ */ React62.createElement("svg", { ref, width, height, className });
|
|
13699
|
+
return /* @__PURE__ */ React62.createElement("svg", { ...rest, ref, width, height, className, style, onMouseMove, onMouseLeave });
|
|
13646
13700
|
}
|
|
13647
13701
|
const minVal = yMin !== void 0 ? yMin : Math.min(...data);
|
|
13648
13702
|
const maxVal = yMax !== void 0 ? yMax : Math.max(...data);
|
|
@@ -13657,12 +13711,15 @@ var SparkLine = React62.forwardRef(
|
|
|
13657
13711
|
return /* @__PURE__ */ React62.createElement(
|
|
13658
13712
|
"svg",
|
|
13659
13713
|
{
|
|
13714
|
+
...rest,
|
|
13660
13715
|
ref,
|
|
13661
13716
|
width,
|
|
13662
13717
|
height,
|
|
13663
13718
|
className,
|
|
13664
13719
|
"aria-hidden": "true",
|
|
13665
|
-
style: { display: "block" }
|
|
13720
|
+
style: { display: "block", ...style },
|
|
13721
|
+
onMouseMove,
|
|
13722
|
+
onMouseLeave
|
|
13666
13723
|
},
|
|
13667
13724
|
data.map((v, i) => {
|
|
13668
13725
|
const barH = Math.max(1, (v - minVal) / range * innerH);
|
|
@@ -13718,14 +13775,15 @@ var SparkLine = React62.forwardRef(
|
|
|
13718
13775
|
return /* @__PURE__ */ React62.createElement(
|
|
13719
13776
|
"svg",
|
|
13720
13777
|
{
|
|
13778
|
+
...rest,
|
|
13721
13779
|
ref,
|
|
13722
13780
|
width,
|
|
13723
13781
|
height,
|
|
13724
13782
|
className,
|
|
13725
13783
|
"aria-hidden": "true",
|
|
13726
|
-
style: { display: "block", position: "relative" },
|
|
13727
|
-
onMouseMove: showTooltip || showHighlight ? handleMouseMove : void 0,
|
|
13728
|
-
onMouseLeave: showTooltip || showHighlight ? handleMouseLeave : void 0
|
|
13784
|
+
style: { display: "block", position: "relative", ...style },
|
|
13785
|
+
onMouseMove: composeEventHandlers(onMouseMove, showTooltip || showHighlight ? handleMouseMove : void 0),
|
|
13786
|
+
onMouseLeave: composeEventHandlers(onMouseLeave, showTooltip || showHighlight ? handleMouseLeave : void 0)
|
|
13729
13787
|
},
|
|
13730
13788
|
area && /* @__PURE__ */ React62.createElement("polygon", { points: areaPoints, fill: color, fillOpacity: 0.15 }),
|
|
13731
13789
|
/* @__PURE__ */ React62.createElement(
|
|
@@ -13784,7 +13842,8 @@ var RangeBar = React62.forwardRef(
|
|
|
13784
13842
|
color,
|
|
13785
13843
|
name,
|
|
13786
13844
|
radius = 3,
|
|
13787
|
-
className
|
|
13845
|
+
className,
|
|
13846
|
+
...rest
|
|
13788
13847
|
}, ref) => {
|
|
13789
13848
|
const ctx = useCartesianContext("Chart.RangeBar");
|
|
13790
13849
|
const {
|
|
@@ -13800,7 +13859,7 @@ var RangeBar = React62.forwardRef(
|
|
|
13800
13859
|
const { innerHeight: _innerHeight } = dimensions;
|
|
13801
13860
|
const seriesIndex = ctx.registerSeries(name ?? lowKey);
|
|
13802
13861
|
const resolvedColor = color ?? palette[seriesIndex % palette.length] ?? palette[0] ?? "hsl(var(--chart-1))";
|
|
13803
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className, "aria-label": name ?? `${lowKey}\u2013${highKey}` }, data.map((row, i) => {
|
|
13862
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className, "aria-label": name ?? `${lowKey}\u2013${highKey}` }, data.map((row, i) => {
|
|
13804
13863
|
const low = row[lowKey];
|
|
13805
13864
|
const high = row[highKey];
|
|
13806
13865
|
if (typeof low !== "number" || typeof high !== "number") return null;
|
|
@@ -13837,14 +13896,15 @@ var ReferenceLine = React62.forwardRef(
|
|
|
13837
13896
|
label,
|
|
13838
13897
|
stroke = "hsl(var(--chart-5, 340 75% 55%))",
|
|
13839
13898
|
strokeDasharray = "4 4",
|
|
13840
|
-
className
|
|
13899
|
+
className,
|
|
13900
|
+
...rest
|
|
13841
13901
|
}, ref) => {
|
|
13842
13902
|
const ctx = useCartesianContext("Chart.ReferenceLine");
|
|
13843
13903
|
const { dimensions, yScale, xScale } = ctx;
|
|
13844
13904
|
const { innerWidth, innerHeight } = dimensions;
|
|
13845
13905
|
if (yValue !== void 0) {
|
|
13846
13906
|
const y = yScale(yValue);
|
|
13847
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className, "aria-label": label ? `Reference: ${label}` : "Reference line" }, /* @__PURE__ */ React62.createElement(
|
|
13907
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className, "aria-label": label ? `Reference: ${label}` : "Reference line" }, /* @__PURE__ */ React62.createElement(
|
|
13848
13908
|
"line",
|
|
13849
13909
|
{
|
|
13850
13910
|
x1: 0,
|
|
@@ -13870,7 +13930,7 @@ var ReferenceLine = React62.forwardRef(
|
|
|
13870
13930
|
}
|
|
13871
13931
|
if (xValue !== void 0) {
|
|
13872
13932
|
const x = xScale(xValue);
|
|
13873
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className, "aria-label": label ? `Reference: ${label}` : "Reference line" }, /* @__PURE__ */ React62.createElement(
|
|
13933
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className, "aria-label": label ? `Reference: ${label}` : "Reference line" }, /* @__PURE__ */ React62.createElement(
|
|
13874
13934
|
"line",
|
|
13875
13935
|
{
|
|
13876
13936
|
x1: x,
|
|
@@ -13906,7 +13966,8 @@ var ReferenceArea = React62.forwardRef(
|
|
|
13906
13966
|
x2: x2Prop,
|
|
13907
13967
|
fill = "hsl(var(--chart-1))",
|
|
13908
13968
|
fillOpacity = 0.15,
|
|
13909
|
-
className
|
|
13969
|
+
className,
|
|
13970
|
+
...rest
|
|
13910
13971
|
}, ref) => {
|
|
13911
13972
|
const ctx = useCartesianContext("Chart.ReferenceArea");
|
|
13912
13973
|
const { dimensions, yScale, xScale } = ctx;
|
|
@@ -13919,7 +13980,7 @@ var ReferenceArea = React62.forwardRef(
|
|
|
13919
13980
|
const rectY = Math.min(y1, y2);
|
|
13920
13981
|
const rectW = Math.abs(x2 - x1);
|
|
13921
13982
|
const rectH = Math.abs(y2 - y1);
|
|
13922
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className, "aria-hidden": "true" }, /* @__PURE__ */ React62.createElement(
|
|
13983
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className, "aria-hidden": "true" }, /* @__PURE__ */ React62.createElement(
|
|
13923
13984
|
"rect",
|
|
13924
13985
|
{
|
|
13925
13986
|
x: rectX,
|
|
@@ -13941,8 +14002,10 @@ var RadialBarRoot = React62.forwardRef(
|
|
|
13941
14002
|
height = 400,
|
|
13942
14003
|
gap = 4,
|
|
13943
14004
|
className,
|
|
14005
|
+
style,
|
|
13944
14006
|
accessibilityLabel = "Radial bar chart",
|
|
13945
|
-
children
|
|
14007
|
+
children,
|
|
14008
|
+
...rest
|
|
13946
14009
|
}, ref) => {
|
|
13947
14010
|
const cx = width / 2;
|
|
13948
14011
|
const cy = height / 2;
|
|
@@ -13957,7 +14020,7 @@ var RadialBarRoot = React62.forwardRef(
|
|
|
13957
14020
|
palette: DEFAULT_PALETTE,
|
|
13958
14021
|
gap
|
|
13959
14022
|
},
|
|
13960
|
-
/* @__PURE__ */ React62.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62.createElement(
|
|
14023
|
+
/* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62.createElement(
|
|
13961
14024
|
"svg",
|
|
13962
14025
|
{
|
|
13963
14026
|
role: "img",
|
|
@@ -13981,7 +14044,8 @@ var RadialBar = React62.forwardRef(
|
|
|
13981
14044
|
innerRadius: innerRadiusFraction = 0.2,
|
|
13982
14045
|
outerRadius: outerRadiusFraction = 0.9,
|
|
13983
14046
|
layout = "vertical",
|
|
13984
|
-
className
|
|
14047
|
+
className,
|
|
14048
|
+
...rest
|
|
13985
14049
|
}, ref) => {
|
|
13986
14050
|
const ctx = useRadialBarContext("Chart.RadialBar");
|
|
13987
14051
|
const { data, cx, cy, maxRadius, palette, gap } = ctx;
|
|
@@ -13999,7 +14063,7 @@ var RadialBar = React62.forwardRef(
|
|
|
13999
14063
|
const barThickness = trackThickness;
|
|
14000
14064
|
const startAngle = -Math.PI / 2;
|
|
14001
14065
|
const fullAngle = 2 * Math.PI;
|
|
14002
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className }, data.map((row, i) => {
|
|
14066
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className }, data.map((row, i) => {
|
|
14003
14067
|
const value = values[i] ?? 0;
|
|
14004
14068
|
const fraction = value / maxValue;
|
|
14005
14069
|
const trackOuterR = outerR - i * (trackThickness + gap);
|
|
@@ -14079,13 +14143,15 @@ var Waterfall = React62.forwardRef(
|
|
|
14079
14143
|
height = 300,
|
|
14080
14144
|
margin: marginProp,
|
|
14081
14145
|
className,
|
|
14082
|
-
|
|
14146
|
+
style,
|
|
14147
|
+
accessibilityLabel = "Waterfall chart",
|
|
14148
|
+
...rest
|
|
14083
14149
|
}, ref) => {
|
|
14084
14150
|
const margin = { top: 20, right: 20, bottom: 40, left: 50, ...marginProp };
|
|
14085
14151
|
const innerWidth = Math.max(0, width - margin.left - margin.right);
|
|
14086
14152
|
const innerHeight = Math.max(0, height - margin.top - margin.bottom);
|
|
14087
14153
|
if (data.length === 0) {
|
|
14088
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className });
|
|
14154
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style });
|
|
14089
14155
|
}
|
|
14090
14156
|
const bars = [];
|
|
14091
14157
|
let running = 0;
|
|
@@ -14107,7 +14173,7 @@ var Waterfall = React62.forwardRef(
|
|
|
14107
14173
|
const yScale = linearScale2(yDomain, [innerHeight, 0]);
|
|
14108
14174
|
const y0 = yScale(0);
|
|
14109
14175
|
const barW = xScale.bandwidth * 0.7;
|
|
14110
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62.createElement(
|
|
14176
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62.createElement(
|
|
14111
14177
|
"svg",
|
|
14112
14178
|
{
|
|
14113
14179
|
role: "img",
|
|
@@ -14215,7 +14281,9 @@ var Sankey = React62.forwardRef(
|
|
|
14215
14281
|
nodeAlignment = "justify",
|
|
14216
14282
|
showLinkValues = false,
|
|
14217
14283
|
className,
|
|
14218
|
-
|
|
14284
|
+
style,
|
|
14285
|
+
accessibilityLabel = "Sankey diagram",
|
|
14286
|
+
...rest
|
|
14219
14287
|
}, ref) => {
|
|
14220
14288
|
const nodeMap = /* @__PURE__ */ new Map();
|
|
14221
14289
|
for (const n of nodes) {
|
|
@@ -14361,7 +14429,7 @@ var Sankey = React62.forwardRef(
|
|
|
14361
14429
|
midY: (y1 + y2) / 2
|
|
14362
14430
|
});
|
|
14363
14431
|
}
|
|
14364
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62.createElement(
|
|
14432
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62.createElement(
|
|
14365
14433
|
"svg",
|
|
14366
14434
|
{
|
|
14367
14435
|
role: "img",
|
|
@@ -14430,15 +14498,17 @@ var Pyramid = React62.forwardRef(
|
|
|
14430
14498
|
height = 300,
|
|
14431
14499
|
labelPosition: _labelPosition = "center",
|
|
14432
14500
|
className,
|
|
14501
|
+
style,
|
|
14433
14502
|
accessibilityLabel = "Pyramid chart",
|
|
14434
|
-
onSegmentClick
|
|
14503
|
+
onSegmentClick,
|
|
14504
|
+
...rest
|
|
14435
14505
|
}, ref) => {
|
|
14436
14506
|
const margin = { top: 10, right: 80, bottom: 10, left: 80 };
|
|
14437
14507
|
const innerWidth = Math.max(0, width - margin.left - margin.right);
|
|
14438
14508
|
const innerHeight = Math.max(0, height - margin.top - margin.bottom);
|
|
14439
14509
|
const reversed = [...data].reverse();
|
|
14440
14510
|
const segments = computeFunnelLayout(reversed, margin.left, margin.top, innerWidth, innerHeight, 4);
|
|
14441
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62.createElement(
|
|
14511
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62.createElement(
|
|
14442
14512
|
"svg",
|
|
14443
14513
|
{
|
|
14444
14514
|
role: "img",
|
|
@@ -14511,13 +14581,15 @@ var Gantt = React62.forwardRef(
|
|
|
14511
14581
|
height = 300,
|
|
14512
14582
|
margin: marginProp,
|
|
14513
14583
|
className,
|
|
14514
|
-
|
|
14584
|
+
style,
|
|
14585
|
+
accessibilityLabel = "Gantt chart",
|
|
14586
|
+
...rest
|
|
14515
14587
|
}, ref) => {
|
|
14516
14588
|
const margin = { top: 10, right: 20, bottom: 30, left: 120, ...marginProp };
|
|
14517
14589
|
const innerWidth = Math.max(0, width - margin.left - margin.right);
|
|
14518
14590
|
const innerHeight = Math.max(0, height - margin.top - margin.bottom);
|
|
14519
14591
|
if (tasks.length === 0) {
|
|
14520
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className });
|
|
14592
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style });
|
|
14521
14593
|
}
|
|
14522
14594
|
const timeMin = Math.min(...tasks.map((t) => t.start));
|
|
14523
14595
|
const timeMax = Math.max(...tasks.map((t) => t.end));
|
|
@@ -14527,7 +14599,7 @@ var Gantt = React62.forwardRef(
|
|
|
14527
14599
|
const rowHeight = Math.max(12, innerHeight / tasks.length - 4);
|
|
14528
14600
|
const barPad = Math.min(4, rowHeight * 0.15);
|
|
14529
14601
|
const timeTicks = niceLinearTicks(timeDomain[0], timeDomain[1], 6);
|
|
14530
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62.createElement(
|
|
14602
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62.createElement(
|
|
14531
14603
|
"svg",
|
|
14532
14604
|
{
|
|
14533
14605
|
role: "img",
|
|
@@ -14613,8 +14685,10 @@ var RadialLineRoot = React62.forwardRef(
|
|
|
14613
14685
|
width = 400,
|
|
14614
14686
|
height = 400,
|
|
14615
14687
|
className,
|
|
14688
|
+
style,
|
|
14616
14689
|
accessibilityLabel = "Radial line chart",
|
|
14617
|
-
children
|
|
14690
|
+
children,
|
|
14691
|
+
...rest
|
|
14618
14692
|
}, ref) => {
|
|
14619
14693
|
const cx = width / 2;
|
|
14620
14694
|
const cy = height / 2;
|
|
@@ -14659,13 +14733,15 @@ var RadialLineRoot = React62.forwardRef(
|
|
|
14659
14733
|
/* @__PURE__ */ React62.createElement(
|
|
14660
14734
|
"div",
|
|
14661
14735
|
{
|
|
14736
|
+
...rest,
|
|
14662
14737
|
ref,
|
|
14663
14738
|
className,
|
|
14664
14739
|
style: {
|
|
14665
14740
|
position: "relative",
|
|
14666
14741
|
display: "inline-flex",
|
|
14667
14742
|
flexDirection: isRow ? "row" : "column",
|
|
14668
|
-
alignItems: "center"
|
|
14743
|
+
alignItems: "center",
|
|
14744
|
+
...style
|
|
14669
14745
|
}
|
|
14670
14746
|
},
|
|
14671
14747
|
/* @__PURE__ */ React62.createElement(
|
|
@@ -14698,7 +14774,8 @@ var RadialLine = React62.forwardRef(
|
|
|
14698
14774
|
dot = false,
|
|
14699
14775
|
dotRadius = 3,
|
|
14700
14776
|
strokeWidth = 2,
|
|
14701
|
-
className
|
|
14777
|
+
className,
|
|
14778
|
+
...rest
|
|
14702
14779
|
}, ref) => {
|
|
14703
14780
|
const ctx = useRadialLineContext("Chart.RadialLine");
|
|
14704
14781
|
const { data, cx, cy, radius, nameKeys, palette } = ctx;
|
|
@@ -14740,7 +14817,7 @@ var RadialLine = React62.forwardRef(
|
|
|
14740
14817
|
}
|
|
14741
14818
|
areaD += " Z";
|
|
14742
14819
|
}
|
|
14743
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className, "aria-label": dataKey }, area && areaD && /* @__PURE__ */ React62.createElement(
|
|
14820
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className, "aria-label": dataKey }, area && areaD && /* @__PURE__ */ React62.createElement(
|
|
14744
14821
|
"path",
|
|
14745
14822
|
{
|
|
14746
14823
|
d: areaD,
|
|
@@ -14781,13 +14858,15 @@ var Histogram = React62.forwardRef(
|
|
|
14781
14858
|
margin: marginProp,
|
|
14782
14859
|
showGrid = true,
|
|
14783
14860
|
className,
|
|
14784
|
-
|
|
14861
|
+
style,
|
|
14862
|
+
accessibilityLabel = "Histogram",
|
|
14863
|
+
...rest
|
|
14785
14864
|
}, ref) => {
|
|
14786
14865
|
const margin = { top: 10, right: 20, bottom: 40, left: 50, ...marginProp };
|
|
14787
14866
|
const innerWidth = Math.max(0, width - margin.left - margin.right);
|
|
14788
14867
|
const innerHeight = Math.max(0, height - margin.top - margin.bottom);
|
|
14789
14868
|
if (data.length === 0) {
|
|
14790
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className });
|
|
14869
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style });
|
|
14791
14870
|
}
|
|
14792
14871
|
const minVal = Math.min(...data);
|
|
14793
14872
|
const maxVal = Math.max(...data);
|
|
@@ -14801,7 +14880,7 @@ var Histogram = React62.forwardRef(
|
|
|
14801
14880
|
const yScale = linearScale2([0, maxCount], [innerHeight, 0]);
|
|
14802
14881
|
const barW = innerWidth / binCount;
|
|
14803
14882
|
const yTicks = niceLinearTicks(0, maxCount, 5);
|
|
14804
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62.createElement(
|
|
14883
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62.createElement(
|
|
14805
14884
|
"svg",
|
|
14806
14885
|
{
|
|
14807
14886
|
role: "img",
|
|
@@ -14883,13 +14962,15 @@ var Boxplot = React62.forwardRef(
|
|
|
14883
14962
|
margin: marginProp,
|
|
14884
14963
|
orientation = "vertical",
|
|
14885
14964
|
className,
|
|
14886
|
-
|
|
14965
|
+
style,
|
|
14966
|
+
accessibilityLabel = "Box plot",
|
|
14967
|
+
...rest
|
|
14887
14968
|
}, ref) => {
|
|
14888
14969
|
const margin = { top: 20, right: 20, bottom: 40, left: 50, ...marginProp };
|
|
14889
14970
|
const innerWidth = Math.max(0, width - margin.left - margin.right);
|
|
14890
14971
|
const innerHeight = Math.max(0, height - margin.top - margin.bottom);
|
|
14891
14972
|
if (data.length === 0) {
|
|
14892
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className });
|
|
14973
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style });
|
|
14893
14974
|
}
|
|
14894
14975
|
const allVals = data.flatMap((d) => [d.min, d.q1, d.median, d.q3, d.max, ...d.outliers ?? []]);
|
|
14895
14976
|
const yMin = Math.min(...allVals);
|
|
@@ -14902,7 +14983,7 @@ var Boxplot = React62.forwardRef(
|
|
|
14902
14983
|
if (isHorizontal) {
|
|
14903
14984
|
const yBand = bandScale(names, [0, innerHeight], 0.2, 0.2);
|
|
14904
14985
|
const xValueScale = linearScale2(yDomain, [0, innerWidth]);
|
|
14905
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62.createElement("svg", { role: "img", "aria-label": accessibilityLabel, width, height, style: { display: "block" } }, /* @__PURE__ */ React62.createElement("title", null, accessibilityLabel), /* @__PURE__ */ React62.createElement("g", { transform: `translate(${margin.left},${margin.top})` }, valueTicks.map((tick) => {
|
|
14986
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62.createElement("svg", { role: "img", "aria-label": accessibilityLabel, width, height, style: { display: "block" } }, /* @__PURE__ */ React62.createElement("title", null, accessibilityLabel), /* @__PURE__ */ React62.createElement("g", { transform: `translate(${margin.left},${margin.top})` }, valueTicks.map((tick) => {
|
|
14906
14987
|
const x = xValueScale(tick);
|
|
14907
14988
|
return /* @__PURE__ */ React62.createElement("g", { key: tick, transform: `translate(${x}, 0)` }, /* @__PURE__ */ React62.createElement("line", { x1: 0, y1: 0, x2: 0, y2: innerHeight, stroke: "currentColor", strokeOpacity: 0.08 }), /* @__PURE__ */ React62.createElement("text", { x: 0, y: innerHeight + 14, textAnchor: "middle", fontSize: 10, fill: "currentColor", fillOpacity: 0.6 }, tick));
|
|
14908
14989
|
}), data.map((entry, i) => {
|
|
@@ -14919,7 +15000,7 @@ var Boxplot = React62.forwardRef(
|
|
|
14919
15000
|
}
|
|
14920
15001
|
const xBand = bandScale(names, [0, innerWidth], 0.2, 0.2);
|
|
14921
15002
|
const yScale = linearScale2(yDomain, [innerHeight, 0]);
|
|
14922
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62.createElement(
|
|
15003
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62.createElement(
|
|
14923
15004
|
"svg",
|
|
14924
15005
|
{
|
|
14925
15006
|
role: "img",
|
|
@@ -15076,8 +15157,10 @@ var Sunburst = React62.forwardRef(
|
|
|
15076
15157
|
height = 400,
|
|
15077
15158
|
innerRadius = 0,
|
|
15078
15159
|
className,
|
|
15160
|
+
style,
|
|
15079
15161
|
accessibilityLabel = "Sunburst chart",
|
|
15080
|
-
onNodeClick
|
|
15162
|
+
onNodeClick,
|
|
15163
|
+
...rest
|
|
15081
15164
|
}, ref) => {
|
|
15082
15165
|
const cx = width / 2;
|
|
15083
15166
|
const cy = height / 2;
|
|
@@ -15086,7 +15169,7 @@ var Sunburst = React62.forwardRef(
|
|
|
15086
15169
|
layoutSunburst(data, 0, 2 * Math.PI, 0, layoutNodes);
|
|
15087
15170
|
const maxD = maxDepth(data);
|
|
15088
15171
|
const ringThickness = maxD > 0 ? (outerRadius - innerRadius) / (maxD + 1) : outerRadius - innerRadius;
|
|
15089
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62.createElement(
|
|
15172
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62.createElement(
|
|
15090
15173
|
"svg",
|
|
15091
15174
|
{
|
|
15092
15175
|
role: "img",
|
|
@@ -15164,7 +15247,9 @@ var Chord = React62.forwardRef(
|
|
|
15164
15247
|
height = 500,
|
|
15165
15248
|
padAngle = 0.05,
|
|
15166
15249
|
className,
|
|
15167
|
-
|
|
15250
|
+
style,
|
|
15251
|
+
accessibilityLabel = "Chord diagram",
|
|
15252
|
+
...rest
|
|
15168
15253
|
}, ref) => {
|
|
15169
15254
|
const cx = width / 2;
|
|
15170
15255
|
const cy = height / 2;
|
|
@@ -15172,7 +15257,7 @@ var Chord = React62.forwardRef(
|
|
|
15172
15257
|
const innerRadius = outerRadius * 0.85;
|
|
15173
15258
|
const n = Math.min(data.length, labels.length);
|
|
15174
15259
|
if (n === 0) {
|
|
15175
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className });
|
|
15260
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style });
|
|
15176
15261
|
}
|
|
15177
15262
|
const palette = colors ?? DEFAULT_PALETTE;
|
|
15178
15263
|
const rowSums = data.slice(0, n).map(
|
|
@@ -15233,7 +15318,7 @@ var Chord = React62.forwardRef(
|
|
|
15233
15318
|
chordPaths.push({ path, color: group.color });
|
|
15234
15319
|
}
|
|
15235
15320
|
}
|
|
15236
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62.createElement(
|
|
15321
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62.createElement(
|
|
15237
15322
|
"svg",
|
|
15238
15323
|
{
|
|
15239
15324
|
role: "img",
|
|
@@ -15291,7 +15376,8 @@ var RangeArea = React62.forwardRef(
|
|
|
15291
15376
|
name,
|
|
15292
15377
|
fillOpacity = 0.3,
|
|
15293
15378
|
curve = "catmullRom",
|
|
15294
|
-
className
|
|
15379
|
+
className,
|
|
15380
|
+
...rest
|
|
15295
15381
|
}, ref) => {
|
|
15296
15382
|
const ctx = useCartesianContext("Chart.RangeArea");
|
|
15297
15383
|
const {
|
|
@@ -15316,7 +15402,7 @@ var RangeArea = React62.forwardRef(
|
|
|
15316
15402
|
});
|
|
15317
15403
|
if (highPoints.length === 0) return null;
|
|
15318
15404
|
const areaD = buildAreaPath(highPoints, lowPoints, curve);
|
|
15319
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className, "aria-label": name ?? `${highKey}\u2013${lowKey}` }, /* @__PURE__ */ React62.createElement(
|
|
15405
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className, "aria-label": name ?? `${highKey}\u2013${lowKey}` }, /* @__PURE__ */ React62.createElement(
|
|
15320
15406
|
"path",
|
|
15321
15407
|
{
|
|
15322
15408
|
d: areaD,
|
|
@@ -15341,7 +15427,9 @@ var LinearGauge = React62.forwardRef(
|
|
|
15341
15427
|
label,
|
|
15342
15428
|
cornerRadius = 8,
|
|
15343
15429
|
className,
|
|
15344
|
-
|
|
15430
|
+
style,
|
|
15431
|
+
accessibilityLabel,
|
|
15432
|
+
...rest
|
|
15345
15433
|
}, ref) => {
|
|
15346
15434
|
const fraction = Math.min(1, Math.max(0, (value - min) / (max - min)));
|
|
15347
15435
|
const labelPad = showLabel ? 52 : 8;
|
|
@@ -15365,7 +15453,7 @@ var LinearGauge = React62.forwardRef(
|
|
|
15365
15453
|
return `${Math.round(fraction * 100)}%`;
|
|
15366
15454
|
})();
|
|
15367
15455
|
const a11yLabel = accessibilityLabel ?? `Gauge: ${value} of ${max}`;
|
|
15368
|
-
return /* @__PURE__ */ React62.createElement("div", { ref, className, style: { display: "inline-block" } }, /* @__PURE__ */ React62.createElement(
|
|
15456
|
+
return /* @__PURE__ */ React62.createElement("div", { ...rest, ref, className, style: { display: "inline-block", ...style } }, /* @__PURE__ */ React62.createElement(
|
|
15369
15457
|
"svg",
|
|
15370
15458
|
{
|
|
15371
15459
|
role: "progressbar",
|
|
@@ -15420,11 +15508,11 @@ var LinearGauge = React62.forwardRef(
|
|
|
15420
15508
|
);
|
|
15421
15509
|
LinearGauge.displayName = "Chart.LinearGauge";
|
|
15422
15510
|
var PieCenterLabel = React62.forwardRef(
|
|
15423
|
-
({ children, className }, ref) => {
|
|
15511
|
+
({ children, className, ...rest }, ref) => {
|
|
15424
15512
|
const ctx = usePieContext("Chart.PieCenterLabel");
|
|
15425
15513
|
const { cx, cy } = ctx;
|
|
15426
15514
|
if (typeof children === "string" || typeof children === "number") {
|
|
15427
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className }, /* @__PURE__ */ React62.createElement(
|
|
15515
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className }, /* @__PURE__ */ React62.createElement(
|
|
15428
15516
|
"text",
|
|
15429
15517
|
{
|
|
15430
15518
|
x: cx,
|
|
@@ -15438,7 +15526,7 @@ var PieCenterLabel = React62.forwardRef(
|
|
|
15438
15526
|
children
|
|
15439
15527
|
));
|
|
15440
15528
|
}
|
|
15441
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className }, /* @__PURE__ */ React62.createElement(
|
|
15529
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className }, /* @__PURE__ */ React62.createElement(
|
|
15442
15530
|
"foreignObject",
|
|
15443
15531
|
{
|
|
15444
15532
|
x: cx - 50,
|
|
@@ -15470,7 +15558,8 @@ var GaugePointer = React62.forwardRef(
|
|
|
15470
15558
|
color = "currentColor",
|
|
15471
15559
|
length: lengthFraction = 0.7,
|
|
15472
15560
|
width: baseWidth = 6,
|
|
15473
|
-
className
|
|
15561
|
+
className,
|
|
15562
|
+
...rest
|
|
15474
15563
|
}, ref) => {
|
|
15475
15564
|
const ctx = useGaugeContext("Chart.GaugePointer");
|
|
15476
15565
|
const { cx, cy, outerRadius, fraction, startAngle, endAngle } = ctx;
|
|
@@ -15488,7 +15577,7 @@ var GaugePointer = React62.forwardRef(
|
|
|
15488
15577
|
const by1 = cy + halfBase * Math.sin(perpAngle);
|
|
15489
15578
|
const bx2 = cx - halfBase * Math.cos(perpAngle);
|
|
15490
15579
|
const by2 = cy - halfBase * Math.sin(perpAngle);
|
|
15491
|
-
return /* @__PURE__ */ React62.createElement("g", { ref, className }, /* @__PURE__ */ React62.createElement(
|
|
15580
|
+
return /* @__PURE__ */ React62.createElement("g", { ...rest, ref, className }, /* @__PURE__ */ React62.createElement(
|
|
15492
15581
|
"polygon",
|
|
15493
15582
|
{
|
|
15494
15583
|
points: `${fmt(bx1)},${fmt(by1)} ${fmt(bx2)},${fmt(by2)} ${fmt(tipX)},${fmt(tipY)}`,
|