@cardenelabs/cdl 0.13.1 → 0.14.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 +28 -1
- package/dist/index.cjs +6103 -6056
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +6103 -6056
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +188 -143
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +188 -143
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/src/kinds/mind-map.tsx +52 -22
- package/src/kinds/tree.tsx +51 -21
- package/src/visual-validate.ts +90 -4
package/dist/react.js
CHANGED
|
@@ -6646,20 +6646,20 @@ function ChartLineNode({
|
|
|
6646
6646
|
const x0 = node.cx - node.w / 2;
|
|
6647
6647
|
const y0 = node.cy - node.h / 2;
|
|
6648
6648
|
const data = resolveChartData(node.chartData ?? [], stateValues);
|
|
6649
|
-
const
|
|
6650
|
-
const
|
|
6651
|
-
const
|
|
6652
|
-
const
|
|
6653
|
-
const canvasW = node.w -
|
|
6654
|
-
const canvasH = node.h -
|
|
6649
|
+
const PAD_TOP2 = 36;
|
|
6650
|
+
const PAD_RIGHT2 = 40;
|
|
6651
|
+
const PAD_BOTTOM2 = 56;
|
|
6652
|
+
const PAD_LEFT2 = 72;
|
|
6653
|
+
const canvasW = node.w - PAD_LEFT2 - PAD_RIGHT2;
|
|
6654
|
+
const canvasH = node.h - PAD_TOP2 - PAD_BOTTOM2;
|
|
6655
6655
|
const values = data.map((d) => d.value);
|
|
6656
6656
|
const vMin = values.length > 0 ? Math.min(...values) : 0;
|
|
6657
6657
|
const vMax = values.length > 0 ? Math.max(...values) : 1;
|
|
6658
6658
|
const vRange = vMax - vMin || 1;
|
|
6659
6659
|
const LABEL_ROOM = 20;
|
|
6660
|
-
const plotTop =
|
|
6660
|
+
const plotTop = PAD_TOP2 + LABEL_ROOM;
|
|
6661
6661
|
const plotH = Math.max(canvasH - LABEL_ROOM * 2, 1);
|
|
6662
|
-
const xAt = (idx) =>
|
|
6662
|
+
const xAt = (idx) => PAD_LEFT2 + (data.length <= 1 ? canvasW / 2 : canvasW * idx / (data.length - 1));
|
|
6663
6663
|
const yAt = (v) => plotTop + plotH - (v - vMin) / vRange * plotH;
|
|
6664
6664
|
const points = data.map((d, idx) => `${xAt(idx)},${yAt(d.value)}`).join(" ");
|
|
6665
6665
|
const \u70B9\u307E\u3067\u306E\u9577\u3055 = [];
|
|
@@ -6704,9 +6704,9 @@ function ChartLineNode({
|
|
|
6704
6704
|
/* @__PURE__ */ jsx(
|
|
6705
6705
|
"line",
|
|
6706
6706
|
{
|
|
6707
|
-
x1:
|
|
6707
|
+
x1: PAD_LEFT2,
|
|
6708
6708
|
y1: t.y,
|
|
6709
|
-
x2:
|
|
6709
|
+
x2: PAD_LEFT2 + canvasW,
|
|
6710
6710
|
y2: t.y,
|
|
6711
6711
|
stroke: "var(--cdl-divider, #d4d4d8)",
|
|
6712
6712
|
strokeWidth: 0.75,
|
|
@@ -6717,7 +6717,7 @@ function ChartLineNode({
|
|
|
6717
6717
|
/* @__PURE__ */ jsx(
|
|
6718
6718
|
"text",
|
|
6719
6719
|
{
|
|
6720
|
-
x:
|
|
6720
|
+
x: PAD_LEFT2 - 8,
|
|
6721
6721
|
y: t.y + 4,
|
|
6722
6722
|
fontSize: 11,
|
|
6723
6723
|
textAnchor: "end",
|
|
@@ -6729,9 +6729,9 @@ function ChartLineNode({
|
|
|
6729
6729
|
/* @__PURE__ */ jsx(
|
|
6730
6730
|
"line",
|
|
6731
6731
|
{
|
|
6732
|
-
x1:
|
|
6732
|
+
x1: PAD_LEFT2,
|
|
6733
6733
|
y1: plotTop + plotH,
|
|
6734
|
-
x2:
|
|
6734
|
+
x2: PAD_LEFT2 + canvasW,
|
|
6735
6735
|
y2: plotTop + plotH,
|
|
6736
6736
|
stroke: "var(--cdl-text-mute, #8a8678)",
|
|
6737
6737
|
strokeWidth: 1.25
|
|
@@ -6740,9 +6740,9 @@ function ChartLineNode({
|
|
|
6740
6740
|
/* @__PURE__ */ jsx(
|
|
6741
6741
|
"line",
|
|
6742
6742
|
{
|
|
6743
|
-
x1:
|
|
6743
|
+
x1: PAD_LEFT2,
|
|
6744
6744
|
y1: plotTop,
|
|
6745
|
-
x2:
|
|
6745
|
+
x2: PAD_LEFT2,
|
|
6746
6746
|
y2: plotTop + plotH,
|
|
6747
6747
|
stroke: "var(--cdl-text-mute, #8a8678)",
|
|
6748
6748
|
strokeWidth: 1.25
|
|
@@ -6810,7 +6810,7 @@ function ChartLineNode({
|
|
|
6810
6810
|
"text",
|
|
6811
6811
|
{
|
|
6812
6812
|
x: cx,
|
|
6813
|
-
y:
|
|
6813
|
+
y: PAD_TOP2 + canvasH + 20,
|
|
6814
6814
|
fontSize: 12,
|
|
6815
6815
|
textAnchor: "middle",
|
|
6816
6816
|
fill: "var(--cdl-text-dim, #5a6270)",
|
|
@@ -6833,13 +6833,13 @@ function ChartPieNode({
|
|
|
6833
6833
|
const y0 = node.cy - node.h / 2;
|
|
6834
6834
|
const data = resolveChartData(node.chartData ?? [], stateValues);
|
|
6835
6835
|
const total = data.reduce((acc, d) => acc + d.value, 0) || 1;
|
|
6836
|
-
const
|
|
6837
|
-
const
|
|
6838
|
-
const chartAreaH = node.h -
|
|
6836
|
+
const PAD_TOP2 = 20;
|
|
6837
|
+
const PAD_BOTTOM2 = 20;
|
|
6838
|
+
const chartAreaH = node.h - PAD_TOP2 - PAD_BOTTOM2;
|
|
6839
6839
|
const pieAreaW = node.w * 0.5;
|
|
6840
6840
|
const radius = Math.min(pieAreaW, chartAreaH) / 2 - 12;
|
|
6841
6841
|
const cx = pieAreaW / 2;
|
|
6842
|
-
const cy =
|
|
6842
|
+
const cy = PAD_TOP2 + chartAreaH / 2;
|
|
6843
6843
|
let cumAngle = -Math.PI / 2;
|
|
6844
6844
|
let cumFrac = 0;
|
|
6845
6845
|
const slices = data.map((d) => {
|
|
@@ -6863,7 +6863,7 @@ function ChartPieNode({
|
|
|
6863
6863
|
const \u958B\u304D\u59CB\u3081\u305F = (startFrac) => !drawing || \u958B\u304D > startFrac;
|
|
6864
6864
|
const legendX = pieAreaW + 8;
|
|
6865
6865
|
const legendGap = Math.min(28, chartAreaH / Math.max(data.length, 1));
|
|
6866
|
-
const legendStartY =
|
|
6866
|
+
const legendStartY = PAD_TOP2 + (chartAreaH - legendGap * data.length) / 2 + legendGap / 2;
|
|
6867
6867
|
return /* @__PURE__ */ jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
6868
6868
|
/* @__PURE__ */ jsx(
|
|
6869
6869
|
"rect",
|
|
@@ -6955,26 +6955,26 @@ function ChartBarNode({
|
|
|
6955
6955
|
const x0 = node.cx - node.w / 2;
|
|
6956
6956
|
const y0 = node.cy - node.h / 2;
|
|
6957
6957
|
const data = resolveChartData(node.chartData ?? [], stateValues);
|
|
6958
|
-
const
|
|
6959
|
-
const
|
|
6960
|
-
const
|
|
6961
|
-
const
|
|
6962
|
-
const canvasW = node.w -
|
|
6963
|
-
const canvasH = node.h -
|
|
6958
|
+
const PAD_TOP2 = 20;
|
|
6959
|
+
const PAD_RIGHT2 = 24;
|
|
6960
|
+
const PAD_BOTTOM2 = 44;
|
|
6961
|
+
const PAD_LEFT2 = 60;
|
|
6962
|
+
const canvasW = node.w - PAD_LEFT2 - PAD_RIGHT2;
|
|
6963
|
+
const canvasH = node.h - PAD_TOP2 - PAD_BOTTOM2;
|
|
6964
6964
|
const vMax = data.length > 0 ? Math.max(...data.map((d) => d.value)) : 1;
|
|
6965
6965
|
const vRange = vMax || 1;
|
|
6966
6966
|
const barGap = 10;
|
|
6967
6967
|
const barCount = data.length || 1;
|
|
6968
6968
|
const barW = (canvasW - barGap * (barCount + 1)) / barCount;
|
|
6969
|
-
const yAt = (v) =>
|
|
6970
|
-
const xAt = (idx) =>
|
|
6969
|
+
const yAt = (v) => PAD_TOP2 + canvasH - v / vRange * canvasH;
|
|
6970
|
+
const xAt = (idx) => PAD_LEFT2 + barGap + idx * (barW + barGap);
|
|
6971
6971
|
const gridCount = 4;
|
|
6972
6972
|
const gridTicks = Array.from({ length: gridCount + 1 }, (_, i) => {
|
|
6973
6973
|
const v = vMax * i / gridCount;
|
|
6974
6974
|
return { y: yAt(v), value: v };
|
|
6975
6975
|
});
|
|
6976
6976
|
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
6977
|
-
const \u6A2A\u8EF8\u306Ey =
|
|
6977
|
+
const \u6A2A\u8EF8\u306Ey = PAD_TOP2 + canvasH;
|
|
6978
6978
|
return /* @__PURE__ */ jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
6979
6979
|
/* @__PURE__ */ jsx(
|
|
6980
6980
|
"rect",
|
|
@@ -6994,9 +6994,9 @@ function ChartBarNode({
|
|
|
6994
6994
|
/* @__PURE__ */ jsx(
|
|
6995
6995
|
"line",
|
|
6996
6996
|
{
|
|
6997
|
-
x1:
|
|
6997
|
+
x1: PAD_LEFT2,
|
|
6998
6998
|
y1: t.y,
|
|
6999
|
-
x2:
|
|
6999
|
+
x2: PAD_LEFT2 + canvasW,
|
|
7000
7000
|
y2: t.y,
|
|
7001
7001
|
stroke: "var(--cdl-divider, #d4d4d8)",
|
|
7002
7002
|
strokeWidth: 0.75,
|
|
@@ -7007,7 +7007,7 @@ function ChartBarNode({
|
|
|
7007
7007
|
/* @__PURE__ */ jsx(
|
|
7008
7008
|
"text",
|
|
7009
7009
|
{
|
|
7010
|
-
x:
|
|
7010
|
+
x: PAD_LEFT2 - 8,
|
|
7011
7011
|
y: t.y + 4,
|
|
7012
7012
|
fontSize: 11,
|
|
7013
7013
|
textAnchor: "end",
|
|
@@ -7019,10 +7019,10 @@ function ChartBarNode({
|
|
|
7019
7019
|
/* @__PURE__ */ jsx(
|
|
7020
7020
|
"line",
|
|
7021
7021
|
{
|
|
7022
|
-
x1:
|
|
7023
|
-
y1:
|
|
7024
|
-
x2:
|
|
7025
|
-
y2:
|
|
7022
|
+
x1: PAD_LEFT2,
|
|
7023
|
+
y1: PAD_TOP2 + canvasH,
|
|
7024
|
+
x2: PAD_LEFT2 + canvasW,
|
|
7025
|
+
y2: PAD_TOP2 + canvasH,
|
|
7026
7026
|
stroke: "var(--cdl-text-mute, #8a8678)",
|
|
7027
7027
|
strokeWidth: 1.25
|
|
7028
7028
|
}
|
|
@@ -7030,7 +7030,7 @@ function ChartBarNode({
|
|
|
7030
7030
|
data.map((d, idx) => {
|
|
7031
7031
|
const bx = xAt(idx);
|
|
7032
7032
|
const by = yAt(d.value);
|
|
7033
|
-
const bh =
|
|
7033
|
+
const bh = PAD_TOP2 + canvasH - by;
|
|
7034
7034
|
const \u898B\u3048\u3066\u3044\u308B\u982D = \u6A2A\u8EF8\u306Ey - (\u6A2A\u8EF8\u306Ey - by) * \u4F38\u3073;
|
|
7035
7035
|
const \u68D2 = /* @__PURE__ */ jsx(
|
|
7036
7036
|
"rect",
|
|
@@ -7063,7 +7063,7 @@ function ChartBarNode({
|
|
|
7063
7063
|
"text",
|
|
7064
7064
|
{
|
|
7065
7065
|
x: bx + barW / 2,
|
|
7066
|
-
y:
|
|
7066
|
+
y: PAD_TOP2 + canvasH + 18,
|
|
7067
7067
|
fontSize: 12,
|
|
7068
7068
|
textAnchor: "middle",
|
|
7069
7069
|
fill: "var(--cdl-text-dim, #5a6270)",
|
|
@@ -7084,12 +7084,12 @@ function GanttNode({
|
|
|
7084
7084
|
const x0 = node.cx - node.w / 2;
|
|
7085
7085
|
const y0 = node.cy - node.h / 2;
|
|
7086
7086
|
const tasks = resolveGanttData(node.ganttData ?? [], stateValues);
|
|
7087
|
-
const
|
|
7088
|
-
const
|
|
7089
|
-
const
|
|
7090
|
-
const
|
|
7091
|
-
const canvasW = node.w -
|
|
7092
|
-
const canvasH = node.h -
|
|
7087
|
+
const PAD_TOP2 = 32;
|
|
7088
|
+
const PAD_RIGHT2 = 48;
|
|
7089
|
+
const PAD_BOTTOM2 = 44;
|
|
7090
|
+
const PAD_LEFT2 = 156;
|
|
7091
|
+
const canvasW = node.w - PAD_LEFT2 - PAD_RIGHT2;
|
|
7092
|
+
const canvasH = node.h - PAD_TOP2 - PAD_BOTTOM2;
|
|
7093
7093
|
const rowGap = 20;
|
|
7094
7094
|
const rowCount = tasks.length || 1;
|
|
7095
7095
|
const rowH = Math.max(28, (canvasH - rowGap * (rowCount + 1)) / rowCount);
|
|
@@ -7116,8 +7116,8 @@ function GanttNode({
|
|
|
7116
7116
|
const \u76EE\u76DB\u308A\u306E\u4E0A\u9650 = 200;
|
|
7117
7117
|
const \u76EE\u76DB\u308A\u306E\u9593\u9694 = Math.max(1, Math.ceil(maxIdx / \u76EE\u76DB\u308A\u306E\u4E0A\u9650));
|
|
7118
7118
|
const \u76EE\u76DB\u308A\u306E\u672C\u6570 = Math.ceil(maxIdx / \u76EE\u76DB\u308A\u306E\u9593\u9694);
|
|
7119
|
-
const xAt = (idx) =>
|
|
7120
|
-
const yAt = (row) =>
|
|
7119
|
+
const xAt = (idx) => PAD_LEFT2 + idx * cellW;
|
|
7120
|
+
const yAt = (row) => PAD_TOP2 + rowGap + row * (rowH + rowGap);
|
|
7121
7121
|
const \u540D\u524D = { \u6574\u6570\u306E\u958B\u59CB: /* @__PURE__ */ new Map(), \u6574\u6570\u306E\u7D42\u4E86: /* @__PURE__ */ new Map(), \u7AEF\u6570\u306E\u958B\u59CB: /* @__PURE__ */ new Map(), \u7AEF\u6570\u306E\u7D42\u4E86: /* @__PURE__ */ new Map() };
|
|
7122
7122
|
const \u7F6E\u304F = (\u8868, \u4F4D\u7F6E, label) => {
|
|
7123
7123
|
if (label !== "" && Number.isFinite(\u4F4D\u7F6E) && !\u8868.has(\u4F4D\u7F6E)) \u8868.set(\u4F4D\u7F6E, label);
|
|
@@ -7162,9 +7162,9 @@ function GanttNode({
|
|
|
7162
7162
|
{
|
|
7163
7163
|
"data-cdl-role": "gantt-grid",
|
|
7164
7164
|
x1: xAt(i),
|
|
7165
|
-
y1:
|
|
7165
|
+
y1: PAD_TOP2,
|
|
7166
7166
|
x2: xAt(i),
|
|
7167
|
-
y2:
|
|
7167
|
+
y2: PAD_TOP2 + canvasH,
|
|
7168
7168
|
stroke: "var(--cdl-divider, #d4d4d8)",
|
|
7169
7169
|
strokeWidth: 0.75,
|
|
7170
7170
|
strokeDasharray: "3 3",
|
|
@@ -7176,7 +7176,7 @@ function GanttNode({
|
|
|
7176
7176
|
{
|
|
7177
7177
|
"data-cdl-role": "gantt-tick",
|
|
7178
7178
|
x: xAt(i) + cellW / 2,
|
|
7179
|
-
y:
|
|
7179
|
+
y: PAD_TOP2 + canvasH + 18,
|
|
7180
7180
|
fontSize: 11,
|
|
7181
7181
|
textAnchor: "middle",
|
|
7182
7182
|
fill: "var(--cdl-text-dim, #5a6270)",
|
|
@@ -7188,9 +7188,9 @@ function GanttNode({
|
|
|
7188
7188
|
"line",
|
|
7189
7189
|
{
|
|
7190
7190
|
x1: xAt(maxIdx),
|
|
7191
|
-
y1:
|
|
7191
|
+
y1: PAD_TOP2,
|
|
7192
7192
|
x2: xAt(maxIdx),
|
|
7193
|
-
y2:
|
|
7193
|
+
y2: PAD_TOP2 + canvasH,
|
|
7194
7194
|
stroke: "var(--cdl-divider, #d4d4d8)",
|
|
7195
7195
|
strokeWidth: 0.75,
|
|
7196
7196
|
opacity: 0.5
|
|
@@ -7199,7 +7199,7 @@ function GanttNode({
|
|
|
7199
7199
|
\u6574\u3048\u305F.map((t, row) => /* @__PURE__ */ jsx(
|
|
7200
7200
|
"text",
|
|
7201
7201
|
{
|
|
7202
|
-
x:
|
|
7202
|
+
x: PAD_LEFT2 - 12,
|
|
7203
7203
|
y: yAt(row) + rowH / 2 + 4,
|
|
7204
7204
|
fontSize: 12,
|
|
7205
7205
|
textAnchor: "end",
|
|
@@ -7356,6 +7356,24 @@ function \u7BB1\u306B\u7A4D\u3080(\u884C, \u7BB1\u306E\u5E45, \u7BB1\u306E\u9AD8
|
|
|
7356
7356
|
}
|
|
7357
7357
|
var MIND_TONES = ["accent", "teal", "success", "warning", "info", "error"];
|
|
7358
7358
|
var MIND_BOX_GAP = 24;
|
|
7359
|
+
var MIND_PAD = 40;
|
|
7360
|
+
function \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues = {}) {
|
|
7361
|
+
const mindData = node.mindData ? resolveMindData(node.mindData, stateValues) : void 0;
|
|
7362
|
+
if (!mindData) return void 0;
|
|
7363
|
+
return computeMindMapLayout(
|
|
7364
|
+
mindData,
|
|
7365
|
+
node.w / 2,
|
|
7366
|
+
node.h / 2,
|
|
7367
|
+
node.w - MIND_PAD * 2,
|
|
7368
|
+
node.h - MIND_PAD * 2
|
|
7369
|
+
);
|
|
7370
|
+
}
|
|
7371
|
+
function \u653E\u5C04\u306E\u884C(n) {
|
|
7372
|
+
return [
|
|
7373
|
+
{ \u5F79\u5272: "title", text: n.title, fontSize: n.isRoot ? 15 : 13 },
|
|
7374
|
+
{ \u5F79\u5272: "subtitle", text: n.subtitle ?? "", fontSize: 9 }
|
|
7375
|
+
];
|
|
7376
|
+
}
|
|
7359
7377
|
function MindMapNode({
|
|
7360
7378
|
node,
|
|
7361
7379
|
active,
|
|
@@ -7365,14 +7383,8 @@ function MindMapNode({
|
|
|
7365
7383
|
}) {
|
|
7366
7384
|
const x0 = node.cx - node.w / 2;
|
|
7367
7385
|
const y0 = node.cy - node.h / 2;
|
|
7368
|
-
const
|
|
7369
|
-
if (!
|
|
7370
|
-
const PAD = 40;
|
|
7371
|
-
const canvasCx = node.w / 2;
|
|
7372
|
-
const canvasCy = node.h / 2;
|
|
7373
|
-
const canvasW = node.w - PAD * 2;
|
|
7374
|
-
const canvasH = node.h - PAD * 2;
|
|
7375
|
-
const layout2 = computeMindMapLayout(mindData, canvasCx, canvasCy, canvasW, canvasH);
|
|
7386
|
+
const layout2 = \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues);
|
|
7387
|
+
if (!layout2) return /* @__PURE__ */ jsx("g", { transform: `translate(${x0} ${y0})` });
|
|
7376
7388
|
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
7377
7389
|
const \u6700\u5927\u6DF1\u3055 = layout2.nodes.reduce((m, n) => Math.max(m, n.depth), 0);
|
|
7378
7390
|
const \u7BB1\u304C\u51FA\u308B = (\u6DF1\u3055) => !drawing || \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, \u6DF1\u3055, \u6700\u5927\u6DF1\u3055) >= 1;
|
|
@@ -7410,16 +7422,11 @@ function MindMapNode({
|
|
|
7410
7422
|
}),
|
|
7411
7423
|
layout2.nodes.map((n) => {
|
|
7412
7424
|
if (!\u7BB1\u304C\u51FA\u308B(n.depth)) return null;
|
|
7413
|
-
const \
|
|
7414
|
-
|
|
7415
|
-
{ \u5F79\u5272: "title", text: n.title, fontSize: n.isRoot ? 15 : 13 },
|
|
7416
|
-
{ \u5F79\u5272: "subtitle", text: n.subtitle ?? "", fontSize: 9 }
|
|
7417
|
-
],
|
|
7418
|
-
n.w,
|
|
7419
|
-
n.h
|
|
7420
|
-
);
|
|
7425
|
+
const \u6750\u6599 = \u653E\u5C04\u306E\u884C(n);
|
|
7426
|
+
const \u884C = \u7BB1\u306B\u7A4D\u3080(\u6750\u6599, n.w, n.h);
|
|
7421
7427
|
const \u88DC\u8DB3\u3042\u308A = (n.subtitle ?? "").trim() !== "";
|
|
7422
|
-
const \
|
|
7428
|
+
const \u540D\u524D = \u6750\u6599[0];
|
|
7429
|
+
const \u53CE\u3081\u305F\u540D\u524D = \u88DC\u8DB3\u3042\u308A ? void 0 : \u5E45\u306B\u53CE\u3081\u308B(\u540D\u524D.text, \u540D\u524D.fontSize, \u4F7F\u3048\u308B\u5E45(n.w));
|
|
7423
7430
|
const \u6587\u5B57\u306E\u8272 = n.isRoot ? "var(--cdl-text-on-tone, #ffffff)" : "var(--cdl-chip-text, #1a1f2a)";
|
|
7424
7431
|
return /* @__PURE__ */ jsxs("g", { "data-cdl-unresolved": n.unresolved ? "true" : void 0, children: [
|
|
7425
7432
|
/* @__PURE__ */ jsx(
|
|
@@ -7698,13 +7705,13 @@ function FunnelNode({
|
|
|
7698
7705
|
const x0 = node.cx - node.w / 2;
|
|
7699
7706
|
const y0 = node.cy - node.h / 2;
|
|
7700
7707
|
const stages = resolveFunnelData(node.funnelData ?? [], stateValues);
|
|
7701
|
-
const
|
|
7702
|
-
const
|
|
7703
|
-
const
|
|
7704
|
-
const
|
|
7708
|
+
const PAD_TOP2 = 32;
|
|
7709
|
+
const PAD_RIGHT2 = 24;
|
|
7710
|
+
const PAD_BOTTOM2 = 32;
|
|
7711
|
+
const PAD_LEFT2 = 24;
|
|
7705
7712
|
const legendW = 160;
|
|
7706
|
-
const canvasW = node.w -
|
|
7707
|
-
const canvasH = node.h -
|
|
7713
|
+
const canvasW = node.w - PAD_LEFT2 - PAD_RIGHT2 - legendW;
|
|
7714
|
+
const canvasH = node.h - PAD_TOP2 - PAD_BOTTOM2;
|
|
7708
7715
|
const stageCount = stages.length || 1;
|
|
7709
7716
|
const gap = 4;
|
|
7710
7717
|
const stageH = (canvasH - gap * (stageCount - 1)) / stageCount;
|
|
@@ -7724,15 +7731,15 @@ function FunnelNode({
|
|
|
7724
7731
|
const \u6BB5 = stages.map((s, idx) => {
|
|
7725
7732
|
const prev = idx > 0 ? stages[idx - 1] : null;
|
|
7726
7733
|
const dropRate = prev && prev.count > 0 ? (prev.count - s.count) / prev.count * 100 : 0;
|
|
7727
|
-
const y =
|
|
7734
|
+
const y = PAD_TOP2 + idx * (stageH + gap);
|
|
7728
7735
|
const topW = widthAtStep(idx);
|
|
7729
7736
|
const bottomW = widthAtStep(idx + 1);
|
|
7730
|
-
const cx =
|
|
7737
|
+
const cx = PAD_LEFT2 + canvasW / 2;
|
|
7731
7738
|
const topX = cx - topW / 2;
|
|
7732
7739
|
const bottomX = cx - bottomW / 2;
|
|
7733
7740
|
const points = `${topX},${y} ${topX + topW},${y} ${bottomX + bottomW},${y + stageH} ${bottomX},${y + stageH}`;
|
|
7734
7741
|
const tone = toneByIndex(idx);
|
|
7735
|
-
const legendX =
|
|
7742
|
+
const legendX = PAD_LEFT2 + canvasW + 24;
|
|
7736
7743
|
return /* @__PURE__ */ jsxs("g", { children: [
|
|
7737
7744
|
/* @__PURE__ */ jsx(
|
|
7738
7745
|
"polygon",
|
|
@@ -7796,7 +7803,7 @@ function FunnelNode({
|
|
|
7796
7803
|
strokeWidth: active ? 3 : 1.25
|
|
7797
7804
|
}
|
|
7798
7805
|
),
|
|
7799
|
-
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:
|
|
7806
|
+
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_TOP2 + canvasH * \u4F38\u3073 }) }) }),
|
|
7800
7807
|
drawing ? /* @__PURE__ */ jsx("g", { clipPath: `url(#${\u5207\u308A\u629C\u304Did})`, children: \u6BB5 }) : \u6BB5
|
|
7801
7808
|
] });
|
|
7802
7809
|
}
|
|
@@ -7821,8 +7828,8 @@ function QuadrantNode({
|
|
|
7821
7828
|
const raw = node.quadrantData;
|
|
7822
7829
|
if (!raw) return /* @__PURE__ */ jsx("g", { transform: `translate(${x0} ${y0})` });
|
|
7823
7830
|
const data = resolveQuadrantData(raw, stateValues);
|
|
7824
|
-
const
|
|
7825
|
-
const
|
|
7831
|
+
const PAD_TOP2 = 40;
|
|
7832
|
+
const PAD_BOTTOM2 = 56;
|
|
7826
7833
|
const AXIS_LABEL_FONT = 12;
|
|
7827
7834
|
const PAD_MIN = 60;
|
|
7828
7835
|
const ITEM_FONT = 13;
|
|
@@ -7834,12 +7841,12 @@ function QuadrantNode({
|
|
|
7834
7841
|
const wantRight = axisLabelPad(data.xAxis.right) - PAD_MIN;
|
|
7835
7842
|
const wantTotal = wantLeft + wantRight;
|
|
7836
7843
|
const padScale = wantTotal > padBudget && wantTotal > 0 ? padBudget / wantTotal : 1;
|
|
7837
|
-
const
|
|
7838
|
-
const
|
|
7839
|
-
const canvasW = node.w -
|
|
7840
|
-
const canvasH = node.h -
|
|
7841
|
-
const cx =
|
|
7842
|
-
const cy =
|
|
7844
|
+
const PAD_LEFT2 = PAD_MIN + wantLeft * padScale;
|
|
7845
|
+
const PAD_RIGHT2 = PAD_MIN + wantRight * padScale;
|
|
7846
|
+
const canvasW = node.w - PAD_LEFT2 - PAD_RIGHT2;
|
|
7847
|
+
const canvasH = node.h - PAD_TOP2 - PAD_BOTTOM2;
|
|
7848
|
+
const cx = PAD_LEFT2 + canvasW / 2;
|
|
7849
|
+
const cy = PAD_TOP2 + canvasH / 2;
|
|
7843
7850
|
const halfW = canvasW / 2;
|
|
7844
7851
|
const halfH = canvasH / 2;
|
|
7845
7852
|
const itemsBy = {
|
|
@@ -7875,16 +7882,16 @@ function QuadrantNode({
|
|
|
7875
7882
|
strokeWidth: active ? 3 : 1.25
|
|
7876
7883
|
}
|
|
7877
7884
|
),
|
|
7878
|
-
/* @__PURE__ */ jsx("rect", { "data-cdl-role": "quadrant-bg", x:
|
|
7879
|
-
/* @__PURE__ */ jsx("rect", { "data-cdl-role": "quadrant-bg", x: cx, y:
|
|
7880
|
-
/* @__PURE__ */ jsx("rect", { "data-cdl-role": "quadrant-bg", x:
|
|
7885
|
+
/* @__PURE__ */ jsx("rect", { "data-cdl-role": "quadrant-bg", x: PAD_LEFT2, y: PAD_TOP2, width: halfW, height: halfH, ...quadrantColor.topLeft }),
|
|
7886
|
+
/* @__PURE__ */ jsx("rect", { "data-cdl-role": "quadrant-bg", x: cx, y: PAD_TOP2, width: halfW, height: halfH, ...quadrantColor.topRight }),
|
|
7887
|
+
/* @__PURE__ */ jsx("rect", { "data-cdl-role": "quadrant-bg", x: PAD_LEFT2, y: cy, width: halfW, height: halfH, ...quadrantColor.bottomLeft }),
|
|
7881
7888
|
/* @__PURE__ */ jsx("rect", { "data-cdl-role": "quadrant-bg", x: cx, y: cy, width: halfW, height: halfH, ...quadrantColor.bottomRight }),
|
|
7882
7889
|
/* @__PURE__ */ jsx(
|
|
7883
7890
|
"rect",
|
|
7884
7891
|
{
|
|
7885
7892
|
"data-cdl-role": "quadrant-canvas",
|
|
7886
|
-
x:
|
|
7887
|
-
y:
|
|
7893
|
+
x: PAD_LEFT2,
|
|
7894
|
+
y: PAD_TOP2,
|
|
7888
7895
|
width: canvasW,
|
|
7889
7896
|
height: canvasH,
|
|
7890
7897
|
fill: "none",
|
|
@@ -7893,25 +7900,25 @@ function QuadrantNode({
|
|
|
7893
7900
|
rx: 8
|
|
7894
7901
|
}
|
|
7895
7902
|
),
|
|
7896
|
-
/* @__PURE__ */ jsx("line", { x1: cx, y1:
|
|
7897
|
-
/* @__PURE__ */ jsx("line", { x1:
|
|
7898
|
-
/* @__PURE__ */ jsx("text", { x:
|
|
7899
|
-
/* @__PURE__ */ jsx("text", { x: cx + halfW / 2, y:
|
|
7900
|
-
/* @__PURE__ */ jsx("text", { x:
|
|
7901
|
-
/* @__PURE__ */ jsx("text", { x: cx + halfW / 2, y:
|
|
7902
|
-
/* @__PURE__ */ jsxs("text", { x: cx, y:
|
|
7903
|
+
/* @__PURE__ */ jsx("line", { x1: cx, y1: PAD_TOP2, x2: cx, y2: PAD_TOP2 + canvasH, stroke: "var(--cdl-text-mute, #8a8678)", strokeWidth: 1.5 }),
|
|
7904
|
+
/* @__PURE__ */ jsx("line", { x1: PAD_LEFT2, y1: cy, x2: PAD_LEFT2 + canvasW, y2: cy, stroke: "var(--cdl-text-mute, #8a8678)", strokeWidth: 1.5 }),
|
|
7905
|
+
/* @__PURE__ */ jsx("text", { x: PAD_LEFT2 + halfW / 2, y: PAD_TOP2 + 22, fontSize: 13, fontWeight: 700, textAnchor: "middle", fill: quadrantAccent.topLeft, children: data.quadrantLabels.topLeft }),
|
|
7906
|
+
/* @__PURE__ */ jsx("text", { x: cx + halfW / 2, y: PAD_TOP2 + 22, fontSize: 13, fontWeight: 700, textAnchor: "middle", fill: quadrantAccent.topRight, children: data.quadrantLabels.topRight }),
|
|
7907
|
+
/* @__PURE__ */ jsx("text", { x: PAD_LEFT2 + halfW / 2, y: PAD_TOP2 + canvasH - 12, fontSize: 13, fontWeight: 700, textAnchor: "middle", fill: quadrantAccent.bottomLeft, children: data.quadrantLabels.bottomLeft }),
|
|
7908
|
+
/* @__PURE__ */ jsx("text", { x: cx + halfW / 2, y: PAD_TOP2 + canvasH - 12, fontSize: 13, fontWeight: 700, textAnchor: "middle", fill: quadrantAccent.bottomRight, children: data.quadrantLabels.bottomRight }),
|
|
7909
|
+
/* @__PURE__ */ jsxs("text", { x: cx, y: PAD_TOP2 - 12, fontSize: 12, fontWeight: 700, textAnchor: "middle", fill: "var(--cdl-text-dim, #5a6270)", children: [
|
|
7903
7910
|
"\u2191 ",
|
|
7904
7911
|
data.yAxis.top
|
|
7905
7912
|
] }),
|
|
7906
|
-
/* @__PURE__ */ jsxs("text", { x: cx, y:
|
|
7913
|
+
/* @__PURE__ */ jsxs("text", { x: cx, y: PAD_TOP2 + canvasH + 24, fontSize: 12, fontWeight: 700, textAnchor: "middle", fill: "var(--cdl-text-dim, #5a6270)", children: [
|
|
7907
7914
|
"\u2193 ",
|
|
7908
7915
|
data.yAxis.bottom
|
|
7909
7916
|
] }),
|
|
7910
|
-
/* @__PURE__ */ jsxs("text", { x:
|
|
7917
|
+
/* @__PURE__ */ jsxs("text", { x: PAD_LEFT2 - 12, y: cy + 4, fontSize: AXIS_LABEL_FONT, fontWeight: 700, textAnchor: "end", fill: "var(--cdl-text-dim, #5a6270)", children: [
|
|
7911
7918
|
"\u2190 ",
|
|
7912
7919
|
data.xAxis.left
|
|
7913
7920
|
] }),
|
|
7914
|
-
/* @__PURE__ */ jsxs("text", { x:
|
|
7921
|
+
/* @__PURE__ */ jsxs("text", { x: PAD_LEFT2 + canvasW + 12, y: cy + 4, fontSize: AXIS_LABEL_FONT, fontWeight: 700, textAnchor: "start", fill: "var(--cdl-text-dim, #5a6270)", children: [
|
|
7915
7922
|
data.xAxis.right,
|
|
7916
7923
|
" \u2192"
|
|
7917
7924
|
] }),
|
|
@@ -7920,8 +7927,8 @@ function QuadrantNode({
|
|
|
7920
7927
|
if (items.length === 0) return null;
|
|
7921
7928
|
const isLeft = q === "topLeft" || q === "bottomLeft";
|
|
7922
7929
|
const isTop = q === "topLeft" || q === "topRight";
|
|
7923
|
-
const qxStart = (isLeft ?
|
|
7924
|
-
const qyStart = (isTop ?
|
|
7930
|
+
const qxStart = (isLeft ? PAD_LEFT2 : cx) + 18;
|
|
7931
|
+
const qyStart = (isTop ? PAD_TOP2 : cy) + 44;
|
|
7925
7932
|
const qHalfW = halfW - 36;
|
|
7926
7933
|
const \u67A0\u306E\u4F59\u5730 = qHalfW;
|
|
7927
7934
|
if (\u67A0\u306E\u4F59\u5730 <= 0) return null;
|
|
@@ -7980,6 +7987,24 @@ function \u7BB1\u306E\u6587\u5B57({
|
|
|
7980
7987
|
r.\u5F79\u5272
|
|
7981
7988
|
));
|
|
7982
7989
|
}
|
|
7990
|
+
var PAD_TOP = 40;
|
|
7991
|
+
var PAD_RIGHT = 24;
|
|
7992
|
+
var PAD_BOTTOM = 40;
|
|
7993
|
+
var PAD_LEFT = 24;
|
|
7994
|
+
function \u6728\u306E\u4E2D\u8EAB(node, stateValues = {}) {
|
|
7995
|
+
const treeNodes = resolveTreeData(node.treeData ?? [], stateValues);
|
|
7996
|
+
return computeTreeLayout(
|
|
7997
|
+
treeNodes,
|
|
7998
|
+
node.w - PAD_LEFT - PAD_RIGHT,
|
|
7999
|
+
node.h - PAD_TOP - PAD_BOTTOM
|
|
8000
|
+
);
|
|
8001
|
+
}
|
|
8002
|
+
function \u6728\u306E\u884C(n) {
|
|
8003
|
+
return [
|
|
8004
|
+
{ \u5F79\u5272: "title", text: n.title, fontSize: n.depth === 0 ? 13 : 12 },
|
|
8005
|
+
{ \u5F79\u5272: "subtitle", text: n.subtitle ?? "", fontSize: 9 }
|
|
8006
|
+
];
|
|
8007
|
+
}
|
|
7983
8008
|
function TreeNode({
|
|
7984
8009
|
node,
|
|
7985
8010
|
active,
|
|
@@ -7989,15 +8014,8 @@ function TreeNode({
|
|
|
7989
8014
|
}) {
|
|
7990
8015
|
const x0 = node.cx - node.w / 2;
|
|
7991
8016
|
const y0 = node.cy - node.h / 2;
|
|
7992
|
-
const treeNodes = resolveTreeData(node.treeData ?? [], stateValues);
|
|
7993
8017
|
const gradientId = `tree-root-grad-${node.id}`;
|
|
7994
|
-
const
|
|
7995
|
-
const PAD_RIGHT = 24;
|
|
7996
|
-
const PAD_BOTTOM = 40;
|
|
7997
|
-
const PAD_LEFT = 24;
|
|
7998
|
-
const canvasW = node.w - PAD_LEFT - PAD_RIGHT;
|
|
7999
|
-
const canvasH = node.h - PAD_TOP - PAD_BOTTOM;
|
|
8000
|
-
const layout2 = computeTreeLayout(treeNodes, canvasW, canvasH);
|
|
8018
|
+
const layout2 = \u6728\u306E\u4E2D\u8EAB(node, stateValues);
|
|
8001
8019
|
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
8002
8020
|
const \u6700\u5927\u6DF1\u3055 = layout2.nodes.reduce((m, n) => Math.max(m, n.depth), 0);
|
|
8003
8021
|
const \u7BB1\u304C\u51FA\u308B = (\u6DF1\u3055) => !drawing || \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, \u6DF1\u3055, \u6700\u5927\u6DF1\u3055) >= 1;
|
|
@@ -8050,16 +8068,11 @@ function TreeNode({
|
|
|
8050
8068
|
if (!\u7BB1\u304C\u51FA\u308B(n.depth)) return null;
|
|
8051
8069
|
const accent = depthColors[Math.min(n.depth, depthColors.length - 1)] ?? depthColors[0];
|
|
8052
8070
|
const isRoot = n.depth === 0;
|
|
8053
|
-
const \
|
|
8054
|
-
|
|
8055
|
-
{ \u5F79\u5272: "title", text: n.title, fontSize: isRoot ? 13 : 12 },
|
|
8056
|
-
{ \u5F79\u5272: "subtitle", text: n.subtitle ?? "", fontSize: 9 }
|
|
8057
|
-
],
|
|
8058
|
-
n.w,
|
|
8059
|
-
n.h
|
|
8060
|
-
);
|
|
8071
|
+
const \u6750\u6599 = \u6728\u306E\u884C(n);
|
|
8072
|
+
const \u884C = \u7BB1\u306B\u7A4D\u3080(\u6750\u6599, n.w, n.h);
|
|
8061
8073
|
const \u88DC\u8DB3\u3042\u308A = (n.subtitle ?? "").trim() !== "";
|
|
8062
|
-
const \
|
|
8074
|
+
const \u540D\u524D = \u6750\u6599[0];
|
|
8075
|
+
const \u53CE\u3081\u305F\u540D\u524D = \u88DC\u8DB3\u3042\u308A ? void 0 : \u5E45\u306B\u53CE\u3081\u308B(\u540D\u524D.text, \u540D\u524D.fontSize, \u4F7F\u3048\u308B\u5E45(n.w));
|
|
8063
8076
|
return /* @__PURE__ */ jsx(
|
|
8064
8077
|
"g",
|
|
8065
8078
|
{
|
|
@@ -8265,12 +8278,12 @@ function UserJourneyNode({
|
|
|
8265
8278
|
const x0 = node.cx - node.w / 2;
|
|
8266
8279
|
const y0 = node.cy - node.h / 2;
|
|
8267
8280
|
const steps = resolveJourneyData(node.journeyData ?? [], stateValues);
|
|
8268
|
-
const
|
|
8269
|
-
const
|
|
8270
|
-
const
|
|
8271
|
-
const
|
|
8272
|
-
const canvasW = node.w -
|
|
8273
|
-
const canvasH = node.h -
|
|
8281
|
+
const PAD_TOP2 = 20;
|
|
8282
|
+
const PAD_RIGHT2 = 32;
|
|
8283
|
+
const PAD_BOTTOM2 = 108;
|
|
8284
|
+
const PAD_LEFT2 = 108;
|
|
8285
|
+
const canvasW = node.w - PAD_LEFT2 - PAD_RIGHT2;
|
|
8286
|
+
const canvasH = node.h - PAD_TOP2 - PAD_BOTTOM2;
|
|
8274
8287
|
const emotionRows = ["delighted", "happy", "neutral", "frustrated", "angry"];
|
|
8275
8288
|
const emotionScore = {
|
|
8276
8289
|
delighted: 4,
|
|
@@ -8295,8 +8308,8 @@ function UserJourneyNode({
|
|
|
8295
8308
|
};
|
|
8296
8309
|
const rowH = canvasH / 5;
|
|
8297
8310
|
const colW = canvasW / Math.max(steps.length, 1);
|
|
8298
|
-
const xAt = (idx) =>
|
|
8299
|
-
const yAt = (emotion) =>
|
|
8311
|
+
const xAt = (idx) => PAD_LEFT2 + (steps.length <= 1 ? canvasW / 2 : colW / 2 + colW * idx);
|
|
8312
|
+
const yAt = (emotion) => PAD_TOP2 + rowH / 2 + (4 - emotionScore[emotion]) * rowH;
|
|
8300
8313
|
const pts = steps.map((s, i) => ({ x: xAt(i), y: yAt(s.emotion) }));
|
|
8301
8314
|
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
8302
8315
|
const \u6BB5\u307E\u3067\u306E\u5272\u5408 = \u30D9\u30B8\u30A8\u306E\u7D2F\u7A4D\u5272\u5408(pts, (\u524D, \u5F8C) => {
|
|
@@ -8330,8 +8343,8 @@ function UserJourneyNode({
|
|
|
8330
8343
|
"rect",
|
|
8331
8344
|
{
|
|
8332
8345
|
"data-cdl-role": "journey-band",
|
|
8333
|
-
x:
|
|
8334
|
-
y:
|
|
8346
|
+
x: PAD_LEFT2,
|
|
8347
|
+
y: PAD_TOP2 + i * rowH,
|
|
8335
8348
|
width: canvasW,
|
|
8336
8349
|
height: rowH,
|
|
8337
8350
|
fill: emotionColor[e],
|
|
@@ -8341,8 +8354,8 @@ function UserJourneyNode({
|
|
|
8341
8354
|
/* @__PURE__ */ jsx(
|
|
8342
8355
|
"text",
|
|
8343
8356
|
{
|
|
8344
|
-
x:
|
|
8345
|
-
y:
|
|
8357
|
+
x: PAD_LEFT2 - 84,
|
|
8358
|
+
y: PAD_TOP2 + i * rowH + rowH / 2 + 5,
|
|
8346
8359
|
fontSize: 18,
|
|
8347
8360
|
textAnchor: "middle",
|
|
8348
8361
|
children: emotionEmoji[e]
|
|
@@ -8351,8 +8364,8 @@ function UserJourneyNode({
|
|
|
8351
8364
|
/* @__PURE__ */ jsx(
|
|
8352
8365
|
"text",
|
|
8353
8366
|
{
|
|
8354
|
-
x:
|
|
8355
|
-
y:
|
|
8367
|
+
x: PAD_LEFT2 - 14,
|
|
8368
|
+
y: PAD_TOP2 + i * rowH + rowH / 2 + 4,
|
|
8356
8369
|
fontSize: 12,
|
|
8357
8370
|
fontWeight: 600,
|
|
8358
8371
|
textAnchor: "end",
|
|
@@ -8366,9 +8379,9 @@ function UserJourneyNode({
|
|
|
8366
8379
|
{
|
|
8367
8380
|
"data-cdl-role": "node-column-divider",
|
|
8368
8381
|
x1: xAt(idx),
|
|
8369
|
-
y1:
|
|
8382
|
+
y1: PAD_TOP2,
|
|
8370
8383
|
x2: xAt(idx),
|
|
8371
|
-
y2:
|
|
8384
|
+
y2: PAD_TOP2 + canvasH,
|
|
8372
8385
|
stroke: "var(--cdl-row-divider, #7e848e)",
|
|
8373
8386
|
strokeDasharray: "4 4"
|
|
8374
8387
|
},
|
|
@@ -8432,7 +8445,7 @@ function UserJourneyNode({
|
|
|
8432
8445
|
"text",
|
|
8433
8446
|
{
|
|
8434
8447
|
x: xAt(idx),
|
|
8435
|
-
y:
|
|
8448
|
+
y: PAD_TOP2 + canvasH + 24,
|
|
8436
8449
|
fontSize: 12,
|
|
8437
8450
|
fontWeight: 700,
|
|
8438
8451
|
textAnchor: "middle",
|
|
@@ -8446,7 +8459,7 @@ function UserJourneyNode({
|
|
|
8446
8459
|
{
|
|
8447
8460
|
"data-cdl-role": "journey-chip",
|
|
8448
8461
|
x: xAt(idx) - 40,
|
|
8449
|
-
y:
|
|
8462
|
+
y: PAD_TOP2 + canvasH + 34,
|
|
8450
8463
|
width: 80,
|
|
8451
8464
|
height: 20,
|
|
8452
8465
|
rx: 10,
|
|
@@ -8461,7 +8474,7 @@ function UserJourneyNode({
|
|
|
8461
8474
|
"text",
|
|
8462
8475
|
{
|
|
8463
8476
|
x: xAt(idx),
|
|
8464
|
-
y:
|
|
8477
|
+
y: PAD_TOP2 + canvasH + 48,
|
|
8465
8478
|
fontSize: 10,
|
|
8466
8479
|
fontWeight: 600,
|
|
8467
8480
|
textAnchor: "middle",
|
|
@@ -8475,7 +8488,7 @@ function UserJourneyNode({
|
|
|
8475
8488
|
"rect",
|
|
8476
8489
|
{
|
|
8477
8490
|
x: xAt(idx) - 55,
|
|
8478
|
-
y:
|
|
8491
|
+
y: PAD_TOP2 + canvasH + 62,
|
|
8479
8492
|
width: 110,
|
|
8480
8493
|
height: 26,
|
|
8481
8494
|
rx: 13,
|
|
@@ -8488,7 +8501,7 @@ function UserJourneyNode({
|
|
|
8488
8501
|
"text",
|
|
8489
8502
|
{
|
|
8490
8503
|
x: xAt(idx),
|
|
8491
|
-
y:
|
|
8504
|
+
y: PAD_TOP2 + canvasH + 79,
|
|
8492
8505
|
fontSize: 10,
|
|
8493
8506
|
textAnchor: "middle",
|
|
8494
8507
|
fill: "var(--cdl-note-text, #7a5320)",
|
|
@@ -21752,6 +21765,7 @@ function emptyCounts() {
|
|
|
21752
21765
|
"node-inside-viewbox": 0,
|
|
21753
21766
|
"node-inside-lane": 0,
|
|
21754
21767
|
"shape-label-dropped": 0,
|
|
21768
|
+
"box-line-dropped": 0,
|
|
21755
21769
|
"edge-inside-viewbox": 0,
|
|
21756
21770
|
"lane-label-inside-viewbox": 0,
|
|
21757
21771
|
"lane-label-overlap": 0,
|
|
@@ -21769,6 +21783,12 @@ function emptyCounts() {
|
|
|
21769
21783
|
"validation-interrupted": 0
|
|
21770
21784
|
};
|
|
21771
21785
|
}
|
|
21786
|
+
function \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n) {
|
|
21787
|
+
const \u7BB1 = (b, \u884C) => ({ \u884C, w: b.w, h: b.h });
|
|
21788
|
+
if (n.kind === "tree-hierarchy") return \u6728\u306E\u4E2D\u8EAB(n).nodes.map((b) => \u7BB1(b, \u6728\u306E\u884C(b)));
|
|
21789
|
+
if (n.kind === "mind-map") return (\u653E\u5C04\u306E\u4E2D\u8EAB(n)?.nodes ?? []).map((b) => \u7BB1(b, \u653E\u5C04\u306E\u884C(b)));
|
|
21790
|
+
return [];
|
|
21791
|
+
}
|
|
21772
21792
|
function measureStubOut(segs) {
|
|
21773
21793
|
const first = segs[0];
|
|
21774
21794
|
const dx0 = first.x2 - first.x1;
|
|
@@ -22671,6 +22691,31 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes) {
|
|
|
22671
22691
|
"warn"
|
|
22672
22692
|
);
|
|
22673
22693
|
}
|
|
22694
|
+
for (const n of laid.nodes) {
|
|
22695
|
+
const \u7BB1 = \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n);
|
|
22696
|
+
if (\u7BB1.length === 0) continue;
|
|
22697
|
+
let \u5BFE\u8C61 = 0;
|
|
22698
|
+
const \u843D\u3061\u305F = [];
|
|
22699
|
+
for (const b of \u7BB1) {
|
|
22700
|
+
const \u5BA3\u8A00 = b.\u884C.slice(1).filter((r) => r.text.trim() !== "");
|
|
22701
|
+
if (\u5BA3\u8A00.length === 0) continue;
|
|
22702
|
+
\u5BFE\u8C61 += 1;
|
|
22703
|
+
const \u6B8B\u3063\u305F = new Set(\u7BB1\u306B\u7A4D\u3080(b.\u884C, b.w, b.h).map((r) => r.\u5F79\u5272));
|
|
22704
|
+
if (\u5BA3\u8A00.every((r) => \u6B8B\u3063\u305F.has(r.\u5F79\u5272))) continue;
|
|
22705
|
+
\u843D\u3061\u305F.push({ title: b.\u884C[0]?.text ?? "", h: b.h });
|
|
22706
|
+
}
|
|
22707
|
+
if (\u843D\u3061\u305F.length === 0) continue;
|
|
22708
|
+
const \u540D\u524D = \u843D\u3061\u305F.map((d) => `"${d.title}"`);
|
|
22709
|
+
const \u898B\u305B\u308B = \u540D\u524D.slice(0, 5).join(" / ");
|
|
22710
|
+
const \u6B8B\u308A = \u540D\u524D.length > 5 ? ` \u4ED6 ${\u540D\u524D.length - 5} \u4EF6` : "";
|
|
22711
|
+
const \u4F4E = Math.min(...\u843D\u3061\u305F.map((d) => d.h)).toFixed(1);
|
|
22712
|
+
const \u9AD8 = Math.max(...\u843D\u3061\u305F.map((d) => d.h)).toFixed(1);
|
|
22713
|
+
push(
|
|
22714
|
+
"box-line-dropped",
|
|
22715
|
+
`node "${n.id}" (${n.kind}) \u306F\u7BB1\u304C\u4F4E\u304F\u3001 \u66F8\u3044\u305F\u88DC\u8DB3\u304C ${\u843D\u3061\u305F.length}/${\u5BFE\u8C61} \u7BB1\u3067\u63CF\u304B\u308C\u306A\u3044 (${\u898B\u305B\u308B}${\u6B8B\u308A}\u3001 \u7BB1\u306E\u9AD8\u3055 ${\u4F4E === \u9AD8 ? \u4F4E : `${\u4F4E}\u301C${\u9AD8}`})\u3002 \u56F3\u3092\u9AD8\u304F\u3059\u308B\u304B\u6BB5\u3092\u6E1B\u3089\u3059\u304B\u3001 \u88DC\u8DB3\u3092\u6D88\u3059`,
|
|
22716
|
+
"warn"
|
|
22717
|
+
);
|
|
22718
|
+
}
|
|
22674
22719
|
for (const e of laid.edges) {
|
|
22675
22720
|
const segs = flattenPathSegments(extractPathSegments(e.d));
|
|
22676
22721
|
if (segs.length === 0) continue;
|