@cardenelabs/dragon 0.15.0 → 0.17.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/README.md +10 -0
- package/dist/index.cjs +628 -379
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +217 -7
- package/dist/index.d.ts +217 -7
- package/dist/index.js +629 -381
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/compile.ts +567 -725
- package/src/index.ts +1 -0
- package/src/json-parser.ts +145 -2
- package/src/schemas/diagram.json +74 -3
- package/src/tokenize.ts +5 -5
- package/src/types.ts +84 -1
- package/src/v05/parser.ts +216 -6
package/dist/index.cjs
CHANGED
|
@@ -1885,6 +1885,10 @@ var \u3064\u307E\u307F\u306E\u8868 = {
|
|
|
1885
1885
|
|
|
1886
1886
|
// src/v05/parser.ts
|
|
1887
1887
|
var EDGE_SIDE_VALUES = ["top", "right", "bottom", "left"];
|
|
1888
|
+
var EDGE_HEAD_VALUES = cdl.EDGE_HEADS;
|
|
1889
|
+
var EDGE_HEAD_FILL_VALUES = cdl.EDGE_HEAD_FILLS;
|
|
1890
|
+
var CLASS_RELATION_VALUES = Object.keys(cdl.CLASS_RELATION_LOOK);
|
|
1891
|
+
var SEQ_MESSAGE_VALUES = Object.keys(cdl.SEQUENCE_MESSAGE_LOOK);
|
|
1888
1892
|
var TOP_LEVEL_KEYS = [
|
|
1889
1893
|
"title",
|
|
1890
1894
|
"type",
|
|
@@ -1909,7 +1913,11 @@ var TOP_LEVEL_KEYS = [
|
|
|
1909
1913
|
// 押下などの出来事で動く仕掛け (#1393)
|
|
1910
1914
|
"events",
|
|
1911
1915
|
// 巻き上げに応じて進む値 (#1393)
|
|
1912
|
-
"scrolls"
|
|
1916
|
+
"scrolls",
|
|
1917
|
+
// 動いている間の帯 (#1466)。 順序図だけが読む
|
|
1918
|
+
"bands",
|
|
1919
|
+
// 矢印をいつ出すか (#1470)
|
|
1920
|
+
"reveal"
|
|
1913
1921
|
];
|
|
1914
1922
|
var LANE_ID_ENTRY = /^([\p{L}\p{N}_-]+)\s*:\s*\{([^}]*)\}\s*$/u;
|
|
1915
1923
|
function \u540D\u524D\u3068\u4E2D\u62EC\u5F27\u306B\u5272\u308B(\u884C) {
|
|
@@ -1996,6 +2004,11 @@ var PRESET_TYPES = /* @__PURE__ */ new Set([
|
|
|
1996
2004
|
"pie",
|
|
1997
2005
|
"bar",
|
|
1998
2006
|
"line",
|
|
2007
|
+
"gauge",
|
|
2008
|
+
"radial",
|
|
2009
|
+
"stat",
|
|
2010
|
+
"waffle",
|
|
2011
|
+
"stacked",
|
|
1999
2012
|
"funnel",
|
|
2000
2013
|
"tree",
|
|
2001
2014
|
"journey",
|
|
@@ -2044,7 +2057,7 @@ var NODE_KIND_VALID = /* @__PURE__ */ new Set([
|
|
|
2044
2057
|
...Object.keys(INFRA_KIND_ALIAS)
|
|
2045
2058
|
]);
|
|
2046
2059
|
var TONE_VALID = new Set(cdl.TONES);
|
|
2047
|
-
var STYLE_VALID =
|
|
2060
|
+
var STYLE_VALID = new Set(cdl.EDGE_STYLES);
|
|
2048
2061
|
function \u66F8\u3051\u308B\u8272\u540D() {
|
|
2049
2062
|
return [.../* @__PURE__ */ new Set([...cdl.TONES, ...Object.keys(TONE_ALIAS)])];
|
|
2050
2063
|
}
|
|
@@ -2064,6 +2077,7 @@ function parseTextDslV05(src) {
|
|
|
2064
2077
|
let type = null;
|
|
2065
2078
|
let eyebrow = null;
|
|
2066
2079
|
let eyebrowLine = 0;
|
|
2080
|
+
let reveal = null;
|
|
2067
2081
|
let axes = void 0;
|
|
2068
2082
|
let axesLine = 0;
|
|
2069
2083
|
let actors = [];
|
|
@@ -2072,6 +2086,7 @@ function parseTextDslV05(src) {
|
|
|
2072
2086
|
const values = [];
|
|
2073
2087
|
let viewport = void 0;
|
|
2074
2088
|
let lanesMap = void 0;
|
|
2089
|
+
let bands = void 0;
|
|
2075
2090
|
let readoutsList = void 0;
|
|
2076
2091
|
let inputsList = void 0;
|
|
2077
2092
|
let formulasList = void 0;
|
|
@@ -2104,6 +2119,22 @@ function parseTextDslV05(src) {
|
|
|
2104
2119
|
i += 1;
|
|
2105
2120
|
continue;
|
|
2106
2121
|
}
|
|
2122
|
+
if (head.key === "reveal") {
|
|
2123
|
+
const v = (head.value ?? "").trim();
|
|
2124
|
+
if (v.length > 0) {
|
|
2125
|
+
if (cdl.EDGE_REVEALS.includes(v)) {
|
|
2126
|
+
reveal = v;
|
|
2127
|
+
} else {
|
|
2128
|
+
errors.push({
|
|
2129
|
+
line: line.no,
|
|
2130
|
+
message: `reveal \u304C\u8AAD\u3081\u307E\u305B\u3093 (\u66F8\u3044\u305F\u5024: ${v})`,
|
|
2131
|
+
hint: `\u4F7F\u3048\u308B\u8A9E = ${cdl.EDGE_REVEALS.join(" / ")}`
|
|
2132
|
+
});
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
i += 1;
|
|
2136
|
+
continue;
|
|
2137
|
+
}
|
|
2107
2138
|
if (head.key === "eyebrow") {
|
|
2108
2139
|
const v = (head.value ?? "").trim();
|
|
2109
2140
|
eyebrow = v.length > 0 ? v : null;
|
|
@@ -2284,6 +2315,24 @@ function parseTextDslV05(src) {
|
|
|
2284
2315
|
i = next;
|
|
2285
2316
|
continue;
|
|
2286
2317
|
}
|
|
2318
|
+
if (head.key === "bands") {
|
|
2319
|
+
const { items, next } = collectIndentedList(lines, i + 1, line.indent);
|
|
2320
|
+
bands = [];
|
|
2321
|
+
for (const it of items) {
|
|
2322
|
+
const m = it.trimmed.match(/^(?:-\s*)?(.+?)\s*:\s*(\d+)\s*\.\.\s*(\d+)\s*$/);
|
|
2323
|
+
if (!m) {
|
|
2324
|
+
errors.push({
|
|
2325
|
+
line: it.no,
|
|
2326
|
+
message: `\u5E2F\u306E\u66F8\u304D\u65B9\u304C\u8AAD\u3081\u307E\u305B\u3093: "${it.trimmed}"`,
|
|
2327
|
+
hint: "use `- DB: 1..2` (\u9762\u306E\u540D\u524D\u3068\u3001\u6BB5\u306E\u756A\u53F7\u306E\u533A\u9593)"
|
|
2328
|
+
});
|
|
2329
|
+
continue;
|
|
2330
|
+
}
|
|
2331
|
+
bands.push({ actor: m[1], from: Number(m[2]), to: Number(m[3]) });
|
|
2332
|
+
}
|
|
2333
|
+
i = next;
|
|
2334
|
+
continue;
|
|
2335
|
+
}
|
|
2287
2336
|
if (head.key === "lanes") {
|
|
2288
2337
|
const { items, next } = collectIndentedList(lines, i + 1, line.indent);
|
|
2289
2338
|
lanesMap = {};
|
|
@@ -2498,6 +2547,7 @@ function parseTextDslV05(src) {
|
|
|
2498
2547
|
title,
|
|
2499
2548
|
type,
|
|
2500
2549
|
...eyebrow !== null ? { eyebrow, eyebrowPos: { line: eyebrowLine } } : {},
|
|
2550
|
+
...reveal !== null ? { reveal } : {},
|
|
2501
2551
|
...axes !== void 0 ? { axes, axesPos: { line: axesLine } } : {},
|
|
2502
2552
|
actors,
|
|
2503
2553
|
flow: flow2,
|
|
@@ -2505,6 +2555,7 @@ function parseTextDslV05(src) {
|
|
|
2505
2555
|
...values.length > 0 ? { values } : {},
|
|
2506
2556
|
viewport,
|
|
2507
2557
|
lanes: lanesMap,
|
|
2558
|
+
...bands && bands.length > 0 ? { bands } : {},
|
|
2508
2559
|
readouts: readoutsList,
|
|
2509
2560
|
inputs: inputsList,
|
|
2510
2561
|
formulas: formulasList,
|
|
@@ -3429,6 +3480,11 @@ function applyContinuationLines(actor, rest, errors) {
|
|
|
3429
3480
|
case "\u5024":
|
|
3430
3481
|
out.value = stripQuotes(raw);
|
|
3431
3482
|
break;
|
|
3483
|
+
// 前の時点の値 (#1450)。 内訳を帯で示す図と値 1 つを大きく示す図が読む
|
|
3484
|
+
case "previous":
|
|
3485
|
+
case "\u524D\u306E\u5024":
|
|
3486
|
+
out.previous = stripQuotes(raw);
|
|
3487
|
+
break;
|
|
3432
3488
|
case "shape":
|
|
3433
3489
|
case "\u56F3\u5F62":
|
|
3434
3490
|
out.shape = \u56F3\u5F62\u3068\u3057\u3066\u8AAD\u3080(raw, ln.no, errors);
|
|
@@ -3462,6 +3518,19 @@ function applyContinuationLines(actor, rest, errors) {
|
|
|
3462
3518
|
case "\u884C":
|
|
3463
3519
|
out.rows = raw.replace(/^\[|\]$/g, "").split(/,(?![^[]*\])/).map((x) => stripQuotes(x.trim())).filter(Boolean);
|
|
3464
3520
|
break;
|
|
3521
|
+
/*
|
|
3522
|
+
* 行頭の印 (#1466)。 `rows` と同じ並びで、空文字はその行に印を付けない。
|
|
3523
|
+
*
|
|
3524
|
+
* **語の意味は図の種類が決める**。 ER は `pk` / `fk` / `opt`、状態遷移は
|
|
3525
|
+
* `entry` / `exit` / `do` / `internal`。 印の 2 軸 (形 × 塗り) は共通だが、その軸が
|
|
3526
|
+
* 何を指すかは種類ごとに違う = 1 つの語彙に畳むと、どの図でも意味が合わない語が残る。
|
|
3527
|
+
*
|
|
3528
|
+
* 空の要素を捨てない (`filter(Boolean)` を掛けない) = 並びが `rows` とずれる。
|
|
3529
|
+
*/
|
|
3530
|
+
case "marks":
|
|
3531
|
+
case "\u5370":
|
|
3532
|
+
out.marks = raw.replace(/^\[|\]$/g, "").split(/,(?![^[]*\])/).map((x) => stripQuotes(x.trim()));
|
|
3533
|
+
break;
|
|
3465
3534
|
case "\u4F4D\u7F6E":
|
|
3466
3535
|
case "pos": {
|
|
3467
3536
|
const value = stripQuotes(raw);
|
|
@@ -3576,8 +3645,14 @@ var ACTOR_ITEM_KEYS = /* @__PURE__ */ new Set([
|
|
|
3576
3645
|
"\u88DC\u8DB3",
|
|
3577
3646
|
"value",
|
|
3578
3647
|
"\u5024",
|
|
3648
|
+
// 前の時点の値 (#1450)。 内訳の変化を帯で示す図と、値 1 つを大きく示す図が読む
|
|
3649
|
+
"previous",
|
|
3650
|
+
"\u524D\u306E\u5024",
|
|
3579
3651
|
"rows",
|
|
3580
3652
|
"\u884C",
|
|
3653
|
+
// 行頭の印 (#1466)。 `rows` と同じ並びで、形 × 塗り の 2 軸を語で書く
|
|
3654
|
+
"marks",
|
|
3655
|
+
"\u5370",
|
|
3581
3656
|
// 箱の中に描く図形 (#1374)
|
|
3582
3657
|
"shape",
|
|
3583
3658
|
"\u56F3\u5F62",
|
|
@@ -3701,7 +3776,9 @@ var ACTOR_RESERVED_FIELDS = /* @__PURE__ */ new Set([
|
|
|
3701
3776
|
"subtitle",
|
|
3702
3777
|
"eyebrow",
|
|
3703
3778
|
"value",
|
|
3779
|
+
"previous",
|
|
3704
3780
|
"rows",
|
|
3781
|
+
"marks",
|
|
3705
3782
|
"lane",
|
|
3706
3783
|
"stack",
|
|
3707
3784
|
"initial",
|
|
@@ -3803,7 +3880,9 @@ var INLINE_ACTOR_ALIASES = {
|
|
|
3803
3880
|
\u7A2E\u985E: "kind",
|
|
3804
3881
|
\u88DC\u8DB3: "subtitle",
|
|
3805
3882
|
\u5024: "value",
|
|
3806
|
-
\
|
|
3883
|
+
\u524D\u306E\u5024: "previous",
|
|
3884
|
+
\u884C: "rows",
|
|
3885
|
+
\u5370: "marks"
|
|
3807
3886
|
};
|
|
3808
3887
|
function \u4E2D\u62EC\u5F27\u306E\u5225\u540D\u3092\u5BC4\u305B\u308B(opts) {
|
|
3809
3888
|
let \u89E6\u3063\u305F = false;
|
|
@@ -3821,7 +3900,9 @@ var INLINE_ACTOR_KEYS = /* @__PURE__ */ new Set([
|
|
|
3821
3900
|
"subtitle",
|
|
3822
3901
|
"eyebrow",
|
|
3823
3902
|
"value",
|
|
3903
|
+
"previous",
|
|
3824
3904
|
"rows",
|
|
3905
|
+
"marks",
|
|
3825
3906
|
"lane",
|
|
3826
3907
|
"stack",
|
|
3827
3908
|
"initial",
|
|
@@ -3868,6 +3949,27 @@ var FLOW_INLINE_READERS = {
|
|
|
3868
3949
|
cardinality: (v) => v,
|
|
3869
3950
|
// 矢印がどの辺から出るか (#1385)。 描画側は 4 方向を取り、書かなければ自動で選ぶ
|
|
3870
3951
|
side: (v) => v !== void 0 && EDGE_SIDE_VALUES.includes(v) ? v : void 0,
|
|
3952
|
+
// 矢印の先の形 (#1462)。 書かなければ描画側の既定 (塗った三角) になる
|
|
3953
|
+
head: (v) => v !== void 0 && EDGE_HEAD_VALUES.includes(v) ? v : void 0,
|
|
3954
|
+
// 出どころ側の端の形 (#1466)。 ER は端ごとに違う個数を示すので両端に要る
|
|
3955
|
+
tailHead: (v) => v !== void 0 && EDGE_HEAD_VALUES.includes(v) ? v : void 0,
|
|
3956
|
+
// 端の印の塗り (#1466)。 白抜きの菱が「持つ」、塗った菱が「抱える」
|
|
3957
|
+
headFill: (v) => v !== void 0 && EDGE_HEAD_FILL_VALUES.includes(v) ? v : void 0,
|
|
3958
|
+
tailHeadFill: (v) => v !== void 0 && EDGE_HEAD_FILL_VALUES.includes(v) ? v : void 0,
|
|
3959
|
+
/*
|
|
3960
|
+
* クラス図の関係の種類 (#1466)。 書くと **線と端の形と塗りと付く側** がまとめて決まる
|
|
3961
|
+
* (`CLASS_RELATION_LOOK`)。
|
|
3962
|
+
*
|
|
3963
|
+
* 4 つを個別に書かせない = 組合せは 6 通りしか無く、1 つでも書き違えると読み手に別の意味で
|
|
3964
|
+
* 伝わる (菱を逆に置くと持ち主が入れ替わる)。 種類で書けばその 6 通りから外れない。
|
|
3965
|
+
*/
|
|
3966
|
+
relation: (v) => v !== void 0 && CLASS_RELATION_VALUES.includes(v) ? v : void 0,
|
|
3967
|
+
/*
|
|
3968
|
+
* 順序図の言づての種類 (#1466)。 書くと線と矢の形がまとめて決まる。
|
|
3969
|
+
*
|
|
3970
|
+
* 呼ぶ (実線 + 塗った矢) / 返す (破線 + 開いた矢) / 投げる (実線 + 開いた矢) の 3 つ。
|
|
3971
|
+
*/
|
|
3972
|
+
kind: (v) => v !== void 0 && SEQ_MESSAGE_VALUES.includes(v) ? v : void 0,
|
|
3871
3973
|
/*
|
|
3872
3974
|
* 矢印を値に追随させる 3 欄 (#1396)。 箱の `wBind` (#1392) と同じく文字列だけを取る。
|
|
3873
3975
|
*
|
|
@@ -3932,7 +4034,10 @@ function parseActor2(line, errors) {
|
|
|
3932
4034
|
owner: isPart ? void 0 : opts.owner,
|
|
3933
4035
|
end: isPart ? void 0 : opts.end,
|
|
3934
4036
|
value: opts.value,
|
|
4037
|
+
previous: opts.previous,
|
|
3935
4038
|
rows: opts.rows ? opts.rows.replace(/^\[|\]$/g, "").split(/,(?![^[]*\])/).map((x) => stripQuotes(x.trim())).filter(Boolean) : void 0,
|
|
4039
|
+
// 行頭の印 (#1466)。 `rows` と同じ並びなので **空の要素を捨てない**
|
|
4040
|
+
marks: opts.marks ? opts.marks.replace(/^\[|\]$/g, "").split(/,(?![^[]*\])/).map((x) => stripQuotes(x.trim())) : void 0,
|
|
3936
4041
|
lane: opts.lane,
|
|
3937
4042
|
// 箱の中に描く図形 (#1374)。 パーツでは状態の上書きとして意味を持つため横取りしない
|
|
3938
4043
|
shape: isPart || opts.shape === void 0 ? void 0 : \u56F3\u5F62\u3068\u3057\u3066\u8AAD\u3080(opts.shape, line.no, errors),
|
|
@@ -4028,6 +4133,22 @@ function parseFlowStep(line, no, errors) {
|
|
|
4028
4133
|
hint: `\u4F7F\u3048\u308B\u5024 = ${EDGE_SIDE_VALUES.join(", ")}`
|
|
4029
4134
|
});
|
|
4030
4135
|
}
|
|
4136
|
+
for (const [\u6B04, \u4F7F\u3048\u308B] of [
|
|
4137
|
+
["head", EDGE_HEAD_VALUES],
|
|
4138
|
+
["tailHead", EDGE_HEAD_VALUES],
|
|
4139
|
+
["headFill", EDGE_HEAD_FILL_VALUES],
|
|
4140
|
+
["tailHeadFill", EDGE_HEAD_FILL_VALUES],
|
|
4141
|
+
["relation", CLASS_RELATION_VALUES],
|
|
4142
|
+
["kind", SEQ_MESSAGE_VALUES]
|
|
4143
|
+
]) {
|
|
4144
|
+
if (opts[\u6B04] !== void 0 && \u4E2D\u62EC\u5F27[\u6B04] === void 0) {
|
|
4145
|
+
errors.push({
|
|
4146
|
+
line: line.no,
|
|
4147
|
+
message: `\u77E2\u5370\u306E ${\u6B04} \u304C\u8AAD\u3081\u307E\u305B\u3093: "${opts[\u6B04]}"`,
|
|
4148
|
+
hint: `\u4F7F\u3048\u308B\u5024 = ${\u4F7F\u3048\u308B.join(", ")}`
|
|
4149
|
+
});
|
|
4150
|
+
}
|
|
4151
|
+
}
|
|
4031
4152
|
\u6570\u3068\u771F\u507D = \u8868\u3067\u8AAD\u3080(FLOW_INLINE_VALUE_KINDS, opts, "\u77E2\u5370\u306E ", line.no, errors);
|
|
4032
4153
|
rest = \u584A.\u524D.trim();
|
|
4033
4154
|
}
|
|
@@ -4035,6 +4156,12 @@ function parseFlowStep(line, no, errors) {
|
|
|
4035
4156
|
const guard = \u4E2D\u62EC\u5F27.guard;
|
|
4036
4157
|
const cardinality = \u4E2D\u62EC\u5F27.cardinality;
|
|
4037
4158
|
const side = \u4E2D\u62EC\u5F27.side;
|
|
4159
|
+
const head = \u4E2D\u62EC\u5F27.head;
|
|
4160
|
+
const tailHead = \u4E2D\u62EC\u5F27.tailHead;
|
|
4161
|
+
const headFill = \u4E2D\u62EC\u5F27.headFill;
|
|
4162
|
+
const tailHeadFill = \u4E2D\u62EC\u5F27.tailHeadFill;
|
|
4163
|
+
const relation = \u4E2D\u62EC\u5F27.relation;
|
|
4164
|
+
const msgKind = \u4E2D\u62EC\u5F27.kind;
|
|
4038
4165
|
const widthBind = \u8FFD\u968F\u3059\u308B\u5927\u304D\u3055\u3068\u3057\u3066\u8AAD\u3080(
|
|
4039
4166
|
\u4E2D\u62EC\u5F27.widthBind,
|
|
4040
4167
|
"\u77E2\u5370\u306E widthBind ",
|
|
@@ -4104,6 +4231,12 @@ function parseFlowStep(line, no, errors) {
|
|
|
4104
4231
|
guard,
|
|
4105
4232
|
cardinality,
|
|
4106
4233
|
side,
|
|
4234
|
+
head,
|
|
4235
|
+
tailHead,
|
|
4236
|
+
headFill,
|
|
4237
|
+
tailHeadFill,
|
|
4238
|
+
relation,
|
|
4239
|
+
msgKind,
|
|
4107
4240
|
widthBind,
|
|
4108
4241
|
strokeBind,
|
|
4109
4242
|
dashOffsetBind,
|
|
@@ -4263,16 +4396,34 @@ function parsePhase(block, errors) {
|
|
|
4263
4396
|
continue;
|
|
4264
4397
|
}
|
|
4265
4398
|
if (key === "draw") {
|
|
4266
|
-
const \u8A9E = stripQuotes(value).trim();
|
|
4399
|
+
const [\u8A9E = "", \u5272\u5408\u306E\u6587\u5B57, ...\u4F59\u308A] = stripQuotes(value).trim().split(/\s+/);
|
|
4267
4400
|
if (!DRAW_WORDS.has(\u8A9E)) {
|
|
4268
4401
|
errors.push({
|
|
4269
4402
|
line: ln.no,
|
|
4270
4403
|
message: `draw \u306B\u66F8\u3051\u306A\u3044\u8A9E\u3067\u3059: "${\u8A9E}"`,
|
|
4271
4404
|
hint: `\u4F7F\u3048\u308B\u8A9E = ${[...DRAW_WORDS].join(", ")}`
|
|
4272
4405
|
});
|
|
4406
|
+
} else if (\u4F59\u308A.length > 0) {
|
|
4407
|
+
errors.push({
|
|
4408
|
+
line: ln.no,
|
|
4409
|
+
message: `draw \u306B\u66F8\u3051\u308B\u9805\u76EE\u306F\u8A9E\u3068\u5272\u5408\u306E 2 \u3064\u307E\u3067\u3067\u3059: "${stripQuotes(value).trim()}"`,
|
|
4410
|
+
hint: "use `draw: line 0.4`"
|
|
4411
|
+
});
|
|
4273
4412
|
} else {
|
|
4274
4413
|
phase.draw = \u8A9E;
|
|
4275
4414
|
phase.drawPos = { line: ln.no };
|
|
4415
|
+
if (\u5272\u5408\u306E\u6587\u5B57 !== void 0) {
|
|
4416
|
+
const \u5272\u5408 = Number(\u5272\u5408\u306E\u6587\u5B57);
|
|
4417
|
+
if (!Number.isFinite(\u5272\u5408) || \u5272\u5408 <= 0 || \u5272\u5408 > 1) {
|
|
4418
|
+
errors.push({
|
|
4419
|
+
line: ln.no,
|
|
4420
|
+
message: `draw \u306E\u5272\u5408\u304C\u7BC4\u56F2\u5916\u3067\u3059: "${\u5272\u5408\u306E\u6587\u5B57}"`,
|
|
4421
|
+
hint: "0 \u3088\u308A\u5927\u304D\u304F 1 \u4EE5\u4E0B\u3067\u66F8\u304D\u307E\u3059 (\u4F8B `draw: line 0.4`)"
|
|
4422
|
+
});
|
|
4423
|
+
} else {
|
|
4424
|
+
phase.drawRatio = \u5272\u5408;
|
|
4425
|
+
}
|
|
4426
|
+
}
|
|
4276
4427
|
}
|
|
4277
4428
|
i += 1;
|
|
4278
4429
|
continue;
|
|
@@ -4775,7 +4926,6 @@ function compileToCdl(doc, opts) {
|
|
|
4775
4926
|
doc = canonicalizeFlowActors(doc);
|
|
4776
4927
|
const \u66F8\u3044\u305F\u307E\u307E = doc;
|
|
4777
4928
|
doc = dropUnresolvedFlow(doc);
|
|
4778
|
-
doc = dropSelfLoopFlow(doc);
|
|
4779
4929
|
const \u5206\u3051\u305F = disambiguateActorIds(doc, opts?.onNotice);
|
|
4780
4930
|
doc = \u5206\u3051\u305F.doc;
|
|
4781
4931
|
let diagram2;
|
|
@@ -4816,6 +4966,21 @@ function compileToCdl(doc, opts) {
|
|
|
4816
4966
|
case "line":
|
|
4817
4967
|
diagram2 = compileValueChart(doc, "line", "chart-line", opts?.onNotice);
|
|
4818
4968
|
break;
|
|
4969
|
+
case "gauge":
|
|
4970
|
+
diagram2 = compileValueChart(doc, "gauge", "chart-gauge", opts?.onNotice);
|
|
4971
|
+
break;
|
|
4972
|
+
case "radial":
|
|
4973
|
+
diagram2 = compileValueChart(doc, "radial", "chart-radial", opts?.onNotice);
|
|
4974
|
+
break;
|
|
4975
|
+
case "stat":
|
|
4976
|
+
diagram2 = compileValueChart(doc, "stat", "chart-stat", opts?.onNotice);
|
|
4977
|
+
break;
|
|
4978
|
+
case "waffle":
|
|
4979
|
+
diagram2 = compileValueChart(doc, "waffle", "chart-waffle", opts?.onNotice);
|
|
4980
|
+
break;
|
|
4981
|
+
case "stacked":
|
|
4982
|
+
diagram2 = compileValueChart(doc, "stacked", "chart-stacked-bar", opts?.onNotice);
|
|
4983
|
+
break;
|
|
4819
4984
|
case "funnel":
|
|
4820
4985
|
diagram2 = compileFunnel(doc, opts?.onNotice);
|
|
4821
4986
|
break;
|
|
@@ -4844,15 +5009,16 @@ function compileToCdl(doc, opts) {
|
|
|
4844
5009
|
applyNodeTones(diagram2, doc);
|
|
4845
5010
|
reportMissingFocusTargets(\u66F8\u3044\u305F\u307E\u307E, opts?.onNotice);
|
|
4846
5011
|
reportMissingFlowActors(\u66F8\u3044\u305F\u307E\u307E, opts?.onNotice);
|
|
4847
|
-
reportSelfLoopFlow(\u66F8\u3044\u305F\u307E\u307E, opts?.onNotice);
|
|
4848
5012
|
reportFlowEndpointNotHonored(doc, \u5206\u3051\u305F.\u5143\u306E\u540D\u524D, opts?.onNotice);
|
|
4849
5013
|
reportLaneNotHonored(\u66F8\u3044\u305F\u307E\u307E, opts?.onNotice);
|
|
5014
|
+
reportActorKindNotHonored(\u66F8\u3044\u305F\u307E\u307E, opts?.onNotice);
|
|
5015
|
+
reportMessageOptionNotHonored(\u66F8\u3044\u305F\u307E\u307E, opts?.onNotice);
|
|
4850
5016
|
reportDocEyebrowNotHonored(\u66F8\u3044\u305F\u307E\u307E, opts?.onNotice);
|
|
4851
5017
|
reportDrawNotHonored(\u66F8\u3044\u305F\u307E\u307E, opts?.onNotice);
|
|
4852
5018
|
reportChartFieldsNotHonored(\u66F8\u3044\u305F\u307E\u307E, opts?.onNotice);
|
|
4853
5019
|
reportAxesNotHonored(\u66F8\u3044\u305F\u307E\u307E, opts?.onNotice);
|
|
4854
5020
|
const placed = resolveRelativeDoc(diagram2, doc, opts?.onNotice, opts?.partsCatalog);
|
|
4855
|
-
applyCanvasPivotPositions(diagram2, placed);
|
|
5021
|
+
applyCanvasPivotPositions(diagram2, placed, opts?.onNotice);
|
|
4856
5022
|
const \u8FFD\u52A0\u3057\u305F\u7E26\u5217 = [];
|
|
4857
5023
|
const extended = applyV05Extensions(diagram2, placed, \u8FFD\u52A0\u3057\u305F\u7E26\u5217);
|
|
4858
5024
|
const inheritedDerivedSourceLines = opts?.onNotice ? /* @__PURE__ */ new Map() : void 0;
|
|
@@ -4875,6 +5041,7 @@ function compileToCdl(doc, opts) {
|
|
|
4875
5041
|
}
|
|
4876
5042
|
injectStaticPhase(merged);
|
|
4877
5043
|
materializeStates(merged, doc);
|
|
5044
|
+
if (doc.reveal !== void 0) merged.edgeReveal = doc.reveal;
|
|
4878
5045
|
\u8A9E\u306E\u72B6\u614B\u3092\u56F3\u306E\u8A9E\u3078\u76F4\u3059(merged);
|
|
4879
5046
|
const \u7573\u3093\u3060\u304D\u3063\u304B\u3051 = foldValueTriggers(merged, doc, opts?.onNotice);
|
|
4880
5047
|
attachDerivedValues(merged, doc, opts?.onNotice, inheritedDerivedSourceLines, \u7573\u3093\u3060\u304D\u3063\u304B\u3051);
|
|
@@ -5074,6 +5241,11 @@ var \u56F3\u7A2E\u306E\u4F5C\u308A = {
|
|
|
5074
5241
|
pie: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
|
|
5075
5242
|
bar: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
|
|
5076
5243
|
line: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
|
|
5244
|
+
gauge: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
|
|
5245
|
+
radial: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
|
|
5246
|
+
stat: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
|
|
5247
|
+
waffle: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
|
|
5248
|
+
stacked: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
|
|
5077
5249
|
funnel: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
|
|
5078
5250
|
tree: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
|
|
5079
5251
|
journey: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
|
|
@@ -5086,27 +5258,6 @@ function dropUnresolvedFlow(doc) {
|
|
|
5086
5258
|
const flow2 = doc.flow.filter((s) => \u8868.has(s.from) && \u8868.has(s.to));
|
|
5087
5259
|
return flow2.length === doc.flow.length ? doc : { ...doc, flow: flow2 };
|
|
5088
5260
|
}
|
|
5089
|
-
function dropSelfLoopFlow(doc) {
|
|
5090
|
-
if (\u56F3\u7A2E\u306E\u4F5C\u308A[doc.type] === "\u56F3\u5168\u4F53\u3092 1 \u7BB1") return doc;
|
|
5091
|
-
const flow2 = doc.flow.filter((s) => s.from !== s.to);
|
|
5092
|
-
return flow2.length === doc.flow.length ? doc : { ...doc, flow: flow2 };
|
|
5093
|
-
}
|
|
5094
|
-
function reportSelfLoopFlow(doc, onNotice) {
|
|
5095
|
-
if (!onNotice) return;
|
|
5096
|
-
if (\u56F3\u7A2E\u306E\u4F5C\u308A[doc.type] === "\u56F3\u5168\u4F53\u3092 1 \u7BB1") return;
|
|
5097
|
-
const \u77E5\u3089\u305B\u305F = /* @__PURE__ */ new Set();
|
|
5098
|
-
for (const s of doc.flow) {
|
|
5099
|
-
if (s.from !== s.to || \u77E5\u3089\u305B\u305F.has(s.from)) continue;
|
|
5100
|
-
\u77E5\u3089\u305B\u305F.add(s.from);
|
|
5101
|
-
onNotice({
|
|
5102
|
-
kind: "flow-self-loop",
|
|
5103
|
-
actor: s.from,
|
|
5104
|
-
line: s.pos.line,
|
|
5105
|
-
message: `"${truncateForMessage(s.from)}" \u304B\u3089\u81EA\u5206\u3078\u623B\u308B\u77E2\u5370\u306F\u63CF\u3051\u307E\u305B\u3093 (\u7D44\u307F\u7ACB\u3066\u304B\u3089\u5916\u3057\u307E\u3057\u305F)`,
|
|
5106
|
-
hint: "\u9014\u4E2D\u306E\u7BB1\u3092 1 \u3064\u8DB3\u3057\u3066 2 \u672C\u306B\u5206\u3051\u308B\u304B\u3001 \u6BB5 (animation) \u3067\u72B6\u614B\u304C\u5909\u308F\u308B\u69D8\u5B50\u3068\u3057\u3066\u898B\u305B\u308B"
|
|
5107
|
-
});
|
|
5108
|
-
}
|
|
5109
|
-
}
|
|
5110
5261
|
function \u56F3\u306E\u5C0F\u898B\u51FA\u3057(doc) {
|
|
5111
5262
|
return doc.eyebrow === void 0 ? {} : { eyebrow: doc.eyebrow };
|
|
5112
5263
|
}
|
|
@@ -5185,6 +5336,59 @@ function reportFlowEndpointNotHonored(doc, \u5143\u306E\u540D\u524D, onNotice) {
|
|
|
5185
5336
|
});
|
|
5186
5337
|
}
|
|
5187
5338
|
}
|
|
5339
|
+
function reportMessageOptionNotHonored(doc, onNotice) {
|
|
5340
|
+
if (!onNotice) return;
|
|
5341
|
+
if (doc.type !== "sequence" && doc.type !== "solidity") return;
|
|
5342
|
+
for (const s of doc.flow) {
|
|
5343
|
+
const \u52B9\u304B\u306A\u3044 = [
|
|
5344
|
+
s.tone !== void 0 ? "\u8272\u5473" : "",
|
|
5345
|
+
s.sub !== void 0 ? "\u6DFB\u3048\u5B57" : "",
|
|
5346
|
+
s.side !== void 0 ? "\u5BC4\u305B" : ""
|
|
5347
|
+
].filter((x) => x !== "");
|
|
5348
|
+
if (\u52B9\u304B\u306A\u3044.length === 0) continue;
|
|
5349
|
+
onNotice({
|
|
5350
|
+
kind: "message-option-not-honored",
|
|
5351
|
+
actor: s.from,
|
|
5352
|
+
line: s.pos?.line ?? 0,
|
|
5353
|
+
message: `"${truncateForMessage(s.label)}" \u306B\u66F8\u3044\u305F ${\u52B9\u304B\u306A\u3044.join(" / ")} \u306F\u52B9\u304D\u307E\u305B\u3093 (type: ${doc.type} \u306E\u677F\u306F\u8A9E\u3068\u5411\u304D\u3068\u7A2E\u985E\u3060\u3051\u3092\u63CF\u304D\u307E\u3059)`,
|
|
5354
|
+
hint: "\u677F\u306B\u306F\u77E2\u5370\u304C\u7121\u3044\u305F\u3081\u98FE\u308A\u3092\u8F09\u305B\u308B\u5148\u304C\u3042\u308A\u307E\u305B\u3093\u3002 \u8A00\u3065\u3066\u306E\u7A2E\u985E (kind: call / return / fire) \u3067\u63CF\u304D\u5206\u3051\u3066\u304F\u3060\u3055\u3044"
|
|
5355
|
+
});
|
|
5356
|
+
}
|
|
5357
|
+
}
|
|
5358
|
+
function reportActorKindNotHonored(doc, onNotice) {
|
|
5359
|
+
if (!onNotice) return;
|
|
5360
|
+
if (doc.type !== "sequence" && doc.type !== "solidity") return;
|
|
5361
|
+
for (const a of doc.actors) {
|
|
5362
|
+
if (a.partId !== void 0) continue;
|
|
5363
|
+
const \u52B9\u304B\u306A\u3044 = [
|
|
5364
|
+
/*
|
|
5365
|
+
* 種類は `sequence` でだけ落ちる。
|
|
5366
|
+
*
|
|
5367
|
+
* `solidity` は種類で **面の並びを決める** (`compileSolidity`) ので、絵にならなくても
|
|
5368
|
+
* 書いた意味は figure に出ている。 落ちたと伝えると、正しく効いている指定に毎回鳴る。
|
|
5369
|
+
*
|
|
5370
|
+
* 記法を通すと既定の `actor` が必ず入るため、値ではなく書いたかどうかの印で見る。
|
|
5371
|
+
* 記法を通さず直接組み立てた場合はこの印が無いので、種類を置いたこと自体を「書いた」 とみなす
|
|
5372
|
+
*/
|
|
5373
|
+
doc.type === "sequence" && a.kindWritten !== false && a.kind !== void 0 ? "\u7A2E\u985E" : "",
|
|
5374
|
+
a.posW !== void 0 || a.posH !== void 0 ? "\u5927\u304D\u3055" : "",
|
|
5375
|
+
a.posX !== void 0 || a.posY !== void 0 || a.posRel !== void 0 ? "\u4F4D\u7F6E" : "",
|
|
5376
|
+
a.rows !== void 0 ? "\u884C" : "",
|
|
5377
|
+
a.tone !== void 0 ? "\u8272" : "",
|
|
5378
|
+
a.eyebrow !== void 0 ? "\u5C0F\u898B\u51FA\u3057" : "",
|
|
5379
|
+
a.value !== void 0 ? "\u5024" : "",
|
|
5380
|
+
a.shape !== void 0 ? "\u56F3\u5F62" : ""
|
|
5381
|
+
].filter((x) => x !== "");
|
|
5382
|
+
if (\u52B9\u304B\u306A\u3044.length === 0) continue;
|
|
5383
|
+
onNotice({
|
|
5384
|
+
kind: "actor-kind-not-honored",
|
|
5385
|
+
actor: a.name,
|
|
5386
|
+
line: a.pos?.line ?? 0,
|
|
5387
|
+
message: `"${truncateForMessage(a.name)}" \u306B\u66F8\u3044\u305F ${\u52B9\u304B\u306A\u3044.join(" / ")} \u306F\u52B9\u304D\u307E\u305B\u3093 (type: ${doc.type} \u306E\u677F\u306F\u540D\u524D\u3068\u547C\u3073\u540D\u3060\u3051\u3092\u63CF\u304D\u307E\u3059)`,
|
|
5388
|
+
hint: "\u677F\u306B\u306F\u9762\u3054\u3068\u306E\u7BB1\u304C\u7121\u3044\u305F\u3081\u98FE\u308A\u3092\u8F09\u305B\u308B\u5148\u304C\u3042\u308A\u307E\u305B\u3093\u3002 \u547C\u3073\u540D (subtitle) \u306B\u66F8\u304F\u304B\u3001\u7BB1\u3092\u6301\u3064\u56F3\u7A2E\u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044"
|
|
5389
|
+
});
|
|
5390
|
+
}
|
|
5391
|
+
}
|
|
5188
5392
|
function reportLaneNotHonored(doc, onNotice) {
|
|
5189
5393
|
if (!onNotice) return;
|
|
5190
5394
|
if (doc.type === "mind") return;
|
|
@@ -5232,6 +5436,11 @@ var \u7A7A\u306E\u5F62\u306E\u9003\u3052\u5148 = {
|
|
|
5232
5436
|
pie: [],
|
|
5233
5437
|
bar: [],
|
|
5234
5438
|
line: [],
|
|
5439
|
+
gauge: [],
|
|
5440
|
+
radial: [],
|
|
5441
|
+
stat: [],
|
|
5442
|
+
waffle: [],
|
|
5443
|
+
stacked: [],
|
|
5235
5444
|
funnel: [],
|
|
5236
5445
|
tree: [],
|
|
5237
5446
|
journey: [],
|
|
@@ -5579,7 +5788,7 @@ function applyNodeTones(diagram2, doc) {
|
|
|
5579
5788
|
}
|
|
5580
5789
|
}
|
|
5581
5790
|
}
|
|
5582
|
-
function applyCanvasPivotPositions(diagram2, doc) {
|
|
5791
|
+
function applyCanvasPivotPositions(diagram2, doc, onNotice) {
|
|
5583
5792
|
for (const actor of doc.actors) {
|
|
5584
5793
|
if (actor.partId !== void 0) continue;
|
|
5585
5794
|
const aliasSlug = slugify(actor.name);
|
|
@@ -5604,14 +5813,25 @@ function applyCanvasPivotPositions(diagram2, doc) {
|
|
|
5604
5813
|
if (actor.nodes) {
|
|
5605
5814
|
for (const [subKey, override] of Object.entries(actor.nodes)) {
|
|
5606
5815
|
if (override.posX === void 0 || override.posY === void 0) continue;
|
|
5816
|
+
let \u5F53\u305F\u3063\u305F = 0;
|
|
5607
5817
|
for (const node of diagram2.nodes) {
|
|
5608
5818
|
if (node.id === `${aliasSlug}-${subKey}` || node.id === `${subKey}-${aliasSlug}`) {
|
|
5609
5819
|
node.posX = override.posX;
|
|
5610
5820
|
node.posY = override.posY;
|
|
5611
5821
|
if (override.posW !== void 0) node.posW = override.posW;
|
|
5612
5822
|
if (override.posH !== void 0) node.posH = override.posH;
|
|
5823
|
+
\u5F53\u305F\u3063\u305F += 1;
|
|
5613
5824
|
}
|
|
5614
5825
|
}
|
|
5826
|
+
if (\u5F53\u305F\u3063\u305F === 0) {
|
|
5827
|
+
onNotice?.({
|
|
5828
|
+
kind: "sub-node-not-found",
|
|
5829
|
+
actor: actor.name,
|
|
5830
|
+
line: actor.pos?.line ?? 0,
|
|
5831
|
+
message: `"${truncateForMessage(actor.name)}" \u306E nodes \u306B\u66F8\u3044\u305F "${truncateForMessage(subKey)}" \u306B\u5F53\u305F\u308B\u7BB1\u304C\u56F3\u306B\u3042\u308A\u307E\u305B\u3093`,
|
|
5832
|
+
hint: "1 \u4EBA\u306B\u8907\u6570\u306E\u7BB1\u3092\u4F5C\u308B\u56F3\u7A2E\u3067\u3060\u3051\u52B9\u304D\u307E\u3059\u3002 \u7BB1\u305D\u306E\u3082\u306E\u306E\u4F4D\u7F6E\u306F actor \u5074\u306E \u4F4D\u7F6E: \u306B\u66F8\u3044\u3066\u304F\u3060\u3055\u3044"
|
|
5833
|
+
});
|
|
5834
|
+
}
|
|
5615
5835
|
}
|
|
5616
5836
|
}
|
|
5617
5837
|
}
|
|
@@ -5834,10 +6054,13 @@ function partVisualSize(part, targetW, targetH) {
|
|
|
5834
6054
|
var PARTS_PER_ROW = 3;
|
|
5835
6055
|
var PARTS_GAP = 120;
|
|
5836
6056
|
var STACK_PITCH = 280;
|
|
5837
|
-
function
|
|
6057
|
+
function partsBaseRows(nodes) {
|
|
6058
|
+
return nodes.reduce((acc, n) => acc + Math.max(1, Math.ceil(positiveOr(n.h, 0) / STACK_PITCH)), 0);
|
|
6059
|
+
}
|
|
6060
|
+
function partsGridCenters(baseRows, items) {
|
|
5838
6061
|
const out = /* @__PURE__ */ new Map();
|
|
5839
6062
|
if (items.length === 0) return out;
|
|
5840
|
-
const safeCount = Number.isSafeInteger(
|
|
6063
|
+
const safeCount = Number.isSafeInteger(baseRows) && baseRows >= 0 ? baseRows : 0;
|
|
5841
6064
|
const top = safeCount * STACK_PITCH + PARTS_GAP * 2;
|
|
5842
6065
|
const seen = /* @__PURE__ */ new Set();
|
|
5843
6066
|
const unique = items.filter((i) => {
|
|
@@ -5920,7 +6143,7 @@ function partGridCenters(target, doc, partsCatalog, accepted, acceptedFrom) {
|
|
|
5920
6143
|
extents.set(a.name, partFrameExtent(part, t.w, t.h));
|
|
5921
6144
|
}
|
|
5922
6145
|
const centers = partsGridCenters(
|
|
5923
|
-
baseNodes
|
|
6146
|
+
partsBaseRows(baseNodes),
|
|
5924
6147
|
placedActors.map((a) => ({ id: a.name, ...extents.get(a.name) }))
|
|
5925
6148
|
);
|
|
5926
6149
|
const out = /* @__PURE__ */ new Map();
|
|
@@ -5970,7 +6193,11 @@ function cleanupPlaceholderActor(target, doc, a) {
|
|
|
5970
6193
|
for (const n of target.nodes) {
|
|
5971
6194
|
if (ownedLaneIds.has(n.lane)) ownedNodeIds.add(n.id);
|
|
5972
6195
|
}
|
|
6196
|
+
const \u7D20\u306E\u7BB1\u306Eid = new Set(
|
|
6197
|
+
doc.actors.filter((x) => x.partId === void 0).map((x) => slugify(x.name))
|
|
6198
|
+
);
|
|
5973
6199
|
const matchesAliasSlug = (id) => {
|
|
6200
|
+
if (\u7D20\u306E\u7BB1\u306Eid.has(id)) return false;
|
|
5974
6201
|
if (id === aliasSlug) return true;
|
|
5975
6202
|
if (id.startsWith(`${aliasSlug}-`)) return true;
|
|
5976
6203
|
if (/^s\d+-/.test(id) && id.endsWith(`-${aliasSlug}`)) return true;
|
|
@@ -5984,14 +6211,14 @@ function cleanupPlaceholderActor(target, doc, a) {
|
|
|
5984
6211
|
if (drop) removedEdgeIds.add(e.id);
|
|
5985
6212
|
return !drop;
|
|
5986
6213
|
});
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
}
|
|
6214
|
+
const \u6B8B\u308B\u7BB1\u3092\u6301\u3064 = new Set(target.nodes.map((n) => n.lane));
|
|
6215
|
+
target.lanes = target.lanes.filter((l) => {
|
|
6216
|
+
if (a.lane !== void 0 && l.id === a.lane) return true;
|
|
6217
|
+
if (\u6B8B\u308B\u7BB1\u3092\u6301\u3064.has(l.id)) return true;
|
|
6218
|
+
if (l.label === a.name) return false;
|
|
6219
|
+
if (l.id === aliasSlug) return false;
|
|
6220
|
+
return true;
|
|
6221
|
+
});
|
|
5995
6222
|
for (const phase of target.phases) {
|
|
5996
6223
|
phase.activate = phase.activate.filter((id) => !relatedToActor(id) && !removedEdgeIds.has(id));
|
|
5997
6224
|
}
|
|
@@ -6353,15 +6580,11 @@ function applyEdgeInlineOptions(diagram2, doc, sourceLines) {
|
|
|
6353
6580
|
return;
|
|
6354
6581
|
}
|
|
6355
6582
|
const used = /* @__PURE__ */ new Set();
|
|
6356
|
-
|
|
6357
|
-
doc.flow.forEach((s, stepIdx) => {
|
|
6583
|
+
doc.flow.forEach((s) => {
|
|
6358
6584
|
const fromId = slugify(s.from);
|
|
6359
6585
|
const toId = slugify(s.to);
|
|
6360
6586
|
const target = diagram2.edges.find((e) => {
|
|
6361
6587
|
if (used.has(e.id)) return false;
|
|
6362
|
-
if (isSeqLike) {
|
|
6363
|
-
return (e.from === `s${stepIdx}-${fromId}` || e.from === fromId) && (e.to === `s${stepIdx}-${toId}` || e.from === e.to);
|
|
6364
|
-
}
|
|
6365
6588
|
return e.from === fromId && e.to === toId;
|
|
6366
6589
|
});
|
|
6367
6590
|
if (!target) return;
|
|
@@ -6412,6 +6635,10 @@ function \u77E2\u5370\u3078\u66F8\u304D\u5199\u3059(target, s, doc) {
|
|
|
6412
6635
|
}
|
|
6413
6636
|
}
|
|
6414
6637
|
if (s.side !== void 0) target.side = s.side;
|
|
6638
|
+
if (s.head !== void 0) target.head = s.head;
|
|
6639
|
+
if (s.tailHead !== void 0) target.tailHead = s.tailHead;
|
|
6640
|
+
if (s.headFill !== void 0) target.headFill = s.headFill;
|
|
6641
|
+
if (s.tailHeadFill !== void 0) target.tailHeadFill = s.tailHeadFill;
|
|
6415
6642
|
if (s.labelOffsetX !== void 0) target.labelOffsetX = s.labelOffsetX;
|
|
6416
6643
|
if (s.labelOffsetY !== void 0) target.labelOffsetY = s.labelOffsetY;
|
|
6417
6644
|
if (s.overlay !== void 0) target.overlay = s.overlay;
|
|
@@ -6429,16 +6656,6 @@ function \u9396\u306E\u3069\u306E\u884C\u304B\u3089\u6765\u305F\u304B(doc, edgeI
|
|
|
6429
6656
|
if (to === void 0) return void 0;
|
|
6430
6657
|
return doc.flow.find((s) => s.to === to.name);
|
|
6431
6658
|
}
|
|
6432
|
-
var DRAWABLE_KINDS = new Set(cdl.NODE_KINDS);
|
|
6433
|
-
var KIND_ALIAS = {
|
|
6434
|
-
eoa: "shape-wallet",
|
|
6435
|
-
wallet: "shape-wallet",
|
|
6436
|
-
multisig: "signer",
|
|
6437
|
-
contract: "shape-smart-contract",
|
|
6438
|
-
proxy: "shape-smart-contract",
|
|
6439
|
-
library: "shape-code-block",
|
|
6440
|
-
interface: "shape-code-block"
|
|
6441
|
-
};
|
|
6442
6659
|
function \u5F0F\u306B\u66F8\u304F\u6570(n) {
|
|
6443
6660
|
if (!Number.isFinite(n)) return "0";
|
|
6444
6661
|
const text = String(n);
|
|
@@ -6766,99 +6983,6 @@ var SINGLE_BOX_KINDS = /* @__PURE__ */ new Set([
|
|
|
6766
6983
|
"tree-hierarchy",
|
|
6767
6984
|
"journey-map"
|
|
6768
6985
|
]);
|
|
6769
|
-
function drawableKind(kind) {
|
|
6770
|
-
if (kind === void 0) return void 0;
|
|
6771
|
-
const mapped = KIND_ALIAS[kind] ?? kind;
|
|
6772
|
-
return DRAWABLE_KINDS.has(mapped) ? mapped : void 0;
|
|
6773
|
-
}
|
|
6774
|
-
function alignSeqHeaderHeights(diagram2, doc) {
|
|
6775
|
-
if (doc.type !== "sequence" && doc.type !== "solidity") return;
|
|
6776
|
-
const isEnd = (n) => n.id === `${n.lane}-header` || n.id === `${n.lane}-footer`;
|
|
6777
|
-
const ends = diagram2.nodes.filter(isEnd);
|
|
6778
|
-
if (ends.length === 0) return;
|
|
6779
|
-
const auto = ends.filter((n) => n.posH === void 0);
|
|
6780
|
-
if (auto.length === 0) return;
|
|
6781
|
-
const tallest = Math.max(...auto.map((n) => n.h ?? 0));
|
|
6782
|
-
if (tallest <= 0) return;
|
|
6783
|
-
for (const n of auto) n.h = tallest;
|
|
6784
|
-
}
|
|
6785
|
-
var LABEL_MIN_H = {
|
|
6786
|
-
// `shape-` のうち、 高さを上げれば下のはみ出しが消える 4 種 (#1067)。 値は「収まる最小の高さ」
|
|
6787
|
-
// で、 1 手前 (値 - 1) では 0.9-1 はみ出すことを実測した
|
|
6788
|
-
"shape-person": 228,
|
|
6789
|
-
// 名札 72 で下へ 155.9
|
|
6790
|
-
"shape-server-rack": 166,
|
|
6791
|
-
// 94
|
|
6792
|
-
"shape-website": 98,
|
|
6793
|
-
// 26
|
|
6794
|
-
"shape-warehouse": 79
|
|
6795
|
-
// 7
|
|
6796
|
-
};
|
|
6797
|
-
var LABEL_NEVER_FITS = /* @__PURE__ */ new Set([
|
|
6798
|
-
// 左右にはみ出す 24 種。 横幅は高さで変わらないため直らない
|
|
6799
|
-
"shape-api-gateway",
|
|
6800
|
-
"shape-atm",
|
|
6801
|
-
"shape-auditor",
|
|
6802
|
-
"shape-bank",
|
|
6803
|
-
"shape-bitcoin-chain",
|
|
6804
|
-
"shape-blockchain",
|
|
6805
|
-
"shape-blockchain-block",
|
|
6806
|
-
"shape-blockchain-node",
|
|
6807
|
-
"shape-brokerage",
|
|
6808
|
-
"shape-code-block",
|
|
6809
|
-
"shape-customer-service",
|
|
6810
|
-
"shape-ethereum-chain",
|
|
6811
|
-
"shape-hexagon",
|
|
6812
|
-
"shape-kanban-card",
|
|
6813
|
-
"shape-lawyer",
|
|
6814
|
-
"shape-network-node",
|
|
6815
|
-
"shape-nft",
|
|
6816
|
-
"shape-notary",
|
|
6817
|
-
"shape-regulator",
|
|
6818
|
-
"shape-satellite",
|
|
6819
|
-
"shape-smart-contract",
|
|
6820
|
-
"shape-terminal",
|
|
6821
|
-
"shape-trader",
|
|
6822
|
-
"shape-trust-bank",
|
|
6823
|
-
// 下のはみ出しが高さに依らない 6 種
|
|
6824
|
-
"shape-cylinder",
|
|
6825
|
-
"shape-diamond",
|
|
6826
|
-
"shape-file",
|
|
6827
|
-
"shape-folder",
|
|
6828
|
-
"shape-mobile-device",
|
|
6829
|
-
"shape-stack",
|
|
6830
|
-
// 上へ出る絵が名札の大きさでは読めない。 `#1067` では「上は何ともぶつからない」 として残したが、
|
|
6831
|
-
// 実際には絵が小さく潰れて名前と重なり、 横に並べた時も 1 本だけ頭が浮く (user 実機確認)
|
|
6832
|
-
"shape-wallet"
|
|
6833
|
-
]);
|
|
6834
|
-
function hasAuthoredText(n) {
|
|
6835
|
-
if (n.subtitle !== void 0 || n.eyebrow !== void 0 || n.value !== void 0) return true;
|
|
6836
|
-
return cdl.rendersRows(n.kind) && (n.rows?.length ?? 0) > 0;
|
|
6837
|
-
}
|
|
6838
|
-
function dropUnfittableEndKinds(diagram2, doc) {
|
|
6839
|
-
if (doc.type !== "sequence" && doc.type !== "solidity") return;
|
|
6840
|
-
const ends = /* @__PURE__ */ new Map();
|
|
6841
|
-
for (const n of diagram2.nodes) {
|
|
6842
|
-
if (n.id !== `${n.lane}-header` && n.id !== `${n.lane}-footer`) continue;
|
|
6843
|
-
const pair = ends.get(n.lane);
|
|
6844
|
-
if (pair === void 0) ends.set(n.lane, [n]);
|
|
6845
|
-
else pair.push(n);
|
|
6846
|
-
}
|
|
6847
|
-
for (const pair of ends.values()) {
|
|
6848
|
-
if (pair.some(hasAuthoredText)) continue;
|
|
6849
|
-
const \u53CE\u307E\u3089\u306A\u3044 = pair.some((n) => {
|
|
6850
|
-
if (LABEL_NEVER_FITS.has(n.kind)) return true;
|
|
6851
|
-
const need = LABEL_MIN_H[n.kind];
|
|
6852
|
-
if (need === void 0) return false;
|
|
6853
|
-
const h = (n.posX !== void 0 && n.posY !== void 0 ? n.posH : void 0) ?? n.h;
|
|
6854
|
-
return h !== void 0 && h < need;
|
|
6855
|
-
});
|
|
6856
|
-
if (!\u53CE\u307E\u3089\u306A\u3044) continue;
|
|
6857
|
-
for (const n of pair) {
|
|
6858
|
-
if (LABEL_NEVER_FITS.has(n.kind) || LABEL_MIN_H[n.kind] !== void 0) n.kind = "card";
|
|
6859
|
-
}
|
|
6860
|
-
}
|
|
6861
|
-
}
|
|
6862
6986
|
function applyGroupContainers(diagram2, doc) {
|
|
6863
6987
|
if (!doc.groups || Object.keys(doc.groups).length === 0) return;
|
|
6864
6988
|
for (const [id, g] of Object.entries(doc.groups)) {
|
|
@@ -7026,34 +7150,46 @@ function compileGantt(doc) {
|
|
|
7026
7150
|
return b.build();
|
|
7027
7151
|
}
|
|
7028
7152
|
function compileClass(doc) {
|
|
7029
|
-
const b = cdl.
|
|
7030
|
-
|
|
7031
|
-
const
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
-
|
|
7040
|
-
|
|
7153
|
+
const b = cdl.classDiagram({ id: slugify(doc.title), topic: doc.title });
|
|
7154
|
+
if (doc.actors.length === 0) return cdl.diagram(slugify(doc.title), { topic: doc.title }).build();
|
|
7155
|
+
const \u5217\u756A\u53F7 = /* @__PURE__ */ new Map();
|
|
7156
|
+
for (const a of doc.actors) {
|
|
7157
|
+
if (a.lane === void 0) continue;
|
|
7158
|
+
if (!\u5217\u756A\u53F7.has(a.lane)) \u5217\u756A\u53F7.set(a.lane, \u5217\u756A\u53F7.size);
|
|
7159
|
+
}
|
|
7160
|
+
for (const a of doc.actors) {
|
|
7161
|
+
const rows = (a.rows ?? []).filter((r) => !/^[─-]+$/.test(r.trim()));
|
|
7162
|
+
const \u632F\u308B\u821E\u3044 = (r) => r.includes("(");
|
|
7163
|
+
const attributes = rows.filter((r) => !\u632F\u308B\u821E\u3044(r));
|
|
7164
|
+
const methods = rows.filter(\u632F\u308B\u821E\u3044);
|
|
7165
|
+
b.class({
|
|
7166
|
+
id: slugify(a.name),
|
|
7041
7167
|
title: \u7BB1\u306E\u984C(a),
|
|
7042
|
-
|
|
7168
|
+
...attributes.length > 0 ? { attributes: [...attributes] } : {},
|
|
7169
|
+
...methods.length > 0 ? { methods: [...methods] } : {},
|
|
7170
|
+
...a.eyebrow ? { stereotype: a.eyebrow } : {},
|
|
7171
|
+
...a.lane !== void 0 ? { col: \u5217\u756A\u53F7.get(a.lane) ?? 0 } : {},
|
|
7172
|
+
...a.stack !== void 0 ? { row: a.stack } : {}
|
|
7043
7173
|
});
|
|
7044
|
-
}
|
|
7045
|
-
for (const
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
...
|
|
7052
|
-
...
|
|
7053
|
-
...
|
|
7174
|
+
}
|
|
7175
|
+
for (const s2 of doc.flow) {
|
|
7176
|
+
b.relation({
|
|
7177
|
+
from: slugify(s2.from),
|
|
7178
|
+
to: slugify(s2.to),
|
|
7179
|
+
// 種類を書かない矢印は「使う」 扱い = 端が開いた矢になり、線と印の組が最も素直
|
|
7180
|
+
type: s2.relation ?? "uses",
|
|
7181
|
+
...s2.label ? { label: s2.label } : {},
|
|
7182
|
+
...s2.sub ? { cardinality: s2.sub } : {},
|
|
7183
|
+
...s2.tone ? { tone: s2.tone } : {},
|
|
7184
|
+
...s2.style ? { style: s2.style } : {},
|
|
7185
|
+
...s2.head ? { head: s2.head } : {},
|
|
7186
|
+
...s2.headFill ? { headFill: s2.headFill } : {},
|
|
7187
|
+
...s2.tailHead ? { tailHead: s2.tailHead } : {}
|
|
7054
7188
|
});
|
|
7055
7189
|
}
|
|
7056
|
-
|
|
7190
|
+
const built = b.build();
|
|
7191
|
+
const \u66F8\u3044\u305F\u6BB5\u304C\u3042\u308B = (doc.animate?.phases.length ?? 0) > 0;
|
|
7192
|
+
return \u66F8\u3044\u305F\u6BB5\u304C\u3042\u308B ? { ...built, phases: [] } : built;
|
|
7057
7193
|
}
|
|
7058
7194
|
function parseShareValue(raw) {
|
|
7059
7195
|
if (raw === void 0) return null;
|
|
@@ -7080,10 +7216,13 @@ function \u53C2\u7167\u3059\u308B\u540D\u524D(value) {
|
|
|
7080
7216
|
function compileValueChart(doc, \u578B, kind, onNotice) {
|
|
7081
7217
|
const b = cdl.diagram(slugify(doc.title), { topic: doc.title });
|
|
7082
7218
|
const CHART_W = 640;
|
|
7083
|
-
const
|
|
7219
|
+
const \u4F4E\u3044\u578B = \u578B === "pie" || \u578B === "gauge" || \u578B === "radial" || \u578B === "waffle" || \u578B === "stat";
|
|
7220
|
+
const CHART_H = \u4F4E\u3044\u578B ? 320 : 368;
|
|
7084
7221
|
b.lane("chart", { width: CHART_W + 64 });
|
|
7085
7222
|
const data = [];
|
|
7086
7223
|
const \u8AAD\u3081\u306A\u3044 = [];
|
|
7224
|
+
const \u524D\u304C\u8AAD\u3081\u306A\u3044 = [];
|
|
7225
|
+
let \u524D\u304C\u8AAD\u3081\u306A\u3044\u884C = 0;
|
|
7087
7226
|
const \u672A\u5BA3\u8A00 = [];
|
|
7088
7227
|
let \u672A\u5BA3\u8A00\u884C = 0;
|
|
7089
7228
|
const \u53C2\u7167\u3067\u304D\u308B = \u6570\u306E\u6B04\u304B\u3089\u53C2\u7167\u3067\u304D\u308B\u540D\u524D(doc);
|
|
@@ -7101,9 +7240,29 @@ function compileValueChart(doc, \u578B, kind, onNotice) {
|
|
|
7101
7240
|
\u672A\u5BA3\u8A00.push(a.name);
|
|
7102
7241
|
continue;
|
|
7103
7242
|
}
|
|
7104
|
-
|
|
7243
|
+
const \u524D = a.previous === void 0 ? null : parseChartValue(a.previous);
|
|
7244
|
+
if (a.previous !== void 0 && \u524D === null) {
|
|
7245
|
+
if (\u524D\u304C\u8AAD\u3081\u306A\u3044.length === 0) \u524D\u304C\u8AAD\u3081\u306A\u3044\u884C = a.pos?.line ?? 0;
|
|
7246
|
+
\u524D\u304C\u8AAD\u3081\u306A\u3044.push(a.name);
|
|
7247
|
+
}
|
|
7248
|
+
data.push({
|
|
7249
|
+
label: \u7BB1\u306E\u984C(a),
|
|
7250
|
+
value,
|
|
7251
|
+
...\u524D === null ? {} : { previous: \u524D },
|
|
7252
|
+
...a.tone !== void 0 ? { tone: a.tone } : {}
|
|
7253
|
+
});
|
|
7105
7254
|
}
|
|
7106
|
-
const \u8A9E
|
|
7255
|
+
const \u8A9E\u306E\u8868 = {
|
|
7256
|
+
pie: { \u91CF: "\u5272\u5408", \u56F3: "\u5186", \u4F8B: '"45%"' },
|
|
7257
|
+
bar: { \u91CF: "\u5024", \u56F3: "\u68D2", \u4F8B: '"420"' },
|
|
7258
|
+
line: { \u91CF: "\u5024", \u56F3: "\u6298\u308C\u7DDA", \u4F8B: '"180"' },
|
|
7259
|
+
gauge: { \u91CF: "\u5024", \u56F3: "\u534A\u5186", \u4F8B: '"680"' },
|
|
7260
|
+
radial: { \u91CF: "\u5024", \u56F3: "\u5F27", \u4F8B: '"72"' },
|
|
7261
|
+
stat: { \u91CF: "\u5024", \u56F3: "\u5927\u304D\u306A\u6570\u5B57", \u4F8B: '"1200"' },
|
|
7262
|
+
waffle: { \u91CF: "\u5272\u5408", \u56F3: "100 \u500B\u306E\u5370", \u4F8B: '"45%"' },
|
|
7263
|
+
stacked: { \u91CF: "\u5185\u8A33\u306E\u5024", \u56F3: "\u5E2F", \u4F8B: '"320"' }
|
|
7264
|
+
};
|
|
7265
|
+
const \u8A9E = \u8A9E\u306E\u8868[\u578B];
|
|
7107
7266
|
const \u4F1D\u3048\u308B = (\u7A2E\u985E, \u540D\u524D, message, line = 0) => {
|
|
7108
7267
|
onNotice?.({ kind: \u7A2E\u985E, actor: \u540D\u524D, line, message });
|
|
7109
7268
|
if (typeof console !== "undefined" && console.warn) console.warn(`[dragon] ${message}`);
|
|
@@ -7124,6 +7283,14 @@ function compileValueChart(doc, \u578B, kind, onNotice) {
|
|
|
7124
7283
|
\u672A\u5BA3\u8A00\u884C
|
|
7125
7284
|
);
|
|
7126
7285
|
}
|
|
7286
|
+
if (\u524D\u304C\u8AAD\u3081\u306A\u3044.length > 0) {
|
|
7287
|
+
\u4F1D\u3048\u308B(
|
|
7288
|
+
"chart-value-unreadable",
|
|
7289
|
+
\u524D\u304C\u8AAD\u3081\u306A\u3044[0],
|
|
7290
|
+
`type: ${\u578B} \u3067\u524D\u306E\u6642\u70B9\u306E\u5024\u3092\u8AAD\u3081\u306A\u3044\u9805\u76EE\u304C\u3042\u308A\u307E\u3059 (\u524D\u306E\u5024\u3092\u4F7F\u3044\u307E\u305B\u3093): ${\u524D\u304C\u8AAD\u3081\u306A\u3044.join(", ")}\u3002 \`- \u540D\u524D: { value: ` + \u8A9E.\u4F8B + ", previous: " + \u8A9E.\u4F8B + " }` \u306E\u5F62\u3067\u66F8\u3044\u3066\u304F\u3060\u3055\u3044",
|
|
7291
|
+
\u524D\u304C\u8AAD\u3081\u306A\u3044\u884C
|
|
7292
|
+
);
|
|
7293
|
+
}
|
|
7127
7294
|
if (doc.flow.length > 0) {
|
|
7128
7295
|
\u4F1D\u3048\u308B(
|
|
7129
7296
|
"chart-edge-dropped",
|
|
@@ -7604,9 +7771,50 @@ function compileC4(doc) {
|
|
|
7604
7771
|
}
|
|
7605
7772
|
return b.build();
|
|
7606
7773
|
}
|
|
7774
|
+
var \u984C\u3092\u6301\u305F\u306A\u3044\u7A2E\u985E = /* @__PURE__ */ new Set(["mark-start", "mark-end"]);
|
|
7607
7775
|
function \u7BB1\u306E\u984C(a) {
|
|
7776
|
+
if (a.title === void 0 && a.kind !== void 0 && \u984C\u3092\u6301\u305F\u306A\u3044\u7A2E\u985E.has(a.kind)) return "";
|
|
7608
7777
|
return a.title ?? a.name;
|
|
7609
7778
|
}
|
|
7779
|
+
function \u884C\u3092\u7D44\u307F\u7ACB\u3066\u5668\u304C\u6301\u3064(type) {
|
|
7780
|
+
return type === "class";
|
|
7781
|
+
}
|
|
7782
|
+
function \u884C\u3068\u5370\u3092\u7D44\u3080(type, rows, marks) {
|
|
7783
|
+
const \u5370 = \u884C\u982D\u306E\u5370\u306B\u3059\u308B(type, marks);
|
|
7784
|
+
if (\u5370 === null) return null;
|
|
7785
|
+
if (type !== "er") {
|
|
7786
|
+
return { rows: [...rows], rowMarks: rows.map((_, i) => \u5370[i] ?? null) };
|
|
7787
|
+
}
|
|
7788
|
+
const \u9375 = [];
|
|
7789
|
+
const \u5024 = [];
|
|
7790
|
+
rows.forEach((_, i) => (\u5370[i]?.underline === true ? \u9375 : \u5024).push(i));
|
|
7791
|
+
const \u4E26\u3073 = \u9375.length > 0 && \u5024.length > 0 ? [...\u9375, -1, ...\u5024] : [...\u9375, ...\u5024];
|
|
7792
|
+
return {
|
|
7793
|
+
rows: \u4E26\u3073.map((i) => i < 0 ? "" : rows[i] ?? ""),
|
|
7794
|
+
rowMarks: \u4E26\u3073.map((i) => i < 0 ? null : \u5370[i] ?? null)
|
|
7795
|
+
};
|
|
7796
|
+
}
|
|
7797
|
+
function \u884C\u982D\u306E\u5370\u306B\u3059\u308B(type, marks) {
|
|
7798
|
+
if (type === "er") {
|
|
7799
|
+
return marks.map((m) => {
|
|
7800
|
+
const \u8A9E = m.trim().split(/\s+/).filter(Boolean);
|
|
7801
|
+
return {
|
|
7802
|
+
shape: \u8A9E.includes("fk") ? "chevron" : "square",
|
|
7803
|
+
filled: !\u8A9E.includes("opt"),
|
|
7804
|
+
...\u8A9E.includes("pk") ? { underline: true } : {}
|
|
7805
|
+
};
|
|
7806
|
+
});
|
|
7807
|
+
}
|
|
7808
|
+
if (type === "state") {
|
|
7809
|
+
return marks.map((m) => {
|
|
7810
|
+
const \u8A9E = m.trim();
|
|
7811
|
+
if (\u8A9E === "") return null;
|
|
7812
|
+
const \u8868 = cdl.FSM_ACTION_MARK;
|
|
7813
|
+
return \u8868[\u8A9E] ?? null;
|
|
7814
|
+
});
|
|
7815
|
+
}
|
|
7816
|
+
return null;
|
|
7817
|
+
}
|
|
7610
7818
|
var \u653E\u5C04\u3067\u63CF\u3051\u306A\u3044\u6B04\u306E\u540D\u524D = {
|
|
7611
7819
|
kind: "\u7A2E\u985E",
|
|
7612
7820
|
eyebrow: "\u4E0A\u306E\u5C0F\u898B\u51FA\u3057",
|
|
@@ -7615,10 +7823,12 @@ var \u653E\u5C04\u3067\u63CF\u3051\u306A\u3044\u6B04\u306E\u540D\u524D = {
|
|
|
7615
7823
|
owner: "\u62C5\u5F53 (\u5DE5\u7A0B\u306E\u4E26\u3073\u306E\u6B04)",
|
|
7616
7824
|
end: "\u7D42\u308F\u308B\u6642\u671F (\u5DE5\u7A0B\u306E\u4E26\u3073\u306E\u6B04)",
|
|
7617
7825
|
rows: "\u884C",
|
|
7826
|
+
marks: "\u5370",
|
|
7618
7827
|
lane: "\u67A0\u306E\u6307\u5B9A",
|
|
7619
7828
|
stack: "\u7A4D\u3080\u9806",
|
|
7620
7829
|
initial: "\u59CB\u307E\u308A / \u7D42\u308F\u308A \u306E\u5370",
|
|
7621
7830
|
final: "\u59CB\u307E\u308A / \u7D42\u308F\u308A \u306E\u5370",
|
|
7831
|
+
previous: "\u524D\u306E\u6642\u70B9\u306E\u5024",
|
|
7622
7832
|
colorHex: "\u8272\u756A\u53F7",
|
|
7623
7833
|
stateOverride: "\u72B6\u614B\u306E\u4E0A\u66F8\u304D",
|
|
7624
7834
|
// 位置は「登場人物ごとの箱をどこに置くか」 の指定で、 箱が 1 つの図では置く先が無い
|
|
@@ -7813,75 +8023,35 @@ function reportEmptyDeclaredLanes(diagram2, \u8FFD\u52A0\u3057\u305F\u7E26\u5217
|
|
|
7813
8023
|
}
|
|
7814
8024
|
}
|
|
7815
8025
|
function applyV05Extensions(diagram2, doc, \u8FFD\u52A0\u3057\u305F\u7E26\u5217out) {
|
|
7816
|
-
const isSeqLike = doc.type === "sequence" || doc.type === "solidity";
|
|
7817
8026
|
for (const a of doc.actors) {
|
|
7818
8027
|
const dragonSlug = slugify(a.name);
|
|
7819
|
-
|
|
7820
|
-
if (isSeqLike) {
|
|
7821
|
-
const ownedLaneIds = new Set(
|
|
7822
|
-
diagram2.lanes.filter((l) => l.label === a.name).map((l) => l.id)
|
|
7823
|
-
);
|
|
7824
|
-
primaryNodes = ownedLaneIds.size > 0 ? diagram2.nodes.filter((n) => ownedLaneIds.has(n.lane) && n.id === `${n.lane}-header`) : diagram2.nodes.filter((n) => n.id === `${dragonSlug}-header`);
|
|
7825
|
-
} else {
|
|
7826
|
-
primaryNodes = diagram2.nodes.filter((n) => n.id === dragonSlug);
|
|
7827
|
-
}
|
|
8028
|
+
const primaryNodes = diagram2.nodes.filter((n) => n.id === dragonSlug);
|
|
7828
8029
|
for (const node of primaryNodes) {
|
|
7829
|
-
if (a.title !== void 0)
|
|
7830
|
-
node.title = a.title;
|
|
7831
|
-
if (isSeqLike) {
|
|
7832
|
-
const footer = diagram2.nodes.find((n) => n.id === `${node.lane}-footer`);
|
|
7833
|
-
if (footer) footer.title = a.title;
|
|
7834
|
-
if (a.posW === void 0) {
|
|
7835
|
-
const titleW = Math.max(140, a.title.length * 22 + 52);
|
|
7836
|
-
node.w = titleW;
|
|
7837
|
-
if (footer) footer.w = titleW;
|
|
7838
|
-
}
|
|
7839
|
-
}
|
|
7840
|
-
}
|
|
8030
|
+
if (a.title !== void 0) node.title = a.title;
|
|
7841
8031
|
const \u8AAC\u660E = doc.type === "c4" ? \u6BB5\u3092\u8AAD\u307F\u53D6\u308B(a.subtitle).\u8AAC\u660E : a.subtitle;
|
|
7842
8032
|
if (\u8AAC\u660E !== void 0) node.subtitle = \u8AAC\u660E;
|
|
7843
8033
|
if (a.eyebrow !== void 0) node.eyebrow = a.eyebrow;
|
|
7844
8034
|
if (a.value !== void 0) node.value = a.value;
|
|
7845
|
-
if (a.rows !== void 0) node.rows = a.rows;
|
|
7846
|
-
if (
|
|
7847
|
-
|
|
7848
|
-
if (
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
if (isSeqLike && a.rows !== void 0 && a.rows.length > 0 && cdl.rendersRows(a.kind)) {
|
|
7857
|
-
node.h = Math.max(node.h ?? 0, cdl.requiredRowsHeight(a.kind, a.rows.length) ?? 0);
|
|
7858
|
-
node.w = Math.max(node.w ?? 0, cdl.requiredRowsWidth(a.rows, a.kind));
|
|
7859
|
-
}
|
|
7860
|
-
if (isSeqLike) {
|
|
7861
|
-
if (a.posW !== void 0) node.w = a.posW;
|
|
7862
|
-
if (a.posH !== void 0) node.h = a.posH;
|
|
7863
|
-
const footer = diagram2.nodes.find((n) => n.id === `${node.lane}-footer`);
|
|
7864
|
-
if (footer && a.posW !== void 0) footer.w = a.posW;
|
|
8035
|
+
if (a.rows !== void 0 && !\u884C\u3092\u7D44\u307F\u7ACB\u3066\u5668\u304C\u6301\u3064(doc.type)) node.rows = a.rows;
|
|
8036
|
+
if (a.marks !== void 0 && a.rows !== void 0) {
|
|
8037
|
+
const \u7D44 = \u884C\u3068\u5370\u3092\u7D44\u3080(doc.type, a.rows, a.marks);
|
|
8038
|
+
if (\u7D44 !== null) {
|
|
8039
|
+
node.rows = \u7D44.rows;
|
|
8040
|
+
node.rowMarks = \u7D44.rowMarks;
|
|
8041
|
+
}
|
|
8042
|
+
}
|
|
8043
|
+
if (doc.type === "state" && node.kind === "storage" && node.rowMarks === void 0) {
|
|
8044
|
+
node.rows = a.rows ?? [];
|
|
8045
|
+
node.rowMarks = [];
|
|
7865
8046
|
}
|
|
8047
|
+
if (a.posW !== void 0) node.w = a.posW;
|
|
8048
|
+
if (a.posH !== void 0) node.h = a.posH;
|
|
7866
8049
|
if (a.shape !== void 0) {
|
|
7867
8050
|
const dynamicKind = `dyn-${a.shape.kind}`;
|
|
7868
8051
|
node.kind = dynamicKind;
|
|
7869
8052
|
node.shape = { ...a.shape };
|
|
7870
|
-
if (isSeqLike) {
|
|
7871
|
-
const footer = diagram2.nodes.find((n) => n.id === `${node.lane}-footer`);
|
|
7872
|
-
if (footer) {
|
|
7873
|
-
footer.kind = dynamicKind;
|
|
7874
|
-
footer.shape = { ...a.shape };
|
|
7875
|
-
}
|
|
7876
|
-
}
|
|
7877
|
-
}
|
|
7878
|
-
if (a.visibleIf !== void 0) {
|
|
7879
|
-
node.visibleIf = a.visibleIf;
|
|
7880
|
-
if (isSeqLike) {
|
|
7881
|
-
const footer = diagram2.nodes.find((n) => n.id === `${node.lane}-footer`);
|
|
7882
|
-
if (footer) footer.visibleIf = a.visibleIf;
|
|
7883
|
-
}
|
|
7884
8053
|
}
|
|
8054
|
+
if (a.visibleIf !== void 0) node.visibleIf = a.visibleIf;
|
|
7885
8055
|
if (a.wBind !== void 0) node.wBind = a.wBind;
|
|
7886
8056
|
if (a.hBind !== void 0) node.hBind = a.hBind;
|
|
7887
8057
|
if (a.opacity !== void 0) node.opacity = a.opacity;
|
|
@@ -7889,8 +8059,6 @@ function applyV05Extensions(diagram2, doc, \u8FFD\u52A0\u3057\u305F\u7E26\u5217o
|
|
|
7889
8059
|
if (a.renderOffsetY !== void 0) node.renderOffsetY = a.renderOffsetY;
|
|
7890
8060
|
}
|
|
7891
8061
|
}
|
|
7892
|
-
alignSeqHeaderHeights(diagram2, doc);
|
|
7893
|
-
dropUnfittableEndKinds(diagram2, doc);
|
|
7894
8062
|
if (doc.animate && doc.animate.phases.length > 0 && diagram2.phases.length === 0) {
|
|
7895
8063
|
injectPhasesFallback(diagram2, doc);
|
|
7896
8064
|
}
|
|
@@ -7986,6 +8154,9 @@ function injectPhasesFallback(diagram2, doc) {
|
|
|
7986
8154
|
body: p.body ?? "",
|
|
7987
8155
|
activate: activateIds,
|
|
7988
8156
|
...drawIds.length > 0 ? { draw: drawIds } : {},
|
|
8157
|
+
// 描く速さ (#1441)。 **描く相手が決まった段にだけ載せる** = 語が効かない図種
|
|
8158
|
+
// (`drawIds` が空) で割合だけ渡すと、描画側が「draw が空なのに割合がある」 と知らせる
|
|
8159
|
+
...drawIds.length > 0 && p.drawRatio !== void 0 ? { drawRatio: p.drawRatio } : {},
|
|
7989
8160
|
tweens: (p.tweens ?? []).map((t) => ({ stateId: t.state, from: t.from, to: t.to })),
|
|
7990
8161
|
sets: (p.sets ?? []).map((s) => ({ stateId: s.state, value: s.value })),
|
|
7991
8162
|
...p.badge ? { badge: p.badge } : {}
|
|
@@ -7993,13 +8164,17 @@ function injectPhasesFallback(diagram2, doc) {
|
|
|
7993
8164
|
}
|
|
7994
8165
|
}
|
|
7995
8166
|
function compileSequence(doc) {
|
|
7996
|
-
if (doc.animate && doc.animate.phases.length > 0) {
|
|
7997
|
-
return compileSequenceWithAnimate(doc);
|
|
7998
|
-
}
|
|
7999
8167
|
const seqBuilder = cdl.sequence({
|
|
8000
8168
|
id: slugify(doc.title),
|
|
8001
8169
|
topic: doc.title,
|
|
8002
|
-
|
|
8170
|
+
/*
|
|
8171
|
+
* 見出しに出すのは **書いた題** (#1466)。 名前は矢印の端として指すためのもので、
|
|
8172
|
+
* `title:` を書いたらそちらを出す (`箱の題`)。 板でも他の図種と同じ規約にする。
|
|
8173
|
+
*/
|
|
8174
|
+
actors: doc.actors.map(
|
|
8175
|
+
(a) => a.subtitle ? { name: \u7BB1\u306E\u984C(a), subtitle: a.subtitle } : \u7BB1\u306E\u984C(a)
|
|
8176
|
+
),
|
|
8177
|
+
...doc.bands && doc.bands.length > 0 ? { bands: doc.bands } : {}
|
|
8003
8178
|
});
|
|
8004
8179
|
for (const s of doc.flow) {
|
|
8005
8180
|
seqBuilder.step({
|
|
@@ -8009,140 +8184,43 @@ function compileSequence(doc) {
|
|
|
8009
8184
|
...s.sub ? { sub: s.sub } : {},
|
|
8010
8185
|
...s.side ? { side: s.side } : {},
|
|
8011
8186
|
...s.tone ? { tone: s.tone } : {},
|
|
8012
|
-
...s.style ? { style: s.style } : {}
|
|
8187
|
+
...s.style ? { style: s.style } : {},
|
|
8188
|
+
...s.msgKind ? { kind: s.msgKind } : {}
|
|
8013
8189
|
});
|
|
8014
8190
|
}
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
const
|
|
8019
|
-
|
|
8020
|
-
const
|
|
8021
|
-
|
|
8022
|
-
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
|
|
8026
|
-
|
|
8027
|
-
|
|
8028
|
-
|
|
8029
|
-
|
|
8030
|
-
|
|
8031
|
-
|
|
8032
|
-
|
|
8033
|
-
const headerId = `${id}-header`;
|
|
8034
|
-
const actorW = Math.max(140, \u7BB1\u306E\u984C(a).length * 22 + 52);
|
|
8035
|
-
b.node(headerId, { lane: id, stack: 0, kind: "card", title: \u7BB1\u306E\u984C(a), w: actorW, h: 72 });
|
|
8036
|
-
const spacerId = `${id}-spacer`;
|
|
8037
|
-
b.node(spacerId, { lane: id, stack: 1, kind: "card", title: "", w: 2, h: 40 });
|
|
8038
|
-
});
|
|
8039
|
-
doc.flow.forEach((s, idx) => {
|
|
8040
|
-
const fromLaneId = actorIds.get(s.from);
|
|
8041
|
-
const toLaneId = actorIds.get(s.to);
|
|
8042
|
-
if (fromLaneId === void 0 || toLaneId === void 0) return;
|
|
8043
|
-
const stack = idx + 2;
|
|
8044
|
-
const fromBoxId = `s${idx}-${fromLaneId}`;
|
|
8045
|
-
const toBoxId = `s${idx}-${toLaneId}`;
|
|
8046
|
-
b.node(fromBoxId, { lane: fromLaneId, stack, kind: "card", title: "", w: 2, h: 2 });
|
|
8047
|
-
if (fromLaneId !== toLaneId) {
|
|
8048
|
-
b.node(toBoxId, { lane: toLaneId, stack, kind: "card", title: "", w: 2, h: 2 });
|
|
8049
|
-
}
|
|
8050
|
-
const edgeId = `e${idx}-${fromLaneId}-${toLaneId}`;
|
|
8051
|
-
b.edge(fromBoxId, fromLaneId === toLaneId ? fromBoxId : toBoxId, {
|
|
8052
|
-
id: edgeId,
|
|
8053
|
-
label: s.label,
|
|
8054
|
-
...s.sub ? { sub: s.sub } : {},
|
|
8055
|
-
...s.side ? { side: s.side } : {},
|
|
8056
|
-
...s.tone ? { tone: s.tone } : {},
|
|
8057
|
-
...s.style ? { style: s.style } : {}
|
|
8058
|
-
});
|
|
8059
|
-
});
|
|
8060
|
-
const footerStack = doc.flow.length + 2;
|
|
8061
|
-
doc.actors.forEach((a) => {
|
|
8062
|
-
const laneId = actorIds.get(a.name) ?? slugify(a.name);
|
|
8063
|
-
const footerId = `${laneId}-footer`;
|
|
8064
|
-
const actorW = Math.max(140, \u7BB1\u306E\u984C(a).length * 22 + 52);
|
|
8065
|
-
b.node(footerId, {
|
|
8066
|
-
lane: laneId,
|
|
8067
|
-
stack: footerStack,
|
|
8068
|
-
kind: "card",
|
|
8069
|
-
title: \u7BB1\u306E\u984C(a),
|
|
8070
|
-
w: actorW,
|
|
8071
|
-
h: 72,
|
|
8072
|
-
role: "lifeline-footer"
|
|
8073
|
-
});
|
|
8074
|
-
});
|
|
8075
|
-
for (const st of doc.animate?.states ?? []) {
|
|
8076
|
-
b.state(st.name, { initial: st.initial });
|
|
8077
|
-
}
|
|
8078
|
-
for (const p of doc.animate?.phases ?? []) {
|
|
8079
|
-
b.phase(
|
|
8080
|
-
slugify(p.name),
|
|
8081
|
-
{
|
|
8191
|
+
const built = seqBuilder.build();
|
|
8192
|
+
const \u6BB5 = doc.animate?.phases ?? [];
|
|
8193
|
+
if (\u6BB5.length === 0) return built;
|
|
8194
|
+
const \u756A\u53F7 = /* @__PURE__ */ new Map();
|
|
8195
|
+
doc.flow.forEach((f, i) => \u756A\u53F7.set(`${slugify(f.from)} -> ${slugify(f.to)}`, i));
|
|
8196
|
+
const \u72B6\u614B\u540D = cdl.sequenceStepId();
|
|
8197
|
+
return {
|
|
8198
|
+
...built,
|
|
8199
|
+
states: [...built.states, { id: \u72B6\u614B\u540D, initial: "0" }],
|
|
8200
|
+
phases: \u6BB5.map((p, i) => {
|
|
8201
|
+
const \u756A = Math.max(
|
|
8202
|
+
0,
|
|
8203
|
+
...(p.highlight ?? []).map(
|
|
8204
|
+
(f) => \u756A\u53F7.get(f.split("->").map((x) => slugify(x.trim())).join(" -> ")) ?? -1
|
|
8205
|
+
)
|
|
8206
|
+
);
|
|
8207
|
+
return {
|
|
8208
|
+
id: `p${i}`,
|
|
8082
8209
|
duration: p.durationMs,
|
|
8083
8210
|
title: p.name,
|
|
8084
|
-
body: p.body ?? ""
|
|
8085
|
-
|
|
8086
|
-
|
|
8087
|
-
|
|
8088
|
-
|
|
8089
|
-
|
|
8090
|
-
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
}
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8097
|
-
if (p.badge) {
|
|
8098
|
-
pb.badge(p.badge);
|
|
8099
|
-
}
|
|
8100
|
-
return pb;
|
|
8101
|
-
}
|
|
8102
|
-
);
|
|
8103
|
-
}
|
|
8104
|
-
return b.build();
|
|
8105
|
-
}
|
|
8106
|
-
function resolveHighlight(phase, doc, actorIds, _stepEdgeIds) {
|
|
8107
|
-
const out = [];
|
|
8108
|
-
const knownNames = new Set(actorIds.keys());
|
|
8109
|
-
for (const raw of phase.highlight ?? []) {
|
|
8110
|
-
const entry = parseFocusEntry(raw, knownNames);
|
|
8111
|
-
if (entry.kind === "edge") {
|
|
8112
|
-
const fromLaneId = actorIds.get(entry.from) ?? slugify(entry.from);
|
|
8113
|
-
const toLaneId = actorIds.get(entry.to) ?? slugify(entry.to);
|
|
8114
|
-
doc.flow.forEach((s, idx) => {
|
|
8115
|
-
const sFromId = actorIds.get(s.from) ?? slugify(s.from);
|
|
8116
|
-
const sToId = actorIds.get(s.to) ?? slugify(s.to);
|
|
8117
|
-
if (sFromId === fromLaneId && sToId === toLaneId) {
|
|
8118
|
-
out.push(`e${idx}-${fromLaneId}-${toLaneId}`);
|
|
8119
|
-
}
|
|
8120
|
-
});
|
|
8121
|
-
const stackIdx = doc.flow.findIndex((s) => {
|
|
8122
|
-
const sFromId = actorIds.get(s.from) ?? slugify(s.from);
|
|
8123
|
-
const sToId = actorIds.get(s.to) ?? slugify(s.to);
|
|
8124
|
-
return sFromId === fromLaneId && sToId === toLaneId;
|
|
8125
|
-
});
|
|
8126
|
-
if (stackIdx >= 0) {
|
|
8127
|
-
out.push(`s${stackIdx}-${fromLaneId}`);
|
|
8128
|
-
if (fromLaneId !== toLaneId) out.push(`s${stackIdx}-${toLaneId}`);
|
|
8129
|
-
}
|
|
8130
|
-
continue;
|
|
8131
|
-
}
|
|
8132
|
-
const laneId = actorIds.get(entry.name) ?? slugLookup(actorIds, entry.name);
|
|
8133
|
-
if (laneId) {
|
|
8134
|
-
out.push(`${laneId}-header`);
|
|
8135
|
-
out.push(`${laneId}-footer`);
|
|
8136
|
-
doc.flow.forEach((s, idx) => {
|
|
8137
|
-
const sFromId = actorIds.get(s.from) ?? slugify(s.from);
|
|
8138
|
-
const sToId = actorIds.get(s.to) ?? slugify(s.to);
|
|
8139
|
-
if (sFromId === laneId || sToId === laneId) {
|
|
8140
|
-
out.push(`s${idx}-${laneId}`);
|
|
8141
|
-
}
|
|
8142
|
-
});
|
|
8143
|
-
}
|
|
8144
|
-
}
|
|
8145
|
-
return out;
|
|
8211
|
+
body: p.body ?? "",
|
|
8212
|
+
activate: [slugify(doc.title)],
|
|
8213
|
+
...p.badge ? { badge: p.badge } : {},
|
|
8214
|
+
/*
|
|
8215
|
+
* **書いた状態の動きも一緒に運ぶ** (#1466)。 板の段は「今どの言づてか」 を状態に
|
|
8216
|
+
* 書くが、記法は同じ段に `遷移:` / `切替:` も書ける。 板の分だけを載せると、
|
|
8217
|
+
* 書いた動きが黙って落ちる (実測で `tweens` が 0 件になっていた)。
|
|
8218
|
+
*/
|
|
8219
|
+
sets: [...(p.sets ?? []).map((x) => ({ stateId: x.state, value: x.value })), { stateId: \u72B6\u614B\u540D, value: \u756A }],
|
|
8220
|
+
tweens: (p.tweens ?? []).map((t) => ({ stateId: t.state, from: t.from, to: t.to }))
|
|
8221
|
+
};
|
|
8222
|
+
})
|
|
8223
|
+
};
|
|
8146
8224
|
}
|
|
8147
8225
|
function slugLookup(byName, wanted) {
|
|
8148
8226
|
let hit;
|
|
@@ -8265,8 +8343,14 @@ function \u59CB\u307E\u308A\u3068\u7D42\u308F\u308A\u306E\u6C7A\u3081\u65B9(doc)
|
|
|
8265
8343
|
\u7D42\u308F\u308A: (a, idx) => \u66F8\u3044\u305F\u7D42\u308F\u308A ? a.final === true : idx === doc.actors.length - 1 && doc.actors.length > 1
|
|
8266
8344
|
};
|
|
8267
8345
|
}
|
|
8346
|
+
var \u72B6\u614B\u306E\u56F3\u306E\u65E2\u5B9A\u306E\u7A2E\u985E = "card";
|
|
8347
|
+
function \u65E2\u5B9A\u3068\u9055\u3046\u7A2E\u985E\u3092\u66F8\u3044\u305F(doc) {
|
|
8348
|
+
return doc.actors.some(
|
|
8349
|
+
(a) => a.kindWritten === true && \u63CF\u3051\u308B\u7A2E\u5225(a.kind) !== \u72B6\u614B\u306E\u56F3\u306E\u65E2\u5B9A\u306E\u7A2E\u985E
|
|
8350
|
+
);
|
|
8351
|
+
}
|
|
8268
8352
|
function compileState(doc) {
|
|
8269
|
-
if (doc.animate && doc.animate.phases.length > 0) {
|
|
8353
|
+
if (doc.animate && doc.animate.phases.length > 0 || \u65E2\u5B9A\u3068\u9055\u3046\u7A2E\u985E\u3092\u66F8\u3044\u305F(doc)) {
|
|
8270
8354
|
return compileGenericWithAnimate(doc, { kind: "state", laneWidth: 360 });
|
|
8271
8355
|
}
|
|
8272
8356
|
const fsm = cdl.stateMachine({
|
|
@@ -8334,7 +8418,13 @@ function \u5F8C\u308D\u3078\u623B\u308B\u77E2\u5370\u304B(kind, fromId, toId, \u
|
|
|
8334
8418
|
if (\u5143 === void 0 || \u5148 === void 0) return false;
|
|
8335
8419
|
return \u5148 < \u5143;
|
|
8336
8420
|
}
|
|
8337
|
-
var \u7E26\u5217\u3092\u9078\u3079\u308B\u56F3\u7A2E = /* @__PURE__ */ new Set([
|
|
8421
|
+
var \u7E26\u5217\u3092\u9078\u3079\u308B\u56F3\u7A2E = /* @__PURE__ */ new Set([
|
|
8422
|
+
"flow",
|
|
8423
|
+
"topology",
|
|
8424
|
+
"swimlane",
|
|
8425
|
+
"class",
|
|
8426
|
+
"state"
|
|
8427
|
+
]);
|
|
8338
8428
|
function \u66F8\u3044\u305F\u7E26\u5217\u306B\u7F6E\u304F(kind, doc) {
|
|
8339
8429
|
if (!\u7E26\u5217\u3092\u9078\u3079\u308B\u56F3\u7A2E.has(kind)) return false;
|
|
8340
8430
|
const \u5BFE\u8C61 = doc.actors.filter((a) => a.partId === void 0);
|
|
@@ -8962,7 +9052,7 @@ function writeVerticalForm(seg, headIdx, lineCount, headIndent, x, y) {
|
|
|
8962
9052
|
else seg.splice(insertAt * 2, 0, newLine, sep);
|
|
8963
9053
|
return seg.join("");
|
|
8964
9054
|
}
|
|
8965
|
-
var \u7DDA\u7A2E =
|
|
9055
|
+
var \u7DDA\u7A2E = cdl.EDGE_STYLES;
|
|
8966
9056
|
var \u8272\u540D\u306E\u8868 = new Map([
|
|
8967
9057
|
...cdl.TONES.map((t) => [t.toLowerCase(), t]),
|
|
8968
9058
|
...Object.entries(TONE_ALIAS).map(([k, v]) => [k.toLowerCase(), v])
|
|
@@ -9129,7 +9219,11 @@ var ACCEPTED_KEYS = {
|
|
|
9129
9219
|
"formulas",
|
|
9130
9220
|
// 押下などの出来事で動く仕掛けと、巻き上げに応じて進む値 (#1393)
|
|
9131
9221
|
"events",
|
|
9132
|
-
"scrolls"
|
|
9222
|
+
"scrolls",
|
|
9223
|
+
// 順序図で面が動いている間の帯 (#1466)
|
|
9224
|
+
"bands",
|
|
9225
|
+
// 矢印をいつ出すか (#1470)
|
|
9226
|
+
"reveal"
|
|
9133
9227
|
],
|
|
9134
9228
|
actor: [
|
|
9135
9229
|
"name",
|
|
@@ -9137,6 +9231,8 @@ var ACCEPTED_KEYS = {
|
|
|
9137
9231
|
"subtitle",
|
|
9138
9232
|
"eyebrow",
|
|
9139
9233
|
"value",
|
|
9234
|
+
// 前の時点の値 (#1450)。 内訳の変化を帯で示す図と、値 1 つを大きく示す図が読む
|
|
9235
|
+
"previous",
|
|
9140
9236
|
"rows",
|
|
9141
9237
|
"lane",
|
|
9142
9238
|
"stack",
|
|
@@ -9167,7 +9263,9 @@ var ACCEPTED_KEYS = {
|
|
|
9167
9263
|
"hBind",
|
|
9168
9264
|
"opacity",
|
|
9169
9265
|
"renderOffsetX",
|
|
9170
|
-
"renderOffsetY"
|
|
9266
|
+
"renderOffsetY",
|
|
9267
|
+
// 行頭の印 (#1466)。 行ごとに 1 つ、図の種類ごとの語で書く
|
|
9268
|
+
"marks"
|
|
9171
9269
|
],
|
|
9172
9270
|
step: [
|
|
9173
9271
|
"from",
|
|
@@ -9176,6 +9274,14 @@ var ACCEPTED_KEYS = {
|
|
|
9176
9274
|
"sub",
|
|
9177
9275
|
// 矢印がどの辺から出るか (#1385)
|
|
9178
9276
|
"side",
|
|
9277
|
+
// 矢印の先の形 (#1462)
|
|
9278
|
+
"head",
|
|
9279
|
+
// 端の印の残り 3 欄と、関係の語 / 言づての種類 (#1466)
|
|
9280
|
+
"tailHead",
|
|
9281
|
+
"headFill",
|
|
9282
|
+
"tailHeadFill",
|
|
9283
|
+
"relation",
|
|
9284
|
+
"kind",
|
|
9179
9285
|
"tone",
|
|
9180
9286
|
"style",
|
|
9181
9287
|
"guard",
|
|
@@ -9189,7 +9295,7 @@ var ACCEPTED_KEYS = {
|
|
|
9189
9295
|
"overlay",
|
|
9190
9296
|
"pos"
|
|
9191
9297
|
],
|
|
9192
|
-
phase: ["step", "duration", "focus", "body", "badge", "tween", "set", "draw"],
|
|
9298
|
+
phase: ["step", "duration", "focus", "body", "badge", "tween", "set", "draw", "drawRatio"],
|
|
9193
9299
|
viewport: ["width", "height", "scale", "laneWidth", "gap", "laneGap", "nodeGap", "labelMargin"],
|
|
9194
9300
|
lane: ["x", "width", "label", "contain", "lifeline", "pos"],
|
|
9195
9301
|
group: ["label", "lanes"],
|
|
@@ -9221,7 +9327,11 @@ var \u6B04\u306E\u578B\u8868 = {
|
|
|
9221
9327
|
formulas: "object",
|
|
9222
9328
|
// 押下と巻き上げ (#1393)。 中身は下の検査が 1 件ずつ見る
|
|
9223
9329
|
events: "\u4E26\u3073",
|
|
9224
|
-
scrolls: "object"
|
|
9330
|
+
scrolls: "object",
|
|
9331
|
+
// 順序図で面が動いている間の帯 (#1466)
|
|
9332
|
+
bands: "\u4E26\u3073",
|
|
9333
|
+
// 矢印をいつ出すか (#1470)
|
|
9334
|
+
reveal: "\u975E\u7A7A\u306E\u6587\u5B57\u5217"
|
|
9225
9335
|
},
|
|
9226
9336
|
actor: {
|
|
9227
9337
|
name: "\u5FC5\u9808\u306E\u975E\u7A7A\u6587\u5B57\u5217",
|
|
@@ -9229,6 +9339,7 @@ var \u6B04\u306E\u578B\u8868 = {
|
|
|
9229
9339
|
subtitle: "\u6587\u5B57\u5217",
|
|
9230
9340
|
eyebrow: "\u6587\u5B57\u5217",
|
|
9231
9341
|
value: "\u6587\u5B57\u5217",
|
|
9342
|
+
previous: "\u6587\u5B57\u5217",
|
|
9232
9343
|
rows: "\u6587\u5B57\u5217\u306E\u4E26\u3073",
|
|
9233
9344
|
lane: "\u6587\u5B57\u5217",
|
|
9234
9345
|
stack: "\u6570",
|
|
@@ -9259,7 +9370,9 @@ var \u6B04\u306E\u578B\u8868 = {
|
|
|
9259
9370
|
hBind: "\u975E\u7A7A\u306E\u6587\u5B57\u5217",
|
|
9260
9371
|
opacity: "\u6570\u304B\u6587\u5B57\u5217",
|
|
9261
9372
|
renderOffsetX: "\u6570\u304B\u6587\u5B57\u5217",
|
|
9262
|
-
renderOffsetY: "\u6570\u304B\u6587\u5B57\u5217"
|
|
9373
|
+
renderOffsetY: "\u6570\u304B\u6587\u5B57\u5217",
|
|
9374
|
+
// 行頭の印 (#1466)
|
|
9375
|
+
marks: "\u6587\u5B57\u5217\u306E\u4E26\u3073"
|
|
9263
9376
|
},
|
|
9264
9377
|
step: {
|
|
9265
9378
|
from: "\u5FC5\u9808\u306E\u6587\u5B57\u5217",
|
|
@@ -9268,6 +9381,13 @@ var \u6B04\u306E\u578B\u8868 = {
|
|
|
9268
9381
|
sub: "\u6587\u5B57\u5217",
|
|
9269
9382
|
// 矢印がどの辺から出るか (#1385)
|
|
9270
9383
|
side: "\u8FBA",
|
|
9384
|
+
head: "\u7AEF\u306E\u5F62",
|
|
9385
|
+
// 端の印の残り 3 欄と、関係の語 / 言づての種類 (#1466)
|
|
9386
|
+
tailHead: "\u7AEF\u306E\u5F62",
|
|
9387
|
+
headFill: "\u975E\u7A7A\u306E\u6587\u5B57\u5217",
|
|
9388
|
+
tailHeadFill: "\u975E\u7A7A\u306E\u6587\u5B57\u5217",
|
|
9389
|
+
relation: "\u975E\u7A7A\u306E\u6587\u5B57\u5217",
|
|
9390
|
+
kind: "\u975E\u7A7A\u306E\u6587\u5B57\u5217",
|
|
9271
9391
|
tone: "\u8272",
|
|
9272
9392
|
style: "\u7DDA\u7A2E",
|
|
9273
9393
|
guard: "\u6587\u5B57\u5217",
|
|
@@ -9289,7 +9409,8 @@ var \u6B04\u306E\u578B\u8868 = {
|
|
|
9289
9409
|
badge: "\u6587\u5B57\u5217",
|
|
9290
9410
|
tween: "object",
|
|
9291
9411
|
set: "object",
|
|
9292
|
-
draw: "\u63CF\u304F\u3082\u306E"
|
|
9412
|
+
draw: "\u63CF\u304F\u3082\u306E",
|
|
9413
|
+
drawRatio: "\u6570"
|
|
9293
9414
|
},
|
|
9294
9415
|
viewport: {
|
|
9295
9416
|
width: "\u6570",
|
|
@@ -9448,6 +9569,16 @@ function \u5024\u3092\u691C\u67FB(v, \u578B, path, \u540D\u524D, errors) {
|
|
|
9448
9569
|
});
|
|
9449
9570
|
}
|
|
9450
9571
|
return;
|
|
9572
|
+
case "\u7AEF\u306E\u5F62":
|
|
9573
|
+
if (v === void 0) return;
|
|
9574
|
+
if (typeof v !== "string" || !EDGE_HEAD_VALUES.includes(v)) {
|
|
9575
|
+
errors.push({
|
|
9576
|
+
path,
|
|
9577
|
+
message: `${\u540D\u524D} must be one of: ${EDGE_HEAD_VALUES.join(", ")}`,
|
|
9578
|
+
hint: typeof v === "string" ? `got "${v}"` : `got ${typeof v}`
|
|
9579
|
+
});
|
|
9580
|
+
}
|
|
9581
|
+
return;
|
|
9451
9582
|
case "\u63CF\u304F\u3082\u306E":
|
|
9452
9583
|
if (v === void 0) return;
|
|
9453
9584
|
if (typeof v !== "string" || !DRAW_WORDS.has(v)) {
|
|
@@ -9632,6 +9763,33 @@ function \u8868\u3067\u4E2D\u8EAB\u3092\u691C\u67FB\u3059\u308B(o, \u8868, path,
|
|
|
9632
9763
|
}
|
|
9633
9764
|
}
|
|
9634
9765
|
}
|
|
9766
|
+
function validateBands(v, errors) {
|
|
9767
|
+
if (v === void 0) return;
|
|
9768
|
+
if (!Array.isArray(v)) {
|
|
9769
|
+
errors.push({
|
|
9770
|
+
path: "$.bands",
|
|
9771
|
+
message: "bands must be an array of band objects",
|
|
9772
|
+
hint: `got ${v === null ? "null" : typeof v}`
|
|
9773
|
+
});
|
|
9774
|
+
return;
|
|
9775
|
+
}
|
|
9776
|
+
v.forEach((b, i) => {
|
|
9777
|
+
const path = `$.bands[${i}]`;
|
|
9778
|
+
if (typeof b !== "object" || b === null || Array.isArray(b)) {
|
|
9779
|
+
errors.push({ path, message: "band must be an object", hint: "{ actor, from, to } \u306E\u5F62\u3067\u66F8\u304F" });
|
|
9780
|
+
return;
|
|
9781
|
+
}
|
|
9782
|
+
const o = b;
|
|
9783
|
+
if (typeof o.actor !== "string" || o.actor === "") {
|
|
9784
|
+
errors.push({ path: `${path}.actor`, message: "band.actor must be a non-empty string" });
|
|
9785
|
+
}
|
|
9786
|
+
for (const k of ["from", "to"]) {
|
|
9787
|
+
if (typeof o[k] !== "number" || !Number.isInteger(o[k]) || o[k] < 0) {
|
|
9788
|
+
errors.push({ path: `${path}.${k}`, message: `band.${k} must be a non-negative integer` });
|
|
9789
|
+
}
|
|
9790
|
+
}
|
|
9791
|
+
});
|
|
9792
|
+
}
|
|
9635
9793
|
function validateReadouts(v, errors) {
|
|
9636
9794
|
if (v === void 0) return;
|
|
9637
9795
|
if (!Array.isArray(v)) {
|
|
@@ -10096,6 +10254,7 @@ function validateJson(json) {
|
|
|
10096
10254
|
const j = \u5199\u3057.value;
|
|
10097
10255
|
checkUnknownKeys(j, "root", "$", errors);
|
|
10098
10256
|
validateReadouts(j.readouts, errors);
|
|
10257
|
+
validateBands(j.bands, errors);
|
|
10099
10258
|
validateInputs(j.inputs, errors);
|
|
10100
10259
|
validateFormulas(j.formulas, j.inputs, errors);
|
|
10101
10260
|
validateEvents(j.events, errors);
|
|
@@ -10327,7 +10486,10 @@ function jsonToDoc(json) {
|
|
|
10327
10486
|
subtitle: a.subtitle,
|
|
10328
10487
|
eyebrow: a.eyebrow,
|
|
10329
10488
|
value: a.value,
|
|
10489
|
+
previous: a.previous,
|
|
10330
10490
|
rows: a.rows,
|
|
10491
|
+
// 行頭の印 (#1466)。 行と対で読む
|
|
10492
|
+
marks: a.marks,
|
|
10331
10493
|
lane: a.lane,
|
|
10332
10494
|
stack: a.stack,
|
|
10333
10495
|
initial: a.initial,
|
|
@@ -10383,6 +10545,14 @@ function jsonToDoc(json) {
|
|
|
10383
10545
|
label: s.label,
|
|
10384
10546
|
sub: s.sub,
|
|
10385
10547
|
side: s.side,
|
|
10548
|
+
// 矢印の先の形 (#1462)。 読めない語は組み立てが落とす
|
|
10549
|
+
head: s.head,
|
|
10550
|
+
// 端の印の残り 3 欄と、関係の語 / 言づての種類 (#1466)
|
|
10551
|
+
tailHead: s.tailHead,
|
|
10552
|
+
headFill: s.headFill,
|
|
10553
|
+
tailHeadFill: s.tailHeadFill,
|
|
10554
|
+
relation: s.relation,
|
|
10555
|
+
msgKind: s.kind,
|
|
10386
10556
|
// 箱と同じ読み替えを通す (#1304)。 通さないと `tone: "成功"` が色名として解決されないまま
|
|
10387
10557
|
// 図に届き、同じ値が箱では色になり矢印では色にならない
|
|
10388
10558
|
tone: resolveTone(s.tone),
|
|
@@ -10427,6 +10597,9 @@ function jsonToDoc(json) {
|
|
|
10427
10597
|
badge: p.badge,
|
|
10428
10598
|
// 書いた段だけが欄を持つ。 空文字を置くと「書いた」 と「書いていない」 が同じ形になる
|
|
10429
10599
|
...p.draw !== void 0 ? { draw: p.draw, drawPos: p0 } : {},
|
|
10600
|
+
// 割合は `draw` がある段にだけ写す。 単独で書いても描く相手が決まらず何も起きないので、
|
|
10601
|
+
// 記法側 (同じ行に書かせる形) と同じ状態に揃える
|
|
10602
|
+
...p.draw !== void 0 && p.drawRatio !== void 0 ? { drawRatio: p.drawRatio } : {},
|
|
10430
10603
|
// 段の中で動かす分 (#1186)。 記法側の `tweens` / `sets` と同じ形に写す。
|
|
10431
10604
|
// 空の配列を置かないのは、記法側が「無ければ field ごと持たない」 形だから
|
|
10432
10605
|
...p.tween && Object.keys(p.tween).length > 0 ? {
|
|
@@ -10475,6 +10648,10 @@ function jsonToDoc(json) {
|
|
|
10475
10648
|
formulas,
|
|
10476
10649
|
events,
|
|
10477
10650
|
scrolls,
|
|
10651
|
+
// 順序図で面が動いている間の帯 (#1466)
|
|
10652
|
+
bands: json.bands,
|
|
10653
|
+
// 矢印をいつ出すか (#1470)
|
|
10654
|
+
reveal: json.reveal,
|
|
10478
10655
|
pos: p0
|
|
10479
10656
|
};
|
|
10480
10657
|
}
|
|
@@ -10522,6 +10699,11 @@ var diagram_default = {
|
|
|
10522
10699
|
"pie",
|
|
10523
10700
|
"bar",
|
|
10524
10701
|
"line",
|
|
10702
|
+
"gauge",
|
|
10703
|
+
"radial",
|
|
10704
|
+
"stat",
|
|
10705
|
+
"waffle",
|
|
10706
|
+
"stacked",
|
|
10525
10707
|
"funnel",
|
|
10526
10708
|
"tree",
|
|
10527
10709
|
"journey",
|
|
@@ -10529,11 +10711,11 @@ var diagram_default = {
|
|
|
10529
10711
|
"c4",
|
|
10530
10712
|
"mind"
|
|
10531
10713
|
],
|
|
10532
|
-
description: '\u56F3\u306E\u7A2E\u985E\u3002 \u578B\u3054\u3068\u306B actors \u306E\u66F8\u304D\u65B9\u304C\u9055\u3046\u3002 [\u95A2\u4FC2\u3092\u63CF\u304F] sequence (\u6642\u7CFB\u5217\u306E\u547C\u3073\u51FA\u3057) / flow (\u51E6\u7406\u306E\u6D41\u308C) / swimlane (\u8CAC\u52D9\u3054\u3068\u306E\u6D41\u308C) / er (DB \u306E schema) / state (\u72B6\u614B\u306E\u9077\u79FB) / topology (network) / solidity (contract) / class (UML \u306E class) / c4 (architecture) / mind (\u767A\u60F3\u306E\u679D\u5206\u304B\u308C) \u306F actors \u306B\u540D\u524D\u3092\u4E26\u3079 flow \u306B\u77E2\u5370\u3092\u66F8\u304F\u3002 [\u5024\u3092\u63CF\u304F] pie (\u5272\u5408) / bar (\u68D2\u306E\u9AD8\u3055) / line (\u7DDA\u306E\u9AD8\u3055\u3001 \u66F8\u3044\u305F\u9806\u306B\u4E26\u3076) \u306F actors \u306B `- \u540D\u524D: "45"` \u306E\u5F62\u3067\u6570\u3092\u66F8\u304F\u3002 funnel (\u6BB5\u3054\u3068\u306B\u6E1B\u308B\u6570) \u3082\u540C\u3058\u5F62\u3002 [\u8A9E\u3092\u63CF\u304F] journey (\u4F53\u9A13\u306E\u8D77\u4F0F) \u306F `- \u767B\u9332: "\u4E0D\u6E80"` \u306E\u5F62\u3067 \u6700\u9AD8 / \u6E80\u8DB3 / \u666E\u901A / \u4E0D\u6E80 / \u6012\u308A \u306E\u3069\u308C\u304B\u3092\u66F8\u304F\u3002 quadrant (2 \u8EF8\u306E\u4ED5\u5206\u3051) \u306F `- \u91CD\u8907\u524A\u9664: "\u5DE6\u4E0A"` \u306E\u5F62\u3067 \u5DE6\u4E0A / \u53F3\u4E0A / \u5DE6\u4E0B / \u53F3\u4E0B \u306E\u3069\u308C\u304B\u3092\u66F8\u304F\u3002 [\u6642\u671F\u3092\u63CF\u304F] gantt (\u5DE5\u7A0B\u306E\u4E26\u3073) \u306F `- \u8A2D\u8A08: "1\u6708"` \u306E\u5F62\u3067\u59CB\u307E\u308A\u306E\u6642\u671F\u3092\u66F8\u304D\u3001 flow \u306E\u77E2\u5370\u3067\u524D\u5F8C\u95A2\u4FC2\u3092\u66F8\u304F\u3002 [\u89AA\u5B50\u3092\u63CF\u304F] tree (\u89AA\u5B50\u306E\u5165\u308C\u5B50) \u306F actors \u306B\u540D\u524D\u3092\u4E26\u3079 flow \u306E\u77E2\u5370\u3067\u89AA\u5B50\u3092\u66F8\u304F (\u77E2\u5370\u306E\u5148\u304C\u5B50)'
|
|
10714
|
+
description: '\u56F3\u306E\u7A2E\u985E\u3002 \u578B\u3054\u3068\u306B actors \u306E\u66F8\u304D\u65B9\u304C\u9055\u3046\u3002 [\u95A2\u4FC2\u3092\u63CF\u304F] sequence (\u6642\u7CFB\u5217\u306E\u547C\u3073\u51FA\u3057) / flow (\u51E6\u7406\u306E\u6D41\u308C) / swimlane (\u8CAC\u52D9\u3054\u3068\u306E\u6D41\u308C) / er (DB \u306E schema) / state (\u72B6\u614B\u306E\u9077\u79FB) / topology (network) / solidity (contract) / class (UML \u306E class) / c4 (architecture) / mind (\u767A\u60F3\u306E\u679D\u5206\u304B\u308C) \u306F actors \u306B\u540D\u524D\u3092\u4E26\u3079 flow \u306B\u77E2\u5370\u3092\u66F8\u304F\u3002 [\u5024\u3092\u63CF\u304F] pie (\u5272\u5408) / bar (\u68D2\u306E\u9AD8\u3055) / line (\u7DDA\u306E\u9AD8\u3055\u3001 \u66F8\u3044\u305F\u9806\u306B\u4E26\u3076) / gauge (\u5408\u8A08\u3092\u534A\u5186\u3067\u793A\u3059) / radial (\u5F27\u306E\u9577\u3055\u3067\u6BD4\u3079\u308B) / stat (\u5024 1 \u3064\u3092\u5927\u304D\u304F\u793A\u3059) / waffle (\u5272\u5408\u3092 100 \u500B\u306E\u5370\u3067\u793A\u3059) / stacked (\u5185\u8A33\u3092\u5E2F\u3067\u793A\u3059) \u306F actors \u306B `- \u540D\u524D: "45"` \u306E\u5F62\u3067\u6570\u3092\u66F8\u304F\u3002 stat \u3068 stacked \u306F `- \u540D\u524D: { value: "320", previous: "280" }` \u306E\u5F62\u3067\u524D\u306E\u6642\u70B9\u306E\u5024\u3082\u66F8\u3051\u308B\u3002 funnel (\u6BB5\u3054\u3068\u306B\u6E1B\u308B\u6570) \u3082\u540C\u3058\u5F62\u3002 [\u8A9E\u3092\u63CF\u304F] journey (\u4F53\u9A13\u306E\u8D77\u4F0F) \u306F `- \u767B\u9332: "\u4E0D\u6E80"` \u306E\u5F62\u3067 \u6700\u9AD8 / \u6E80\u8DB3 / \u666E\u901A / \u4E0D\u6E80 / \u6012\u308A \u306E\u3069\u308C\u304B\u3092\u66F8\u304F\u3002 quadrant (2 \u8EF8\u306E\u4ED5\u5206\u3051) \u306F `- \u91CD\u8907\u524A\u9664: "\u5DE6\u4E0A"` \u306E\u5F62\u3067 \u5DE6\u4E0A / \u53F3\u4E0A / \u5DE6\u4E0B / \u53F3\u4E0B \u306E\u3069\u308C\u304B\u3092\u66F8\u304F\u3002 [\u6642\u671F\u3092\u63CF\u304F] gantt (\u5DE5\u7A0B\u306E\u4E26\u3073) \u306F `- \u8A2D\u8A08: "1\u6708"` \u306E\u5F62\u3067\u59CB\u307E\u308A\u306E\u6642\u671F\u3092\u66F8\u304D\u3001 flow \u306E\u77E2\u5370\u3067\u524D\u5F8C\u95A2\u4FC2\u3092\u66F8\u304F\u3002 [\u89AA\u5B50\u3092\u63CF\u304F] tree (\u89AA\u5B50\u306E\u5165\u308C\u5B50) \u306F actors \u306B\u540D\u524D\u3092\u4E26\u3079 flow \u306E\u77E2\u5370\u3067\u89AA\u5B50\u3092\u66F8\u304F (\u77E2\u5370\u306E\u5148\u304C\u5B50)'
|
|
10533
10715
|
},
|
|
10534
10716
|
eyebrow: {
|
|
10535
10717
|
type: "string",
|
|
10536
|
-
description: "\u56F3\u8868\u306E\u7BB1\u306E\u4E0A\u306B\u51FA\u3059\u5C0F\u898B\u51FA\u3057 (\u7701\u7565\u53EF)\u3002 \u52B9\u304F\u306E\u306F\u56F3\u5168\u4F53\u3092 1 \u7BB1\u306B\u3059\u308B\u578B (pie / bar / line / funnel / tree / journey / quadrant / mind / gantt) \u3060\u3051\u3002 \u7BB1\u3054\u3068\u306B\u5206\u304B\u308C\u308B\u578B\u3067\u306F\u76F8\u624B\u304C\u6C7A\u307E\u3089\u306A\u3044\u305F\u3081\u3001 actors[].eyebrow \u306B\u66F8\u304F"
|
|
10718
|
+
description: "\u56F3\u8868\u306E\u7BB1\u306E\u4E0A\u306B\u51FA\u3059\u5C0F\u898B\u51FA\u3057 (\u7701\u7565\u53EF)\u3002 \u52B9\u304F\u306E\u306F\u56F3\u5168\u4F53\u3092 1 \u7BB1\u306B\u3059\u308B\u578B (pie / bar / line / gauge / radial / stat / waffle / stacked / funnel / tree / journey / quadrant / mind / gantt) \u3060\u3051\u3002 \u7BB1\u3054\u3068\u306B\u5206\u304B\u308C\u308B\u578B\u3067\u306F\u76F8\u624B\u304C\u6C7A\u307E\u3089\u306A\u3044\u305F\u3081\u3001 actors[].eyebrow \u306B\u66F8\u304F"
|
|
10537
10719
|
},
|
|
10538
10720
|
axes: {
|
|
10539
10721
|
type: "object",
|
|
@@ -10602,6 +10784,10 @@ var diagram_default = {
|
|
|
10602
10784
|
type: "string",
|
|
10603
10785
|
description: "actor \u6570\u5024\u8868\u793A (kind: actor \u7528)"
|
|
10604
10786
|
},
|
|
10787
|
+
previous: {
|
|
10788
|
+
type: "string",
|
|
10789
|
+
description: "\u524D\u306E\u6642\u70B9\u306E\u5024\u3002 type: stacked \u304C 2 \u672C\u76EE\u306E\u5E2F\u3068\u3057\u3066\u63CF\u304D\u3001type: stat \u304C\u5DEE\u3068\u3057\u3066\u51FA\u3059\u3002 \u66F8\u304B\u306A\u3044\u56F3\u306F 1 \u672C\u306E\u307E\u307E"
|
|
10790
|
+
},
|
|
10605
10791
|
rows: {
|
|
10606
10792
|
type: "array",
|
|
10607
10793
|
items: {
|
|
@@ -10609,6 +10795,13 @@ var diagram_default = {
|
|
|
10609
10795
|
},
|
|
10610
10796
|
description: "storage \u5185\u306E column \u5217 (kind: storage \u7528)"
|
|
10611
10797
|
},
|
|
10798
|
+
marks: {
|
|
10799
|
+
type: "array",
|
|
10800
|
+
items: {
|
|
10801
|
+
type: "string"
|
|
10802
|
+
},
|
|
10803
|
+
description: "\u884C\u982D\u306E\u5370\u3002 rows \u3068\u540C\u3058\u6570\u3060\u3051\u4E26\u3079\u308B\u3002 \u8A9E\u306E\u610F\u5473\u306F\u56F3\u306E\u7A2E\u985E\u304C\u6C7A\u3081\u308B = er \u306F pk / fk / opt\u3001class \u306F + / - \u3068 () \u306E\u6709\u7121\u3001state \u306F entry / do / exit / internal"
|
|
10804
|
+
},
|
|
10612
10805
|
lane: {
|
|
10613
10806
|
type: "string",
|
|
10614
10807
|
description: "swimlane / topology \u3067\u5C5E\u3059\u308B lane id"
|
|
@@ -10943,7 +11136,7 @@ var diagram_default = {
|
|
|
10943
11136
|
},
|
|
10944
11137
|
style: {
|
|
10945
11138
|
type: "string",
|
|
10946
|
-
enum: ["solid", "dotted-flow"],
|
|
11139
|
+
enum: ["solid", "dotted-flow", "dashed"],
|
|
10947
11140
|
description: "\u77E2\u5370\u306E\u7DDA\u7A2E"
|
|
10948
11141
|
},
|
|
10949
11142
|
guard: {
|
|
@@ -10959,6 +11152,36 @@ var diagram_default = {
|
|
|
10959
11152
|
enum: ["top", "right", "bottom", "left"],
|
|
10960
11153
|
description: "\u77E2\u5370\u304C\u3069\u306E\u8FBA\u304B\u3089\u51FA\u308B\u304B\u3002 \u66F8\u304B\u306A\u3051\u308C\u3070\u63CF\u753B\u5074\u304C\u81EA\u52D5\u3067\u9078\u3076\u3002"
|
|
10961
11154
|
},
|
|
11155
|
+
head: {
|
|
11156
|
+
type: "string",
|
|
11157
|
+
enum: ["none", "triangle", "diamond", "open", "crow", "one", "zero-one", "many", "zero-many"],
|
|
11158
|
+
description: "\u7740\u304D\u5148\u5074\u306E\u7AEF\u306E\u5F62\u3002 \u7AEF\u306E\u5F62\u3067\u95A2\u4FC2\u306E\u7A2E\u985E\u3092\u793A\u3059 = triangle (\u7D99\u3050) / diamond (\u6301\u3064) / open (\u4F7F\u3046) / crow (\u591A) / one / zero-one / many / zero-many (\u500B\u6570)\u3002 \u66F8\u304B\u306A\u3051\u308C\u3070\u5857\u3063\u305F\u4E09\u89D2\u306B\u306A\u308B\u3002"
|
|
11159
|
+
},
|
|
11160
|
+
tailHead: {
|
|
11161
|
+
type: "string",
|
|
11162
|
+
enum: ["none", "triangle", "diamond", "open", "crow", "one", "zero-one", "many", "zero-many"],
|
|
11163
|
+
description: "\u51FA\u3069\u3053\u308D\u5074\u306E\u7AEF\u306E\u5F62\u3002 \u4E21\u7AEF\u306B\u5225\u3005\u306E\u5370\u3092\u7ACB\u3066\u308B\u6642\u306B\u66F8\u304F\u3002"
|
|
11164
|
+
},
|
|
11165
|
+
headFill: {
|
|
11166
|
+
type: "string",
|
|
11167
|
+
enum: ["solid", "hollow"],
|
|
11168
|
+
description: "\u7740\u304D\u5148\u5074\u306E\u7AEF\u306E\u5857\u308A\u3002 \u4E2D\u7A7A\u306F\u300C\u5F31\u3044\u95A2\u4FC2\u300D \u3092\u8868\u3059\u3002"
|
|
11169
|
+
},
|
|
11170
|
+
tailHeadFill: {
|
|
11171
|
+
type: "string",
|
|
11172
|
+
enum: ["solid", "hollow"],
|
|
11173
|
+
description: "\u51FA\u3069\u3053\u308D\u5074\u306E\u7AEF\u306E\u5857\u308A\u3002"
|
|
11174
|
+
},
|
|
11175
|
+
relation: {
|
|
11176
|
+
type: "string",
|
|
11177
|
+
enum: ["extends", "implements", "aggregates", "composes", "associates", "uses"],
|
|
11178
|
+
description: "\u30AF\u30E9\u30B9\u56F3\u306E\u95A2\u4FC2\u306E\u8A9E\u3002 \u66F8\u304F\u3068\u7AEF\u306E\u5F62 / \u5857\u308A / \u7DDA\u7A2E\u304C\u307E\u3068\u3081\u3066\u6C7A\u307E\u308B\u3002"
|
|
11179
|
+
},
|
|
11180
|
+
kind: {
|
|
11181
|
+
type: "string",
|
|
11182
|
+
enum: ["call", "return", "fire"],
|
|
11183
|
+
description: "\u9806\u5E8F\u56F3\u306E\u8A00\u3065\u3066\u306E\u7A2E\u985E\u3002 call (\u8FD4\u4E8B\u3092\u5F85\u3064) / return (\u8FD4\u3057) / fire (\u8FD4\u4E8B\u3092\u5F85\u305F\u306A\u3044)\u3002"
|
|
11184
|
+
},
|
|
10962
11185
|
labelOffsetX: {
|
|
10963
11186
|
type: "number",
|
|
10964
11187
|
description: "\u30E9\u30D9\u30EB\u4F4D\u7F6E x \u8ABF\u6574"
|
|
@@ -11079,6 +11302,12 @@ var diagram_default = {
|
|
|
11079
11302
|
enum: ["line", "bar", "pie", "journey", "mind", "tree", "gantt", "funnel"],
|
|
11080
11303
|
description: "\u3053\u306E phase \u3067\u8D77\u70B9\u304B\u3089\u63CF\u304F\u3082\u306E\u3002 \u8A9E\u306F\u56F3\u7A2E\u3068\u63C3\u3048\u308B\u3002 line / journey = \u7DDA\u304C\u5DE6\u7AEF\u304B\u3089\u53F3\u3078\u4F38\u3073\u308B / bar = \u68D2\u304C\u6A2A\u8EF8\u304B\u3089\u4E0A\u3078\u4F38\u3073\u308B / pie = \u6247\u304C 12 \u6642\u304B\u3089\u6642\u8A08\u56DE\u308A\u306B\u958B\u304F / mind = \u679D\u304C\u4E2D\u5FC3\u304B\u3089\u5916\u3078\u4F38\u3073\u308B / tree = \u679D\u304C\u6839\u304B\u3089\u4E0B\u3078\u4F38\u3073\u308B / gantt = \u5E2F\u304C\u5404\u59CB\u7AEF\u304B\u3089\u53F3\u3078\u4F38\u3073\u308B / funnel = \u6BB5\u304C\u4E0A\u7AEF\u304B\u3089\u9806\u306B\u7A4D\u307E\u308C\u308B"
|
|
11081
11304
|
},
|
|
11305
|
+
drawRatio: {
|
|
11306
|
+
type: "number",
|
|
11307
|
+
exclusiveMinimum: 0,
|
|
11308
|
+
maximum: 1,
|
|
11309
|
+
description: "\u63CF\u304D\u7D42\u3048\u308B\u307E\u3067\u306B phase \u306E\u4F55\u5272\u3092\u4F7F\u3046\u304B\u3002 0.4 \u306A\u3089\u9032\u307F\u304C 0.4 \u306B\u9054\u3057\u305F\u6642\u70B9\u3067\u63CF\u304D\u7D42\u308F\u308A\u3001\u6B8B\u308A\u306F\u63CF\u304D\u7D42\u308F\u3063\u305F\u59FF\u306E\u307E\u307E\u5024\u3060\u3051\u304C\u52D5\u304F\u3002 \u66F8\u304B\u306A\u3051\u308C\u3070 phase \u306E\u7D42\u308F\u308A\u306B\u63CF\u304D\u7D42\u308F\u308B\u3002 draw \u3068\u4E00\u7DD2\u306B\u66F8\u304F (draw \u304C\u7121\u3044\u3068\u4F55\u3082\u8D77\u304D\u306A\u3044)"
|
|
11310
|
+
},
|
|
11082
11311
|
tween: {
|
|
11083
11312
|
type: "object",
|
|
11084
11313
|
description: "\u3053\u306E phase \u3067\u88DC\u9593\u3059\u308B\u72B6\u614B\u3002 \u72B6\u614B\u540D -> [\u958B\u59CB\u5024, \u7D42\u4E86\u5024]\u3002 \u540D\u524D\u306F\u82F1\u5B57\u304B _ \u3067\u59CB\u3081\u3001 \u82F1\u6570\u5B57\u3068 _ \u3060\u3051\u3092\u4F7F\u3046",
|
|
@@ -12239,6 +12468,25 @@ var diagram_default = {
|
|
|
12239
12468
|
pattern: "^[A-Za-z_][A-Za-z0-9_]*$"
|
|
12240
12469
|
}
|
|
12241
12470
|
},
|
|
12471
|
+
reveal: {
|
|
12472
|
+
type: "string",
|
|
12473
|
+
enum: ["phase", "all"],
|
|
12474
|
+
description: "\u77E2\u5370\u3092\u3044\u3064\u51FA\u3059\u304B\u3002 phase (\u65E2\u5B9A) = \u6BB5\u304C\u540D\u6307\u3057\u3059\u308B\u77E2\u5370\u306F\u305D\u306E\u6BB5\u304C\u6765\u308B\u307E\u3067\u63CF\u304B\u306A\u3044\u3002 all = \u6BB5\u306B\u95A2\u308F\u3089\u305A\u6700\u521D\u304B\u3089\u5168\u90E8\u63CF\u304F\u3002"
|
|
12475
|
+
},
|
|
12476
|
+
bands: {
|
|
12477
|
+
type: "array",
|
|
12478
|
+
description: "\u9806\u5E8F\u56F3\u3067\u9762\u304C\u52D5\u3044\u3066\u3044\u308B\u9593\u306E\u5E2F\u3002 \u66F8\u304B\u306A\u3051\u308C\u3070\u9762\u3054\u3068\u306B\u300C\u6700\u521D\u306B\u95A2\u308F\u3063\u305F\u6BB5\u304B\u3089\u6700\u5F8C\u307E\u3067\u300D \u306E 1 \u672C\u306B\u306A\u308B\u3002",
|
|
12479
|
+
items: {
|
|
12480
|
+
type: "object",
|
|
12481
|
+
required: ["actor", "from", "to"],
|
|
12482
|
+
additionalProperties: false,
|
|
12483
|
+
properties: {
|
|
12484
|
+
actor: { type: "string", description: "\u5E2F\u3092\u51FA\u3059\u9762\u306E\u540D\u524D" },
|
|
12485
|
+
from: { type: "integer", minimum: 0, description: "\u59CB\u307E\u308A\u306E\u8A00\u3065\u3066\u306E\u756A\u53F7 (0 \u8D77\u70B9)" },
|
|
12486
|
+
to: { type: "integer", minimum: 0, description: "\u7D42\u308F\u308A\u306E\u8A00\u3065\u3066\u306E\u756A\u53F7 (0 \u8D77\u70B9)" }
|
|
12487
|
+
}
|
|
12488
|
+
}
|
|
12489
|
+
},
|
|
12242
12490
|
events: {
|
|
12243
12491
|
type: "array",
|
|
12244
12492
|
description: "\u62BC\u4E0B\u306A\u3069\u306E\u51FA\u6765\u4E8B\u3067\u52D5\u304F\u4ED5\u639B\u3051\u3002 \u76F8\u624B\u306F\u540D\u524D\u3067\u6307\u3059 (box / lane / arrow / diagram \u306E\u3069\u308C\u304B 1 \u3064)\u3002",
|
|
@@ -12455,6 +12703,7 @@ exports.partScaleFactor = partScaleFactor;
|
|
|
12455
12703
|
exports.partTargetScale = partTargetScale;
|
|
12456
12704
|
exports.partTargetSize = partTargetSize;
|
|
12457
12705
|
exports.partVisualSize = partVisualSize;
|
|
12706
|
+
exports.partsBaseRows = partsBaseRows;
|
|
12458
12707
|
exports.partsGridCenters = partsGridCenters;
|
|
12459
12708
|
exports.pointsOutside = pointsOutside;
|
|
12460
12709
|
exports.rectsOverlap = rectsOverlap;
|