@cardenelabs/cdl 0.52.0 → 0.54.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 +42 -1
- package/README.md +2 -2
- package/dist/index.cjs +138 -105
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.js +138 -105
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +88 -78
- 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 +88 -78
- package/dist/react.js.map +1 -1
- package/dist/{render-C0PJ2weJ.d.cts → render-Cp41meYv.d.cts} +7 -6
- package/dist/{render-C0PJ2weJ.d.ts → render-Cp41meYv.d.ts} +7 -6
- package/package.json +1 -1
- package/src/layout/head-label.ts +26 -2
- package/src/layout/nodes.ts +7 -3
- package/src/presets.ts +67 -34
- package/src/render/relation-focus.ts +1 -1
- package/src/types.ts +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,45 @@ CDL (Chainome Diagram Language) の主要変更履歴。
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.54.0] - 2026-09-11
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **図の組み立て関数が自動で書き足す字を、英語から日本語にした** (#835)
|
|
13
|
+
|
|
14
|
+
組み立て関数は書き手の入力とは別に、箱の札・説明・最後の段の説明を書き足す。 そこに英語が混ざっていた。
|
|
15
|
+
|
|
16
|
+
| 組み立て関数 | 直す前 | 直した後 |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| `flowchart` の形の札 | `process` `decision` `start` `end` `loop` | 処理 / 判断 / 開始 / 終了 / 繰り返し |
|
|
19
|
+
| `network` の機器の札 | `router` `switch` `firewall` `server` `client` | ルーター / スイッチ / ファイアウォール / サーバー / 端末 |
|
|
20
|
+
| `stateMachine2` の入れ子の札 | `状態 / nested in active` (親の識別子) | `状態 / Activeの中` (親の題) |
|
|
21
|
+
| `stateMachine2` の入る時と出る時 | `entry: clearForm` / `exit: stopSpinner` | `入る時: clearForm` / `出る時: stopSpinner` |
|
|
22
|
+
| 17 種の最後の段の説明 | 「全 step 順次実行。」 「network 全 device + link を visible 化。」 など | 「すべての段を上から順に通った流れ。」 「すべての機器と接続を並べた構成。」 など |
|
|
23
|
+
|
|
24
|
+
入れ子の札は、親を後から宣言しても親の題を引く。 段の札 (`badge`) と、描く側が描かない図表の札は変えていない。
|
|
25
|
+
|
|
26
|
+
- **文書で関係の種類を呼ぶ語を、見本帳と同じ UML の用語にした** (#833)
|
|
27
|
+
|
|
28
|
+
`README.md` の端の形の説明は、関係の種類を `継ぐ` `満たす` `持つ` と作った語で呼んでいた。
|
|
29
|
+
見本帳 (dragon) が 継承 / 実装 / 集約 / コンポジション / 関連 / 依存 に揃えたので、同じ語にした。
|
|
30
|
+
型と表の説明 (`EdgeStyle` / `EdgeHead` / `EdgeHeadFill` / `CLASS_RELATION_LOOK` / `SequenceMessageKind`) も同じ語にした。
|
|
31
|
+
見本帳を写した検査の関係名とテスト名も見本帳と同じ語にした。 実装は変えていない。
|
|
32
|
+
|
|
33
|
+
## [0.53.0] - 2026-09-11
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- **短い縦の線で、両端の多重度が詰まって 1 つの札に見えるのを直した** (#829)
|
|
38
|
+
|
|
39
|
+
縦に隣り合う箱をつなぐ線は、箱の間隔 (100) がそのまま線の長さになる。 両端に多重度を書くと、
|
|
40
|
+
出どころの字と行き先の字が線の同じ側に縦に並び、間が 10 しか空かなかった。 2 行の札のように
|
|
41
|
+
読まれ、どちらの端の数かが分からなかった。
|
|
42
|
+
|
|
43
|
+
縦の間隔を決める計算に端の字を入れた。 両端に字がある線は、2 つの字の間が字と自分の端の間 (22) の
|
|
44
|
+
2 倍以上空く長さまで間隔を広げる。 間隔は図の中で全て同じ値に揃える規則のままなので、その図の
|
|
45
|
+
縦の間隔が全て広がる。 片方の端にだけ字がある線はいまの間隔で足り、見た目は変わらない。
|
|
46
|
+
|
|
8
47
|
## [0.52.0] - 2026-09-11
|
|
9
48
|
|
|
10
49
|
### Added
|
|
@@ -2448,7 +2487,9 @@ Initial OSS release.
|
|
|
2448
2487
|
使わない = annotated tag を push しても GitHub Release は作られず、 Release を作っていない版で
|
|
2449
2488
|
行き止まりになる。
|
|
2450
2489
|
|
|
2451
|
-
[Unreleased]: https://github.com/cardene777/cdl/compare/v0.
|
|
2490
|
+
[Unreleased]: https://github.com/cardene777/cdl/compare/v0.54.0...HEAD
|
|
2491
|
+
[0.54.0]: https://github.com/cardene777/cdl/compare/v0.53.0...v0.54.0
|
|
2492
|
+
[0.53.0]: https://github.com/cardene777/cdl/compare/v0.52.0...v0.53.0
|
|
2452
2493
|
[0.52.0]: https://github.com/cardene777/cdl/compare/v0.51.0...v0.52.0
|
|
2453
2494
|
[0.51.0]: https://github.com/cardene777/cdl/compare/v0.50.0...v0.51.0
|
|
2454
2495
|
[0.50.0]: https://github.com/cardene777/cdl/compare/v0.49.0...v0.50.0
|
package/README.md
CHANGED
|
@@ -200,8 +200,8 @@ export const custom = diagram("custom", { topic: "Custom" })
|
|
|
200
200
|
| `dotted-flow` | 点線 + 進行点 glow (3 重円) が path 上を流れる、 node 貫通自動判定 |
|
|
201
201
|
|
|
202
202
|
端の形 (`head`) は線の種類とは **別の軸** で、線の先端に何を置くかを決める。
|
|
203
|
-
実線 × 三角 (
|
|
204
|
-
実線 × 三角 (
|
|
203
|
+
実線 × 三角 (継承) と破線 × 三角 (実装) は線種で分かれ、
|
|
204
|
+
実線 × 三角 (継承) と実線 × 菱 (集約) は端で分かれる。
|
|
205
205
|
|
|
206
206
|
| EdgeHead | 形 | 表すもの |
|
|
207
207
|
|---|---|---|
|
package/dist/index.cjs
CHANGED
|
@@ -20532,6 +20532,87 @@ function requiredRowsWidth(rows, kind) {
|
|
|
20532
20532
|
return Math.ceil(kind === "storage" ? storage : generic);
|
|
20533
20533
|
}
|
|
20534
20534
|
|
|
20535
|
+
// src/layout/head-label.ts
|
|
20536
|
+
var \u7AEF\u306E\u5B57\u3092\u623B\u3059\u8DDD\u96E2 = 22;
|
|
20537
|
+
var \u7AEF\u306E\u5B57\u3068\u7DDA\u306E\u9699\u9593 = 8;
|
|
20538
|
+
var \u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055 = EDGE_LABEL_TEXT.sub.fontSize;
|
|
20539
|
+
var \u7BB1\u306E\u9AD8\u3055 = Math.round(\u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055 * 1.2);
|
|
20540
|
+
var BASELINE_RATIO = 0.8;
|
|
20541
|
+
var \u4E21\u7AEF\u306E\u5B57\u306E\u9593 = \u7AEF\u306E\u5B57\u3092\u623B\u3059\u8DDD\u96E2 * 2;
|
|
20542
|
+
function \u7AEF\u306E\u5B57\u306B\u8981\u308B\u7DDA\u306E\u9577\u3055(edge) {
|
|
20543
|
+
const \u4E00\u3064\u5206 = \u7AEF\u306E\u5B57\u3092\u623B\u3059\u8DDD\u96E2 + \u7BB1\u306E\u9AD8\u3055;
|
|
20544
|
+
const \u6570 = [edge.headLabel, edge.tailLabel].filter((t) => t?.trim()).length;
|
|
20545
|
+
if (\u6570 === 0) return 0;
|
|
20546
|
+
if (\u6570 === 1) return \u4E00\u3064\u5206;
|
|
20547
|
+
return \u4E00\u3064\u5206 * 2 + \u4E21\u7AEF\u306E\u5B57\u306E\u9593;
|
|
20548
|
+
}
|
|
20549
|
+
function \u5411\u304D\u3092\u53D6\u308B(end, \u5019\u88DC) {
|
|
20550
|
+
for (const p of \u5019\u88DC) {
|
|
20551
|
+
if (!p) continue;
|
|
20552
|
+
const dx = end.x - p.x;
|
|
20553
|
+
const dy = end.y - p.y;
|
|
20554
|
+
const len = Math.hypot(dx, dy);
|
|
20555
|
+
if (len > 1e-6) return { end, ux: dx / len, uy: dy / len };
|
|
20556
|
+
}
|
|
20557
|
+
return null;
|
|
20558
|
+
}
|
|
20559
|
+
function \u7AEF\u3067\u306E\u5411\u304D(d, \u7AEF) {
|
|
20560
|
+
const segs = extractPathSegments(d);
|
|
20561
|
+
if (segs.length === 0) return null;
|
|
20562
|
+
if (\u7AEF === "head") {
|
|
20563
|
+
const last = segs[segs.length - 1];
|
|
20564
|
+
const end2 = { x: last.x2, y: last.y2 };
|
|
20565
|
+
const \u5019\u88DC2 = segs.slice().reverse().flatMap((s) => [s.cmd === "Q" ? s.ctrl?.[0] : s.cmd === "C" ? s.ctrl?.[1] : void 0, { x: s.x1, y: s.y1 }]);
|
|
20566
|
+
return \u5411\u304D\u3092\u53D6\u308B(end2, \u5019\u88DC2);
|
|
20567
|
+
}
|
|
20568
|
+
const first = segs[0];
|
|
20569
|
+
const end = { x: first.x1, y: first.y1 };
|
|
20570
|
+
const \u5019\u88DC = segs.flatMap((s) => [...s.ctrl ?? [], { x: s.x2, y: s.y2 }]);
|
|
20571
|
+
return \u5411\u304D\u3092\u53D6\u308B(end, \u5019\u88DC);
|
|
20572
|
+
}
|
|
20573
|
+
function \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF = "head") {
|
|
20574
|
+
const text = (\u7AEF === "head" ? edge.headLabel : edge.tailLabel)?.trim();
|
|
20575
|
+
if (!text) return null;
|
|
20576
|
+
const \u5411\u304D = \u7AEF\u3067\u306E\u5411\u304D(edge.d, \u7AEF);
|
|
20577
|
+
if (!\u5411\u304D) return null;
|
|
20578
|
+
const { end, ux, uy } = \u5411\u304D;
|
|
20579
|
+
const bx = end.x - ux * \u7AEF\u306E\u5B57\u3092\u623B\u3059\u8DDD\u96E2;
|
|
20580
|
+
const by = end.y - uy * \u7AEF\u306E\u5B57\u3092\u623B\u3059\u8DDD\u96E2;
|
|
20581
|
+
const w = measureTextWidth(text, {
|
|
20582
|
+
fontSize: \u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055,
|
|
20583
|
+
fontWeight: EDGE_LABEL_TEXT.sub.fontWeight,
|
|
20584
|
+
fontFamily: "mono"
|
|
20585
|
+
});
|
|
20586
|
+
const h = \u7BB1\u306E\u9AD8\u3055;
|
|
20587
|
+
const \u672D = hasRenderedLabel(edge) && edge.labelX !== void 0 && edge.labelY !== void 0 ? { x: edge.labelX, y: edge.labelY } : null;
|
|
20588
|
+
let anchor;
|
|
20589
|
+
let box;
|
|
20590
|
+
if (Math.abs(ux) >= Math.abs(uy)) {
|
|
20591
|
+
const \u53F3\u3078\u9032\u3080 = ux > 0;
|
|
20592
|
+
const \u4E0A\u306B\u7F6E\u304F = \u672D !== null && \u672D.y > by;
|
|
20593
|
+
anchor = \u53F3\u3078\u9032\u3080 ? "end" : "start";
|
|
20594
|
+
box = {
|
|
20595
|
+
x: \u53F3\u3078\u9032\u3080 ? bx - w : bx,
|
|
20596
|
+
y: \u4E0A\u306B\u7F6E\u304F ? by - \u7AEF\u306E\u5B57\u3068\u7DDA\u306E\u9699\u9593 - h : by + \u7AEF\u306E\u5B57\u3068\u7DDA\u306E\u9699\u9593,
|
|
20597
|
+
w,
|
|
20598
|
+
h
|
|
20599
|
+
};
|
|
20600
|
+
} else {
|
|
20601
|
+
const \u4E0B\u3078\u9032\u3080 = uy > 0;
|
|
20602
|
+
const \u53F3\u306B\u7F6E\u304F = \u672D !== null && \u672D.x < bx;
|
|
20603
|
+
anchor = \u53F3\u306B\u7F6E\u304F ? "start" : "end";
|
|
20604
|
+
box = {
|
|
20605
|
+
x: \u53F3\u306B\u7F6E\u304F ? bx + \u7AEF\u306E\u5B57\u3068\u7DDA\u306E\u9699\u9593 : bx - \u7AEF\u306E\u5B57\u3068\u7DDA\u306E\u9699\u9593 - w,
|
|
20606
|
+
y: \u4E0B\u3078\u9032\u3080 ? by - h : by,
|
|
20607
|
+
w,
|
|
20608
|
+
h
|
|
20609
|
+
};
|
|
20610
|
+
}
|
|
20611
|
+
const x = anchor === "start" ? box.x : box.x + box.w;
|
|
20612
|
+
const y = box.y + (h - \u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055) / 2 + \u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055 * BASELINE_RATIO;
|
|
20613
|
+
return { x, y, anchor, box };
|
|
20614
|
+
}
|
|
20615
|
+
|
|
20535
20616
|
// src/layout/nodes.ts
|
|
20536
20617
|
function autoStorageHeight(n, defaultH) {
|
|
20537
20618
|
if (n.kind !== "storage") return n.h ?? defaultH;
|
|
@@ -20553,7 +20634,7 @@ function autoRowsWidth(n, defaultW) {
|
|
|
20553
20634
|
const required = requiredRowsWidth(n.rows, n.kind);
|
|
20554
20635
|
return Math.max(defaultW, required);
|
|
20555
20636
|
}
|
|
20556
|
-
function \u7BB1\u306E\u9AD8\
|
|
20637
|
+
function \u7BB1\u306E\u9AD8\u30552(n, \u65E2\u5B9Ah) {
|
|
20557
20638
|
if (n.h != null) return n.h;
|
|
20558
20639
|
if (n.kind === "storage") return autoStorageHeight(n, \u65E2\u5B9Ah);
|
|
20559
20640
|
return \u4E2D\u8EAB\u304B\u3089\u51FA\u3059\u9AD8\u3055(n.kind, \u65E2\u5B9Ah, {
|
|
@@ -20567,8 +20648,8 @@ function requiredStackGapForEdgeLabels(diag, allStacks) {
|
|
|
20567
20648
|
const byId = new Map(diag.nodes.map((n) => [n.id, n]));
|
|
20568
20649
|
const rankOf = new Map(allStacks.map((stack, i) => [stack, i]));
|
|
20569
20650
|
const pillHsByGap = /* @__PURE__ */ new Map();
|
|
20651
|
+
let \u7AEF\u306E\u5B57\u306E\u8981\u6C42 = 0;
|
|
20570
20652
|
for (const e of diag.edges) {
|
|
20571
|
-
if (!hasRenderedLabel(e)) continue;
|
|
20572
20653
|
const from = byId.get(e.from);
|
|
20573
20654
|
const to = byId.get(e.to);
|
|
20574
20655
|
if (!from || !to) continue;
|
|
@@ -20577,10 +20658,12 @@ function requiredStackGapForEdgeLabels(diag, allStacks) {
|
|
|
20577
20658
|
const toRank = rankOf.get(to.stack);
|
|
20578
20659
|
if (fromRank === void 0 || toRank === void 0) continue;
|
|
20579
20660
|
if (Math.abs(fromRank - toRank) !== 1) continue;
|
|
20661
|
+
\u7AEF\u306E\u5B57\u306E\u8981\u6C42 = Math.max(\u7AEF\u306E\u5B57\u306E\u8981\u6C42, \u7AEF\u306E\u5B57\u306B\u8981\u308B\u7DDA\u306E\u9577\u3055(e));
|
|
20662
|
+
if (!hasRenderedLabel(e)) continue;
|
|
20580
20663
|
const key = `${from.lane}::${Math.min(fromRank, toRank)}`;
|
|
20581
20664
|
pillHsByGap.set(key, [...pillHsByGap.get(key) ?? [], labelPillH(e.sub)]);
|
|
20582
20665
|
}
|
|
20583
|
-
let required =
|
|
20666
|
+
let required = \u7AEF\u306E\u5B57\u306E\u8981\u6C42;
|
|
20584
20667
|
for (const pillHs of pillHsByGap.values()) {
|
|
20585
20668
|
required = Math.max(required, requiredVerticalLabelGap(pillHs));
|
|
20586
20669
|
}
|
|
@@ -20592,7 +20675,7 @@ function layoutNodes(diag, lanes) {
|
|
|
20592
20675
|
const rowH = /* @__PURE__ */ new Map();
|
|
20593
20676
|
for (const stack of allStacks) {
|
|
20594
20677
|
const nodesAtStack = diag.nodes.filter((n) => n.stack === stack);
|
|
20595
|
-
const h = Math.max(...nodesAtStack.map((n) => \u7BB1\u306E\u9AD8\
|
|
20678
|
+
const h = Math.max(...nodesAtStack.map((n) => \u7BB1\u306E\u9AD8\u30552(n, NODE_SIZE[n.kind].h)));
|
|
20596
20679
|
rowH.set(stack, h);
|
|
20597
20680
|
}
|
|
20598
20681
|
const rowCy = /* @__PURE__ */ new Map();
|
|
@@ -20646,7 +20729,7 @@ function layoutNodes(diag, lanes) {
|
|
|
20646
20729
|
const \u6BB5\u306E\u82AF = rowCy.get(n.stack);
|
|
20647
20730
|
const \u6BB5\u306E\u9AD8\u3055 = rowH.get(n.stack);
|
|
20648
20731
|
const \u81EA\u524D\u306E\u9AD8\u3055 = n.rowMarks !== void 0;
|
|
20649
|
-
const h = n.h ?? (\u81EA\u524D\u306E\u9AD8\u3055 ? \u7BB1\u306E\u9AD8\
|
|
20732
|
+
const h = n.h ?? (\u81EA\u524D\u306E\u9AD8\u3055 ? \u7BB1\u306E\u9AD8\u30552(n, size.h) : \u6BB5\u306E\u9AD8\u3055);
|
|
20650
20733
|
const cy = \u6BB5\u306E\u82AF;
|
|
20651
20734
|
const w = autoRowsWidth(n, size.w);
|
|
20652
20735
|
out.push({
|
|
@@ -22935,79 +23018,6 @@ function \u7B49\u5E45\u306E\u5B57(text, fontSize) {
|
|
|
22935
23018
|
});
|
|
22936
23019
|
return out;
|
|
22937
23020
|
}
|
|
22938
|
-
|
|
22939
|
-
// src/layout/head-label.ts
|
|
22940
|
-
var \u7AEF\u306E\u5B57\u3092\u623B\u3059\u8DDD\u96E2 = 22;
|
|
22941
|
-
var \u7AEF\u306E\u5B57\u3068\u7DDA\u306E\u9699\u9593 = 8;
|
|
22942
|
-
var \u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055 = EDGE_LABEL_TEXT.sub.fontSize;
|
|
22943
|
-
var \u7BB1\u306E\u9AD8\u30552 = Math.round(\u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055 * 1.2);
|
|
22944
|
-
var BASELINE_RATIO = 0.8;
|
|
22945
|
-
function \u5411\u304D\u3092\u53D6\u308B(end, \u5019\u88DC) {
|
|
22946
|
-
for (const p of \u5019\u88DC) {
|
|
22947
|
-
if (!p) continue;
|
|
22948
|
-
const dx = end.x - p.x;
|
|
22949
|
-
const dy = end.y - p.y;
|
|
22950
|
-
const len = Math.hypot(dx, dy);
|
|
22951
|
-
if (len > 1e-6) return { end, ux: dx / len, uy: dy / len };
|
|
22952
|
-
}
|
|
22953
|
-
return null;
|
|
22954
|
-
}
|
|
22955
|
-
function \u7AEF\u3067\u306E\u5411\u304D(d, \u7AEF) {
|
|
22956
|
-
const segs = extractPathSegments(d);
|
|
22957
|
-
if (segs.length === 0) return null;
|
|
22958
|
-
if (\u7AEF === "head") {
|
|
22959
|
-
const last = segs[segs.length - 1];
|
|
22960
|
-
const end2 = { x: last.x2, y: last.y2 };
|
|
22961
|
-
const \u5019\u88DC2 = segs.slice().reverse().flatMap((s) => [s.cmd === "Q" ? s.ctrl?.[0] : s.cmd === "C" ? s.ctrl?.[1] : void 0, { x: s.x1, y: s.y1 }]);
|
|
22962
|
-
return \u5411\u304D\u3092\u53D6\u308B(end2, \u5019\u88DC2);
|
|
22963
|
-
}
|
|
22964
|
-
const first = segs[0];
|
|
22965
|
-
const end = { x: first.x1, y: first.y1 };
|
|
22966
|
-
const \u5019\u88DC = segs.flatMap((s) => [...s.ctrl ?? [], { x: s.x2, y: s.y2 }]);
|
|
22967
|
-
return \u5411\u304D\u3092\u53D6\u308B(end, \u5019\u88DC);
|
|
22968
|
-
}
|
|
22969
|
-
function \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF = "head") {
|
|
22970
|
-
const text = (\u7AEF === "head" ? edge.headLabel : edge.tailLabel)?.trim();
|
|
22971
|
-
if (!text) return null;
|
|
22972
|
-
const \u5411\u304D = \u7AEF\u3067\u306E\u5411\u304D(edge.d, \u7AEF);
|
|
22973
|
-
if (!\u5411\u304D) return null;
|
|
22974
|
-
const { end, ux, uy } = \u5411\u304D;
|
|
22975
|
-
const bx = end.x - ux * \u7AEF\u306E\u5B57\u3092\u623B\u3059\u8DDD\u96E2;
|
|
22976
|
-
const by = end.y - uy * \u7AEF\u306E\u5B57\u3092\u623B\u3059\u8DDD\u96E2;
|
|
22977
|
-
const w = measureTextWidth(text, {
|
|
22978
|
-
fontSize: \u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055,
|
|
22979
|
-
fontWeight: EDGE_LABEL_TEXT.sub.fontWeight,
|
|
22980
|
-
fontFamily: "mono"
|
|
22981
|
-
});
|
|
22982
|
-
const h = \u7BB1\u306E\u9AD8\u30552;
|
|
22983
|
-
const \u672D = hasRenderedLabel(edge) && edge.labelX !== void 0 && edge.labelY !== void 0 ? { x: edge.labelX, y: edge.labelY } : null;
|
|
22984
|
-
let anchor;
|
|
22985
|
-
let box;
|
|
22986
|
-
if (Math.abs(ux) >= Math.abs(uy)) {
|
|
22987
|
-
const \u53F3\u3078\u9032\u3080 = ux > 0;
|
|
22988
|
-
const \u4E0A\u306B\u7F6E\u304F = \u672D !== null && \u672D.y > by;
|
|
22989
|
-
anchor = \u53F3\u3078\u9032\u3080 ? "end" : "start";
|
|
22990
|
-
box = {
|
|
22991
|
-
x: \u53F3\u3078\u9032\u3080 ? bx - w : bx,
|
|
22992
|
-
y: \u4E0A\u306B\u7F6E\u304F ? by - \u7AEF\u306E\u5B57\u3068\u7DDA\u306E\u9699\u9593 - h : by + \u7AEF\u306E\u5B57\u3068\u7DDA\u306E\u9699\u9593,
|
|
22993
|
-
w,
|
|
22994
|
-
h
|
|
22995
|
-
};
|
|
22996
|
-
} else {
|
|
22997
|
-
const \u4E0B\u3078\u9032\u3080 = uy > 0;
|
|
22998
|
-
const \u53F3\u306B\u7F6E\u304F = \u672D !== null && \u672D.x < bx;
|
|
22999
|
-
anchor = \u53F3\u306B\u7F6E\u304F ? "start" : "end";
|
|
23000
|
-
box = {
|
|
23001
|
-
x: \u53F3\u306B\u7F6E\u304F ? bx + \u7AEF\u306E\u5B57\u3068\u7DDA\u306E\u9699\u9593 : bx - \u7AEF\u306E\u5B57\u3068\u7DDA\u306E\u9699\u9593 - w,
|
|
23002
|
-
y: \u4E0B\u3078\u9032\u3080 ? by - h : by,
|
|
23003
|
-
w,
|
|
23004
|
-
h
|
|
23005
|
-
};
|
|
23006
|
-
}
|
|
23007
|
-
const x = anchor === "start" ? box.x : box.x + box.w;
|
|
23008
|
-
const y = box.y + (h - \u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055) / 2 + \u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055 * BASELINE_RATIO;
|
|
23009
|
-
return { x, y, anchor, box };
|
|
23010
|
-
}
|
|
23011
23021
|
function defaultEdgeWidth(active) {
|
|
23012
23022
|
return active ? 2.5 : 1.25;
|
|
23013
23023
|
}
|
|
@@ -32159,7 +32169,7 @@ function flow(preset) {
|
|
|
32159
32169
|
build() {
|
|
32160
32170
|
b.phase(
|
|
32161
32171
|
"flow",
|
|
32162
|
-
{ duration: 2400, title: preset.topic, body: "\
|
|
32172
|
+
{ duration: 2400, title: preset.topic, body: "\u3059\u3079\u3066\u306E\u6BB5\u3092\u4E0A\u304B\u3089\u9806\u306B\u901A\u3063\u305F\u6D41\u308C\u3002" },
|
|
32163
32173
|
(p) => p.activate(...phaseActivate).badge("flow")
|
|
32164
32174
|
);
|
|
32165
32175
|
return b.build();
|
|
@@ -32217,7 +32227,7 @@ function sequence(preset) {
|
|
|
32217
32227
|
});
|
|
32218
32228
|
b.phase(
|
|
32219
32229
|
"sequence",
|
|
32220
|
-
{ duration: 2400, title: preset.topic, body: "
|
|
32230
|
+
{ duration: 2400, title: preset.topic, body: "\u3059\u3079\u3066\u306E\u3084\u308A\u53D6\u308A\u3092\u6642\u9593\u306E\u9806\u306B\u4E26\u3079\u305F\u59FF\u3002" },
|
|
32221
32231
|
(p) => p.activate(preset.id).badge("sequence")
|
|
32222
32232
|
);
|
|
32223
32233
|
return b.build();
|
|
@@ -32278,7 +32288,7 @@ function topology(preset) {
|
|
|
32278
32288
|
build() {
|
|
32279
32289
|
b.phase(
|
|
32280
32290
|
"topo",
|
|
32281
|
-
{ duration: 2400, title: preset.topic, body: "
|
|
32291
|
+
{ duration: 2400, title: preset.topic, body: "\u3059\u3079\u3066\u306E\u69CB\u6210\u8981\u7D20\u3068\u63A5\u7D9A\u3092\u4E26\u3079\u305F\u69CB\u6210\u3002" },
|
|
32282
32292
|
(p) => p.activate(...phaseActivate).badge("topology")
|
|
32283
32293
|
);
|
|
32284
32294
|
return b.build();
|
|
@@ -32366,7 +32376,7 @@ function er(preset) {
|
|
|
32366
32376
|
build() {
|
|
32367
32377
|
b.phase(
|
|
32368
32378
|
"er",
|
|
32369
|
-
{ duration: 2400, title: preset.topic, body: "
|
|
32379
|
+
{ duration: 2400, title: preset.topic, body: "\u3059\u3079\u3066\u306E\u8868\u3068\u95A2\u4FC2\u3092\u4E26\u3079\u305F\u69CB\u9020\u3002" },
|
|
32370
32380
|
(p) => p.activate(...phaseActivate).badge("er")
|
|
32371
32381
|
);
|
|
32372
32382
|
return b.build();
|
|
@@ -32484,7 +32494,7 @@ function stateMachine(preset) {
|
|
|
32484
32494
|
});
|
|
32485
32495
|
b.phase(
|
|
32486
32496
|
"fsm",
|
|
32487
|
-
{ duration: 2400, title: preset.topic, body: "
|
|
32497
|
+
{ duration: 2400, title: preset.topic, body: "\u3059\u3079\u3066\u306E\u72B6\u614B\u3068\u9077\u79FB\u3092\u4E26\u3079\u305F\u59FF\u3002" },
|
|
32488
32498
|
(p) => p.activate(...phaseActivate).badge("fsm")
|
|
32489
32499
|
);
|
|
32490
32500
|
return b.build();
|
|
@@ -32539,7 +32549,7 @@ function infrastructure(preset) {
|
|
|
32539
32549
|
build() {
|
|
32540
32550
|
b.phase(
|
|
32541
32551
|
"infra",
|
|
32542
|
-
{ duration: 2400, title: preset.topic, body: "
|
|
32552
|
+
{ duration: 2400, title: preset.topic, body: "\u3059\u3079\u3066\u306E\u69CB\u6210\u8981\u7D20\u3068\u63A5\u7D9A\u3092\u4E26\u3079\u305F\u69CB\u6210\u3002" },
|
|
32543
32553
|
(p) => p.activate(...phaseActivate).badge("infrastructure")
|
|
32544
32554
|
);
|
|
32545
32555
|
return b.build();
|
|
@@ -32656,7 +32666,7 @@ function classDiagram(preset) {
|
|
|
32656
32666
|
});
|
|
32657
32667
|
b.phase(
|
|
32658
32668
|
"class",
|
|
32659
|
-
{ duration: 2400, title: preset.topic, body: "
|
|
32669
|
+
{ duration: 2400, title: preset.topic, body: "\u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u3068\u95A2\u4FC2\u3092\u4E26\u3079\u305F\u69CB\u9020\u3002" },
|
|
32660
32670
|
(p) => p.activate(...phaseActivate).badge("class")
|
|
32661
32671
|
);
|
|
32662
32672
|
return b.build();
|
|
@@ -32694,7 +32704,7 @@ function tree(preset) {
|
|
|
32694
32704
|
});
|
|
32695
32705
|
b.phase(
|
|
32696
32706
|
"tree",
|
|
32697
|
-
{ duration: 2400, title: preset.topic, body: "
|
|
32707
|
+
{ duration: 2400, title: preset.topic, body: "\u3059\u3079\u3066\u306E\u9805\u76EE\u3092\u89AA\u5B50\u306E\u968E\u5C64\u3067\u4E26\u3079\u305F\u6728\u3002" },
|
|
32698
32708
|
(p) => p.activate(nodeId).badge("tree")
|
|
32699
32709
|
);
|
|
32700
32710
|
return b.build();
|
|
@@ -32733,7 +32743,7 @@ function userJourney(preset) {
|
|
|
32733
32743
|
});
|
|
32734
32744
|
b.phase(
|
|
32735
32745
|
"journey",
|
|
32736
|
-
{ duration: 2400, title: preset.topic, body: "
|
|
32746
|
+
{ duration: 2400, title: preset.topic, body: "\u3059\u3079\u3066\u306E\u6BB5\u968E\u3092\u3001\u6C17\u6301\u3061\u306E\u66F2\u7DDA\u3068\u63A5\u70B9\u3067\u4E26\u3079\u305F\u4F53\u9A13\u3002" },
|
|
32737
32747
|
(p) => p.activate(nodeId).badge("journey")
|
|
32738
32748
|
);
|
|
32739
32749
|
return b.build();
|
|
@@ -32777,7 +32787,7 @@ function mindMap(preset) {
|
|
|
32777
32787
|
});
|
|
32778
32788
|
b.phase(
|
|
32779
32789
|
"mindmap",
|
|
32780
|
-
{ duration: 2400, title: preset.topic, body: "
|
|
32790
|
+
{ duration: 2400, title: preset.topic, body: "\u4E2D\u5FC3\u306E\u4E3B\u984C\u304B\u3089\u3001\u3059\u3079\u3066\u306E\u679D\u3092\u653E\u5C04\u72B6\u306B\u5E83\u3052\u305F\u59FF\u3002" },
|
|
32781
32791
|
(p) => p.activate(nodeId).badge("mindmap")
|
|
32782
32792
|
);
|
|
32783
32793
|
return b.build();
|
|
@@ -32815,7 +32825,7 @@ function funnel(preset) {
|
|
|
32815
32825
|
});
|
|
32816
32826
|
b.phase(
|
|
32817
32827
|
"funnel",
|
|
32818
|
-
{ duration: 2400, title: preset.topic, body: "
|
|
32828
|
+
{ duration: 2400, title: preset.topic, body: "\u3059\u3079\u3066\u306E\u6BB5\u968E\u3092\u3001\u4EBA\u6570\u3068\u3068\u3082\u306B\u4E0A\u304B\u3089\u7D5E\u308A\u8FBC\u3093\u3060\u59FF\u3002" },
|
|
32819
32829
|
(p) => p.activate(nodeId).badge("funnel")
|
|
32820
32830
|
);
|
|
32821
32831
|
return b.build();
|
|
@@ -32864,7 +32874,7 @@ function quadrant(preset) {
|
|
|
32864
32874
|
});
|
|
32865
32875
|
b.phase(
|
|
32866
32876
|
"quadrant",
|
|
32867
|
-
{ duration: 2400, title: preset.topic, body: "
|
|
32877
|
+
{ duration: 2400, title: preset.topic, body: "2 \u672C\u306E\u8EF8\u3067\u5206\u3051\u305F 4 \u3064\u306E\u67A0\u306B\u3001\u3059\u3079\u3066\u306E\u9805\u76EE\u3092\u7F6E\u3044\u305F\u59FF\u3002" },
|
|
32868
32878
|
(p) => p.activate(nodeId).badge("quadrant")
|
|
32869
32879
|
);
|
|
32870
32880
|
return b.build();
|
|
@@ -32915,7 +32925,7 @@ function chart(preset) {
|
|
|
32915
32925
|
});
|
|
32916
32926
|
b.phase(
|
|
32917
32927
|
"chart",
|
|
32918
|
-
{ duration: 2400, title: preset.topic, body:
|
|
32928
|
+
{ duration: 2400, title: preset.topic, body: "\u3059\u3079\u3066\u306E\u5024\u3092\u63CF\u3044\u305F\u30B0\u30E9\u30D5\u3002" },
|
|
32919
32929
|
(p) => p.activate(nodeId).badge(preset.type)
|
|
32920
32930
|
);
|
|
32921
32931
|
return b.build();
|
|
@@ -32968,7 +32978,7 @@ function gantt(preset) {
|
|
|
32968
32978
|
});
|
|
32969
32979
|
b.phase(
|
|
32970
32980
|
"gantt",
|
|
32971
|
-
{ duration: 2400, title: preset.topic, body: "
|
|
32981
|
+
{ duration: 2400, title: preset.topic, body: "\u3059\u3079\u3066\u306E\u4F5C\u696D\u3092\u3001\u671F\u9593\u306E\u5E2F\u3068\u524D\u5F8C\u95A2\u4FC2\u306E\u77E2\u5370\u3067\u4E26\u3079\u305F\u5DE5\u7A0B\u3002" },
|
|
32972
32982
|
(p) => p.activate(nodeId).badge("gantt")
|
|
32973
32983
|
);
|
|
32974
32984
|
return b.build();
|
|
@@ -32984,11 +32994,11 @@ var SHAPE_KIND = {
|
|
|
32984
32994
|
loop: "card"
|
|
32985
32995
|
};
|
|
32986
32996
|
var SHAPE_EYEBROW = {
|
|
32987
|
-
process: "
|
|
32988
|
-
decision: "
|
|
32989
|
-
start: "
|
|
32990
|
-
end: "
|
|
32991
|
-
loop: "
|
|
32997
|
+
process: "\u51E6\u7406",
|
|
32998
|
+
decision: "\u5224\u65AD",
|
|
32999
|
+
start: "\u958B\u59CB",
|
|
33000
|
+
end: "\u7D42\u4E86",
|
|
33001
|
+
loop: "\u7E70\u308A\u8FD4\u3057"
|
|
32992
33002
|
};
|
|
32993
33003
|
function flowchart(preset) {
|
|
32994
33004
|
const laneW = preset.laneWidth ?? 380;
|
|
@@ -33036,7 +33046,7 @@ function flowchart(preset) {
|
|
|
33036
33046
|
build() {
|
|
33037
33047
|
b.phase(
|
|
33038
33048
|
"flowchart",
|
|
33039
|
-
{ duration: 2400, title: preset.topic, body: "
|
|
33049
|
+
{ duration: 2400, title: preset.topic, body: "\u3059\u3079\u3066\u306E\u51E6\u7406\u3068\u5206\u5C90\u3092\u3001\u62C5\u5F53\u3054\u3068\u306E\u30EC\u30FC\u30F3\u306B\u4E26\u3079\u305F\u6D41\u308C\u3002" },
|
|
33040
33050
|
(p) => p.activate(...phaseActivate).badge("flowchart")
|
|
33041
33051
|
);
|
|
33042
33052
|
return b.build();
|
|
@@ -33051,6 +33061,13 @@ var NET_KIND_MAP = {
|
|
|
33051
33061
|
server: "backend",
|
|
33052
33062
|
client: "actor"
|
|
33053
33063
|
};
|
|
33064
|
+
var NET_KIND_LABEL = {
|
|
33065
|
+
router: "\u30EB\u30FC\u30BF\u30FC",
|
|
33066
|
+
switch: "\u30B9\u30A4\u30C3\u30C1",
|
|
33067
|
+
firewall: "\u30D5\u30A1\u30A4\u30A2\u30A6\u30A9\u30FC\u30EB",
|
|
33068
|
+
server: "\u30B5\u30FC\u30D0\u30FC",
|
|
33069
|
+
client: "\u7AEF\u672B"
|
|
33070
|
+
};
|
|
33054
33071
|
function network(preset) {
|
|
33055
33072
|
const laneW = preset.laneWidth ?? 320;
|
|
33056
33073
|
const tone = preset.defaultTone ?? "info";
|
|
@@ -33066,7 +33083,7 @@ function network(preset) {
|
|
|
33066
33083
|
b.lane(laneId, { width: laneW });
|
|
33067
33084
|
colLaneIds.set(d.col, laneId);
|
|
33068
33085
|
}
|
|
33069
|
-
const eyebrowParts = [d.kind];
|
|
33086
|
+
const eyebrowParts = [NET_KIND_LABEL[d.kind]];
|
|
33070
33087
|
if (d.segment) eyebrowParts.push(d.segment);
|
|
33071
33088
|
b.node(d.id, {
|
|
33072
33089
|
lane: laneId,
|
|
@@ -33092,7 +33109,7 @@ function network(preset) {
|
|
|
33092
33109
|
build() {
|
|
33093
33110
|
b.phase(
|
|
33094
33111
|
"network",
|
|
33095
|
-
{ duration: 2400, title: preset.topic, body: "
|
|
33112
|
+
{ duration: 2400, title: preset.topic, body: "\u3059\u3079\u3066\u306E\u6A5F\u5668\u3068\u63A5\u7D9A\u3092\u4E26\u3079\u305F\u69CB\u6210\u3002" },
|
|
33096
33113
|
(p) => p.activate(...phaseActivate).badge("network")
|
|
33097
33114
|
);
|
|
33098
33115
|
return b.build();
|
|
@@ -33108,18 +33125,21 @@ function stateMachine2(preset) {
|
|
|
33108
33125
|
const stateOrder = /* @__PURE__ */ new Map();
|
|
33109
33126
|
const phaseActivate = [];
|
|
33110
33127
|
let transIdx = 0;
|
|
33128
|
+
const \u984C = /* @__PURE__ */ new Map();
|
|
33129
|
+
const \u89AA = /* @__PURE__ */ new Map();
|
|
33111
33130
|
const api = {
|
|
33112
33131
|
state(s) {
|
|
33113
33132
|
const laneId = `lane-${s.id}`;
|
|
33114
33133
|
b.lane(laneId, { width: laneW });
|
|
33134
|
+
\u984C.set(s.id, s.title);
|
|
33135
|
+
if (s.parent) \u89AA.set(s.id, s.parent);
|
|
33115
33136
|
const eyebrowParts = [];
|
|
33116
33137
|
if (s.initial) eyebrowParts.push("\u521D\u671F");
|
|
33117
33138
|
else if (s.final) eyebrowParts.push("\u6700\u7D42");
|
|
33118
33139
|
else eyebrowParts.push("\u72B6\u614B");
|
|
33119
|
-
if (s.parent) eyebrowParts.push(`nested in ${s.parent}`);
|
|
33120
33140
|
const subtitleParts = [];
|
|
33121
|
-
if (s.entry) subtitleParts.push(
|
|
33122
|
-
if (s.exit) subtitleParts.push(
|
|
33141
|
+
if (s.entry) subtitleParts.push(`\u5165\u308B\u6642: ${s.entry}`);
|
|
33142
|
+
if (s.exit) subtitleParts.push(`\u51FA\u308B\u6642: ${s.exit}`);
|
|
33123
33143
|
b.node(s.id, {
|
|
33124
33144
|
lane: laneId,
|
|
33125
33145
|
stack: 0,
|
|
@@ -33152,10 +33172,23 @@ function stateMachine2(preset) {
|
|
|
33152
33172
|
build() {
|
|
33153
33173
|
b.phase(
|
|
33154
33174
|
"sm2",
|
|
33155
|
-
{
|
|
33175
|
+
{
|
|
33176
|
+
duration: 2400,
|
|
33177
|
+
title: preset.topic,
|
|
33178
|
+
body: "\u5165\u308C\u5B50\u306E\u72B6\u614B\u3068\u3001\u5165\u308B\u6642\u30FB\u51FA\u308B\u6642\u306E\u51E6\u7406\u3092\u542B\u3081\u305F\u3001\u3059\u3079\u3066\u306E\u72B6\u614B\u3068\u9077\u79FB\u3002"
|
|
33179
|
+
},
|
|
33156
33180
|
(p) => p.activate(...phaseActivate).badge("statemachine2")
|
|
33157
33181
|
);
|
|
33158
|
-
|
|
33182
|
+
const d = b.build();
|
|
33183
|
+
return {
|
|
33184
|
+
...d,
|
|
33185
|
+
nodes: d.nodes.map((n) => {
|
|
33186
|
+
const \u89AA\u306E\u8B58\u5225\u5B50 = \u89AA.get(n.id);
|
|
33187
|
+
if (\u89AA\u306E\u8B58\u5225\u5B50 === void 0) return n;
|
|
33188
|
+
const \u89AA\u306E\u984C = \u984C.get(\u89AA\u306E\u8B58\u5225\u5B50) ?? \u89AA\u306E\u8B58\u5225\u5B50;
|
|
33189
|
+
return { ...n, eyebrow: `${n.eyebrow ?? "\u72B6\u614B"} / ${\u89AA\u306E\u984C}\u306E\u4E2D` };
|
|
33190
|
+
})
|
|
33191
|
+
};
|
|
33159
33192
|
}
|
|
33160
33193
|
};
|
|
33161
33194
|
return api;
|