@cardenelabs/cdl 0.11.0 → 0.12.1
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 +12 -2
- package/dist/index.cjs +361 -177
- 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 +361 -177
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +361 -177
- 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 +361 -177
- package/dist/react.js.map +1 -1
- package/dist/{render-DwH8v5Mb.d.cts → render-C7FKvMqq.d.cts} +5 -0
- package/dist/{render-DwH8v5Mb.d.ts → render-C7FKvMqq.d.ts} +5 -0
- package/package.json +1 -1
- package/src/kinds/box-lines.ts +12 -2
- package/src/kinds/chart-bar.tsx +3 -7
- package/src/kinds/chart-line.tsx +4 -10
- package/src/kinds/chart-pie.tsx +3 -7
- 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 +70 -16
- package/src/kinds/tree.tsx +57 -7
- package/src/kinds/user-journey.tsx +29 -1
- package/src/render/nodes.tsx +45 -5
- package/src/types.ts +5 -0
- package/src/validate.ts +15 -1
package/dist/react.cjs
CHANGED
|
@@ -4886,7 +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([
|
|
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
|
+
]);
|
|
4890
4899
|
var KINDS = new Set(NODE_KINDS);
|
|
4891
4900
|
var ENG_BANNED = /\b(FUNCTION|STORAGE|EVENT LOG|BALANCES MAPPING|READ|WRITE|EMIT|CALL)\b/;
|
|
4892
4901
|
function validate(diag) {
|
|
@@ -6584,6 +6593,44 @@ function resolveMindData(data, values) {
|
|
|
6584
6593
|
const \u89E3\u6C7A\u5F8C = { ...data, rootTitle: root.value, branches };
|
|
6585
6594
|
return root.ok ? \u89E3\u6C7A\u5F8C : { ...\u89E3\u6C7A\u5F8C, unresolved: true };
|
|
6586
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
|
+
}
|
|
6587
6634
|
function ChartLineNode({
|
|
6588
6635
|
node,
|
|
6589
6636
|
active,
|
|
@@ -6621,7 +6668,7 @@ function ChartLineNode({
|
|
|
6621
6668
|
\u70B9\u307E\u3067\u306E\u9577\u3055.push(\u7DDA\u306E\u5168\u9577);
|
|
6622
6669
|
\u524D\u306E\u70B9 = \u4ECA\u306E\u70B9;
|
|
6623
6670
|
}
|
|
6624
|
-
const \u4F38\u3073 = drawing
|
|
6671
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
6625
6672
|
const \u7DDA\u306E\u5148\u304C\u5C4A\u3044\u305F = (idx) => {
|
|
6626
6673
|
if (!drawing) return true;
|
|
6627
6674
|
if (data.length <= 1) return true;
|
|
@@ -6706,7 +6753,7 @@ function ChartLineNode({
|
|
|
6706
6753
|
strokeWidth: 2.5,
|
|
6707
6754
|
strokeLinejoin: "round",
|
|
6708
6755
|
strokeLinecap: "round",
|
|
6709
|
-
|
|
6756
|
+
...\u4F38\u3070\u3059dash(drawing, \u4F38\u3073)
|
|
6710
6757
|
}
|
|
6711
6758
|
),
|
|
6712
6759
|
data.map((d, idx) => {
|
|
@@ -6806,7 +6853,7 @@ function ChartPieNode({
|
|
|
6806
6853
|
const path = `M ${cx} ${cy} L ${x1} ${y1} A ${radius} ${radius} 0 ${large} 1 ${x2} ${y2} Z`;
|
|
6807
6854
|
return { d, frac, path, startFrac };
|
|
6808
6855
|
});
|
|
6809
|
-
const \u958B\u304D = drawing
|
|
6856
|
+
const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
6810
6857
|
const \u5207\u308A\u629C\u304Did = `cdl-pie-draw-${instanceId}`;
|
|
6811
6858
|
const \u958B\u304D\u59CB\u3081\u305F = (startFrac) => !drawing || \u958B\u304D > startFrac;
|
|
6812
6859
|
const legendX = pieAreaW + 8;
|
|
@@ -6921,7 +6968,7 @@ function ChartBarNode({
|
|
|
6921
6968
|
const v = vMax * i / gridCount;
|
|
6922
6969
|
return { y: yAt(v), value: v };
|
|
6923
6970
|
});
|
|
6924
|
-
const \u4F38\u3073 = drawing
|
|
6971
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
6925
6972
|
const \u6A2A\u8EF8\u306Ey = PAD_TOP + canvasH;
|
|
6926
6973
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
6927
6974
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7025,7 +7072,9 @@ function ChartBarNode({
|
|
|
7025
7072
|
function GanttNode({
|
|
7026
7073
|
node,
|
|
7027
7074
|
active,
|
|
7028
|
-
stateValues = {}
|
|
7075
|
+
stateValues = {},
|
|
7076
|
+
drawing = false,
|
|
7077
|
+
progress = 1
|
|
7029
7078
|
}) {
|
|
7030
7079
|
const x0 = node.cx - node.w / 2;
|
|
7031
7080
|
const y0 = node.cy - node.h / 2;
|
|
@@ -7084,6 +7133,7 @@ function GanttNode({
|
|
|
7084
7133
|
const \u5E2F\u306E\u4F59\u767D = Math.min(6, cellW / 2);
|
|
7085
7134
|
const \u5E2F\u306E\u5DE6 = (idx) => xAt(idx) + \u5E2F\u306E\u4F59\u767D / 2;
|
|
7086
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);
|
|
7087
7137
|
const taskById = new Map(\u6574\u3048\u305F.map((t) => [t.id, t]));
|
|
7088
7138
|
const rowOf = new Map(\u6574\u3048\u305F.map((t, i) => [t.id, i]));
|
|
7089
7139
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
@@ -7158,34 +7208,41 @@ function GanttNode({
|
|
|
7158
7208
|
const bx = \u5E2F\u306E\u5DE6(t.startIdx);
|
|
7159
7209
|
const by = yAt(row);
|
|
7160
7210
|
const bw = Math.max(0, \u5E2F\u306E\u53F3(t.endIdx) - bx);
|
|
7161
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7162
|
-
|
|
7163
|
-
|
|
7164
|
-
{
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
7171
|
-
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
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
|
+
);
|
|
7189
7246
|
}),
|
|
7190
7247
|
\u6574\u3048\u305F.filter((t) => t.dependsOn && taskById.has(t.dependsOn)).map((t) => {
|
|
7191
7248
|
const parent = taskById.get(t.dependsOn);
|
|
@@ -7205,29 +7262,33 @@ function GanttNode({
|
|
|
7205
7262
|
const hasRoom = enterX - startX >= elbowGap;
|
|
7206
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}`;
|
|
7207
7264
|
const arrowHeadPath = `M ${tipX + arrowHeadSize} ${tipY} L ${tipX} ${tipY - arrowHeadSize / 2} L ${tipX} ${tipY + arrowHeadSize / 2} Z`;
|
|
7208
|
-
return
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
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
|
+
);
|
|
7231
7292
|
})
|
|
7232
7293
|
] });
|
|
7233
7294
|
}
|
|
@@ -7241,17 +7302,20 @@ var \u884C\u9001\u308A\u306E\u6BD4 = 1.15;
|
|
|
7241
7302
|
var \u5B57\u306E\u9AD8\u3055\u306E\u6BD4 = 0.72;
|
|
7242
7303
|
var \u4E0A\u4E0B\u306E\u4F59\u767D = 2;
|
|
7243
7304
|
var \u5DE6\u53F3\u306E\u4F59\u767D = 8;
|
|
7244
|
-
function \
|
|
7245
|
-
|
|
7246
|
-
|
|
7305
|
+
function \u4F7F\u3048\u308B\u5E45(\u7BB1\u306E\u5E45) {
|
|
7306
|
+
return \u7BB1\u306E\u5E45 - \u5DE6\u53F3\u306E\u4F59\u767D * 2;
|
|
7307
|
+
}
|
|
7308
|
+
function \u5E45\u3067\u5207\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B = textWidth) {
|
|
7309
|
+
if (\u4F7F\u3048\u308B\u5E452 <= 0) return "";
|
|
7310
|
+
if (\u6E2C\u308B(text, fontSize) <= \u4F7F\u3048\u308B\u5E452) return text;
|
|
7247
7311
|
const \u7701\u7565 = "\u2026";
|
|
7248
7312
|
const \u7701\u7565\u306E\u5E45 = \u6E2C\u308B(\u7701\u7565, fontSize);
|
|
7249
|
-
if (\u7701\u7565\u306E\u5E45 > \u4F7F\u3048\u308B\
|
|
7313
|
+
if (\u7701\u7565\u306E\u5E45 > \u4F7F\u3048\u308B\u5E452) return "";
|
|
7250
7314
|
let \u51FA = "";
|
|
7251
7315
|
let \u5E45 = 0;
|
|
7252
7316
|
for (const c of \u66F8\u8A18\u7D20\u306B\u5206\u3051\u308B(text)) {
|
|
7253
7317
|
const \u5B57\u306E\u5E452 = \u6E2C\u308B(c, fontSize);
|
|
7254
|
-
if (\u5E45 + \u5B57\u306E\u5E452 + \u7701\u7565\u306E\u5E45 > \u4F7F\u3048\u308B\
|
|
7318
|
+
if (\u5E45 + \u5B57\u306E\u5E452 + \u7701\u7565\u306E\u5E45 > \u4F7F\u3048\u308B\u5E452) break;
|
|
7255
7319
|
\u5E45 += \u5B57\u306E\u5E452;
|
|
7256
7320
|
\u51FA += c;
|
|
7257
7321
|
}
|
|
@@ -7269,13 +7333,13 @@ function \u7BB1\u306B\u7A4D\u3080(\u884C, \u7BB1\u306E\u5E45, \u7BB1\u306E\u9AD8
|
|
|
7269
7333
|
const \u9AD8\u3055 = (rs) => rs.reduce((a, r) => a + r.fontSize * \u884C\u9001\u308A\u306E\u6BD4, 0);
|
|
7270
7334
|
const \u6B8B\u3059 = [...\u5019\u88DC];
|
|
7271
7335
|
while (\u6B8B\u3059.length > 1 && \u9AD8\u3055(\u6B8B\u3059) > \u4F7F\u3048\u308B\u9AD8\u3055) \u6B8B\u3059.pop();
|
|
7272
|
-
const \u4F7F\u3048\u308B\u5E45
|
|
7336
|
+
const \u5E45 = \u4F7F\u3048\u308B\u5E45(\u7BB1\u306E\u5E45);
|
|
7273
7337
|
const \u7DCF\u9AD8 = \u9AD8\u3055(\u6B8B\u3059);
|
|
7274
7338
|
let \u7A4D\u307F = -\u7DCF\u9AD8 / 2;
|
|
7275
7339
|
return \u6B8B\u3059.map((r) => {
|
|
7276
7340
|
const dy = \u7A4D\u307F + (\u884C\u9001\u308A\u306E\u6BD4 + \u5B57\u306E\u9AD8\u3055\u306E\u6BD4) / 2 * r.fontSize;
|
|
7277
7341
|
\u7A4D\u307F += r.fontSize * \u884C\u9001\u308A\u306E\u6BD4;
|
|
7278
|
-
return { ...r, text: \u5E45\u3067\u5207\u308B(r.text, r.fontSize, \
|
|
7342
|
+
return { ...r, text: \u5E45\u3067\u5207\u308B(r.text, r.fontSize, \u5E45), dy };
|
|
7279
7343
|
});
|
|
7280
7344
|
}
|
|
7281
7345
|
var MIND_TONES = ["accent", "teal", "success", "warning", "info", "error"];
|
|
@@ -7283,7 +7347,9 @@ var MIND_BOX_GAP = 24;
|
|
|
7283
7347
|
function MindMapNode({
|
|
7284
7348
|
node,
|
|
7285
7349
|
active,
|
|
7286
|
-
stateValues = {}
|
|
7350
|
+
stateValues = {},
|
|
7351
|
+
drawing = false,
|
|
7352
|
+
progress = 1
|
|
7287
7353
|
}) {
|
|
7288
7354
|
const x0 = node.cx - node.w / 2;
|
|
7289
7355
|
const y0 = node.cy - node.h / 2;
|
|
@@ -7295,6 +7361,9 @@ function MindMapNode({
|
|
|
7295
7361
|
const canvasW = node.w - PAD * 2;
|
|
7296
7362
|
const canvasH = node.h - PAD * 2;
|
|
7297
7363
|
const layout2 = computeMindMapLayout(mindData, canvasCx, canvasCy, canvasW, canvasH);
|
|
7364
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
7365
|
+
const \u6700\u5927\u6DF1\u3055 = layout2.nodes.reduce((m, n) => Math.max(m, n.depth), 0);
|
|
7366
|
+
const \u7BB1\u304C\u51FA\u308B = (\u6DF1\u3055) => !drawing || \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, \u6DF1\u3055, \u6700\u5927\u6DF1\u3055) >= 1;
|
|
7298
7367
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
7299
7368
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7300
7369
|
"rect",
|
|
@@ -7310,20 +7379,25 @@ function MindMapNode({
|
|
|
7310
7379
|
strokeWidth: active ? 3 : 1.25
|
|
7311
7380
|
}
|
|
7312
7381
|
),
|
|
7313
|
-
layout2.edges.map((e, i) =>
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
"
|
|
7317
|
-
|
|
7318
|
-
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
|
|
7325
|
-
|
|
7382
|
+
layout2.edges.map((e, i) => {
|
|
7383
|
+
const \u679D\u306E\u4F38\u3073 = e.deferUntilComplete ? \u4F38\u3073 >= 1 ? 1 : 0 : \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, e.depth, \u6700\u5927\u6DF1\u3055);
|
|
7384
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7385
|
+
"path",
|
|
7386
|
+
{
|
|
7387
|
+
"data-cdl-role": "mind-edge",
|
|
7388
|
+
d: e.d,
|
|
7389
|
+
fill: "none",
|
|
7390
|
+
stroke: toneColor4(e.tone),
|
|
7391
|
+
strokeWidth: 2.5,
|
|
7392
|
+
strokeOpacity: 0.55,
|
|
7393
|
+
strokeLinecap: "round",
|
|
7394
|
+
...\u4F38\u3070\u3059dash(drawing, \u679D\u306E\u4F38\u3073)
|
|
7395
|
+
},
|
|
7396
|
+
`edge-${i}`
|
|
7397
|
+
);
|
|
7398
|
+
}),
|
|
7326
7399
|
layout2.nodes.map((n) => {
|
|
7400
|
+
if (!\u7BB1\u304C\u51FA\u308B(n.depth)) return null;
|
|
7327
7401
|
const \u884C = \u7BB1\u306B\u7A4D\u3080(
|
|
7328
7402
|
[
|
|
7329
7403
|
{ \u5F79\u5272: "title", text: n.title, fontSize: n.isRoot ? 15 : 13 },
|
|
@@ -7362,17 +7436,22 @@ function MindMapNode({
|
|
|
7362
7436
|
children: r.text
|
|
7363
7437
|
},
|
|
7364
7438
|
r.\u5F79\u5272
|
|
7365
|
-
)) :
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
|
|
7439
|
+
)) : (
|
|
7440
|
+
// 補足が無くても **幅に収める** (#526)。 `箱に積む` を通らないこの経路だけが
|
|
7441
|
+
// 幅を見ておらず、長い名前がそのまま箱の外へ出て枝の線と重なっていた
|
|
7442
|
+
// (実測 = 中心の箱で文字 163px に対し箱 120px)
|
|
7443
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7444
|
+
"text",
|
|
7445
|
+
{
|
|
7446
|
+
x: n.x,
|
|
7447
|
+
y: n.y + 5,
|
|
7448
|
+
fontSize: n.isRoot ? 15 : 13,
|
|
7449
|
+
fontWeight: n.isRoot ? 700 : 600,
|
|
7450
|
+
textAnchor: "middle",
|
|
7451
|
+
fill: \u6587\u5B57\u306E\u8272,
|
|
7452
|
+
children: \u5E45\u3067\u5207\u308B(n.title, n.isRoot ? 15 : 13, \u4F7F\u3048\u308B\u5E45(n.w))
|
|
7453
|
+
}
|
|
7454
|
+
)
|
|
7376
7455
|
)
|
|
7377
7456
|
] }, `n-${n.id}`);
|
|
7378
7457
|
})
|
|
@@ -7391,6 +7470,8 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
|
|
|
7391
7470
|
w: rootW,
|
|
7392
7471
|
h: rootH,
|
|
7393
7472
|
isRoot: true,
|
|
7473
|
+
// 中心は起点なので段数 0 (cdl#520)
|
|
7474
|
+
depth: 0,
|
|
7394
7475
|
...mindData.unresolved ? { unresolved: true } : {}
|
|
7395
7476
|
});
|
|
7396
7477
|
const childrenOf = /* @__PURE__ */ new Map();
|
|
@@ -7502,6 +7583,8 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
|
|
|
7502
7583
|
y,
|
|
7503
7584
|
w,
|
|
7504
7585
|
h,
|
|
7586
|
+
// 第 1 階層が段数 1 (`subDepth` は 0 始まり、 cdl#520)
|
|
7587
|
+
depth: subDepth + 1,
|
|
7505
7588
|
tone: myTone,
|
|
7506
7589
|
isRoot: false,
|
|
7507
7590
|
...node.unresolved ? { unresolved: true } : {}
|
|
@@ -7543,23 +7626,36 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
|
|
|
7543
7626
|
}
|
|
7544
7627
|
}
|
|
7545
7628
|
}
|
|
7629
|
+
const \u6BB5\u6570 = new Map(nodes.map((n) => [n.id, n.depth]));
|
|
7546
7630
|
for (const br of mindData.branches) {
|
|
7547
7631
|
const childPos = nodePos.get(br.id);
|
|
7548
7632
|
if (!childPos) continue;
|
|
7549
7633
|
const isLeft = nodeSide.get(br.id) === "left";
|
|
7550
7634
|
const childHalfW = nodeHalfW.get(br.id) ?? subBranchW / 2;
|
|
7551
7635
|
const tone = nodeTone.get(br.id);
|
|
7636
|
+
const childDepth = \u6BB5\u6570.get(br.id) ?? 1;
|
|
7637
|
+
const parentDepth = \u6BB5\u6570.get(br.parent) ?? 0;
|
|
7552
7638
|
if (br.parent === mindData.rootId) {
|
|
7553
7639
|
const startX = rootEdgeXFor(isLeft);
|
|
7554
7640
|
const endX = childPos.x + (isLeft ? childHalfW : -childHalfW);
|
|
7555
|
-
edges.push({
|
|
7641
|
+
edges.push({
|
|
7642
|
+
d: makeCurve(startX, cy, endX, childPos.y),
|
|
7643
|
+
tone,
|
|
7644
|
+
depth: childDepth,
|
|
7645
|
+
deferUntilComplete: false
|
|
7646
|
+
});
|
|
7556
7647
|
} else {
|
|
7557
7648
|
const parentPos = nodePos.get(br.parent);
|
|
7558
7649
|
if (!parentPos) continue;
|
|
7559
7650
|
const parentHalfW = nodeHalfW.get(br.parent) ?? branchW / 2;
|
|
7560
7651
|
const startX = parentPos.x + (isLeft ? -parentHalfW : parentHalfW);
|
|
7561
7652
|
const endX = childPos.x + (isLeft ? childHalfW : -childHalfW);
|
|
7562
|
-
edges.push({
|
|
7653
|
+
edges.push({
|
|
7654
|
+
d: makeCurve(startX, parentPos.y, endX, childPos.y),
|
|
7655
|
+
tone,
|
|
7656
|
+
depth: Math.max(parentDepth, childDepth),
|
|
7657
|
+
deferUntilComplete: parentDepth >= childDepth
|
|
7658
|
+
});
|
|
7563
7659
|
}
|
|
7564
7660
|
}
|
|
7565
7661
|
return { nodes, edges };
|
|
@@ -7579,7 +7675,9 @@ function toneColor4(tone, alpha = 1) {
|
|
|
7579
7675
|
function FunnelNode({
|
|
7580
7676
|
node,
|
|
7581
7677
|
active,
|
|
7582
|
-
stateValues = {}
|
|
7678
|
+
stateValues = {},
|
|
7679
|
+
drawing = false,
|
|
7680
|
+
progress = 1
|
|
7583
7681
|
}) {
|
|
7584
7682
|
const x0 = node.cx - node.w / 2;
|
|
7585
7683
|
const y0 = node.cy - node.h / 2;
|
|
@@ -7594,12 +7692,79 @@ function FunnelNode({
|
|
|
7594
7692
|
const stageCount = stages.length || 1;
|
|
7595
7693
|
const gap = 4;
|
|
7596
7694
|
const stageH = (canvasH - gap * (stageCount - 1)) / stageCount;
|
|
7695
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
7696
|
+
const \u5207\u308A\u629C\u304Did = `cdl-funnel-draw-${react.useId().replace(/[^A-Za-z0-9_-]/g, "")}`;
|
|
7697
|
+
const \u6BB5\u306E\u4E0B\u7AEF\u306E\u5272\u5408 = (idx) => {
|
|
7698
|
+
if (canvasH <= 0) return 0;
|
|
7699
|
+
return ((idx + 1) * stageH + idx * gap) / canvasH;
|
|
7700
|
+
};
|
|
7701
|
+
const \u6BB5\u304C\u51FA\u5207\u3063\u305F = (idx) => !drawing || \u4F38\u3073 >= \u6BB5\u306E\u4E0B\u7AEF\u306E\u5272\u5408(idx);
|
|
7597
7702
|
const widthAtStep = (step) => {
|
|
7598
7703
|
const topRatio = 1;
|
|
7599
7704
|
const bottomRatio = 0.35;
|
|
7600
7705
|
const t = step / stageCount;
|
|
7601
7706
|
return canvasW * (topRatio + (bottomRatio - topRatio) * t);
|
|
7602
7707
|
};
|
|
7708
|
+
const \u6BB5 = stages.map((s, idx) => {
|
|
7709
|
+
const prev = idx > 0 ? stages[idx - 1] : null;
|
|
7710
|
+
const dropRate = prev && prev.count > 0 ? (prev.count - s.count) / prev.count * 100 : 0;
|
|
7711
|
+
const y = PAD_TOP + idx * (stageH + gap);
|
|
7712
|
+
const topW = widthAtStep(idx);
|
|
7713
|
+
const bottomW = widthAtStep(idx + 1);
|
|
7714
|
+
const cx = PAD_LEFT + canvasW / 2;
|
|
7715
|
+
const topX = cx - topW / 2;
|
|
7716
|
+
const bottomX = cx - bottomW / 2;
|
|
7717
|
+
const points = `${topX},${y} ${topX + topW},${y} ${bottomX + bottomW},${y + stageH} ${bottomX},${y + stageH}`;
|
|
7718
|
+
const tone = toneByIndex(idx);
|
|
7719
|
+
const legendX = PAD_LEFT + canvasW + 24;
|
|
7720
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
7721
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7722
|
+
"polygon",
|
|
7723
|
+
{
|
|
7724
|
+
"data-cdl-role": "funnel-stage",
|
|
7725
|
+
"data-cdl-unresolved": s.unresolved ? "true" : void 0,
|
|
7726
|
+
points,
|
|
7727
|
+
fill: tone,
|
|
7728
|
+
fillOpacity: 0.9,
|
|
7729
|
+
stroke: tone,
|
|
7730
|
+
strokeWidth: 0
|
|
7731
|
+
}
|
|
7732
|
+
),
|
|
7733
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7734
|
+
"text",
|
|
7735
|
+
{
|
|
7736
|
+
x: cx,
|
|
7737
|
+
y: y + stageH / 2 + 5,
|
|
7738
|
+
fontSize: 14,
|
|
7739
|
+
fontWeight: 700,
|
|
7740
|
+
textAnchor: "middle",
|
|
7741
|
+
fill: "var(--cdl-node-fill, #ffffff)",
|
|
7742
|
+
children: s.title
|
|
7743
|
+
}
|
|
7744
|
+
),
|
|
7745
|
+
\u6BB5\u304C\u51FA\u5207\u3063\u305F(idx) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7746
|
+
"text",
|
|
7747
|
+
{
|
|
7748
|
+
x: legendX,
|
|
7749
|
+
y: y + stageH / 2 - 2,
|
|
7750
|
+
fontSize: 13,
|
|
7751
|
+
fontWeight: 700,
|
|
7752
|
+
fill: "var(--cdl-text, #1a1f2a)",
|
|
7753
|
+
children: s.count.toLocaleString()
|
|
7754
|
+
}
|
|
7755
|
+
),
|
|
7756
|
+
\u6BB5\u304C\u51FA\u5207\u3063\u305F(idx) && prev && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7757
|
+
"text",
|
|
7758
|
+
{
|
|
7759
|
+
x: legendX,
|
|
7760
|
+
y: y + stageH / 2 + 14,
|
|
7761
|
+
fontSize: 11,
|
|
7762
|
+
fill: dropRate > 0 ? "var(--cdl-text-dim, #5a6270)" : "var(--cdl-text-mute, #8a8678)",
|
|
7763
|
+
children: dropRate > 0 ? `\u2193 ${dropRate.toFixed(1)}%` : "\xB10%"
|
|
7764
|
+
}
|
|
7765
|
+
)
|
|
7766
|
+
] }, `stage-${s.id}`);
|
|
7767
|
+
});
|
|
7603
7768
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
7604
7769
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7605
7770
|
"rect",
|
|
@@ -7615,66 +7780,8 @@ function FunnelNode({
|
|
|
7615
7780
|
strokeWidth: active ? 3 : 1.25
|
|
7616
7781
|
}
|
|
7617
7782
|
),
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
const dropRate = prev && prev.count > 0 ? (prev.count - s.count) / prev.count * 100 : 0;
|
|
7621
|
-
const y = PAD_TOP + idx * (stageH + gap);
|
|
7622
|
-
const topW = widthAtStep(idx);
|
|
7623
|
-
const bottomW = widthAtStep(idx + 1);
|
|
7624
|
-
const cx = PAD_LEFT + canvasW / 2;
|
|
7625
|
-
const topX = cx - topW / 2;
|
|
7626
|
-
const bottomX = cx - bottomW / 2;
|
|
7627
|
-
const points = `${topX},${y} ${topX + topW},${y} ${bottomX + bottomW},${y + stageH} ${bottomX},${y + stageH}`;
|
|
7628
|
-
const tone = toneByIndex(idx);
|
|
7629
|
-
const legendX = PAD_LEFT + canvasW + 24;
|
|
7630
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
7631
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7632
|
-
"polygon",
|
|
7633
|
-
{
|
|
7634
|
-
"data-cdl-role": "funnel-stage",
|
|
7635
|
-
"data-cdl-unresolved": s.unresolved ? "true" : void 0,
|
|
7636
|
-
points,
|
|
7637
|
-
fill: tone,
|
|
7638
|
-
fillOpacity: 0.9,
|
|
7639
|
-
stroke: tone,
|
|
7640
|
-
strokeWidth: 0
|
|
7641
|
-
}
|
|
7642
|
-
),
|
|
7643
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7644
|
-
"text",
|
|
7645
|
-
{
|
|
7646
|
-
x: cx,
|
|
7647
|
-
y: y + stageH / 2 + 5,
|
|
7648
|
-
fontSize: 14,
|
|
7649
|
-
fontWeight: 700,
|
|
7650
|
-
textAnchor: "middle",
|
|
7651
|
-
fill: "var(--cdl-node-fill, #ffffff)",
|
|
7652
|
-
children: s.title
|
|
7653
|
-
}
|
|
7654
|
-
),
|
|
7655
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7656
|
-
"text",
|
|
7657
|
-
{
|
|
7658
|
-
x: legendX,
|
|
7659
|
-
y: y + stageH / 2 - 2,
|
|
7660
|
-
fontSize: 13,
|
|
7661
|
-
fontWeight: 700,
|
|
7662
|
-
fill: "var(--cdl-text, #1a1f2a)",
|
|
7663
|
-
children: s.count.toLocaleString()
|
|
7664
|
-
}
|
|
7665
|
-
),
|
|
7666
|
-
prev && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7667
|
-
"text",
|
|
7668
|
-
{
|
|
7669
|
-
x: legendX,
|
|
7670
|
-
y: y + stageH / 2 + 14,
|
|
7671
|
-
fontSize: 11,
|
|
7672
|
-
fill: dropRate > 0 ? "var(--cdl-text-dim, #5a6270)" : "var(--cdl-text-mute, #8a8678)",
|
|
7673
|
-
children: dropRate > 0 ? `\u2193 ${dropRate.toFixed(1)}%` : "\xB10%"
|
|
7674
|
-
}
|
|
7675
|
-
)
|
|
7676
|
-
] }, `stage-${s.id}`);
|
|
7677
|
-
})
|
|
7783
|
+
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 }) }) }),
|
|
7784
|
+
drawing ? /* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: `url(#${\u5207\u308A\u629C\u304Did})`, children: \u6BB5 }) : \u6BB5
|
|
7678
7785
|
] });
|
|
7679
7786
|
}
|
|
7680
7787
|
var TONE_ORDER = [
|
|
@@ -7860,7 +7967,9 @@ function \u7BB1\u306E\u6587\u5B57({
|
|
|
7860
7967
|
function TreeNode({
|
|
7861
7968
|
node,
|
|
7862
7969
|
active,
|
|
7863
|
-
stateValues = {}
|
|
7970
|
+
stateValues = {},
|
|
7971
|
+
drawing = false,
|
|
7972
|
+
progress = 1
|
|
7864
7973
|
}) {
|
|
7865
7974
|
const x0 = node.cx - node.w / 2;
|
|
7866
7975
|
const y0 = node.cy - node.h / 2;
|
|
@@ -7873,6 +7982,9 @@ function TreeNode({
|
|
|
7873
7982
|
const canvasW = node.w - PAD_LEFT - PAD_RIGHT;
|
|
7874
7983
|
const canvasH = node.h - PAD_TOP - PAD_BOTTOM;
|
|
7875
7984
|
const layout2 = computeTreeLayout(treeNodes, canvasW, canvasH);
|
|
7985
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
7986
|
+
const \u6700\u5927\u6DF1\u3055 = layout2.nodes.reduce((m, n) => Math.max(m, n.depth), 0);
|
|
7987
|
+
const \u7BB1\u304C\u51FA\u308B = (\u6DF1\u3055) => !drawing || \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, \u6DF1\u3055, \u6700\u5927\u6DF1\u3055) >= 1;
|
|
7876
7988
|
const depthColors = [TONE.accent, TONE.teal, TONE.success, TONE.warning, TONE.info];
|
|
7877
7989
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
7878
7990
|
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "0%", y2: "100%", children: [
|
|
@@ -7900,6 +8012,7 @@ function TreeNode({
|
|
|
7900
8012
|
const y2 = PAD_TOP + e.y2;
|
|
7901
8013
|
const midY = (y1 + y2) / 2;
|
|
7902
8014
|
const path = `M ${x1} ${y1} L ${x1} ${midY} L ${x2} ${midY} L ${x2} ${y2}`;
|
|
8015
|
+
const \u679D\u306E\u4F38\u3073 = e.deferUntilComplete ? \u4F38\u3073 >= 1 ? 1 : 0 : \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, e.depth, \u6700\u5927\u6DF1\u3055);
|
|
7903
8016
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
7904
8017
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7905
8018
|
"path",
|
|
@@ -7910,13 +8023,15 @@ function TreeNode({
|
|
|
7910
8023
|
stroke: TONE.accent,
|
|
7911
8024
|
strokeOpacity: 0.55,
|
|
7912
8025
|
strokeWidth: 1.5,
|
|
7913
|
-
strokeLinejoin: "round"
|
|
8026
|
+
strokeLinejoin: "round",
|
|
8027
|
+
...\u4F38\u3070\u3059dash(drawing, \u679D\u306E\u4F38\u3073)
|
|
7914
8028
|
}
|
|
7915
8029
|
),
|
|
7916
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x1, cy: midY, r: 2.5, fill: TONE.accent, fillOpacity: 0.75 })
|
|
8030
|
+
(!drawing || \u679D\u306E\u4F38\u3073 >= 1) && /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x1, cy: midY, r: 2.5, fill: TONE.accent, fillOpacity: 0.75 })
|
|
7917
8031
|
] }, `edge-${i}`);
|
|
7918
8032
|
}),
|
|
7919
8033
|
layout2.nodes.map((n) => {
|
|
8034
|
+
if (!\u7BB1\u304C\u51FA\u308B(n.depth)) return null;
|
|
7920
8035
|
const accent = depthColors[Math.min(n.depth, depthColors.length - 1)] ?? depthColors[0];
|
|
7921
8036
|
const isRoot = n.depth === 0;
|
|
7922
8037
|
const \u884C = \u7BB1\u306B\u7A4D\u3080(
|
|
@@ -7952,17 +8067,21 @@ function TreeNode({
|
|
|
7952
8067
|
\u7BB1\u306E\u9AD8\u3055: n.h,
|
|
7953
8068
|
fill: "var(--cdl-text-on-tone, #ffffff)",
|
|
7954
8069
|
\u540D\u524D\u306E\u592A\u3055: 700
|
|
7955
|
-
}) :
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
|
|
7962
|
-
|
|
7963
|
-
|
|
7964
|
-
|
|
7965
|
-
|
|
8070
|
+
}) : (
|
|
8071
|
+
// 補足が無くても幅に収める (#526)。 `箱の文字` を通らないこの経路だけが
|
|
8072
|
+
// 幅を見ておらず、長い名前が箱の外へ出ていた
|
|
8073
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8074
|
+
"text",
|
|
8075
|
+
{
|
|
8076
|
+
x: n.w / 2,
|
|
8077
|
+
y: n.h / 2 + 5,
|
|
8078
|
+
fontSize: 13,
|
|
8079
|
+
fontWeight: 700,
|
|
8080
|
+
textAnchor: "middle",
|
|
8081
|
+
fill: "var(--cdl-text-on-tone, #ffffff)",
|
|
8082
|
+
children: \u5E45\u3067\u5207\u308B(n.title, 13, \u4F7F\u3048\u308B\u5E45(n.w))
|
|
8083
|
+
}
|
|
8084
|
+
)
|
|
7966
8085
|
)
|
|
7967
8086
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7968
8087
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7995,7 +8114,7 @@ function TreeNode({
|
|
|
7995
8114
|
fontWeight: 600,
|
|
7996
8115
|
textAnchor: "middle",
|
|
7997
8116
|
fill: "var(--cdl-chip-text, #1a1f2a)",
|
|
7998
|
-
children: n.title
|
|
8117
|
+
children: \u5E45\u3067\u5207\u308B(n.title, 12, \u4F7F\u3048\u308B\u5E45(n.w))
|
|
7999
8118
|
}
|
|
8000
8119
|
)
|
|
8001
8120
|
] })
|
|
@@ -8097,6 +8216,7 @@ function computeTreeLayout(treeNodes, canvasW, canvasH) {
|
|
|
8097
8216
|
}
|
|
8098
8217
|
}
|
|
8099
8218
|
const hById = new Map(nodes.map((n) => [n.id, n.h]));
|
|
8219
|
+
const \u6BB5\u6570 = new Map(nodes.map((n) => [n.id, n.depth]));
|
|
8100
8220
|
const edges = [];
|
|
8101
8221
|
for (const n of treeNodes) {
|
|
8102
8222
|
if (!n.parent) continue;
|
|
@@ -8105,14 +8225,25 @@ function computeTreeLayout(treeNodes, canvasW, canvasH) {
|
|
|
8105
8225
|
if (!parent || !child) continue;
|
|
8106
8226
|
const parentH = hById.get(n.parent) ?? nodeH;
|
|
8107
8227
|
const childH = hById.get(n.id) ?? nodeH;
|
|
8108
|
-
|
|
8228
|
+
const parentDepth = \u6BB5\u6570.get(n.parent) ?? 0;
|
|
8229
|
+
const childDepth = \u6BB5\u6570.get(n.id) ?? 1;
|
|
8230
|
+
edges.push({
|
|
8231
|
+
x1: parent.x,
|
|
8232
|
+
y1: parent.y + parentH / 2,
|
|
8233
|
+
x2: child.x,
|
|
8234
|
+
y2: child.y - childH / 2,
|
|
8235
|
+
depth: Math.max(parentDepth, childDepth),
|
|
8236
|
+
deferUntilComplete: parentDepth >= childDepth
|
|
8237
|
+
});
|
|
8109
8238
|
}
|
|
8110
8239
|
return { nodes, edges };
|
|
8111
8240
|
}
|
|
8112
8241
|
function UserJourneyNode({
|
|
8113
8242
|
node,
|
|
8114
8243
|
active,
|
|
8115
|
-
stateValues = {}
|
|
8244
|
+
stateValues = {},
|
|
8245
|
+
drawing = false,
|
|
8246
|
+
progress = 1
|
|
8116
8247
|
}) {
|
|
8117
8248
|
const x0 = node.cx - node.w / 2;
|
|
8118
8249
|
const y0 = node.cy - node.h / 2;
|
|
@@ -8150,6 +8281,12 @@ function UserJourneyNode({
|
|
|
8150
8281
|
const xAt = (idx) => PAD_LEFT + (steps.length <= 1 ? canvasW / 2 : colW / 2 + colW * idx);
|
|
8151
8282
|
const yAt = (emotion) => PAD_TOP + rowH / 2 + (4 - emotionScore[emotion]) * rowH;
|
|
8152
8283
|
const pts = steps.map((s, i) => ({ x: xAt(i), y: yAt(s.emotion) }));
|
|
8284
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
8285
|
+
const \u6BB5\u307E\u3067\u306E\u5272\u5408 = \u30D9\u30B8\u30A8\u306E\u7D2F\u7A4D\u5272\u5408(pts, (\u524D, \u5F8C) => {
|
|
8286
|
+
const midX = (\u524D.x + \u5F8C.x) / 2;
|
|
8287
|
+
return [{ x: midX, y: \u524D.y }, { x: midX, y: \u5F8C.y }];
|
|
8288
|
+
});
|
|
8289
|
+
const \u7DDA\u306E\u5148\u304C\u5C4A\u3044\u305F = (idx) => !drawing || \u4F38\u3073 >= (\u6BB5\u307E\u3067\u306E\u5272\u5408[idx] ?? 0);
|
|
8153
8290
|
const smoothPath = pts.length > 1 ? pts.reduce((acc, p, i) => {
|
|
8154
8291
|
if (i === 0) return `M ${p.x} ${p.y}`;
|
|
8155
8292
|
const prev = pts[i - 1];
|
|
@@ -8230,7 +8367,8 @@ function UserJourneyNode({
|
|
|
8230
8367
|
stroke: "var(--cdl-tone-accent, #2d6a8f)",
|
|
8231
8368
|
strokeOpacity: 0.18,
|
|
8232
8369
|
strokeWidth: 10,
|
|
8233
|
-
strokeLinecap: "round"
|
|
8370
|
+
strokeLinecap: "round",
|
|
8371
|
+
...\u4F38\u3070\u3059dash(drawing, \u4F38\u3073)
|
|
8234
8372
|
}
|
|
8235
8373
|
),
|
|
8236
8374
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -8242,11 +8380,12 @@ function UserJourneyNode({
|
|
|
8242
8380
|
stroke: "var(--cdl-tone-accent, #2d6a8f)",
|
|
8243
8381
|
strokeWidth: 2.75,
|
|
8244
8382
|
strokeLinejoin: "round",
|
|
8245
|
-
strokeLinecap: "round"
|
|
8383
|
+
strokeLinecap: "round",
|
|
8384
|
+
...\u4F38\u3070\u3059dash(drawing, \u4F38\u3073)
|
|
8246
8385
|
}
|
|
8247
8386
|
)
|
|
8248
8387
|
] }),
|
|
8249
|
-
steps.map((s, idx) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8388
|
+
steps.map((s, idx) => !\u7DDA\u306E\u5148\u304C\u5C4A\u3044\u305F(idx) ? null : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8250
8389
|
"g",
|
|
8251
8390
|
{
|
|
8252
8391
|
"data-cdl-role": "journey-step",
|
|
@@ -12337,17 +12476,62 @@ function CdlNodeView({
|
|
|
12337
12476
|
}
|
|
12338
12477
|
);
|
|
12339
12478
|
case "gantt-timeline":
|
|
12340
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12479
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12480
|
+
GanttNode,
|
|
12481
|
+
{
|
|
12482
|
+
node: resolvedNode,
|
|
12483
|
+
active,
|
|
12484
|
+
stateValues,
|
|
12485
|
+
drawing,
|
|
12486
|
+
progress
|
|
12487
|
+
}
|
|
12488
|
+
);
|
|
12341
12489
|
case "mind-map":
|
|
12342
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12490
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12491
|
+
MindMapNode,
|
|
12492
|
+
{
|
|
12493
|
+
node: resolvedNode,
|
|
12494
|
+
active,
|
|
12495
|
+
stateValues,
|
|
12496
|
+
drawing,
|
|
12497
|
+
progress
|
|
12498
|
+
}
|
|
12499
|
+
);
|
|
12343
12500
|
case "funnel-stages":
|
|
12344
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12501
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12502
|
+
FunnelNode,
|
|
12503
|
+
{
|
|
12504
|
+
node: resolvedNode,
|
|
12505
|
+
active,
|
|
12506
|
+
stateValues,
|
|
12507
|
+
drawing,
|
|
12508
|
+
progress
|
|
12509
|
+
}
|
|
12510
|
+
);
|
|
12345
12511
|
case "quadrant-matrix":
|
|
12346
12512
|
return /* @__PURE__ */ jsxRuntime.jsx(QuadrantNode, { node: resolvedNode, active, stateValues });
|
|
12347
12513
|
case "tree-hierarchy":
|
|
12348
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12514
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12515
|
+
TreeNode,
|
|
12516
|
+
{
|
|
12517
|
+
node: resolvedNode,
|
|
12518
|
+
active,
|
|
12519
|
+
stateValues,
|
|
12520
|
+
drawing,
|
|
12521
|
+
progress
|
|
12522
|
+
}
|
|
12523
|
+
);
|
|
12349
12524
|
case "journey-map":
|
|
12350
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12525
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12526
|
+
UserJourneyNode,
|
|
12527
|
+
{
|
|
12528
|
+
node: resolvedNode,
|
|
12529
|
+
active,
|
|
12530
|
+
stateValues,
|
|
12531
|
+
drawing,
|
|
12532
|
+
progress
|
|
12533
|
+
}
|
|
12534
|
+
);
|
|
12351
12535
|
case "shape-file":
|
|
12352
12536
|
return /* @__PURE__ */ jsxRuntime.jsx(ShapeFileNode, { node: resolvedNode, active });
|
|
12353
12537
|
case "shape-folder":
|