@cardenelabs/cdl 0.31.1 → 0.33.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/dist/index.cjs CHANGED
@@ -11748,6 +11748,7 @@ var KINDS_WITHOUT_TITLE_TEXT = /* @__PURE__ */ new Set([
11748
11748
  "chart-stat",
11749
11749
  "chart-waffle",
11750
11750
  "chart-stacked-bar",
11751
+ "chart-slope",
11751
11752
  "gantt-timeline",
11752
11753
  "mind-map",
11753
11754
  "funnel-stages",
@@ -13656,8 +13657,10 @@ var NODE_KINDS = [
13656
13657
  "chart-radial",
13657
13658
  "chart-stat",
13658
13659
  // chart-stacked-bar は帯を割合で区切り時点を並べる形 (cdl#551)
13660
+ // chart-slope は 2 時点を直線でつなぎ増減と順位の入れ替わりを見せる形 (cdl#688)
13659
13661
  "chart-waffle",
13660
13662
  "chart-stacked-bar",
13663
+ "chart-slope",
13661
13664
  // Timeline / Mind 系 (2、 CAR-994 Phase B) ... 1 node に payload 配列、 SVG geometry render
13662
13665
  "gantt-timeline",
13663
13666
  "mind-map",
@@ -15462,6 +15465,7 @@ var GRID_ALIGNED_KINDS = /* @__PURE__ */ new Set([
15462
15465
  "chart-stat",
15463
15466
  "chart-waffle",
15464
15467
  "chart-stacked-bar",
15468
+ "chart-slope",
15465
15469
  "funnel-stages",
15466
15470
  "quadrant-matrix"
15467
15471
  ]);
@@ -15920,10 +15924,10 @@ function countEdgeCrossings(edges, warnAt = 3) {
15920
15924
  if (isNearAny(p, a.ends, SAME_POINT_TOL) || isNearAny(p, b.ends, SAME_POINT_TOL))
15921
15925
  continue;
15922
15926
  if (\u5171\u6709\u5074.length > 0) {
15923
- const \u67A0 = Math.min(MAX_CHECKS - checks, MAX_CHECKS_PER_PAIR - pairChecks);
15924
- const \u4E88\u7B97 = { \u6B8B\u308A: Math.max(0, \u67A0) };
15927
+ const \u67A02 = Math.min(MAX_CHECKS - checks, MAX_CHECKS_PER_PAIR - pairChecks);
15928
+ const \u4E88\u7B97 = { \u6B8B\u308A: Math.max(0, \u67A02) };
15925
15929
  const \u5224\u5B9A = mergesTowardShared(a.flat, b.flat, p, \u5171\u6709\u5074, MERGE_TOL, \u4E88\u7B97);
15926
- const \u4F7F\u3063\u305F = Math.max(0, \u67A0) - \u4E88\u7B97.\u6B8B\u308A;
15930
+ const \u4F7F\u3063\u305F = Math.max(0, \u67A02) - \u4E88\u7B97.\u6B8B\u308A;
15927
15931
  checks += \u4F7F\u3063\u305F;
15928
15932
  pairChecks += \u4F7F\u3063\u305F;
15929
15933
  if (\u5224\u5B9A === "merged") continue;
@@ -18068,6 +18072,8 @@ var TOKENS = {
18068
18072
  "chart-waffle": { w: 640, h: 320 },
18069
18073
  // 帯を最大 2 本 + 下に一覧。 縦は帯 2 本ぶんで足りる (cdl#551)
18070
18074
  "chart-stacked-bar": { w: 640, h: 320 },
18075
+ // 左右 2 本の縦軸と、その外に名札。 縦は系列が縦に並ぶぶん要る (cdl#688)
18076
+ "chart-slope": { w: 640, h: 360 },
18071
18077
  // Timeline / Mind 系 (CAR-994 Phase B)
18072
18078
  "gantt-timeline": { w: 720, h: 360 },
18073
18079
  "mind-map": { w: 720, h: 480 },
@@ -20781,6 +20787,7 @@ var DRAW_KINDS = /* @__PURE__ */ new Set([
20781
20787
  "chart-line",
20782
20788
  "chart-bar",
20783
20789
  "chart-pie",
20790
+ "chart-slope",
20784
20791
  "journey-map",
20785
20792
  "mind-map",
20786
20793
  "tree-hierarchy",
@@ -24343,52 +24350,52 @@ function ChartPieNode({
24343
24350
  const y0 = node.cy - node.h / 2;
24344
24351
  const data = resolveChartData(node.chartData ?? [], stateValues);
24345
24352
  const total = data.reduce((acc, d) => acc + d.value, 0) || 1;
24353
+ const \u524D\u3042\u308A = data.some((d) => d.previous !== void 0);
24354
+ const \u4ECA\u306E\u5024 = data.map((d) => Math.max(0, d.value));
24355
+ const \u524D\u306E\u5024 = data.map((d) => Math.max(0, d.previous ?? 0));
24356
+ const \u4ECA\u306E\u5408\u8A08 = \u4ECA\u306E\u5024.reduce((acc, value) => acc + value, 0);
24357
+ const \u524D\u306E\u5408\u8A08 = \u524D\u306E\u5024.reduce((acc, value) => acc + value, 0);
24358
+ 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);
24359
+ const \u524D\u306E\u5272\u5408 = \u524D\u306E\u5024.map((value) => \u524D\u306E\u5408\u8A08 > 0 ? value / \u524D\u306E\u5408\u8A08 : 0);
24360
+ const \u5F62 = node.chartPieForm === "arcs" || node.chartPieForm === "table" ? node.chartPieForm : "ring";
24346
24361
  const PAD_TOP2 = 20;
24347
24362
  const PAD_BOTTOM2 = 20;
24348
24363
  const PAD_SIDE = 20;
24349
24364
  const chartAreaH = node.h - PAD_TOP2 - PAD_BOTTOM2;
24350
- const \u540D\u672D\u306E\u7D1A = 14;
24351
- const \u6570\u5024\u306E\u7D1A = 13;
24365
+ const \u5272\u5408\u306E\u7D1A = 19;
24366
+ const \u540D\u524D\u306E\u7D1A = 12;
24352
24367
  const \u5F15\u304D\u51FA\u3057 = 18;
24353
24368
  const \u5B57\u307E\u3067\u306E\u9593 = 26;
24354
24369
  const \u540D\u672D\u306E\u7E26\u306E\u5F35\u308A\u51FA\u3057 = 20;
24355
- const \u5272\u5408\u306E\u6587\u5B57 = data.map((d) => \u5272\u5408\u8868\u8A18(d.value / total));
24356
- const \u6570\u5024\u306E\u6587\u5B57 = data.map((d, i) => `${\u5B9F\u5024\u8868\u8A18(d.value)} ${\u5272\u5408\u306E\u6587\u5B57[i]}`);
24370
+ const \u5272\u5408\u306E\u6587\u5B57 = \u4ECA\u306E\u5272\u5408.map(\u5272\u5408\u8868\u8A18);
24371
+ const \u540D\u524D\u306E\u6587\u5B57 = data.map((d, i) => {
24372
+ const \u540D = d.label ?? "";
24373
+ if (\u524D\u3042\u308A) return `${\u540D} ${\u5B9F\u5024\u8868\u8A18(\u524D\u306E\u5024[i])} \u2192 ${\u5B9F\u5024\u8868\u8A18(\u4ECA\u306E\u5024[i])}`;
24374
+ return `${\u5B9F\u5024\u8868\u8A18(d.value)}%` === \u5272\u5408\u306E\u6587\u5B57[i] ? \u540D : `${\u540D} ${\u5B9F\u5024\u8868\u8A18(d.value)}`;
24375
+ });
24376
+ if (\u5F62 !== "ring") {
24377
+ const \u5171\u901A = { node, active, data, \u5272\u5408: \u4ECA\u306E\u5272\u5408, x0, y0, drawing, progress, instanceId };
24378
+ return \u5F62 === "arcs" ? \u5F27\u306E\u5F62(\u5171\u901A) : \u8868\u306E\u5F62(\u5171\u901A);
24379
+ }
24357
24380
  const \u540D\u672D\u5E45 = Math.max(
24358
24381
  0,
24359
24382
  ...data.map(
24360
- (d, i) => Math.max(textWidth(d.label ?? "", \u540D\u672D\u306E\u7D1A), textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A))
24383
+ (_d, i) => Math.max(
24384
+ textWidth(\u5272\u5408\u306E\u6587\u5B57[i] ?? "", \u5272\u5408\u306E\u7D1A),
24385
+ textWidth(\u540D\u524D\u306E\u6587\u5B57[i] ?? "", \u540D\u524D\u306E\u7D1A)
24386
+ )
24361
24387
  )
24362
24388
  );
24363
24389
  const \u7E26\u304B\u3089 = chartAreaH / 2 - \u5F15\u304D\u51FA\u3057 - \u540D\u672D\u306E\u7E26\u306E\u5F35\u308A\u51FA\u3057;
24364
24390
  const \u6A2A\u304B\u3089 = (node.w - PAD_SIDE * 2) / 2 - \u5F15\u304D\u51FA\u3057 - \u5B57\u307E\u3067\u306E\u9593 - \u540D\u672D\u5E45;
24365
24391
  const radius = Math.max(24, Math.min(\u7E26\u304B\u3089, \u6A2A\u304B\u3089));
24366
- const \u5185\u534A\u5F84 = radius * 0.58;
24392
+ const \u5916\u306E\u5185\u534A\u5F84 = radius * (\u524D\u3042\u308A ? 0.75 : 0.58);
24393
+ const \u524D\u306E\u5916\u534A\u5F84 = radius * 0.67;
24394
+ const \u524D\u306E\u5185\u534A\u5F84 = radius * 0.42;
24367
24395
  const cx = node.w / 2;
24368
24396
  const cy = PAD_TOP2 + chartAreaH / 2;
24369
- let cumAngle = -Math.PI / 2;
24370
- let cumFrac = 0;
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
- });
24397
+ 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) : [];
24398
+ const slices = \u8F2A\u3092\u7D44\u3080(data, cx, cy, radius, \u5916\u306E\u5185\u534A\u5F84, \u4ECA\u306E\u5272\u5408);
24392
24399
  const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
24393
24400
  const \u5207\u308A\u629C\u304Did = `cdl-pie-draw-${instanceId}`;
24394
24401
  const \u5F71id = `cdl-pie-shadow-${instanceId}`;
@@ -24412,19 +24419,34 @@ function ChartPieNode({
24412
24419
  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
24420
  /* @__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
24421
  ] }),
24415
- /* @__PURE__ */ jsxRuntime.jsx("g", { ...drawing ? { clipPath: `url(#${\u5207\u308A\u629C\u304Did})` } : {}, filter: `url(#${\u5F71id})`, children: slices.map((s, idx) => /* @__PURE__ */ jsxRuntime.jsx(
24416
- "path",
24417
- {
24418
- "data-cdl-role": "chart-pie-slice",
24419
- "data-cdl-unresolved": s.d.unresolved ? "true" : void 0,
24420
- d: s.path,
24421
- fill: sliceColor(s.d.tone, idx),
24422
- stroke: "var(--cdl-node-fill, #ffffff)",
24423
- strokeWidth: 3,
24424
- strokeLinejoin: "round"
24425
- },
24426
- `slice-${idx}`
24427
- )) }),
24422
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { ...drawing ? { clipPath: `url(#${\u5207\u308A\u629C\u304Did})` } : {}, filter: `url(#${\u5F71id})`, children: [
24423
+ \u524D\u306Eslices.map((s, idx) => /* @__PURE__ */ jsxRuntime.jsx(
24424
+ "path",
24425
+ {
24426
+ "data-cdl-role": "chart-pie-slice-previous",
24427
+ "data-cdl-unresolved": s.d.unresolved ? "true" : void 0,
24428
+ d: s.path,
24429
+ fill: sliceColor(s.d.tone, idx),
24430
+ stroke: "var(--cdl-node-fill, #ffffff)",
24431
+ strokeWidth: 3,
24432
+ strokeLinejoin: "round"
24433
+ },
24434
+ `slice-previous-${idx}`
24435
+ )),
24436
+ slices.map((s, idx) => /* @__PURE__ */ jsxRuntime.jsx(
24437
+ "path",
24438
+ {
24439
+ "data-cdl-role": "chart-pie-slice",
24440
+ "data-cdl-unresolved": s.d.unresolved ? "true" : void 0,
24441
+ d: s.path,
24442
+ fill: sliceColor(s.d.tone, idx),
24443
+ stroke: "var(--cdl-node-fill, #ffffff)",
24444
+ strokeWidth: 3,
24445
+ strokeLinejoin: "round"
24446
+ },
24447
+ `slice-${idx}`
24448
+ ))
24449
+ ] }),
24428
24450
  /* @__PURE__ */ jsxRuntime.jsx(
24429
24451
  "text",
24430
24452
  {
@@ -24434,7 +24456,7 @@ function ChartPieNode({
24434
24456
  fontSize: Math.round(radius * 0.26),
24435
24457
  fontWeight: 600,
24436
24458
  fill: "var(--cdl-text, #1a1f2a)",
24437
- children: \u5B9F\u5024\u8868\u8A18(Math.round(total))
24459
+ children: \u5B9F\u5024\u8868\u8A18(Math.round(\u524D\u3042\u308A ? \u4ECA\u306E\u5408\u8A08 : total))
24438
24460
  }
24439
24461
  ),
24440
24462
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -24471,12 +24493,12 @@ function ChartPieNode({
24471
24493
  "text",
24472
24494
  {
24473
24495
  x: \u5B57x,
24474
- y: \u6298\u308Cy - 3,
24496
+ y: \u6298\u308Cy - 1,
24475
24497
  textAnchor: \u53F3 ? "start" : "end",
24476
- fontSize: \u540D\u672D\u306E\u7D1A,
24498
+ fontSize: \u5272\u5408\u306E\u7D1A,
24477
24499
  fontWeight: 600,
24478
24500
  fill: "var(--cdl-text, #1a1f2a)",
24479
- children: s.d.label
24501
+ children: \u5272\u5408\u306E\u6587\u5B57[idx]
24480
24502
  }
24481
24503
  ),
24482
24504
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -24485,15 +24507,275 @@ function ChartPieNode({
24485
24507
  x: \u5B57x,
24486
24508
  y: \u6298\u308Cy + 15,
24487
24509
  textAnchor: \u53F3 ? "start" : "end",
24488
- fontSize: \u6570\u5024\u306E\u7D1A,
24510
+ fontSize: \u540D\u524D\u306E\u7D1A,
24489
24511
  fill: "var(--cdl-text-dim, #5a6270)",
24490
- children: \u6570\u5024\u306E\u6587\u5B57[idx]
24512
+ children: \u540D\u524D\u306E\u6587\u5B57[idx]
24491
24513
  }
24492
24514
  )
24493
24515
  ] }, `callout-${idx}`);
24494
24516
  })
24495
24517
  ] });
24496
24518
  }
24519
+ function \u8F2A\u3092\u7D44\u3080(data, cx, cy, \u5916\u534A\u5F84, \u5185\u534A\u5F84, \u5272\u5408) {
24520
+ let cumAngle = -Math.PI / 2;
24521
+ let cumFrac = 0;
24522
+ return data.map((d, idx) => {
24523
+ const frac = \u5272\u5408[idx] ?? 0;
24524
+ const angle = frac * Math.PI * 2;
24525
+ const a0 = cumAngle;
24526
+ const a1 = cumAngle + angle;
24527
+ cumAngle = a1;
24528
+ const startFrac = cumFrac;
24529
+ cumFrac += frac;
24530
+ const x1 = cx + \u5916\u534A\u5F84 * Math.cos(a0);
24531
+ const y1 = cy + \u5916\u534A\u5F84 * Math.sin(a0);
24532
+ const x2 = cx + \u5916\u534A\u5F84 * Math.cos(a1);
24533
+ const y2 = cy + \u5916\u534A\u5F84 * Math.sin(a1);
24534
+ const x3 = cx + \u5185\u534A\u5F84 * Math.cos(a1);
24535
+ const y3 = cy + \u5185\u534A\u5F84 * Math.sin(a1);
24536
+ const x4 = cx + \u5185\u534A\u5F84 * Math.cos(a0);
24537
+ const y4 = cy + \u5185\u534A\u5F84 * Math.sin(a0);
24538
+ const large = angle > Math.PI ? 1 : 0;
24539
+ 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`;
24540
+ return { d, frac, path, startFrac, \u4E2D\u592E\u89D2: (a0 + a1) / 2 };
24541
+ });
24542
+ }
24543
+ function \u67A0(node, active) {
24544
+ return /* @__PURE__ */ jsxRuntime.jsx(
24545
+ "rect",
24546
+ {
24547
+ "data-cdl-role": "node-body",
24548
+ x: 0,
24549
+ y: 0,
24550
+ width: node.w,
24551
+ height: node.h,
24552
+ rx: 16,
24553
+ fill: "var(--cdl-node-fill, #ffffff)",
24554
+ stroke: active ? "var(--cdl-tone-accent, #2d6a8f)" : "var(--cdl-divider, #d4d4d8)",
24555
+ strokeWidth: active ? 3 : 1.25
24556
+ }
24557
+ );
24558
+ }
24559
+ function \u5F27\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing, progress }) {
24560
+ const PAD = 20;
24561
+ const \u540D\u524D\u306E\u7D1A = 14;
24562
+ const \u5272\u5408\u306E\u7D1A = 24;
24563
+ const \u5370\u304B\u3089\u540D\u524D\u307E\u30672 = 18;
24564
+ const \u540D\u524D\u304B\u3089\u5272\u5408\u307E\u3067 = 24;
24565
+ const \u5272\u5408\u306E\u6587\u5B57 = \u5272\u5408.map(\u5272\u5408\u8868\u8A18);
24566
+ 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)));
24567
+ const \u7E26\u304B\u3089 = (node.h - PAD * 2) / 2;
24568
+ const \u6A2A\u304B\u3089 = (node.w - PAD * 2 - \u4E00\u89A7\u5E45 - 28) / 2;
24569
+ const R = Math.max(24, Math.min(\u7E26\u304B\u3089, \u6A2A\u304B\u3089));
24570
+ const cx = PAD + R;
24571
+ const cy = node.h / 2;
24572
+ const \u7A74 = R * 0.34;
24573
+ const \u523B\u307F = (R - \u7A74) / Math.max(1, data.length);
24574
+ const \u592A\u3055 = Math.max(3, \u523B\u307F * 0.6);
24575
+ const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
24576
+ const \u4E00\u89A7\u5DE6 = node.w - PAD - \u4E00\u89A7\u5E45;
24577
+ const \u884C\u306E\u9593 = Math.min(56, (node.h - PAD * 2) / Math.max(1, data.length));
24578
+ const \u4E00\u89A7\u4E0A = node.h / 2 - \u884C\u306E\u9593 * (data.length - 1) / 2;
24579
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
24580
+ \u67A0(node, active),
24581
+ data.map((d, idx) => {
24582
+ const r = R - \u592A\u3055 / 2 - idx * \u523B\u307F;
24583
+ if (r <= \u592A\u3055 / 2) return null;
24584
+ const \u53D6\u308A\u5206 = (\u5272\u5408[idx] ?? 0) * (drawing ? \u958B\u304D : 1);
24585
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
24586
+ /* @__PURE__ */ jsxRuntime.jsx(
24587
+ "circle",
24588
+ {
24589
+ "data-cdl-role": "chart-pie-arc-track",
24590
+ cx,
24591
+ cy,
24592
+ r,
24593
+ fill: "none",
24594
+ stroke: "var(--cdl-divider, #d4d4d8)",
24595
+ strokeWidth: \u592A\u3055
24596
+ }
24597
+ ),
24598
+ /* @__PURE__ */ jsxRuntime.jsx(
24599
+ "path",
24600
+ {
24601
+ "data-cdl-role": "chart-pie-arc",
24602
+ "data-cdl-unresolved": d.unresolved ? "true" : void 0,
24603
+ d: \u5F27\u306E\u9053(cx, cy, r, \u53D6\u308A\u5206),
24604
+ fill: "none",
24605
+ stroke: sliceColor(d.tone, idx),
24606
+ strokeWidth: \u592A\u3055,
24607
+ strokeLinecap: "round"
24608
+ }
24609
+ )
24610
+ ] }, `arc-${idx}`);
24611
+ }),
24612
+ data.map((d, idx) => {
24613
+ const y = \u4E00\u89A7\u4E0A + \u884C\u306E\u9593 * idx;
24614
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
24615
+ /* @__PURE__ */ jsxRuntime.jsx(
24616
+ "rect",
24617
+ {
24618
+ x: \u4E00\u89A7\u5DE6,
24619
+ y: y - 9,
24620
+ width: 10,
24621
+ height: 10,
24622
+ rx: 2,
24623
+ fill: sliceColor(d.tone, idx)
24624
+ }
24625
+ ),
24626
+ /* @__PURE__ */ jsxRuntime.jsx(
24627
+ "text",
24628
+ {
24629
+ x: \u4E00\u89A7\u5DE6 + \u5370\u304B\u3089\u540D\u524D\u307E\u30672,
24630
+ y,
24631
+ fontSize: \u540D\u524D\u306E\u7D1A,
24632
+ fill: "var(--cdl-text, #1a1f2a)",
24633
+ children: d.label
24634
+ }
24635
+ ),
24636
+ /* @__PURE__ */ jsxRuntime.jsx(
24637
+ "text",
24638
+ {
24639
+ x: node.w - PAD,
24640
+ y: y + 4,
24641
+ textAnchor: "end",
24642
+ fontSize: \u5272\u5408\u306E\u7D1A,
24643
+ fontWeight: 600,
24644
+ fill: "var(--cdl-text, #1a1f2a)",
24645
+ children: \u5272\u5408\u306E\u6587\u5B57[idx]
24646
+ }
24647
+ )
24648
+ ] }, `row-${idx}`);
24649
+ })
24650
+ ] });
24651
+ }
24652
+ function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing, progress, instanceId }) {
24653
+ const PAD = 20;
24654
+ const \u898B\u51FA\u3057\u306E\u7D1A = 11;
24655
+ const \u540D\u524D\u306E\u7D1A = 15;
24656
+ const \u5272\u5408\u306E\u7D1A = 17;
24657
+ const \u5B9F\u6570\u306E\u7D1A = 15;
24658
+ const \u5370\u304B\u3089\u540D\u524D\u307E\u30672 = 18;
24659
+ const \u5272\u5408\u306E\u6587\u5B57 = \u5272\u5408.map(\u5272\u5408\u8868\u8A18);
24660
+ const \u5B9F\u6570\u306E\u6587\u5B57 = data.map((d) => \u5B9F\u5024\u8868\u8A18(d.value));
24661
+ const \u540D\u524D\u5E45 = Math.max(0, ...data.map((d) => textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A)));
24662
+ 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)));
24663
+ 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)));
24664
+ const \u8868\u5E45 = 10 + \u5370\u304B\u3089\u540D\u524D\u307E\u30672 + \u540D\u524D\u5E45 + 28 + \u5272\u5408\u5E45 + 24 + \u5B9F\u6570\u5E45;
24665
+ const \u7E26\u304B\u3089 = (node.h - PAD * 2) / 2;
24666
+ const \u6A2A\u304B\u3089 = (node.w - PAD * 2 - \u8868\u5E45 - 28) / 2;
24667
+ const R = Math.max(24, Math.min(\u7E26\u304B\u3089, \u6A2A\u304B\u3089));
24668
+ const \u5185\u534A\u5F84 = R * 0.58;
24669
+ const cx = PAD + R;
24670
+ const cy = node.h / 2;
24671
+ const \u8868\u5DE6 = node.w - PAD - \u8868\u5E45;
24672
+ const \u53F3\u7AEF = node.w - PAD;
24673
+ const \u5272\u5408\u53F3 = \u53F3\u7AEF - \u5B9F\u6570\u5E45 - 24;
24674
+ const \u884C\u306E\u9593 = Math.min(52, (node.h - PAD * 2 - 40) / Math.max(1, data.length));
24675
+ const \u898B\u51FA\u3057\u306Ey = node.h / 2 - \u884C\u306E\u9593 * data.length / 2 - 14;
24676
+ const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
24677
+ const \u5207\u308A\u629C\u304Did = `cdl-pie-draw-${instanceId}`;
24678
+ const \u958B\u304D\u59CB\u3081\u305F = (\u59CB\u307E\u308A) => !drawing || \u958B\u304D > \u59CB\u307E\u308A;
24679
+ let \u89D2 = -Math.PI / 2;
24680
+ let \u7D2F\u8A08 = 0;
24681
+ const \u6247\u305F\u3061 = data.map((d, idx) => {
24682
+ const frac = \u5272\u5408[idx] ?? 0;
24683
+ const a0 = \u89D2;
24684
+ const a1 = \u89D2 + frac * Math.PI * 2;
24685
+ \u89D2 = a1;
24686
+ const \u59CB\u307E\u308A = \u7D2F\u8A08;
24687
+ \u7D2F\u8A08 += frac;
24688
+ return { d, idx, \u59CB\u307E\u308A, path: \u8F2A\u306E\u9053(cx, cy, R, \u5185\u534A\u5F84, a0, a1) };
24689
+ });
24690
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
24691
+ \u67A0(node, active),
24692
+ 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) }) }),
24693
+ /* @__PURE__ */ jsxRuntime.jsx("g", { ...drawing ? { clipPath: `url(#${\u5207\u308A\u629C\u304Did})` } : {}, children: \u6247\u305F\u3061.map((s) => /* @__PURE__ */ jsxRuntime.jsx(
24694
+ "path",
24695
+ {
24696
+ "data-cdl-role": "chart-pie-slice",
24697
+ "data-cdl-unresolved": s.d.unresolved ? "true" : void 0,
24698
+ d: s.path,
24699
+ fill: sliceColor(s.d.tone, s.idx),
24700
+ stroke: "var(--cdl-node-fill, #ffffff)",
24701
+ strokeWidth: 3,
24702
+ strokeLinejoin: "round"
24703
+ },
24704
+ `slice-${s.idx}`
24705
+ )) }),
24706
+ /* @__PURE__ */ jsxRuntime.jsx(
24707
+ "text",
24708
+ {
24709
+ x: cx,
24710
+ y: cy - 2,
24711
+ textAnchor: "middle",
24712
+ fontSize: Math.round(R * 0.26),
24713
+ fontWeight: 600,
24714
+ fill: "var(--cdl-text, #1a1f2a)",
24715
+ children: \u5B9F\u5024\u8868\u8A18(Math.round(data.reduce((acc, d) => acc + d.value, 0)))
24716
+ }
24717
+ ),
24718
+ /* @__PURE__ */ jsxRuntime.jsx(
24719
+ "text",
24720
+ {
24721
+ x: cx,
24722
+ y: cy + Math.round(R * 0.2),
24723
+ textAnchor: "middle",
24724
+ fontSize: Math.round(R * 0.12),
24725
+ fill: "var(--cdl-text-dim, #5a6270)",
24726
+ children: "\u5408\u8A08"
24727
+ }
24728
+ ),
24729
+ /* @__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" }),
24730
+ /* @__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" }),
24731
+ /* @__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" }),
24732
+ /* @__PURE__ */ jsxRuntime.jsx(
24733
+ "line",
24734
+ {
24735
+ "data-cdl-role": "chart-pie-table-rule",
24736
+ x1: \u8868\u5DE6,
24737
+ y1: \u898B\u51FA\u3057\u306Ey + 10,
24738
+ x2: \u53F3\u7AEF,
24739
+ y2: \u898B\u51FA\u3057\u306Ey + 10,
24740
+ stroke: "var(--cdl-text, #1a1f2a)",
24741
+ strokeWidth: 1.2
24742
+ }
24743
+ ),
24744
+ \u6247\u305F\u3061.map((s) => {
24745
+ if (!\u958B\u304D\u59CB\u3081\u305F(s.\u59CB\u307E\u308A)) return null;
24746
+ const y = \u898B\u51FA\u3057\u306Ey + 40 + \u884C\u306E\u9593 * s.idx;
24747
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
24748
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: \u8868\u5DE6, y: y - 10, width: 10, height: 10, rx: 2, fill: sliceColor(s.d.tone, s.idx) }),
24749
+ /* @__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 }),
24750
+ /* @__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] }),
24751
+ /* @__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] }),
24752
+ /* @__PURE__ */ jsxRuntime.jsx(
24753
+ "line",
24754
+ {
24755
+ "data-cdl-role": "chart-pie-table-rule",
24756
+ x1: \u8868\u5DE6,
24757
+ y1: y + 16,
24758
+ x2: \u53F3\u7AEF,
24759
+ y2: y + 16,
24760
+ stroke: "var(--cdl-divider, #d4d4d8)",
24761
+ strokeWidth: 1
24762
+ }
24763
+ )
24764
+ ] }, `row-${s.idx}`);
24765
+ })
24766
+ ] });
24767
+ }
24768
+ function \u5F27\u306E\u9053(cx, cy, r, \u53D6\u308A\u5206) {
24769
+ const \u5B9F\u52B9 = Math.max(0, Math.min(0.9999, \u53D6\u308A\u5206));
24770
+ const a0 = -Math.PI / 2;
24771
+ const a1 = a0 + \u5B9F\u52B9 * Math.PI * 2;
24772
+ const large = \u5B9F\u52B9 > 0.5 ? 1 : 0;
24773
+ 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)}`;
24774
+ }
24775
+ function \u8F2A\u306E\u9053(cx, cy, R, r, a0, a1) {
24776
+ const large = a1 - a0 > Math.PI ? 1 : 0;
24777
+ 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`;
24778
+ }
24497
24779
  function \u6247\u5F62\u306E\u5207\u308A\u629C\u304D(cx, cy, r, \u958B\u304D) {
24498
24780
  if (\u958B\u304D <= 0) return null;
24499
24781
  if (\u958B\u304D >= 1) return /* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy, r });
@@ -24695,8 +24977,8 @@ function ChartRadialNode({
24695
24977
  frac,
24696
24978
  \u4E2D\u5FC3\u534A\u5F84,
24697
24979
  // 軌道は全周。 1 周ちょうどは弧で表せないので、 わずかに欠かして描く
24698
- \u8ECC\u9053: \u5F27\u306E\u9053(\u5F27\u306Ecx, cy, \u4E2D\u5FC3\u534A\u5F84, \u5E2F\u306E\u5E45, 0.9999),
24699
- \u53D6\u308A\u5206: frac <= 0 ? null : \u5F27\u306E\u9053(\u5F27\u306Ecx, cy, \u4E2D\u5FC3\u534A\u5F84, \u5E2F\u306E\u5E45, Math.min(frac, 0.9999))
24980
+ \u8ECC\u9053: \u5F27\u306E\u90532(\u5F27\u306Ecx, cy, \u4E2D\u5FC3\u534A\u5F84, \u5E2F\u306E\u5E45, 0.9999),
24981
+ \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
24982
  };
24701
24983
  });
24702
24984
  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 +25049,7 @@ function ChartRadialNode({
24767
25049
  ] });
24768
25050
  }
24769
25051
  var \u5370\u306E\u5E45 = 18;
24770
- function \u5F27\u306E\u9053(cx, cy, \u4E2D\u5FC3\u534A\u5F84, \u5E45, \u5272\u5408) {
25052
+ function \u5F27\u306E\u90532(cx, cy, \u4E2D\u5FC3\u534A\u5F84, \u5E45, \u5272\u5408) {
24771
25053
  const \u5916 = \u4E2D\u5FC3\u534A\u5F84 + \u5E45 / 2;
24772
25054
  const \u5185 = Math.max(0.5, \u4E2D\u5FC3\u534A\u5F84 - \u5E45 / 2);
24773
25055
  const a0 = -Math.PI / 2;
@@ -24813,12 +25095,12 @@ function ChartStatNode({
24813
25095
  }
24814
25096
  ),
24815
25097
  data.map((d, idx) => {
24816
- const \u67A0 = \u533A\u753B.\u67A0(idx);
25098
+ const \u67A02 = \u533A\u753B.\u67A0(idx);
24817
25099
  const frac = total > 0 ? d.value / total : 0;
24818
25100
  const \u8272 = \u5370\u306E\u8272(d.tone, idx);
24819
25101
  const \u6570\u5024 = \u5B9F\u5024\u8868\u8A184(d.value);
24820
- const \u6570\u5024\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A(\u6570\u5024, \u67A0.w - \u533A\u753B.\u4F59\u767D * 2, \u533A\u753B.\u6570\u5024\u306E\u7D1A, \u533A\u753B.\u540D\u524D\u306E\u7D1A + 1);
24821
- return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-role": "chart-stat-item", transform: `translate(${\u67A0.x} ${\u67A0.y})`, children: [
25102
+ 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);
25103
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-role": "chart-stat-item", transform: `translate(${\u67A02.x} ${\u67A02.y})`, children: [
24822
25104
  idx > 0 && /* @__PURE__ */ jsxRuntime.jsx(
24823
25105
  "line",
24824
25106
  {
@@ -24826,7 +25108,7 @@ function ChartStatNode({
24826
25108
  x1: 0,
24827
25109
  y1: \u533A\u753B.\u4F59\u767D,
24828
25110
  x2: 0,
24829
- y2: \u67A0.h - \u533A\u753B.\u4F59\u767D,
25111
+ y2: \u67A02.h - \u533A\u753B.\u4F59\u767D,
24830
25112
  stroke: "var(--cdl-divider, #d4d4d8)",
24831
25113
  strokeWidth: 1
24832
25114
  }
@@ -24835,7 +25117,7 @@ function ChartStatNode({
24835
25117
  "text",
24836
25118
  {
24837
25119
  "data-cdl-role": "chart-stat-label",
24838
- x: \u67A0.w / 2,
25120
+ x: \u67A02.w / 2,
24839
25121
  y: \u533A\u753B.\u540D\u524D\u306Ey,
24840
25122
  fontSize: \u533A\u753B.\u540D\u524D\u306E\u7D1A,
24841
25123
  fontWeight: 700,
@@ -24849,7 +25131,7 @@ function ChartStatNode({
24849
25131
  {
24850
25132
  "data-cdl-role": "chart-stat-value",
24851
25133
  "data-cdl-unresolved": d.unresolved ? "true" : void 0,
24852
- x: \u67A0.w / 2,
25134
+ x: \u67A02.w / 2,
24853
25135
  y: \u533A\u753B.\u6570\u5024\u306Ey,
24854
25136
  fontSize: \u6570\u5024\u306E\u7D1A,
24855
25137
  fontWeight: 700,
@@ -24862,7 +25144,7 @@ function ChartStatNode({
24862
25144
  "circle",
24863
25145
  {
24864
25146
  "data-cdl-role": "chart-stat-track",
24865
- cx: \u67A0.w / 2,
25147
+ cx: \u67A02.w / 2,
24866
25148
  cy: \u533A\u753B.\u5F27\u306Ey,
24867
25149
  r: \u533A\u753B.\u5F27\u306E\u534A\u5F84,
24868
25150
  fill: "none",
@@ -24875,7 +25157,7 @@ function ChartStatNode({
24875
25157
  "path",
24876
25158
  {
24877
25159
  "data-cdl-role": "chart-stat-arc",
24878
- d: \u5F27\u306E\u90532(\u67A0.w / 2, \u533A\u753B.\u5F27\u306Ey, \u533A\u753B.\u5F27\u306E\u534A\u5F84, Math.min(frac, 0.9999)),
25160
+ d: \u5F27\u306E\u90533(\u67A02.w / 2, \u533A\u753B.\u5F27\u306Ey, \u533A\u753B.\u5F27\u306E\u534A\u5F84, Math.min(frac, 0.9999)),
24879
25161
  fill: "none",
24880
25162
  stroke: \u8272,
24881
25163
  strokeWidth: \u533A\u753B.\u5F27\u306E\u592A\u3055,
@@ -24886,7 +25168,7 @@ function ChartStatNode({
24886
25168
  "text",
24887
25169
  {
24888
25170
  "data-cdl-role": "chart-stat-share",
24889
- x: \u67A0.w / 2,
25171
+ x: \u67A02.w / 2,
24890
25172
  y: \u533A\u753B.\u5272\u5408\u306Ey,
24891
25173
  fontSize: \u533A\u753B.\u5272\u5408\u306E\u7D1A,
24892
25174
  textAnchor: "middle",
@@ -24931,7 +25213,7 @@ function \u53CE\u3081\u308B\u7D1A(\u5B57, \u4F7F\u3048\u308B\u5E452, \u521D\u671
24931
25213
  while (\u7D1A > \u4E0B\u9650 && textWidth(\u5B57, \u7D1A) > \u4F7F\u3048\u308B\u5E452) \u7D1A -= 1;
24932
25214
  return \u7D1A;
24933
25215
  }
24934
- function \u5F27\u306E\u90532(cx, cy, r, \u5272\u5408) {
25216
+ function \u5F27\u306E\u90533(cx, cy, r, \u5272\u5408) {
24935
25217
  const a0 = -Math.PI / 2;
24936
25218
  const a1 = a0 + \u5272\u5408 * Math.PI * 2;
24937
25219
  const large = \u5272\u5408 > 0.5 ? 1 : 0;
@@ -25239,6 +25521,238 @@ function \u4E00\u89A7\u306E\u4E26\u3073(data, \u5DE6, \u53F3\u7AEF, \u7D1A) {
25239
25521
  });
25240
25522
  return out;
25241
25523
  }
25524
+
25525
+ // src/kinds/chart-number.ts
25526
+ function \u5B9F\u5024\u8868\u8A187(v) {
25527
+ return Number.isInteger(v) ? v.toLocaleString("en-US") : v.toLocaleString("en-US", { maximumFractionDigits: 1 });
25528
+ }
25529
+ var \u7DDA\u306E\u6700\u5C0F\u5E45 = 120;
25530
+ function ChartSlopeNode({
25531
+ node,
25532
+ active,
25533
+ stateValues = {},
25534
+ drawing = false,
25535
+ progress = 1
25536
+ }) {
25537
+ const x0 = node.cx - node.w / 2;
25538
+ const y0 = node.cy - node.h / 2;
25539
+ const data = resolveChartData(node.chartData ?? [], stateValues);
25540
+ const PAD = 24;
25541
+ const \u6642\u70B9\u306E\u7D1A = 12;
25542
+ const \u5024\u306E\u7D1A = 14;
25543
+ const \u540D\u524D\u306E\u4E0A\u9650\u7D1A = 13;
25544
+ const \u540D\u524D\u306E\u4E0B\u9650\u7D1A = 9;
25545
+ const \u8EF8\u304B\u3089\u5024\u307E\u3067 = 10;
25546
+ const \u5024\u304B\u3089\u540D\u524D\u307E\u3067 = 8;
25547
+ const \u524D\u3042\u308A = data.some((d) => d.previous !== void 0);
25548
+ const \u7CFB\u5217\u305F\u3061 = data.map((d, i) => ({
25549
+ \u540D\u524D: d.label ?? "",
25550
+ // 前を持たない件は 0 から立ち上げる。 件を落とすと左右で系列の数が変わり、色の並びが
25551
+ // 対応しなくなる (`chart-stacked-bar` と同じ判断)
25552
+ \u524D: d.previous ?? 0,
25553
+ \u4ECA: d.value,
25554
+ \u8272: \u5370\u306E\u82724(d.tone, i),
25555
+ \u672A\u89E3\u6C7A: d.unresolved === true
25556
+ }));
25557
+ const \u5168\u90E8\u306E\u5024 = \u524D\u3042\u308A ? \u7CFB\u5217\u305F\u3061.flatMap((s) => [s.\u524D, s.\u4ECA]) : \u7CFB\u5217\u305F\u3061.map((s) => s.\u4ECA);
25558
+ const \u6700\u5C0F = \u5168\u90E8\u306E\u5024.length > 0 ? Math.min(...\u5168\u90E8\u306E\u5024) : 0;
25559
+ const \u6700\u5927 = \u5168\u90E8\u306E\u5024.length > 0 ? Math.max(...\u5168\u90E8\u306E\u5024) : 0;
25560
+ const \u5C3A\u306E\u5E45 = \u6700\u5927 - \u6700\u5C0F;
25561
+ const \u4E0A\u7AEF = PAD + (\u524D\u3042\u308A ? \u6642\u70B9\u306E\u7D1A + 12 : 0) + 6;
25562
+ const \u4E0B\u7AEF = Math.max(\u4E0A\u7AEF + 10, node.h - PAD - 6);
25563
+ const y\u3092\u53D6\u308B = (v) => \u5C3A\u306E\u5E45 > 0 ? \u4E0B\u7AEF - (v - \u6700\u5C0F) / \u5C3A\u306E\u5E45 * (\u4E0B\u7AEF - \u4E0A\u7AEF) : (\u4E0A\u7AEF + \u4E0B\u7AEF) / 2;
25564
+ const \u5DE6\u306E\u5B57 = \u7CFB\u5217\u305F\u3061.map((s) => \u5B9F\u5024\u8868\u8A187(s.\u524D));
25565
+ const \u53F3\u306E\u5B57 = \u7CFB\u5217\u305F\u3061.map((s) => \u5B9F\u5024\u8868\u8A187(s.\u4ECA));
25566
+ const \u5DE6\u5024\u5E45 = Math.max(0, ...\u5DE6\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A)));
25567
+ const \u53F3\u5024\u5E45 = Math.max(0, ...\u53F3\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A)));
25568
+ const \u540D\u524D\u306B\u4F7F\u3048\u308B = Math.max(
25569
+ 0,
25570
+ (node.w - PAD * 2 - \u7DDA\u306E\u6700\u5C0F\u5E45 - (\u5DE6\u5024\u5E45 + \u8EF8\u304B\u3089\u5024\u307E\u3067 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067) - (\u53F3\u5024\u5E45 + \u8EF8\u304B\u3089\u5024\u307E\u3067 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067)) / 2
25571
+ );
25572
+ const \u540D\u524D\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A2(\u7CFB\u5217\u305F\u3061.map((s) => s.\u540D\u524D), \u540D\u524D\u306B\u4F7F\u3048\u308B, \u540D\u524D\u306E\u4E0A\u9650\u7D1A, \u540D\u524D\u306E\u4E0B\u9650\u7D1A);
25573
+ const \u540D\u524D\u5E45 = Math.min(
25574
+ \u540D\u524D\u306B\u4F7F\u3048\u308B,
25575
+ Math.max(0, ...\u7CFB\u5217\u305F\u3061.map((s) => textWidth(s.\u540D\u524D, \u540D\u524D\u306E\u7D1A)))
25576
+ );
25577
+ const \u5DE6\u306E\u4F59\u767D = \u540D\u524D\u5E45 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067 + \u5DE6\u5024\u5E45 + \u8EF8\u304B\u3089\u5024\u307E\u3067;
25578
+ const \u53F3\u306E\u4F59\u767D = \u8EF8\u304B\u3089\u5024\u307E\u3067 + \u53F3\u5024\u5E45 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067 + \u540D\u524D\u5E45;
25579
+ const \u5DE6\u8EF8x = \u524D\u3042\u308A ? Math.max(PAD, Math.min(PAD + \u5DE6\u306E\u4F59\u767D, node.w / 2 - \u7DDA\u306E\u6700\u5C0F\u5E45 / 2)) : Math.max(PAD, Math.min(node.w / 2, node.w - PAD));
25580
+ const \u53F3\u8EF8x = \u524D\u3042\u308A ? Math.min(node.w - PAD, Math.max(node.w - PAD - \u53F3\u306E\u4F59\u767D, node.w / 2 + \u7DDA\u306E\u6700\u5C0F\u5E45 / 2)) : \u5DE6\u8EF8x;
25581
+ const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
25582
+ const \u53F3\u3092\u51FA\u3059 = !drawing || \u4F38\u3073 >= 1;
25583
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
25584
+ /* @__PURE__ */ jsxRuntime.jsx(
25585
+ "rect",
25586
+ {
25587
+ "data-cdl-role": "node-body",
25588
+ x: 0,
25589
+ y: 0,
25590
+ width: node.w,
25591
+ height: node.h,
25592
+ rx: 16,
25593
+ fill: "var(--cdl-node-fill, #ffffff)",
25594
+ stroke: active ? "var(--cdl-tone-accent, #2d6a8f)" : "var(--cdl-divider, #d4d4d8)",
25595
+ strokeWidth: active ? 3 : 1.25
25596
+ }
25597
+ ),
25598
+ (\u524D\u3042\u308A ? [\u5DE6\u8EF8x, \u53F3\u8EF8x] : [\u5DE6\u8EF8x]).map((x, i) => /* @__PURE__ */ jsxRuntime.jsx(
25599
+ "line",
25600
+ {
25601
+ "data-cdl-role": "chart-slope-axis",
25602
+ x1: x,
25603
+ y1: \u4E0A\u7AEF - 6,
25604
+ x2: x,
25605
+ y2: \u4E0B\u7AEF + 6,
25606
+ stroke: "var(--cdl-divider, #d4d4d8)",
25607
+ strokeWidth: 1
25608
+ },
25609
+ `axis-${i}`
25610
+ )),
25611
+ \u524D\u3042\u308A && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
25612
+ /* @__PURE__ */ jsxRuntime.jsx(
25613
+ "text",
25614
+ {
25615
+ "data-cdl-role": "chart-slope-period",
25616
+ x: \u5DE6\u8EF8x,
25617
+ y: PAD + \u6642\u70B9\u306E\u7D1A,
25618
+ textAnchor: "middle",
25619
+ fontSize: \u6642\u70B9\u306E\u7D1A,
25620
+ fontWeight: 700,
25621
+ fill: "var(--cdl-text-dim, #5a6270)",
25622
+ children: "\u524D"
25623
+ }
25624
+ ),
25625
+ /* @__PURE__ */ jsxRuntime.jsx(
25626
+ "text",
25627
+ {
25628
+ "data-cdl-role": "chart-slope-period",
25629
+ x: \u53F3\u8EF8x,
25630
+ y: PAD + \u6642\u70B9\u306E\u7D1A,
25631
+ textAnchor: "middle",
25632
+ fontSize: \u6642\u70B9\u306E\u7D1A,
25633
+ fontWeight: 700,
25634
+ fill: "var(--cdl-text-dim, #5a6270)",
25635
+ children: "\u4ECA"
25636
+ }
25637
+ )
25638
+ ] }),
25639
+ \u7CFB\u5217\u305F\u3061.map((s, i) => {
25640
+ const \u5DE6y = y\u3092\u53D6\u308B(s.\u524D);
25641
+ const \u53F3y = y\u3092\u53D6\u308B(s.\u4ECA);
25642
+ const \u672A\u89E3\u6C7A = s.\u672A\u89E3\u6C7A ? "true" : void 0;
25643
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
25644
+ \u524D\u3042\u308A && /* @__PURE__ */ jsxRuntime.jsx(
25645
+ "path",
25646
+ {
25647
+ "data-cdl-role": "chart-slope-line",
25648
+ "data-cdl-unresolved": \u672A\u89E3\u6C7A,
25649
+ d: `M ${\u5DE6\u8EF8x} ${\u5DE6y} L ${\u53F3\u8EF8x} ${\u53F3y}`,
25650
+ fill: "none",
25651
+ stroke: s.\u8272,
25652
+ strokeWidth: 2.5,
25653
+ strokeLinecap: "round",
25654
+ ...\u4F38\u3070\u3059dash(drawing, \u4F38\u3073)
25655
+ }
25656
+ ),
25657
+ \u524D\u3042\u308A && /* @__PURE__ */ jsxRuntime.jsx(
25658
+ "circle",
25659
+ {
25660
+ "data-cdl-role": "chart-slope-dot",
25661
+ "data-cdl-unresolved": \u672A\u89E3\u6C7A,
25662
+ cx: \u5DE6\u8EF8x,
25663
+ cy: \u5DE6y,
25664
+ r: 4,
25665
+ fill: s.\u8272
25666
+ }
25667
+ ),
25668
+ \u53F3\u3092\u51FA\u3059 && /* @__PURE__ */ jsxRuntime.jsx(
25669
+ "circle",
25670
+ {
25671
+ "data-cdl-role": "chart-slope-dot",
25672
+ "data-cdl-unresolved": \u672A\u89E3\u6C7A,
25673
+ cx: \u53F3\u8EF8x,
25674
+ cy: \u53F3y,
25675
+ r: 4,
25676
+ fill: s.\u8272
25677
+ }
25678
+ ),
25679
+ \u524D\u3042\u308A ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
25680
+ /* @__PURE__ */ jsxRuntime.jsx(
25681
+ "text",
25682
+ {
25683
+ "data-cdl-role": "chart-slope-label",
25684
+ x: \u5DE6\u8EF8x - \u8EF8\u304B\u3089\u5024\u307E\u3067,
25685
+ y: \u5DE6y + 5,
25686
+ textAnchor: "end",
25687
+ fontSize: \u5024\u306E\u7D1A,
25688
+ fontWeight: 600,
25689
+ fill: "var(--cdl-text, #1a1f2a)",
25690
+ children: \u5DE6\u306E\u5B57[i]
25691
+ }
25692
+ ),
25693
+ /* @__PURE__ */ jsxRuntime.jsx(
25694
+ "text",
25695
+ {
25696
+ "data-cdl-role": "chart-slope-label",
25697
+ x: \u5DE6\u8EF8x - \u8EF8\u304B\u3089\u5024\u307E\u3067 - \u5DE6\u5024\u5E45 - \u5024\u304B\u3089\u540D\u524D\u307E\u3067,
25698
+ y: \u5DE6y + 5,
25699
+ textAnchor: "end",
25700
+ fontSize: \u540D\u524D\u306E\u7D1A,
25701
+ fill: "var(--cdl-text-dim, #5a6270)",
25702
+ children: s.\u540D\u524D
25703
+ }
25704
+ )
25705
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(
25706
+ "text",
25707
+ {
25708
+ "data-cdl-role": "chart-slope-label",
25709
+ x: \u5DE6\u8EF8x - \u8EF8\u304B\u3089\u5024\u307E\u3067,
25710
+ y: \u53F3y + 5,
25711
+ textAnchor: "end",
25712
+ fontSize: \u540D\u524D\u306E\u7D1A,
25713
+ fill: "var(--cdl-text-dim, #5a6270)",
25714
+ children: s.\u540D\u524D
25715
+ }
25716
+ ),
25717
+ \u53F3\u3092\u51FA\u3059 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
25718
+ /* @__PURE__ */ jsxRuntime.jsx(
25719
+ "text",
25720
+ {
25721
+ "data-cdl-role": "chart-slope-label",
25722
+ x: \u53F3\u8EF8x + \u8EF8\u304B\u3089\u5024\u307E\u3067,
25723
+ y: \u53F3y + 5,
25724
+ fontSize: \u5024\u306E\u7D1A,
25725
+ fontWeight: 600,
25726
+ fill: "var(--cdl-text, #1a1f2a)",
25727
+ children: \u53F3\u306E\u5B57[i]
25728
+ }
25729
+ ),
25730
+ \u524D\u3042\u308A && /* @__PURE__ */ jsxRuntime.jsx(
25731
+ "text",
25732
+ {
25733
+ "data-cdl-role": "chart-slope-label",
25734
+ x: \u53F3\u8EF8x + \u8EF8\u304B\u3089\u5024\u307E\u3067 + \u53F3\u5024\u5E45 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067,
25735
+ y: \u53F3y + 5,
25736
+ fontSize: \u540D\u524D\u306E\u7D1A,
25737
+ fill: "var(--cdl-text-dim, #5a6270)",
25738
+ children: s.\u540D\u524D
25739
+ }
25740
+ )
25741
+ ] })
25742
+ ] }, `slope-${i}`);
25743
+ })
25744
+ ] });
25745
+ }
25746
+ function \u5370\u306E\u82724(tone, idx) {
25747
+ if (tone) return TONE[tone];
25748
+ return chartSeriesColor(idx);
25749
+ }
25750
+ function \u53CE\u3081\u308B\u7D1A2(\u540D\u524D\u305F\u3061, \u5E45, \u4E0A\u9650, \u4E0B\u9650) {
25751
+ if (\u540D\u524D\u305F\u3061.length === 0) return \u4E0A\u9650;
25752
+ let \u7D1A = \u4E0A\u9650;
25753
+ while (\u7D1A > \u4E0B\u9650 && Math.max(...\u540D\u524D\u305F\u3061.map((n) => textWidth(n, \u7D1A))) > \u5E45) \u7D1A -= 1;
25754
+ return \u7D1A;
25755
+ }
25242
25756
  function ChartBarNode({
25243
25757
  node,
25244
25758
  active,
@@ -29918,6 +30432,17 @@ function CdlNodeView({
29918
30432
  return /* @__PURE__ */ jsxRuntime.jsx(ChartGaugeNode, { node: resolvedNode, active, stateValues });
29919
30433
  case "chart-stacked-bar":
29920
30434
  return /* @__PURE__ */ jsxRuntime.jsx(ChartStackedBarNode, { node: resolvedNode, active, stateValues });
30435
+ case "chart-slope":
30436
+ return /* @__PURE__ */ jsxRuntime.jsx(
30437
+ ChartSlopeNode,
30438
+ {
30439
+ node: resolvedNode,
30440
+ active,
30441
+ stateValues,
30442
+ drawing,
30443
+ progress
30444
+ }
30445
+ );
29921
30446
  case "chart-waffle":
29922
30447
  return /* @__PURE__ */ jsxRuntime.jsx(ChartWaffleNode, { node: resolvedNode, active, stateValues });
29923
30448
  case "chart-stat":
@@ -31699,7 +32224,8 @@ function chart(preset) {
31699
32224
  radial: "chart-radial",
31700
32225
  stat: "chart-stat",
31701
32226
  waffle: "chart-waffle",
31702
- "stacked-bar": "chart-stacked-bar"
32227
+ "stacked-bar": "chart-stacked-bar",
32228
+ slope: "chart-slope"
31703
32229
  };
31704
32230
  const api = {
31705
32231
  datum(d) {