@cardenelabs/cdl 0.31.1 → 0.32.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/CHANGELOG.md +10 -1
- package/README.md +40 -0
- package/dist/index.cjs +339 -64
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +339 -64
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +339 -64
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +339 -64
- package/dist/react.js.map +1 -1
- package/dist/{render-D6wVFGfI.d.cts → render-DjnLKv2Q.d.cts} +15 -1
- package/dist/{render-D6wVFGfI.d.ts → render-DjnLKv2Q.d.ts} +15 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/kinds/chart-pie.tsx +451 -48
- package/src/render/template-fields.ts +2 -0
- package/src/types.ts +15 -0
package/dist/react.cjs
CHANGED
|
@@ -4908,10 +4908,10 @@ function countEdgeCrossings(edges, warnAt = 3) {
|
|
|
4908
4908
|
if (isNearAny(p, a.ends, SAME_POINT_TOL) || isNearAny(p, b.ends, SAME_POINT_TOL))
|
|
4909
4909
|
continue;
|
|
4910
4910
|
if (\u5171\u6709\u5074.length > 0) {
|
|
4911
|
-
const \
|
|
4912
|
-
const \u4E88\u7B97 = { \u6B8B\u308A: Math.max(0, \
|
|
4911
|
+
const \u67A02 = Math.min(MAX_CHECKS - checks, MAX_CHECKS_PER_PAIR - pairChecks);
|
|
4912
|
+
const \u4E88\u7B97 = { \u6B8B\u308A: Math.max(0, \u67A02) };
|
|
4913
4913
|
const \u5224\u5B9A = mergesTowardShared(a.flat, b.flat, p, \u5171\u6709\u5074, MERGE_TOL, \u4E88\u7B97);
|
|
4914
|
-
const \u4F7F\u3063\u305F = Math.max(0, \
|
|
4914
|
+
const \u4F7F\u3063\u305F = Math.max(0, \u67A02) - \u4E88\u7B97.\u6B8B\u308A;
|
|
4915
4915
|
checks += \u4F7F\u3063\u305F;
|
|
4916
4916
|
pairChecks += \u4F7F\u3063\u305F;
|
|
4917
4917
|
if (\u5224\u5B9A === "merged") continue;
|
|
@@ -11844,52 +11844,52 @@ function ChartPieNode({
|
|
|
11844
11844
|
const y0 = node.cy - node.h / 2;
|
|
11845
11845
|
const data = resolveChartData(node.chartData ?? [], stateValues);
|
|
11846
11846
|
const total = data.reduce((acc, d) => acc + d.value, 0) || 1;
|
|
11847
|
+
const \u524D\u3042\u308A = data.some((d) => d.previous !== void 0);
|
|
11848
|
+
const \u4ECA\u306E\u5024 = data.map((d) => Math.max(0, d.value));
|
|
11849
|
+
const \u524D\u306E\u5024 = data.map((d) => Math.max(0, d.previous ?? 0));
|
|
11850
|
+
const \u4ECA\u306E\u5408\u8A08 = \u4ECA\u306E\u5024.reduce((acc, value) => acc + value, 0);
|
|
11851
|
+
const \u524D\u306E\u5408\u8A08 = \u524D\u306E\u5024.reduce((acc, value) => acc + value, 0);
|
|
11852
|
+
const \u4ECA\u306E\u5272\u5408 = \u524D\u3042\u308A ? \u4ECA\u306E\u5024.map((value) => \u4ECA\u306E\u5408\u8A08 > 0 ? value / \u4ECA\u306E\u5408\u8A08 : 0) : data.map((d) => d.value / total);
|
|
11853
|
+
const \u524D\u306E\u5272\u5408 = \u524D\u306E\u5024.map((value) => \u524D\u306E\u5408\u8A08 > 0 ? value / \u524D\u306E\u5408\u8A08 : 0);
|
|
11854
|
+
const \u5F62 = node.chartPieForm === "arcs" || node.chartPieForm === "table" ? node.chartPieForm : "ring";
|
|
11847
11855
|
const PAD_TOP2 = 20;
|
|
11848
11856
|
const PAD_BOTTOM2 = 20;
|
|
11849
11857
|
const PAD_SIDE = 20;
|
|
11850
11858
|
const chartAreaH = node.h - PAD_TOP2 - PAD_BOTTOM2;
|
|
11851
|
-
const \
|
|
11852
|
-
const \
|
|
11859
|
+
const \u5272\u5408\u306E\u7D1A = 19;
|
|
11860
|
+
const \u540D\u524D\u306E\u7D1A = 12;
|
|
11853
11861
|
const \u5F15\u304D\u51FA\u3057 = 18;
|
|
11854
11862
|
const \u5B57\u307E\u3067\u306E\u9593 = 26;
|
|
11855
11863
|
const \u540D\u672D\u306E\u7E26\u306E\u5F35\u308A\u51FA\u3057 = 20;
|
|
11856
|
-
const \u5272\u5408\u306E\u6587\u5B57 =
|
|
11857
|
-
const \
|
|
11864
|
+
const \u5272\u5408\u306E\u6587\u5B57 = \u4ECA\u306E\u5272\u5408.map(\u5272\u5408\u8868\u8A18);
|
|
11865
|
+
const \u540D\u524D\u306E\u6587\u5B57 = data.map((d, i) => {
|
|
11866
|
+
const \u540D = d.label ?? "";
|
|
11867
|
+
if (\u524D\u3042\u308A) return `${\u540D} ${\u5B9F\u5024\u8868\u8A18(\u524D\u306E\u5024[i])} \u2192 ${\u5B9F\u5024\u8868\u8A18(\u4ECA\u306E\u5024[i])}`;
|
|
11868
|
+
return `${\u5B9F\u5024\u8868\u8A18(d.value)}%` === \u5272\u5408\u306E\u6587\u5B57[i] ? \u540D : `${\u540D} ${\u5B9F\u5024\u8868\u8A18(d.value)}`;
|
|
11869
|
+
});
|
|
11870
|
+
if (\u5F62 !== "ring") {
|
|
11871
|
+
const \u5171\u901A = { node, active, data, \u5272\u5408: \u4ECA\u306E\u5272\u5408, x0, y0, drawing, progress, instanceId };
|
|
11872
|
+
return \u5F62 === "arcs" ? \u5F27\u306E\u5F62(\u5171\u901A) : \u8868\u306E\u5F62(\u5171\u901A);
|
|
11873
|
+
}
|
|
11858
11874
|
const \u540D\u672D\u5E45 = Math.max(
|
|
11859
11875
|
0,
|
|
11860
11876
|
...data.map(
|
|
11861
|
-
(
|
|
11877
|
+
(_d, i) => Math.max(
|
|
11878
|
+
textWidth(\u5272\u5408\u306E\u6587\u5B57[i] ?? "", \u5272\u5408\u306E\u7D1A),
|
|
11879
|
+
textWidth(\u540D\u524D\u306E\u6587\u5B57[i] ?? "", \u540D\u524D\u306E\u7D1A)
|
|
11880
|
+
)
|
|
11862
11881
|
)
|
|
11863
11882
|
);
|
|
11864
11883
|
const \u7E26\u304B\u3089 = chartAreaH / 2 - \u5F15\u304D\u51FA\u3057 - \u540D\u672D\u306E\u7E26\u306E\u5F35\u308A\u51FA\u3057;
|
|
11865
11884
|
const \u6A2A\u304B\u3089 = (node.w - PAD_SIDE * 2) / 2 - \u5F15\u304D\u51FA\u3057 - \u5B57\u307E\u3067\u306E\u9593 - \u540D\u672D\u5E45;
|
|
11866
11885
|
const radius = Math.max(24, Math.min(\u7E26\u304B\u3089, \u6A2A\u304B\u3089));
|
|
11867
|
-
const \u5185\u534A\u5F84 = radius * 0.58;
|
|
11886
|
+
const \u5916\u306E\u5185\u534A\u5F84 = radius * (\u524D\u3042\u308A ? 0.75 : 0.58);
|
|
11887
|
+
const \u524D\u306E\u5916\u534A\u5F84 = radius * 0.67;
|
|
11888
|
+
const \u524D\u306E\u5185\u534A\u5F84 = radius * 0.42;
|
|
11868
11889
|
const cx = node.w / 2;
|
|
11869
11890
|
const cy = PAD_TOP2 + chartAreaH / 2;
|
|
11870
|
-
|
|
11871
|
-
|
|
11872
|
-
const slices = data.map((d) => {
|
|
11873
|
-
const frac = d.value / total;
|
|
11874
|
-
const angle = frac * Math.PI * 2;
|
|
11875
|
-
const a0 = cumAngle;
|
|
11876
|
-
const a1 = cumAngle + angle;
|
|
11877
|
-
cumAngle = a1;
|
|
11878
|
-
const startFrac = cumFrac;
|
|
11879
|
-
cumFrac += frac;
|
|
11880
|
-
const x1 = cx + radius * Math.cos(a0);
|
|
11881
|
-
const y1 = cy + radius * Math.sin(a0);
|
|
11882
|
-
const x2 = cx + radius * Math.cos(a1);
|
|
11883
|
-
const y2 = cy + radius * Math.sin(a1);
|
|
11884
|
-
const x3 = cx + \u5185\u534A\u5F84 * Math.cos(a1);
|
|
11885
|
-
const y3 = cy + \u5185\u534A\u5F84 * Math.sin(a1);
|
|
11886
|
-
const x4 = cx + \u5185\u534A\u5F84 * Math.cos(a0);
|
|
11887
|
-
const y4 = cy + \u5185\u534A\u5F84 * Math.sin(a0);
|
|
11888
|
-
const large = angle > Math.PI ? 1 : 0;
|
|
11889
|
-
const path = `M ${x1} ${y1} A ${radius} ${radius} 0 ${large} 1 ${x2} ${y2} L ${x3} ${y3} A ${\u5185\u534A\u5F84} ${\u5185\u534A\u5F84} 0 ${large} 0 ${x4} ${y4} Z`;
|
|
11890
|
-
const \u4E2D\u592E\u89D2 = (a0 + a1) / 2;
|
|
11891
|
-
return { d, frac, path, startFrac, \u4E2D\u592E\u89D2 };
|
|
11892
|
-
});
|
|
11891
|
+
const \u524D\u306Eslices = \u524D\u3042\u308A ? \u8F2A\u3092\u7D44\u3080(data, cx, cy, \u524D\u306E\u5916\u534A\u5F84, \u524D\u306E\u5185\u534A\u5F84, \u524D\u306E\u5272\u5408) : [];
|
|
11892
|
+
const slices = \u8F2A\u3092\u7D44\u3080(data, cx, cy, radius, \u5916\u306E\u5185\u534A\u5F84, \u4ECA\u306E\u5272\u5408);
|
|
11893
11893
|
const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
11894
11894
|
const \u5207\u308A\u629C\u304Did = `cdl-pie-draw-${instanceId}`;
|
|
11895
11895
|
const \u5F71id = `cdl-pie-shadow-${instanceId}`;
|
|
@@ -11913,19 +11913,34 @@ function ChartPieNode({
|
|
|
11913
11913
|
drawing && /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: \u5207\u308A\u629C\u304Did, children: \u6247\u5F62\u306E\u5207\u308A\u629C\u304D(cx, cy, radius + 2, \u958B\u304D) }),
|
|
11914
11914
|
/* @__PURE__ */ jsxRuntime.jsx("filter", { id: \u5F71id, x: "-20%", y: "-20%", width: "140%", height: "140%", children: /* @__PURE__ */ jsxRuntime.jsx("feDropShadow", { dx: "0", dy: "6", stdDeviation: "10", floodColor: "#0b1220", floodOpacity: "0.16" }) })
|
|
11915
11915
|
] }),
|
|
11916
|
-
/* @__PURE__ */ jsxRuntime.
|
|
11917
|
-
|
|
11918
|
-
|
|
11919
|
-
|
|
11920
|
-
|
|
11921
|
-
|
|
11922
|
-
|
|
11923
|
-
|
|
11924
|
-
|
|
11925
|
-
|
|
11926
|
-
|
|
11927
|
-
|
|
11928
|
-
|
|
11916
|
+
/* @__PURE__ */ jsxRuntime.jsxs("g", { ...drawing ? { clipPath: `url(#${\u5207\u308A\u629C\u304Did})` } : {}, filter: `url(#${\u5F71id})`, children: [
|
|
11917
|
+
\u524D\u306Eslices.map((s, idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11918
|
+
"path",
|
|
11919
|
+
{
|
|
11920
|
+
"data-cdl-role": "chart-pie-slice-previous",
|
|
11921
|
+
"data-cdl-unresolved": s.d.unresolved ? "true" : void 0,
|
|
11922
|
+
d: s.path,
|
|
11923
|
+
fill: sliceColor(s.d.tone, idx),
|
|
11924
|
+
stroke: "var(--cdl-node-fill, #ffffff)",
|
|
11925
|
+
strokeWidth: 3,
|
|
11926
|
+
strokeLinejoin: "round"
|
|
11927
|
+
},
|
|
11928
|
+
`slice-previous-${idx}`
|
|
11929
|
+
)),
|
|
11930
|
+
slices.map((s, idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11931
|
+
"path",
|
|
11932
|
+
{
|
|
11933
|
+
"data-cdl-role": "chart-pie-slice",
|
|
11934
|
+
"data-cdl-unresolved": s.d.unresolved ? "true" : void 0,
|
|
11935
|
+
d: s.path,
|
|
11936
|
+
fill: sliceColor(s.d.tone, idx),
|
|
11937
|
+
stroke: "var(--cdl-node-fill, #ffffff)",
|
|
11938
|
+
strokeWidth: 3,
|
|
11939
|
+
strokeLinejoin: "round"
|
|
11940
|
+
},
|
|
11941
|
+
`slice-${idx}`
|
|
11942
|
+
))
|
|
11943
|
+
] }),
|
|
11929
11944
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11930
11945
|
"text",
|
|
11931
11946
|
{
|
|
@@ -11935,7 +11950,7 @@ function ChartPieNode({
|
|
|
11935
11950
|
fontSize: Math.round(radius * 0.26),
|
|
11936
11951
|
fontWeight: 600,
|
|
11937
11952
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
11938
|
-
children: \u5B9F\u5024\u8868\u8A18(Math.round(total))
|
|
11953
|
+
children: \u5B9F\u5024\u8868\u8A18(Math.round(\u524D\u3042\u308A ? \u4ECA\u306E\u5408\u8A08 : total))
|
|
11939
11954
|
}
|
|
11940
11955
|
),
|
|
11941
11956
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -11972,12 +11987,12 @@ function ChartPieNode({
|
|
|
11972
11987
|
"text",
|
|
11973
11988
|
{
|
|
11974
11989
|
x: \u5B57x,
|
|
11975
|
-
y: \u6298\u308Cy -
|
|
11990
|
+
y: \u6298\u308Cy - 1,
|
|
11976
11991
|
textAnchor: \u53F3 ? "start" : "end",
|
|
11977
|
-
fontSize: \
|
|
11992
|
+
fontSize: \u5272\u5408\u306E\u7D1A,
|
|
11978
11993
|
fontWeight: 600,
|
|
11979
11994
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
11980
|
-
children:
|
|
11995
|
+
children: \u5272\u5408\u306E\u6587\u5B57[idx]
|
|
11981
11996
|
}
|
|
11982
11997
|
),
|
|
11983
11998
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -11986,15 +12001,275 @@ function ChartPieNode({
|
|
|
11986
12001
|
x: \u5B57x,
|
|
11987
12002
|
y: \u6298\u308Cy + 15,
|
|
11988
12003
|
textAnchor: \u53F3 ? "start" : "end",
|
|
11989
|
-
fontSize: \
|
|
12004
|
+
fontSize: \u540D\u524D\u306E\u7D1A,
|
|
11990
12005
|
fill: "var(--cdl-text-dim, #5a6270)",
|
|
11991
|
-
children: \
|
|
12006
|
+
children: \u540D\u524D\u306E\u6587\u5B57[idx]
|
|
11992
12007
|
}
|
|
11993
12008
|
)
|
|
11994
12009
|
] }, `callout-${idx}`);
|
|
11995
12010
|
})
|
|
11996
12011
|
] });
|
|
11997
12012
|
}
|
|
12013
|
+
function \u8F2A\u3092\u7D44\u3080(data, cx, cy, \u5916\u534A\u5F84, \u5185\u534A\u5F84, \u5272\u5408) {
|
|
12014
|
+
let cumAngle = -Math.PI / 2;
|
|
12015
|
+
let cumFrac = 0;
|
|
12016
|
+
return data.map((d, idx) => {
|
|
12017
|
+
const frac = \u5272\u5408[idx] ?? 0;
|
|
12018
|
+
const angle = frac * Math.PI * 2;
|
|
12019
|
+
const a0 = cumAngle;
|
|
12020
|
+
const a1 = cumAngle + angle;
|
|
12021
|
+
cumAngle = a1;
|
|
12022
|
+
const startFrac = cumFrac;
|
|
12023
|
+
cumFrac += frac;
|
|
12024
|
+
const x1 = cx + \u5916\u534A\u5F84 * Math.cos(a0);
|
|
12025
|
+
const y1 = cy + \u5916\u534A\u5F84 * Math.sin(a0);
|
|
12026
|
+
const x2 = cx + \u5916\u534A\u5F84 * Math.cos(a1);
|
|
12027
|
+
const y2 = cy + \u5916\u534A\u5F84 * Math.sin(a1);
|
|
12028
|
+
const x3 = cx + \u5185\u534A\u5F84 * Math.cos(a1);
|
|
12029
|
+
const y3 = cy + \u5185\u534A\u5F84 * Math.sin(a1);
|
|
12030
|
+
const x4 = cx + \u5185\u534A\u5F84 * Math.cos(a0);
|
|
12031
|
+
const y4 = cy + \u5185\u534A\u5F84 * Math.sin(a0);
|
|
12032
|
+
const large = angle > Math.PI ? 1 : 0;
|
|
12033
|
+
const path = `M ${x1} ${y1} A ${\u5916\u534A\u5F84} ${\u5916\u534A\u5F84} 0 ${large} 1 ${x2} ${y2} L ${x3} ${y3} A ${\u5185\u534A\u5F84} ${\u5185\u534A\u5F84} 0 ${large} 0 ${x4} ${y4} Z`;
|
|
12034
|
+
return { d, frac, path, startFrac, \u4E2D\u592E\u89D2: (a0 + a1) / 2 };
|
|
12035
|
+
});
|
|
12036
|
+
}
|
|
12037
|
+
function \u67A0(node, active) {
|
|
12038
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12039
|
+
"rect",
|
|
12040
|
+
{
|
|
12041
|
+
"data-cdl-role": "node-body",
|
|
12042
|
+
x: 0,
|
|
12043
|
+
y: 0,
|
|
12044
|
+
width: node.w,
|
|
12045
|
+
height: node.h,
|
|
12046
|
+
rx: 16,
|
|
12047
|
+
fill: "var(--cdl-node-fill, #ffffff)",
|
|
12048
|
+
stroke: active ? "var(--cdl-tone-accent, #2d6a8f)" : "var(--cdl-divider, #d4d4d8)",
|
|
12049
|
+
strokeWidth: active ? 3 : 1.25
|
|
12050
|
+
}
|
|
12051
|
+
);
|
|
12052
|
+
}
|
|
12053
|
+
function \u5F27\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing, progress }) {
|
|
12054
|
+
const PAD = 20;
|
|
12055
|
+
const \u540D\u524D\u306E\u7D1A = 14;
|
|
12056
|
+
const \u5272\u5408\u306E\u7D1A = 24;
|
|
12057
|
+
const \u5370\u304B\u3089\u540D\u524D\u307E\u30672 = 18;
|
|
12058
|
+
const \u540D\u524D\u304B\u3089\u5272\u5408\u307E\u3067 = 24;
|
|
12059
|
+
const \u5272\u5408\u306E\u6587\u5B57 = \u5272\u5408.map(\u5272\u5408\u8868\u8A18);
|
|
12060
|
+
const \u4E00\u89A7\u5E45 = 10 + \u5370\u304B\u3089\u540D\u524D\u307E\u30672 + Math.max(0, ...data.map((d) => textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A))) + \u540D\u524D\u304B\u3089\u5272\u5408\u307E\u3067 + Math.max(0, ...\u5272\u5408\u306E\u6587\u5B57.map((t) => textWidth(t, \u5272\u5408\u306E\u7D1A)));
|
|
12061
|
+
const \u7E26\u304B\u3089 = (node.h - PAD * 2) / 2;
|
|
12062
|
+
const \u6A2A\u304B\u3089 = (node.w - PAD * 2 - \u4E00\u89A7\u5E45 - 28) / 2;
|
|
12063
|
+
const R = Math.max(24, Math.min(\u7E26\u304B\u3089, \u6A2A\u304B\u3089));
|
|
12064
|
+
const cx = PAD + R;
|
|
12065
|
+
const cy = node.h / 2;
|
|
12066
|
+
const \u7A74 = R * 0.34;
|
|
12067
|
+
const \u523B\u307F = (R - \u7A74) / Math.max(1, data.length);
|
|
12068
|
+
const \u592A\u3055 = Math.max(3, \u523B\u307F * 0.6);
|
|
12069
|
+
const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
12070
|
+
const \u4E00\u89A7\u5DE6 = node.w - PAD - \u4E00\u89A7\u5E45;
|
|
12071
|
+
const \u884C\u306E\u9593 = Math.min(56, (node.h - PAD * 2) / Math.max(1, data.length));
|
|
12072
|
+
const \u4E00\u89A7\u4E0A = node.h / 2 - \u884C\u306E\u9593 * (data.length - 1) / 2;
|
|
12073
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
12074
|
+
\u67A0(node, active),
|
|
12075
|
+
data.map((d, idx) => {
|
|
12076
|
+
const r = R - \u592A\u3055 / 2 - idx * \u523B\u307F;
|
|
12077
|
+
if (r <= \u592A\u3055 / 2) return null;
|
|
12078
|
+
const \u53D6\u308A\u5206 = (\u5272\u5408[idx] ?? 0) * (drawing ? \u958B\u304D : 1);
|
|
12079
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
12080
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12081
|
+
"circle",
|
|
12082
|
+
{
|
|
12083
|
+
"data-cdl-role": "chart-pie-arc-track",
|
|
12084
|
+
cx,
|
|
12085
|
+
cy,
|
|
12086
|
+
r,
|
|
12087
|
+
fill: "none",
|
|
12088
|
+
stroke: "var(--cdl-divider, #d4d4d8)",
|
|
12089
|
+
strokeWidth: \u592A\u3055
|
|
12090
|
+
}
|
|
12091
|
+
),
|
|
12092
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12093
|
+
"path",
|
|
12094
|
+
{
|
|
12095
|
+
"data-cdl-role": "chart-pie-arc",
|
|
12096
|
+
"data-cdl-unresolved": d.unresolved ? "true" : void 0,
|
|
12097
|
+
d: \u5F27\u306E\u9053(cx, cy, r, \u53D6\u308A\u5206),
|
|
12098
|
+
fill: "none",
|
|
12099
|
+
stroke: sliceColor(d.tone, idx),
|
|
12100
|
+
strokeWidth: \u592A\u3055,
|
|
12101
|
+
strokeLinecap: "round"
|
|
12102
|
+
}
|
|
12103
|
+
)
|
|
12104
|
+
] }, `arc-${idx}`);
|
|
12105
|
+
}),
|
|
12106
|
+
data.map((d, idx) => {
|
|
12107
|
+
const y = \u4E00\u89A7\u4E0A + \u884C\u306E\u9593 * idx;
|
|
12108
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
12109
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12110
|
+
"rect",
|
|
12111
|
+
{
|
|
12112
|
+
x: \u4E00\u89A7\u5DE6,
|
|
12113
|
+
y: y - 9,
|
|
12114
|
+
width: 10,
|
|
12115
|
+
height: 10,
|
|
12116
|
+
rx: 2,
|
|
12117
|
+
fill: sliceColor(d.tone, idx)
|
|
12118
|
+
}
|
|
12119
|
+
),
|
|
12120
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12121
|
+
"text",
|
|
12122
|
+
{
|
|
12123
|
+
x: \u4E00\u89A7\u5DE6 + \u5370\u304B\u3089\u540D\u524D\u307E\u30672,
|
|
12124
|
+
y,
|
|
12125
|
+
fontSize: \u540D\u524D\u306E\u7D1A,
|
|
12126
|
+
fill: "var(--cdl-text, #1a1f2a)",
|
|
12127
|
+
children: d.label
|
|
12128
|
+
}
|
|
12129
|
+
),
|
|
12130
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12131
|
+
"text",
|
|
12132
|
+
{
|
|
12133
|
+
x: node.w - PAD,
|
|
12134
|
+
y: y + 4,
|
|
12135
|
+
textAnchor: "end",
|
|
12136
|
+
fontSize: \u5272\u5408\u306E\u7D1A,
|
|
12137
|
+
fontWeight: 600,
|
|
12138
|
+
fill: "var(--cdl-text, #1a1f2a)",
|
|
12139
|
+
children: \u5272\u5408\u306E\u6587\u5B57[idx]
|
|
12140
|
+
}
|
|
12141
|
+
)
|
|
12142
|
+
] }, `row-${idx}`);
|
|
12143
|
+
})
|
|
12144
|
+
] });
|
|
12145
|
+
}
|
|
12146
|
+
function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing, progress, instanceId }) {
|
|
12147
|
+
const PAD = 20;
|
|
12148
|
+
const \u898B\u51FA\u3057\u306E\u7D1A = 11;
|
|
12149
|
+
const \u540D\u524D\u306E\u7D1A = 15;
|
|
12150
|
+
const \u5272\u5408\u306E\u7D1A = 17;
|
|
12151
|
+
const \u5B9F\u6570\u306E\u7D1A = 15;
|
|
12152
|
+
const \u5370\u304B\u3089\u540D\u524D\u307E\u30672 = 18;
|
|
12153
|
+
const \u5272\u5408\u306E\u6587\u5B57 = \u5272\u5408.map(\u5272\u5408\u8868\u8A18);
|
|
12154
|
+
const \u5B9F\u6570\u306E\u6587\u5B57 = data.map((d) => \u5B9F\u5024\u8868\u8A18(d.value));
|
|
12155
|
+
const \u540D\u524D\u5E45 = Math.max(0, ...data.map((d) => textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A)));
|
|
12156
|
+
const \u5272\u5408\u5E45 = Math.max(textWidth("\u5272\u5408", \u898B\u51FA\u3057\u306E\u7D1A), ...\u5272\u5408\u306E\u6587\u5B57.map((t) => textWidth(t, \u5272\u5408\u306E\u7D1A)));
|
|
12157
|
+
const \u5B9F\u6570\u5E45 = Math.max(textWidth("\u5024", \u898B\u51FA\u3057\u306E\u7D1A), ...\u5B9F\u6570\u306E\u6587\u5B57.map((t) => textWidth(t, \u5B9F\u6570\u306E\u7D1A)));
|
|
12158
|
+
const \u8868\u5E45 = 10 + \u5370\u304B\u3089\u540D\u524D\u307E\u30672 + \u540D\u524D\u5E45 + 28 + \u5272\u5408\u5E45 + 24 + \u5B9F\u6570\u5E45;
|
|
12159
|
+
const \u7E26\u304B\u3089 = (node.h - PAD * 2) / 2;
|
|
12160
|
+
const \u6A2A\u304B\u3089 = (node.w - PAD * 2 - \u8868\u5E45 - 28) / 2;
|
|
12161
|
+
const R = Math.max(24, Math.min(\u7E26\u304B\u3089, \u6A2A\u304B\u3089));
|
|
12162
|
+
const \u5185\u534A\u5F84 = R * 0.58;
|
|
12163
|
+
const cx = PAD + R;
|
|
12164
|
+
const cy = node.h / 2;
|
|
12165
|
+
const \u8868\u5DE6 = node.w - PAD - \u8868\u5E45;
|
|
12166
|
+
const \u53F3\u7AEF = node.w - PAD;
|
|
12167
|
+
const \u5272\u5408\u53F3 = \u53F3\u7AEF - \u5B9F\u6570\u5E45 - 24;
|
|
12168
|
+
const \u884C\u306E\u9593 = Math.min(52, (node.h - PAD * 2 - 40) / Math.max(1, data.length));
|
|
12169
|
+
const \u898B\u51FA\u3057\u306Ey = node.h / 2 - \u884C\u306E\u9593 * data.length / 2 - 14;
|
|
12170
|
+
const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
12171
|
+
const \u5207\u308A\u629C\u304Did = `cdl-pie-draw-${instanceId}`;
|
|
12172
|
+
const \u958B\u304D\u59CB\u3081\u305F = (\u59CB\u307E\u308A) => !drawing || \u958B\u304D > \u59CB\u307E\u308A;
|
|
12173
|
+
let \u89D2 = -Math.PI / 2;
|
|
12174
|
+
let \u7D2F\u8A08 = 0;
|
|
12175
|
+
const \u6247\u305F\u3061 = data.map((d, idx) => {
|
|
12176
|
+
const frac = \u5272\u5408[idx] ?? 0;
|
|
12177
|
+
const a0 = \u89D2;
|
|
12178
|
+
const a1 = \u89D2 + frac * Math.PI * 2;
|
|
12179
|
+
\u89D2 = a1;
|
|
12180
|
+
const \u59CB\u307E\u308A = \u7D2F\u8A08;
|
|
12181
|
+
\u7D2F\u8A08 += frac;
|
|
12182
|
+
return { d, idx, \u59CB\u307E\u308A, path: \u8F2A\u306E\u9053(cx, cy, R, \u5185\u534A\u5F84, a0, a1) };
|
|
12183
|
+
});
|
|
12184
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
12185
|
+
\u67A0(node, active),
|
|
12186
|
+
drawing && /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: \u5207\u308A\u629C\u304Did, children: \u6247\u5F62\u306E\u5207\u308A\u629C\u304D(cx, cy, R + 2, \u958B\u304D) }) }),
|
|
12187
|
+
/* @__PURE__ */ jsxRuntime.jsx("g", { ...drawing ? { clipPath: `url(#${\u5207\u308A\u629C\u304Did})` } : {}, children: \u6247\u305F\u3061.map((s) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
12188
|
+
"path",
|
|
12189
|
+
{
|
|
12190
|
+
"data-cdl-role": "chart-pie-slice",
|
|
12191
|
+
"data-cdl-unresolved": s.d.unresolved ? "true" : void 0,
|
|
12192
|
+
d: s.path,
|
|
12193
|
+
fill: sliceColor(s.d.tone, s.idx),
|
|
12194
|
+
stroke: "var(--cdl-node-fill, #ffffff)",
|
|
12195
|
+
strokeWidth: 3,
|
|
12196
|
+
strokeLinejoin: "round"
|
|
12197
|
+
},
|
|
12198
|
+
`slice-${s.idx}`
|
|
12199
|
+
)) }),
|
|
12200
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12201
|
+
"text",
|
|
12202
|
+
{
|
|
12203
|
+
x: cx,
|
|
12204
|
+
y: cy - 2,
|
|
12205
|
+
textAnchor: "middle",
|
|
12206
|
+
fontSize: Math.round(R * 0.26),
|
|
12207
|
+
fontWeight: 600,
|
|
12208
|
+
fill: "var(--cdl-text, #1a1f2a)",
|
|
12209
|
+
children: \u5B9F\u5024\u8868\u8A18(Math.round(data.reduce((acc, d) => acc + d.value, 0)))
|
|
12210
|
+
}
|
|
12211
|
+
),
|
|
12212
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12213
|
+
"text",
|
|
12214
|
+
{
|
|
12215
|
+
x: cx,
|
|
12216
|
+
y: cy + Math.round(R * 0.2),
|
|
12217
|
+
textAnchor: "middle",
|
|
12218
|
+
fontSize: Math.round(R * 0.12),
|
|
12219
|
+
fill: "var(--cdl-text-dim, #5a6270)",
|
|
12220
|
+
children: "\u5408\u8A08"
|
|
12221
|
+
}
|
|
12222
|
+
),
|
|
12223
|
+
/* @__PURE__ */ jsxRuntime.jsx("text", { x: \u8868\u5DE6, y: \u898B\u51FA\u3057\u306Ey, fontSize: \u898B\u51FA\u3057\u306E\u7D1A, fill: "var(--cdl-text-dim, #5a6270)", children: "\u5185\u8A33" }),
|
|
12224
|
+
/* @__PURE__ */ jsxRuntime.jsx("text", { x: \u5272\u5408\u53F3, y: \u898B\u51FA\u3057\u306Ey, textAnchor: "end", fontSize: \u898B\u51FA\u3057\u306E\u7D1A, fill: "var(--cdl-text-dim, #5a6270)", children: "\u5272\u5408" }),
|
|
12225
|
+
/* @__PURE__ */ jsxRuntime.jsx("text", { x: \u53F3\u7AEF, y: \u898B\u51FA\u3057\u306Ey, textAnchor: "end", fontSize: \u898B\u51FA\u3057\u306E\u7D1A, fill: "var(--cdl-text-dim, #5a6270)", children: "\u5024" }),
|
|
12226
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12227
|
+
"line",
|
|
12228
|
+
{
|
|
12229
|
+
"data-cdl-role": "chart-pie-table-rule",
|
|
12230
|
+
x1: \u8868\u5DE6,
|
|
12231
|
+
y1: \u898B\u51FA\u3057\u306Ey + 10,
|
|
12232
|
+
x2: \u53F3\u7AEF,
|
|
12233
|
+
y2: \u898B\u51FA\u3057\u306Ey + 10,
|
|
12234
|
+
stroke: "var(--cdl-text, #1a1f2a)",
|
|
12235
|
+
strokeWidth: 1.2
|
|
12236
|
+
}
|
|
12237
|
+
),
|
|
12238
|
+
\u6247\u305F\u3061.map((s) => {
|
|
12239
|
+
if (!\u958B\u304D\u59CB\u3081\u305F(s.\u59CB\u307E\u308A)) return null;
|
|
12240
|
+
const y = \u898B\u51FA\u3057\u306Ey + 40 + \u884C\u306E\u9593 * s.idx;
|
|
12241
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
12242
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: \u8868\u5DE6, y: y - 10, width: 10, height: 10, rx: 2, fill: sliceColor(s.d.tone, s.idx) }),
|
|
12243
|
+
/* @__PURE__ */ jsxRuntime.jsx("text", { x: \u8868\u5DE6 + \u5370\u304B\u3089\u540D\u524D\u307E\u30672, y, fontSize: \u540D\u524D\u306E\u7D1A, fill: "var(--cdl-text, #1a1f2a)", children: s.d.label }),
|
|
12244
|
+
/* @__PURE__ */ jsxRuntime.jsx("text", { x: \u5272\u5408\u53F3, y, textAnchor: "end", fontSize: \u5272\u5408\u306E\u7D1A, fontWeight: 600, fill: "var(--cdl-text, #1a1f2a)", children: \u5272\u5408\u306E\u6587\u5B57[s.idx] }),
|
|
12245
|
+
/* @__PURE__ */ jsxRuntime.jsx("text", { x: \u53F3\u7AEF, y, textAnchor: "end", fontSize: \u5B9F\u6570\u306E\u7D1A, fill: "var(--cdl-text-dim, #5a6270)", children: \u5B9F\u6570\u306E\u6587\u5B57[s.idx] }),
|
|
12246
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12247
|
+
"line",
|
|
12248
|
+
{
|
|
12249
|
+
"data-cdl-role": "chart-pie-table-rule",
|
|
12250
|
+
x1: \u8868\u5DE6,
|
|
12251
|
+
y1: y + 16,
|
|
12252
|
+
x2: \u53F3\u7AEF,
|
|
12253
|
+
y2: y + 16,
|
|
12254
|
+
stroke: "var(--cdl-divider, #d4d4d8)",
|
|
12255
|
+
strokeWidth: 1
|
|
12256
|
+
}
|
|
12257
|
+
)
|
|
12258
|
+
] }, `row-${s.idx}`);
|
|
12259
|
+
})
|
|
12260
|
+
] });
|
|
12261
|
+
}
|
|
12262
|
+
function \u5F27\u306E\u9053(cx, cy, r, \u53D6\u308A\u5206) {
|
|
12263
|
+
const \u5B9F\u52B9 = Math.max(0, Math.min(0.9999, \u53D6\u308A\u5206));
|
|
12264
|
+
const a0 = -Math.PI / 2;
|
|
12265
|
+
const a1 = a0 + \u5B9F\u52B9 * Math.PI * 2;
|
|
12266
|
+
const large = \u5B9F\u52B9 > 0.5 ? 1 : 0;
|
|
12267
|
+
return `M ${cx + r * Math.cos(a0)} ${cy + r * Math.sin(a0)} A ${r} ${r} 0 ${large} 1 ${cx + r * Math.cos(a1)} ${cy + r * Math.sin(a1)}`;
|
|
12268
|
+
}
|
|
12269
|
+
function \u8F2A\u306E\u9053(cx, cy, R, r, a0, a1) {
|
|
12270
|
+
const large = a1 - a0 > Math.PI ? 1 : 0;
|
|
12271
|
+
return `M ${cx + R * Math.cos(a0)} ${cy + R * Math.sin(a0)} A ${R} ${R} 0 ${large} 1 ${cx + R * Math.cos(a1)} ${cy + R * Math.sin(a1)} L ${cx + r * Math.cos(a1)} ${cy + r * Math.sin(a1)} A ${r} ${r} 0 ${large} 0 ${cx + r * Math.cos(a0)} ${cy + r * Math.sin(a0)} Z`;
|
|
12272
|
+
}
|
|
11998
12273
|
function \u6247\u5F62\u306E\u5207\u308A\u629C\u304D(cx, cy, r, \u958B\u304D) {
|
|
11999
12274
|
if (\u958B\u304D <= 0) return null;
|
|
12000
12275
|
if (\u958B\u304D >= 1) return /* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy, r });
|
|
@@ -12196,8 +12471,8 @@ function ChartRadialNode({
|
|
|
12196
12471
|
frac,
|
|
12197
12472
|
\u4E2D\u5FC3\u534A\u5F84,
|
|
12198
12473
|
// 軌道は全周。 1 周ちょうどは弧で表せないので、 わずかに欠かして描く
|
|
12199
|
-
\u8ECC\u9053: \u5F27\u306E\
|
|
12200
|
-
\u53D6\u308A\u5206: frac <= 0 ? null : \u5F27\u306E\
|
|
12474
|
+
\u8ECC\u9053: \u5F27\u306E\u90532(\u5F27\u306Ecx, cy, \u4E2D\u5FC3\u534A\u5F84, \u5E2F\u306E\u5E45, 0.9999),
|
|
12475
|
+
\u53D6\u308A\u5206: frac <= 0 ? null : \u5F27\u306E\u90532(\u5F27\u306Ecx, cy, \u4E2D\u5FC3\u534A\u5F84, \u5E2F\u306E\u5E45, Math.min(frac, 0.9999))
|
|
12201
12476
|
};
|
|
12202
12477
|
});
|
|
12203
12478
|
const \u4E00\u89A7\u306E\u59CB\u307E\u308A = PAD + (\u4F7F\u3048\u308B\u9AD8\u3055 - \u884C\u306E\u9AD8\u3055 * data.length) / 2 + \u884C\u306E\u9AD8\u3055 / 2;
|
|
@@ -12268,7 +12543,7 @@ function ChartRadialNode({
|
|
|
12268
12543
|
] });
|
|
12269
12544
|
}
|
|
12270
12545
|
var \u5370\u306E\u5E45 = 18;
|
|
12271
|
-
function \u5F27\u306E\
|
|
12546
|
+
function \u5F27\u306E\u90532(cx, cy, \u4E2D\u5FC3\u534A\u5F84, \u5E45, \u5272\u5408) {
|
|
12272
12547
|
const \u5916 = \u4E2D\u5FC3\u534A\u5F84 + \u5E45 / 2;
|
|
12273
12548
|
const \u5185 = Math.max(0.5, \u4E2D\u5FC3\u534A\u5F84 - \u5E45 / 2);
|
|
12274
12549
|
const a0 = -Math.PI / 2;
|
|
@@ -12314,12 +12589,12 @@ function ChartStatNode({
|
|
|
12314
12589
|
}
|
|
12315
12590
|
),
|
|
12316
12591
|
data.map((d, idx) => {
|
|
12317
|
-
const \
|
|
12592
|
+
const \u67A02 = \u533A\u753B.\u67A0(idx);
|
|
12318
12593
|
const frac = total > 0 ? d.value / total : 0;
|
|
12319
12594
|
const \u8272 = \u5370\u306E\u8272(d.tone, idx);
|
|
12320
12595
|
const \u6570\u5024 = \u5B9F\u5024\u8868\u8A184(d.value);
|
|
12321
|
-
const \u6570\u5024\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A(\u6570\u5024, \
|
|
12322
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-role": "chart-stat-item", transform: `translate(${\
|
|
12596
|
+
const \u6570\u5024\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A(\u6570\u5024, \u67A02.w - \u533A\u753B.\u4F59\u767D * 2, \u533A\u753B.\u6570\u5024\u306E\u7D1A, \u533A\u753B.\u540D\u524D\u306E\u7D1A + 1);
|
|
12597
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-role": "chart-stat-item", transform: `translate(${\u67A02.x} ${\u67A02.y})`, children: [
|
|
12323
12598
|
idx > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12324
12599
|
"line",
|
|
12325
12600
|
{
|
|
@@ -12327,7 +12602,7 @@ function ChartStatNode({
|
|
|
12327
12602
|
x1: 0,
|
|
12328
12603
|
y1: \u533A\u753B.\u4F59\u767D,
|
|
12329
12604
|
x2: 0,
|
|
12330
|
-
y2: \
|
|
12605
|
+
y2: \u67A02.h - \u533A\u753B.\u4F59\u767D,
|
|
12331
12606
|
stroke: "var(--cdl-divider, #d4d4d8)",
|
|
12332
12607
|
strokeWidth: 1
|
|
12333
12608
|
}
|
|
@@ -12336,7 +12611,7 @@ function ChartStatNode({
|
|
|
12336
12611
|
"text",
|
|
12337
12612
|
{
|
|
12338
12613
|
"data-cdl-role": "chart-stat-label",
|
|
12339
|
-
x: \
|
|
12614
|
+
x: \u67A02.w / 2,
|
|
12340
12615
|
y: \u533A\u753B.\u540D\u524D\u306Ey,
|
|
12341
12616
|
fontSize: \u533A\u753B.\u540D\u524D\u306E\u7D1A,
|
|
12342
12617
|
fontWeight: 700,
|
|
@@ -12350,7 +12625,7 @@ function ChartStatNode({
|
|
|
12350
12625
|
{
|
|
12351
12626
|
"data-cdl-role": "chart-stat-value",
|
|
12352
12627
|
"data-cdl-unresolved": d.unresolved ? "true" : void 0,
|
|
12353
|
-
x: \
|
|
12628
|
+
x: \u67A02.w / 2,
|
|
12354
12629
|
y: \u533A\u753B.\u6570\u5024\u306Ey,
|
|
12355
12630
|
fontSize: \u6570\u5024\u306E\u7D1A,
|
|
12356
12631
|
fontWeight: 700,
|
|
@@ -12363,7 +12638,7 @@ function ChartStatNode({
|
|
|
12363
12638
|
"circle",
|
|
12364
12639
|
{
|
|
12365
12640
|
"data-cdl-role": "chart-stat-track",
|
|
12366
|
-
cx: \
|
|
12641
|
+
cx: \u67A02.w / 2,
|
|
12367
12642
|
cy: \u533A\u753B.\u5F27\u306Ey,
|
|
12368
12643
|
r: \u533A\u753B.\u5F27\u306E\u534A\u5F84,
|
|
12369
12644
|
fill: "none",
|
|
@@ -12376,7 +12651,7 @@ function ChartStatNode({
|
|
|
12376
12651
|
"path",
|
|
12377
12652
|
{
|
|
12378
12653
|
"data-cdl-role": "chart-stat-arc",
|
|
12379
|
-
d: \u5F27\u306E\
|
|
12654
|
+
d: \u5F27\u306E\u90533(\u67A02.w / 2, \u533A\u753B.\u5F27\u306Ey, \u533A\u753B.\u5F27\u306E\u534A\u5F84, Math.min(frac, 0.9999)),
|
|
12380
12655
|
fill: "none",
|
|
12381
12656
|
stroke: \u8272,
|
|
12382
12657
|
strokeWidth: \u533A\u753B.\u5F27\u306E\u592A\u3055,
|
|
@@ -12387,7 +12662,7 @@ function ChartStatNode({
|
|
|
12387
12662
|
"text",
|
|
12388
12663
|
{
|
|
12389
12664
|
"data-cdl-role": "chart-stat-share",
|
|
12390
|
-
x: \
|
|
12665
|
+
x: \u67A02.w / 2,
|
|
12391
12666
|
y: \u533A\u753B.\u5272\u5408\u306Ey,
|
|
12392
12667
|
fontSize: \u533A\u753B.\u5272\u5408\u306E\u7D1A,
|
|
12393
12668
|
textAnchor: "middle",
|
|
@@ -12432,7 +12707,7 @@ function \u53CE\u3081\u308B\u7D1A(\u5B57, \u4F7F\u3048\u308B\u5E452, \u521D\u671
|
|
|
12432
12707
|
while (\u7D1A > \u4E0B\u9650 && textWidth(\u5B57, \u7D1A) > \u4F7F\u3048\u308B\u5E452) \u7D1A -= 1;
|
|
12433
12708
|
return \u7D1A;
|
|
12434
12709
|
}
|
|
12435
|
-
function \u5F27\u306E\
|
|
12710
|
+
function \u5F27\u306E\u90533(cx, cy, r, \u5272\u5408) {
|
|
12436
12711
|
const a0 = -Math.PI / 2;
|
|
12437
12712
|
const a1 = a0 + \u5272\u5408 * Math.PI * 2;
|
|
12438
12713
|
const large = \u5272\u5408 > 0.5 ? 1 : 0;
|