@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/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,14 @@ CDL (Chainome Diagram Language) の主要変更履歴。
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.32.0] - 2026-09-07
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **円グラフで datum の `previous` を内側の輪として描けるようになった** (#680)
|
|
13
|
+
- **円グラフの名札で割合を主役にした** (#683)。 1 行目が割合 (級 19 の太字)、2 行目が名前 (級 12)。 実数は割合と違う数になる図でだけ 2 行目に添える
|
|
14
|
+
- **円グラフの見せ方を記法から選べるようになった** (#684)。 `chartPieForm` に `arcs` (系列ごとに 1 本の弧) と `table` (図と表を左右に据える) を書ける。 欄を書かない図は今までどおりの輪
|
|
15
|
+
|
|
8
16
|
## [0.31.1] - 2026-09-06
|
|
9
17
|
|
|
10
18
|
### Fixed
|
|
@@ -1621,7 +1629,8 @@ Initial OSS release.
|
|
|
1621
1629
|
使わない = annotated tag を push しても GitHub Release は作られず、 Release を作っていない版で
|
|
1622
1630
|
行き止まりになる。
|
|
1623
1631
|
|
|
1624
|
-
[Unreleased]: https://github.com/cardene777/cdl/compare/v0.
|
|
1632
|
+
[Unreleased]: https://github.com/cardene777/cdl/compare/v0.32.0...HEAD
|
|
1633
|
+
[0.32.0]: https://github.com/cardene777/cdl/compare/v0.31.1...v0.32.0
|
|
1625
1634
|
[0.31.1]: https://github.com/cardene777/cdl/compare/v0.31.0...v0.31.1
|
|
1626
1635
|
[0.31.0]: https://github.com/cardene777/cdl/compare/v0.30.3...v0.31.0
|
|
1627
1636
|
[0.30.3]: https://github.com/cardene777/cdl/compare/v0.30.2...v0.30.3
|
package/README.md
CHANGED
|
@@ -244,6 +244,46 @@ state placeholder は node の `title` / `subtitle` / `eyebrow` / `value` 内で
|
|
|
244
244
|
|
|
245
245
|
phase 切替に連動して `status: idle` → `status: running` のように描画される。
|
|
246
246
|
|
|
247
|
+
## 2 時点の構成比
|
|
248
|
+
|
|
249
|
+
`chart-pie` と `chart-stacked-bar` は datum の `previous` で前の時点を受け取る。
|
|
250
|
+
`previous` を 1 件でも書くと、書かない datum も前の時点では 0 として扱うため、系列の色と
|
|
251
|
+
並びが時点間で対応する。
|
|
252
|
+
|
|
253
|
+
```ts
|
|
254
|
+
.node("share", {
|
|
255
|
+
lane: "l",
|
|
256
|
+
stack: 0,
|
|
257
|
+
kind: "chart-pie",
|
|
258
|
+
chartData: [
|
|
259
|
+
{ label: "Web", previous: 45, value: 30 },
|
|
260
|
+
{ label: "Mobile", previous: 35, value: 45 },
|
|
261
|
+
{ label: "API", value: 25 },
|
|
262
|
+
],
|
|
263
|
+
})
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
`chart-pie` は前を内側、今を外側の輪で描き、名札には `45 → 30 30%` の形で今の割合を添える。
|
|
267
|
+
`chart-stacked-bar` は前から今の順に帯を並べる。`previous` を書かない図は、どちらも今だけを描く。
|
|
268
|
+
3 時点以上は持たない。
|
|
269
|
+
|
|
270
|
+
## 円グラフの見せ方
|
|
271
|
+
|
|
272
|
+
`chart-pie` は `chartPieForm` で見せ方を選ぶ。 欄を書かない図は `ring` と同じ。
|
|
273
|
+
|
|
274
|
+
| 値 | 形 | 向くもの |
|
|
275
|
+
|---|---|---|
|
|
276
|
+
| `ring` (既定) | 輪を扇に切り分け、外へ引き出し線を伸ばして名札を置く | 内訳の割合をひとめで見せる |
|
|
277
|
+
| `arcs` | 系列ごとに 1 本の弧を置き、割合を角度ではなく弧の長さで読む | 合計が 100 にならない図 (系列ごとの達成率など) |
|
|
278
|
+
| `table` | 輪を左に寄せ、右に 名前 / 割合 / 実数 の 3 列の表を組む | 割合と実数の両方を読ませたい図 |
|
|
279
|
+
|
|
280
|
+
```ts
|
|
281
|
+
.node("share", { lane: "l", stack: 0, kind: "chart-pie", chartPieForm: "arcs", chartData: [...] })
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
型の外の値を書いた図は `ring` として描く。 `previous` が効くのは `ring` だけで、
|
|
285
|
+
他の形では内側の輪を描かない。
|
|
286
|
+
|
|
247
287
|
## CdlDiagramView props
|
|
248
288
|
|
|
249
289
|
```ts
|
package/dist/index.cjs
CHANGED
|
@@ -15920,10 +15920,10 @@ function countEdgeCrossings(edges, warnAt = 3) {
|
|
|
15920
15920
|
if (isNearAny(p, a.ends, SAME_POINT_TOL) || isNearAny(p, b.ends, SAME_POINT_TOL))
|
|
15921
15921
|
continue;
|
|
15922
15922
|
if (\u5171\u6709\u5074.length > 0) {
|
|
15923
|
-
const \
|
|
15924
|
-
const \u4E88\u7B97 = { \u6B8B\u308A: Math.max(0, \
|
|
15923
|
+
const \u67A02 = Math.min(MAX_CHECKS - checks, MAX_CHECKS_PER_PAIR - pairChecks);
|
|
15924
|
+
const \u4E88\u7B97 = { \u6B8B\u308A: Math.max(0, \u67A02) };
|
|
15925
15925
|
const \u5224\u5B9A = mergesTowardShared(a.flat, b.flat, p, \u5171\u6709\u5074, MERGE_TOL, \u4E88\u7B97);
|
|
15926
|
-
const \u4F7F\u3063\u305F = Math.max(0, \
|
|
15926
|
+
const \u4F7F\u3063\u305F = Math.max(0, \u67A02) - \u4E88\u7B97.\u6B8B\u308A;
|
|
15927
15927
|
checks += \u4F7F\u3063\u305F;
|
|
15928
15928
|
pairChecks += \u4F7F\u3063\u305F;
|
|
15929
15929
|
if (\u5224\u5B9A === "merged") continue;
|
|
@@ -24343,52 +24343,52 @@ function ChartPieNode({
|
|
|
24343
24343
|
const y0 = node.cy - node.h / 2;
|
|
24344
24344
|
const data = resolveChartData(node.chartData ?? [], stateValues);
|
|
24345
24345
|
const total = data.reduce((acc, d) => acc + d.value, 0) || 1;
|
|
24346
|
+
const \u524D\u3042\u308A = data.some((d) => d.previous !== void 0);
|
|
24347
|
+
const \u4ECA\u306E\u5024 = data.map((d) => Math.max(0, d.value));
|
|
24348
|
+
const \u524D\u306E\u5024 = data.map((d) => Math.max(0, d.previous ?? 0));
|
|
24349
|
+
const \u4ECA\u306E\u5408\u8A08 = \u4ECA\u306E\u5024.reduce((acc, value) => acc + value, 0);
|
|
24350
|
+
const \u524D\u306E\u5408\u8A08 = \u524D\u306E\u5024.reduce((acc, value) => acc + value, 0);
|
|
24351
|
+
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);
|
|
24352
|
+
const \u524D\u306E\u5272\u5408 = \u524D\u306E\u5024.map((value) => \u524D\u306E\u5408\u8A08 > 0 ? value / \u524D\u306E\u5408\u8A08 : 0);
|
|
24353
|
+
const \u5F62 = node.chartPieForm === "arcs" || node.chartPieForm === "table" ? node.chartPieForm : "ring";
|
|
24346
24354
|
const PAD_TOP2 = 20;
|
|
24347
24355
|
const PAD_BOTTOM2 = 20;
|
|
24348
24356
|
const PAD_SIDE = 20;
|
|
24349
24357
|
const chartAreaH = node.h - PAD_TOP2 - PAD_BOTTOM2;
|
|
24350
|
-
const \
|
|
24351
|
-
const \
|
|
24358
|
+
const \u5272\u5408\u306E\u7D1A = 19;
|
|
24359
|
+
const \u540D\u524D\u306E\u7D1A = 12;
|
|
24352
24360
|
const \u5F15\u304D\u51FA\u3057 = 18;
|
|
24353
24361
|
const \u5B57\u307E\u3067\u306E\u9593 = 26;
|
|
24354
24362
|
const \u540D\u672D\u306E\u7E26\u306E\u5F35\u308A\u51FA\u3057 = 20;
|
|
24355
|
-
const \u5272\u5408\u306E\u6587\u5B57 =
|
|
24356
|
-
const \
|
|
24363
|
+
const \u5272\u5408\u306E\u6587\u5B57 = \u4ECA\u306E\u5272\u5408.map(\u5272\u5408\u8868\u8A18);
|
|
24364
|
+
const \u540D\u524D\u306E\u6587\u5B57 = data.map((d, i) => {
|
|
24365
|
+
const \u540D = d.label ?? "";
|
|
24366
|
+
if (\u524D\u3042\u308A) return `${\u540D} ${\u5B9F\u5024\u8868\u8A18(\u524D\u306E\u5024[i])} \u2192 ${\u5B9F\u5024\u8868\u8A18(\u4ECA\u306E\u5024[i])}`;
|
|
24367
|
+
return `${\u5B9F\u5024\u8868\u8A18(d.value)}%` === \u5272\u5408\u306E\u6587\u5B57[i] ? \u540D : `${\u540D} ${\u5B9F\u5024\u8868\u8A18(d.value)}`;
|
|
24368
|
+
});
|
|
24369
|
+
if (\u5F62 !== "ring") {
|
|
24370
|
+
const \u5171\u901A = { node, active, data, \u5272\u5408: \u4ECA\u306E\u5272\u5408, x0, y0, drawing, progress, instanceId };
|
|
24371
|
+
return \u5F62 === "arcs" ? \u5F27\u306E\u5F62(\u5171\u901A) : \u8868\u306E\u5F62(\u5171\u901A);
|
|
24372
|
+
}
|
|
24357
24373
|
const \u540D\u672D\u5E45 = Math.max(
|
|
24358
24374
|
0,
|
|
24359
24375
|
...data.map(
|
|
24360
|
-
(
|
|
24376
|
+
(_d, i) => Math.max(
|
|
24377
|
+
textWidth(\u5272\u5408\u306E\u6587\u5B57[i] ?? "", \u5272\u5408\u306E\u7D1A),
|
|
24378
|
+
textWidth(\u540D\u524D\u306E\u6587\u5B57[i] ?? "", \u540D\u524D\u306E\u7D1A)
|
|
24379
|
+
)
|
|
24361
24380
|
)
|
|
24362
24381
|
);
|
|
24363
24382
|
const \u7E26\u304B\u3089 = chartAreaH / 2 - \u5F15\u304D\u51FA\u3057 - \u540D\u672D\u306E\u7E26\u306E\u5F35\u308A\u51FA\u3057;
|
|
24364
24383
|
const \u6A2A\u304B\u3089 = (node.w - PAD_SIDE * 2) / 2 - \u5F15\u304D\u51FA\u3057 - \u5B57\u307E\u3067\u306E\u9593 - \u540D\u672D\u5E45;
|
|
24365
24384
|
const radius = Math.max(24, Math.min(\u7E26\u304B\u3089, \u6A2A\u304B\u3089));
|
|
24366
|
-
const \u5185\u534A\u5F84 = radius * 0.58;
|
|
24385
|
+
const \u5916\u306E\u5185\u534A\u5F84 = radius * (\u524D\u3042\u308A ? 0.75 : 0.58);
|
|
24386
|
+
const \u524D\u306E\u5916\u534A\u5F84 = radius * 0.67;
|
|
24387
|
+
const \u524D\u306E\u5185\u534A\u5F84 = radius * 0.42;
|
|
24367
24388
|
const cx = node.w / 2;
|
|
24368
24389
|
const cy = PAD_TOP2 + chartAreaH / 2;
|
|
24369
|
-
|
|
24370
|
-
|
|
24371
|
-
const slices = data.map((d) => {
|
|
24372
|
-
const frac = d.value / total;
|
|
24373
|
-
const angle = frac * Math.PI * 2;
|
|
24374
|
-
const a0 = cumAngle;
|
|
24375
|
-
const a1 = cumAngle + angle;
|
|
24376
|
-
cumAngle = a1;
|
|
24377
|
-
const startFrac = cumFrac;
|
|
24378
|
-
cumFrac += frac;
|
|
24379
|
-
const x1 = cx + radius * Math.cos(a0);
|
|
24380
|
-
const y1 = cy + radius * Math.sin(a0);
|
|
24381
|
-
const x2 = cx + radius * Math.cos(a1);
|
|
24382
|
-
const y2 = cy + radius * Math.sin(a1);
|
|
24383
|
-
const x3 = cx + \u5185\u534A\u5F84 * Math.cos(a1);
|
|
24384
|
-
const y3 = cy + \u5185\u534A\u5F84 * Math.sin(a1);
|
|
24385
|
-
const x4 = cx + \u5185\u534A\u5F84 * Math.cos(a0);
|
|
24386
|
-
const y4 = cy + \u5185\u534A\u5F84 * Math.sin(a0);
|
|
24387
|
-
const large = angle > Math.PI ? 1 : 0;
|
|
24388
|
-
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`;
|
|
24389
|
-
const \u4E2D\u592E\u89D2 = (a0 + a1) / 2;
|
|
24390
|
-
return { d, frac, path, startFrac, \u4E2D\u592E\u89D2 };
|
|
24391
|
-
});
|
|
24390
|
+
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) : [];
|
|
24391
|
+
const slices = \u8F2A\u3092\u7D44\u3080(data, cx, cy, radius, \u5916\u306E\u5185\u534A\u5F84, \u4ECA\u306E\u5272\u5408);
|
|
24392
24392
|
const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
24393
24393
|
const \u5207\u308A\u629C\u304Did = `cdl-pie-draw-${instanceId}`;
|
|
24394
24394
|
const \u5F71id = `cdl-pie-shadow-${instanceId}`;
|
|
@@ -24412,19 +24412,34 @@ function ChartPieNode({
|
|
|
24412
24412
|
drawing && /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: \u5207\u308A\u629C\u304Did, children: \u6247\u5F62\u306E\u5207\u308A\u629C\u304D(cx, cy, radius + 2, \u958B\u304D) }),
|
|
24413
24413
|
/* @__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" }) })
|
|
24414
24414
|
] }),
|
|
24415
|
-
/* @__PURE__ */ jsxRuntime.
|
|
24416
|
-
|
|
24417
|
-
|
|
24418
|
-
|
|
24419
|
-
|
|
24420
|
-
|
|
24421
|
-
|
|
24422
|
-
|
|
24423
|
-
|
|
24424
|
-
|
|
24425
|
-
|
|
24426
|
-
|
|
24427
|
-
|
|
24415
|
+
/* @__PURE__ */ jsxRuntime.jsxs("g", { ...drawing ? { clipPath: `url(#${\u5207\u308A\u629C\u304Did})` } : {}, filter: `url(#${\u5F71id})`, children: [
|
|
24416
|
+
\u524D\u306Eslices.map((s, idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
24417
|
+
"path",
|
|
24418
|
+
{
|
|
24419
|
+
"data-cdl-role": "chart-pie-slice-previous",
|
|
24420
|
+
"data-cdl-unresolved": s.d.unresolved ? "true" : void 0,
|
|
24421
|
+
d: s.path,
|
|
24422
|
+
fill: sliceColor(s.d.tone, idx),
|
|
24423
|
+
stroke: "var(--cdl-node-fill, #ffffff)",
|
|
24424
|
+
strokeWidth: 3,
|
|
24425
|
+
strokeLinejoin: "round"
|
|
24426
|
+
},
|
|
24427
|
+
`slice-previous-${idx}`
|
|
24428
|
+
)),
|
|
24429
|
+
slices.map((s, idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
24430
|
+
"path",
|
|
24431
|
+
{
|
|
24432
|
+
"data-cdl-role": "chart-pie-slice",
|
|
24433
|
+
"data-cdl-unresolved": s.d.unresolved ? "true" : void 0,
|
|
24434
|
+
d: s.path,
|
|
24435
|
+
fill: sliceColor(s.d.tone, idx),
|
|
24436
|
+
stroke: "var(--cdl-node-fill, #ffffff)",
|
|
24437
|
+
strokeWidth: 3,
|
|
24438
|
+
strokeLinejoin: "round"
|
|
24439
|
+
},
|
|
24440
|
+
`slice-${idx}`
|
|
24441
|
+
))
|
|
24442
|
+
] }),
|
|
24428
24443
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
24429
24444
|
"text",
|
|
24430
24445
|
{
|
|
@@ -24434,7 +24449,7 @@ function ChartPieNode({
|
|
|
24434
24449
|
fontSize: Math.round(radius * 0.26),
|
|
24435
24450
|
fontWeight: 600,
|
|
24436
24451
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
24437
|
-
children: \u5B9F\u5024\u8868\u8A18(Math.round(total))
|
|
24452
|
+
children: \u5B9F\u5024\u8868\u8A18(Math.round(\u524D\u3042\u308A ? \u4ECA\u306E\u5408\u8A08 : total))
|
|
24438
24453
|
}
|
|
24439
24454
|
),
|
|
24440
24455
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -24471,12 +24486,12 @@ function ChartPieNode({
|
|
|
24471
24486
|
"text",
|
|
24472
24487
|
{
|
|
24473
24488
|
x: \u5B57x,
|
|
24474
|
-
y: \u6298\u308Cy -
|
|
24489
|
+
y: \u6298\u308Cy - 1,
|
|
24475
24490
|
textAnchor: \u53F3 ? "start" : "end",
|
|
24476
|
-
fontSize: \
|
|
24491
|
+
fontSize: \u5272\u5408\u306E\u7D1A,
|
|
24477
24492
|
fontWeight: 600,
|
|
24478
24493
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
24479
|
-
children:
|
|
24494
|
+
children: \u5272\u5408\u306E\u6587\u5B57[idx]
|
|
24480
24495
|
}
|
|
24481
24496
|
),
|
|
24482
24497
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -24485,15 +24500,275 @@ function ChartPieNode({
|
|
|
24485
24500
|
x: \u5B57x,
|
|
24486
24501
|
y: \u6298\u308Cy + 15,
|
|
24487
24502
|
textAnchor: \u53F3 ? "start" : "end",
|
|
24488
|
-
fontSize: \
|
|
24503
|
+
fontSize: \u540D\u524D\u306E\u7D1A,
|
|
24489
24504
|
fill: "var(--cdl-text-dim, #5a6270)",
|
|
24490
|
-
children: \
|
|
24505
|
+
children: \u540D\u524D\u306E\u6587\u5B57[idx]
|
|
24491
24506
|
}
|
|
24492
24507
|
)
|
|
24493
24508
|
] }, `callout-${idx}`);
|
|
24494
24509
|
})
|
|
24495
24510
|
] });
|
|
24496
24511
|
}
|
|
24512
|
+
function \u8F2A\u3092\u7D44\u3080(data, cx, cy, \u5916\u534A\u5F84, \u5185\u534A\u5F84, \u5272\u5408) {
|
|
24513
|
+
let cumAngle = -Math.PI / 2;
|
|
24514
|
+
let cumFrac = 0;
|
|
24515
|
+
return data.map((d, idx) => {
|
|
24516
|
+
const frac = \u5272\u5408[idx] ?? 0;
|
|
24517
|
+
const angle = frac * Math.PI * 2;
|
|
24518
|
+
const a0 = cumAngle;
|
|
24519
|
+
const a1 = cumAngle + angle;
|
|
24520
|
+
cumAngle = a1;
|
|
24521
|
+
const startFrac = cumFrac;
|
|
24522
|
+
cumFrac += frac;
|
|
24523
|
+
const x1 = cx + \u5916\u534A\u5F84 * Math.cos(a0);
|
|
24524
|
+
const y1 = cy + \u5916\u534A\u5F84 * Math.sin(a0);
|
|
24525
|
+
const x2 = cx + \u5916\u534A\u5F84 * Math.cos(a1);
|
|
24526
|
+
const y2 = cy + \u5916\u534A\u5F84 * Math.sin(a1);
|
|
24527
|
+
const x3 = cx + \u5185\u534A\u5F84 * Math.cos(a1);
|
|
24528
|
+
const y3 = cy + \u5185\u534A\u5F84 * Math.sin(a1);
|
|
24529
|
+
const x4 = cx + \u5185\u534A\u5F84 * Math.cos(a0);
|
|
24530
|
+
const y4 = cy + \u5185\u534A\u5F84 * Math.sin(a0);
|
|
24531
|
+
const large = angle > Math.PI ? 1 : 0;
|
|
24532
|
+
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`;
|
|
24533
|
+
return { d, frac, path, startFrac, \u4E2D\u592E\u89D2: (a0 + a1) / 2 };
|
|
24534
|
+
});
|
|
24535
|
+
}
|
|
24536
|
+
function \u67A0(node, active) {
|
|
24537
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
24538
|
+
"rect",
|
|
24539
|
+
{
|
|
24540
|
+
"data-cdl-role": "node-body",
|
|
24541
|
+
x: 0,
|
|
24542
|
+
y: 0,
|
|
24543
|
+
width: node.w,
|
|
24544
|
+
height: node.h,
|
|
24545
|
+
rx: 16,
|
|
24546
|
+
fill: "var(--cdl-node-fill, #ffffff)",
|
|
24547
|
+
stroke: active ? "var(--cdl-tone-accent, #2d6a8f)" : "var(--cdl-divider, #d4d4d8)",
|
|
24548
|
+
strokeWidth: active ? 3 : 1.25
|
|
24549
|
+
}
|
|
24550
|
+
);
|
|
24551
|
+
}
|
|
24552
|
+
function \u5F27\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing, progress }) {
|
|
24553
|
+
const PAD = 20;
|
|
24554
|
+
const \u540D\u524D\u306E\u7D1A = 14;
|
|
24555
|
+
const \u5272\u5408\u306E\u7D1A = 24;
|
|
24556
|
+
const \u5370\u304B\u3089\u540D\u524D\u307E\u30672 = 18;
|
|
24557
|
+
const \u540D\u524D\u304B\u3089\u5272\u5408\u307E\u3067 = 24;
|
|
24558
|
+
const \u5272\u5408\u306E\u6587\u5B57 = \u5272\u5408.map(\u5272\u5408\u8868\u8A18);
|
|
24559
|
+
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)));
|
|
24560
|
+
const \u7E26\u304B\u3089 = (node.h - PAD * 2) / 2;
|
|
24561
|
+
const \u6A2A\u304B\u3089 = (node.w - PAD * 2 - \u4E00\u89A7\u5E45 - 28) / 2;
|
|
24562
|
+
const R = Math.max(24, Math.min(\u7E26\u304B\u3089, \u6A2A\u304B\u3089));
|
|
24563
|
+
const cx = PAD + R;
|
|
24564
|
+
const cy = node.h / 2;
|
|
24565
|
+
const \u7A74 = R * 0.34;
|
|
24566
|
+
const \u523B\u307F = (R - \u7A74) / Math.max(1, data.length);
|
|
24567
|
+
const \u592A\u3055 = Math.max(3, \u523B\u307F * 0.6);
|
|
24568
|
+
const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
24569
|
+
const \u4E00\u89A7\u5DE6 = node.w - PAD - \u4E00\u89A7\u5E45;
|
|
24570
|
+
const \u884C\u306E\u9593 = Math.min(56, (node.h - PAD * 2) / Math.max(1, data.length));
|
|
24571
|
+
const \u4E00\u89A7\u4E0A = node.h / 2 - \u884C\u306E\u9593 * (data.length - 1) / 2;
|
|
24572
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
24573
|
+
\u67A0(node, active),
|
|
24574
|
+
data.map((d, idx) => {
|
|
24575
|
+
const r = R - \u592A\u3055 / 2 - idx * \u523B\u307F;
|
|
24576
|
+
if (r <= \u592A\u3055 / 2) return null;
|
|
24577
|
+
const \u53D6\u308A\u5206 = (\u5272\u5408[idx] ?? 0) * (drawing ? \u958B\u304D : 1);
|
|
24578
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
24579
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
24580
|
+
"circle",
|
|
24581
|
+
{
|
|
24582
|
+
"data-cdl-role": "chart-pie-arc-track",
|
|
24583
|
+
cx,
|
|
24584
|
+
cy,
|
|
24585
|
+
r,
|
|
24586
|
+
fill: "none",
|
|
24587
|
+
stroke: "var(--cdl-divider, #d4d4d8)",
|
|
24588
|
+
strokeWidth: \u592A\u3055
|
|
24589
|
+
}
|
|
24590
|
+
),
|
|
24591
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
24592
|
+
"path",
|
|
24593
|
+
{
|
|
24594
|
+
"data-cdl-role": "chart-pie-arc",
|
|
24595
|
+
"data-cdl-unresolved": d.unresolved ? "true" : void 0,
|
|
24596
|
+
d: \u5F27\u306E\u9053(cx, cy, r, \u53D6\u308A\u5206),
|
|
24597
|
+
fill: "none",
|
|
24598
|
+
stroke: sliceColor(d.tone, idx),
|
|
24599
|
+
strokeWidth: \u592A\u3055,
|
|
24600
|
+
strokeLinecap: "round"
|
|
24601
|
+
}
|
|
24602
|
+
)
|
|
24603
|
+
] }, `arc-${idx}`);
|
|
24604
|
+
}),
|
|
24605
|
+
data.map((d, idx) => {
|
|
24606
|
+
const y = \u4E00\u89A7\u4E0A + \u884C\u306E\u9593 * idx;
|
|
24607
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
24608
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
24609
|
+
"rect",
|
|
24610
|
+
{
|
|
24611
|
+
x: \u4E00\u89A7\u5DE6,
|
|
24612
|
+
y: y - 9,
|
|
24613
|
+
width: 10,
|
|
24614
|
+
height: 10,
|
|
24615
|
+
rx: 2,
|
|
24616
|
+
fill: sliceColor(d.tone, idx)
|
|
24617
|
+
}
|
|
24618
|
+
),
|
|
24619
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
24620
|
+
"text",
|
|
24621
|
+
{
|
|
24622
|
+
x: \u4E00\u89A7\u5DE6 + \u5370\u304B\u3089\u540D\u524D\u307E\u30672,
|
|
24623
|
+
y,
|
|
24624
|
+
fontSize: \u540D\u524D\u306E\u7D1A,
|
|
24625
|
+
fill: "var(--cdl-text, #1a1f2a)",
|
|
24626
|
+
children: d.label
|
|
24627
|
+
}
|
|
24628
|
+
),
|
|
24629
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
24630
|
+
"text",
|
|
24631
|
+
{
|
|
24632
|
+
x: node.w - PAD,
|
|
24633
|
+
y: y + 4,
|
|
24634
|
+
textAnchor: "end",
|
|
24635
|
+
fontSize: \u5272\u5408\u306E\u7D1A,
|
|
24636
|
+
fontWeight: 600,
|
|
24637
|
+
fill: "var(--cdl-text, #1a1f2a)",
|
|
24638
|
+
children: \u5272\u5408\u306E\u6587\u5B57[idx]
|
|
24639
|
+
}
|
|
24640
|
+
)
|
|
24641
|
+
] }, `row-${idx}`);
|
|
24642
|
+
})
|
|
24643
|
+
] });
|
|
24644
|
+
}
|
|
24645
|
+
function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing, progress, instanceId }) {
|
|
24646
|
+
const PAD = 20;
|
|
24647
|
+
const \u898B\u51FA\u3057\u306E\u7D1A = 11;
|
|
24648
|
+
const \u540D\u524D\u306E\u7D1A = 15;
|
|
24649
|
+
const \u5272\u5408\u306E\u7D1A = 17;
|
|
24650
|
+
const \u5B9F\u6570\u306E\u7D1A = 15;
|
|
24651
|
+
const \u5370\u304B\u3089\u540D\u524D\u307E\u30672 = 18;
|
|
24652
|
+
const \u5272\u5408\u306E\u6587\u5B57 = \u5272\u5408.map(\u5272\u5408\u8868\u8A18);
|
|
24653
|
+
const \u5B9F\u6570\u306E\u6587\u5B57 = data.map((d) => \u5B9F\u5024\u8868\u8A18(d.value));
|
|
24654
|
+
const \u540D\u524D\u5E45 = Math.max(0, ...data.map((d) => textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A)));
|
|
24655
|
+
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)));
|
|
24656
|
+
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)));
|
|
24657
|
+
const \u8868\u5E45 = 10 + \u5370\u304B\u3089\u540D\u524D\u307E\u30672 + \u540D\u524D\u5E45 + 28 + \u5272\u5408\u5E45 + 24 + \u5B9F\u6570\u5E45;
|
|
24658
|
+
const \u7E26\u304B\u3089 = (node.h - PAD * 2) / 2;
|
|
24659
|
+
const \u6A2A\u304B\u3089 = (node.w - PAD * 2 - \u8868\u5E45 - 28) / 2;
|
|
24660
|
+
const R = Math.max(24, Math.min(\u7E26\u304B\u3089, \u6A2A\u304B\u3089));
|
|
24661
|
+
const \u5185\u534A\u5F84 = R * 0.58;
|
|
24662
|
+
const cx = PAD + R;
|
|
24663
|
+
const cy = node.h / 2;
|
|
24664
|
+
const \u8868\u5DE6 = node.w - PAD - \u8868\u5E45;
|
|
24665
|
+
const \u53F3\u7AEF = node.w - PAD;
|
|
24666
|
+
const \u5272\u5408\u53F3 = \u53F3\u7AEF - \u5B9F\u6570\u5E45 - 24;
|
|
24667
|
+
const \u884C\u306E\u9593 = Math.min(52, (node.h - PAD * 2 - 40) / Math.max(1, data.length));
|
|
24668
|
+
const \u898B\u51FA\u3057\u306Ey = node.h / 2 - \u884C\u306E\u9593 * data.length / 2 - 14;
|
|
24669
|
+
const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
24670
|
+
const \u5207\u308A\u629C\u304Did = `cdl-pie-draw-${instanceId}`;
|
|
24671
|
+
const \u958B\u304D\u59CB\u3081\u305F = (\u59CB\u307E\u308A) => !drawing || \u958B\u304D > \u59CB\u307E\u308A;
|
|
24672
|
+
let \u89D2 = -Math.PI / 2;
|
|
24673
|
+
let \u7D2F\u8A08 = 0;
|
|
24674
|
+
const \u6247\u305F\u3061 = data.map((d, idx) => {
|
|
24675
|
+
const frac = \u5272\u5408[idx] ?? 0;
|
|
24676
|
+
const a0 = \u89D2;
|
|
24677
|
+
const a1 = \u89D2 + frac * Math.PI * 2;
|
|
24678
|
+
\u89D2 = a1;
|
|
24679
|
+
const \u59CB\u307E\u308A = \u7D2F\u8A08;
|
|
24680
|
+
\u7D2F\u8A08 += frac;
|
|
24681
|
+
return { d, idx, \u59CB\u307E\u308A, path: \u8F2A\u306E\u9053(cx, cy, R, \u5185\u534A\u5F84, a0, a1) };
|
|
24682
|
+
});
|
|
24683
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
24684
|
+
\u67A0(node, active),
|
|
24685
|
+
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) }) }),
|
|
24686
|
+
/* @__PURE__ */ jsxRuntime.jsx("g", { ...drawing ? { clipPath: `url(#${\u5207\u308A\u629C\u304Did})` } : {}, children: \u6247\u305F\u3061.map((s) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
24687
|
+
"path",
|
|
24688
|
+
{
|
|
24689
|
+
"data-cdl-role": "chart-pie-slice",
|
|
24690
|
+
"data-cdl-unresolved": s.d.unresolved ? "true" : void 0,
|
|
24691
|
+
d: s.path,
|
|
24692
|
+
fill: sliceColor(s.d.tone, s.idx),
|
|
24693
|
+
stroke: "var(--cdl-node-fill, #ffffff)",
|
|
24694
|
+
strokeWidth: 3,
|
|
24695
|
+
strokeLinejoin: "round"
|
|
24696
|
+
},
|
|
24697
|
+
`slice-${s.idx}`
|
|
24698
|
+
)) }),
|
|
24699
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
24700
|
+
"text",
|
|
24701
|
+
{
|
|
24702
|
+
x: cx,
|
|
24703
|
+
y: cy - 2,
|
|
24704
|
+
textAnchor: "middle",
|
|
24705
|
+
fontSize: Math.round(R * 0.26),
|
|
24706
|
+
fontWeight: 600,
|
|
24707
|
+
fill: "var(--cdl-text, #1a1f2a)",
|
|
24708
|
+
children: \u5B9F\u5024\u8868\u8A18(Math.round(data.reduce((acc, d) => acc + d.value, 0)))
|
|
24709
|
+
}
|
|
24710
|
+
),
|
|
24711
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
24712
|
+
"text",
|
|
24713
|
+
{
|
|
24714
|
+
x: cx,
|
|
24715
|
+
y: cy + Math.round(R * 0.2),
|
|
24716
|
+
textAnchor: "middle",
|
|
24717
|
+
fontSize: Math.round(R * 0.12),
|
|
24718
|
+
fill: "var(--cdl-text-dim, #5a6270)",
|
|
24719
|
+
children: "\u5408\u8A08"
|
|
24720
|
+
}
|
|
24721
|
+
),
|
|
24722
|
+
/* @__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" }),
|
|
24723
|
+
/* @__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" }),
|
|
24724
|
+
/* @__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" }),
|
|
24725
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
24726
|
+
"line",
|
|
24727
|
+
{
|
|
24728
|
+
"data-cdl-role": "chart-pie-table-rule",
|
|
24729
|
+
x1: \u8868\u5DE6,
|
|
24730
|
+
y1: \u898B\u51FA\u3057\u306Ey + 10,
|
|
24731
|
+
x2: \u53F3\u7AEF,
|
|
24732
|
+
y2: \u898B\u51FA\u3057\u306Ey + 10,
|
|
24733
|
+
stroke: "var(--cdl-text, #1a1f2a)",
|
|
24734
|
+
strokeWidth: 1.2
|
|
24735
|
+
}
|
|
24736
|
+
),
|
|
24737
|
+
\u6247\u305F\u3061.map((s) => {
|
|
24738
|
+
if (!\u958B\u304D\u59CB\u3081\u305F(s.\u59CB\u307E\u308A)) return null;
|
|
24739
|
+
const y = \u898B\u51FA\u3057\u306Ey + 40 + \u884C\u306E\u9593 * s.idx;
|
|
24740
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
24741
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: \u8868\u5DE6, y: y - 10, width: 10, height: 10, rx: 2, fill: sliceColor(s.d.tone, s.idx) }),
|
|
24742
|
+
/* @__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 }),
|
|
24743
|
+
/* @__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] }),
|
|
24744
|
+
/* @__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] }),
|
|
24745
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
24746
|
+
"line",
|
|
24747
|
+
{
|
|
24748
|
+
"data-cdl-role": "chart-pie-table-rule",
|
|
24749
|
+
x1: \u8868\u5DE6,
|
|
24750
|
+
y1: y + 16,
|
|
24751
|
+
x2: \u53F3\u7AEF,
|
|
24752
|
+
y2: y + 16,
|
|
24753
|
+
stroke: "var(--cdl-divider, #d4d4d8)",
|
|
24754
|
+
strokeWidth: 1
|
|
24755
|
+
}
|
|
24756
|
+
)
|
|
24757
|
+
] }, `row-${s.idx}`);
|
|
24758
|
+
})
|
|
24759
|
+
] });
|
|
24760
|
+
}
|
|
24761
|
+
function \u5F27\u306E\u9053(cx, cy, r, \u53D6\u308A\u5206) {
|
|
24762
|
+
const \u5B9F\u52B9 = Math.max(0, Math.min(0.9999, \u53D6\u308A\u5206));
|
|
24763
|
+
const a0 = -Math.PI / 2;
|
|
24764
|
+
const a1 = a0 + \u5B9F\u52B9 * Math.PI * 2;
|
|
24765
|
+
const large = \u5B9F\u52B9 > 0.5 ? 1 : 0;
|
|
24766
|
+
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)}`;
|
|
24767
|
+
}
|
|
24768
|
+
function \u8F2A\u306E\u9053(cx, cy, R, r, a0, a1) {
|
|
24769
|
+
const large = a1 - a0 > Math.PI ? 1 : 0;
|
|
24770
|
+
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`;
|
|
24771
|
+
}
|
|
24497
24772
|
function \u6247\u5F62\u306E\u5207\u308A\u629C\u304D(cx, cy, r, \u958B\u304D) {
|
|
24498
24773
|
if (\u958B\u304D <= 0) return null;
|
|
24499
24774
|
if (\u958B\u304D >= 1) return /* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy, r });
|
|
@@ -24695,8 +24970,8 @@ function ChartRadialNode({
|
|
|
24695
24970
|
frac,
|
|
24696
24971
|
\u4E2D\u5FC3\u534A\u5F84,
|
|
24697
24972
|
// 軌道は全周。 1 周ちょうどは弧で表せないので、 わずかに欠かして描く
|
|
24698
|
-
\u8ECC\u9053: \u5F27\u306E\
|
|
24699
|
-
\u53D6\u308A\u5206: frac <= 0 ? null : \u5F27\u306E\
|
|
24973
|
+
\u8ECC\u9053: \u5F27\u306E\u90532(\u5F27\u306Ecx, cy, \u4E2D\u5FC3\u534A\u5F84, \u5E2F\u306E\u5E45, 0.9999),
|
|
24974
|
+
\u53D6\u308A\u5206: frac <= 0 ? null : \u5F27\u306E\u90532(\u5F27\u306Ecx, cy, \u4E2D\u5FC3\u534A\u5F84, \u5E2F\u306E\u5E45, Math.min(frac, 0.9999))
|
|
24700
24975
|
};
|
|
24701
24976
|
});
|
|
24702
24977
|
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;
|
|
@@ -24767,7 +25042,7 @@ function ChartRadialNode({
|
|
|
24767
25042
|
] });
|
|
24768
25043
|
}
|
|
24769
25044
|
var \u5370\u306E\u5E45 = 18;
|
|
24770
|
-
function \u5F27\u306E\
|
|
25045
|
+
function \u5F27\u306E\u90532(cx, cy, \u4E2D\u5FC3\u534A\u5F84, \u5E45, \u5272\u5408) {
|
|
24771
25046
|
const \u5916 = \u4E2D\u5FC3\u534A\u5F84 + \u5E45 / 2;
|
|
24772
25047
|
const \u5185 = Math.max(0.5, \u4E2D\u5FC3\u534A\u5F84 - \u5E45 / 2);
|
|
24773
25048
|
const a0 = -Math.PI / 2;
|
|
@@ -24813,12 +25088,12 @@ function ChartStatNode({
|
|
|
24813
25088
|
}
|
|
24814
25089
|
),
|
|
24815
25090
|
data.map((d, idx) => {
|
|
24816
|
-
const \
|
|
25091
|
+
const \u67A02 = \u533A\u753B.\u67A0(idx);
|
|
24817
25092
|
const frac = total > 0 ? d.value / total : 0;
|
|
24818
25093
|
const \u8272 = \u5370\u306E\u8272(d.tone, idx);
|
|
24819
25094
|
const \u6570\u5024 = \u5B9F\u5024\u8868\u8A184(d.value);
|
|
24820
|
-
const \u6570\u5024\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A(\u6570\u5024, \
|
|
24821
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-role": "chart-stat-item", transform: `translate(${\
|
|
25095
|
+
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);
|
|
25096
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-role": "chart-stat-item", transform: `translate(${\u67A02.x} ${\u67A02.y})`, children: [
|
|
24822
25097
|
idx > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
24823
25098
|
"line",
|
|
24824
25099
|
{
|
|
@@ -24826,7 +25101,7 @@ function ChartStatNode({
|
|
|
24826
25101
|
x1: 0,
|
|
24827
25102
|
y1: \u533A\u753B.\u4F59\u767D,
|
|
24828
25103
|
x2: 0,
|
|
24829
|
-
y2: \
|
|
25104
|
+
y2: \u67A02.h - \u533A\u753B.\u4F59\u767D,
|
|
24830
25105
|
stroke: "var(--cdl-divider, #d4d4d8)",
|
|
24831
25106
|
strokeWidth: 1
|
|
24832
25107
|
}
|
|
@@ -24835,7 +25110,7 @@ function ChartStatNode({
|
|
|
24835
25110
|
"text",
|
|
24836
25111
|
{
|
|
24837
25112
|
"data-cdl-role": "chart-stat-label",
|
|
24838
|
-
x: \
|
|
25113
|
+
x: \u67A02.w / 2,
|
|
24839
25114
|
y: \u533A\u753B.\u540D\u524D\u306Ey,
|
|
24840
25115
|
fontSize: \u533A\u753B.\u540D\u524D\u306E\u7D1A,
|
|
24841
25116
|
fontWeight: 700,
|
|
@@ -24849,7 +25124,7 @@ function ChartStatNode({
|
|
|
24849
25124
|
{
|
|
24850
25125
|
"data-cdl-role": "chart-stat-value",
|
|
24851
25126
|
"data-cdl-unresolved": d.unresolved ? "true" : void 0,
|
|
24852
|
-
x: \
|
|
25127
|
+
x: \u67A02.w / 2,
|
|
24853
25128
|
y: \u533A\u753B.\u6570\u5024\u306Ey,
|
|
24854
25129
|
fontSize: \u6570\u5024\u306E\u7D1A,
|
|
24855
25130
|
fontWeight: 700,
|
|
@@ -24862,7 +25137,7 @@ function ChartStatNode({
|
|
|
24862
25137
|
"circle",
|
|
24863
25138
|
{
|
|
24864
25139
|
"data-cdl-role": "chart-stat-track",
|
|
24865
|
-
cx: \
|
|
25140
|
+
cx: \u67A02.w / 2,
|
|
24866
25141
|
cy: \u533A\u753B.\u5F27\u306Ey,
|
|
24867
25142
|
r: \u533A\u753B.\u5F27\u306E\u534A\u5F84,
|
|
24868
25143
|
fill: "none",
|
|
@@ -24875,7 +25150,7 @@ function ChartStatNode({
|
|
|
24875
25150
|
"path",
|
|
24876
25151
|
{
|
|
24877
25152
|
"data-cdl-role": "chart-stat-arc",
|
|
24878
|
-
d: \u5F27\u306E\
|
|
25153
|
+
d: \u5F27\u306E\u90533(\u67A02.w / 2, \u533A\u753B.\u5F27\u306Ey, \u533A\u753B.\u5F27\u306E\u534A\u5F84, Math.min(frac, 0.9999)),
|
|
24879
25154
|
fill: "none",
|
|
24880
25155
|
stroke: \u8272,
|
|
24881
25156
|
strokeWidth: \u533A\u753B.\u5F27\u306E\u592A\u3055,
|
|
@@ -24886,7 +25161,7 @@ function ChartStatNode({
|
|
|
24886
25161
|
"text",
|
|
24887
25162
|
{
|
|
24888
25163
|
"data-cdl-role": "chart-stat-share",
|
|
24889
|
-
x: \
|
|
25164
|
+
x: \u67A02.w / 2,
|
|
24890
25165
|
y: \u533A\u753B.\u5272\u5408\u306Ey,
|
|
24891
25166
|
fontSize: \u533A\u753B.\u5272\u5408\u306E\u7D1A,
|
|
24892
25167
|
textAnchor: "middle",
|
|
@@ -24931,7 +25206,7 @@ function \u53CE\u3081\u308B\u7D1A(\u5B57, \u4F7F\u3048\u308B\u5E452, \u521D\u671
|
|
|
24931
25206
|
while (\u7D1A > \u4E0B\u9650 && textWidth(\u5B57, \u7D1A) > \u4F7F\u3048\u308B\u5E452) \u7D1A -= 1;
|
|
24932
25207
|
return \u7D1A;
|
|
24933
25208
|
}
|
|
24934
|
-
function \u5F27\u306E\
|
|
25209
|
+
function \u5F27\u306E\u90533(cx, cy, r, \u5272\u5408) {
|
|
24935
25210
|
const a0 = -Math.PI / 2;
|
|
24936
25211
|
const a1 = a0 + \u5272\u5408 * Math.PI * 2;
|
|
24937
25212
|
const large = \u5272\u5408 > 0.5 ? 1 : 0;
|