@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/react.cjs CHANGED
@@ -579,6 +579,7 @@ var KINDS_WITHOUT_TITLE_TEXT = /* @__PURE__ */ new Set([
579
579
  "chart-stat",
580
580
  "chart-waffle",
581
581
  "chart-stacked-bar",
582
+ "chart-slope",
582
583
  "gantt-timeline",
583
584
  "mind-map",
584
585
  "funnel-stages",
@@ -2314,8 +2315,10 @@ var NODE_KINDS = [
2314
2315
  "chart-radial",
2315
2316
  "chart-stat",
2316
2317
  // chart-stacked-bar は帯を割合で区切り時点を並べる形 (cdl#551)
2318
+ // chart-slope は 2 時点を直線でつなぎ増減と順位の入れ替わりを見せる形 (cdl#688)
2317
2319
  "chart-waffle",
2318
2320
  "chart-stacked-bar",
2321
+ "chart-slope",
2319
2322
  // Timeline / Mind 系 (2、 CAR-994 Phase B) ... 1 node に payload 配列、 SVG geometry render
2320
2323
  "gantt-timeline",
2321
2324
  "mind-map",
@@ -4450,6 +4453,7 @@ var GRID_ALIGNED_KINDS = /* @__PURE__ */ new Set([
4450
4453
  "chart-stat",
4451
4454
  "chart-waffle",
4452
4455
  "chart-stacked-bar",
4456
+ "chart-slope",
4453
4457
  "funnel-stages",
4454
4458
  "quadrant-matrix"
4455
4459
  ]);
@@ -4908,10 +4912,10 @@ function countEdgeCrossings(edges, warnAt = 3) {
4908
4912
  if (isNearAny(p, a.ends, SAME_POINT_TOL) || isNearAny(p, b.ends, SAME_POINT_TOL))
4909
4913
  continue;
4910
4914
  if (\u5171\u6709\u5074.length > 0) {
4911
- const \u67A0 = Math.min(MAX_CHECKS - checks, MAX_CHECKS_PER_PAIR - pairChecks);
4912
- const \u4E88\u7B97 = { \u6B8B\u308A: Math.max(0, \u67A0) };
4915
+ const \u67A02 = Math.min(MAX_CHECKS - checks, MAX_CHECKS_PER_PAIR - pairChecks);
4916
+ const \u4E88\u7B97 = { \u6B8B\u308A: Math.max(0, \u67A02) };
4913
4917
  const \u5224\u5B9A = mergesTowardShared(a.flat, b.flat, p, \u5171\u6709\u5074, MERGE_TOL, \u4E88\u7B97);
4914
- const \u4F7F\u3063\u305F = Math.max(0, \u67A0) - \u4E88\u7B97.\u6B8B\u308A;
4918
+ const \u4F7F\u3063\u305F = Math.max(0, \u67A02) - \u4E88\u7B97.\u6B8B\u308A;
4915
4919
  checks += \u4F7F\u3063\u305F;
4916
4920
  pairChecks += \u4F7F\u3063\u305F;
4917
4921
  if (\u5224\u5B9A === "merged") continue;
@@ -6786,6 +6790,8 @@ var TOKENS = {
6786
6790
  "chart-waffle": { w: 640, h: 320 },
6787
6791
  // 帯を最大 2 本 + 下に一覧。 縦は帯 2 本ぶんで足りる (cdl#551)
6788
6792
  "chart-stacked-bar": { w: 640, h: 320 },
6793
+ // 左右 2 本の縦軸と、その外に名札。 縦は系列が縦に並ぶぶん要る (cdl#688)
6794
+ "chart-slope": { w: 640, h: 360 },
6789
6795
  // Timeline / Mind 系 (CAR-994 Phase B)
6790
6796
  "gantt-timeline": { w: 720, h: 360 },
6791
6797
  "mind-map": { w: 720, h: 480 },
@@ -9499,6 +9505,7 @@ var DRAW_KINDS = /* @__PURE__ */ new Set([
9499
9505
  "chart-line",
9500
9506
  "chart-bar",
9501
9507
  "chart-pie",
9508
+ "chart-slope",
9502
9509
  "journey-map",
9503
9510
  "mind-map",
9504
9511
  "tree-hierarchy",
@@ -11844,52 +11851,52 @@ function ChartPieNode({
11844
11851
  const y0 = node.cy - node.h / 2;
11845
11852
  const data = resolveChartData(node.chartData ?? [], stateValues);
11846
11853
  const total = data.reduce((acc, d) => acc + d.value, 0) || 1;
11854
+ const \u524D\u3042\u308A = data.some((d) => d.previous !== void 0);
11855
+ const \u4ECA\u306E\u5024 = data.map((d) => Math.max(0, d.value));
11856
+ const \u524D\u306E\u5024 = data.map((d) => Math.max(0, d.previous ?? 0));
11857
+ const \u4ECA\u306E\u5408\u8A08 = \u4ECA\u306E\u5024.reduce((acc, value) => acc + value, 0);
11858
+ const \u524D\u306E\u5408\u8A08 = \u524D\u306E\u5024.reduce((acc, value) => acc + value, 0);
11859
+ 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);
11860
+ const \u524D\u306E\u5272\u5408 = \u524D\u306E\u5024.map((value) => \u524D\u306E\u5408\u8A08 > 0 ? value / \u524D\u306E\u5408\u8A08 : 0);
11861
+ const \u5F62 = node.chartPieForm === "arcs" || node.chartPieForm === "table" ? node.chartPieForm : "ring";
11847
11862
  const PAD_TOP2 = 20;
11848
11863
  const PAD_BOTTOM2 = 20;
11849
11864
  const PAD_SIDE = 20;
11850
11865
  const chartAreaH = node.h - PAD_TOP2 - PAD_BOTTOM2;
11851
- const \u540D\u672D\u306E\u7D1A = 14;
11852
- const \u6570\u5024\u306E\u7D1A = 13;
11866
+ const \u5272\u5408\u306E\u7D1A = 19;
11867
+ const \u540D\u524D\u306E\u7D1A = 12;
11853
11868
  const \u5F15\u304D\u51FA\u3057 = 18;
11854
11869
  const \u5B57\u307E\u3067\u306E\u9593 = 26;
11855
11870
  const \u540D\u672D\u306E\u7E26\u306E\u5F35\u308A\u51FA\u3057 = 20;
11856
- const \u5272\u5408\u306E\u6587\u5B57 = data.map((d) => \u5272\u5408\u8868\u8A18(d.value / total));
11857
- const \u6570\u5024\u306E\u6587\u5B57 = data.map((d, i) => `${\u5B9F\u5024\u8868\u8A18(d.value)} ${\u5272\u5408\u306E\u6587\u5B57[i]}`);
11871
+ const \u5272\u5408\u306E\u6587\u5B57 = \u4ECA\u306E\u5272\u5408.map(\u5272\u5408\u8868\u8A18);
11872
+ const \u540D\u524D\u306E\u6587\u5B57 = data.map((d, i) => {
11873
+ const \u540D = d.label ?? "";
11874
+ if (\u524D\u3042\u308A) return `${\u540D} ${\u5B9F\u5024\u8868\u8A18(\u524D\u306E\u5024[i])} \u2192 ${\u5B9F\u5024\u8868\u8A18(\u4ECA\u306E\u5024[i])}`;
11875
+ return `${\u5B9F\u5024\u8868\u8A18(d.value)}%` === \u5272\u5408\u306E\u6587\u5B57[i] ? \u540D : `${\u540D} ${\u5B9F\u5024\u8868\u8A18(d.value)}`;
11876
+ });
11877
+ if (\u5F62 !== "ring") {
11878
+ const \u5171\u901A = { node, active, data, \u5272\u5408: \u4ECA\u306E\u5272\u5408, x0, y0, drawing, progress, instanceId };
11879
+ return \u5F62 === "arcs" ? \u5F27\u306E\u5F62(\u5171\u901A) : \u8868\u306E\u5F62(\u5171\u901A);
11880
+ }
11858
11881
  const \u540D\u672D\u5E45 = Math.max(
11859
11882
  0,
11860
11883
  ...data.map(
11861
- (d, i) => Math.max(textWidth(d.label ?? "", \u540D\u672D\u306E\u7D1A), textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A))
11884
+ (_d, i) => Math.max(
11885
+ textWidth(\u5272\u5408\u306E\u6587\u5B57[i] ?? "", \u5272\u5408\u306E\u7D1A),
11886
+ textWidth(\u540D\u524D\u306E\u6587\u5B57[i] ?? "", \u540D\u524D\u306E\u7D1A)
11887
+ )
11862
11888
  )
11863
11889
  );
11864
11890
  const \u7E26\u304B\u3089 = chartAreaH / 2 - \u5F15\u304D\u51FA\u3057 - \u540D\u672D\u306E\u7E26\u306E\u5F35\u308A\u51FA\u3057;
11865
11891
  const \u6A2A\u304B\u3089 = (node.w - PAD_SIDE * 2) / 2 - \u5F15\u304D\u51FA\u3057 - \u5B57\u307E\u3067\u306E\u9593 - \u540D\u672D\u5E45;
11866
11892
  const radius = Math.max(24, Math.min(\u7E26\u304B\u3089, \u6A2A\u304B\u3089));
11867
- const \u5185\u534A\u5F84 = radius * 0.58;
11893
+ const \u5916\u306E\u5185\u534A\u5F84 = radius * (\u524D\u3042\u308A ? 0.75 : 0.58);
11894
+ const \u524D\u306E\u5916\u534A\u5F84 = radius * 0.67;
11895
+ const \u524D\u306E\u5185\u534A\u5F84 = radius * 0.42;
11868
11896
  const cx = node.w / 2;
11869
11897
  const cy = PAD_TOP2 + chartAreaH / 2;
11870
- let cumAngle = -Math.PI / 2;
11871
- let cumFrac = 0;
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
- });
11898
+ 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) : [];
11899
+ const slices = \u8F2A\u3092\u7D44\u3080(data, cx, cy, radius, \u5916\u306E\u5185\u534A\u5F84, \u4ECA\u306E\u5272\u5408);
11893
11900
  const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
11894
11901
  const \u5207\u308A\u629C\u304Did = `cdl-pie-draw-${instanceId}`;
11895
11902
  const \u5F71id = `cdl-pie-shadow-${instanceId}`;
@@ -11913,19 +11920,34 @@ function ChartPieNode({
11913
11920
  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
11921
  /* @__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
11922
  ] }),
11916
- /* @__PURE__ */ jsxRuntime.jsx("g", { ...drawing ? { clipPath: `url(#${\u5207\u308A\u629C\u304Did})` } : {}, filter: `url(#${\u5F71id})`, children: slices.map((s, idx) => /* @__PURE__ */ jsxRuntime.jsx(
11917
- "path",
11918
- {
11919
- "data-cdl-role": "chart-pie-slice",
11920
- "data-cdl-unresolved": s.d.unresolved ? "true" : void 0,
11921
- d: s.path,
11922
- fill: sliceColor(s.d.tone, idx),
11923
- stroke: "var(--cdl-node-fill, #ffffff)",
11924
- strokeWidth: 3,
11925
- strokeLinejoin: "round"
11926
- },
11927
- `slice-${idx}`
11928
- )) }),
11923
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { ...drawing ? { clipPath: `url(#${\u5207\u308A\u629C\u304Did})` } : {}, filter: `url(#${\u5F71id})`, children: [
11924
+ \u524D\u306Eslices.map((s, idx) => /* @__PURE__ */ jsxRuntime.jsx(
11925
+ "path",
11926
+ {
11927
+ "data-cdl-role": "chart-pie-slice-previous",
11928
+ "data-cdl-unresolved": s.d.unresolved ? "true" : void 0,
11929
+ d: s.path,
11930
+ fill: sliceColor(s.d.tone, idx),
11931
+ stroke: "var(--cdl-node-fill, #ffffff)",
11932
+ strokeWidth: 3,
11933
+ strokeLinejoin: "round"
11934
+ },
11935
+ `slice-previous-${idx}`
11936
+ )),
11937
+ slices.map((s, idx) => /* @__PURE__ */ jsxRuntime.jsx(
11938
+ "path",
11939
+ {
11940
+ "data-cdl-role": "chart-pie-slice",
11941
+ "data-cdl-unresolved": s.d.unresolved ? "true" : void 0,
11942
+ d: s.path,
11943
+ fill: sliceColor(s.d.tone, idx),
11944
+ stroke: "var(--cdl-node-fill, #ffffff)",
11945
+ strokeWidth: 3,
11946
+ strokeLinejoin: "round"
11947
+ },
11948
+ `slice-${idx}`
11949
+ ))
11950
+ ] }),
11929
11951
  /* @__PURE__ */ jsxRuntime.jsx(
11930
11952
  "text",
11931
11953
  {
@@ -11935,7 +11957,7 @@ function ChartPieNode({
11935
11957
  fontSize: Math.round(radius * 0.26),
11936
11958
  fontWeight: 600,
11937
11959
  fill: "var(--cdl-text, #1a1f2a)",
11938
- children: \u5B9F\u5024\u8868\u8A18(Math.round(total))
11960
+ children: \u5B9F\u5024\u8868\u8A18(Math.round(\u524D\u3042\u308A ? \u4ECA\u306E\u5408\u8A08 : total))
11939
11961
  }
11940
11962
  ),
11941
11963
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -11972,12 +11994,12 @@ function ChartPieNode({
11972
11994
  "text",
11973
11995
  {
11974
11996
  x: \u5B57x,
11975
- y: \u6298\u308Cy - 3,
11997
+ y: \u6298\u308Cy - 1,
11976
11998
  textAnchor: \u53F3 ? "start" : "end",
11977
- fontSize: \u540D\u672D\u306E\u7D1A,
11999
+ fontSize: \u5272\u5408\u306E\u7D1A,
11978
12000
  fontWeight: 600,
11979
12001
  fill: "var(--cdl-text, #1a1f2a)",
11980
- children: s.d.label
12002
+ children: \u5272\u5408\u306E\u6587\u5B57[idx]
11981
12003
  }
11982
12004
  ),
11983
12005
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -11986,15 +12008,275 @@ function ChartPieNode({
11986
12008
  x: \u5B57x,
11987
12009
  y: \u6298\u308Cy + 15,
11988
12010
  textAnchor: \u53F3 ? "start" : "end",
11989
- fontSize: \u6570\u5024\u306E\u7D1A,
12011
+ fontSize: \u540D\u524D\u306E\u7D1A,
11990
12012
  fill: "var(--cdl-text-dim, #5a6270)",
11991
- children: \u6570\u5024\u306E\u6587\u5B57[idx]
12013
+ children: \u540D\u524D\u306E\u6587\u5B57[idx]
11992
12014
  }
11993
12015
  )
11994
12016
  ] }, `callout-${idx}`);
11995
12017
  })
11996
12018
  ] });
11997
12019
  }
12020
+ function \u8F2A\u3092\u7D44\u3080(data, cx, cy, \u5916\u534A\u5F84, \u5185\u534A\u5F84, \u5272\u5408) {
12021
+ let cumAngle = -Math.PI / 2;
12022
+ let cumFrac = 0;
12023
+ return data.map((d, idx) => {
12024
+ const frac = \u5272\u5408[idx] ?? 0;
12025
+ const angle = frac * Math.PI * 2;
12026
+ const a0 = cumAngle;
12027
+ const a1 = cumAngle + angle;
12028
+ cumAngle = a1;
12029
+ const startFrac = cumFrac;
12030
+ cumFrac += frac;
12031
+ const x1 = cx + \u5916\u534A\u5F84 * Math.cos(a0);
12032
+ const y1 = cy + \u5916\u534A\u5F84 * Math.sin(a0);
12033
+ const x2 = cx + \u5916\u534A\u5F84 * Math.cos(a1);
12034
+ const y2 = cy + \u5916\u534A\u5F84 * Math.sin(a1);
12035
+ const x3 = cx + \u5185\u534A\u5F84 * Math.cos(a1);
12036
+ const y3 = cy + \u5185\u534A\u5F84 * Math.sin(a1);
12037
+ const x4 = cx + \u5185\u534A\u5F84 * Math.cos(a0);
12038
+ const y4 = cy + \u5185\u534A\u5F84 * Math.sin(a0);
12039
+ const large = angle > Math.PI ? 1 : 0;
12040
+ 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`;
12041
+ return { d, frac, path, startFrac, \u4E2D\u592E\u89D2: (a0 + a1) / 2 };
12042
+ });
12043
+ }
12044
+ function \u67A0(node, active) {
12045
+ return /* @__PURE__ */ jsxRuntime.jsx(
12046
+ "rect",
12047
+ {
12048
+ "data-cdl-role": "node-body",
12049
+ x: 0,
12050
+ y: 0,
12051
+ width: node.w,
12052
+ height: node.h,
12053
+ rx: 16,
12054
+ fill: "var(--cdl-node-fill, #ffffff)",
12055
+ stroke: active ? "var(--cdl-tone-accent, #2d6a8f)" : "var(--cdl-divider, #d4d4d8)",
12056
+ strokeWidth: active ? 3 : 1.25
12057
+ }
12058
+ );
12059
+ }
12060
+ function \u5F27\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing, progress }) {
12061
+ const PAD = 20;
12062
+ const \u540D\u524D\u306E\u7D1A = 14;
12063
+ const \u5272\u5408\u306E\u7D1A = 24;
12064
+ const \u5370\u304B\u3089\u540D\u524D\u307E\u30672 = 18;
12065
+ const \u540D\u524D\u304B\u3089\u5272\u5408\u307E\u3067 = 24;
12066
+ const \u5272\u5408\u306E\u6587\u5B57 = \u5272\u5408.map(\u5272\u5408\u8868\u8A18);
12067
+ 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)));
12068
+ const \u7E26\u304B\u3089 = (node.h - PAD * 2) / 2;
12069
+ const \u6A2A\u304B\u3089 = (node.w - PAD * 2 - \u4E00\u89A7\u5E45 - 28) / 2;
12070
+ const R = Math.max(24, Math.min(\u7E26\u304B\u3089, \u6A2A\u304B\u3089));
12071
+ const cx = PAD + R;
12072
+ const cy = node.h / 2;
12073
+ const \u7A74 = R * 0.34;
12074
+ const \u523B\u307F = (R - \u7A74) / Math.max(1, data.length);
12075
+ const \u592A\u3055 = Math.max(3, \u523B\u307F * 0.6);
12076
+ const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
12077
+ const \u4E00\u89A7\u5DE6 = node.w - PAD - \u4E00\u89A7\u5E45;
12078
+ const \u884C\u306E\u9593 = Math.min(56, (node.h - PAD * 2) / Math.max(1, data.length));
12079
+ const \u4E00\u89A7\u4E0A = node.h / 2 - \u884C\u306E\u9593 * (data.length - 1) / 2;
12080
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
12081
+ \u67A0(node, active),
12082
+ data.map((d, idx) => {
12083
+ const r = R - \u592A\u3055 / 2 - idx * \u523B\u307F;
12084
+ if (r <= \u592A\u3055 / 2) return null;
12085
+ const \u53D6\u308A\u5206 = (\u5272\u5408[idx] ?? 0) * (drawing ? \u958B\u304D : 1);
12086
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
12087
+ /* @__PURE__ */ jsxRuntime.jsx(
12088
+ "circle",
12089
+ {
12090
+ "data-cdl-role": "chart-pie-arc-track",
12091
+ cx,
12092
+ cy,
12093
+ r,
12094
+ fill: "none",
12095
+ stroke: "var(--cdl-divider, #d4d4d8)",
12096
+ strokeWidth: \u592A\u3055
12097
+ }
12098
+ ),
12099
+ /* @__PURE__ */ jsxRuntime.jsx(
12100
+ "path",
12101
+ {
12102
+ "data-cdl-role": "chart-pie-arc",
12103
+ "data-cdl-unresolved": d.unresolved ? "true" : void 0,
12104
+ d: \u5F27\u306E\u9053(cx, cy, r, \u53D6\u308A\u5206),
12105
+ fill: "none",
12106
+ stroke: sliceColor(d.tone, idx),
12107
+ strokeWidth: \u592A\u3055,
12108
+ strokeLinecap: "round"
12109
+ }
12110
+ )
12111
+ ] }, `arc-${idx}`);
12112
+ }),
12113
+ data.map((d, idx) => {
12114
+ const y = \u4E00\u89A7\u4E0A + \u884C\u306E\u9593 * idx;
12115
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
12116
+ /* @__PURE__ */ jsxRuntime.jsx(
12117
+ "rect",
12118
+ {
12119
+ x: \u4E00\u89A7\u5DE6,
12120
+ y: y - 9,
12121
+ width: 10,
12122
+ height: 10,
12123
+ rx: 2,
12124
+ fill: sliceColor(d.tone, idx)
12125
+ }
12126
+ ),
12127
+ /* @__PURE__ */ jsxRuntime.jsx(
12128
+ "text",
12129
+ {
12130
+ x: \u4E00\u89A7\u5DE6 + \u5370\u304B\u3089\u540D\u524D\u307E\u30672,
12131
+ y,
12132
+ fontSize: \u540D\u524D\u306E\u7D1A,
12133
+ fill: "var(--cdl-text, #1a1f2a)",
12134
+ children: d.label
12135
+ }
12136
+ ),
12137
+ /* @__PURE__ */ jsxRuntime.jsx(
12138
+ "text",
12139
+ {
12140
+ x: node.w - PAD,
12141
+ y: y + 4,
12142
+ textAnchor: "end",
12143
+ fontSize: \u5272\u5408\u306E\u7D1A,
12144
+ fontWeight: 600,
12145
+ fill: "var(--cdl-text, #1a1f2a)",
12146
+ children: \u5272\u5408\u306E\u6587\u5B57[idx]
12147
+ }
12148
+ )
12149
+ ] }, `row-${idx}`);
12150
+ })
12151
+ ] });
12152
+ }
12153
+ function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing, progress, instanceId }) {
12154
+ const PAD = 20;
12155
+ const \u898B\u51FA\u3057\u306E\u7D1A = 11;
12156
+ const \u540D\u524D\u306E\u7D1A = 15;
12157
+ const \u5272\u5408\u306E\u7D1A = 17;
12158
+ const \u5B9F\u6570\u306E\u7D1A = 15;
12159
+ const \u5370\u304B\u3089\u540D\u524D\u307E\u30672 = 18;
12160
+ const \u5272\u5408\u306E\u6587\u5B57 = \u5272\u5408.map(\u5272\u5408\u8868\u8A18);
12161
+ const \u5B9F\u6570\u306E\u6587\u5B57 = data.map((d) => \u5B9F\u5024\u8868\u8A18(d.value));
12162
+ const \u540D\u524D\u5E45 = Math.max(0, ...data.map((d) => textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A)));
12163
+ 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)));
12164
+ 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)));
12165
+ const \u8868\u5E45 = 10 + \u5370\u304B\u3089\u540D\u524D\u307E\u30672 + \u540D\u524D\u5E45 + 28 + \u5272\u5408\u5E45 + 24 + \u5B9F\u6570\u5E45;
12166
+ const \u7E26\u304B\u3089 = (node.h - PAD * 2) / 2;
12167
+ const \u6A2A\u304B\u3089 = (node.w - PAD * 2 - \u8868\u5E45 - 28) / 2;
12168
+ const R = Math.max(24, Math.min(\u7E26\u304B\u3089, \u6A2A\u304B\u3089));
12169
+ const \u5185\u534A\u5F84 = R * 0.58;
12170
+ const cx = PAD + R;
12171
+ const cy = node.h / 2;
12172
+ const \u8868\u5DE6 = node.w - PAD - \u8868\u5E45;
12173
+ const \u53F3\u7AEF = node.w - PAD;
12174
+ const \u5272\u5408\u53F3 = \u53F3\u7AEF - \u5B9F\u6570\u5E45 - 24;
12175
+ const \u884C\u306E\u9593 = Math.min(52, (node.h - PAD * 2 - 40) / Math.max(1, data.length));
12176
+ const \u898B\u51FA\u3057\u306Ey = node.h / 2 - \u884C\u306E\u9593 * data.length / 2 - 14;
12177
+ const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
12178
+ const \u5207\u308A\u629C\u304Did = `cdl-pie-draw-${instanceId}`;
12179
+ const \u958B\u304D\u59CB\u3081\u305F = (\u59CB\u307E\u308A) => !drawing || \u958B\u304D > \u59CB\u307E\u308A;
12180
+ let \u89D2 = -Math.PI / 2;
12181
+ let \u7D2F\u8A08 = 0;
12182
+ const \u6247\u305F\u3061 = data.map((d, idx) => {
12183
+ const frac = \u5272\u5408[idx] ?? 0;
12184
+ const a0 = \u89D2;
12185
+ const a1 = \u89D2 + frac * Math.PI * 2;
12186
+ \u89D2 = a1;
12187
+ const \u59CB\u307E\u308A = \u7D2F\u8A08;
12188
+ \u7D2F\u8A08 += frac;
12189
+ return { d, idx, \u59CB\u307E\u308A, path: \u8F2A\u306E\u9053(cx, cy, R, \u5185\u534A\u5F84, a0, a1) };
12190
+ });
12191
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
12192
+ \u67A0(node, active),
12193
+ 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) }) }),
12194
+ /* @__PURE__ */ jsxRuntime.jsx("g", { ...drawing ? { clipPath: `url(#${\u5207\u308A\u629C\u304Did})` } : {}, children: \u6247\u305F\u3061.map((s) => /* @__PURE__ */ jsxRuntime.jsx(
12195
+ "path",
12196
+ {
12197
+ "data-cdl-role": "chart-pie-slice",
12198
+ "data-cdl-unresolved": s.d.unresolved ? "true" : void 0,
12199
+ d: s.path,
12200
+ fill: sliceColor(s.d.tone, s.idx),
12201
+ stroke: "var(--cdl-node-fill, #ffffff)",
12202
+ strokeWidth: 3,
12203
+ strokeLinejoin: "round"
12204
+ },
12205
+ `slice-${s.idx}`
12206
+ )) }),
12207
+ /* @__PURE__ */ jsxRuntime.jsx(
12208
+ "text",
12209
+ {
12210
+ x: cx,
12211
+ y: cy - 2,
12212
+ textAnchor: "middle",
12213
+ fontSize: Math.round(R * 0.26),
12214
+ fontWeight: 600,
12215
+ fill: "var(--cdl-text, #1a1f2a)",
12216
+ children: \u5B9F\u5024\u8868\u8A18(Math.round(data.reduce((acc, d) => acc + d.value, 0)))
12217
+ }
12218
+ ),
12219
+ /* @__PURE__ */ jsxRuntime.jsx(
12220
+ "text",
12221
+ {
12222
+ x: cx,
12223
+ y: cy + Math.round(R * 0.2),
12224
+ textAnchor: "middle",
12225
+ fontSize: Math.round(R * 0.12),
12226
+ fill: "var(--cdl-text-dim, #5a6270)",
12227
+ children: "\u5408\u8A08"
12228
+ }
12229
+ ),
12230
+ /* @__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" }),
12231
+ /* @__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" }),
12232
+ /* @__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" }),
12233
+ /* @__PURE__ */ jsxRuntime.jsx(
12234
+ "line",
12235
+ {
12236
+ "data-cdl-role": "chart-pie-table-rule",
12237
+ x1: \u8868\u5DE6,
12238
+ y1: \u898B\u51FA\u3057\u306Ey + 10,
12239
+ x2: \u53F3\u7AEF,
12240
+ y2: \u898B\u51FA\u3057\u306Ey + 10,
12241
+ stroke: "var(--cdl-text, #1a1f2a)",
12242
+ strokeWidth: 1.2
12243
+ }
12244
+ ),
12245
+ \u6247\u305F\u3061.map((s) => {
12246
+ if (!\u958B\u304D\u59CB\u3081\u305F(s.\u59CB\u307E\u308A)) return null;
12247
+ const y = \u898B\u51FA\u3057\u306Ey + 40 + \u884C\u306E\u9593 * s.idx;
12248
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
12249
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: \u8868\u5DE6, y: y - 10, width: 10, height: 10, rx: 2, fill: sliceColor(s.d.tone, s.idx) }),
12250
+ /* @__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 }),
12251
+ /* @__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] }),
12252
+ /* @__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] }),
12253
+ /* @__PURE__ */ jsxRuntime.jsx(
12254
+ "line",
12255
+ {
12256
+ "data-cdl-role": "chart-pie-table-rule",
12257
+ x1: \u8868\u5DE6,
12258
+ y1: y + 16,
12259
+ x2: \u53F3\u7AEF,
12260
+ y2: y + 16,
12261
+ stroke: "var(--cdl-divider, #d4d4d8)",
12262
+ strokeWidth: 1
12263
+ }
12264
+ )
12265
+ ] }, `row-${s.idx}`);
12266
+ })
12267
+ ] });
12268
+ }
12269
+ function \u5F27\u306E\u9053(cx, cy, r, \u53D6\u308A\u5206) {
12270
+ const \u5B9F\u52B9 = Math.max(0, Math.min(0.9999, \u53D6\u308A\u5206));
12271
+ const a0 = -Math.PI / 2;
12272
+ const a1 = a0 + \u5B9F\u52B9 * Math.PI * 2;
12273
+ const large = \u5B9F\u52B9 > 0.5 ? 1 : 0;
12274
+ 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)}`;
12275
+ }
12276
+ function \u8F2A\u306E\u9053(cx, cy, R, r, a0, a1) {
12277
+ const large = a1 - a0 > Math.PI ? 1 : 0;
12278
+ 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`;
12279
+ }
11998
12280
  function \u6247\u5F62\u306E\u5207\u308A\u629C\u304D(cx, cy, r, \u958B\u304D) {
11999
12281
  if (\u958B\u304D <= 0) return null;
12000
12282
  if (\u958B\u304D >= 1) return /* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy, r });
@@ -12196,8 +12478,8 @@ function ChartRadialNode({
12196
12478
  frac,
12197
12479
  \u4E2D\u5FC3\u534A\u5F84,
12198
12480
  // 軌道は全周。 1 周ちょうどは弧で表せないので、 わずかに欠かして描く
12199
- \u8ECC\u9053: \u5F27\u306E\u9053(\u5F27\u306Ecx, cy, \u4E2D\u5FC3\u534A\u5F84, \u5E2F\u306E\u5E45, 0.9999),
12200
- \u53D6\u308A\u5206: frac <= 0 ? null : \u5F27\u306E\u9053(\u5F27\u306Ecx, cy, \u4E2D\u5FC3\u534A\u5F84, \u5E2F\u306E\u5E45, Math.min(frac, 0.9999))
12481
+ \u8ECC\u9053: \u5F27\u306E\u90532(\u5F27\u306Ecx, cy, \u4E2D\u5FC3\u534A\u5F84, \u5E2F\u306E\u5E45, 0.9999),
12482
+ \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
12483
  };
12202
12484
  });
12203
12485
  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 +12550,7 @@ function ChartRadialNode({
12268
12550
  ] });
12269
12551
  }
12270
12552
  var \u5370\u306E\u5E45 = 18;
12271
- function \u5F27\u306E\u9053(cx, cy, \u4E2D\u5FC3\u534A\u5F84, \u5E45, \u5272\u5408) {
12553
+ function \u5F27\u306E\u90532(cx, cy, \u4E2D\u5FC3\u534A\u5F84, \u5E45, \u5272\u5408) {
12272
12554
  const \u5916 = \u4E2D\u5FC3\u534A\u5F84 + \u5E45 / 2;
12273
12555
  const \u5185 = Math.max(0.5, \u4E2D\u5FC3\u534A\u5F84 - \u5E45 / 2);
12274
12556
  const a0 = -Math.PI / 2;
@@ -12314,12 +12596,12 @@ function ChartStatNode({
12314
12596
  }
12315
12597
  ),
12316
12598
  data.map((d, idx) => {
12317
- const \u67A0 = \u533A\u753B.\u67A0(idx);
12599
+ const \u67A02 = \u533A\u753B.\u67A0(idx);
12318
12600
  const frac = total > 0 ? d.value / total : 0;
12319
12601
  const \u8272 = \u5370\u306E\u8272(d.tone, idx);
12320
12602
  const \u6570\u5024 = \u5B9F\u5024\u8868\u8A184(d.value);
12321
- 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);
12322
- return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-role": "chart-stat-item", transform: `translate(${\u67A0.x} ${\u67A0.y})`, children: [
12603
+ 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);
12604
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-role": "chart-stat-item", transform: `translate(${\u67A02.x} ${\u67A02.y})`, children: [
12323
12605
  idx > 0 && /* @__PURE__ */ jsxRuntime.jsx(
12324
12606
  "line",
12325
12607
  {
@@ -12327,7 +12609,7 @@ function ChartStatNode({
12327
12609
  x1: 0,
12328
12610
  y1: \u533A\u753B.\u4F59\u767D,
12329
12611
  x2: 0,
12330
- y2: \u67A0.h - \u533A\u753B.\u4F59\u767D,
12612
+ y2: \u67A02.h - \u533A\u753B.\u4F59\u767D,
12331
12613
  stroke: "var(--cdl-divider, #d4d4d8)",
12332
12614
  strokeWidth: 1
12333
12615
  }
@@ -12336,7 +12618,7 @@ function ChartStatNode({
12336
12618
  "text",
12337
12619
  {
12338
12620
  "data-cdl-role": "chart-stat-label",
12339
- x: \u67A0.w / 2,
12621
+ x: \u67A02.w / 2,
12340
12622
  y: \u533A\u753B.\u540D\u524D\u306Ey,
12341
12623
  fontSize: \u533A\u753B.\u540D\u524D\u306E\u7D1A,
12342
12624
  fontWeight: 700,
@@ -12350,7 +12632,7 @@ function ChartStatNode({
12350
12632
  {
12351
12633
  "data-cdl-role": "chart-stat-value",
12352
12634
  "data-cdl-unresolved": d.unresolved ? "true" : void 0,
12353
- x: \u67A0.w / 2,
12635
+ x: \u67A02.w / 2,
12354
12636
  y: \u533A\u753B.\u6570\u5024\u306Ey,
12355
12637
  fontSize: \u6570\u5024\u306E\u7D1A,
12356
12638
  fontWeight: 700,
@@ -12363,7 +12645,7 @@ function ChartStatNode({
12363
12645
  "circle",
12364
12646
  {
12365
12647
  "data-cdl-role": "chart-stat-track",
12366
- cx: \u67A0.w / 2,
12648
+ cx: \u67A02.w / 2,
12367
12649
  cy: \u533A\u753B.\u5F27\u306Ey,
12368
12650
  r: \u533A\u753B.\u5F27\u306E\u534A\u5F84,
12369
12651
  fill: "none",
@@ -12376,7 +12658,7 @@ function ChartStatNode({
12376
12658
  "path",
12377
12659
  {
12378
12660
  "data-cdl-role": "chart-stat-arc",
12379
- d: \u5F27\u306E\u90532(\u67A0.w / 2, \u533A\u753B.\u5F27\u306Ey, \u533A\u753B.\u5F27\u306E\u534A\u5F84, Math.min(frac, 0.9999)),
12661
+ d: \u5F27\u306E\u90533(\u67A02.w / 2, \u533A\u753B.\u5F27\u306Ey, \u533A\u753B.\u5F27\u306E\u534A\u5F84, Math.min(frac, 0.9999)),
12380
12662
  fill: "none",
12381
12663
  stroke: \u8272,
12382
12664
  strokeWidth: \u533A\u753B.\u5F27\u306E\u592A\u3055,
@@ -12387,7 +12669,7 @@ function ChartStatNode({
12387
12669
  "text",
12388
12670
  {
12389
12671
  "data-cdl-role": "chart-stat-share",
12390
- x: \u67A0.w / 2,
12672
+ x: \u67A02.w / 2,
12391
12673
  y: \u533A\u753B.\u5272\u5408\u306Ey,
12392
12674
  fontSize: \u533A\u753B.\u5272\u5408\u306E\u7D1A,
12393
12675
  textAnchor: "middle",
@@ -12432,7 +12714,7 @@ function \u53CE\u3081\u308B\u7D1A(\u5B57, \u4F7F\u3048\u308B\u5E452, \u521D\u671
12432
12714
  while (\u7D1A > \u4E0B\u9650 && textWidth(\u5B57, \u7D1A) > \u4F7F\u3048\u308B\u5E452) \u7D1A -= 1;
12433
12715
  return \u7D1A;
12434
12716
  }
12435
- function \u5F27\u306E\u90532(cx, cy, r, \u5272\u5408) {
12717
+ function \u5F27\u306E\u90533(cx, cy, r, \u5272\u5408) {
12436
12718
  const a0 = -Math.PI / 2;
12437
12719
  const a1 = a0 + \u5272\u5408 * Math.PI * 2;
12438
12720
  const large = \u5272\u5408 > 0.5 ? 1 : 0;
@@ -12740,6 +13022,238 @@ function \u4E00\u89A7\u306E\u4E26\u3073(data, \u5DE6, \u53F3\u7AEF, \u7D1A) {
12740
13022
  });
12741
13023
  return out;
12742
13024
  }
13025
+
13026
+ // src/kinds/chart-number.ts
13027
+ function \u5B9F\u5024\u8868\u8A187(v) {
13028
+ return Number.isInteger(v) ? v.toLocaleString("en-US") : v.toLocaleString("en-US", { maximumFractionDigits: 1 });
13029
+ }
13030
+ var \u7DDA\u306E\u6700\u5C0F\u5E45 = 120;
13031
+ function ChartSlopeNode({
13032
+ node,
13033
+ active,
13034
+ stateValues = {},
13035
+ drawing = false,
13036
+ progress = 1
13037
+ }) {
13038
+ const x0 = node.cx - node.w / 2;
13039
+ const y0 = node.cy - node.h / 2;
13040
+ const data = resolveChartData(node.chartData ?? [], stateValues);
13041
+ const PAD = 24;
13042
+ const \u6642\u70B9\u306E\u7D1A = 12;
13043
+ const \u5024\u306E\u7D1A = 14;
13044
+ const \u540D\u524D\u306E\u4E0A\u9650\u7D1A = 13;
13045
+ const \u540D\u524D\u306E\u4E0B\u9650\u7D1A = 9;
13046
+ const \u8EF8\u304B\u3089\u5024\u307E\u3067 = 10;
13047
+ const \u5024\u304B\u3089\u540D\u524D\u307E\u3067 = 8;
13048
+ const \u524D\u3042\u308A = data.some((d) => d.previous !== void 0);
13049
+ const \u7CFB\u5217\u305F\u3061 = data.map((d, i) => ({
13050
+ \u540D\u524D: d.label ?? "",
13051
+ // 前を持たない件は 0 から立ち上げる。 件を落とすと左右で系列の数が変わり、色の並びが
13052
+ // 対応しなくなる (`chart-stacked-bar` と同じ判断)
13053
+ \u524D: d.previous ?? 0,
13054
+ \u4ECA: d.value,
13055
+ \u8272: \u5370\u306E\u82724(d.tone, i),
13056
+ \u672A\u89E3\u6C7A: d.unresolved === true
13057
+ }));
13058
+ 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);
13059
+ const \u6700\u5C0F = \u5168\u90E8\u306E\u5024.length > 0 ? Math.min(...\u5168\u90E8\u306E\u5024) : 0;
13060
+ const \u6700\u5927 = \u5168\u90E8\u306E\u5024.length > 0 ? Math.max(...\u5168\u90E8\u306E\u5024) : 0;
13061
+ const \u5C3A\u306E\u5E45 = \u6700\u5927 - \u6700\u5C0F;
13062
+ const \u4E0A\u7AEF = PAD + (\u524D\u3042\u308A ? \u6642\u70B9\u306E\u7D1A + 12 : 0) + 6;
13063
+ const \u4E0B\u7AEF = Math.max(\u4E0A\u7AEF + 10, node.h - PAD - 6);
13064
+ 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;
13065
+ const \u5DE6\u306E\u5B57 = \u7CFB\u5217\u305F\u3061.map((s) => \u5B9F\u5024\u8868\u8A187(s.\u524D));
13066
+ const \u53F3\u306E\u5B57 = \u7CFB\u5217\u305F\u3061.map((s) => \u5B9F\u5024\u8868\u8A187(s.\u4ECA));
13067
+ const \u5DE6\u5024\u5E45 = Math.max(0, ...\u5DE6\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A)));
13068
+ const \u53F3\u5024\u5E45 = Math.max(0, ...\u53F3\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A)));
13069
+ const \u540D\u524D\u306B\u4F7F\u3048\u308B = Math.max(
13070
+ 0,
13071
+ (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
13072
+ );
13073
+ 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);
13074
+ const \u540D\u524D\u5E45 = Math.min(
13075
+ \u540D\u524D\u306B\u4F7F\u3048\u308B,
13076
+ Math.max(0, ...\u7CFB\u5217\u305F\u3061.map((s) => textWidth(s.\u540D\u524D, \u540D\u524D\u306E\u7D1A)))
13077
+ );
13078
+ const \u5DE6\u306E\u4F59\u767D = \u540D\u524D\u5E45 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067 + \u5DE6\u5024\u5E45 + \u8EF8\u304B\u3089\u5024\u307E\u3067;
13079
+ const \u53F3\u306E\u4F59\u767D = \u8EF8\u304B\u3089\u5024\u307E\u3067 + \u53F3\u5024\u5E45 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067 + \u540D\u524D\u5E45;
13080
+ 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));
13081
+ 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;
13082
+ const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
13083
+ const \u53F3\u3092\u51FA\u3059 = !drawing || \u4F38\u3073 >= 1;
13084
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
13085
+ /* @__PURE__ */ jsxRuntime.jsx(
13086
+ "rect",
13087
+ {
13088
+ "data-cdl-role": "node-body",
13089
+ x: 0,
13090
+ y: 0,
13091
+ width: node.w,
13092
+ height: node.h,
13093
+ rx: 16,
13094
+ fill: "var(--cdl-node-fill, #ffffff)",
13095
+ stroke: active ? "var(--cdl-tone-accent, #2d6a8f)" : "var(--cdl-divider, #d4d4d8)",
13096
+ strokeWidth: active ? 3 : 1.25
13097
+ }
13098
+ ),
13099
+ (\u524D\u3042\u308A ? [\u5DE6\u8EF8x, \u53F3\u8EF8x] : [\u5DE6\u8EF8x]).map((x, i) => /* @__PURE__ */ jsxRuntime.jsx(
13100
+ "line",
13101
+ {
13102
+ "data-cdl-role": "chart-slope-axis",
13103
+ x1: x,
13104
+ y1: \u4E0A\u7AEF - 6,
13105
+ x2: x,
13106
+ y2: \u4E0B\u7AEF + 6,
13107
+ stroke: "var(--cdl-divider, #d4d4d8)",
13108
+ strokeWidth: 1
13109
+ },
13110
+ `axis-${i}`
13111
+ )),
13112
+ \u524D\u3042\u308A && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
13113
+ /* @__PURE__ */ jsxRuntime.jsx(
13114
+ "text",
13115
+ {
13116
+ "data-cdl-role": "chart-slope-period",
13117
+ x: \u5DE6\u8EF8x,
13118
+ y: PAD + \u6642\u70B9\u306E\u7D1A,
13119
+ textAnchor: "middle",
13120
+ fontSize: \u6642\u70B9\u306E\u7D1A,
13121
+ fontWeight: 700,
13122
+ fill: "var(--cdl-text-dim, #5a6270)",
13123
+ children: "\u524D"
13124
+ }
13125
+ ),
13126
+ /* @__PURE__ */ jsxRuntime.jsx(
13127
+ "text",
13128
+ {
13129
+ "data-cdl-role": "chart-slope-period",
13130
+ x: \u53F3\u8EF8x,
13131
+ y: PAD + \u6642\u70B9\u306E\u7D1A,
13132
+ textAnchor: "middle",
13133
+ fontSize: \u6642\u70B9\u306E\u7D1A,
13134
+ fontWeight: 700,
13135
+ fill: "var(--cdl-text-dim, #5a6270)",
13136
+ children: "\u4ECA"
13137
+ }
13138
+ )
13139
+ ] }),
13140
+ \u7CFB\u5217\u305F\u3061.map((s, i) => {
13141
+ const \u5DE6y = y\u3092\u53D6\u308B(s.\u524D);
13142
+ const \u53F3y = y\u3092\u53D6\u308B(s.\u4ECA);
13143
+ const \u672A\u89E3\u6C7A = s.\u672A\u89E3\u6C7A ? "true" : void 0;
13144
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
13145
+ \u524D\u3042\u308A && /* @__PURE__ */ jsxRuntime.jsx(
13146
+ "path",
13147
+ {
13148
+ "data-cdl-role": "chart-slope-line",
13149
+ "data-cdl-unresolved": \u672A\u89E3\u6C7A,
13150
+ d: `M ${\u5DE6\u8EF8x} ${\u5DE6y} L ${\u53F3\u8EF8x} ${\u53F3y}`,
13151
+ fill: "none",
13152
+ stroke: s.\u8272,
13153
+ strokeWidth: 2.5,
13154
+ strokeLinecap: "round",
13155
+ ...\u4F38\u3070\u3059dash(drawing, \u4F38\u3073)
13156
+ }
13157
+ ),
13158
+ \u524D\u3042\u308A && /* @__PURE__ */ jsxRuntime.jsx(
13159
+ "circle",
13160
+ {
13161
+ "data-cdl-role": "chart-slope-dot",
13162
+ "data-cdl-unresolved": \u672A\u89E3\u6C7A,
13163
+ cx: \u5DE6\u8EF8x,
13164
+ cy: \u5DE6y,
13165
+ r: 4,
13166
+ fill: s.\u8272
13167
+ }
13168
+ ),
13169
+ \u53F3\u3092\u51FA\u3059 && /* @__PURE__ */ jsxRuntime.jsx(
13170
+ "circle",
13171
+ {
13172
+ "data-cdl-role": "chart-slope-dot",
13173
+ "data-cdl-unresolved": \u672A\u89E3\u6C7A,
13174
+ cx: \u53F3\u8EF8x,
13175
+ cy: \u53F3y,
13176
+ r: 4,
13177
+ fill: s.\u8272
13178
+ }
13179
+ ),
13180
+ \u524D\u3042\u308A ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
13181
+ /* @__PURE__ */ jsxRuntime.jsx(
13182
+ "text",
13183
+ {
13184
+ "data-cdl-role": "chart-slope-label",
13185
+ x: \u5DE6\u8EF8x - \u8EF8\u304B\u3089\u5024\u307E\u3067,
13186
+ y: \u5DE6y + 5,
13187
+ textAnchor: "end",
13188
+ fontSize: \u5024\u306E\u7D1A,
13189
+ fontWeight: 600,
13190
+ fill: "var(--cdl-text, #1a1f2a)",
13191
+ children: \u5DE6\u306E\u5B57[i]
13192
+ }
13193
+ ),
13194
+ /* @__PURE__ */ jsxRuntime.jsx(
13195
+ "text",
13196
+ {
13197
+ "data-cdl-role": "chart-slope-label",
13198
+ x: \u5DE6\u8EF8x - \u8EF8\u304B\u3089\u5024\u307E\u3067 - \u5DE6\u5024\u5E45 - \u5024\u304B\u3089\u540D\u524D\u307E\u3067,
13199
+ y: \u5DE6y + 5,
13200
+ textAnchor: "end",
13201
+ fontSize: \u540D\u524D\u306E\u7D1A,
13202
+ fill: "var(--cdl-text-dim, #5a6270)",
13203
+ children: s.\u540D\u524D
13204
+ }
13205
+ )
13206
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(
13207
+ "text",
13208
+ {
13209
+ "data-cdl-role": "chart-slope-label",
13210
+ x: \u5DE6\u8EF8x - \u8EF8\u304B\u3089\u5024\u307E\u3067,
13211
+ y: \u53F3y + 5,
13212
+ textAnchor: "end",
13213
+ fontSize: \u540D\u524D\u306E\u7D1A,
13214
+ fill: "var(--cdl-text-dim, #5a6270)",
13215
+ children: s.\u540D\u524D
13216
+ }
13217
+ ),
13218
+ \u53F3\u3092\u51FA\u3059 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
13219
+ /* @__PURE__ */ jsxRuntime.jsx(
13220
+ "text",
13221
+ {
13222
+ "data-cdl-role": "chart-slope-label",
13223
+ x: \u53F3\u8EF8x + \u8EF8\u304B\u3089\u5024\u307E\u3067,
13224
+ y: \u53F3y + 5,
13225
+ fontSize: \u5024\u306E\u7D1A,
13226
+ fontWeight: 600,
13227
+ fill: "var(--cdl-text, #1a1f2a)",
13228
+ children: \u53F3\u306E\u5B57[i]
13229
+ }
13230
+ ),
13231
+ \u524D\u3042\u308A && /* @__PURE__ */ jsxRuntime.jsx(
13232
+ "text",
13233
+ {
13234
+ "data-cdl-role": "chart-slope-label",
13235
+ x: \u53F3\u8EF8x + \u8EF8\u304B\u3089\u5024\u307E\u3067 + \u53F3\u5024\u5E45 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067,
13236
+ y: \u53F3y + 5,
13237
+ fontSize: \u540D\u524D\u306E\u7D1A,
13238
+ fill: "var(--cdl-text-dim, #5a6270)",
13239
+ children: s.\u540D\u524D
13240
+ }
13241
+ )
13242
+ ] })
13243
+ ] }, `slope-${i}`);
13244
+ })
13245
+ ] });
13246
+ }
13247
+ function \u5370\u306E\u82724(tone, idx) {
13248
+ if (tone) return TONE[tone];
13249
+ return chartSeriesColor(idx);
13250
+ }
13251
+ function \u53CE\u3081\u308B\u7D1A2(\u540D\u524D\u305F\u3061, \u5E45, \u4E0A\u9650, \u4E0B\u9650) {
13252
+ if (\u540D\u524D\u305F\u3061.length === 0) return \u4E0A\u9650;
13253
+ let \u7D1A = \u4E0A\u9650;
13254
+ while (\u7D1A > \u4E0B\u9650 && Math.max(...\u540D\u524D\u305F\u3061.map((n) => textWidth(n, \u7D1A))) > \u5E45) \u7D1A -= 1;
13255
+ return \u7D1A;
13256
+ }
12743
13257
  function ChartBarNode({
12744
13258
  node,
12745
13259
  active,
@@ -17419,6 +17933,17 @@ function CdlNodeView({
17419
17933
  return /* @__PURE__ */ jsxRuntime.jsx(ChartGaugeNode, { node: resolvedNode, active, stateValues });
17420
17934
  case "chart-stacked-bar":
17421
17935
  return /* @__PURE__ */ jsxRuntime.jsx(ChartStackedBarNode, { node: resolvedNode, active, stateValues });
17936
+ case "chart-slope":
17937
+ return /* @__PURE__ */ jsxRuntime.jsx(
17938
+ ChartSlopeNode,
17939
+ {
17940
+ node: resolvedNode,
17941
+ active,
17942
+ stateValues,
17943
+ drawing,
17944
+ progress
17945
+ }
17946
+ );
17422
17947
  case "chart-waffle":
17423
17948
  return /* @__PURE__ */ jsxRuntime.jsx(ChartWaffleNode, { node: resolvedNode, active, stateValues });
17424
17949
  case "chart-stat":