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