@cardenelabs/cdl 0.10.0 → 0.12.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 +65 -1
- package/SPEC.md +25 -3
- package/dist/index.cjs +387 -169
- 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 +388 -170
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +387 -169
- 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 +388 -170
- package/dist/react.js.map +1 -1
- package/dist/{render-CH1Qn3Jv.d.cts → render-C7FKvMqq.d.cts} +14 -2
- package/dist/{render-CH1Qn3Jv.d.ts → render-C7FKvMqq.d.ts} +14 -2
- package/package.json +1 -1
- package/src/kinds/chart-bar.tsx +45 -12
- package/src/kinds/chart-line.tsx +4 -10
- package/src/kinds/chart-pie.tsx +76 -15
- package/src/kinds/draw-progress.ts +100 -0
- package/src/kinds/funnel.tsx +101 -58
- package/src/kinds/gantt.tsx +25 -1
- package/src/kinds/mind-map.tsx +65 -14
- package/src/kinds/tree.tsx +52 -4
- package/src/kinds/user-journey.tsx +29 -1
- package/src/render/nodes.tsx +63 -7
- package/src/types.ts +14 -2
- package/src/validate.ts +32 -2
package/dist/react.cjs
CHANGED
|
@@ -4886,6 +4886,16 @@ function nodeTemplateTexts(node) {
|
|
|
4886
4886
|
|
|
4887
4887
|
// src/validate.ts
|
|
4888
4888
|
var TONES2 = new Set(TONES);
|
|
4889
|
+
var DRAW_KINDS = /* @__PURE__ */ new Set([
|
|
4890
|
+
"chart-line",
|
|
4891
|
+
"chart-bar",
|
|
4892
|
+
"chart-pie",
|
|
4893
|
+
"journey-map",
|
|
4894
|
+
"mind-map",
|
|
4895
|
+
"tree-hierarchy",
|
|
4896
|
+
"gantt-timeline",
|
|
4897
|
+
"funnel-stages"
|
|
4898
|
+
]);
|
|
4889
4899
|
var KINDS = new Set(NODE_KINDS);
|
|
4890
4900
|
var ENG_BANNED = /\b(FUNCTION|STORAGE|EVENT LOG|BALANCES MAPPING|READ|WRITE|EMIT|CALL)\b/;
|
|
4891
4901
|
function validate(diag) {
|
|
@@ -5003,8 +5013,10 @@ function validate(diag) {
|
|
|
5003
5013
|
continue;
|
|
5004
5014
|
}
|
|
5005
5015
|
const kind = diag.nodes.find((n) => n.id === id)?.kind;
|
|
5006
|
-
if (kind
|
|
5007
|
-
warnings.push(
|
|
5016
|
+
if (!DRAW_KINDS.has(String(kind))) {
|
|
5017
|
+
warnings.push(
|
|
5018
|
+
`phase "${p.id}" \u306E draw "${id}" \u306F kind "${kind}" \u3067\u3001 \u8D77\u70B9\u304B\u3089\u63CF\u304F\u52D5\u304D\u3092\u6301\u305F\u306A\u3044 (\u5BFE\u8C61\u306F ${[...DRAW_KINDS].join(" / ")})`
|
|
5019
|
+
);
|
|
5008
5020
|
}
|
|
5009
5021
|
}
|
|
5010
5022
|
for (const t of p.tweens) {
|
|
@@ -6581,6 +6593,44 @@ function resolveMindData(data, values) {
|
|
|
6581
6593
|
const \u89E3\u6C7A\u5F8C = { ...data, rootTitle: root.value, branches };
|
|
6582
6594
|
return root.ok ? \u89E3\u6C7A\u5F8C : { ...\u89E3\u6C7A\u5F8C, unresolved: true };
|
|
6583
6595
|
}
|
|
6596
|
+
|
|
6597
|
+
// src/kinds/draw-progress.ts
|
|
6598
|
+
function \u9032\u307F\u3092\u7573\u3080(drawing, progress) {
|
|
6599
|
+
if (!drawing) return 1;
|
|
6600
|
+
return Math.min(1, Math.max(0, Number.isFinite(progress) ? progress : 1));
|
|
6601
|
+
}
|
|
6602
|
+
function \u4F38\u3070\u3059dash(drawing, \u4F38\u3073) {
|
|
6603
|
+
if (!drawing) return {};
|
|
6604
|
+
return { pathLength: 1, strokeDasharray: 1, strokeDashoffset: 1 - \u4F38\u3073 };
|
|
6605
|
+
}
|
|
6606
|
+
function \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, \u6DF1\u3055, \u6700\u5927\u6DF1\u3055) {
|
|
6607
|
+
if (\u6700\u5927\u6DF1\u3055 <= 0 || \u6DF1\u3055 <= 0) return 1;
|
|
6608
|
+
const \u5E45 = 1 / \u6700\u5927\u6DF1\u3055;
|
|
6609
|
+
const \u59CB\u307E\u308A = (\u6DF1\u3055 - 1) * \u5E45;
|
|
6610
|
+
return Math.min(1, Math.max(0, (\u4F38\u3073 - \u59CB\u307E\u308A) / \u5E45));
|
|
6611
|
+
}
|
|
6612
|
+
function \u30D9\u30B8\u30A8\u306E\u7D2F\u7A4D\u5272\u5408(\u70B9, \u5236\u5FA1\u70B9, \u5206\u5272\u6570 = 16) {
|
|
6613
|
+
if (\u70B9.length <= 1) return \u70B9.map(() => 0);
|
|
6614
|
+
const \u9577\u3055 = [0];
|
|
6615
|
+
let \u5408\u8A08 = 0;
|
|
6616
|
+
for (let i = 1; i < \u70B9.length; i++) {
|
|
6617
|
+
const p0 = \u70B9[i - 1];
|
|
6618
|
+
const p3 = \u70B9[i];
|
|
6619
|
+
const [p1, p2] = \u5236\u5FA1\u70B9(p0, p3);
|
|
6620
|
+
let \u524D = p0;
|
|
6621
|
+
for (let s = 1; s <= \u5206\u5272\u6570; s++) {
|
|
6622
|
+
const t = s / \u5206\u5272\u6570;
|
|
6623
|
+
const u = 1 - t;
|
|
6624
|
+
const x = u * u * u * p0.x + 3 * u * u * t * p1.x + 3 * u * t * t * p2.x + t * t * t * p3.x;
|
|
6625
|
+
const y = u * u * u * p0.y + 3 * u * u * t * p1.y + 3 * u * t * t * p2.y + t * t * t * p3.y;
|
|
6626
|
+
\u5408\u8A08 += Math.hypot(x - \u524D.x, y - \u524D.y);
|
|
6627
|
+
\u524D = { x, y };
|
|
6628
|
+
}
|
|
6629
|
+
\u9577\u3055.push(\u5408\u8A08);
|
|
6630
|
+
}
|
|
6631
|
+
if (\u5408\u8A08 === 0) return \u70B9.map(() => 0);
|
|
6632
|
+
return \u9577\u3055.map((l) => l / \u5408\u8A08);
|
|
6633
|
+
}
|
|
6584
6634
|
function ChartLineNode({
|
|
6585
6635
|
node,
|
|
6586
6636
|
active,
|
|
@@ -6618,7 +6668,7 @@ function ChartLineNode({
|
|
|
6618
6668
|
\u70B9\u307E\u3067\u306E\u9577\u3055.push(\u7DDA\u306E\u5168\u9577);
|
|
6619
6669
|
\u524D\u306E\u70B9 = \u4ECA\u306E\u70B9;
|
|
6620
6670
|
}
|
|
6621
|
-
const \u4F38\u3073 = drawing
|
|
6671
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
6622
6672
|
const \u7DDA\u306E\u5148\u304C\u5C4A\u3044\u305F = (idx) => {
|
|
6623
6673
|
if (!drawing) return true;
|
|
6624
6674
|
if (data.length <= 1) return true;
|
|
@@ -6703,7 +6753,7 @@ function ChartLineNode({
|
|
|
6703
6753
|
strokeWidth: 2.5,
|
|
6704
6754
|
strokeLinejoin: "round",
|
|
6705
6755
|
strokeLinecap: "round",
|
|
6706
|
-
|
|
6756
|
+
...\u4F38\u3070\u3059dash(drawing, \u4F38\u3073)
|
|
6707
6757
|
}
|
|
6708
6758
|
),
|
|
6709
6759
|
data.map((d, idx) => {
|
|
@@ -6769,8 +6819,11 @@ function ChartLineNode({
|
|
|
6769
6819
|
function ChartPieNode({
|
|
6770
6820
|
node,
|
|
6771
6821
|
active,
|
|
6772
|
-
stateValues = {}
|
|
6822
|
+
stateValues = {},
|
|
6823
|
+
drawing = false,
|
|
6824
|
+
progress = 1
|
|
6773
6825
|
}) {
|
|
6826
|
+
const instanceId = react.useId().replace(/[^A-Za-z0-9_-]/g, "");
|
|
6774
6827
|
const x0 = node.cx - node.w / 2;
|
|
6775
6828
|
const y0 = node.cy - node.h / 2;
|
|
6776
6829
|
const data = resolveChartData(node.chartData ?? [], stateValues);
|
|
@@ -6783,20 +6836,26 @@ function ChartPieNode({
|
|
|
6783
6836
|
const cx = pieAreaW / 2;
|
|
6784
6837
|
const cy = PAD_TOP + chartAreaH / 2;
|
|
6785
6838
|
let cumAngle = -Math.PI / 2;
|
|
6839
|
+
let cumFrac = 0;
|
|
6786
6840
|
const slices = data.map((d) => {
|
|
6787
6841
|
const frac = d.value / total;
|
|
6788
6842
|
const angle = frac * Math.PI * 2;
|
|
6789
6843
|
const a0 = cumAngle;
|
|
6790
6844
|
const a1 = cumAngle + angle;
|
|
6791
6845
|
cumAngle = a1;
|
|
6846
|
+
const startFrac = cumFrac;
|
|
6847
|
+
cumFrac += frac;
|
|
6792
6848
|
const x1 = cx + radius * Math.cos(a0);
|
|
6793
6849
|
const y1 = cy + radius * Math.sin(a0);
|
|
6794
6850
|
const x2 = cx + radius * Math.cos(a1);
|
|
6795
6851
|
const y2 = cy + radius * Math.sin(a1);
|
|
6796
6852
|
const large = angle > Math.PI ? 1 : 0;
|
|
6797
6853
|
const path = `M ${cx} ${cy} L ${x1} ${y1} A ${radius} ${radius} 0 ${large} 1 ${x2} ${y2} Z`;
|
|
6798
|
-
return { d, frac, path };
|
|
6854
|
+
return { d, frac, path, startFrac };
|
|
6799
6855
|
});
|
|
6856
|
+
const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
6857
|
+
const \u5207\u308A\u629C\u304Did = `cdl-pie-draw-${instanceId}`;
|
|
6858
|
+
const \u958B\u304D\u59CB\u3081\u305F = (startFrac) => !drawing || \u958B\u304D > startFrac;
|
|
6800
6859
|
const legendX = pieAreaW + 8;
|
|
6801
6860
|
const legendGap = Math.min(28, chartAreaH / Math.max(data.length, 1));
|
|
6802
6861
|
const legendStartY = PAD_TOP + (chartAreaH - legendGap * data.length) / 2 + legendGap / 2;
|
|
@@ -6815,7 +6874,8 @@ function ChartPieNode({
|
|
|
6815
6874
|
strokeWidth: active ? 3 : 1.25
|
|
6816
6875
|
}
|
|
6817
6876
|
),
|
|
6818
|
-
|
|
6877
|
+
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, radius + 2, \u958B\u304D) }) }),
|
|
6878
|
+
/* @__PURE__ */ jsxRuntime.jsx("g", { ...drawing ? { clipPath: `url(#${\u5207\u308A\u629C\u304Did})` } : {}, children: slices.map((s, idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6819
6879
|
"path",
|
|
6820
6880
|
{
|
|
6821
6881
|
"data-cdl-role": "chart-pie-slice",
|
|
@@ -6827,8 +6887,8 @@ function ChartPieNode({
|
|
|
6827
6887
|
strokeWidth: 1.5
|
|
6828
6888
|
},
|
|
6829
6889
|
`slice-${idx}`
|
|
6830
|
-
)),
|
|
6831
|
-
slices.map((s, idx) => /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${legendX} ${legendStartY + idx * legendGap})`, children: [
|
|
6890
|
+
)) }),
|
|
6891
|
+
slices.map((s, idx) => !\u958B\u304D\u59CB\u3081\u305F(s.startFrac) ? null : /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${legendX} ${legendStartY + idx * legendGap})`, children: [
|
|
6832
6892
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6833
6893
|
"rect",
|
|
6834
6894
|
{
|
|
@@ -6866,6 +6926,15 @@ function ChartPieNode({
|
|
|
6866
6926
|
] }, `legend-${idx}`))
|
|
6867
6927
|
] });
|
|
6868
6928
|
}
|
|
6929
|
+
function \u6247\u5F62\u306E\u5207\u308A\u629C\u304D(cx, cy, r, \u958B\u304D) {
|
|
6930
|
+
if (\u958B\u304D <= 0) return null;
|
|
6931
|
+
if (\u958B\u304D >= 1) return /* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy, r });
|
|
6932
|
+
const a0 = -Math.PI / 2;
|
|
6933
|
+
const a1 = a0 + \u958B\u304D * Math.PI * 2;
|
|
6934
|
+
const large = \u958B\u304D > 0.5 ? 1 : 0;
|
|
6935
|
+
const d = `M ${cx} ${cy} L ${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)} Z`;
|
|
6936
|
+
return /* @__PURE__ */ jsxRuntime.jsx("path", { d });
|
|
6937
|
+
}
|
|
6869
6938
|
var FALLBACK_ORDER = ["accent", "teal", "warning", "success", "info", "error"];
|
|
6870
6939
|
function sliceColor(tone, idx) {
|
|
6871
6940
|
if (tone) return TONE[tone];
|
|
@@ -6874,7 +6943,9 @@ function sliceColor(tone, idx) {
|
|
|
6874
6943
|
function ChartBarNode({
|
|
6875
6944
|
node,
|
|
6876
6945
|
active,
|
|
6877
|
-
stateValues = {}
|
|
6946
|
+
stateValues = {},
|
|
6947
|
+
drawing = false,
|
|
6948
|
+
progress = 1
|
|
6878
6949
|
}) {
|
|
6879
6950
|
const x0 = node.cx - node.w / 2;
|
|
6880
6951
|
const y0 = node.cy - node.h / 2;
|
|
@@ -6897,6 +6968,8 @@ function ChartBarNode({
|
|
|
6897
6968
|
const v = vMax * i / gridCount;
|
|
6898
6969
|
return { y: yAt(v), value: v };
|
|
6899
6970
|
});
|
|
6971
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
6972
|
+
const \u6A2A\u8EF8\u306Ey = PAD_TOP + canvasH;
|
|
6900
6973
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
6901
6974
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6902
6975
|
"rect",
|
|
@@ -6953,26 +7026,28 @@ function ChartBarNode({
|
|
|
6953
7026
|
const bx = xAt(idx);
|
|
6954
7027
|
const by = yAt(d.value);
|
|
6955
7028
|
const bh = PAD_TOP + canvasH - by;
|
|
7029
|
+
const \u898B\u3048\u3066\u3044\u308B\u982D = \u6A2A\u8EF8\u306Ey - (\u6A2A\u8EF8\u306Ey - by) * \u4F38\u3073;
|
|
7030
|
+
const \u68D2 = /* @__PURE__ */ jsxRuntime.jsx(
|
|
7031
|
+
"rect",
|
|
7032
|
+
{
|
|
7033
|
+
"data-cdl-role": "chart-bar",
|
|
7034
|
+
"data-cdl-unresolved": d.unresolved ? "true" : void 0,
|
|
7035
|
+
x: bx,
|
|
7036
|
+
y: by,
|
|
7037
|
+
width: barW,
|
|
7038
|
+
height: bh,
|
|
7039
|
+
rx: 2,
|
|
7040
|
+
fill: "var(--cdl-tone-accent, #2d6a8f)",
|
|
7041
|
+
fillOpacity: 0.9
|
|
7042
|
+
}
|
|
7043
|
+
);
|
|
6956
7044
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
6957
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6958
|
-
"rect",
|
|
6959
|
-
{
|
|
6960
|
-
"data-cdl-role": "chart-bar",
|
|
6961
|
-
"data-cdl-unresolved": d.unresolved ? "true" : void 0,
|
|
6962
|
-
x: bx,
|
|
6963
|
-
y: by,
|
|
6964
|
-
width: barW,
|
|
6965
|
-
height: bh,
|
|
6966
|
-
rx: 2,
|
|
6967
|
-
fill: "var(--cdl-tone-accent, #2d6a8f)",
|
|
6968
|
-
fillOpacity: 0.9
|
|
6969
|
-
}
|
|
6970
|
-
),
|
|
7045
|
+
drawing ? /* @__PURE__ */ jsxRuntime.jsx("g", { transform: `translate(0 ${\u6A2A\u8EF8\u306Ey}) scale(1 ${\u4F38\u3073}) translate(0 ${-\u6A2A\u8EF8\u306Ey})`, children: \u68D2 }) : \u68D2,
|
|
6971
7046
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6972
7047
|
"text",
|
|
6973
7048
|
{
|
|
6974
7049
|
x: bx + barW / 2,
|
|
6975
|
-
y:
|
|
7050
|
+
y: \u898B\u3048\u3066\u3044\u308B\u982D - 6,
|
|
6976
7051
|
fontSize: 11,
|
|
6977
7052
|
textAnchor: "middle",
|
|
6978
7053
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
@@ -6997,7 +7072,9 @@ function ChartBarNode({
|
|
|
6997
7072
|
function GanttNode({
|
|
6998
7073
|
node,
|
|
6999
7074
|
active,
|
|
7000
|
-
stateValues = {}
|
|
7075
|
+
stateValues = {},
|
|
7076
|
+
drawing = false,
|
|
7077
|
+
progress = 1
|
|
7001
7078
|
}) {
|
|
7002
7079
|
const x0 = node.cx - node.w / 2;
|
|
7003
7080
|
const y0 = node.cy - node.h / 2;
|
|
@@ -7056,6 +7133,7 @@ function GanttNode({
|
|
|
7056
7133
|
const \u5E2F\u306E\u4F59\u767D = Math.min(6, cellW / 2);
|
|
7057
7134
|
const \u5E2F\u306E\u5DE6 = (idx) => xAt(idx) + \u5E2F\u306E\u4F59\u767D / 2;
|
|
7058
7135
|
const \u5E2F\u306E\u53F3 = (idx) => xAt(idx) + cellW - \u5E2F\u306E\u4F59\u767D / 2;
|
|
7136
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
7059
7137
|
const taskById = new Map(\u6574\u3048\u305F.map((t) => [t.id, t]));
|
|
7060
7138
|
const rowOf = new Map(\u6574\u3048\u305F.map((t, i) => [t.id, i]));
|
|
7061
7139
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
@@ -7130,34 +7208,41 @@ function GanttNode({
|
|
|
7130
7208
|
const bx = \u5E2F\u306E\u5DE6(t.startIdx);
|
|
7131
7209
|
const by = yAt(row);
|
|
7132
7210
|
const bw = Math.max(0, \u5E2F\u306E\u53F3(t.endIdx) - bx);
|
|
7133
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
{
|
|
7137
|
-
|
|
7138
|
-
|
|
7139
|
-
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
|
|
7147
|
-
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
|
|
7153
|
-
|
|
7154
|
-
|
|
7155
|
-
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7211
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7212
|
+
"g",
|
|
7213
|
+
{
|
|
7214
|
+
...drawing ? { transform: `translate(${bx} 0) scale(${\u4F38\u3073} 1) translate(${-bx} 0)` } : {},
|
|
7215
|
+
children: [
|
|
7216
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7217
|
+
"rect",
|
|
7218
|
+
{
|
|
7219
|
+
"data-cdl-role": "gantt-bar",
|
|
7220
|
+
"data-cdl-unresolved": t.unresolved ? "true" : void 0,
|
|
7221
|
+
"data-cdl-clipped": "clipped" in t && t.clipped ? "true" : void 0,
|
|
7222
|
+
x: bx,
|
|
7223
|
+
y: by,
|
|
7224
|
+
width: bw,
|
|
7225
|
+
height: rowH,
|
|
7226
|
+
rx: 4,
|
|
7227
|
+
fill: toneColor3(t.tone),
|
|
7228
|
+
fillOpacity: 0.9
|
|
7229
|
+
}
|
|
7230
|
+
),
|
|
7231
|
+
t.owner && rowH >= 22 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7232
|
+
"text",
|
|
7233
|
+
{
|
|
7234
|
+
x: bx + 8,
|
|
7235
|
+
y: by + rowH / 2 + 4,
|
|
7236
|
+
fontSize: 11,
|
|
7237
|
+
fill: "var(--cdl-node-fill, #ffffff)",
|
|
7238
|
+
fontWeight: 600,
|
|
7239
|
+
children: t.owner
|
|
7240
|
+
}
|
|
7241
|
+
)
|
|
7242
|
+
]
|
|
7243
|
+
},
|
|
7244
|
+
`bar-${t.id}`
|
|
7245
|
+
);
|
|
7161
7246
|
}),
|
|
7162
7247
|
\u6574\u3048\u305F.filter((t) => t.dependsOn && taskById.has(t.dependsOn)).map((t) => {
|
|
7163
7248
|
const parent = taskById.get(t.dependsOn);
|
|
@@ -7177,29 +7262,33 @@ function GanttNode({
|
|
|
7177
7262
|
const hasRoom = enterX - startX >= elbowGap;
|
|
7178
7263
|
const path = hasRoom ? `M ${startX} ${parentMidY} L ${enterX} ${parentMidY} L ${enterX} ${tipY} L ${tipX} ${tipY}` : `M ${startX} ${parentMidY} L ${startX + elbowGap} ${parentMidY} L ${startX + elbowGap} ${(parentMidY + tipY) / 2} L ${enterX} ${(parentMidY + tipY) / 2} L ${enterX} ${tipY} L ${tipX} ${tipY}`;
|
|
7179
7264
|
const arrowHeadPath = `M ${tipX + arrowHeadSize} ${tipY} L ${tipX} ${tipY - arrowHeadSize / 2} L ${tipX} ${tipY + arrowHeadSize / 2} Z`;
|
|
7180
|
-
return
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7265
|
+
return (
|
|
7266
|
+
// 矢印は両端の帯が出てから描く。 帯が無い場所へ矢印だけが伸びると、
|
|
7267
|
+
// 指す先の無い線になる (cdl#521)
|
|
7268
|
+
drawing && \u4F38\u3073 < 1 ? null : /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-role": "gantt-arrow", children: [
|
|
7269
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7270
|
+
"path",
|
|
7271
|
+
{
|
|
7272
|
+
d: path,
|
|
7273
|
+
fill: "none",
|
|
7274
|
+
stroke: "var(--cdl-text-mute, #8a8678)",
|
|
7275
|
+
strokeWidth: 1.75,
|
|
7276
|
+
strokeLinejoin: "round",
|
|
7277
|
+
strokeLinecap: "round"
|
|
7278
|
+
}
|
|
7279
|
+
),
|
|
7280
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7281
|
+
"path",
|
|
7282
|
+
{
|
|
7283
|
+
d: arrowHeadPath,
|
|
7284
|
+
fill: "var(--cdl-text-mute, #8a8678)",
|
|
7285
|
+
stroke: "var(--cdl-text-mute, #8a8678)",
|
|
7286
|
+
strokeWidth: 0.5,
|
|
7287
|
+
strokeLinejoin: "round"
|
|
7288
|
+
}
|
|
7289
|
+
)
|
|
7290
|
+
] }, `dep-${parent.id}-${t.id}`)
|
|
7291
|
+
);
|
|
7203
7292
|
})
|
|
7204
7293
|
] });
|
|
7205
7294
|
}
|
|
@@ -7255,7 +7344,9 @@ var MIND_BOX_GAP = 24;
|
|
|
7255
7344
|
function MindMapNode({
|
|
7256
7345
|
node,
|
|
7257
7346
|
active,
|
|
7258
|
-
stateValues = {}
|
|
7347
|
+
stateValues = {},
|
|
7348
|
+
drawing = false,
|
|
7349
|
+
progress = 1
|
|
7259
7350
|
}) {
|
|
7260
7351
|
const x0 = node.cx - node.w / 2;
|
|
7261
7352
|
const y0 = node.cy - node.h / 2;
|
|
@@ -7267,6 +7358,9 @@ function MindMapNode({
|
|
|
7267
7358
|
const canvasW = node.w - PAD * 2;
|
|
7268
7359
|
const canvasH = node.h - PAD * 2;
|
|
7269
7360
|
const layout2 = computeMindMapLayout(mindData, canvasCx, canvasCy, canvasW, canvasH);
|
|
7361
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
7362
|
+
const \u6700\u5927\u6DF1\u3055 = layout2.nodes.reduce((m, n) => Math.max(m, n.depth), 0);
|
|
7363
|
+
const \u7BB1\u304C\u51FA\u308B = (\u6DF1\u3055) => !drawing || \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, \u6DF1\u3055, \u6700\u5927\u6DF1\u3055) >= 1;
|
|
7270
7364
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
7271
7365
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7272
7366
|
"rect",
|
|
@@ -7282,20 +7376,25 @@ function MindMapNode({
|
|
|
7282
7376
|
strokeWidth: active ? 3 : 1.25
|
|
7283
7377
|
}
|
|
7284
7378
|
),
|
|
7285
|
-
layout2.edges.map((e, i) =>
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
"
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
|
|
7379
|
+
layout2.edges.map((e, i) => {
|
|
7380
|
+
const \u679D\u306E\u4F38\u3073 = e.deferUntilComplete ? \u4F38\u3073 >= 1 ? 1 : 0 : \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, e.depth, \u6700\u5927\u6DF1\u3055);
|
|
7381
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7382
|
+
"path",
|
|
7383
|
+
{
|
|
7384
|
+
"data-cdl-role": "mind-edge",
|
|
7385
|
+
d: e.d,
|
|
7386
|
+
fill: "none",
|
|
7387
|
+
stroke: toneColor4(e.tone),
|
|
7388
|
+
strokeWidth: 2.5,
|
|
7389
|
+
strokeOpacity: 0.55,
|
|
7390
|
+
strokeLinecap: "round",
|
|
7391
|
+
...\u4F38\u3070\u3059dash(drawing, \u679D\u306E\u4F38\u3073)
|
|
7392
|
+
},
|
|
7393
|
+
`edge-${i}`
|
|
7394
|
+
);
|
|
7395
|
+
}),
|
|
7298
7396
|
layout2.nodes.map((n) => {
|
|
7397
|
+
if (!\u7BB1\u304C\u51FA\u308B(n.depth)) return null;
|
|
7299
7398
|
const \u884C = \u7BB1\u306B\u7A4D\u3080(
|
|
7300
7399
|
[
|
|
7301
7400
|
{ \u5F79\u5272: "title", text: n.title, fontSize: n.isRoot ? 15 : 13 },
|
|
@@ -7363,6 +7462,8 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
|
|
|
7363
7462
|
w: rootW,
|
|
7364
7463
|
h: rootH,
|
|
7365
7464
|
isRoot: true,
|
|
7465
|
+
// 中心は起点なので段数 0 (cdl#520)
|
|
7466
|
+
depth: 0,
|
|
7366
7467
|
...mindData.unresolved ? { unresolved: true } : {}
|
|
7367
7468
|
});
|
|
7368
7469
|
const childrenOf = /* @__PURE__ */ new Map();
|
|
@@ -7474,6 +7575,8 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
|
|
|
7474
7575
|
y,
|
|
7475
7576
|
w,
|
|
7476
7577
|
h,
|
|
7578
|
+
// 第 1 階層が段数 1 (`subDepth` は 0 始まり、 cdl#520)
|
|
7579
|
+
depth: subDepth + 1,
|
|
7477
7580
|
tone: myTone,
|
|
7478
7581
|
isRoot: false,
|
|
7479
7582
|
...node.unresolved ? { unresolved: true } : {}
|
|
@@ -7515,23 +7618,36 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
|
|
|
7515
7618
|
}
|
|
7516
7619
|
}
|
|
7517
7620
|
}
|
|
7621
|
+
const \u6BB5\u6570 = new Map(nodes.map((n) => [n.id, n.depth]));
|
|
7518
7622
|
for (const br of mindData.branches) {
|
|
7519
7623
|
const childPos = nodePos.get(br.id);
|
|
7520
7624
|
if (!childPos) continue;
|
|
7521
7625
|
const isLeft = nodeSide.get(br.id) === "left";
|
|
7522
7626
|
const childHalfW = nodeHalfW.get(br.id) ?? subBranchW / 2;
|
|
7523
7627
|
const tone = nodeTone.get(br.id);
|
|
7628
|
+
const childDepth = \u6BB5\u6570.get(br.id) ?? 1;
|
|
7629
|
+
const parentDepth = \u6BB5\u6570.get(br.parent) ?? 0;
|
|
7524
7630
|
if (br.parent === mindData.rootId) {
|
|
7525
7631
|
const startX = rootEdgeXFor(isLeft);
|
|
7526
7632
|
const endX = childPos.x + (isLeft ? childHalfW : -childHalfW);
|
|
7527
|
-
edges.push({
|
|
7633
|
+
edges.push({
|
|
7634
|
+
d: makeCurve(startX, cy, endX, childPos.y),
|
|
7635
|
+
tone,
|
|
7636
|
+
depth: childDepth,
|
|
7637
|
+
deferUntilComplete: false
|
|
7638
|
+
});
|
|
7528
7639
|
} else {
|
|
7529
7640
|
const parentPos = nodePos.get(br.parent);
|
|
7530
7641
|
if (!parentPos) continue;
|
|
7531
7642
|
const parentHalfW = nodeHalfW.get(br.parent) ?? branchW / 2;
|
|
7532
7643
|
const startX = parentPos.x + (isLeft ? -parentHalfW : parentHalfW);
|
|
7533
7644
|
const endX = childPos.x + (isLeft ? childHalfW : -childHalfW);
|
|
7534
|
-
edges.push({
|
|
7645
|
+
edges.push({
|
|
7646
|
+
d: makeCurve(startX, parentPos.y, endX, childPos.y),
|
|
7647
|
+
tone,
|
|
7648
|
+
depth: Math.max(parentDepth, childDepth),
|
|
7649
|
+
deferUntilComplete: parentDepth >= childDepth
|
|
7650
|
+
});
|
|
7535
7651
|
}
|
|
7536
7652
|
}
|
|
7537
7653
|
return { nodes, edges };
|
|
@@ -7551,7 +7667,9 @@ function toneColor4(tone, alpha = 1) {
|
|
|
7551
7667
|
function FunnelNode({
|
|
7552
7668
|
node,
|
|
7553
7669
|
active,
|
|
7554
|
-
stateValues = {}
|
|
7670
|
+
stateValues = {},
|
|
7671
|
+
drawing = false,
|
|
7672
|
+
progress = 1
|
|
7555
7673
|
}) {
|
|
7556
7674
|
const x0 = node.cx - node.w / 2;
|
|
7557
7675
|
const y0 = node.cy - node.h / 2;
|
|
@@ -7566,12 +7684,79 @@ function FunnelNode({
|
|
|
7566
7684
|
const stageCount = stages.length || 1;
|
|
7567
7685
|
const gap = 4;
|
|
7568
7686
|
const stageH = (canvasH - gap * (stageCount - 1)) / stageCount;
|
|
7687
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
7688
|
+
const \u5207\u308A\u629C\u304Did = `cdl-funnel-draw-${react.useId().replace(/[^A-Za-z0-9_-]/g, "")}`;
|
|
7689
|
+
const \u6BB5\u306E\u4E0B\u7AEF\u306E\u5272\u5408 = (idx) => {
|
|
7690
|
+
if (canvasH <= 0) return 0;
|
|
7691
|
+
return ((idx + 1) * stageH + idx * gap) / canvasH;
|
|
7692
|
+
};
|
|
7693
|
+
const \u6BB5\u304C\u51FA\u5207\u3063\u305F = (idx) => !drawing || \u4F38\u3073 >= \u6BB5\u306E\u4E0B\u7AEF\u306E\u5272\u5408(idx);
|
|
7569
7694
|
const widthAtStep = (step) => {
|
|
7570
7695
|
const topRatio = 1;
|
|
7571
7696
|
const bottomRatio = 0.35;
|
|
7572
7697
|
const t = step / stageCount;
|
|
7573
7698
|
return canvasW * (topRatio + (bottomRatio - topRatio) * t);
|
|
7574
7699
|
};
|
|
7700
|
+
const \u6BB5 = stages.map((s, idx) => {
|
|
7701
|
+
const prev = idx > 0 ? stages[idx - 1] : null;
|
|
7702
|
+
const dropRate = prev && prev.count > 0 ? (prev.count - s.count) / prev.count * 100 : 0;
|
|
7703
|
+
const y = PAD_TOP + idx * (stageH + gap);
|
|
7704
|
+
const topW = widthAtStep(idx);
|
|
7705
|
+
const bottomW = widthAtStep(idx + 1);
|
|
7706
|
+
const cx = PAD_LEFT + canvasW / 2;
|
|
7707
|
+
const topX = cx - topW / 2;
|
|
7708
|
+
const bottomX = cx - bottomW / 2;
|
|
7709
|
+
const points = `${topX},${y} ${topX + topW},${y} ${bottomX + bottomW},${y + stageH} ${bottomX},${y + stageH}`;
|
|
7710
|
+
const tone = toneByIndex(idx);
|
|
7711
|
+
const legendX = PAD_LEFT + canvasW + 24;
|
|
7712
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
7713
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7714
|
+
"polygon",
|
|
7715
|
+
{
|
|
7716
|
+
"data-cdl-role": "funnel-stage",
|
|
7717
|
+
"data-cdl-unresolved": s.unresolved ? "true" : void 0,
|
|
7718
|
+
points,
|
|
7719
|
+
fill: tone,
|
|
7720
|
+
fillOpacity: 0.9,
|
|
7721
|
+
stroke: tone,
|
|
7722
|
+
strokeWidth: 0
|
|
7723
|
+
}
|
|
7724
|
+
),
|
|
7725
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7726
|
+
"text",
|
|
7727
|
+
{
|
|
7728
|
+
x: cx,
|
|
7729
|
+
y: y + stageH / 2 + 5,
|
|
7730
|
+
fontSize: 14,
|
|
7731
|
+
fontWeight: 700,
|
|
7732
|
+
textAnchor: "middle",
|
|
7733
|
+
fill: "var(--cdl-node-fill, #ffffff)",
|
|
7734
|
+
children: s.title
|
|
7735
|
+
}
|
|
7736
|
+
),
|
|
7737
|
+
\u6BB5\u304C\u51FA\u5207\u3063\u305F(idx) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7738
|
+
"text",
|
|
7739
|
+
{
|
|
7740
|
+
x: legendX,
|
|
7741
|
+
y: y + stageH / 2 - 2,
|
|
7742
|
+
fontSize: 13,
|
|
7743
|
+
fontWeight: 700,
|
|
7744
|
+
fill: "var(--cdl-text, #1a1f2a)",
|
|
7745
|
+
children: s.count.toLocaleString()
|
|
7746
|
+
}
|
|
7747
|
+
),
|
|
7748
|
+
\u6BB5\u304C\u51FA\u5207\u3063\u305F(idx) && prev && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7749
|
+
"text",
|
|
7750
|
+
{
|
|
7751
|
+
x: legendX,
|
|
7752
|
+
y: y + stageH / 2 + 14,
|
|
7753
|
+
fontSize: 11,
|
|
7754
|
+
fill: dropRate > 0 ? "var(--cdl-text-dim, #5a6270)" : "var(--cdl-text-mute, #8a8678)",
|
|
7755
|
+
children: dropRate > 0 ? `\u2193 ${dropRate.toFixed(1)}%` : "\xB10%"
|
|
7756
|
+
}
|
|
7757
|
+
)
|
|
7758
|
+
] }, `stage-${s.id}`);
|
|
7759
|
+
});
|
|
7575
7760
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
7576
7761
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7577
7762
|
"rect",
|
|
@@ -7587,66 +7772,8 @@ function FunnelNode({
|
|
|
7587
7772
|
strokeWidth: active ? 3 : 1.25
|
|
7588
7773
|
}
|
|
7589
7774
|
),
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
const dropRate = prev && prev.count > 0 ? (prev.count - s.count) / prev.count * 100 : 0;
|
|
7593
|
-
const y = PAD_TOP + idx * (stageH + gap);
|
|
7594
|
-
const topW = widthAtStep(idx);
|
|
7595
|
-
const bottomW = widthAtStep(idx + 1);
|
|
7596
|
-
const cx = PAD_LEFT + canvasW / 2;
|
|
7597
|
-
const topX = cx - topW / 2;
|
|
7598
|
-
const bottomX = cx - bottomW / 2;
|
|
7599
|
-
const points = `${topX},${y} ${topX + topW},${y} ${bottomX + bottomW},${y + stageH} ${bottomX},${y + stageH}`;
|
|
7600
|
-
const tone = toneByIndex(idx);
|
|
7601
|
-
const legendX = PAD_LEFT + canvasW + 24;
|
|
7602
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
7603
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7604
|
-
"polygon",
|
|
7605
|
-
{
|
|
7606
|
-
"data-cdl-role": "funnel-stage",
|
|
7607
|
-
"data-cdl-unresolved": s.unresolved ? "true" : void 0,
|
|
7608
|
-
points,
|
|
7609
|
-
fill: tone,
|
|
7610
|
-
fillOpacity: 0.9,
|
|
7611
|
-
stroke: tone,
|
|
7612
|
-
strokeWidth: 0
|
|
7613
|
-
}
|
|
7614
|
-
),
|
|
7615
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7616
|
-
"text",
|
|
7617
|
-
{
|
|
7618
|
-
x: cx,
|
|
7619
|
-
y: y + stageH / 2 + 5,
|
|
7620
|
-
fontSize: 14,
|
|
7621
|
-
fontWeight: 700,
|
|
7622
|
-
textAnchor: "middle",
|
|
7623
|
-
fill: "var(--cdl-node-fill, #ffffff)",
|
|
7624
|
-
children: s.title
|
|
7625
|
-
}
|
|
7626
|
-
),
|
|
7627
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7628
|
-
"text",
|
|
7629
|
-
{
|
|
7630
|
-
x: legendX,
|
|
7631
|
-
y: y + stageH / 2 - 2,
|
|
7632
|
-
fontSize: 13,
|
|
7633
|
-
fontWeight: 700,
|
|
7634
|
-
fill: "var(--cdl-text, #1a1f2a)",
|
|
7635
|
-
children: s.count.toLocaleString()
|
|
7636
|
-
}
|
|
7637
|
-
),
|
|
7638
|
-
prev && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7639
|
-
"text",
|
|
7640
|
-
{
|
|
7641
|
-
x: legendX,
|
|
7642
|
-
y: y + stageH / 2 + 14,
|
|
7643
|
-
fontSize: 11,
|
|
7644
|
-
fill: dropRate > 0 ? "var(--cdl-text-dim, #5a6270)" : "var(--cdl-text-mute, #8a8678)",
|
|
7645
|
-
children: dropRate > 0 ? `\u2193 ${dropRate.toFixed(1)}%` : "\xB10%"
|
|
7646
|
-
}
|
|
7647
|
-
)
|
|
7648
|
-
] }, `stage-${s.id}`);
|
|
7649
|
-
})
|
|
7775
|
+
drawing && /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: \u5207\u308A\u629C\u304Did, children: /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: node.w, height: PAD_TOP + canvasH * \u4F38\u3073 }) }) }),
|
|
7776
|
+
drawing ? /* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: `url(#${\u5207\u308A\u629C\u304Did})`, children: \u6BB5 }) : \u6BB5
|
|
7650
7777
|
] });
|
|
7651
7778
|
}
|
|
7652
7779
|
var TONE_ORDER = [
|
|
@@ -7832,7 +7959,9 @@ function \u7BB1\u306E\u6587\u5B57({
|
|
|
7832
7959
|
function TreeNode({
|
|
7833
7960
|
node,
|
|
7834
7961
|
active,
|
|
7835
|
-
stateValues = {}
|
|
7962
|
+
stateValues = {},
|
|
7963
|
+
drawing = false,
|
|
7964
|
+
progress = 1
|
|
7836
7965
|
}) {
|
|
7837
7966
|
const x0 = node.cx - node.w / 2;
|
|
7838
7967
|
const y0 = node.cy - node.h / 2;
|
|
@@ -7845,6 +7974,9 @@ function TreeNode({
|
|
|
7845
7974
|
const canvasW = node.w - PAD_LEFT - PAD_RIGHT;
|
|
7846
7975
|
const canvasH = node.h - PAD_TOP - PAD_BOTTOM;
|
|
7847
7976
|
const layout2 = computeTreeLayout(treeNodes, canvasW, canvasH);
|
|
7977
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
7978
|
+
const \u6700\u5927\u6DF1\u3055 = layout2.nodes.reduce((m, n) => Math.max(m, n.depth), 0);
|
|
7979
|
+
const \u7BB1\u304C\u51FA\u308B = (\u6DF1\u3055) => !drawing || \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, \u6DF1\u3055, \u6700\u5927\u6DF1\u3055) >= 1;
|
|
7848
7980
|
const depthColors = [TONE.accent, TONE.teal, TONE.success, TONE.warning, TONE.info];
|
|
7849
7981
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
7850
7982
|
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "0%", y2: "100%", children: [
|
|
@@ -7872,6 +8004,7 @@ function TreeNode({
|
|
|
7872
8004
|
const y2 = PAD_TOP + e.y2;
|
|
7873
8005
|
const midY = (y1 + y2) / 2;
|
|
7874
8006
|
const path = `M ${x1} ${y1} L ${x1} ${midY} L ${x2} ${midY} L ${x2} ${y2}`;
|
|
8007
|
+
const \u679D\u306E\u4F38\u3073 = e.deferUntilComplete ? \u4F38\u3073 >= 1 ? 1 : 0 : \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, e.depth, \u6700\u5927\u6DF1\u3055);
|
|
7875
8008
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
7876
8009
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7877
8010
|
"path",
|
|
@@ -7882,13 +8015,15 @@ function TreeNode({
|
|
|
7882
8015
|
stroke: TONE.accent,
|
|
7883
8016
|
strokeOpacity: 0.55,
|
|
7884
8017
|
strokeWidth: 1.5,
|
|
7885
|
-
strokeLinejoin: "round"
|
|
8018
|
+
strokeLinejoin: "round",
|
|
8019
|
+
...\u4F38\u3070\u3059dash(drawing, \u679D\u306E\u4F38\u3073)
|
|
7886
8020
|
}
|
|
7887
8021
|
),
|
|
7888
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x1, cy: midY, r: 2.5, fill: TONE.accent, fillOpacity: 0.75 })
|
|
8022
|
+
(!drawing || \u679D\u306E\u4F38\u3073 >= 1) && /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x1, cy: midY, r: 2.5, fill: TONE.accent, fillOpacity: 0.75 })
|
|
7889
8023
|
] }, `edge-${i}`);
|
|
7890
8024
|
}),
|
|
7891
8025
|
layout2.nodes.map((n) => {
|
|
8026
|
+
if (!\u7BB1\u304C\u51FA\u308B(n.depth)) return null;
|
|
7892
8027
|
const accent = depthColors[Math.min(n.depth, depthColors.length - 1)] ?? depthColors[0];
|
|
7893
8028
|
const isRoot = n.depth === 0;
|
|
7894
8029
|
const \u884C = \u7BB1\u306B\u7A4D\u3080(
|
|
@@ -8069,6 +8204,7 @@ function computeTreeLayout(treeNodes, canvasW, canvasH) {
|
|
|
8069
8204
|
}
|
|
8070
8205
|
}
|
|
8071
8206
|
const hById = new Map(nodes.map((n) => [n.id, n.h]));
|
|
8207
|
+
const \u6BB5\u6570 = new Map(nodes.map((n) => [n.id, n.depth]));
|
|
8072
8208
|
const edges = [];
|
|
8073
8209
|
for (const n of treeNodes) {
|
|
8074
8210
|
if (!n.parent) continue;
|
|
@@ -8077,14 +8213,25 @@ function computeTreeLayout(treeNodes, canvasW, canvasH) {
|
|
|
8077
8213
|
if (!parent || !child) continue;
|
|
8078
8214
|
const parentH = hById.get(n.parent) ?? nodeH;
|
|
8079
8215
|
const childH = hById.get(n.id) ?? nodeH;
|
|
8080
|
-
|
|
8216
|
+
const parentDepth = \u6BB5\u6570.get(n.parent) ?? 0;
|
|
8217
|
+
const childDepth = \u6BB5\u6570.get(n.id) ?? 1;
|
|
8218
|
+
edges.push({
|
|
8219
|
+
x1: parent.x,
|
|
8220
|
+
y1: parent.y + parentH / 2,
|
|
8221
|
+
x2: child.x,
|
|
8222
|
+
y2: child.y - childH / 2,
|
|
8223
|
+
depth: Math.max(parentDepth, childDepth),
|
|
8224
|
+
deferUntilComplete: parentDepth >= childDepth
|
|
8225
|
+
});
|
|
8081
8226
|
}
|
|
8082
8227
|
return { nodes, edges };
|
|
8083
8228
|
}
|
|
8084
8229
|
function UserJourneyNode({
|
|
8085
8230
|
node,
|
|
8086
8231
|
active,
|
|
8087
|
-
stateValues = {}
|
|
8232
|
+
stateValues = {},
|
|
8233
|
+
drawing = false,
|
|
8234
|
+
progress = 1
|
|
8088
8235
|
}) {
|
|
8089
8236
|
const x0 = node.cx - node.w / 2;
|
|
8090
8237
|
const y0 = node.cy - node.h / 2;
|
|
@@ -8122,6 +8269,12 @@ function UserJourneyNode({
|
|
|
8122
8269
|
const xAt = (idx) => PAD_LEFT + (steps.length <= 1 ? canvasW / 2 : colW / 2 + colW * idx);
|
|
8123
8270
|
const yAt = (emotion) => PAD_TOP + rowH / 2 + (4 - emotionScore[emotion]) * rowH;
|
|
8124
8271
|
const pts = steps.map((s, i) => ({ x: xAt(i), y: yAt(s.emotion) }));
|
|
8272
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
8273
|
+
const \u6BB5\u307E\u3067\u306E\u5272\u5408 = \u30D9\u30B8\u30A8\u306E\u7D2F\u7A4D\u5272\u5408(pts, (\u524D, \u5F8C) => {
|
|
8274
|
+
const midX = (\u524D.x + \u5F8C.x) / 2;
|
|
8275
|
+
return [{ x: midX, y: \u524D.y }, { x: midX, y: \u5F8C.y }];
|
|
8276
|
+
});
|
|
8277
|
+
const \u7DDA\u306E\u5148\u304C\u5C4A\u3044\u305F = (idx) => !drawing || \u4F38\u3073 >= (\u6BB5\u307E\u3067\u306E\u5272\u5408[idx] ?? 0);
|
|
8125
8278
|
const smoothPath = pts.length > 1 ? pts.reduce((acc, p, i) => {
|
|
8126
8279
|
if (i === 0) return `M ${p.x} ${p.y}`;
|
|
8127
8280
|
const prev = pts[i - 1];
|
|
@@ -8202,7 +8355,8 @@ function UserJourneyNode({
|
|
|
8202
8355
|
stroke: "var(--cdl-tone-accent, #2d6a8f)",
|
|
8203
8356
|
strokeOpacity: 0.18,
|
|
8204
8357
|
strokeWidth: 10,
|
|
8205
|
-
strokeLinecap: "round"
|
|
8358
|
+
strokeLinecap: "round",
|
|
8359
|
+
...\u4F38\u3070\u3059dash(drawing, \u4F38\u3073)
|
|
8206
8360
|
}
|
|
8207
8361
|
),
|
|
8208
8362
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -8214,11 +8368,12 @@ function UserJourneyNode({
|
|
|
8214
8368
|
stroke: "var(--cdl-tone-accent, #2d6a8f)",
|
|
8215
8369
|
strokeWidth: 2.75,
|
|
8216
8370
|
strokeLinejoin: "round",
|
|
8217
|
-
strokeLinecap: "round"
|
|
8371
|
+
strokeLinecap: "round",
|
|
8372
|
+
...\u4F38\u3070\u3059dash(drawing, \u4F38\u3073)
|
|
8218
8373
|
}
|
|
8219
8374
|
)
|
|
8220
8375
|
] }),
|
|
8221
|
-
steps.map((s, idx) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8376
|
+
steps.map((s, idx) => !\u7DDA\u306E\u5148\u304C\u5C4A\u3044\u305F(idx) ? null : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8222
8377
|
"g",
|
|
8223
8378
|
{
|
|
8224
8379
|
"data-cdl-role": "journey-step",
|
|
@@ -12287,21 +12442,84 @@ function CdlNodeView({
|
|
|
12287
12442
|
}
|
|
12288
12443
|
);
|
|
12289
12444
|
case "chart-pie":
|
|
12290
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12445
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12446
|
+
ChartPieNode,
|
|
12447
|
+
{
|
|
12448
|
+
node: resolvedNode,
|
|
12449
|
+
active,
|
|
12450
|
+
stateValues,
|
|
12451
|
+
drawing,
|
|
12452
|
+
progress
|
|
12453
|
+
}
|
|
12454
|
+
);
|
|
12291
12455
|
case "chart-bar":
|
|
12292
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12456
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12457
|
+
ChartBarNode,
|
|
12458
|
+
{
|
|
12459
|
+
node: resolvedNode,
|
|
12460
|
+
active,
|
|
12461
|
+
stateValues,
|
|
12462
|
+
drawing,
|
|
12463
|
+
progress
|
|
12464
|
+
}
|
|
12465
|
+
);
|
|
12293
12466
|
case "gantt-timeline":
|
|
12294
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12467
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12468
|
+
GanttNode,
|
|
12469
|
+
{
|
|
12470
|
+
node: resolvedNode,
|
|
12471
|
+
active,
|
|
12472
|
+
stateValues,
|
|
12473
|
+
drawing,
|
|
12474
|
+
progress
|
|
12475
|
+
}
|
|
12476
|
+
);
|
|
12295
12477
|
case "mind-map":
|
|
12296
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12478
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12479
|
+
MindMapNode,
|
|
12480
|
+
{
|
|
12481
|
+
node: resolvedNode,
|
|
12482
|
+
active,
|
|
12483
|
+
stateValues,
|
|
12484
|
+
drawing,
|
|
12485
|
+
progress
|
|
12486
|
+
}
|
|
12487
|
+
);
|
|
12297
12488
|
case "funnel-stages":
|
|
12298
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12489
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12490
|
+
FunnelNode,
|
|
12491
|
+
{
|
|
12492
|
+
node: resolvedNode,
|
|
12493
|
+
active,
|
|
12494
|
+
stateValues,
|
|
12495
|
+
drawing,
|
|
12496
|
+
progress
|
|
12497
|
+
}
|
|
12498
|
+
);
|
|
12299
12499
|
case "quadrant-matrix":
|
|
12300
12500
|
return /* @__PURE__ */ jsxRuntime.jsx(QuadrantNode, { node: resolvedNode, active, stateValues });
|
|
12301
12501
|
case "tree-hierarchy":
|
|
12302
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12502
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12503
|
+
TreeNode,
|
|
12504
|
+
{
|
|
12505
|
+
node: resolvedNode,
|
|
12506
|
+
active,
|
|
12507
|
+
stateValues,
|
|
12508
|
+
drawing,
|
|
12509
|
+
progress
|
|
12510
|
+
}
|
|
12511
|
+
);
|
|
12303
12512
|
case "journey-map":
|
|
12304
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12513
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12514
|
+
UserJourneyNode,
|
|
12515
|
+
{
|
|
12516
|
+
node: resolvedNode,
|
|
12517
|
+
active,
|
|
12518
|
+
stateValues,
|
|
12519
|
+
drawing,
|
|
12520
|
+
progress
|
|
12521
|
+
}
|
|
12522
|
+
);
|
|
12305
12523
|
case "shape-file":
|
|
12306
12524
|
return /* @__PURE__ */ jsxRuntime.jsx(ShapeFileNode, { node: resolvedNode, active });
|
|
12307
12525
|
case "shape-folder":
|