@cardenelabs/cdl 0.6.1 → 0.9.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 +401 -0
- package/SPEC.md +32 -17
- package/dist/index.cjs +820 -364
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +68 -14
- package/dist/index.d.ts +68 -14
- package/dist/index.js +820 -364
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +692 -254
- 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 +692 -254
- package/dist/react.js.map +1 -1
- package/dist/{render-DquCvgOB.d.cts → render-hmFRAabt.d.cts} +33 -2
- package/dist/{render-DquCvgOB.d.ts → render-hmFRAabt.d.ts} +33 -2
- package/package.json +6 -3
- package/src/kinds/box-lines.ts +120 -0
- package/src/kinds/gantt.tsx +152 -24
- package/src/kinds/mind-map.tsx +77 -16
- package/src/kinds/quadrant.tsx +28 -2
- package/src/kinds/shape-blockchain.tsx +65 -12
- package/src/kinds/shape-region.tsx +152 -34
- package/src/kinds/tree.tsx +121 -24
- package/src/layout/collisions.ts +10 -2
- package/src/layout/footer-shape.ts +86 -24
- package/src/layout/lifeline.ts +80 -0
- package/src/layout/spec.ts +21 -2
- package/src/layout/text-width.ts +92 -4
- package/src/layout/viewbox.ts +0 -8
- package/src/layout.ts +8 -1
- package/src/presets.ts +120 -22
- package/src/render/header.tsx +3 -1
- package/src/render/nodes.tsx +6 -5
- package/src/render/payload-binding.ts +88 -3
- package/src/render/stage.tsx +17 -34
- package/src/render/template-fields.ts +212 -0
- package/src/render/utils.ts +32 -2
- package/src/render.tsx +2 -9
- package/src/types.ts +33 -2
- package/src/validate.ts +27 -9
- package/src/visual-validate.ts +34 -1
- package/src/layout/label-shift.ts +0 -28
package/dist/index.cjs
CHANGED
|
@@ -11605,7 +11605,35 @@ function isCJK(code) {
|
|
|
11605
11605
|
function isHalfwidthKana(code) {
|
|
11606
11606
|
return code >= 65377 && code <= 65500;
|
|
11607
11607
|
}
|
|
11608
|
+
var EMOJI_ADVANCE_EM = 1.05;
|
|
11609
|
+
var MONO_EMOJI_ADVANCE_EM = 1.16;
|
|
11610
|
+
var WIDE_SYMBOL_ADVANCE_EM = 0.95;
|
|
11611
|
+
function isEmoji(code) {
|
|
11612
|
+
return code >= 126976 && code <= 129791 || // 絵文字の主要面
|
|
11613
|
+
code >= 9728 && code <= 10175 || // 記号と絵文字 (♻ ✅ ❤ 等)
|
|
11614
|
+
code >= 127462 && code <= 127487;
|
|
11615
|
+
}
|
|
11616
|
+
function isEmojiGrapheme(grapheme, firstCode) {
|
|
11617
|
+
return isEmoji(firstCode) || grapheme.includes("\uFE0F");
|
|
11618
|
+
}
|
|
11619
|
+
function isWideSymbol(code) {
|
|
11620
|
+
return code >= 8592 && code <= 8703 || // 矢印
|
|
11621
|
+
code >= 9472 && code <= 9599 || // 罫線
|
|
11622
|
+
code >= 9632 && code <= 9727 || // 幾何図形
|
|
11623
|
+
code >= 11008 && code <= 11263;
|
|
11624
|
+
}
|
|
11625
|
+
var CLUSTER_JOINER_RE = /\u200d|\ufe0f|[\u{1f000}-\u{1faff}]|[\u{2600}-\u{27bf}]/u;
|
|
11626
|
+
var \u66F8\u8A18\u7D20\u3067\u5206\u3051\u308B;
|
|
11627
|
+
function segmentGraphemes(text) {
|
|
11628
|
+
if (typeof Intl === "undefined" || typeof Intl.Segmenter !== "function") {
|
|
11629
|
+
return [...text];
|
|
11630
|
+
}
|
|
11631
|
+
\u66F8\u8A18\u7D20\u3067\u5206\u3051\u308B ??= new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
11632
|
+
return [...\u66F8\u8A18\u7D20\u3067\u5206\u3051\u308B.segment(text)].map((s) => s.segment);
|
|
11633
|
+
}
|
|
11608
11634
|
function defaultAdvanceEm(ch, code) {
|
|
11635
|
+
if (isEmoji(code)) return EMOJI_ADVANCE_EM;
|
|
11636
|
+
if (isWideSymbol(code)) return WIDE_SYMBOL_ADVANCE_EM;
|
|
11609
11637
|
if (isCJK(code)) return 1.08;
|
|
11610
11638
|
if (isHalfwidthKana(code)) return 0.72;
|
|
11611
11639
|
if (ch >= "a" && ch <= "z") return 0.73;
|
|
@@ -11619,19 +11647,23 @@ function measureTextWidth(text, opts = {}) {
|
|
|
11619
11647
|
const fontFamily = opts.fontFamily ?? "sans";
|
|
11620
11648
|
let advanceEmSum = 0;
|
|
11621
11649
|
let charCount = 0;
|
|
11622
|
-
|
|
11650
|
+
const \u6587\u5B57\u5217 = CLUSTER_JOINER_RE.test(text) ? segmentGraphemes(text) : [...text];
|
|
11651
|
+
for (const ch of \u6587\u5B57\u5217) {
|
|
11623
11652
|
charCount++;
|
|
11653
|
+
const code = ch.codePointAt(0) ?? 0;
|
|
11654
|
+
if (isEmojiGrapheme(ch, code)) {
|
|
11655
|
+
advanceEmSum += fontFamily === "mono" ? MONO_EMOJI_ADVANCE_EM : EMOJI_ADVANCE_EM;
|
|
11656
|
+
continue;
|
|
11657
|
+
}
|
|
11624
11658
|
if (fontFamily === "mono") {
|
|
11625
|
-
|
|
11626
|
-
advanceEmSum += isCJK(code2) ? 1.08 : JETBRAINS_MONO_ADVANCE_EM;
|
|
11659
|
+
advanceEmSum += isCJK(code) ? 1.08 : JETBRAINS_MONO_ADVANCE_EM;
|
|
11627
11660
|
continue;
|
|
11628
11661
|
}
|
|
11629
|
-
const code = ch.codePointAt(0) ?? 0;
|
|
11630
11662
|
if (isCJK(code)) {
|
|
11631
11663
|
advanceEmSum += 1.08;
|
|
11632
11664
|
continue;
|
|
11633
11665
|
}
|
|
11634
|
-
const table = INTER_BOLD_ADVANCE_EM[ch];
|
|
11666
|
+
const table = ch.length === 1 ? INTER_BOLD_ADVANCE_EM[ch] : void 0;
|
|
11635
11667
|
advanceEmSum += table !== void 0 ? table : defaultAdvanceEm(ch, code);
|
|
11636
11668
|
}
|
|
11637
11669
|
const w = advanceEmSum * fontSize + letterSpacing * charCount;
|
|
@@ -11687,13 +11719,15 @@ var KINDS_WITHOUT_TITLE_TEXT = /* @__PURE__ */ new Set([
|
|
|
11687
11719
|
"funnel-stages",
|
|
11688
11720
|
"quadrant-matrix",
|
|
11689
11721
|
"tree-hierarchy",
|
|
11690
|
-
"journey-map"
|
|
11691
|
-
// 形の中に自前の文字を置く (title は使わない)
|
|
11692
|
-
"shape-blockchain-block"
|
|
11722
|
+
"journey-map"
|
|
11693
11723
|
]);
|
|
11694
11724
|
function rendersTitleText(kind) {
|
|
11695
11725
|
return !KINDS_WITHOUT_TITLE_TEXT.has(kind ?? "");
|
|
11696
11726
|
}
|
|
11727
|
+
var KINDS_FITTING_OWN_TITLE = /* @__PURE__ */ new Set(["shape-blockchain-block"]);
|
|
11728
|
+
function fitsOwnTitleWidth(kind) {
|
|
11729
|
+
return KINDS_FITTING_OWN_TITLE.has(kind ?? "");
|
|
11730
|
+
}
|
|
11697
11731
|
var KINDS_WITH_ROW_TEXT = /* @__PURE__ */ new Set([
|
|
11698
11732
|
// 専用の表組み (StorageNode)
|
|
11699
11733
|
"storage",
|
|
@@ -11895,6 +11929,70 @@ function buildDiagramAltText(topic, phase) {
|
|
|
11895
11929
|
return parts.join(" ");
|
|
11896
11930
|
}
|
|
11897
11931
|
|
|
11932
|
+
// src/layout/footer-shape.ts
|
|
11933
|
+
var SHAPE_DRAW_UP_EXTENT = {
|
|
11934
|
+
"shape-robot-arm": 201,
|
|
11935
|
+
// 実測 上 129
|
|
11936
|
+
"shape-iot-sensor": 120,
|
|
11937
|
+
// 48
|
|
11938
|
+
"shape-credit-card": 113,
|
|
11939
|
+
// 40.8
|
|
11940
|
+
"shape-exchange": 107,
|
|
11941
|
+
// 35
|
|
11942
|
+
"shape-storefront": 104,
|
|
11943
|
+
// 32
|
|
11944
|
+
"shape-cdn-edge": 103,
|
|
11945
|
+
// 30.8
|
|
11946
|
+
"shape-payment-provider": 101,
|
|
11947
|
+
// 29
|
|
11948
|
+
"shape-gear": 96,
|
|
11949
|
+
// 23.9
|
|
11950
|
+
"shape-rpc-node": 94,
|
|
11951
|
+
// 22
|
|
11952
|
+
"shape-wallet": 84
|
|
11953
|
+
// 12.1
|
|
11954
|
+
};
|
|
11955
|
+
function lifelineFooterNodes(lanes, nodes) {
|
|
11956
|
+
const \u6570 = /* @__PURE__ */ new Map();
|
|
11957
|
+
for (const n of nodes) \u6570.set(n.lane, (\u6570.get(n.lane) ?? 0) + 1);
|
|
11958
|
+
const lifelineLanes = /* @__PURE__ */ new Set();
|
|
11959
|
+
for (const lane of lanes) {
|
|
11960
|
+
if (lane.lifeline) lifelineLanes.add(lane.id);
|
|
11961
|
+
}
|
|
11962
|
+
return nodes.filter(
|
|
11963
|
+
(n) => n.role === "lifeline-footer" && lifelineLanes.has(n.lane) && (\u6570.get(n.lane) ?? 0) >= 2
|
|
11964
|
+
);
|
|
11965
|
+
}
|
|
11966
|
+
function footerShapeDropY(kind, h) {
|
|
11967
|
+
const extent = SHAPE_DRAW_UP_EXTENT[kind];
|
|
11968
|
+
if (extent === void 0) return 0;
|
|
11969
|
+
if (!Number.isFinite(h) || h <= 0) return 0;
|
|
11970
|
+
return Math.max(0, extent - h);
|
|
11971
|
+
}
|
|
11972
|
+
function footerShapeDrops(lanes, nodes) {
|
|
11973
|
+
return footerShapeDropsOf(lifelineFooterNodes(lanes, nodes));
|
|
11974
|
+
}
|
|
11975
|
+
function footerShapeDropsOf(footers) {
|
|
11976
|
+
const drops = /* @__PURE__ */ new Map();
|
|
11977
|
+
for (const footer of footers) {
|
|
11978
|
+
const dy = footerShapeDropY(footer.kind, footer.h);
|
|
11979
|
+
if (dy > 0) drops.set(footer.id, dy);
|
|
11980
|
+
}
|
|
11981
|
+
return drops;
|
|
11982
|
+
}
|
|
11983
|
+
function applyFooterShapeDrops(lanes, nodes) {
|
|
11984
|
+
const drops = footerShapeDrops(lanes, nodes);
|
|
11985
|
+
if (drops.size === 0) return nodes;
|
|
11986
|
+
return nodes.map((n) => {
|
|
11987
|
+
if (n.posX !== void 0 && n.posY !== void 0) return n;
|
|
11988
|
+
const dy = drops.get(n.id);
|
|
11989
|
+
return dy === void 0 ? n : { ...n, cy: n.cy + dy };
|
|
11990
|
+
});
|
|
11991
|
+
}
|
|
11992
|
+
function footerShapeDrawTop(node) {
|
|
11993
|
+
return node.cy - node.h / 2 - footerShapeDropY(node.kind, node.h);
|
|
11994
|
+
}
|
|
11995
|
+
|
|
11898
11996
|
// src/layout/collisions.ts
|
|
11899
11997
|
var LANE_LABEL_CLEARANCE_MARGIN = 2;
|
|
11900
11998
|
function collectBBoxes(lanes, nodes, edges) {
|
|
@@ -11910,14 +12008,16 @@ function collectBBoxes(lanes, nodes, edges) {
|
|
|
11910
12008
|
h: 28
|
|
11911
12009
|
});
|
|
11912
12010
|
}
|
|
12011
|
+
const footerDraw = footerShapeDrops(lanes, nodes);
|
|
11913
12012
|
for (const n of nodes) {
|
|
12013
|
+
const up = footerDraw.get(n.id) ?? 0;
|
|
11914
12014
|
out.push({
|
|
11915
12015
|
kind: "node",
|
|
11916
12016
|
id: n.id,
|
|
11917
12017
|
x: n.cx - n.w / 2,
|
|
11918
|
-
y: n.cy - n.h / 2,
|
|
12018
|
+
y: n.cy - n.h / 2 - up,
|
|
11919
12019
|
w: n.w,
|
|
11920
|
-
h: n.h
|
|
12020
|
+
h: n.h + up
|
|
11921
12021
|
});
|
|
11922
12022
|
}
|
|
11923
12023
|
for (const e of edges) {
|
|
@@ -14900,67 +15000,6 @@ function layoutNodes(diag, lanes) {
|
|
|
14900
15000
|
return out;
|
|
14901
15001
|
}
|
|
14902
15002
|
|
|
14903
|
-
// src/layout/footer-shape.ts
|
|
14904
|
-
var SHAPE_DRAW_UP_EXTENT = {
|
|
14905
|
-
"shape-robot-arm": 201,
|
|
14906
|
-
// 実測 上 129
|
|
14907
|
-
"shape-iot-sensor": 120,
|
|
14908
|
-
// 48
|
|
14909
|
-
"shape-credit-card": 113,
|
|
14910
|
-
// 40.8
|
|
14911
|
-
"shape-exchange": 107,
|
|
14912
|
-
// 35
|
|
14913
|
-
"shape-storefront": 104,
|
|
14914
|
-
// 32
|
|
14915
|
-
"shape-cdn-edge": 103,
|
|
14916
|
-
// 30.8
|
|
14917
|
-
"shape-payment-provider": 101,
|
|
14918
|
-
// 29
|
|
14919
|
-
"shape-gear": 96,
|
|
14920
|
-
// 23.9
|
|
14921
|
-
"shape-rpc-node": 94,
|
|
14922
|
-
// 22
|
|
14923
|
-
"shape-wallet": 84
|
|
14924
|
-
// 12.1
|
|
14925
|
-
};
|
|
14926
|
-
function lifelineFooterNodes(lanes, nodes) {
|
|
14927
|
-
const byLane = /* @__PURE__ */ new Map();
|
|
14928
|
-
for (const n of nodes) {
|
|
14929
|
-
const inside = byLane.get(n.lane);
|
|
14930
|
-
if (inside) inside.push(n);
|
|
14931
|
-
else byLane.set(n.lane, [n]);
|
|
14932
|
-
}
|
|
14933
|
-
const footers = [];
|
|
14934
|
-
for (const lane of lanes) {
|
|
14935
|
-
if (!lane.lifeline) continue;
|
|
14936
|
-
const inside = byLane.get(lane.id);
|
|
14937
|
-
if (inside === void 0 || inside.length < 2) continue;
|
|
14938
|
-
let footer = inside[0];
|
|
14939
|
-
for (const n of inside) {
|
|
14940
|
-
if (n.cy >= footer.cy) footer = n;
|
|
14941
|
-
}
|
|
14942
|
-
footers.push(footer);
|
|
14943
|
-
}
|
|
14944
|
-
return footers;
|
|
14945
|
-
}
|
|
14946
|
-
function footerShapeDropY(kind, h) {
|
|
14947
|
-
const extent = SHAPE_DRAW_UP_EXTENT[kind];
|
|
14948
|
-
if (extent === void 0) return 0;
|
|
14949
|
-
if (!Number.isFinite(h) || h <= 0) return 0;
|
|
14950
|
-
return Math.max(0, extent - h);
|
|
14951
|
-
}
|
|
14952
|
-
function footerShapeDrops(lanes, nodes) {
|
|
14953
|
-
return footerShapeDropsOf(lifelineFooterNodes(lanes, nodes));
|
|
14954
|
-
}
|
|
14955
|
-
function footerShapeDropsOf(footers) {
|
|
14956
|
-
const drops = /* @__PURE__ */ new Map();
|
|
14957
|
-
for (const footer of footers) {
|
|
14958
|
-
const dy = footerShapeDropY(footer.kind, footer.h);
|
|
14959
|
-
if (dy > 0) drops.set(footer.id, dy);
|
|
14960
|
-
}
|
|
14961
|
-
return drops;
|
|
14962
|
-
}
|
|
14963
|
-
|
|
14964
15003
|
// src/layout/viewbox.ts
|
|
14965
15004
|
function computeViewBox(lanes, nodes, edges, bboxes, viewport) {
|
|
14966
15005
|
let maxX = 0;
|
|
@@ -14981,11 +15020,6 @@ function computeViewBox(lanes, nodes, edges, bboxes, viewport) {
|
|
|
14981
15020
|
maxX = Math.max(maxX, n.cx + n.w / 2);
|
|
14982
15021
|
maxY = Math.max(maxY, n.cy + n.h / 2);
|
|
14983
15022
|
}
|
|
14984
|
-
const footerDrops = footerShapeDrops(lanes, nodes);
|
|
14985
|
-
for (const n of nodes) {
|
|
14986
|
-
const dy = footerDrops.get(n.id);
|
|
14987
|
-
if (dy !== void 0) maxY = Math.max(maxY, n.cy + n.h / 2 + dy);
|
|
14988
|
-
}
|
|
14989
15023
|
if (!Number.isFinite(minX)) minX = 0;
|
|
14990
15024
|
if (!Number.isFinite(minY)) minY = 0;
|
|
14991
15025
|
const x = minX - VIEW_PAD;
|
|
@@ -15063,7 +15097,7 @@ function applyRowLevelNodeShifts(nodes, lanes, nodeShifts) {
|
|
|
15063
15097
|
}
|
|
15064
15098
|
function layout(diag) {
|
|
15065
15099
|
const lanes = layoutLanes(diag);
|
|
15066
|
-
const rawNodes = layoutNodes(diag, lanes);
|
|
15100
|
+
const rawNodes = applyFooterShapeDrops(lanes, layoutNodes(diag, lanes));
|
|
15067
15101
|
const expandedLanes = expandLanesForNodes(lanes, rawNodes);
|
|
15068
15102
|
const gapExpandedLanes = expandLaneGapsForEdgeLabels(expandedLanes, rawNodes, diag.edges);
|
|
15069
15103
|
const nodes = rawNodes.map((n) => {
|
|
@@ -15582,7 +15616,7 @@ function templateRefIds(text) {
|
|
|
15582
15616
|
return out;
|
|
15583
15617
|
}
|
|
15584
15618
|
function computeStateValues(laid, phaseIdx, progress) {
|
|
15585
|
-
const values =
|
|
15619
|
+
const values = /* @__PURE__ */ Object.create(null);
|
|
15586
15620
|
for (const s of laid.states) values[s.id] = s.initial;
|
|
15587
15621
|
for (let i = 0; i < laid.phases.length; i++) {
|
|
15588
15622
|
const phase = laid.phases[i];
|
|
@@ -15600,10 +15634,20 @@ function computeStateValues(laid, phaseIdx, progress) {
|
|
|
15600
15634
|
}
|
|
15601
15635
|
}
|
|
15602
15636
|
}
|
|
15603
|
-
const out =
|
|
15637
|
+
const out = /* @__PURE__ */ Object.create(null);
|
|
15604
15638
|
for (const [k, v] of Object.entries(values)) out[k] = String(v);
|
|
15605
15639
|
return withDerivedValues(out, laid.derived);
|
|
15606
15640
|
}
|
|
15641
|
+
function mergeStateValues(base, overrides) {
|
|
15642
|
+
const merged = Object.assign(/* @__PURE__ */ Object.create(null), base);
|
|
15643
|
+
for (const key of Object.keys(overrides)) {
|
|
15644
|
+
const v = overrides[key];
|
|
15645
|
+
if (typeof v === "number" || typeof v === "string" || typeof v === "boolean") {
|
|
15646
|
+
merged[key] = String(v);
|
|
15647
|
+
}
|
|
15648
|
+
}
|
|
15649
|
+
return merged;
|
|
15650
|
+
}
|
|
15607
15651
|
function interpolate(template, values) {
|
|
15608
15652
|
return template.replace(TEMPLATE_REF_RE, (_, id, accessor) => {
|
|
15609
15653
|
const raw = Object.hasOwn(values, id) ? values[id] : void 0;
|
|
@@ -15753,6 +15797,65 @@ function pathSubpath(d, progress) {
|
|
|
15753
15797
|
return d;
|
|
15754
15798
|
}
|
|
15755
15799
|
|
|
15800
|
+
// src/render/template-fields.ts
|
|
15801
|
+
var TEXT_FIELDS = ["title", "eyebrow", "subtitle", "value", "wBind", "hBind", "visibleIf"];
|
|
15802
|
+
var LIST_FIELDS = ["rows"];
|
|
15803
|
+
var NUMERIC_FIELDS = ["opacity", "renderOffsetX", "renderOffsetY"];
|
|
15804
|
+
var SHAPE_TEMPLATE_FIELDS = ["source", "radius", "fillProgress", "angle", "level", "rotation", "fill"];
|
|
15805
|
+
function shapeTexts(shape) {
|
|
15806
|
+
if (!shape) return [];
|
|
15807
|
+
const out = [];
|
|
15808
|
+
const \u4E2D\u8EAB = shape;
|
|
15809
|
+
for (const f of SHAPE_TEMPLATE_FIELDS) {
|
|
15810
|
+
const v = \u4E2D\u8EAB[f];
|
|
15811
|
+
if (typeof v === "string" && v) out.push(v);
|
|
15812
|
+
}
|
|
15813
|
+
return out;
|
|
15814
|
+
}
|
|
15815
|
+
function payloadTexts(node) {
|
|
15816
|
+
const out = [];
|
|
15817
|
+
const \u8DB3\u3059 = (v) => {
|
|
15818
|
+
if (typeof v === "string" && v) out.push(v);
|
|
15819
|
+
};
|
|
15820
|
+
for (const d of node.chartData ?? []) \u8DB3\u3059(d.value);
|
|
15821
|
+
for (const s of node.funnelData ?? []) \u8DB3\u3059(s.count);
|
|
15822
|
+
for (const t of node.ganttData ?? []) {
|
|
15823
|
+
\u8DB3\u3059(t.startIdx);
|
|
15824
|
+
\u8DB3\u3059(t.endIdx);
|
|
15825
|
+
}
|
|
15826
|
+
for (const i of node.quadrantData?.items ?? []) \u8DB3\u3059(i.quadrant);
|
|
15827
|
+
for (const s of node.journeyData ?? []) \u8DB3\u3059(s.emotion);
|
|
15828
|
+
for (const n of node.treeData ?? []) {
|
|
15829
|
+
\u8DB3\u3059(n.title);
|
|
15830
|
+
\u8DB3\u3059(n.subtitle);
|
|
15831
|
+
}
|
|
15832
|
+
if (node.mindData) {
|
|
15833
|
+
\u8DB3\u3059(node.mindData.rootTitle);
|
|
15834
|
+
for (const b of node.mindData.branches) {
|
|
15835
|
+
\u8DB3\u3059(b.title);
|
|
15836
|
+
\u8DB3\u3059(b.subtitle);
|
|
15837
|
+
}
|
|
15838
|
+
}
|
|
15839
|
+
return out;
|
|
15840
|
+
}
|
|
15841
|
+
function nodeTemplateTexts(node) {
|
|
15842
|
+
const out = [];
|
|
15843
|
+
for (const f of TEXT_FIELDS) {
|
|
15844
|
+
const v = node[f];
|
|
15845
|
+
if (typeof v === "string" && v) out.push(v);
|
|
15846
|
+
}
|
|
15847
|
+
for (const f of LIST_FIELDS) {
|
|
15848
|
+
for (const v of node[f] ?? []) if (v) out.push(v);
|
|
15849
|
+
}
|
|
15850
|
+
for (const f of NUMERIC_FIELDS) {
|
|
15851
|
+
const v = node[f];
|
|
15852
|
+
if (typeof v === "string" && v) out.push(v);
|
|
15853
|
+
}
|
|
15854
|
+
out.push(...shapeTexts(node.shape));
|
|
15855
|
+
out.push(...payloadTexts(node));
|
|
15856
|
+
return out;
|
|
15857
|
+
}
|
|
15858
|
+
|
|
15756
15859
|
// src/validate.ts
|
|
15757
15860
|
var TONES2 = new Set(TONES);
|
|
15758
15861
|
var KINDS = new Set(NODE_KINDS);
|
|
@@ -15811,7 +15914,13 @@ function validate(diag) {
|
|
|
15811
15914
|
const nodeIds = new Set(diag.nodes.map((n) => n.id));
|
|
15812
15915
|
const edgeIds = new Set(diag.edges.map((e) => e.id));
|
|
15813
15916
|
const stateIds = new Set(diag.states.map((s) => s.id));
|
|
15814
|
-
const readableIds = /* @__PURE__ */ new Set([
|
|
15917
|
+
const readableIds = /* @__PURE__ */ new Set([
|
|
15918
|
+
...stateIds,
|
|
15919
|
+
...(diag.derived ?? []).map((d) => d.id),
|
|
15920
|
+
...(diag.inputs ?? []).map((i) => i.id),
|
|
15921
|
+
...(diag.formulas ?? []).map((f) => f.id),
|
|
15922
|
+
...(diag.scrollTriggers ?? []).map((t) => t.id)
|
|
15923
|
+
]);
|
|
15815
15924
|
const suggest = (target, candidates) => {
|
|
15816
15925
|
const list = [...candidates];
|
|
15817
15926
|
if (list.length === 0) return "";
|
|
@@ -15878,10 +15987,7 @@ function validate(diag) {
|
|
|
15878
15987
|
}
|
|
15879
15988
|
}
|
|
15880
15989
|
for (const n of diag.nodes) {
|
|
15881
|
-
const
|
|
15882
|
-
if (n.value) checks.push(n.value);
|
|
15883
|
-
if (n.rows) checks.push(...n.rows);
|
|
15884
|
-
for (const text of checks) {
|
|
15990
|
+
for (const text of nodeTemplateTexts(n)) {
|
|
15885
15991
|
for (const id of templateRefIds(text)) {
|
|
15886
15992
|
if (!readableIds.has(id)) {
|
|
15887
15993
|
warnings.push(`node "${n.id}" \u304C\u672A\u5B9A\u7FA9 state "${id}" \u3092\u53C2\u7167`);
|
|
@@ -15909,8 +16015,7 @@ function validate(diag) {
|
|
|
15909
16015
|
for (const s of p.sets) stateUsed.add(s.stateId);
|
|
15910
16016
|
}
|
|
15911
16017
|
for (const n of diag.nodes) {
|
|
15912
|
-
const
|
|
15913
|
-
for (const text of texts2) {
|
|
16018
|
+
for (const text of nodeTemplateTexts(n)) {
|
|
15914
16019
|
for (const id of templateRefIds(text)) stateUsed.add(id);
|
|
15915
16020
|
}
|
|
15916
16021
|
}
|
|
@@ -15990,6 +16095,187 @@ function compile(diag) {
|
|
|
15990
16095
|
validate(diag);
|
|
15991
16096
|
return layout(diag);
|
|
15992
16097
|
}
|
|
16098
|
+
var TITLE_MAX = 18;
|
|
16099
|
+
var TITLE_MIN = 9;
|
|
16100
|
+
var TITLE_RATIO = 0.17;
|
|
16101
|
+
var SUB_RATIO = 0.72;
|
|
16102
|
+
var LINE_GAP = 3;
|
|
16103
|
+
var BOTTOM_PAD = 4;
|
|
16104
|
+
var ASCENT = 0.72;
|
|
16105
|
+
var DESCENT = 0.25;
|
|
16106
|
+
var ART_GAP = 4;
|
|
16107
|
+
var ART_MIN_BAND = 45;
|
|
16108
|
+
var \u843D\u3068\u3057\u3066\u3082\u63CF\u304F\u7A2E\u5225 = {
|
|
16109
|
+
\u80A9\u66F8: /* @__PURE__ */ new Set([
|
|
16110
|
+
// basement 系 = `commonLabel` が自前の帯に置く
|
|
16111
|
+
"shape-file",
|
|
16112
|
+
"shape-folder",
|
|
16113
|
+
"shape-cloud",
|
|
16114
|
+
"shape-cylinder",
|
|
16115
|
+
"shape-hexagon",
|
|
16116
|
+
"shape-diamond",
|
|
16117
|
+
"shape-stack",
|
|
16118
|
+
// software 系 = 固有 layout
|
|
16119
|
+
"shape-window",
|
|
16120
|
+
"shape-terminal",
|
|
16121
|
+
"shape-code-block",
|
|
16122
|
+
"shape-message-bubble",
|
|
16123
|
+
"shape-gear",
|
|
16124
|
+
// hardware 系のうち固有 layout を持つもの
|
|
16125
|
+
"shape-iot-sensor",
|
|
16126
|
+
"shape-robot-arm"
|
|
16127
|
+
]),
|
|
16128
|
+
\u8AAC\u660E: /* @__PURE__ */ new Set([
|
|
16129
|
+
// basement 系 = `commonLabel` が自前の帯に置く
|
|
16130
|
+
"shape-file",
|
|
16131
|
+
"shape-folder",
|
|
16132
|
+
"shape-cloud",
|
|
16133
|
+
"shape-cylinder",
|
|
16134
|
+
"shape-hexagon",
|
|
16135
|
+
"shape-diamond",
|
|
16136
|
+
"shape-stack",
|
|
16137
|
+
// software 系 = 固有 layout
|
|
16138
|
+
"shape-window",
|
|
16139
|
+
"shape-message-bubble",
|
|
16140
|
+
"shape-gear",
|
|
16141
|
+
// hardware / blockchain 系のうち固有 layout を持つもの
|
|
16142
|
+
"shape-iot-sensor",
|
|
16143
|
+
"shape-robot-arm",
|
|
16144
|
+
"shape-blockchain-block"
|
|
16145
|
+
])
|
|
16146
|
+
};
|
|
16147
|
+
function droppedLineIsHidden(kind, line) {
|
|
16148
|
+
return kind.startsWith("shape-") && !\u843D\u3068\u3057\u3066\u3082\u63CF\u304F\u7A2E\u5225[line].has(kind);
|
|
16149
|
+
}
|
|
16150
|
+
function labelPlan(node) {
|
|
16151
|
+
const \u9AD8\u3055 = Math.max(0, node.h);
|
|
16152
|
+
const \u5E95 = node.cy + \u9AD8\u3055 / 2;
|
|
16153
|
+
const \u5929 = node.cy - \u9AD8\u3055 / 2;
|
|
16154
|
+
const \u7A4D\u3080 = (\u540D\u524D\u5927, \u8AAC\u660E\u3042\u308A2, \u80A9\u66F8\u3042\u308A2, \u4E0B\u4F59\u767D) => {
|
|
16155
|
+
const \u5C0F\u3055\u3044\u5B57 = Math.max(1, Math.round(\u540D\u524D\u5927 * SUB_RATIO));
|
|
16156
|
+
let y = \u5E95 - \u4E0B\u4F59\u767D;
|
|
16157
|
+
const \u8AAC\u660E = \u8AAC\u660E\u3042\u308A2 ? { y, size: \u5C0F\u3055\u3044\u5B57 } : null;
|
|
16158
|
+
if (\u8AAC\u660E !== null) y -= \u5C0F\u3055\u3044\u5B57 + LINE_GAP;
|
|
16159
|
+
const \u540D\u524D = { y, size: \u540D\u524D\u5927 };
|
|
16160
|
+
y -= \u540D\u524D\u5927 + LINE_GAP;
|
|
16161
|
+
const \u80A9\u66F8 = \u80A9\u66F8\u3042\u308A2 ? { y, size: \u5C0F\u3055\u3044\u5B57 } : null;
|
|
16162
|
+
const \u4E0A\u306E\u884C = \u80A9\u66F8 ?? \u540D\u524D;
|
|
16163
|
+
return { \u540D\u524D, \u8AAC\u660E, \u80A9\u66F8, \u4E0A\u7AEF: \u4E0A\u306E\u884C.y - \u4E0A\u306E\u884C.size * ASCENT };
|
|
16164
|
+
};
|
|
16165
|
+
const \u5165\u308B = (\u8AAC\u660E\u3042\u308A2, \u80A9\u66F8\u3042\u308A2) => \u7A4D\u3080(1, \u8AAC\u660E\u3042\u308A2, \u80A9\u66F8\u3042\u308A2, 1 * DESCENT).\u4E0A\u7AEF >= \u5929;
|
|
16166
|
+
let \u8AAC\u660E\u3042\u308A = Boolean(node.subtitle);
|
|
16167
|
+
let \u80A9\u66F8\u3042\u308A = Boolean(node.eyebrow);
|
|
16168
|
+
const \u843D\u3068\u3057\u305F = [];
|
|
16169
|
+
if (!\u5165\u308B(\u8AAC\u660E\u3042\u308A, \u80A9\u66F8\u3042\u308A) && \u80A9\u66F8\u3042\u308A) {
|
|
16170
|
+
\u80A9\u66F8\u3042\u308A = false;
|
|
16171
|
+
\u843D\u3068\u3057\u305F.push("\u80A9\u66F8");
|
|
16172
|
+
}
|
|
16173
|
+
if (!\u5165\u308B(\u8AAC\u660E\u3042\u308A, \u80A9\u66F8\u3042\u308A) && \u8AAC\u660E\u3042\u308A) {
|
|
16174
|
+
\u8AAC\u660E\u3042\u308A = false;
|
|
16175
|
+
\u843D\u3068\u3057\u305F.push("\u8AAC\u660E");
|
|
16176
|
+
}
|
|
16177
|
+
const \u7D44\u3080 = (\u8AAC\u660E\u3042\u308A2, \u80A9\u66F8\u3042\u308A2) => {
|
|
16178
|
+
const \u4E0A\u9650 = Math.min(TITLE_MAX, Math.max(1, Math.round(\u9AD8\u3055 * TITLE_RATIO)));
|
|
16179
|
+
let \u540D\u524D\u5927 = 0;
|
|
16180
|
+
for (let size = \u4E0A\u9650; size >= 1; size--) {
|
|
16181
|
+
const \u5C0F\u3055\u3044\u5B572 = Math.max(1, Math.round(size * SUB_RATIO));
|
|
16182
|
+
const \u4E0B\u306E\u884C\u5927 = \u8AAC\u660E\u3042\u308A2 ? \u5C0F\u3055\u3044\u5B572 : size;
|
|
16183
|
+
if (\u7A4D\u3080(size, \u8AAC\u660E\u3042\u308A2, \u80A9\u66F8\u3042\u308A2, \u4E0B\u306E\u884C\u5927 * DESCENT).\u4E0A\u7AEF >= \u5929) {
|
|
16184
|
+
\u540D\u524D\u5927 = size;
|
|
16185
|
+
break;
|
|
16186
|
+
}
|
|
16187
|
+
}
|
|
16188
|
+
if (\u540D\u524D\u5927 === 0) \u540D\u524D\u5927 = \u9AD8\u3055 / (ASCENT + DESCENT);
|
|
16189
|
+
const \u5C0F\u3055\u3044\u5B57 = Math.max(1, Math.round(\u540D\u524D\u5927 * SUB_RATIO));
|
|
16190
|
+
const \u5F35\u308A\u51FA\u3057 = (\u8AAC\u660E\u3042\u308A2 ? \u5C0F\u3055\u3044\u5B57 : \u540D\u524D\u5927) * DESCENT;
|
|
16191
|
+
const \u4F59\u308A = Math.max(0, \u7A4D\u3080(\u540D\u524D\u5927, \u8AAC\u660E\u3042\u308A2, \u80A9\u66F8\u3042\u308A2, \u5F35\u308A\u51FA\u3057).\u4E0A\u7AEF - \u5929);
|
|
16192
|
+
const \u4E0B\u4F59\u767D = Math.min(Math.max(BOTTOM_PAD, \u5F35\u308A\u51FA\u3057), \u5F35\u308A\u51FA\u3057 + \u4F59\u308A);
|
|
16193
|
+
return \u7A4D\u3080(\u540D\u524D\u5927, \u8AAC\u660E\u3042\u308A2, \u80A9\u66F8\u3042\u308A2, \u4E0B\u4F59\u767D);
|
|
16194
|
+
};
|
|
16195
|
+
const \u7D75\u306E\u5E2F = (\u7D442) => Math.max(0, \u7D442.\u4E0A\u7AEF - ART_GAP - \u5929);
|
|
16196
|
+
let \u7D44 = \u7D44\u3080(\u8AAC\u660E\u3042\u308A, \u80A9\u66F8\u3042\u308A);
|
|
16197
|
+
if (\u7D75\u306E\u5E2F(\u7D44) < ART_MIN_BAND && \u80A9\u66F8\u3042\u308A) {
|
|
16198
|
+
\u80A9\u66F8\u3042\u308A = false;
|
|
16199
|
+
\u843D\u3068\u3057\u305F.push("\u80A9\u66F8");
|
|
16200
|
+
\u7D44 = \u7D44\u3080(\u8AAC\u660E\u3042\u308A, \u80A9\u66F8\u3042\u308A);
|
|
16201
|
+
}
|
|
16202
|
+
if (\u7D75\u306E\u5E2F(\u7D44) < ART_MIN_BAND && \u8AAC\u660E\u3042\u308A) {
|
|
16203
|
+
\u8AAC\u660E\u3042\u308A = false;
|
|
16204
|
+
\u843D\u3068\u3057\u305F.push("\u8AAC\u660E");
|
|
16205
|
+
\u7D44 = \u7D44\u3080(\u8AAC\u660E\u3042\u308A, \u80A9\u66F8\u3042\u308A);
|
|
16206
|
+
}
|
|
16207
|
+
const \u4E00\u756A\u5C0F\u3055\u3044\u884C = Math.min(
|
|
16208
|
+
...[\u7D44.\u540D\u524D, \u7D44.\u8AAC\u660E, \u7D44.\u80A9\u66F8].filter((l) => l !== null).map((l) => l.size)
|
|
16209
|
+
);
|
|
16210
|
+
return {
|
|
16211
|
+
\u540D\u524D: \u7D44.\u540D\u524D,
|
|
16212
|
+
\u8AAC\u660E: \u7D44.\u8AAC\u660E,
|
|
16213
|
+
\u80A9\u66F8: \u7D44.\u80A9\u66F8,
|
|
16214
|
+
top: \u7D44.\u4E0A\u7AEF,
|
|
16215
|
+
\u8AAD\u3081\u308B: \u4E00\u756A\u5C0F\u3055\u3044\u884C >= TITLE_MIN,
|
|
16216
|
+
\u843D\u3068\u3057\u305F
|
|
16217
|
+
};
|
|
16218
|
+
}
|
|
16219
|
+
function shapeRegion(node) {
|
|
16220
|
+
const label = labelPlan(node);
|
|
16221
|
+
const \u5929 = node.cy - node.h / 2;
|
|
16222
|
+
const availH = Math.max(0, label.top - ART_GAP - \u5929);
|
|
16223
|
+
return {
|
|
16224
|
+
cx: node.cx,
|
|
16225
|
+
cy: \u5929 + availH / 2,
|
|
16226
|
+
availW: node.w,
|
|
16227
|
+
availH,
|
|
16228
|
+
labelY: label.\u540D\u524D.y,
|
|
16229
|
+
label
|
|
16230
|
+
};
|
|
16231
|
+
}
|
|
16232
|
+
var SHADOW_GAP = 8;
|
|
16233
|
+
var FRAME_HALF = 1.5;
|
|
16234
|
+
function bodyBand(node, opt) {
|
|
16235
|
+
const \u5F71 = Math.max(0, opt.\u5F71ry);
|
|
16236
|
+
const \u5916 = Math.max(0, opt.\u5916 ?? FRAME_HALF);
|
|
16237
|
+
const \u4E0B\u4F59\u767D = Math.max(SHADOW_GAP + \u5F71, \u5916);
|
|
16238
|
+
const \u7BB1w = Math.max(0, node.w);
|
|
16239
|
+
const \u7BB1h = Math.max(0, node.h);
|
|
16240
|
+
const \u7E26\u4F59\u767D = \u5916 + \u4E0B\u4F59\u767D;
|
|
16241
|
+
const ky = \u7E26\u4F59\u767D > \u7BB1h && \u7E26\u4F59\u767D > 0 ? \u7BB1h / \u7E26\u4F59\u767D : 1;
|
|
16242
|
+
const \u6A2A\u4F59\u767D = \u5916 * 2;
|
|
16243
|
+
const kx = \u6A2A\u4F59\u767D > \u7BB1w && \u6A2A\u4F59\u767D > 0 ? \u7BB1w / \u6A2A\u4F59\u767D : 1;
|
|
16244
|
+
const x = node.cx - \u7BB1w / 2 + \u5916 * kx;
|
|
16245
|
+
const y = node.cy - \u7BB1h / 2 + \u5916 * ky;
|
|
16246
|
+
const w = Math.max(0, \u7BB1w - \u6A2A\u4F59\u767D * kx);
|
|
16247
|
+
const h = Math.max(0, \u7BB1h - \u7E26\u4F59\u767D * ky);
|
|
16248
|
+
return { x, y, w, h, cx: x + w / 2, cy: y + h / 2, \u53F3: x + w, \u5E95: y + h };
|
|
16249
|
+
}
|
|
16250
|
+
function fitLabel(band, block, pos) {
|
|
16251
|
+
const \u7E26 = block.\u4E0A + block.\u4E0B;
|
|
16252
|
+
const \u6A2A = Math.max(0, block.\u5E45);
|
|
16253
|
+
if (!(\u7E26 > 0)) return { k: 1, x: pos.x, y: pos.y };
|
|
16254
|
+
if (!(band.h > 0) || !(band.w > 0)) return { k: 0, x: band.x + band.w / 2, y: band.y };
|
|
16255
|
+
const k = Math.min(1, band.h / \u7E26, \u6A2A > 0 ? band.w / \u6A2A : 1);
|
|
16256
|
+
const \u534A = \u6A2A * k / 2;
|
|
16257
|
+
return {
|
|
16258
|
+
k,
|
|
16259
|
+
x: Math.max(band.x + \u534A, Math.min(pos.x, band.x + band.w - \u534A)),
|
|
16260
|
+
y: Math.max(band.y + block.\u4E0A * k, Math.min(pos.y, band.y + band.h - block.\u4E0B * k))
|
|
16261
|
+
};
|
|
16262
|
+
}
|
|
16263
|
+
function fitArt(region, extent, art) {
|
|
16264
|
+
const \u7E26 = extent.\u4E0A + extent.\u4E0B;
|
|
16265
|
+
const \u6A2A = extent.\u5DE6 + extent.\u53F3;
|
|
16266
|
+
if (!Number.isFinite(\u7E26) || !Number.isFinite(\u6A2A) || \u7E26 <= 0 || \u6A2A <= 0) return art;
|
|
16267
|
+
if (!Number.isFinite(region.availH) || !Number.isFinite(region.availW) || region.availH <= 0 || region.availW <= 0) {
|
|
16268
|
+
return art;
|
|
16269
|
+
}
|
|
16270
|
+
const s = Math.min(1, region.availH / \u7E26, region.availW / \u6A2A);
|
|
16271
|
+
if (!Number.isFinite(s) || s <= 0) return art;
|
|
16272
|
+
const \u7D75cx = region.cx + (extent.\u53F3 - extent.\u5DE6) / 2;
|
|
16273
|
+
const \u7D75cy = region.cy + (extent.\u4E0B - extent.\u4E0A) / 2;
|
|
16274
|
+
const dx = region.cx - s * \u7D75cx;
|
|
16275
|
+
const dy = region.cy - s * \u7D75cy;
|
|
16276
|
+
if (s >= 1 && dx === 0 && dy === 0) return art;
|
|
16277
|
+
return /* @__PURE__ */ jsxRuntime.jsx("g", { transform: `translate(${dx} ${dy}) scale(${s})`, children: art });
|
|
16278
|
+
}
|
|
15993
16279
|
|
|
15994
16280
|
// src/layout/geometry.ts
|
|
15995
16281
|
function pointRectEdgeDistance(px, py, rect) {
|
|
@@ -16156,6 +16442,7 @@ function emptyCounts() {
|
|
|
16156
16442
|
"validate-performance-budget": 0,
|
|
16157
16443
|
"node-inside-viewbox": 0,
|
|
16158
16444
|
"node-inside-lane": 0,
|
|
16445
|
+
"shape-label-dropped": 0,
|
|
16159
16446
|
"edge-inside-viewbox": 0,
|
|
16160
16447
|
"lane-label-inside-viewbox": 0,
|
|
16161
16448
|
"lane-label-overlap": 0,
|
|
@@ -16846,6 +17133,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes) {
|
|
|
16846
17133
|
for (const n of laid.nodes) {
|
|
16847
17134
|
if (n.id.endsWith("-spacer")) continue;
|
|
16848
17135
|
if (!rendersTitleText(n.kind)) continue;
|
|
17136
|
+
if (fitsOwnTitleWidth(n.kind)) continue;
|
|
16849
17137
|
if (!isRenderedNode(n)) continue;
|
|
16850
17138
|
const titleTrimmed = n.title?.trim() ?? "";
|
|
16851
17139
|
if (!titleTrimmed) continue;
|
|
@@ -17102,6 +17390,15 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes) {
|
|
|
17102
17390
|
);
|
|
17103
17391
|
}
|
|
17104
17392
|
}
|
|
17393
|
+
for (const n of laid.nodes) {
|
|
17394
|
+
const \u843D\u3068\u3057\u305F = labelPlan(n).\u843D\u3068\u3057\u305F.filter((line) => droppedLineIsHidden(n.kind, line));
|
|
17395
|
+
if (\u843D\u3068\u3057\u305F.length === 0) continue;
|
|
17396
|
+
push(
|
|
17397
|
+
"shape-label-dropped",
|
|
17398
|
+
`node "${n.id}" (${n.kind}, ${n.w.toFixed(0)}x${n.h.toFixed(0)}) \u306F\u66F8\u3044\u305F ${\u843D\u3068\u3057\u305F.join(" / ")} \u304C\u63CF\u304B\u308C\u306A\u3044\u3002 \u7BB1\u3092\u9AD8\u304F\u3059\u308B\u304B\u3001 \u305D\u306E\u884C\u3092\u6D88\u3059`,
|
|
17399
|
+
"warn"
|
|
17400
|
+
);
|
|
17401
|
+
}
|
|
17105
17402
|
for (const e of laid.edges) {
|
|
17106
17403
|
const segs = flattenPathSegments(extractPathSegments(e.d));
|
|
17107
17404
|
if (segs.length === 0) continue;
|
|
@@ -18346,6 +18643,7 @@ function validateMetaAxes(totalCounts, diagrams = [], durations = [], reports =
|
|
|
18346
18643
|
"validate-performance-budget",
|
|
18347
18644
|
"node-inside-viewbox",
|
|
18348
18645
|
"node-inside-lane",
|
|
18646
|
+
"shape-label-dropped",
|
|
18349
18647
|
"edge-inside-viewbox",
|
|
18350
18648
|
"lane-label-inside-viewbox",
|
|
18351
18649
|
"lane-label-overlap",
|
|
@@ -18414,6 +18712,7 @@ function validateMetaAxes(totalCounts, diagrams = [], durations = [], reports =
|
|
|
18414
18712
|
"validate-performance-budget",
|
|
18415
18713
|
"node-inside-viewbox",
|
|
18416
18714
|
"node-inside-lane",
|
|
18715
|
+
"shape-label-dropped",
|
|
18417
18716
|
"edge-inside-viewbox",
|
|
18418
18717
|
"lane-label-inside-viewbox",
|
|
18419
18718
|
"lane-label-overlap",
|
|
@@ -18440,7 +18739,7 @@ function validateMetaAxes(totalCounts, diagrams = [], durations = [], reports =
|
|
|
18440
18739
|
});
|
|
18441
18740
|
}
|
|
18442
18741
|
}
|
|
18443
|
-
const EXPECTED_AXIS_COUNT =
|
|
18742
|
+
const EXPECTED_AXIS_COUNT = 67;
|
|
18444
18743
|
if (allAxes.length !== EXPECTED_AXIS_COUNT) {
|
|
18445
18744
|
out.push({
|
|
18446
18745
|
axis: "axis-documentation-completeness",
|
|
@@ -19652,7 +19951,7 @@ function StateDiffCard({
|
|
|
19652
19951
|
] }) }),
|
|
19653
19952
|
/* @__PURE__ */ jsxRuntime.jsx("tbody", { style: { color: "var(--cdl-text, #1a1f2a)" }, children: states.map((s) => {
|
|
19654
19953
|
const initial = String(s.initial);
|
|
19655
|
-
const current = stateValues[s.id]
|
|
19954
|
+
const current = Object.hasOwn(stateValues, s.id) ? stateValues[s.id] : initial;
|
|
19656
19955
|
const changed = initial !== current;
|
|
19657
19956
|
return /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
19658
19957
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "py-1 text-left text-[12px]", children: s.id }),
|
|
@@ -19941,14 +20240,14 @@ function fitTextSize(text, maxWidth, targetSize, minSize) {
|
|
|
19941
20240
|
var COMPACT_MAX_H = 100;
|
|
19942
20241
|
var COMPACT_PADDING_X = 16;
|
|
19943
20242
|
var MIN_SIZE = 11;
|
|
19944
|
-
var
|
|
19945
|
-
var
|
|
19946
|
-
var MIN_BAND_H = MIN_SIZE * (
|
|
20243
|
+
var ASCENT2 = 0.72;
|
|
20244
|
+
var DESCENT2 = 0.25;
|
|
20245
|
+
var MIN_BAND_H = MIN_SIZE * (ASCENT2 + DESCENT2);
|
|
19947
20246
|
var EYEBROW_BASELINE = 38;
|
|
19948
20247
|
var EYEBROW_SIZE = 18;
|
|
19949
20248
|
var EYEBROW_GAP = 8;
|
|
19950
20249
|
var BOTTOM_INSET = 4;
|
|
19951
|
-
var eyebrowBottom = () => EYEBROW_BASELINE + EYEBROW_SIZE *
|
|
20250
|
+
var eyebrowBottom = () => EYEBROW_BASELINE + EYEBROW_SIZE * DESCENT2;
|
|
19952
20251
|
var titleBandTop = (hasEyebrow) => eyebrowBottom() + EYEBROW_GAP ;
|
|
19953
20252
|
var isCompactBox = (h) => h < COMPACT_MAX_H;
|
|
19954
20253
|
function titlePlacement(node, \u901A\u5E38, opts = {}) {
|
|
@@ -19967,10 +20266,10 @@ function titlePlacement(node, \u901A\u5E38, opts = {}) {
|
|
|
19967
20266
|
\u901A\u5E38.size,
|
|
19968
20267
|
MIN_SIZE
|
|
19969
20268
|
);
|
|
19970
|
-
const \u5E2F\u3067 = Math.floor(\u5E2F / (
|
|
20269
|
+
const \u5E2F\u3067 = Math.floor(\u5E2F / (ASCENT2 + DESCENT2));
|
|
19971
20270
|
const size = Math.max(MIN_SIZE, Math.min(\u5E45\u3067, \u5E2F\u3067));
|
|
19972
|
-
const \u5B57\u9AD8 = size * (
|
|
19973
|
-
const y = \u5B57\u9AD8 <= \u5E2F ? \u4E0A + \u5E2F / 2 + size * (
|
|
20271
|
+
const \u5B57\u9AD8 = size * (ASCENT2 + DESCENT2);
|
|
20272
|
+
const y = \u5B57\u9AD8 <= \u5E2F ? \u4E0A + \u5E2F / 2 + size * (ASCENT2 - DESCENT2) / 2 : \u4E0A > 0 ? \u4E0A + size * ASCENT2 : (\u9AD8\u3055 - \u5B57\u9AD8) / 2 + size * ASCENT2;
|
|
19974
20273
|
return { x: node.w / 2, y, size, anchor: "middle" };
|
|
19975
20274
|
}
|
|
19976
20275
|
function ActorNode({ node, active, value }) {
|
|
@@ -20928,6 +21227,42 @@ function resolveJourneyData(steps, values) {
|
|
|
20928
21227
|
return e.ok ? { ...s, emotion: e.value } : { ...s, emotion: e.value, unresolved: true };
|
|
20929
21228
|
});
|
|
20930
21229
|
}
|
|
21230
|
+
function resolveBoundText(raw, values) {
|
|
21231
|
+
if (!raw.includes("{")) return { value: raw, ok: true };
|
|
21232
|
+
const resolved = interpolate(raw, values);
|
|
21233
|
+
return hasUnresolvedRef(resolved) ? { value: resolved, ok: false } : { value: resolved, ok: true };
|
|
21234
|
+
}
|
|
21235
|
+
function resolveTreeData(nodes, values) {
|
|
21236
|
+
const \u8AAD\u3080 = nodes.some((n) => n.title.includes("{") || (n.subtitle?.includes("{") ?? false));
|
|
21237
|
+
if (!\u8AAD\u3080) return nodes;
|
|
21238
|
+
return nodes.map((n) => {
|
|
21239
|
+
const title = resolveBoundText(n.title, values);
|
|
21240
|
+
const subtitle = n.subtitle === void 0 ? void 0 : resolveBoundText(n.subtitle, values);
|
|
21241
|
+
const \u89E3\u6C7A\u5F8C = {
|
|
21242
|
+
...n,
|
|
21243
|
+
title: title.value,
|
|
21244
|
+
...subtitle ? { subtitle: subtitle.value } : {}
|
|
21245
|
+
};
|
|
21246
|
+
return title.ok && (subtitle?.ok ?? true) ? \u89E3\u6C7A\u5F8C : { ...\u89E3\u6C7A\u5F8C, unresolved: true };
|
|
21247
|
+
});
|
|
21248
|
+
}
|
|
21249
|
+
function resolveMindData(data, values) {
|
|
21250
|
+
const \u8AAD\u3080 = data.rootTitle.includes("{") || data.branches.some((b) => b.title.includes("{") || (b.subtitle?.includes("{") ?? false));
|
|
21251
|
+
if (!\u8AAD\u3080) return data;
|
|
21252
|
+
const root = resolveBoundText(data.rootTitle, values);
|
|
21253
|
+
const branches = data.branches.map((b) => {
|
|
21254
|
+
const title = resolveBoundText(b.title, values);
|
|
21255
|
+
const subtitle = b.subtitle === void 0 ? void 0 : resolveBoundText(b.subtitle, values);
|
|
21256
|
+
const \u89E3\u6C7A\u5F8C2 = {
|
|
21257
|
+
...b,
|
|
21258
|
+
title: title.value,
|
|
21259
|
+
...subtitle ? { subtitle: subtitle.value } : {}
|
|
21260
|
+
};
|
|
21261
|
+
return title.ok && (subtitle?.ok ?? true) ? \u89E3\u6C7A\u5F8C2 : { ...\u89E3\u6C7A\u5F8C2, unresolved: true };
|
|
21262
|
+
});
|
|
21263
|
+
const \u89E3\u6C7A\u5F8C = { ...data, rootTitle: root.value, branches };
|
|
21264
|
+
return root.ok ? \u89E3\u6C7A\u5F8C : { ...\u89E3\u6C7A\u5F8C, unresolved: true };
|
|
21265
|
+
}
|
|
20931
21266
|
function ChartLineNode({
|
|
20932
21267
|
node,
|
|
20933
21268
|
active,
|
|
@@ -21334,16 +21669,53 @@ function GanttNode({
|
|
|
21334
21669
|
const rowGap = 20;
|
|
21335
21670
|
const rowCount = tasks.length || 1;
|
|
21336
21671
|
const rowH = Math.max(28, (canvasH - rowGap * (rowCount + 1)) / rowCount);
|
|
21337
|
-
const
|
|
21672
|
+
const \u4F4D\u7F6E\u306E\u4E0A\u9650 = 1e6;
|
|
21673
|
+
const \u53CE\u3081\u305F = tasks.map((t) => {
|
|
21674
|
+
const \u59CB = Math.min(\u4F4D\u7F6E\u306E\u4E0A\u9650, Math.max(0, Number.isFinite(t.startIdx) ? t.startIdx : 0));
|
|
21675
|
+
const \u7D42 = Math.min(\u4F4D\u7F6E\u306E\u4E0A\u9650, Math.max(\u59CB, Number.isFinite(t.endIdx) ? t.endIdx : \u59CB));
|
|
21676
|
+
return { ...t, startIdx: \u59CB, endIdx: \u7D42 };
|
|
21677
|
+
});
|
|
21678
|
+
const \u5BA3\u8A00 = node.ganttAxisMax;
|
|
21679
|
+
const \u5BA3\u8A00\u3057\u305F\u5C3A = typeof \u5BA3\u8A00 === "number" && Number.isFinite(\u5BA3\u8A00) && \u5BA3\u8A00 > 0 ? Math.min(\u4F4D\u7F6E\u306E\u4E0A\u9650, Math.ceil(\u5BA3\u8A00)) : void 0;
|
|
21680
|
+
const maxIdx = \u5BA3\u8A00\u3057\u305F\u5C3A ?? Math.max(
|
|
21681
|
+
1,
|
|
21682
|
+
Math.ceil(Math.max(...\u53CE\u3081\u305F.flatMap((t) => [t.startIdx + 1, t.endIdx + 1]), 1))
|
|
21683
|
+
);
|
|
21338
21684
|
const cellW = canvasW / maxIdx;
|
|
21685
|
+
const \u6700\u5F8C\u306E\u76EE\u76DB\u308A = maxIdx - 1;
|
|
21686
|
+
const \u6574\u3048\u305F = \u5BA3\u8A00\u3057\u305F\u5C3A === void 0 ? \u53CE\u3081\u305F : \u53CE\u3081\u305F.map((t) => {
|
|
21687
|
+
const \u59CB = Math.min(t.startIdx, \u6700\u5F8C\u306E\u76EE\u76DB\u308A);
|
|
21688
|
+
const \u7D42 = Math.min(t.endIdx, \u6700\u5F8C\u306E\u76EE\u76DB\u308A);
|
|
21689
|
+
const \u5BC4\u305B\u305F = \u59CB !== t.startIdx || \u7D42 !== t.endIdx;
|
|
21690
|
+
return \u5BC4\u305B\u305F ? { ...t, startIdx: \u59CB, endIdx: \u7D42, clipped: true } : t;
|
|
21691
|
+
});
|
|
21692
|
+
const \u76EE\u76DB\u308A\u306E\u4E0A\u9650 = 200;
|
|
21693
|
+
const \u76EE\u76DB\u308A\u306E\u9593\u9694 = Math.max(1, Math.ceil(maxIdx / \u76EE\u76DB\u308A\u306E\u4E0A\u9650));
|
|
21694
|
+
const \u76EE\u76DB\u308A\u306E\u672C\u6570 = Math.ceil(maxIdx / \u76EE\u76DB\u308A\u306E\u9593\u9694);
|
|
21339
21695
|
const xAt = (idx) => PAD_LEFT + idx * cellW;
|
|
21340
21696
|
const yAt = (row) => PAD_TOP + rowGap + row * (rowH + rowGap);
|
|
21341
|
-
const
|
|
21342
|
-
|
|
21343
|
-
|
|
21344
|
-
}
|
|
21345
|
-
const
|
|
21346
|
-
|
|
21697
|
+
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() };
|
|
21698
|
+
const \u7F6E\u304F = (\u8868, \u4F4D\u7F6E, label) => {
|
|
21699
|
+
if (label !== "" && Number.isFinite(\u4F4D\u7F6E) && !\u8868.has(\u4F4D\u7F6E)) \u8868.set(\u4F4D\u7F6E, label);
|
|
21700
|
+
};
|
|
21701
|
+
for (const t of \u53CE\u3081\u305F) {
|
|
21702
|
+
const \u6574\u6570\u306E\u958B\u59CB = Number.isInteger(t.startIdx);
|
|
21703
|
+
\u7F6E\u304F(\u6574\u6570\u306E\u958B\u59CB ? \u540D\u524D.\u6574\u6570\u306E\u958B\u59CB : \u540D\u524D.\u7AEF\u6570\u306E\u958B\u59CB, Math.round(t.startIdx), t.startLabel);
|
|
21704
|
+
const \u6574\u6570\u306E\u7D42\u4E86 = Number.isInteger(t.endIdx);
|
|
21705
|
+
\u7F6E\u304F(\u6574\u6570\u306E\u7D42\u4E86 ? \u540D\u524D.\u6574\u6570\u306E\u7D42\u4E86 : \u540D\u524D.\u7AEF\u6570\u306E\u7D42\u4E86, Math.round(t.endIdx), t.endLabel);
|
|
21706
|
+
}
|
|
21707
|
+
const \u540D\u524D\u3092\u5F15\u304F = (i) => \u540D\u524D.\u6574\u6570\u306E\u958B\u59CB.get(i) ?? \u540D\u524D.\u6574\u6570\u306E\u7D42\u4E86.get(i) ?? \u540D\u524D.\u7AEF\u6570\u306E\u958B\u59CB.get(i) ?? \u540D\u524D.\u7AEF\u6570\u306E\u7D42\u4E86.get(i) ?? "";
|
|
21708
|
+
const \u4F4D\u7F6E\u306E\u96C6\u5408 = /* @__PURE__ */ new Set();
|
|
21709
|
+
for (let n = 0; n < \u76EE\u76DB\u308A\u306E\u672C\u6570; n += 1) \u4F4D\u7F6E\u306E\u96C6\u5408.add(n * \u76EE\u76DB\u308A\u306E\u9593\u9694);
|
|
21710
|
+
for (const \u8868 of [\u540D\u524D.\u6574\u6570\u306E\u958B\u59CB, \u540D\u524D.\u6574\u6570\u306E\u7D42\u4E86, \u540D\u524D.\u7AEF\u6570\u306E\u958B\u59CB, \u540D\u524D.\u7AEF\u6570\u306E\u7D42\u4E86]) {
|
|
21711
|
+
for (const i of \u8868.keys()) if (i >= 0 && i < maxIdx) \u4F4D\u7F6E\u306E\u96C6\u5408.add(i);
|
|
21712
|
+
}
|
|
21713
|
+
const gridLabels = [...\u4F4D\u7F6E\u306E\u96C6\u5408].sort((a, b) => a - b).map((i) => ({ \u4F4D\u7F6E: i, label: \u540D\u524D\u3092\u5F15\u304F(i) }));
|
|
21714
|
+
const \u5E2F\u306E\u4F59\u767D = Math.min(6, cellW / 2);
|
|
21715
|
+
const \u5E2F\u306E\u5DE6 = (idx) => xAt(idx) + \u5E2F\u306E\u4F59\u767D / 2;
|
|
21716
|
+
const \u5E2F\u306E\u53F3 = (idx) => xAt(idx) + cellW - \u5E2F\u306E\u4F59\u767D / 2;
|
|
21717
|
+
const taskById = new Map(\u6574\u3048\u305F.map((t) => [t.id, t]));
|
|
21718
|
+
const rowOf = new Map(\u6574\u3048\u305F.map((t, i) => [t.id, i]));
|
|
21347
21719
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
21348
21720
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21349
21721
|
"rect",
|
|
@@ -21359,10 +21731,11 @@ function GanttNode({
|
|
|
21359
21731
|
strokeWidth: active ? 3 : 1.25
|
|
21360
21732
|
}
|
|
21361
21733
|
),
|
|
21362
|
-
gridLabels.map((
|
|
21734
|
+
gridLabels.map(({ \u4F4D\u7F6E: i, label }) => /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
21363
21735
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21364
21736
|
"line",
|
|
21365
21737
|
{
|
|
21738
|
+
"data-cdl-role": "gantt-grid",
|
|
21366
21739
|
x1: xAt(i),
|
|
21367
21740
|
y1: PAD_TOP,
|
|
21368
21741
|
x2: xAt(i),
|
|
@@ -21373,9 +21746,10 @@ function GanttNode({
|
|
|
21373
21746
|
opacity: 0.5
|
|
21374
21747
|
}
|
|
21375
21748
|
),
|
|
21376
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21749
|
+
label === "" ? null : /* @__PURE__ */ jsxRuntime.jsx(
|
|
21377
21750
|
"text",
|
|
21378
21751
|
{
|
|
21752
|
+
"data-cdl-role": "gantt-tick",
|
|
21379
21753
|
x: xAt(i) + cellW / 2,
|
|
21380
21754
|
y: PAD_TOP + canvasH + 18,
|
|
21381
21755
|
fontSize: 11,
|
|
@@ -21397,7 +21771,7 @@ function GanttNode({
|
|
|
21397
21771
|
opacity: 0.5
|
|
21398
21772
|
}
|
|
21399
21773
|
),
|
|
21400
|
-
|
|
21774
|
+
\u6574\u3048\u305F.map((t, row) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
21401
21775
|
"text",
|
|
21402
21776
|
{
|
|
21403
21777
|
x: PAD_LEFT - 12,
|
|
@@ -21410,16 +21784,17 @@ function GanttNode({
|
|
|
21410
21784
|
},
|
|
21411
21785
|
`label-${t.id}`
|
|
21412
21786
|
)),
|
|
21413
|
-
|
|
21414
|
-
const bx =
|
|
21787
|
+
\u6574\u3048\u305F.map((t, row) => {
|
|
21788
|
+
const bx = \u5E2F\u306E\u5DE6(t.startIdx);
|
|
21415
21789
|
const by = yAt(row);
|
|
21416
|
-
const bw = Math.max(
|
|
21790
|
+
const bw = Math.max(0, \u5E2F\u306E\u53F3(t.endIdx) - bx);
|
|
21417
21791
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
21418
21792
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21419
21793
|
"rect",
|
|
21420
21794
|
{
|
|
21421
21795
|
"data-cdl-role": "gantt-bar",
|
|
21422
21796
|
"data-cdl-unresolved": t.unresolved ? "true" : void 0,
|
|
21797
|
+
"data-cdl-clipped": "clipped" in t && t.clipped ? "true" : void 0,
|
|
21423
21798
|
x: bx,
|
|
21424
21799
|
y: by,
|
|
21425
21800
|
width: bw,
|
|
@@ -21442,13 +21817,13 @@ function GanttNode({
|
|
|
21442
21817
|
)
|
|
21443
21818
|
] }, `bar-${t.id}`);
|
|
21444
21819
|
}),
|
|
21445
|
-
|
|
21820
|
+
\u6574\u3048\u305F.filter((t) => t.dependsOn && taskById.has(t.dependsOn)).map((t) => {
|
|
21446
21821
|
const parent = taskById.get(t.dependsOn);
|
|
21447
21822
|
const parentRow = rowOf.get(parent.id);
|
|
21448
21823
|
const childRow = rowOf.get(t.id);
|
|
21449
|
-
const parentBarRight =
|
|
21824
|
+
const parentBarRight = \u5E2F\u306E\u53F3(parent.endIdx);
|
|
21450
21825
|
const parentMidY = yAt(parentRow) + rowH / 2;
|
|
21451
|
-
const childBarLeft =
|
|
21826
|
+
const childBarLeft = \u5E2F\u306E\u5DE6(t.startIdx);
|
|
21452
21827
|
const childMidY = yAt(childRow) + rowH / 2;
|
|
21453
21828
|
const arrowHeadSize = 8;
|
|
21454
21829
|
const arrowHeadTipGap = 10;
|
|
@@ -21490,12 +21865,59 @@ function toneColor3(tone) {
|
|
|
21490
21865
|
if (!tone) return TONE.accent;
|
|
21491
21866
|
return TONE[tone];
|
|
21492
21867
|
}
|
|
21868
|
+
|
|
21869
|
+
// src/kinds/box-lines.ts
|
|
21870
|
+
var \u884C\u9001\u308A\u306E\u6BD4 = 1.15;
|
|
21871
|
+
var \u5B57\u306E\u9AD8\u3055\u306E\u6BD4 = 0.72;
|
|
21872
|
+
var \u4E0A\u4E0B\u306E\u4F59\u767D = 2;
|
|
21873
|
+
var \u5DE6\u53F3\u306E\u4F59\u767D = 8;
|
|
21874
|
+
function \u5E45\u3067\u5207\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E45, \u6E2C\u308B = textWidth) {
|
|
21875
|
+
if (\u4F7F\u3048\u308B\u5E45 <= 0) return "";
|
|
21876
|
+
if (\u6E2C\u308B(text, fontSize) <= \u4F7F\u3048\u308B\u5E45) return text;
|
|
21877
|
+
const \u7701\u7565 = "\u2026";
|
|
21878
|
+
const \u7701\u7565\u306E\u5E45 = \u6E2C\u308B(\u7701\u7565, fontSize);
|
|
21879
|
+
if (\u7701\u7565\u306E\u5E45 > \u4F7F\u3048\u308B\u5E45) return "";
|
|
21880
|
+
let \u51FA = "";
|
|
21881
|
+
let \u5E45 = 0;
|
|
21882
|
+
for (const c of \u66F8\u8A18\u7D20\u306B\u5206\u3051\u308B(text)) {
|
|
21883
|
+
const \u5B57\u306E\u5E452 = \u6E2C\u308B(c, fontSize);
|
|
21884
|
+
if (\u5E45 + \u5B57\u306E\u5E452 + \u7701\u7565\u306E\u5E45 > \u4F7F\u3048\u308B\u5E45) break;
|
|
21885
|
+
\u5E45 += \u5B57\u306E\u5E452;
|
|
21886
|
+
\u51FA += c;
|
|
21887
|
+
}
|
|
21888
|
+
return `${\u51FA}${\u7701\u7565}`;
|
|
21889
|
+
}
|
|
21890
|
+
function \u66F8\u8A18\u7D20\u306B\u5206\u3051\u308B(text) {
|
|
21891
|
+
const \u533A\u5207\u308A = Intl.Segmenter;
|
|
21892
|
+
if (typeof \u533A\u5207\u308A !== "function") return [...text];
|
|
21893
|
+
return [...new \u533A\u5207\u308A(void 0, { granularity: "grapheme" }).segment(text)].map((g) => g.segment);
|
|
21894
|
+
}
|
|
21895
|
+
function \u7BB1\u306B\u7A4D\u3080(\u884C, \u7BB1\u306E\u5E45, \u7BB1\u306E\u9AD8\u3055) {
|
|
21896
|
+
const \u5019\u88DC = \u884C.filter((r, i) => i === 0 || r.text.trim() !== "");
|
|
21897
|
+
if (\u5019\u88DC.length === 0) return [];
|
|
21898
|
+
const \u4F7F\u3048\u308B\u9AD8\u3055 = \u7BB1\u306E\u9AD8\u3055 - \u4E0A\u4E0B\u306E\u4F59\u767D * 2;
|
|
21899
|
+
const \u9AD8\u3055 = (rs) => rs.reduce((a, r) => a + r.fontSize * \u884C\u9001\u308A\u306E\u6BD4, 0);
|
|
21900
|
+
const \u6B8B\u3059 = [...\u5019\u88DC];
|
|
21901
|
+
while (\u6B8B\u3059.length > 1 && \u9AD8\u3055(\u6B8B\u3059) > \u4F7F\u3048\u308B\u9AD8\u3055) \u6B8B\u3059.pop();
|
|
21902
|
+
const \u4F7F\u3048\u308B\u5E45 = \u7BB1\u306E\u5E45 - \u5DE6\u53F3\u306E\u4F59\u767D * 2;
|
|
21903
|
+
const \u7DCF\u9AD8 = \u9AD8\u3055(\u6B8B\u3059);
|
|
21904
|
+
let \u7A4D\u307F = -\u7DCF\u9AD8 / 2;
|
|
21905
|
+
return \u6B8B\u3059.map((r) => {
|
|
21906
|
+
const dy = \u7A4D\u307F + (\u884C\u9001\u308A\u306E\u6BD4 + \u5B57\u306E\u9AD8\u3055\u306E\u6BD4) / 2 * r.fontSize;
|
|
21907
|
+
\u7A4D\u307F += r.fontSize * \u884C\u9001\u308A\u306E\u6BD4;
|
|
21908
|
+
return { ...r, text: \u5E45\u3067\u5207\u308B(r.text, r.fontSize, \u4F7F\u3048\u308B\u5E45), dy };
|
|
21909
|
+
});
|
|
21910
|
+
}
|
|
21493
21911
|
var MIND_TONES = ["accent", "teal", "success", "warning", "info", "error"];
|
|
21494
21912
|
var MIND_BOX_GAP = 24;
|
|
21495
|
-
function MindMapNode({
|
|
21913
|
+
function MindMapNode({
|
|
21914
|
+
node,
|
|
21915
|
+
active,
|
|
21916
|
+
stateValues = {}
|
|
21917
|
+
}) {
|
|
21496
21918
|
const x0 = node.cx - node.w / 2;
|
|
21497
21919
|
const y0 = node.cy - node.h / 2;
|
|
21498
|
-
const mindData = node.mindData;
|
|
21920
|
+
const mindData = node.mindData ? resolveMindData(node.mindData, stateValues) : void 0;
|
|
21499
21921
|
if (!mindData) return /* @__PURE__ */ jsxRuntime.jsx("g", { transform: `translate(${x0} ${y0})` });
|
|
21500
21922
|
const PAD = 40;
|
|
21501
21923
|
const canvasCx = node.w / 2;
|
|
@@ -21531,33 +21953,59 @@ function MindMapNode({ node, active }) {
|
|
|
21531
21953
|
},
|
|
21532
21954
|
`edge-${i}`
|
|
21533
21955
|
)),
|
|
21534
|
-
layout2.nodes.map((n) =>
|
|
21535
|
-
|
|
21536
|
-
|
|
21537
|
-
|
|
21538
|
-
|
|
21539
|
-
|
|
21540
|
-
|
|
21541
|
-
|
|
21542
|
-
|
|
21543
|
-
|
|
21544
|
-
|
|
21545
|
-
|
|
21546
|
-
|
|
21547
|
-
|
|
21548
|
-
|
|
21549
|
-
|
|
21550
|
-
|
|
21551
|
-
|
|
21552
|
-
|
|
21553
|
-
|
|
21554
|
-
|
|
21555
|
-
|
|
21556
|
-
|
|
21557
|
-
|
|
21558
|
-
|
|
21559
|
-
|
|
21560
|
-
|
|
21956
|
+
layout2.nodes.map((n) => {
|
|
21957
|
+
const \u884C = \u7BB1\u306B\u7A4D\u3080(
|
|
21958
|
+
[
|
|
21959
|
+
{ \u5F79\u5272: "title", text: n.title, fontSize: n.isRoot ? 15 : 13 },
|
|
21960
|
+
{ \u5F79\u5272: "subtitle", text: n.subtitle ?? "", fontSize: 9 }
|
|
21961
|
+
],
|
|
21962
|
+
n.w,
|
|
21963
|
+
n.h
|
|
21964
|
+
);
|
|
21965
|
+
const \u88DC\u8DB3\u3042\u308A = (n.subtitle ?? "").trim() !== "";
|
|
21966
|
+
const \u6587\u5B57\u306E\u8272 = n.isRoot ? "var(--cdl-text-on-tone, #ffffff)" : "var(--cdl-chip-text, #1a1f2a)";
|
|
21967
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-unresolved": n.unresolved ? "true" : void 0, children: [
|
|
21968
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21969
|
+
"rect",
|
|
21970
|
+
{
|
|
21971
|
+
x: n.x - n.w / 2,
|
|
21972
|
+
y: n.y - n.h / 2,
|
|
21973
|
+
width: n.w,
|
|
21974
|
+
height: n.h,
|
|
21975
|
+
rx: n.isRoot ? 22 : 10,
|
|
21976
|
+
fill: n.isRoot ? toneColor4(n.tone ?? "accent") : "var(--cdl-chip-fill, #f4f6fb)",
|
|
21977
|
+
stroke: n.isRoot ? toneColor4(n.tone ?? "accent") : toneColor4(n.tone),
|
|
21978
|
+
strokeWidth: n.isRoot ? 2 : 1.75
|
|
21979
|
+
}
|
|
21980
|
+
),
|
|
21981
|
+
\u88DC\u8DB3\u3042\u308A ? \u884C.map((r) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
21982
|
+
"text",
|
|
21983
|
+
{
|
|
21984
|
+
"data-cdl-role": r.\u5F79\u5272 === "subtitle" ? "mind-node-subtitle" : void 0,
|
|
21985
|
+
x: n.x,
|
|
21986
|
+
y: n.y + r.dy,
|
|
21987
|
+
fontSize: r.fontSize,
|
|
21988
|
+
fontWeight: r.\u5F79\u5272 === "title" ? n.isRoot ? 700 : 600 : 500,
|
|
21989
|
+
textAnchor: "middle",
|
|
21990
|
+
fill: \u6587\u5B57\u306E\u8272,
|
|
21991
|
+
opacity: r.\u5F79\u5272 === "subtitle" ? 0.85 : void 0,
|
|
21992
|
+
children: r.text
|
|
21993
|
+
},
|
|
21994
|
+
r.\u5F79\u5272
|
|
21995
|
+
)) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
21996
|
+
"text",
|
|
21997
|
+
{
|
|
21998
|
+
x: n.x,
|
|
21999
|
+
y: n.y + 5,
|
|
22000
|
+
fontSize: n.isRoot ? 15 : 13,
|
|
22001
|
+
fontWeight: n.isRoot ? 700 : 600,
|
|
22002
|
+
textAnchor: "middle",
|
|
22003
|
+
fill: \u6587\u5B57\u306E\u8272,
|
|
22004
|
+
children: n.title
|
|
22005
|
+
}
|
|
22006
|
+
)
|
|
22007
|
+
] }, `n-${n.id}`);
|
|
22008
|
+
})
|
|
21561
22009
|
] });
|
|
21562
22010
|
}
|
|
21563
22011
|
function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
|
|
@@ -21572,7 +22020,8 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
|
|
|
21572
22020
|
y: cy,
|
|
21573
22021
|
w: rootW,
|
|
21574
22022
|
h: rootH,
|
|
21575
|
-
isRoot: true
|
|
22023
|
+
isRoot: true,
|
|
22024
|
+
...mindData.unresolved ? { unresolved: true } : {}
|
|
21576
22025
|
});
|
|
21577
22026
|
const childrenOf = /* @__PURE__ */ new Map();
|
|
21578
22027
|
for (const br of mindData.branches) {
|
|
@@ -21675,7 +22124,18 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
|
|
|
21675
22124
|
);
|
|
21676
22125
|
y = (ys[0] + ys[ys.length - 1]) / 2;
|
|
21677
22126
|
}
|
|
21678
|
-
nodes.push({
|
|
22127
|
+
nodes.push({
|
|
22128
|
+
id: node.id,
|
|
22129
|
+
title: node.title,
|
|
22130
|
+
...node.subtitle !== void 0 ? { subtitle: node.subtitle } : {},
|
|
22131
|
+
x,
|
|
22132
|
+
y,
|
|
22133
|
+
w,
|
|
22134
|
+
h,
|
|
22135
|
+
tone: myTone,
|
|
22136
|
+
isRoot: false,
|
|
22137
|
+
...node.unresolved ? { unresolved: true } : {}
|
|
22138
|
+
});
|
|
21679
22139
|
nodePos.set(node.id, { x, y });
|
|
21680
22140
|
nodeSide.set(node.id, isLeft ? "left" : "right");
|
|
21681
22141
|
nodeHalfW.set(node.id, w / 2);
|
|
@@ -21872,6 +22332,9 @@ function QuadrantNode({
|
|
|
21872
22332
|
const PAD_BOTTOM = 56;
|
|
21873
22333
|
const AXIS_LABEL_FONT = 12;
|
|
21874
22334
|
const PAD_MIN = 60;
|
|
22335
|
+
const ITEM_FONT = 13;
|
|
22336
|
+
const ITEM_PAD_X = 12;
|
|
22337
|
+
const ITEM_MIN_W = 48;
|
|
21875
22338
|
const axisLabelPad = (text) => Math.max(PAD_MIN, measureTextWidth(`\u2190 ${text}`, { fontSize: AXIS_LABEL_FONT}) + 12);
|
|
21876
22339
|
const padBudget = Math.max(0, node.w * 0.5 - PAD_MIN * 2);
|
|
21877
22340
|
const wantLeft = axisLabelPad(data.xAxis.left) - PAD_MIN;
|
|
@@ -21967,6 +22430,12 @@ function QuadrantNode({
|
|
|
21967
22430
|
const qxStart = (isLeft ? PAD_LEFT : cx) + 18;
|
|
21968
22431
|
const qyStart = (isTop ? PAD_TOP : cy) + 44;
|
|
21969
22432
|
const qHalfW = halfW - 36;
|
|
22433
|
+
const \u67A0\u306E\u4F59\u5730 = qHalfW;
|
|
22434
|
+
if (\u67A0\u306E\u4F59\u5730 <= 0) return null;
|
|
22435
|
+
const \u67A0\u306E\u5E45 = (title) => Math.min(
|
|
22436
|
+
\u67A0\u306E\u4F59\u5730,
|
|
22437
|
+
Math.max(ITEM_MIN_W, measureTextWidth(title, { fontSize: ITEM_FONT}) + ITEM_PAD_X * 2)
|
|
22438
|
+
);
|
|
21970
22439
|
const qHalfH = halfH - 60;
|
|
21971
22440
|
const gap = 10;
|
|
21972
22441
|
const rowH = 34;
|
|
@@ -21981,7 +22450,7 @@ function QuadrantNode({
|
|
|
21981
22450
|
"data-cdl-unresolved": it.unresolved ? "true" : void 0,
|
|
21982
22451
|
x: qxStart,
|
|
21983
22452
|
y: py,
|
|
21984
|
-
width:
|
|
22453
|
+
width: \u67A0\u306E\u5E45(it.title),
|
|
21985
22454
|
height: rowH,
|
|
21986
22455
|
rx: 6,
|
|
21987
22456
|
fill: "var(--cdl-node-fill, #ffffff)",
|
|
@@ -21989,16 +22458,43 @@ function QuadrantNode({
|
|
|
21989
22458
|
strokeWidth: 1.5
|
|
21990
22459
|
}
|
|
21991
22460
|
),
|
|
21992
|
-
/* @__PURE__ */ jsxRuntime.jsx("text", { x: qxStart +
|
|
22461
|
+
/* @__PURE__ */ jsxRuntime.jsx("text", { x: qxStart + ITEM_PAD_X, y: py + rowH / 2 + 5, fontSize: ITEM_FONT, fontWeight: 600, letterSpacing: 0, fill: "var(--cdl-text, #1a1f2a)", children: it.title })
|
|
21993
22462
|
] }, `item-${it.id}`);
|
|
21994
22463
|
});
|
|
21995
22464
|
})
|
|
21996
22465
|
] });
|
|
21997
22466
|
}
|
|
21998
|
-
function
|
|
22467
|
+
function \u7BB1\u306E\u6587\u5B57({
|
|
22468
|
+
\u884C,
|
|
22469
|
+
x,
|
|
22470
|
+
\u7BB1\u306E\u9AD8\u3055,
|
|
22471
|
+
fill,
|
|
22472
|
+
\u540D\u524D\u306E\u592A\u3055
|
|
22473
|
+
}) {
|
|
22474
|
+
return \u884C.map((r) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
22475
|
+
"text",
|
|
22476
|
+
{
|
|
22477
|
+
"data-cdl-role": r.\u5F79\u5272 === "subtitle" ? "tree-node-subtitle" : void 0,
|
|
22478
|
+
x,
|
|
22479
|
+
y: \u7BB1\u306E\u9AD8\u3055 / 2 + r.dy,
|
|
22480
|
+
fontSize: r.fontSize,
|
|
22481
|
+
fontWeight: r.\u5F79\u5272 === "title" ? \u540D\u524D\u306E\u592A\u3055 : 500,
|
|
22482
|
+
textAnchor: "middle",
|
|
22483
|
+
fill,
|
|
22484
|
+
opacity: r.\u5F79\u5272 === "subtitle" ? 0.85 : void 0,
|
|
22485
|
+
children: r.text
|
|
22486
|
+
},
|
|
22487
|
+
r.\u5F79\u5272
|
|
22488
|
+
));
|
|
22489
|
+
}
|
|
22490
|
+
function TreeNode({
|
|
22491
|
+
node,
|
|
22492
|
+
active,
|
|
22493
|
+
stateValues = {}
|
|
22494
|
+
}) {
|
|
21999
22495
|
const x0 = node.cx - node.w / 2;
|
|
22000
22496
|
const y0 = node.cy - node.h / 2;
|
|
22001
|
-
const treeNodes = node.treeData ?? [];
|
|
22497
|
+
const treeNodes = resolveTreeData(node.treeData ?? [], stateValues);
|
|
22002
22498
|
const gradientId = `tree-root-grad-${node.id}`;
|
|
22003
22499
|
const PAD_TOP = 40;
|
|
22004
22500
|
const PAD_RIGHT = 24;
|
|
@@ -22053,60 +22549,89 @@ function TreeNode({ node, active }) {
|
|
|
22053
22549
|
layout2.nodes.map((n) => {
|
|
22054
22550
|
const accent = depthColors[Math.min(n.depth, depthColors.length - 1)] ?? depthColors[0];
|
|
22055
22551
|
const isRoot = n.depth === 0;
|
|
22056
|
-
|
|
22057
|
-
|
|
22058
|
-
"
|
|
22059
|
-
{
|
|
22060
|
-
|
|
22061
|
-
|
|
22062
|
-
|
|
22063
|
-
|
|
22064
|
-
|
|
22065
|
-
|
|
22066
|
-
|
|
22067
|
-
|
|
22068
|
-
|
|
22069
|
-
|
|
22070
|
-
|
|
22071
|
-
|
|
22072
|
-
|
|
22073
|
-
|
|
22074
|
-
|
|
22075
|
-
|
|
22076
|
-
|
|
22077
|
-
|
|
22078
|
-
|
|
22079
|
-
|
|
22080
|
-
|
|
22081
|
-
|
|
22082
|
-
|
|
22083
|
-
|
|
22084
|
-
|
|
22085
|
-
|
|
22086
|
-
|
|
22087
|
-
|
|
22088
|
-
|
|
22089
|
-
|
|
22090
|
-
|
|
22091
|
-
|
|
22092
|
-
|
|
22093
|
-
|
|
22094
|
-
|
|
22095
|
-
|
|
22096
|
-
|
|
22097
|
-
|
|
22098
|
-
|
|
22099
|
-
|
|
22100
|
-
|
|
22101
|
-
|
|
22102
|
-
|
|
22103
|
-
|
|
22104
|
-
|
|
22105
|
-
|
|
22106
|
-
|
|
22107
|
-
|
|
22108
|
-
|
|
22109
|
-
|
|
22552
|
+
const \u884C = \u7BB1\u306B\u7A4D\u3080(
|
|
22553
|
+
[
|
|
22554
|
+
{ \u5F79\u5272: "title", text: n.title, fontSize: isRoot ? 13 : 12 },
|
|
22555
|
+
{ \u5F79\u5272: "subtitle", text: n.subtitle ?? "", fontSize: 9 }
|
|
22556
|
+
],
|
|
22557
|
+
n.w,
|
|
22558
|
+
n.h
|
|
22559
|
+
);
|
|
22560
|
+
const \u88DC\u8DB3\u3042\u308A = (n.subtitle ?? "").trim() !== "";
|
|
22561
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22562
|
+
"g",
|
|
22563
|
+
{
|
|
22564
|
+
"data-cdl-unresolved": n.unresolved ? "true" : void 0,
|
|
22565
|
+
transform: `translate(${PAD_LEFT + n.x - n.w / 2} ${PAD_TOP + n.y - n.h / 2})`,
|
|
22566
|
+
children: isRoot ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
22567
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22568
|
+
"rect",
|
|
22569
|
+
{
|
|
22570
|
+
"data-cdl-role": "tree-node",
|
|
22571
|
+
x: 0,
|
|
22572
|
+
y: 0,
|
|
22573
|
+
width: n.w,
|
|
22574
|
+
height: n.h,
|
|
22575
|
+
rx: 12,
|
|
22576
|
+
fill: `url(#${gradientId})`
|
|
22577
|
+
}
|
|
22578
|
+
),
|
|
22579
|
+
\u88DC\u8DB3\u3042\u308A ? \u7BB1\u306E\u6587\u5B57({
|
|
22580
|
+
\u884C,
|
|
22581
|
+
x: n.w / 2,
|
|
22582
|
+
\u7BB1\u306E\u9AD8\u3055: n.h,
|
|
22583
|
+
fill: "var(--cdl-text-on-tone, #ffffff)",
|
|
22584
|
+
\u540D\u524D\u306E\u592A\u3055: 700
|
|
22585
|
+
}) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
22586
|
+
"text",
|
|
22587
|
+
{
|
|
22588
|
+
x: n.w / 2,
|
|
22589
|
+
y: n.h / 2 + 5,
|
|
22590
|
+
fontSize: 13,
|
|
22591
|
+
fontWeight: 700,
|
|
22592
|
+
textAnchor: "middle",
|
|
22593
|
+
fill: "var(--cdl-text-on-tone, #ffffff)",
|
|
22594
|
+
children: n.title
|
|
22595
|
+
}
|
|
22596
|
+
)
|
|
22597
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
22598
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22599
|
+
"rect",
|
|
22600
|
+
{
|
|
22601
|
+
"data-cdl-role": "tree-node",
|
|
22602
|
+
x: 0,
|
|
22603
|
+
y: 0,
|
|
22604
|
+
width: n.w,
|
|
22605
|
+
height: n.h,
|
|
22606
|
+
rx: 9,
|
|
22607
|
+
fill: "var(--cdl-chip-fill, #f4f6fb)",
|
|
22608
|
+
stroke: accent,
|
|
22609
|
+
strokeWidth: 1.5
|
|
22610
|
+
}
|
|
22611
|
+
),
|
|
22612
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: 4, height: n.h, rx: 2, fill: accent }),
|
|
22613
|
+
\u88DC\u8DB3\u3042\u308A ? \u7BB1\u306E\u6587\u5B57({
|
|
22614
|
+
\u884C,
|
|
22615
|
+
x: n.w / 2 + 2,
|
|
22616
|
+
\u7BB1\u306E\u9AD8\u3055: n.h,
|
|
22617
|
+
fill: "var(--cdl-chip-text, #1a1f2a)",
|
|
22618
|
+
\u540D\u524D\u306E\u592A\u3055: 600
|
|
22619
|
+
}) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
22620
|
+
"text",
|
|
22621
|
+
{
|
|
22622
|
+
x: n.w / 2 + 2,
|
|
22623
|
+
y: n.h / 2 + 4,
|
|
22624
|
+
fontSize: 12,
|
|
22625
|
+
fontWeight: 600,
|
|
22626
|
+
textAnchor: "middle",
|
|
22627
|
+
fill: "var(--cdl-chip-text, #1a1f2a)",
|
|
22628
|
+
children: n.title
|
|
22629
|
+
}
|
|
22630
|
+
)
|
|
22631
|
+
] })
|
|
22632
|
+
},
|
|
22633
|
+
`n-${n.id}`
|
|
22634
|
+
);
|
|
22110
22635
|
})
|
|
22111
22636
|
] });
|
|
22112
22637
|
}
|
|
@@ -22169,7 +22694,17 @@ function computeTreeLayout(treeNodes, canvasW, canvasH) {
|
|
|
22169
22694
|
}
|
|
22170
22695
|
const y = depth * depthGap + depthGap / 2;
|
|
22171
22696
|
posOf.set(n.id, { x, y });
|
|
22172
|
-
nodes.push({
|
|
22697
|
+
nodes.push({
|
|
22698
|
+
id: n.id,
|
|
22699
|
+
title: n.title,
|
|
22700
|
+
...n.subtitle !== void 0 ? { subtitle: n.subtitle } : {},
|
|
22701
|
+
x,
|
|
22702
|
+
y,
|
|
22703
|
+
w: nodeW,
|
|
22704
|
+
h: nodeH,
|
|
22705
|
+
depth,
|
|
22706
|
+
...n.unresolved ? { unresolved: true } : {}
|
|
22707
|
+
});
|
|
22173
22708
|
return x;
|
|
22174
22709
|
};
|
|
22175
22710
|
for (const r of roots) if (!placed.has(r.id)) place(r, 0);
|
|
@@ -22444,122 +22979,6 @@ function UserJourneyNode({
|
|
|
22444
22979
|
))
|
|
22445
22980
|
] });
|
|
22446
22981
|
}
|
|
22447
|
-
var TITLE_MAX = 18;
|
|
22448
|
-
var TITLE_MIN = 9;
|
|
22449
|
-
var TITLE_RATIO = 0.17;
|
|
22450
|
-
var SUB_RATIO = 0.72;
|
|
22451
|
-
var LINE_GAP = 3;
|
|
22452
|
-
var BOTTOM_PAD = 4;
|
|
22453
|
-
var ASCENT2 = 0.72;
|
|
22454
|
-
var DESCENT2 = 0.25;
|
|
22455
|
-
var ART_GAP = 4;
|
|
22456
|
-
function labelPlan(node) {
|
|
22457
|
-
const \u9AD8\u3055 = Math.max(0, node.h);
|
|
22458
|
-
const \u5E95 = node.cy + \u9AD8\u3055 / 2;
|
|
22459
|
-
const \u5929 = node.cy - \u9AD8\u3055 / 2;
|
|
22460
|
-
const \u7A4D\u3080 = (\u540D\u524D\u59272, \u8AAC\u660E\u3042\u308A2, \u80A9\u66F8\u3042\u308A2, \u4E0B\u4F59\u767D2) => {
|
|
22461
|
-
const \u5C0F\u3055\u3044\u5B572 = Math.max(1, Math.round(\u540D\u524D\u59272 * SUB_RATIO));
|
|
22462
|
-
let y = \u5E95 - \u4E0B\u4F59\u767D2;
|
|
22463
|
-
const \u8AAC\u660E = \u8AAC\u660E\u3042\u308A2 ? { y, size: \u5C0F\u3055\u3044\u5B572 } : null;
|
|
22464
|
-
if (\u8AAC\u660E !== null) y -= \u5C0F\u3055\u3044\u5B572 + LINE_GAP;
|
|
22465
|
-
const \u540D\u524D = { y, size: \u540D\u524D\u59272 };
|
|
22466
|
-
y -= \u540D\u524D\u59272 + LINE_GAP;
|
|
22467
|
-
const \u80A9\u66F8 = \u80A9\u66F8\u3042\u308A2 ? { y, size: \u5C0F\u3055\u3044\u5B572 } : null;
|
|
22468
|
-
const \u4E0A\u306E\u884C = \u80A9\u66F8 ?? \u540D\u524D;
|
|
22469
|
-
return { \u540D\u524D, \u8AAC\u660E, \u80A9\u66F8, \u4E0A\u7AEF: \u4E0A\u306E\u884C.y - \u4E0A\u306E\u884C.size * ASCENT2 };
|
|
22470
|
-
};
|
|
22471
|
-
const \u5165\u308B = (\u8AAC\u660E\u3042\u308A2, \u80A9\u66F8\u3042\u308A2) => \u7A4D\u3080(1, \u8AAC\u660E\u3042\u308A2, \u80A9\u66F8\u3042\u308A2, 1 * DESCENT2).\u4E0A\u7AEF >= \u5929;
|
|
22472
|
-
let \u8AAC\u660E\u3042\u308A = Boolean(node.subtitle);
|
|
22473
|
-
let \u80A9\u66F8\u3042\u308A = Boolean(node.eyebrow);
|
|
22474
|
-
if (!\u5165\u308B(\u8AAC\u660E\u3042\u308A, \u80A9\u66F8\u3042\u308A)) \u80A9\u66F8\u3042\u308A = false;
|
|
22475
|
-
if (!\u5165\u308B(\u8AAC\u660E\u3042\u308A, \u80A9\u66F8\u3042\u308A)) \u8AAC\u660E\u3042\u308A = false;
|
|
22476
|
-
const \u4E0A\u9650 = Math.min(TITLE_MAX, Math.max(1, Math.round(\u9AD8\u3055 * TITLE_RATIO)));
|
|
22477
|
-
let \u540D\u524D\u5927 = 0;
|
|
22478
|
-
for (let size = \u4E0A\u9650; size >= 1; size--) {
|
|
22479
|
-
const \u5C0F\u3055\u3044\u5B572 = Math.max(1, Math.round(size * SUB_RATIO));
|
|
22480
|
-
const \u4E0B\u306E\u884C\u5927 = \u8AAC\u660E\u3042\u308A ? \u5C0F\u3055\u3044\u5B572 : size;
|
|
22481
|
-
if (\u7A4D\u3080(size, \u8AAC\u660E\u3042\u308A, \u80A9\u66F8\u3042\u308A, \u4E0B\u306E\u884C\u5927 * DESCENT2).\u4E0A\u7AEF >= \u5929) {
|
|
22482
|
-
\u540D\u524D\u5927 = size;
|
|
22483
|
-
break;
|
|
22484
|
-
}
|
|
22485
|
-
}
|
|
22486
|
-
if (\u540D\u524D\u5927 === 0) \u540D\u524D\u5927 = \u9AD8\u3055 / (ASCENT2 + DESCENT2);
|
|
22487
|
-
const \u5C0F\u3055\u3044\u5B57 = Math.max(1, Math.round(\u540D\u524D\u5927 * SUB_RATIO));
|
|
22488
|
-
const \u5F35\u308A\u51FA\u3057 = (\u8AAC\u660E\u3042\u308A ? \u5C0F\u3055\u3044\u5B57 : \u540D\u524D\u5927) * DESCENT2;
|
|
22489
|
-
const \u4F59\u308A = Math.max(0, \u7A4D\u3080(\u540D\u524D\u5927, \u8AAC\u660E\u3042\u308A, \u80A9\u66F8\u3042\u308A, \u5F35\u308A\u51FA\u3057).\u4E0A\u7AEF - \u5929);
|
|
22490
|
-
const \u4E0B\u4F59\u767D = Math.min(Math.max(BOTTOM_PAD, \u5F35\u308A\u51FA\u3057), \u5F35\u308A\u51FA\u3057 + \u4F59\u308A);
|
|
22491
|
-
const \u7D44 = \u7A4D\u3080(\u540D\u524D\u5927, \u8AAC\u660E\u3042\u308A, \u80A9\u66F8\u3042\u308A, \u4E0B\u4F59\u767D);
|
|
22492
|
-
const \u4E00\u756A\u5C0F\u3055\u3044\u884C = Math.min(
|
|
22493
|
-
...[\u7D44.\u540D\u524D, \u7D44.\u8AAC\u660E, \u7D44.\u80A9\u66F8].filter((l) => l !== null).map((l) => l.size)
|
|
22494
|
-
);
|
|
22495
|
-
return {
|
|
22496
|
-
\u540D\u524D: \u7D44.\u540D\u524D,
|
|
22497
|
-
\u8AAC\u660E: \u7D44.\u8AAC\u660E,
|
|
22498
|
-
\u80A9\u66F8: \u7D44.\u80A9\u66F8,
|
|
22499
|
-
top: \u7D44.\u4E0A\u7AEF,
|
|
22500
|
-
\u8AAD\u3081\u308B: \u4E00\u756A\u5C0F\u3055\u3044\u884C >= TITLE_MIN
|
|
22501
|
-
};
|
|
22502
|
-
}
|
|
22503
|
-
function shapeRegion(node) {
|
|
22504
|
-
const label = labelPlan(node);
|
|
22505
|
-
const \u5929 = node.cy - node.h / 2;
|
|
22506
|
-
const availH = Math.max(0, label.top - ART_GAP - \u5929);
|
|
22507
|
-
return {
|
|
22508
|
-
cx: node.cx,
|
|
22509
|
-
cy: \u5929 + availH / 2,
|
|
22510
|
-
availW: node.w,
|
|
22511
|
-
availH,
|
|
22512
|
-
labelY: label.\u540D\u524D.y,
|
|
22513
|
-
label
|
|
22514
|
-
};
|
|
22515
|
-
}
|
|
22516
|
-
var SHADOW_GAP = 8;
|
|
22517
|
-
var FRAME_HALF = 1.5;
|
|
22518
|
-
function bodyBand(node, opt) {
|
|
22519
|
-
const \u5F71 = Math.max(0, opt.\u5F71ry);
|
|
22520
|
-
const \u5916 = Math.max(0, opt.\u5916 ?? FRAME_HALF);
|
|
22521
|
-
const \u4E0B\u4F59\u767D = Math.max(SHADOW_GAP + \u5F71, \u5916);
|
|
22522
|
-
const \u7BB1w = Math.max(0, node.w);
|
|
22523
|
-
const \u7BB1h = Math.max(0, node.h);
|
|
22524
|
-
const \u7E26\u4F59\u767D = \u5916 + \u4E0B\u4F59\u767D;
|
|
22525
|
-
const ky = \u7E26\u4F59\u767D > \u7BB1h && \u7E26\u4F59\u767D > 0 ? \u7BB1h / \u7E26\u4F59\u767D : 1;
|
|
22526
|
-
const \u6A2A\u4F59\u767D = \u5916 * 2;
|
|
22527
|
-
const kx = \u6A2A\u4F59\u767D > \u7BB1w && \u6A2A\u4F59\u767D > 0 ? \u7BB1w / \u6A2A\u4F59\u767D : 1;
|
|
22528
|
-
const x = node.cx - \u7BB1w / 2 + \u5916 * kx;
|
|
22529
|
-
const y = node.cy - \u7BB1h / 2 + \u5916 * ky;
|
|
22530
|
-
const w = Math.max(0, \u7BB1w - \u6A2A\u4F59\u767D * kx);
|
|
22531
|
-
const h = Math.max(0, \u7BB1h - \u7E26\u4F59\u767D * ky);
|
|
22532
|
-
return { x, y, w, h, cx: x + w / 2, cy: y + h / 2, \u53F3: x + w, \u5E95: y + h };
|
|
22533
|
-
}
|
|
22534
|
-
function fitLabel(band, block, pos) {
|
|
22535
|
-
const \u7E26 = block.\u4E0A + block.\u4E0B;
|
|
22536
|
-
const \u6A2A = Math.max(0, block.\u5E45);
|
|
22537
|
-
if (!(\u7E26 > 0)) return { k: 1, x: pos.x, y: pos.y };
|
|
22538
|
-
if (!(band.h > 0) || !(band.w > 0)) return { k: 0, x: band.x + band.w / 2, y: band.y };
|
|
22539
|
-
const k = Math.min(1, band.h / \u7E26, \u6A2A > 0 ? band.w / \u6A2A : 1);
|
|
22540
|
-
const \u534A = \u6A2A * k / 2;
|
|
22541
|
-
return {
|
|
22542
|
-
k,
|
|
22543
|
-
x: Math.max(band.x + \u534A, Math.min(pos.x, band.x + band.w - \u534A)),
|
|
22544
|
-
y: Math.max(band.y + block.\u4E0A * k, Math.min(pos.y, band.y + band.h - block.\u4E0B * k))
|
|
22545
|
-
};
|
|
22546
|
-
}
|
|
22547
|
-
function fitArt(region, extent, art) {
|
|
22548
|
-
const \u7E26 = extent.\u4E0A + extent.\u4E0B;
|
|
22549
|
-
const \u6A2A = extent.\u5DE6 + extent.\u53F3;
|
|
22550
|
-
if (!Number.isFinite(\u7E26) || !Number.isFinite(\u6A2A) || \u7E26 <= 0 || \u6A2A <= 0) return art;
|
|
22551
|
-
if (!Number.isFinite(region.availH) || !Number.isFinite(region.availW) || region.availH <= 0 || region.availW <= 0) {
|
|
22552
|
-
return art;
|
|
22553
|
-
}
|
|
22554
|
-
const s = Math.min(1, region.availH / \u7E26, region.availW / \u6A2A);
|
|
22555
|
-
if (!Number.isFinite(s) || s <= 0) return art;
|
|
22556
|
-
const \u7D75cx = region.cx + (extent.\u53F3 - extent.\u5DE6) / 2;
|
|
22557
|
-
const \u7D75cy = region.cy + (extent.\u4E0B - extent.\u4E0A) / 2;
|
|
22558
|
-
const dx = region.cx - s * \u7D75cx;
|
|
22559
|
-
const dy = region.cy - s * \u7D75cy;
|
|
22560
|
-
if (s >= 1 && dx === 0 && dy === 0) return art;
|
|
22561
|
-
return /* @__PURE__ */ jsxRuntime.jsx("g", { transform: `translate(${dx} ${dy}) scale(${s})`, children: art });
|
|
22562
|
-
}
|
|
22563
22982
|
var BASEMENT_FILL = "#dde8f0";
|
|
22564
22983
|
var commonFrame = (active) => ({
|
|
22565
22984
|
fill: BASEMENT_FILL,
|
|
@@ -22574,8 +22993,8 @@ var EYEBROW_TRACKING = 2;
|
|
|
22574
22993
|
var SUB_SIZE = 11;
|
|
22575
22994
|
var SUB_GAP = 4;
|
|
22576
22995
|
function labelBlock(node, pos, size, band) {
|
|
22577
|
-
const \u4E0A = node.eyebrow ? size + EYEBROW_GAP2 + EYEBROW_SIZE2 *
|
|
22578
|
-
const \u4E0B = node.subtitle ? size + SUB_GAP + SUB_SIZE *
|
|
22996
|
+
const \u4E0A = node.eyebrow ? size + EYEBROW_GAP2 + EYEBROW_SIZE2 * ASCENT : size * ASCENT;
|
|
22997
|
+
const \u4E0B = node.subtitle ? size + SUB_GAP + SUB_SIZE * DESCENT : size * DESCENT;
|
|
22579
22998
|
const \u5E45 = Math.max(
|
|
22580
22999
|
textWidth(node.title ?? "", size),
|
|
22581
23000
|
node.eyebrow ? textWidth(node.eyebrow, EYEBROW_SIZE2, EYEBROW_TRACKING) : 0,
|
|
@@ -24765,6 +25184,15 @@ function ShapeSmartContractNode({ node, active }) {
|
|
|
24765
25184
|
bottomLabel2(node, r.cx, r.label)
|
|
24766
25185
|
] });
|
|
24767
25186
|
}
|
|
25187
|
+
var \u5B57\u306E\u5E45 = (text, size) => Math.max(displayWidth(text) * size * MONO_ADVANCE_RATIO, textWidth(text, size));
|
|
25188
|
+
var BLOCK_DEFAULT_FIELDS = [
|
|
25189
|
+
{ label: "hash", value: "0xaf31c9d2..." },
|
|
25190
|
+
{ label: "prev", value: "0x7b3f92c1..." },
|
|
25191
|
+
{ label: "merkle", value: "0xc1892f4a..." },
|
|
25192
|
+
{ label: "nonce", value: "82,914" },
|
|
25193
|
+
{ label: "tx", value: "142 tx" }
|
|
25194
|
+
];
|
|
25195
|
+
var BLOCK_DEFAULT_TITLE = "Block #421,873";
|
|
24768
25196
|
function ShapeBlockchainBlockNode({ node, active }) {
|
|
24769
25197
|
const frame = commonFrame4(active);
|
|
24770
25198
|
const r = shapeRegion(node);
|
|
@@ -24774,21 +25202,22 @@ function ShapeBlockchainBlockNode({ node, active }) {
|
|
|
24774
25202
|
const cy = r.cy;
|
|
24775
25203
|
const x = cx - bw / 2;
|
|
24776
25204
|
const y = cy - bh / 2;
|
|
25205
|
+
const \u6E21\u3055\u308C\u305F = (v) => (v ?? "").trim();
|
|
25206
|
+
const \u898B\u51FA\u3057 = \u6E21\u3055\u308C\u305F(node.title) || BLOCK_DEFAULT_TITLE;
|
|
25207
|
+
const fields = BLOCK_DEFAULT_FIELDS.map((f) => ({
|
|
25208
|
+
label: f.label,
|
|
25209
|
+
value: f.label === "hash" ? \u6E21\u3055\u308C\u305F(node.subtitle) || f.value : f.value
|
|
25210
|
+
}));
|
|
25211
|
+
const \u898B\u51FA\u3057\u306E\u5E45 = bw - 14 - 30;
|
|
24777
25212
|
const art = /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
24778
25213
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: x + 6, y: y + 6, width: bw, height: bh, rx: 8, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
|
|
24779
25214
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { "data-cdl-role": "node-body", x, y, width: bw, height: bh, rx: 8, ...frame }),
|
|
24780
25215
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: `M ${x} ${y + 32} L ${x} ${y + 8} Q ${x} ${y}, ${x + 8} ${y} L ${x + bw - 8} ${y} Q ${x + bw} ${y}, ${x + bw} ${y + 8} L ${x + bw} ${y + 32} Z`, fill: "var(--cdl-tone-accent, #2d6a8f)", fillOpacity: 0.9, stroke: "none" }),
|
|
24781
|
-
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: y + 22, fontSize: 13, fontWeight: 700, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fill: "#ffffff", children:
|
|
25216
|
+
/* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "blockchain-block-title", x: x + 14, y: y + 22, fontSize: 13, fontWeight: 700, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fill: "#ffffff", children: \u5E45\u3067\u5207\u308B(\u898B\u51FA\u3057, 13, \u898B\u51FA\u3057\u306E\u5E45, \u5B57\u306E\u5E45) }),
|
|
24782
25217
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x + bw - 16, cy: y + 16, r: 5.5, fill: "#7cd88f", stroke: "#ffffff", strokeWidth: 1.5 }),
|
|
24783
|
-
[
|
|
24784
|
-
{ label: "hash", value: "0xaf31c9d2..." },
|
|
24785
|
-
{ label: "prev", value: "0x7b3f92c1..." },
|
|
24786
|
-
{ label: "merkle", value: "0xc1892f4a..." },
|
|
24787
|
-
{ label: "nonce", value: "82,914" },
|
|
24788
|
-
{ label: "tx", value: "142 tx" }
|
|
24789
|
-
].map((f, i) => /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
25218
|
+
fields.map((f, i) => /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
24790
25219
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: y + 54 + i * 22, fontSize: 10.5, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fill: "var(--cdl-text-dim, #5a6270)", children: f.label }),
|
|
24791
|
-
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + bw - 14, y: y + 54 + i * 22, fontSize: 11, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fontWeight: 600, textAnchor: "end", fill: "var(--cdl-text, #1a1f2a)", children: f.value }),
|
|
25220
|
+
/* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": `blockchain-block-${f.label}`, x: x + bw - 14, y: y + 54 + i * 22, fontSize: 11, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fontWeight: 600, textAnchor: "end", fill: "var(--cdl-text, #1a1f2a)", children: \u5E45\u3067\u5207\u308B(f.value, 11, bw - 28 - \u5B57\u306E\u5E45(f.label, 10.5) - 8, \u5B57\u306E\u5E45) }),
|
|
24792
25221
|
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: x + 14, y1: y + 60 + i * 22, x2: x + bw - 14, y2: y + 60 + i * 22, stroke: "var(--cdl-divider, #d4d4d8)", strokeWidth: 0.5, opacity: 0.5 })
|
|
24793
25222
|
] }, i)),
|
|
24794
25223
|
/* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${cx - 32}, ${y + bh - 26})`, children: [
|
|
@@ -26318,9 +26747,10 @@ function CdlNodeView({
|
|
|
26318
26747
|
return /* @__PURE__ */ jsxRuntime.jsx(EventNode, { node: resolvedNode, active, progress });
|
|
26319
26748
|
case "card":
|
|
26320
26749
|
return /* @__PURE__ */ jsxRuntime.jsx(CardNode, { node: resolvedNode, active });
|
|
26321
|
-
// 図表
|
|
26322
|
-
// (`render/payload-binding.ts` が描画直前に解決する)。
|
|
26323
|
-
//
|
|
26750
|
+
// 図表 9 種は payload が `{signal}` を取れるので stateValues を渡す
|
|
26751
|
+
// (`render/payload-binding.ts` が描画直前に解決する)。 取れる欄は種別で違い、
|
|
26752
|
+
// 数と語を取る 7 種に対し、mind-map / tree-hierarchy は **名前だけ** を取る (#467)。
|
|
26753
|
+
// 親子の繋がりと、描かれない欄 (補足) は解決しない。
|
|
26324
26754
|
case "chart-line":
|
|
26325
26755
|
return /* @__PURE__ */ jsxRuntime.jsx(ChartLineNode, { node: resolvedNode, active, stateValues });
|
|
26326
26756
|
case "chart-pie":
|
|
@@ -26330,13 +26760,13 @@ function CdlNodeView({
|
|
|
26330
26760
|
case "gantt-timeline":
|
|
26331
26761
|
return /* @__PURE__ */ jsxRuntime.jsx(GanttNode, { node: resolvedNode, active, stateValues });
|
|
26332
26762
|
case "mind-map":
|
|
26333
|
-
return /* @__PURE__ */ jsxRuntime.jsx(MindMapNode, { node: resolvedNode, active });
|
|
26763
|
+
return /* @__PURE__ */ jsxRuntime.jsx(MindMapNode, { node: resolvedNode, active, stateValues });
|
|
26334
26764
|
case "funnel-stages":
|
|
26335
26765
|
return /* @__PURE__ */ jsxRuntime.jsx(FunnelNode, { node: resolvedNode, active, stateValues });
|
|
26336
26766
|
case "quadrant-matrix":
|
|
26337
26767
|
return /* @__PURE__ */ jsxRuntime.jsx(QuadrantNode, { node: resolvedNode, active, stateValues });
|
|
26338
26768
|
case "tree-hierarchy":
|
|
26339
|
-
return /* @__PURE__ */ jsxRuntime.jsx(TreeNode, { node: resolvedNode, active });
|
|
26769
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TreeNode, { node: resolvedNode, active, stateValues });
|
|
26340
26770
|
case "journey-map":
|
|
26341
26771
|
return /* @__PURE__ */ jsxRuntime.jsx(UserJourneyNode, { node: resolvedNode, active, stateValues });
|
|
26342
26772
|
case "shape-file":
|
|
@@ -26483,6 +26913,29 @@ function CdlNodeView({
|
|
|
26483
26913
|
}
|
|
26484
26914
|
);
|
|
26485
26915
|
}
|
|
26916
|
+
|
|
26917
|
+
// src/layout/lifeline.ts
|
|
26918
|
+
function lifelineStartYs(nodes) {
|
|
26919
|
+
const topmost = /* @__PURE__ */ new Map();
|
|
26920
|
+
for (const n of nodes) {
|
|
26921
|
+
const cur = topmost.get(n.lane);
|
|
26922
|
+
if (cur === void 0 || n.cy < cur.cy) topmost.set(n.lane, n);
|
|
26923
|
+
}
|
|
26924
|
+
const starts = /* @__PURE__ */ new Map();
|
|
26925
|
+
for (const [laneId, n] of topmost) starts.set(laneId, n.cy + n.h / 2);
|
|
26926
|
+
return starts;
|
|
26927
|
+
}
|
|
26928
|
+
function uniformLifelineEndY(lanes, nodes, starts = lifelineStartYs(nodes)) {
|
|
26929
|
+
const lifelineLanes = lanes.filter((l) => l.lifeline);
|
|
26930
|
+
let deepestStart = Number.NEGATIVE_INFINITY;
|
|
26931
|
+
for (const lane of lifelineLanes) {
|
|
26932
|
+
const start = starts.get(lane.id);
|
|
26933
|
+
if (start !== void 0) deepestStart = Math.max(deepestStart, start);
|
|
26934
|
+
}
|
|
26935
|
+
const footerTops = lifelineFooterNodes(lanes, nodes).map((f) => footerShapeDrawTop(f)).filter((top) => top > deepestStart);
|
|
26936
|
+
if (footerTops.length > 0) return Math.min(...footerTops);
|
|
26937
|
+
return lifelineLanes[0] ? lifelineLanes[0].y + lifelineLanes[0].height : 0;
|
|
26938
|
+
}
|
|
26486
26939
|
function CdlStage({
|
|
26487
26940
|
laid,
|
|
26488
26941
|
currentPhase,
|
|
@@ -26493,15 +26946,13 @@ function CdlStage({
|
|
|
26493
26946
|
svgRef
|
|
26494
26947
|
}) {
|
|
26495
26948
|
const activeSet = new Set(currentPhase?.activate ?? []);
|
|
26496
|
-
const
|
|
26497
|
-
|
|
26498
|
-
const footers = lifelineFooterNodes(laid.lanes, laid.nodes);
|
|
26949
|
+
const { lifelineStarts, uniformFooterTop } = react.useMemo(() => {
|
|
26950
|
+
const starts = lifelineStartYs(laid.nodes);
|
|
26499
26951
|
return {
|
|
26500
|
-
|
|
26501
|
-
|
|
26952
|
+
lifelineStarts: starts,
|
|
26953
|
+
uniformFooterTop: uniformLifelineEndY(laid.lanes, laid.nodes, starts)
|
|
26502
26954
|
};
|
|
26503
26955
|
}, [laid]);
|
|
26504
|
-
const uniformFooterTop = footerTops.length > 0 ? Math.min(...footerTops) : lifelineLanes[0] ? lifelineLanes[0].y + lifelineLanes[0].height : 0;
|
|
26505
26956
|
const diagramScale = laid.diagramScale ?? 1;
|
|
26506
26957
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: compact ? "px-3 py-3" : "px-6 py-6", style: compact ? void 0 : { minHeight: 460 }, children: [
|
|
26507
26958
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -26588,11 +27039,8 @@ function CdlStage({
|
|
|
26588
27039
|
}
|
|
26589
27040
|
),
|
|
26590
27041
|
lane.lifeline && (() => {
|
|
26591
|
-
const
|
|
26592
|
-
if (
|
|
26593
|
-
const sortedByCy = laneNodes.slice().sort((a, b) => a.cy - b.cy);
|
|
26594
|
-
const header = sortedByCy[0];
|
|
26595
|
-
const y1 = header.cy + header.h / 2;
|
|
27042
|
+
const y1 = lifelineStarts.get(lane.id);
|
|
27043
|
+
if (y1 === void 0) return null;
|
|
26596
27044
|
const y2 = uniformFooterTop;
|
|
26597
27045
|
if (y2 <= y1) return null;
|
|
26598
27046
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -26639,8 +27087,7 @@ function CdlStage({
|
|
|
26639
27087
|
currentPhaseId: currentPhase?.id
|
|
26640
27088
|
}
|
|
26641
27089
|
);
|
|
26642
|
-
|
|
26643
|
-
return dy === void 0 ? /* @__PURE__ */ jsxRuntime.jsx("g", { children: view }, node.id) : /* @__PURE__ */ jsxRuntime.jsx("g", { transform: `translate(0, ${dy})`, children: view }, node.id);
|
|
27090
|
+
return /* @__PURE__ */ jsxRuntime.jsx("g", { children: view }, node.id);
|
|
26644
27091
|
}),
|
|
26645
27092
|
laid.edges.filter((edge) => Boolean(edge.dThrough)).map((edge) => /* @__PURE__ */ jsxRuntime.jsx(CdlEdgeGlowView, { edge, active: activeSet.has(edge.id) }, `glow-${edge.id}`)),
|
|
26646
27093
|
laid.edges.map((edge) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -26863,14 +27310,7 @@ function CdlDiagramView({ diagram: diagram2, laid: laidProp, hideHeader = false,
|
|
|
26863
27310
|
);
|
|
26864
27311
|
const stateValues = react.useMemo(() => {
|
|
26865
27312
|
if (!isInteractive) return baseStateValues;
|
|
26866
|
-
|
|
26867
|
-
for (const key of Object.keys(interactive.stateOverrides)) {
|
|
26868
|
-
const v = interactive.stateOverrides[key];
|
|
26869
|
-
if (typeof v === "number" || typeof v === "string" || typeof v === "boolean") {
|
|
26870
|
-
merged[key] = String(v);
|
|
26871
|
-
}
|
|
26872
|
-
}
|
|
26873
|
-
return merged;
|
|
27313
|
+
return mergeStateValues(baseStateValues, interactive.stateOverrides);
|
|
26874
27314
|
}, [isInteractive, baseStateValues, interactive.stateOverrides]);
|
|
26875
27315
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
26876
27316
|
"div",
|
|
@@ -27112,6 +27552,7 @@ function bboxDiffWorld(predicted, actual) {
|
|
|
27112
27552
|
}
|
|
27113
27553
|
|
|
27114
27554
|
// src/presets.ts
|
|
27555
|
+
var \u53C2\u7167\u305D\u306E\u3082\u306E = (v) => /^\{[A-Za-z_][\s\S]*\}$/.test(v);
|
|
27115
27556
|
var GRID_UNIT = 16;
|
|
27116
27557
|
function gridAlignedLaneW(canvasW) {
|
|
27117
27558
|
const padPerSide = Math.ceil(LANE_PAD_MIN / GRID_UNIT) * GRID_UNIT;
|
|
@@ -27179,6 +27620,7 @@ function flow(preset) {
|
|
|
27179
27620
|
b.lane("flow", { width: w, ...preset.laneLabel ? { label: preset.laneLabel } : {} });
|
|
27180
27621
|
const tone = preset.defaultTone ?? "accent";
|
|
27181
27622
|
const style = preset.defaultStyle ?? "dotted-flow";
|
|
27623
|
+
const autoChain = preset.autoChain ?? true;
|
|
27182
27624
|
let prevId = null;
|
|
27183
27625
|
let stackIdx = 0;
|
|
27184
27626
|
const phaseActivate = [];
|
|
@@ -27193,7 +27635,7 @@ function flow(preset) {
|
|
|
27193
27635
|
...node.subtitle ? { subtitle: node.subtitle } : {}
|
|
27194
27636
|
});
|
|
27195
27637
|
phaseActivate.push(node.id);
|
|
27196
|
-
if (prevId !== null) {
|
|
27638
|
+
if (autoChain && prevId !== null) {
|
|
27197
27639
|
const edgeId = `e-${prevId}-${node.id}`;
|
|
27198
27640
|
b.edge(prevId, node.id, {
|
|
27199
27641
|
id: edgeId,
|
|
@@ -27206,6 +27648,17 @@ function flow(preset) {
|
|
|
27206
27648
|
prevId = node.id;
|
|
27207
27649
|
return api;
|
|
27208
27650
|
},
|
|
27651
|
+
edge(from, to, opts) {
|
|
27652
|
+
const edgeId = opts?.id ?? `e-${from}-${to}`;
|
|
27653
|
+
b.edge(from, to, {
|
|
27654
|
+
id: edgeId,
|
|
27655
|
+
label: opts?.label ?? "\u2192",
|
|
27656
|
+
tone: opts?.tone ?? tone,
|
|
27657
|
+
style: opts?.style ?? style
|
|
27658
|
+
});
|
|
27659
|
+
phaseActivate.push(edgeId);
|
|
27660
|
+
return api;
|
|
27661
|
+
},
|
|
27209
27662
|
build() {
|
|
27210
27663
|
b.phase(
|
|
27211
27664
|
"flow",
|
|
@@ -27269,7 +27722,7 @@ function sequence(preset) {
|
|
|
27269
27722
|
const laneId = actorIds.get(label) ?? slugify(label);
|
|
27270
27723
|
const footerId = `${laneId}-footer`;
|
|
27271
27724
|
const actorW = Math.max(140, label.length * 22 + 52);
|
|
27272
|
-
b.node(footerId, { lane: laneId, stack: footerStack, kind: "card", title: label, w: actorW, h: 72 });
|
|
27725
|
+
b.node(footerId, { lane: laneId, stack: footerStack, kind: "card", title: label, w: actorW, h: 72, role: "lifeline-footer" });
|
|
27273
27726
|
phaseActivate.push(footerId);
|
|
27274
27727
|
});
|
|
27275
27728
|
b.phase(
|
|
@@ -27592,8 +28045,7 @@ function tree(preset) {
|
|
|
27592
28045
|
id: n.id,
|
|
27593
28046
|
title: n.title,
|
|
27594
28047
|
parent: n.parent,
|
|
27595
|
-
subtitle: n.subtitle
|
|
27596
|
-
eyebrow: n.eyebrow
|
|
28048
|
+
subtitle: n.subtitle
|
|
27597
28049
|
}))
|
|
27598
28050
|
});
|
|
27599
28051
|
b.phase(
|
|
@@ -27827,9 +28279,11 @@ function gantt(preset) {
|
|
|
27827
28279
|
build() {
|
|
27828
28280
|
const labelSeq = [];
|
|
27829
28281
|
for (const t of tasks) {
|
|
27830
|
-
if (!labelSeq.includes(t.start)) labelSeq.push(t.start);
|
|
27831
|
-
if (!labelSeq.includes(t.end)) labelSeq.push(t.end);
|
|
28282
|
+
if (!\u53C2\u7167\u305D\u306E\u3082\u306E(t.start) && !labelSeq.includes(t.start)) labelSeq.push(t.start);
|
|
28283
|
+
if (!\u53C2\u7167\u305D\u306E\u3082\u306E(t.end) && !labelSeq.includes(t.end)) labelSeq.push(t.end);
|
|
27832
28284
|
}
|
|
28285
|
+
const \u4F4D\u7F6E = (v) => \u53C2\u7167\u305D\u306E\u3082\u306E(v) ? v : labelSeq.indexOf(v);
|
|
28286
|
+
const \u540D\u672D = (v) => \u53C2\u7167\u305D\u306E\u3082\u306E(v) ? "" : v;
|
|
27833
28287
|
b.lane("gantt", { width: canvasW });
|
|
27834
28288
|
const nodeId = `${preset.id}-gantt`;
|
|
27835
28289
|
b.node(nodeId, {
|
|
@@ -27840,13 +28294,15 @@ function gantt(preset) {
|
|
|
27840
28294
|
eyebrow: "gantt",
|
|
27841
28295
|
w: canvasW,
|
|
27842
28296
|
h: canvasH,
|
|
28297
|
+
// 宣言していない図には欄自体を載せない = 自動で決める経路をそのまま通す
|
|
28298
|
+
...preset.axisMax !== void 0 ? { ganttAxisMax: preset.axisMax } : {},
|
|
27843
28299
|
ganttData: tasks.map((t) => ({
|
|
27844
28300
|
id: t.id,
|
|
27845
28301
|
title: t.title,
|
|
27846
|
-
startIdx:
|
|
27847
|
-
endIdx:
|
|
27848
|
-
startLabel: t.start,
|
|
27849
|
-
endLabel: t.end,
|
|
28302
|
+
startIdx: \u4F4D\u7F6E(t.start),
|
|
28303
|
+
endIdx: \u4F4D\u7F6E(t.end),
|
|
28304
|
+
startLabel: \u540D\u672D(t.start),
|
|
28305
|
+
endLabel: \u540D\u672D(t.end),
|
|
27850
28306
|
owner: t.owner,
|
|
27851
28307
|
dependsOn: t.dependsOn,
|
|
27852
28308
|
tone
|