@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/index.cjs
CHANGED
|
@@ -15864,7 +15864,16 @@ function nodeTemplateTexts(node) {
|
|
|
15864
15864
|
|
|
15865
15865
|
// src/validate.ts
|
|
15866
15866
|
var TONES2 = new Set(TONES);
|
|
15867
|
-
var DRAW_KINDS = /* @__PURE__ */ new Set([
|
|
15867
|
+
var DRAW_KINDS = /* @__PURE__ */ new Set([
|
|
15868
|
+
"chart-line",
|
|
15869
|
+
"chart-bar",
|
|
15870
|
+
"chart-pie",
|
|
15871
|
+
"journey-map",
|
|
15872
|
+
"mind-map",
|
|
15873
|
+
"tree-hierarchy",
|
|
15874
|
+
"gantt-timeline",
|
|
15875
|
+
"funnel-stages"
|
|
15876
|
+
]);
|
|
15868
15877
|
var KINDS = new Set(NODE_KINDS);
|
|
15869
15878
|
var ENG_BANNED = /\b(FUNCTION|STORAGE|EVENT LOG|BALANCES MAPPING|READ|WRITE|EMIT|CALL)\b/;
|
|
15870
15879
|
function validate(diag) {
|
|
@@ -21282,6 +21291,44 @@ function resolveMindData(data, values) {
|
|
|
21282
21291
|
const \u89E3\u6C7A\u5F8C = { ...data, rootTitle: root.value, branches };
|
|
21283
21292
|
return root.ok ? \u89E3\u6C7A\u5F8C : { ...\u89E3\u6C7A\u5F8C, unresolved: true };
|
|
21284
21293
|
}
|
|
21294
|
+
|
|
21295
|
+
// src/kinds/draw-progress.ts
|
|
21296
|
+
function \u9032\u307F\u3092\u7573\u3080(drawing, progress) {
|
|
21297
|
+
if (!drawing) return 1;
|
|
21298
|
+
return Math.min(1, Math.max(0, Number.isFinite(progress) ? progress : 1));
|
|
21299
|
+
}
|
|
21300
|
+
function \u4F38\u3070\u3059dash(drawing, \u4F38\u3073) {
|
|
21301
|
+
if (!drawing) return {};
|
|
21302
|
+
return { pathLength: 1, strokeDasharray: 1, strokeDashoffset: 1 - \u4F38\u3073 };
|
|
21303
|
+
}
|
|
21304
|
+
function \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, \u6DF1\u3055, \u6700\u5927\u6DF1\u3055) {
|
|
21305
|
+
if (\u6700\u5927\u6DF1\u3055 <= 0 || \u6DF1\u3055 <= 0) return 1;
|
|
21306
|
+
const \u5E45 = 1 / \u6700\u5927\u6DF1\u3055;
|
|
21307
|
+
const \u59CB\u307E\u308A = (\u6DF1\u3055 - 1) * \u5E45;
|
|
21308
|
+
return Math.min(1, Math.max(0, (\u4F38\u3073 - \u59CB\u307E\u308A) / \u5E45));
|
|
21309
|
+
}
|
|
21310
|
+
function \u30D9\u30B8\u30A8\u306E\u7D2F\u7A4D\u5272\u5408(\u70B9, \u5236\u5FA1\u70B9, \u5206\u5272\u6570 = 16) {
|
|
21311
|
+
if (\u70B9.length <= 1) return \u70B9.map(() => 0);
|
|
21312
|
+
const \u9577\u3055 = [0];
|
|
21313
|
+
let \u5408\u8A08 = 0;
|
|
21314
|
+
for (let i = 1; i < \u70B9.length; i++) {
|
|
21315
|
+
const p0 = \u70B9[i - 1];
|
|
21316
|
+
const p3 = \u70B9[i];
|
|
21317
|
+
const [p1, p2] = \u5236\u5FA1\u70B9(p0, p3);
|
|
21318
|
+
let \u524D = p0;
|
|
21319
|
+
for (let s = 1; s <= \u5206\u5272\u6570; s++) {
|
|
21320
|
+
const t = s / \u5206\u5272\u6570;
|
|
21321
|
+
const u = 1 - t;
|
|
21322
|
+
const x = u * u * u * p0.x + 3 * u * u * t * p1.x + 3 * u * t * t * p2.x + t * t * t * p3.x;
|
|
21323
|
+
const y = u * u * u * p0.y + 3 * u * u * t * p1.y + 3 * u * t * t * p2.y + t * t * t * p3.y;
|
|
21324
|
+
\u5408\u8A08 += Math.hypot(x - \u524D.x, y - \u524D.y);
|
|
21325
|
+
\u524D = { x, y };
|
|
21326
|
+
}
|
|
21327
|
+
\u9577\u3055.push(\u5408\u8A08);
|
|
21328
|
+
}
|
|
21329
|
+
if (\u5408\u8A08 === 0) return \u70B9.map(() => 0);
|
|
21330
|
+
return \u9577\u3055.map((l) => l / \u5408\u8A08);
|
|
21331
|
+
}
|
|
21285
21332
|
function ChartLineNode({
|
|
21286
21333
|
node,
|
|
21287
21334
|
active,
|
|
@@ -21319,7 +21366,7 @@ function ChartLineNode({
|
|
|
21319
21366
|
\u70B9\u307E\u3067\u306E\u9577\u3055.push(\u7DDA\u306E\u5168\u9577);
|
|
21320
21367
|
\u524D\u306E\u70B9 = \u4ECA\u306E\u70B9;
|
|
21321
21368
|
}
|
|
21322
|
-
const \u4F38\u3073 = drawing
|
|
21369
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
21323
21370
|
const \u7DDA\u306E\u5148\u304C\u5C4A\u3044\u305F = (idx) => {
|
|
21324
21371
|
if (!drawing) return true;
|
|
21325
21372
|
if (data.length <= 1) return true;
|
|
@@ -21404,7 +21451,7 @@ function ChartLineNode({
|
|
|
21404
21451
|
strokeWidth: 2.5,
|
|
21405
21452
|
strokeLinejoin: "round",
|
|
21406
21453
|
strokeLinecap: "round",
|
|
21407
|
-
|
|
21454
|
+
...\u4F38\u3070\u3059dash(drawing, \u4F38\u3073)
|
|
21408
21455
|
}
|
|
21409
21456
|
),
|
|
21410
21457
|
data.map((d, idx) => {
|
|
@@ -21504,7 +21551,7 @@ function ChartPieNode({
|
|
|
21504
21551
|
const path = `M ${cx} ${cy} L ${x1} ${y1} A ${radius} ${radius} 0 ${large} 1 ${x2} ${y2} Z`;
|
|
21505
21552
|
return { d, frac, path, startFrac };
|
|
21506
21553
|
});
|
|
21507
|
-
const \u958B\u304D = drawing
|
|
21554
|
+
const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
21508
21555
|
const \u5207\u308A\u629C\u304Did = `cdl-pie-draw-${instanceId}`;
|
|
21509
21556
|
const \u958B\u304D\u59CB\u3081\u305F = (startFrac) => !drawing || \u958B\u304D > startFrac;
|
|
21510
21557
|
const legendX = pieAreaW + 8;
|
|
@@ -21619,7 +21666,7 @@ function ChartBarNode({
|
|
|
21619
21666
|
const v = vMax * i / gridCount;
|
|
21620
21667
|
return { y: yAt(v), value: v };
|
|
21621
21668
|
});
|
|
21622
|
-
const \u4F38\u3073 = drawing
|
|
21669
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
21623
21670
|
const \u6A2A\u8EF8\u306Ey = PAD_TOP + canvasH;
|
|
21624
21671
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
21625
21672
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -21723,7 +21770,9 @@ function ChartBarNode({
|
|
|
21723
21770
|
function GanttNode({
|
|
21724
21771
|
node,
|
|
21725
21772
|
active,
|
|
21726
|
-
stateValues = {}
|
|
21773
|
+
stateValues = {},
|
|
21774
|
+
drawing = false,
|
|
21775
|
+
progress = 1
|
|
21727
21776
|
}) {
|
|
21728
21777
|
const x0 = node.cx - node.w / 2;
|
|
21729
21778
|
const y0 = node.cy - node.h / 2;
|
|
@@ -21782,6 +21831,7 @@ function GanttNode({
|
|
|
21782
21831
|
const \u5E2F\u306E\u4F59\u767D = Math.min(6, cellW / 2);
|
|
21783
21832
|
const \u5E2F\u306E\u5DE6 = (idx) => xAt(idx) + \u5E2F\u306E\u4F59\u767D / 2;
|
|
21784
21833
|
const \u5E2F\u306E\u53F3 = (idx) => xAt(idx) + cellW - \u5E2F\u306E\u4F59\u767D / 2;
|
|
21834
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
21785
21835
|
const taskById = new Map(\u6574\u3048\u305F.map((t) => [t.id, t]));
|
|
21786
21836
|
const rowOf = new Map(\u6574\u3048\u305F.map((t, i) => [t.id, i]));
|
|
21787
21837
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
@@ -21856,34 +21906,41 @@ function GanttNode({
|
|
|
21856
21906
|
const bx = \u5E2F\u306E\u5DE6(t.startIdx);
|
|
21857
21907
|
const by = yAt(row);
|
|
21858
21908
|
const bw = Math.max(0, \u5E2F\u306E\u53F3(t.endIdx) - bx);
|
|
21859
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21860
|
-
|
|
21861
|
-
|
|
21862
|
-
{
|
|
21863
|
-
|
|
21864
|
-
|
|
21865
|
-
|
|
21866
|
-
|
|
21867
|
-
|
|
21868
|
-
|
|
21869
|
-
|
|
21870
|
-
|
|
21871
|
-
|
|
21872
|
-
|
|
21873
|
-
|
|
21874
|
-
|
|
21875
|
-
|
|
21876
|
-
|
|
21877
|
-
|
|
21878
|
-
|
|
21879
|
-
|
|
21880
|
-
|
|
21881
|
-
|
|
21882
|
-
|
|
21883
|
-
|
|
21884
|
-
|
|
21885
|
-
|
|
21886
|
-
|
|
21909
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21910
|
+
"g",
|
|
21911
|
+
{
|
|
21912
|
+
...drawing ? { transform: `translate(${bx} 0) scale(${\u4F38\u3073} 1) translate(${-bx} 0)` } : {},
|
|
21913
|
+
children: [
|
|
21914
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21915
|
+
"rect",
|
|
21916
|
+
{
|
|
21917
|
+
"data-cdl-role": "gantt-bar",
|
|
21918
|
+
"data-cdl-unresolved": t.unresolved ? "true" : void 0,
|
|
21919
|
+
"data-cdl-clipped": "clipped" in t && t.clipped ? "true" : void 0,
|
|
21920
|
+
x: bx,
|
|
21921
|
+
y: by,
|
|
21922
|
+
width: bw,
|
|
21923
|
+
height: rowH,
|
|
21924
|
+
rx: 4,
|
|
21925
|
+
fill: toneColor3(t.tone),
|
|
21926
|
+
fillOpacity: 0.9
|
|
21927
|
+
}
|
|
21928
|
+
),
|
|
21929
|
+
t.owner && rowH >= 22 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
21930
|
+
"text",
|
|
21931
|
+
{
|
|
21932
|
+
x: bx + 8,
|
|
21933
|
+
y: by + rowH / 2 + 4,
|
|
21934
|
+
fontSize: 11,
|
|
21935
|
+
fill: "var(--cdl-node-fill, #ffffff)",
|
|
21936
|
+
fontWeight: 600,
|
|
21937
|
+
children: t.owner
|
|
21938
|
+
}
|
|
21939
|
+
)
|
|
21940
|
+
]
|
|
21941
|
+
},
|
|
21942
|
+
`bar-${t.id}`
|
|
21943
|
+
);
|
|
21887
21944
|
}),
|
|
21888
21945
|
\u6574\u3048\u305F.filter((t) => t.dependsOn && taskById.has(t.dependsOn)).map((t) => {
|
|
21889
21946
|
const parent = taskById.get(t.dependsOn);
|
|
@@ -21903,29 +21960,33 @@ function GanttNode({
|
|
|
21903
21960
|
const hasRoom = enterX - startX >= elbowGap;
|
|
21904
21961
|
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}`;
|
|
21905
21962
|
const arrowHeadPath = `M ${tipX + arrowHeadSize} ${tipY} L ${tipX} ${tipY - arrowHeadSize / 2} L ${tipX} ${tipY + arrowHeadSize / 2} Z`;
|
|
21906
|
-
return
|
|
21907
|
-
|
|
21908
|
-
|
|
21909
|
-
|
|
21910
|
-
|
|
21911
|
-
|
|
21912
|
-
|
|
21913
|
-
|
|
21914
|
-
|
|
21915
|
-
|
|
21916
|
-
|
|
21917
|
-
|
|
21918
|
-
|
|
21919
|
-
|
|
21920
|
-
|
|
21921
|
-
|
|
21922
|
-
|
|
21923
|
-
|
|
21924
|
-
|
|
21925
|
-
|
|
21926
|
-
|
|
21927
|
-
|
|
21928
|
-
|
|
21963
|
+
return (
|
|
21964
|
+
// 矢印は両端の帯が出てから描く。 帯が無い場所へ矢印だけが伸びると、
|
|
21965
|
+
// 指す先の無い線になる (cdl#521)
|
|
21966
|
+
drawing && \u4F38\u3073 < 1 ? null : /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-role": "gantt-arrow", children: [
|
|
21967
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21968
|
+
"path",
|
|
21969
|
+
{
|
|
21970
|
+
d: path,
|
|
21971
|
+
fill: "none",
|
|
21972
|
+
stroke: "var(--cdl-text-mute, #8a8678)",
|
|
21973
|
+
strokeWidth: 1.75,
|
|
21974
|
+
strokeLinejoin: "round",
|
|
21975
|
+
strokeLinecap: "round"
|
|
21976
|
+
}
|
|
21977
|
+
),
|
|
21978
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21979
|
+
"path",
|
|
21980
|
+
{
|
|
21981
|
+
d: arrowHeadPath,
|
|
21982
|
+
fill: "var(--cdl-text-mute, #8a8678)",
|
|
21983
|
+
stroke: "var(--cdl-text-mute, #8a8678)",
|
|
21984
|
+
strokeWidth: 0.5,
|
|
21985
|
+
strokeLinejoin: "round"
|
|
21986
|
+
}
|
|
21987
|
+
)
|
|
21988
|
+
] }, `dep-${parent.id}-${t.id}`)
|
|
21989
|
+
);
|
|
21929
21990
|
})
|
|
21930
21991
|
] });
|
|
21931
21992
|
}
|
|
@@ -21939,17 +22000,20 @@ var \u884C\u9001\u308A\u306E\u6BD4 = 1.15;
|
|
|
21939
22000
|
var \u5B57\u306E\u9AD8\u3055\u306E\u6BD4 = 0.72;
|
|
21940
22001
|
var \u4E0A\u4E0B\u306E\u4F59\u767D = 2;
|
|
21941
22002
|
var \u5DE6\u53F3\u306E\u4F59\u767D = 8;
|
|
21942
|
-
function \
|
|
21943
|
-
|
|
21944
|
-
|
|
22003
|
+
function \u4F7F\u3048\u308B\u5E45(\u7BB1\u306E\u5E45) {
|
|
22004
|
+
return \u7BB1\u306E\u5E45 - \u5DE6\u53F3\u306E\u4F59\u767D * 2;
|
|
22005
|
+
}
|
|
22006
|
+
function \u5E45\u3067\u5207\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B = textWidth) {
|
|
22007
|
+
if (\u4F7F\u3048\u308B\u5E452 <= 0) return "";
|
|
22008
|
+
if (\u6E2C\u308B(text, fontSize) <= \u4F7F\u3048\u308B\u5E452) return text;
|
|
21945
22009
|
const \u7701\u7565 = "\u2026";
|
|
21946
22010
|
const \u7701\u7565\u306E\u5E45 = \u6E2C\u308B(\u7701\u7565, fontSize);
|
|
21947
|
-
if (\u7701\u7565\u306E\u5E45 > \u4F7F\u3048\u308B\
|
|
22011
|
+
if (\u7701\u7565\u306E\u5E45 > \u4F7F\u3048\u308B\u5E452) return "";
|
|
21948
22012
|
let \u51FA = "";
|
|
21949
22013
|
let \u5E45 = 0;
|
|
21950
22014
|
for (const c of \u66F8\u8A18\u7D20\u306B\u5206\u3051\u308B(text)) {
|
|
21951
22015
|
const \u5B57\u306E\u5E452 = \u6E2C\u308B(c, fontSize);
|
|
21952
|
-
if (\u5E45 + \u5B57\u306E\u5E452 + \u7701\u7565\u306E\u5E45 > \u4F7F\u3048\u308B\
|
|
22016
|
+
if (\u5E45 + \u5B57\u306E\u5E452 + \u7701\u7565\u306E\u5E45 > \u4F7F\u3048\u308B\u5E452) break;
|
|
21953
22017
|
\u5E45 += \u5B57\u306E\u5E452;
|
|
21954
22018
|
\u51FA += c;
|
|
21955
22019
|
}
|
|
@@ -21967,13 +22031,13 @@ function \u7BB1\u306B\u7A4D\u3080(\u884C, \u7BB1\u306E\u5E45, \u7BB1\u306E\u9AD8
|
|
|
21967
22031
|
const \u9AD8\u3055 = (rs) => rs.reduce((a, r) => a + r.fontSize * \u884C\u9001\u308A\u306E\u6BD4, 0);
|
|
21968
22032
|
const \u6B8B\u3059 = [...\u5019\u88DC];
|
|
21969
22033
|
while (\u6B8B\u3059.length > 1 && \u9AD8\u3055(\u6B8B\u3059) > \u4F7F\u3048\u308B\u9AD8\u3055) \u6B8B\u3059.pop();
|
|
21970
|
-
const \u4F7F\u3048\u308B\u5E45
|
|
22034
|
+
const \u5E45 = \u4F7F\u3048\u308B\u5E45(\u7BB1\u306E\u5E45);
|
|
21971
22035
|
const \u7DCF\u9AD8 = \u9AD8\u3055(\u6B8B\u3059);
|
|
21972
22036
|
let \u7A4D\u307F = -\u7DCF\u9AD8 / 2;
|
|
21973
22037
|
return \u6B8B\u3059.map((r) => {
|
|
21974
22038
|
const dy = \u7A4D\u307F + (\u884C\u9001\u308A\u306E\u6BD4 + \u5B57\u306E\u9AD8\u3055\u306E\u6BD4) / 2 * r.fontSize;
|
|
21975
22039
|
\u7A4D\u307F += r.fontSize * \u884C\u9001\u308A\u306E\u6BD4;
|
|
21976
|
-
return { ...r, text: \u5E45\u3067\u5207\u308B(r.text, r.fontSize, \
|
|
22040
|
+
return { ...r, text: \u5E45\u3067\u5207\u308B(r.text, r.fontSize, \u5E45), dy };
|
|
21977
22041
|
});
|
|
21978
22042
|
}
|
|
21979
22043
|
var MIND_TONES = ["accent", "teal", "success", "warning", "info", "error"];
|
|
@@ -21981,7 +22045,9 @@ var MIND_BOX_GAP = 24;
|
|
|
21981
22045
|
function MindMapNode({
|
|
21982
22046
|
node,
|
|
21983
22047
|
active,
|
|
21984
|
-
stateValues = {}
|
|
22048
|
+
stateValues = {},
|
|
22049
|
+
drawing = false,
|
|
22050
|
+
progress = 1
|
|
21985
22051
|
}) {
|
|
21986
22052
|
const x0 = node.cx - node.w / 2;
|
|
21987
22053
|
const y0 = node.cy - node.h / 2;
|
|
@@ -21993,6 +22059,9 @@ function MindMapNode({
|
|
|
21993
22059
|
const canvasW = node.w - PAD * 2;
|
|
21994
22060
|
const canvasH = node.h - PAD * 2;
|
|
21995
22061
|
const layout2 = computeMindMapLayout(mindData, canvasCx, canvasCy, canvasW, canvasH);
|
|
22062
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
22063
|
+
const \u6700\u5927\u6DF1\u3055 = layout2.nodes.reduce((m, n) => Math.max(m, n.depth), 0);
|
|
22064
|
+
const \u7BB1\u304C\u51FA\u308B = (\u6DF1\u3055) => !drawing || \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, \u6DF1\u3055, \u6700\u5927\u6DF1\u3055) >= 1;
|
|
21996
22065
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
21997
22066
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21998
22067
|
"rect",
|
|
@@ -22008,20 +22077,25 @@ function MindMapNode({
|
|
|
22008
22077
|
strokeWidth: active ? 3 : 1.25
|
|
22009
22078
|
}
|
|
22010
22079
|
),
|
|
22011
|
-
layout2.edges.map((e, i) =>
|
|
22012
|
-
|
|
22013
|
-
|
|
22014
|
-
"
|
|
22015
|
-
|
|
22016
|
-
|
|
22017
|
-
|
|
22018
|
-
|
|
22019
|
-
|
|
22020
|
-
|
|
22021
|
-
|
|
22022
|
-
|
|
22023
|
-
|
|
22080
|
+
layout2.edges.map((e, i) => {
|
|
22081
|
+
const \u679D\u306E\u4F38\u3073 = e.deferUntilComplete ? \u4F38\u3073 >= 1 ? 1 : 0 : \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, e.depth, \u6700\u5927\u6DF1\u3055);
|
|
22082
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22083
|
+
"path",
|
|
22084
|
+
{
|
|
22085
|
+
"data-cdl-role": "mind-edge",
|
|
22086
|
+
d: e.d,
|
|
22087
|
+
fill: "none",
|
|
22088
|
+
stroke: toneColor4(e.tone),
|
|
22089
|
+
strokeWidth: 2.5,
|
|
22090
|
+
strokeOpacity: 0.55,
|
|
22091
|
+
strokeLinecap: "round",
|
|
22092
|
+
...\u4F38\u3070\u3059dash(drawing, \u679D\u306E\u4F38\u3073)
|
|
22093
|
+
},
|
|
22094
|
+
`edge-${i}`
|
|
22095
|
+
);
|
|
22096
|
+
}),
|
|
22024
22097
|
layout2.nodes.map((n) => {
|
|
22098
|
+
if (!\u7BB1\u304C\u51FA\u308B(n.depth)) return null;
|
|
22025
22099
|
const \u884C = \u7BB1\u306B\u7A4D\u3080(
|
|
22026
22100
|
[
|
|
22027
22101
|
{ \u5F79\u5272: "title", text: n.title, fontSize: n.isRoot ? 15 : 13 },
|
|
@@ -22060,17 +22134,22 @@ function MindMapNode({
|
|
|
22060
22134
|
children: r.text
|
|
22061
22135
|
},
|
|
22062
22136
|
r.\u5F79\u5272
|
|
22063
|
-
)) :
|
|
22064
|
-
|
|
22065
|
-
|
|
22066
|
-
|
|
22067
|
-
|
|
22068
|
-
|
|
22069
|
-
|
|
22070
|
-
|
|
22071
|
-
|
|
22072
|
-
|
|
22073
|
-
|
|
22137
|
+
)) : (
|
|
22138
|
+
// 補足が無くても **幅に収める** (#526)。 `箱に積む` を通らないこの経路だけが
|
|
22139
|
+
// 幅を見ておらず、長い名前がそのまま箱の外へ出て枝の線と重なっていた
|
|
22140
|
+
// (実測 = 中心の箱で文字 163px に対し箱 120px)
|
|
22141
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22142
|
+
"text",
|
|
22143
|
+
{
|
|
22144
|
+
x: n.x,
|
|
22145
|
+
y: n.y + 5,
|
|
22146
|
+
fontSize: n.isRoot ? 15 : 13,
|
|
22147
|
+
fontWeight: n.isRoot ? 700 : 600,
|
|
22148
|
+
textAnchor: "middle",
|
|
22149
|
+
fill: \u6587\u5B57\u306E\u8272,
|
|
22150
|
+
children: \u5E45\u3067\u5207\u308B(n.title, n.isRoot ? 15 : 13, \u4F7F\u3048\u308B\u5E45(n.w))
|
|
22151
|
+
}
|
|
22152
|
+
)
|
|
22074
22153
|
)
|
|
22075
22154
|
] }, `n-${n.id}`);
|
|
22076
22155
|
})
|
|
@@ -22089,6 +22168,8 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
|
|
|
22089
22168
|
w: rootW,
|
|
22090
22169
|
h: rootH,
|
|
22091
22170
|
isRoot: true,
|
|
22171
|
+
// 中心は起点なので段数 0 (cdl#520)
|
|
22172
|
+
depth: 0,
|
|
22092
22173
|
...mindData.unresolved ? { unresolved: true } : {}
|
|
22093
22174
|
});
|
|
22094
22175
|
const childrenOf = /* @__PURE__ */ new Map();
|
|
@@ -22200,6 +22281,8 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
|
|
|
22200
22281
|
y,
|
|
22201
22282
|
w,
|
|
22202
22283
|
h,
|
|
22284
|
+
// 第 1 階層が段数 1 (`subDepth` は 0 始まり、 cdl#520)
|
|
22285
|
+
depth: subDepth + 1,
|
|
22203
22286
|
tone: myTone,
|
|
22204
22287
|
isRoot: false,
|
|
22205
22288
|
...node.unresolved ? { unresolved: true } : {}
|
|
@@ -22241,23 +22324,36 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
|
|
|
22241
22324
|
}
|
|
22242
22325
|
}
|
|
22243
22326
|
}
|
|
22327
|
+
const \u6BB5\u6570 = new Map(nodes.map((n) => [n.id, n.depth]));
|
|
22244
22328
|
for (const br of mindData.branches) {
|
|
22245
22329
|
const childPos = nodePos.get(br.id);
|
|
22246
22330
|
if (!childPos) continue;
|
|
22247
22331
|
const isLeft = nodeSide.get(br.id) === "left";
|
|
22248
22332
|
const childHalfW = nodeHalfW.get(br.id) ?? subBranchW / 2;
|
|
22249
22333
|
const tone = nodeTone.get(br.id);
|
|
22334
|
+
const childDepth = \u6BB5\u6570.get(br.id) ?? 1;
|
|
22335
|
+
const parentDepth = \u6BB5\u6570.get(br.parent) ?? 0;
|
|
22250
22336
|
if (br.parent === mindData.rootId) {
|
|
22251
22337
|
const startX = rootEdgeXFor(isLeft);
|
|
22252
22338
|
const endX = childPos.x + (isLeft ? childHalfW : -childHalfW);
|
|
22253
|
-
edges.push({
|
|
22339
|
+
edges.push({
|
|
22340
|
+
d: makeCurve(startX, cy, endX, childPos.y),
|
|
22341
|
+
tone,
|
|
22342
|
+
depth: childDepth,
|
|
22343
|
+
deferUntilComplete: false
|
|
22344
|
+
});
|
|
22254
22345
|
} else {
|
|
22255
22346
|
const parentPos = nodePos.get(br.parent);
|
|
22256
22347
|
if (!parentPos) continue;
|
|
22257
22348
|
const parentHalfW = nodeHalfW.get(br.parent) ?? branchW / 2;
|
|
22258
22349
|
const startX = parentPos.x + (isLeft ? -parentHalfW : parentHalfW);
|
|
22259
22350
|
const endX = childPos.x + (isLeft ? childHalfW : -childHalfW);
|
|
22260
|
-
edges.push({
|
|
22351
|
+
edges.push({
|
|
22352
|
+
d: makeCurve(startX, parentPos.y, endX, childPos.y),
|
|
22353
|
+
tone,
|
|
22354
|
+
depth: Math.max(parentDepth, childDepth),
|
|
22355
|
+
deferUntilComplete: parentDepth >= childDepth
|
|
22356
|
+
});
|
|
22261
22357
|
}
|
|
22262
22358
|
}
|
|
22263
22359
|
return { nodes, edges };
|
|
@@ -22277,7 +22373,9 @@ function toneColor4(tone, alpha = 1) {
|
|
|
22277
22373
|
function FunnelNode({
|
|
22278
22374
|
node,
|
|
22279
22375
|
active,
|
|
22280
|
-
stateValues = {}
|
|
22376
|
+
stateValues = {},
|
|
22377
|
+
drawing = false,
|
|
22378
|
+
progress = 1
|
|
22281
22379
|
}) {
|
|
22282
22380
|
const x0 = node.cx - node.w / 2;
|
|
22283
22381
|
const y0 = node.cy - node.h / 2;
|
|
@@ -22292,12 +22390,79 @@ function FunnelNode({
|
|
|
22292
22390
|
const stageCount = stages.length || 1;
|
|
22293
22391
|
const gap = 4;
|
|
22294
22392
|
const stageH = (canvasH - gap * (stageCount - 1)) / stageCount;
|
|
22393
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
22394
|
+
const \u5207\u308A\u629C\u304Did = `cdl-funnel-draw-${react.useId().replace(/[^A-Za-z0-9_-]/g, "")}`;
|
|
22395
|
+
const \u6BB5\u306E\u4E0B\u7AEF\u306E\u5272\u5408 = (idx) => {
|
|
22396
|
+
if (canvasH <= 0) return 0;
|
|
22397
|
+
return ((idx + 1) * stageH + idx * gap) / canvasH;
|
|
22398
|
+
};
|
|
22399
|
+
const \u6BB5\u304C\u51FA\u5207\u3063\u305F = (idx) => !drawing || \u4F38\u3073 >= \u6BB5\u306E\u4E0B\u7AEF\u306E\u5272\u5408(idx);
|
|
22295
22400
|
const widthAtStep = (step) => {
|
|
22296
22401
|
const topRatio = 1;
|
|
22297
22402
|
const bottomRatio = 0.35;
|
|
22298
22403
|
const t = step / stageCount;
|
|
22299
22404
|
return canvasW * (topRatio + (bottomRatio - topRatio) * t);
|
|
22300
22405
|
};
|
|
22406
|
+
const \u6BB5 = stages.map((s, idx) => {
|
|
22407
|
+
const prev = idx > 0 ? stages[idx - 1] : null;
|
|
22408
|
+
const dropRate = prev && prev.count > 0 ? (prev.count - s.count) / prev.count * 100 : 0;
|
|
22409
|
+
const y = PAD_TOP + idx * (stageH + gap);
|
|
22410
|
+
const topW = widthAtStep(idx);
|
|
22411
|
+
const bottomW = widthAtStep(idx + 1);
|
|
22412
|
+
const cx = PAD_LEFT + canvasW / 2;
|
|
22413
|
+
const topX = cx - topW / 2;
|
|
22414
|
+
const bottomX = cx - bottomW / 2;
|
|
22415
|
+
const points = `${topX},${y} ${topX + topW},${y} ${bottomX + bottomW},${y + stageH} ${bottomX},${y + stageH}`;
|
|
22416
|
+
const tone = toneByIndex(idx);
|
|
22417
|
+
const legendX = PAD_LEFT + canvasW + 24;
|
|
22418
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
22419
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22420
|
+
"polygon",
|
|
22421
|
+
{
|
|
22422
|
+
"data-cdl-role": "funnel-stage",
|
|
22423
|
+
"data-cdl-unresolved": s.unresolved ? "true" : void 0,
|
|
22424
|
+
points,
|
|
22425
|
+
fill: tone,
|
|
22426
|
+
fillOpacity: 0.9,
|
|
22427
|
+
stroke: tone,
|
|
22428
|
+
strokeWidth: 0
|
|
22429
|
+
}
|
|
22430
|
+
),
|
|
22431
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22432
|
+
"text",
|
|
22433
|
+
{
|
|
22434
|
+
x: cx,
|
|
22435
|
+
y: y + stageH / 2 + 5,
|
|
22436
|
+
fontSize: 14,
|
|
22437
|
+
fontWeight: 700,
|
|
22438
|
+
textAnchor: "middle",
|
|
22439
|
+
fill: "var(--cdl-node-fill, #ffffff)",
|
|
22440
|
+
children: s.title
|
|
22441
|
+
}
|
|
22442
|
+
),
|
|
22443
|
+
\u6BB5\u304C\u51FA\u5207\u3063\u305F(idx) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
22444
|
+
"text",
|
|
22445
|
+
{
|
|
22446
|
+
x: legendX,
|
|
22447
|
+
y: y + stageH / 2 - 2,
|
|
22448
|
+
fontSize: 13,
|
|
22449
|
+
fontWeight: 700,
|
|
22450
|
+
fill: "var(--cdl-text, #1a1f2a)",
|
|
22451
|
+
children: s.count.toLocaleString()
|
|
22452
|
+
}
|
|
22453
|
+
),
|
|
22454
|
+
\u6BB5\u304C\u51FA\u5207\u3063\u305F(idx) && prev && /* @__PURE__ */ jsxRuntime.jsx(
|
|
22455
|
+
"text",
|
|
22456
|
+
{
|
|
22457
|
+
x: legendX,
|
|
22458
|
+
y: y + stageH / 2 + 14,
|
|
22459
|
+
fontSize: 11,
|
|
22460
|
+
fill: dropRate > 0 ? "var(--cdl-text-dim, #5a6270)" : "var(--cdl-text-mute, #8a8678)",
|
|
22461
|
+
children: dropRate > 0 ? `\u2193 ${dropRate.toFixed(1)}%` : "\xB10%"
|
|
22462
|
+
}
|
|
22463
|
+
)
|
|
22464
|
+
] }, `stage-${s.id}`);
|
|
22465
|
+
});
|
|
22301
22466
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
22302
22467
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22303
22468
|
"rect",
|
|
@@ -22313,66 +22478,8 @@ function FunnelNode({
|
|
|
22313
22478
|
strokeWidth: active ? 3 : 1.25
|
|
22314
22479
|
}
|
|
22315
22480
|
),
|
|
22316
|
-
|
|
22317
|
-
|
|
22318
|
-
const dropRate = prev && prev.count > 0 ? (prev.count - s.count) / prev.count * 100 : 0;
|
|
22319
|
-
const y = PAD_TOP + idx * (stageH + gap);
|
|
22320
|
-
const topW = widthAtStep(idx);
|
|
22321
|
-
const bottomW = widthAtStep(idx + 1);
|
|
22322
|
-
const cx = PAD_LEFT + canvasW / 2;
|
|
22323
|
-
const topX = cx - topW / 2;
|
|
22324
|
-
const bottomX = cx - bottomW / 2;
|
|
22325
|
-
const points = `${topX},${y} ${topX + topW},${y} ${bottomX + bottomW},${y + stageH} ${bottomX},${y + stageH}`;
|
|
22326
|
-
const tone = toneByIndex(idx);
|
|
22327
|
-
const legendX = PAD_LEFT + canvasW + 24;
|
|
22328
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
22329
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22330
|
-
"polygon",
|
|
22331
|
-
{
|
|
22332
|
-
"data-cdl-role": "funnel-stage",
|
|
22333
|
-
"data-cdl-unresolved": s.unresolved ? "true" : void 0,
|
|
22334
|
-
points,
|
|
22335
|
-
fill: tone,
|
|
22336
|
-
fillOpacity: 0.9,
|
|
22337
|
-
stroke: tone,
|
|
22338
|
-
strokeWidth: 0
|
|
22339
|
-
}
|
|
22340
|
-
),
|
|
22341
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22342
|
-
"text",
|
|
22343
|
-
{
|
|
22344
|
-
x: cx,
|
|
22345
|
-
y: y + stageH / 2 + 5,
|
|
22346
|
-
fontSize: 14,
|
|
22347
|
-
fontWeight: 700,
|
|
22348
|
-
textAnchor: "middle",
|
|
22349
|
-
fill: "var(--cdl-node-fill, #ffffff)",
|
|
22350
|
-
children: s.title
|
|
22351
|
-
}
|
|
22352
|
-
),
|
|
22353
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22354
|
-
"text",
|
|
22355
|
-
{
|
|
22356
|
-
x: legendX,
|
|
22357
|
-
y: y + stageH / 2 - 2,
|
|
22358
|
-
fontSize: 13,
|
|
22359
|
-
fontWeight: 700,
|
|
22360
|
-
fill: "var(--cdl-text, #1a1f2a)",
|
|
22361
|
-
children: s.count.toLocaleString()
|
|
22362
|
-
}
|
|
22363
|
-
),
|
|
22364
|
-
prev && /* @__PURE__ */ jsxRuntime.jsx(
|
|
22365
|
-
"text",
|
|
22366
|
-
{
|
|
22367
|
-
x: legendX,
|
|
22368
|
-
y: y + stageH / 2 + 14,
|
|
22369
|
-
fontSize: 11,
|
|
22370
|
-
fill: dropRate > 0 ? "var(--cdl-text-dim, #5a6270)" : "var(--cdl-text-mute, #8a8678)",
|
|
22371
|
-
children: dropRate > 0 ? `\u2193 ${dropRate.toFixed(1)}%` : "\xB10%"
|
|
22372
|
-
}
|
|
22373
|
-
)
|
|
22374
|
-
] }, `stage-${s.id}`);
|
|
22375
|
-
})
|
|
22481
|
+
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 }) }) }),
|
|
22482
|
+
drawing ? /* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: `url(#${\u5207\u308A\u629C\u304Did})`, children: \u6BB5 }) : \u6BB5
|
|
22376
22483
|
] });
|
|
22377
22484
|
}
|
|
22378
22485
|
var TONE_ORDER = [
|
|
@@ -22558,7 +22665,9 @@ function \u7BB1\u306E\u6587\u5B57({
|
|
|
22558
22665
|
function TreeNode({
|
|
22559
22666
|
node,
|
|
22560
22667
|
active,
|
|
22561
|
-
stateValues = {}
|
|
22668
|
+
stateValues = {},
|
|
22669
|
+
drawing = false,
|
|
22670
|
+
progress = 1
|
|
22562
22671
|
}) {
|
|
22563
22672
|
const x0 = node.cx - node.w / 2;
|
|
22564
22673
|
const y0 = node.cy - node.h / 2;
|
|
@@ -22571,6 +22680,9 @@ function TreeNode({
|
|
|
22571
22680
|
const canvasW = node.w - PAD_LEFT - PAD_RIGHT;
|
|
22572
22681
|
const canvasH = node.h - PAD_TOP - PAD_BOTTOM;
|
|
22573
22682
|
const layout2 = computeTreeLayout(treeNodes, canvasW, canvasH);
|
|
22683
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
22684
|
+
const \u6700\u5927\u6DF1\u3055 = layout2.nodes.reduce((m, n) => Math.max(m, n.depth), 0);
|
|
22685
|
+
const \u7BB1\u304C\u51FA\u308B = (\u6DF1\u3055) => !drawing || \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, \u6DF1\u3055, \u6700\u5927\u6DF1\u3055) >= 1;
|
|
22574
22686
|
const depthColors = [TONE.accent, TONE.teal, TONE.success, TONE.warning, TONE.info];
|
|
22575
22687
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
22576
22688
|
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "0%", y2: "100%", children: [
|
|
@@ -22598,6 +22710,7 @@ function TreeNode({
|
|
|
22598
22710
|
const y2 = PAD_TOP + e.y2;
|
|
22599
22711
|
const midY = (y1 + y2) / 2;
|
|
22600
22712
|
const path = `M ${x1} ${y1} L ${x1} ${midY} L ${x2} ${midY} L ${x2} ${y2}`;
|
|
22713
|
+
const \u679D\u306E\u4F38\u3073 = e.deferUntilComplete ? \u4F38\u3073 >= 1 ? 1 : 0 : \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, e.depth, \u6700\u5927\u6DF1\u3055);
|
|
22601
22714
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
22602
22715
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22603
22716
|
"path",
|
|
@@ -22608,13 +22721,15 @@ function TreeNode({
|
|
|
22608
22721
|
stroke: TONE.accent,
|
|
22609
22722
|
strokeOpacity: 0.55,
|
|
22610
22723
|
strokeWidth: 1.5,
|
|
22611
|
-
strokeLinejoin: "round"
|
|
22724
|
+
strokeLinejoin: "round",
|
|
22725
|
+
...\u4F38\u3070\u3059dash(drawing, \u679D\u306E\u4F38\u3073)
|
|
22612
22726
|
}
|
|
22613
22727
|
),
|
|
22614
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x1, cy: midY, r: 2.5, fill: TONE.accent, fillOpacity: 0.75 })
|
|
22728
|
+
(!drawing || \u679D\u306E\u4F38\u3073 >= 1) && /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x1, cy: midY, r: 2.5, fill: TONE.accent, fillOpacity: 0.75 })
|
|
22615
22729
|
] }, `edge-${i}`);
|
|
22616
22730
|
}),
|
|
22617
22731
|
layout2.nodes.map((n) => {
|
|
22732
|
+
if (!\u7BB1\u304C\u51FA\u308B(n.depth)) return null;
|
|
22618
22733
|
const accent = depthColors[Math.min(n.depth, depthColors.length - 1)] ?? depthColors[0];
|
|
22619
22734
|
const isRoot = n.depth === 0;
|
|
22620
22735
|
const \u884C = \u7BB1\u306B\u7A4D\u3080(
|
|
@@ -22650,17 +22765,21 @@ function TreeNode({
|
|
|
22650
22765
|
\u7BB1\u306E\u9AD8\u3055: n.h,
|
|
22651
22766
|
fill: "var(--cdl-text-on-tone, #ffffff)",
|
|
22652
22767
|
\u540D\u524D\u306E\u592A\u3055: 700
|
|
22653
|
-
}) :
|
|
22654
|
-
|
|
22655
|
-
|
|
22656
|
-
|
|
22657
|
-
|
|
22658
|
-
|
|
22659
|
-
|
|
22660
|
-
|
|
22661
|
-
|
|
22662
|
-
|
|
22663
|
-
|
|
22768
|
+
}) : (
|
|
22769
|
+
// 補足が無くても幅に収める (#526)。 `箱の文字` を通らないこの経路だけが
|
|
22770
|
+
// 幅を見ておらず、長い名前が箱の外へ出ていた
|
|
22771
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22772
|
+
"text",
|
|
22773
|
+
{
|
|
22774
|
+
x: n.w / 2,
|
|
22775
|
+
y: n.h / 2 + 5,
|
|
22776
|
+
fontSize: 13,
|
|
22777
|
+
fontWeight: 700,
|
|
22778
|
+
textAnchor: "middle",
|
|
22779
|
+
fill: "var(--cdl-text-on-tone, #ffffff)",
|
|
22780
|
+
children: \u5E45\u3067\u5207\u308B(n.title, 13, \u4F7F\u3048\u308B\u5E45(n.w))
|
|
22781
|
+
}
|
|
22782
|
+
)
|
|
22664
22783
|
)
|
|
22665
22784
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
22666
22785
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -22693,7 +22812,7 @@ function TreeNode({
|
|
|
22693
22812
|
fontWeight: 600,
|
|
22694
22813
|
textAnchor: "middle",
|
|
22695
22814
|
fill: "var(--cdl-chip-text, #1a1f2a)",
|
|
22696
|
-
children: n.title
|
|
22815
|
+
children: \u5E45\u3067\u5207\u308B(n.title, 12, \u4F7F\u3048\u308B\u5E45(n.w))
|
|
22697
22816
|
}
|
|
22698
22817
|
)
|
|
22699
22818
|
] })
|
|
@@ -22795,6 +22914,7 @@ function computeTreeLayout(treeNodes, canvasW, canvasH) {
|
|
|
22795
22914
|
}
|
|
22796
22915
|
}
|
|
22797
22916
|
const hById = new Map(nodes.map((n) => [n.id, n.h]));
|
|
22917
|
+
const \u6BB5\u6570 = new Map(nodes.map((n) => [n.id, n.depth]));
|
|
22798
22918
|
const edges = [];
|
|
22799
22919
|
for (const n of treeNodes) {
|
|
22800
22920
|
if (!n.parent) continue;
|
|
@@ -22803,14 +22923,25 @@ function computeTreeLayout(treeNodes, canvasW, canvasH) {
|
|
|
22803
22923
|
if (!parent || !child) continue;
|
|
22804
22924
|
const parentH = hById.get(n.parent) ?? nodeH;
|
|
22805
22925
|
const childH = hById.get(n.id) ?? nodeH;
|
|
22806
|
-
|
|
22926
|
+
const parentDepth = \u6BB5\u6570.get(n.parent) ?? 0;
|
|
22927
|
+
const childDepth = \u6BB5\u6570.get(n.id) ?? 1;
|
|
22928
|
+
edges.push({
|
|
22929
|
+
x1: parent.x,
|
|
22930
|
+
y1: parent.y + parentH / 2,
|
|
22931
|
+
x2: child.x,
|
|
22932
|
+
y2: child.y - childH / 2,
|
|
22933
|
+
depth: Math.max(parentDepth, childDepth),
|
|
22934
|
+
deferUntilComplete: parentDepth >= childDepth
|
|
22935
|
+
});
|
|
22807
22936
|
}
|
|
22808
22937
|
return { nodes, edges };
|
|
22809
22938
|
}
|
|
22810
22939
|
function UserJourneyNode({
|
|
22811
22940
|
node,
|
|
22812
22941
|
active,
|
|
22813
|
-
stateValues = {}
|
|
22942
|
+
stateValues = {},
|
|
22943
|
+
drawing = false,
|
|
22944
|
+
progress = 1
|
|
22814
22945
|
}) {
|
|
22815
22946
|
const x0 = node.cx - node.w / 2;
|
|
22816
22947
|
const y0 = node.cy - node.h / 2;
|
|
@@ -22848,6 +22979,12 @@ function UserJourneyNode({
|
|
|
22848
22979
|
const xAt = (idx) => PAD_LEFT + (steps.length <= 1 ? canvasW / 2 : colW / 2 + colW * idx);
|
|
22849
22980
|
const yAt = (emotion) => PAD_TOP + rowH / 2 + (4 - emotionScore[emotion]) * rowH;
|
|
22850
22981
|
const pts = steps.map((s, i) => ({ x: xAt(i), y: yAt(s.emotion) }));
|
|
22982
|
+
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
22983
|
+
const \u6BB5\u307E\u3067\u306E\u5272\u5408 = \u30D9\u30B8\u30A8\u306E\u7D2F\u7A4D\u5272\u5408(pts, (\u524D, \u5F8C) => {
|
|
22984
|
+
const midX = (\u524D.x + \u5F8C.x) / 2;
|
|
22985
|
+
return [{ x: midX, y: \u524D.y }, { x: midX, y: \u5F8C.y }];
|
|
22986
|
+
});
|
|
22987
|
+
const \u7DDA\u306E\u5148\u304C\u5C4A\u3044\u305F = (idx) => !drawing || \u4F38\u3073 >= (\u6BB5\u307E\u3067\u306E\u5272\u5408[idx] ?? 0);
|
|
22851
22988
|
const smoothPath = pts.length > 1 ? pts.reduce((acc, p, i) => {
|
|
22852
22989
|
if (i === 0) return `M ${p.x} ${p.y}`;
|
|
22853
22990
|
const prev = pts[i - 1];
|
|
@@ -22928,7 +23065,8 @@ function UserJourneyNode({
|
|
|
22928
23065
|
stroke: "var(--cdl-tone-accent, #2d6a8f)",
|
|
22929
23066
|
strokeOpacity: 0.18,
|
|
22930
23067
|
strokeWidth: 10,
|
|
22931
|
-
strokeLinecap: "round"
|
|
23068
|
+
strokeLinecap: "round",
|
|
23069
|
+
...\u4F38\u3070\u3059dash(drawing, \u4F38\u3073)
|
|
22932
23070
|
}
|
|
22933
23071
|
),
|
|
22934
23072
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -22940,11 +23078,12 @@ function UserJourneyNode({
|
|
|
22940
23078
|
stroke: "var(--cdl-tone-accent, #2d6a8f)",
|
|
22941
23079
|
strokeWidth: 2.75,
|
|
22942
23080
|
strokeLinejoin: "round",
|
|
22943
|
-
strokeLinecap: "round"
|
|
23081
|
+
strokeLinecap: "round",
|
|
23082
|
+
...\u4F38\u3070\u3059dash(drawing, \u4F38\u3073)
|
|
22944
23083
|
}
|
|
22945
23084
|
)
|
|
22946
23085
|
] }),
|
|
22947
|
-
steps.map((s, idx) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
23086
|
+
steps.map((s, idx) => !\u7DDA\u306E\u5148\u304C\u5C4A\u3044\u305F(idx) ? null : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
22948
23087
|
"g",
|
|
22949
23088
|
{
|
|
22950
23089
|
"data-cdl-role": "journey-step",
|
|
@@ -26854,17 +26993,62 @@ function CdlNodeView({
|
|
|
26854
26993
|
}
|
|
26855
26994
|
);
|
|
26856
26995
|
case "gantt-timeline":
|
|
26857
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
26996
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
26997
|
+
GanttNode,
|
|
26998
|
+
{
|
|
26999
|
+
node: resolvedNode,
|
|
27000
|
+
active,
|
|
27001
|
+
stateValues,
|
|
27002
|
+
drawing,
|
|
27003
|
+
progress
|
|
27004
|
+
}
|
|
27005
|
+
);
|
|
26858
27006
|
case "mind-map":
|
|
26859
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27007
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27008
|
+
MindMapNode,
|
|
27009
|
+
{
|
|
27010
|
+
node: resolvedNode,
|
|
27011
|
+
active,
|
|
27012
|
+
stateValues,
|
|
27013
|
+
drawing,
|
|
27014
|
+
progress
|
|
27015
|
+
}
|
|
27016
|
+
);
|
|
26860
27017
|
case "funnel-stages":
|
|
26861
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27018
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27019
|
+
FunnelNode,
|
|
27020
|
+
{
|
|
27021
|
+
node: resolvedNode,
|
|
27022
|
+
active,
|
|
27023
|
+
stateValues,
|
|
27024
|
+
drawing,
|
|
27025
|
+
progress
|
|
27026
|
+
}
|
|
27027
|
+
);
|
|
26862
27028
|
case "quadrant-matrix":
|
|
26863
27029
|
return /* @__PURE__ */ jsxRuntime.jsx(QuadrantNode, { node: resolvedNode, active, stateValues });
|
|
26864
27030
|
case "tree-hierarchy":
|
|
26865
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27031
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27032
|
+
TreeNode,
|
|
27033
|
+
{
|
|
27034
|
+
node: resolvedNode,
|
|
27035
|
+
active,
|
|
27036
|
+
stateValues,
|
|
27037
|
+
drawing,
|
|
27038
|
+
progress
|
|
27039
|
+
}
|
|
27040
|
+
);
|
|
26866
27041
|
case "journey-map":
|
|
26867
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27042
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27043
|
+
UserJourneyNode,
|
|
27044
|
+
{
|
|
27045
|
+
node: resolvedNode,
|
|
27046
|
+
active,
|
|
27047
|
+
stateValues,
|
|
27048
|
+
drawing,
|
|
27049
|
+
progress
|
|
27050
|
+
}
|
|
27051
|
+
);
|
|
26868
27052
|
case "shape-file":
|
|
26869
27053
|
return /* @__PURE__ */ jsxRuntime.jsx(ShapeFileNode, { node: resolvedNode, active });
|
|
26870
27054
|
case "shape-folder":
|