@sia.soul/sia-react-ui 0.1.23 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Select-BoVx-D0D.d.ts → Select-O_yY51vc.d.ts} +4 -2
- package/dist/{Select-BO3VyE2n.d.cts → Select-W_xpkpOW.d.cts} +4 -2
- package/dist/chart.cjs +1401 -1160
- package/dist/chart.css +21 -0
- package/dist/chart.js +4 -4
- package/dist/{chunk-KLI65JVD.js → chunk-27ZYAKII.js} +68 -186
- package/dist/{chunk-TZGUBGA4.js → chunk-IYNS423D.js} +4 -3
- package/dist/{chunk-GM47DAAN.js → chunk-IYO2JSGQ.js} +8 -7
- package/dist/{chunk-QJ4OQNQ4.js → chunk-PXHBIRQW.js} +4 -3
- package/dist/{chunk-VX2JECOU.js → chunk-QCBKT5FV.js} +20 -16
- package/dist/chunk-RAO3JHDL.js +284 -0
- package/dist/{chunk-RWGSZW32.js → chunk-RWODH2LW.js} +7 -6
- package/dist/{chunk-OKP4DIQH.js → chunk-TZROBD65.js} +29 -26
- package/dist/{chunk-NPB33IXJ.js → chunk-W52CNNWW.js} +349 -278
- package/dist/{chunk-YT6E3X2K.js → chunk-YQDHCORW.js} +4 -3
- package/dist/{core-Cqgl6Z7h.d.ts → core-BOzLwiXG.d.ts} +44 -5
- package/dist/{core-DF0pknX6.d.cts → core-tbb9ZiBY.d.cts} +44 -5
- package/dist/core.cjs +1637 -1443
- package/dist/core.css +53 -0
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +8 -6
- package/dist/index.cjs +3797 -3583
- package/dist/index.css +53 -0
- package/dist/index.d.cts +36 -17
- package/dist/index.d.ts +36 -17
- package/dist/index.js +104 -83
- package/dist/markdown-editor.cjs +269 -28
- package/dist/markdown-editor.css +20 -0
- package/dist/markdown-editor.js +2 -2
- package/dist/rich-text-editor.cjs +1156 -1031
- package/dist/rich-text-editor.css +20 -0
- package/dist/rich-text-editor.js +4 -4
- package/dist/{select-date-range-a6nzK7Wu.d.ts → select-date-range-BjqFUeU6.d.ts} +1 -1
- package/dist/{select-date-range-IOe6MMqu.d.cts → select-date-range-C9w8z3G8.d.cts} +1 -1
- package/dist/select-date-range.cjs +1188 -1059
- package/dist/select-date-range.css +20 -0
- package/dist/select-date-range.d.cts +2 -2
- package/dist/select-date-range.d.ts +2 -2
- package/dist/select-date-range.js +5 -5
- package/package.json +2 -2
- package/dist/chunk-3VJ4CZDQ.js +0 -43
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TextArea
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YQDHCORW.js";
|
|
4
4
|
import {
|
|
5
5
|
Button
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-IYNS423D.js";
|
|
7
|
+
import {
|
|
8
|
+
withTitleTooltip
|
|
9
|
+
} from "./chunk-RAO3JHDL.js";
|
|
7
10
|
|
|
8
11
|
// src/components/ChartWhirlingLoading.tsx
|
|
9
12
|
import { useEffect, useState } from "react";
|
|
@@ -73,7 +76,7 @@ function ChartBrush({ bounds, onSelect, onCancel, selectionShape = "band", selec
|
|
|
73
76
|
tabIndex: 0,
|
|
74
77
|
role: "group",
|
|
75
78
|
"aria-label": "\u62D6\u52A8\u6846\u9009\u7F29\u653E\uFF0CEscape\u53D6\u6D88",
|
|
76
|
-
...bounds,
|
|
79
|
+
...withTitleTooltip(bounds),
|
|
77
80
|
fill: "transparent",
|
|
78
81
|
style: { cursor: "crosshair", touchAction: "none", pointerEvents: "all" },
|
|
79
82
|
onKeyDown: (event) => {
|
|
@@ -327,27 +330,27 @@ function ChartNodeTimeline({ labels, dates, value, onChange, autoPlay = false, p
|
|
|
327
330
|
return nearestTimelineIndex(ratios, (p.x - start) / (end - start));
|
|
328
331
|
};
|
|
329
332
|
return /* @__PURE__ */ jsxs3("g", { "data-chart-node-timeline": "", "aria-label": "\u56FE\u8868\u65F6\u95F4\u8F74", fontSize: 12, fill: "#666", children: [
|
|
330
|
-
/* @__PURE__ */ jsxs3("g", { role: "button", tabIndex: 0, "aria-label": "\u4E0A\u4E00\u5E74", ...activate(() => step(-1)), children: [
|
|
333
|
+
/* @__PURE__ */ jsxs3("g", { role: "button", tabIndex: 0, "aria-label": "\u4E0A\u4E00\u5E74", ...withTitleTooltip(activate(() => step(-1))), children: [
|
|
331
334
|
/* @__PURE__ */ jsx4("rect", { x, y: y - 14, width: 24, height: 28, fill: "transparent" }),
|
|
332
335
|
/* @__PURE__ */ jsx4("path", { d: `M${x + 17} ${y - 7} L${x + 7} ${y} L${x + 17} ${y + 7}`, fill: "none", stroke: "#666", strokeWidth: 2 })
|
|
333
336
|
] }),
|
|
334
|
-
/* @__PURE__ */ jsxs3("g", { role: "button", tabIndex: 0, "aria-label": playing ? "\u6682\u505C\u65F6\u95F4\u8F74" : "\u64AD\u653E\u65F6\u95F4\u8F74", ...activate(() => {
|
|
337
|
+
/* @__PURE__ */ jsxs3("g", { role: "button", tabIndex: 0, "aria-label": playing ? "\u6682\u505C\u65F6\u95F4\u8F74" : "\u64AD\u653E\u65F6\u95F4\u8F74", ...withTitleTooltip(activate(() => {
|
|
335
338
|
cancelPending();
|
|
336
339
|
if (playing) setPlaying(false);
|
|
337
340
|
else {
|
|
338
341
|
onChange((shown + 1) % labels.length);
|
|
339
342
|
setPlaying(true);
|
|
340
343
|
}
|
|
341
|
-
}), children: [
|
|
344
|
+
})), children: [
|
|
342
345
|
/* @__PURE__ */ jsx4("rect", { x: x + 30, y: y - 14, width: 24, height: 28, fill: "transparent" }),
|
|
343
346
|
playing ? /* @__PURE__ */ jsx4("path", { d: `M${x + 37} ${y - 7} V${y + 7} M${x + 47} ${y - 7} V${y + 7}`, fill: "none", stroke: "#666", strokeWidth: 3 }) : /* @__PURE__ */ jsx4("path", { d: `M${x + 36} ${y - 8} L${x + 50} ${y} L${x + 36} ${y + 8} Z` })
|
|
344
347
|
] }),
|
|
345
|
-
/* @__PURE__ */ jsxs3("g", { role: "button", tabIndex: 0, "aria-label": "\u4E0B\u4E00\u5E74", ...activate(() => step(1)), children: [
|
|
348
|
+
/* @__PURE__ */ jsxs3("g", { role: "button", tabIndex: 0, "aria-label": "\u4E0B\u4E00\u5E74", ...withTitleTooltip(activate(() => step(1))), children: [
|
|
346
349
|
/* @__PURE__ */ jsx4("rect", { x: x + 60, y: y - 14, width: 24, height: 28, fill: "transparent" }),
|
|
347
350
|
/* @__PURE__ */ jsx4("path", { d: `M${x + 67} ${y - 7} L${x + 77} ${y} L${x + 67} ${y + 7}`, fill: "none", stroke: "#666", strokeWidth: 2 })
|
|
348
351
|
] }),
|
|
349
352
|
/* @__PURE__ */ jsx4("line", { x1: start, x2: end, y1: y, y2: y, stroke: "#666", strokeWidth: 1, strokeDasharray: "5 5" }),
|
|
350
|
-
labels.map((label, index) => /* @__PURE__ */ jsxs3("g", { role: "button", tabIndex: 0, "aria-label": `\u5E74\u4EFD ${label}`, "aria-pressed": value === index, ...activate(() => select(index)), children: [
|
|
353
|
+
labels.map((label, index) => /* @__PURE__ */ jsxs3("g", { role: "button", tabIndex: 0, "aria-label": `\u5E74\u4EFD ${label}`, "aria-pressed": value === index, ...withTitleTooltip(activate(() => select(index))), children: [
|
|
351
354
|
/* @__PURE__ */ jsx4("rect", { x: position(index) - 20, y: y - 12, width: 40, height: 40, fill: "transparent" }),
|
|
352
355
|
/* @__PURE__ */ jsx4("path", { "data-timeline-node": index, d: `M${position(index)} ${y - 4} L${position(index) + 4} ${y} L${position(index)} ${y + 4} L${position(index) - 4} ${y} Z`, fill: "#fff", stroke: "#666" }),
|
|
353
356
|
/* @__PURE__ */ jsx4("text", { x: position(index), y: y + 24, textAnchor: "middle", children: label })
|
|
@@ -489,10 +492,10 @@ function ChartVerticalRange({ min, max, x, y, length, thickness, colors, range,
|
|
|
489
492
|
/* @__PURE__ */ jsx5("text", { x, y: y - 5, children: endLabels?.[1] ?? max }),
|
|
490
493
|
/* @__PURE__ */ jsx5("rect", { x, y, width: thickness, height: Math.max(0, position(high) - y), fill: "#ccc", pointerEvents: "none" }),
|
|
491
494
|
/* @__PURE__ */ jsx5("rect", { x, y: position(low), width: thickness, height: Math.max(0, y + length - position(low)), fill: "#ccc", pointerEvents: "none" }),
|
|
492
|
-
/* @__PURE__ */ jsx5("rect", { "data-range-selection": "", x, y: position(high), width: thickness, height: Math.max(0, position(low) - position(high)), fill: "transparent", style: { cursor: readOnly ? "default" : "move" }, ...handlers(2) }),
|
|
495
|
+
/* @__PURE__ */ jsx5("rect", { "data-range-selection": "", x, y: position(high), width: thickness, height: Math.max(0, position(low) - position(high)), fill: "transparent", style: { cursor: readOnly ? "default" : "move" }, ...withTitleTooltip(handlers(2)) }),
|
|
493
496
|
!readOnly && [0, 1].map((index) => {
|
|
494
497
|
const value = index === 0 ? low : high, py = position(value), direction = index === 0 ? 1 : -1;
|
|
495
|
-
return /* @__PURE__ */ jsxs4("g", { role: "slider", "aria-label": `\u503C\u57DF${index === 0 ? "\u4E0B\u9650" : "\u4E0A\u9650"}`, "aria-valuemin": index === 0 ? min : low, "aria-valuemax": index === 0 ? high : max, "aria-valuenow": value, "aria-orientation": "vertical", tabIndex: 0, style: { cursor: "ns-resize", pointerEvents: "all" }, ...handlers(index), onKeyDown: (event) => {
|
|
498
|
+
return /* @__PURE__ */ jsxs4("g", { role: "slider", "aria-label": `\u503C\u57DF${index === 0 ? "\u4E0B\u9650" : "\u4E0A\u9650"}`, "aria-valuemin": index === 0 ? min : low, "aria-valuemax": index === 0 ? high : max, "aria-valuenow": value, "aria-orientation": "vertical", tabIndex: 0, style: { cursor: "ns-resize", pointerEvents: "all" }, ...withTitleTooltip(handlers(index)), onKeyDown: (event) => {
|
|
496
499
|
const step = span / 100;
|
|
497
500
|
const next = event.key === "Home" ? min : event.key === "End" ? max : ["ArrowUp", "ArrowRight"].includes(event.key) ? value + step : ["ArrowDown", "ArrowLeft"].includes(event.key) ? value - step : void 0;
|
|
498
501
|
if (next !== void 0) {
|
|
@@ -579,10 +582,10 @@ function ChartHorizontalRange({ min, max, x, y, length, thickness, colors, range
|
|
|
579
582
|
/* @__PURE__ */ jsx6("text", { x: x + length + 10, y: y + thickness / 2, dominantBaseline: "central", children: endLabels?.[0] ?? min }),
|
|
580
583
|
/* @__PURE__ */ jsx6("rect", { x, y, width: Math.max(0, position(high) - x), height: thickness, fill: "#ccc", pointerEvents: "none" }),
|
|
581
584
|
/* @__PURE__ */ jsx6("rect", { x: position(low), y, width: Math.max(0, x + length - position(low)), height: thickness, fill: "#ccc", pointerEvents: "none" }),
|
|
582
|
-
/* @__PURE__ */ jsx6("rect", { "data-range-selection": "", x: position(high), y, width: Math.max(0, position(low) - position(high)), height: thickness, fill: "transparent", style: { cursor: "move" }, ...handlers(2) }),
|
|
585
|
+
/* @__PURE__ */ jsx6("rect", { "data-range-selection": "", x: position(high), y, width: Math.max(0, position(low) - position(high)), height: thickness, fill: "transparent", style: { cursor: "move" }, ...withTitleTooltip(handlers(2)) }),
|
|
583
586
|
[0, 1].map((index) => {
|
|
584
587
|
const value = index === 0 ? low : high, px = position(value), direction = index === 0 ? 1 : -1;
|
|
585
|
-
return /* @__PURE__ */ jsxs5("g", { role: "slider", "aria-label": "\u503C\u57DF" + (index === 0 ? "\u4E0B\u9650" : "\u4E0A\u9650"), "aria-valuemin": index === 0 ? min : low, "aria-valuemax": index === 0 ? high : max, "aria-valuenow": value, "aria-orientation": "horizontal", tabIndex: 0, style: { cursor: "ew-resize", pointerEvents: "all" }, ...handlers(index), onKeyDown: (event) => {
|
|
588
|
+
return /* @__PURE__ */ jsxs5("g", { role: "slider", "aria-label": "\u503C\u57DF" + (index === 0 ? "\u4E0B\u9650" : "\u4E0A\u9650"), "aria-valuemin": index === 0 ? min : low, "aria-valuemax": index === 0 ? high : max, "aria-valuenow": value, "aria-orientation": "horizontal", tabIndex: 0, style: { cursor: "ew-resize", pointerEvents: "all" }, ...withTitleTooltip(handlers(index)), onKeyDown: (event) => {
|
|
586
589
|
const step = span / 100, next = event.key === "Home" ? min : event.key === "End" ? max : ["ArrowUp", "ArrowLeft"].includes(event.key) ? value + step : ["ArrowDown", "ArrowRight"].includes(event.key) ? value - step : void 0;
|
|
587
590
|
if (next !== void 0) {
|
|
588
591
|
event.preventDefault();
|
|
@@ -744,7 +747,7 @@ function toCssSize(value, fallback) {
|
|
|
744
747
|
var ChartComposite = forwardRef(function ChartComposite2({ layers, width = "100%", height = 320, ariaLabel = "\u7EC4\u5408\u56FE\u8868", className = "", style, ...props }, ref) {
|
|
745
748
|
const host = useRef6(null);
|
|
746
749
|
useImperativeHandle(ref, () => ({ toSvgString: () => host.current ? serializeChartComposite(host.current) : null, saveAsImage: (filename) => saveCompositeImage(host.current ? serializeChartComposite(host.current) : null, filename) }), []);
|
|
747
|
-
return /* @__PURE__ */ jsx7("div", { ...props, ref: host, className: `sia-chart-composite${className ? ` ${className}` : ""}`, style: { ...style, width: toCssSize(width, "100%"), height: toCssSize(height, "320px") }, role: "group", "aria-label": ariaLabel, children: layers.map((layer, index) => /* @__PURE__ */ jsx7("div", { className: "sia-chart-composite__layer", style: { left: layer.left ?? 0, top: layer.top ?? 0, width: layer.width ?? "100%", height: layer.height ?? "100%", zIndex: layer.zIndex ?? index, pointerEvents: layer.pointerEvents }, children: layer.content }, layer.key ?? index)) });
|
|
750
|
+
return /* @__PURE__ */ jsx7("div", { ...withTitleTooltip(props), ref: host, className: `sia-chart-composite${className ? ` ${className}` : ""}`, style: { ...style, width: toCssSize(width, "100%"), height: toCssSize(height, "320px") }, role: "group", "aria-label": ariaLabel, children: layers.map((layer, index) => /* @__PURE__ */ jsx7("div", { className: "sia-chart-composite__layer", style: { left: layer.left ?? 0, top: layer.top ?? 0, width: layer.width ?? "100%", height: layer.height ?? "100%", zIndex: layer.zIndex ?? index, pointerEvents: layer.pointerEvents }, children: layer.content }, layer.key ?? index)) });
|
|
748
751
|
});
|
|
749
752
|
var useTooltipLayoutEffect = typeof window === "undefined" ? useEffect6 : useLayoutEffect;
|
|
750
753
|
function ChartTooltip({ open, left, top, children, enterable = false, inheritTextStyle = false, placement = "above", className = "", style, ...props }) {
|
|
@@ -767,7 +770,7 @@ function ChartTooltip({ open, left, top, children, enterable = false, inheritTex
|
|
|
767
770
|
return /* @__PURE__ */ jsx7(
|
|
768
771
|
"div",
|
|
769
772
|
{
|
|
770
|
-
...props,
|
|
773
|
+
...withTitleTooltip(props),
|
|
771
774
|
ref: elementRef,
|
|
772
775
|
className: `sia-chart__tooltip${inheritTextStyle ? " sia-chart__tooltip--inherit-text" : ""}${className ? ` ${className}` : ""}`,
|
|
773
776
|
role: "tooltip",
|
|
@@ -846,7 +849,7 @@ function ChartToolbox({
|
|
|
846
849
|
{
|
|
847
850
|
type: "button",
|
|
848
851
|
className: "sia-chart-toolbox__button",
|
|
849
|
-
title: TOOLBOX_LABELS[feature],
|
|
852
|
+
...withTitleTooltip({ title: TOOLBOX_LABELS[feature] }),
|
|
850
853
|
"aria-label": TOOLBOX_LABELS[feature],
|
|
851
854
|
"aria-pressed": feature === "mark" ? markActive : feature === "dataZoom" ? zoomActive : void 0,
|
|
852
855
|
onClick: featureActions[feature],
|
|
@@ -854,9 +857,9 @@ function ChartToolbox({
|
|
|
854
857
|
}
|
|
855
858
|
),
|
|
856
859
|
feature === "mark" ? /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
857
|
-
/* @__PURE__ */ jsx7("button", { type: "button", className: "sia-chart-toolbox__button", "aria-label": "\u64A4\u9500\u6807\u7EBF", title: "\u64A4\u9500\u6807\u7EBF", disabled: !markCount, onClick: onMarkUndo, children: /* @__PURE__ */ jsx7(ToolboxIcon, { children: /* @__PURE__ */ jsx7("path", { d: "M4 8h10a6 6 0 0 1 0 12M4 8l5-5M4 8l5 5" }) }) }),
|
|
858
|
-
/* @__PURE__ */ jsx7("button", { type: "button", className: "sia-chart-toolbox__button", "aria-label": "\u6E05\u7A7A\u6807\u7EBF", title: "\u6E05\u7A7A\u6807\u7EBF", disabled: !markCount, onClick: onMarkClear, children: /* @__PURE__ */ jsx7(ToolboxIcon, { children: /* @__PURE__ */ jsx7("path", { d: "M4 6h16M9 6V3h6v3M6 6l1 15h10l1-15M10 10v7M14 10v7" }) }) })
|
|
859
|
-
] }) : feature === "dataZoom" && onZoomBack ? /* @__PURE__ */ jsx7("button", { type: "button", className: "sia-chart-toolbox__button", "aria-label": "\u533A\u57DF\u7F29\u653E\u540E\u9000", title: "\u533A\u57DF\u7F29\u653E\u540E\u9000", disabled: zoomBackDisabled, onClick: onZoomBack, children: /* @__PURE__ */ jsx7(ToolboxIcon, { children: /* @__PURE__ */ jsx7("path", { d: "M4 8h10a6 6 0 0 1 0 12M4 8l5-5M4 8l5 5" }) }) }) : null
|
|
860
|
+
/* @__PURE__ */ jsx7("button", { type: "button", className: "sia-chart-toolbox__button", "aria-label": "\u64A4\u9500\u6807\u7EBF", ...withTitleTooltip({ title: "\u64A4\u9500\u6807\u7EBF" }), disabled: !markCount, onClick: onMarkUndo, children: /* @__PURE__ */ jsx7(ToolboxIcon, { children: /* @__PURE__ */ jsx7("path", { d: "M4 8h10a6 6 0 0 1 0 12M4 8l5-5M4 8l5 5" }) }) }),
|
|
861
|
+
/* @__PURE__ */ jsx7("button", { type: "button", className: "sia-chart-toolbox__button", "aria-label": "\u6E05\u7A7A\u6807\u7EBF", ...withTitleTooltip({ title: "\u6E05\u7A7A\u6807\u7EBF" }), disabled: !markCount, onClick: onMarkClear, children: /* @__PURE__ */ jsx7(ToolboxIcon, { children: /* @__PURE__ */ jsx7("path", { d: "M4 6h16M9 6V3h6v3M6 6l1 15h10l1-15M10 10v7M14 10v7" }) }) })
|
|
862
|
+
] }) : feature === "dataZoom" && onZoomBack ? /* @__PURE__ */ jsx7("button", { type: "button", className: "sia-chart-toolbox__button", "aria-label": "\u533A\u57DF\u7F29\u653E\u540E\u9000", ...withTitleTooltip({ title: "\u533A\u57DF\u7F29\u653E\u540E\u9000" }), disabled: zoomBackDisabled, onClick: onZoomBack, children: /* @__PURE__ */ jsx7(ToolboxIcon, { children: /* @__PURE__ */ jsx7("path", { d: "M4 8h10a6 6 0 0 1 0 12M4 8l5-5M4 8l5 5" }) }) }) : null
|
|
860
863
|
] }, feature)),
|
|
861
864
|
magicTypes.map((type) => /* @__PURE__ */ jsx7(
|
|
862
865
|
"button",
|
|
@@ -865,7 +868,7 @@ function ChartToolbox({
|
|
|
865
868
|
className: "sia-chart-toolbox__button sia-chart-toolbox__magic",
|
|
866
869
|
"aria-pressed": activeMagicTypes ? activeMagicTypes.includes(type) : activeMagicType === type,
|
|
867
870
|
"aria-label": `\u5207\u6362\u4E3A${{ line: "\u6298\u7EBF\u56FE", bar: "\u67F1\u72B6\u56FE", stack: "\u5806\u79EF", tiled: "\u5E73\u94FA" }[type] ?? type}`,
|
|
868
|
-
title: `\u5207\u6362\u4E3A${type}
|
|
871
|
+
...withTitleTooltip({ title: `\u5207\u6362\u4E3A${type}` }),
|
|
869
872
|
onClick: () => onMagicTypeChange?.(type),
|
|
870
873
|
children: ["line", "bar", "stack", "tiled"].includes(type) ? /* @__PURE__ */ jsx7(ToolboxIcon, { children: type === "line" ? /* @__PURE__ */ jsx7("path", { d: "M3 3v18h18M5 16l4-9 5 6 6-10" }) : type === "bar" ? /* @__PURE__ */ jsx7("path", { d: "M3 3v18h18M7 18V10h2v8M12 18V5h2v13M17 18V8h2v10" }) : type === "stack" ? /* @__PURE__ */ jsx7("path", { d: "M4 4h16v4H4zM4 10h16v4H4zM4 16h16v4H4z" }) : /* @__PURE__ */ jsx7("path", { d: "M4 4h4v16H4zM10 4h4v16h-4zM16 4h4v16h-4z" }) }) : type
|
|
871
874
|
},
|
|
@@ -1034,7 +1037,7 @@ var SiaChart = forwardRef(function SiaChart2({
|
|
|
1034
1037
|
return /* @__PURE__ */ jsx7(ChartContext.Provider, { value: context, children: /* @__PURE__ */ jsxs6(
|
|
1035
1038
|
"div",
|
|
1036
1039
|
{
|
|
1037
|
-
...rest,
|
|
1040
|
+
...withTitleTooltip(rest),
|
|
1038
1041
|
ref: hostRef,
|
|
1039
1042
|
className: `sia-chart${loading ? " sia-chart--loading" : ""}${animation ? " sia-chart--animated" : ""}${className ? ` ${className}` : ""}`,
|
|
1040
1043
|
style: rootStyle,
|
|
@@ -1043,7 +1046,7 @@ var SiaChart = forwardRef(function SiaChart2({
|
|
|
1043
1046
|
/* @__PURE__ */ jsxs6(
|
|
1044
1047
|
"svg",
|
|
1045
1048
|
{
|
|
1046
|
-
...svgProps,
|
|
1049
|
+
...withTitleTooltip(svgProps),
|
|
1047
1050
|
ref: svgRef,
|
|
1048
1051
|
className: `sia-chart__svg${svgProps?.className ? ` ${svgProps.className}` : ""}`,
|
|
1049
1052
|
viewBox: `0 0 ${viewBoxSize[0]} ${viewBoxSize[1]}`,
|
|
@@ -1187,7 +1190,7 @@ function ChartMark({ tooltip, tooltipPoint, label, onPointerMove, onPointerLeave
|
|
|
1187
1190
|
return /* @__PURE__ */ jsx7(
|
|
1188
1191
|
"g",
|
|
1189
1192
|
{
|
|
1190
|
-
...props,
|
|
1193
|
+
...withTitleTooltip(props),
|
|
1191
1194
|
className: `sia-chart__mark${props.className ? ` ${props.className}` : ""}`,
|
|
1192
1195
|
tabIndex: props.tabIndex ?? 0,
|
|
1193
1196
|
role: "graphics-symbol",
|
|
@@ -1456,7 +1459,7 @@ function ChartTimeline({ labels, value, onChange, autoPlay = false, playInterval
|
|
|
1456
1459
|
}, Math.max(120, playInterval));
|
|
1457
1460
|
return () => window.clearInterval(timer);
|
|
1458
1461
|
}, [labels.length, loop, onChange, playInterval, playing, value]);
|
|
1459
|
-
return /* @__PURE__ */ jsxs6("div", { ...props, className: `sia-chart-timeline${className ? ` ${className}` : ""}`, children: [
|
|
1462
|
+
return /* @__PURE__ */ jsxs6("div", { ...withTitleTooltip(props), className: `sia-chart-timeline${className ? ` ${className}` : ""}`, children: [
|
|
1460
1463
|
/* @__PURE__ */ jsx7("button", { type: "button", "aria-label": playing ? "\u6682\u505C\u65F6\u95F4\u8F74" : "\u64AD\u653E\u65F6\u95F4\u8F74", onClick: () => setPlaying((current) => !current), children: playing ? "\u2161" : "\u25B6" }),
|
|
1461
1464
|
/* @__PURE__ */ jsx7("input", { "aria-label": "\u56FE\u8868\u65F6\u95F4\u8F74", type: "range", min: 0, max: Math.max(0, labels.length - 1), value: Math.min(value, Math.max(0, labels.length - 1)), onChange: (event) => onChange(Number(event.target.value)) }),
|
|
1462
1465
|
/* @__PURE__ */ jsx7("output", { children: labels[value] ?? "" })
|
|
@@ -1828,7 +1831,7 @@ function SvgMapPlot({ source, name, data, x, y, width, height, domain, range = d
|
|
|
1828
1831
|
const scale = Math.min(width / map.width, height / map.height), left = x + (width - map.width * scale) / 2, top = y + (height - map.height * scale) / 2;
|
|
1829
1832
|
const project = (point) => [left + (point[0] - map.x) * scale, top + (point[1] - map.y) * scale];
|
|
1830
1833
|
const markColor = (value) => chartColorRamp(colors, (Math.max(domain[0], Math.min(domain[1], value)) - domain[0]) / Math.max(1, domain[1] - domain[0]));
|
|
1831
|
-
return /* @__PURE__ */ jsxs9("g", { ref: control.host, ...control.handlers, "data-svg-map": name, tabIndex: roam ? 0 : void 0, role: "group", "aria-label": `${name}\u6F2B\u6E38`, style: { touchAction: "none" }, children: [
|
|
1834
|
+
return /* @__PURE__ */ jsxs9("g", { ref: control.host, ...withTitleTooltip(control.handlers), "data-svg-map": name, tabIndex: roam ? 0 : void 0, role: "group", "aria-label": `${name}\u6F2B\u6E38`, style: { touchAction: "none" }, children: [
|
|
1832
1835
|
roam ? /* @__PURE__ */ jsx12("rect", { x, y, width, height, fill: "transparent" }) : null,
|
|
1833
1836
|
/* @__PURE__ */ jsxs9("g", { "data-svg-map-transform": "", transform: `translate(${control.view.x} ${control.view.y}) scale(${control.view.scale})`, children: [
|
|
1834
1837
|
/* @__PURE__ */ jsxs9("g", { transform: `translate(${left} ${top}) scale(${scale}) translate(${-map.x} ${-map.y})`, children: [
|
|
@@ -4290,7 +4293,7 @@ var LineChart = forwardRef2(function LineChart2({ calculableMode = "resize", onT
|
|
|
4290
4293
|
const PLOT2 = plot;
|
|
4291
4294
|
const legend = useLegendSelection(series.map((item) => item.name), legendSelected, onLegendSelectionChange);
|
|
4292
4295
|
const [zoomValue, setZoomValue] = useZoom(zoom, defaultZoom, onZoomChange);
|
|
4293
|
-
const inlineZoom = dataZoom && zoomControlBounds ? /* @__PURE__ */ jsx30("foreignObject", { className: "sia-chart__inline-zoom sia-chart__inline-zoom--compact", ...zoomControlBounds, children: /* @__PURE__ */ jsx30(ChartDataZoom, { handleLabels: [categories[Math.min(categories.length - 1, Math.floor(Math.min(...zoomValue) / 100 * categories.length))] ?? "", categories[Math.max(0, Math.ceil(Math.max(...zoomValue) / 100 * categories.length) - 1)] ?? ""], shadowBounds: zoomControlBounds, panEnabled: zoomPan, value: zoomValue, dataShadow: series[0]?.data.map(lineValue), onChange: setZoomValue }) }) : null;
|
|
4296
|
+
const inlineZoom = dataZoom && zoomControlBounds ? /* @__PURE__ */ jsx30("foreignObject", { className: "sia-chart__inline-zoom sia-chart__inline-zoom--compact", ...withTitleTooltip(zoomControlBounds), children: /* @__PURE__ */ jsx30(ChartDataZoom, { handleLabels: [categories[Math.min(categories.length - 1, Math.floor(Math.min(...zoomValue) / 100 * categories.length))] ?? "", categories[Math.max(0, Math.ceil(Math.max(...zoomValue) / 100 * categories.length) - 1)] ?? ""], shadowBounds: zoomControlBounds, panEnabled: zoomPan, value: zoomValue, dataShadow: series[0]?.data.map(lineValue), onChange: setZoomValue }) }) : null;
|
|
4294
4297
|
const [zoomBrushActive, setZoomBrushActive] = useState28(false);
|
|
4295
4298
|
const [zoomHistory, setZoomHistory] = useState28(() => dataZoom ? [defaultZoom ?? zoom ?? [0, 100]] : []);
|
|
4296
4299
|
const zoomBrush = dataZoom && zoomBrushActive ? { minSelectionSize: zoomMinSelectionSize, selectionStyle: zoomSelectionStyle, selectionShape: zoomSelectionShape, bounds: PLOT2, onCancel: () => setZoomBrushActive(false), onSelect: (range) => {
|
|
@@ -5917,7 +5920,7 @@ var MapChart = forwardRef2(function MapChart2({ overlayProjection, bundledLines,
|
|
|
5917
5920
|
];
|
|
5918
5921
|
};
|
|
5919
5922
|
return /* @__PURE__ */ jsxs21(SiaChart, { ...props, ref, toolbox: chartToolbox, empty: !collection?.features.length && !overlayProjection, ariaLabel: props.ariaLabel ?? "\u5730\u56FE", children: [
|
|
5920
|
-
/* @__PURE__ */ jsxs21("g", { ref: roamControl.host, ...roamControl.handlers, "data-map-viewport": true, tabIndex: roam ? 0 : void 0, role: roam ? "group" : void 0, "aria-label": roam ? "\u5730\u56FE\u6F2B\u6E38\uFF1A\u62D6\u52A8\u5E73\u79FB\u3001\u6EDA\u8F6E\u7F29\u653E\u3001Home \u8FD8\u539F" : void 0, style: { touchAction: roam ? "none" : void 0 }, children: [
|
|
5923
|
+
/* @__PURE__ */ jsxs21("g", { ref: roamControl.host, ...withTitleTooltip(roamControl.handlers), "data-map-viewport": true, tabIndex: roam ? 0 : void 0, role: roam ? "group" : void 0, "aria-label": roam ? "\u5730\u56FE\u6F2B\u6E38\uFF1A\u62D6\u52A8\u5E73\u79FB\u3001\u6EDA\u8F6E\u7F29\u653E\u3001Home \u8FD8\u539F" : void 0, style: { touchAction: roam ? "none" : void 0 }, children: [
|
|
5921
5924
|
roam ? /* @__PURE__ */ jsx30("rect", { x: 0, y: 0, width: props.viewBoxSize?.[0] ?? 720, height: props.viewBoxSize?.[1] ?? 360, fill: "transparent", className: "sia-chart__map-roam-surface" }) : null,
|
|
5922
5925
|
/* @__PURE__ */ jsxs21("g", { "data-map-transform": true, style: { display: showMap ? void 0 : "none" }, transform: `translate(${view.x} ${view.y}) scale(${view.scale})`, children: [
|
|
5923
5926
|
collection?.features.map((feature, featureIndex) => {
|