@cardenelabs/dragon 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +115 -0
- package/dist/index.cjs +6610 -3358
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +578 -9
- package/dist/index.d.ts +578 -9
- package/dist/index.js +6606 -3360
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/compile.ts +2957 -256
- package/src/index.ts +29 -15
- package/src/input-size.ts +8 -1
- package/src/json-parser.ts +1384 -105
- package/src/notation-lint.ts +27 -4
- package/src/schemas/diagram.json +416 -41
- package/src/tokenize.ts +289 -0
- package/src/types.ts +144 -0
- package/src/v05/parser.ts +995 -163
- package/src/value-syntax.ts +313 -0
package/src/notation-lint.ts
CHANGED
|
@@ -102,7 +102,6 @@ const KIND_TO_JA: Record<string, string> = {
|
|
|
102
102
|
tree: "階層ツリー",
|
|
103
103
|
userJourney: "ユーザージャーニー",
|
|
104
104
|
mindMap: "マインドマップ",
|
|
105
|
-
mindMapRadial: "放射状マインドマップ",
|
|
106
105
|
funnel: "ファネル (段階別離脱)",
|
|
107
106
|
quadrant: "四象限マトリクス",
|
|
108
107
|
gantt: "ガントチャート",
|
|
@@ -113,7 +112,7 @@ const KIND_TO_JA: Record<string, string> = {
|
|
|
113
112
|
function applyTopicAutoFix(topic: string): string {
|
|
114
113
|
// 1. 先頭の kind name を検出、 マッチしたら JA description に置換
|
|
115
114
|
const kindMatch = topic.match(
|
|
116
|
-
/^\s*(chart|flow|swimlane|sequence|topology|er|stateMachine2?|infrastructure|classDiagram|tree|userJourney|mindMap
|
|
115
|
+
/^\s*(chart|flow|swimlane|sequence|topology|er|stateMachine2?|infrastructure|classDiagram|tree|userJourney|mindMap|funnel|quadrant|gantt|flowchart|network|line chart|pie chart|bar chart)\b/i,
|
|
117
116
|
);
|
|
118
117
|
if (kindMatch) {
|
|
119
118
|
const kind = kindMatch[1]!.toLowerCase();
|
|
@@ -202,10 +201,22 @@ function ruleGanttUnknownDependsOn(d: CdlDiagram): LintIssue[] {
|
|
|
202
201
|
return out;
|
|
203
202
|
}
|
|
204
203
|
|
|
204
|
+
/**
|
|
205
|
+
* 枝の親が実在するかを見る。
|
|
206
|
+
*
|
|
207
|
+
* **記法からも届く** (`#1177`)。 一時期は組立て API (`mindMap()` builder) で組んだ図にしか
|
|
208
|
+
* 当たらなかった = 記法の `type: mind` が `card` を 3 列に並べる別実装で、 `mind-map` 種別を
|
|
209
|
+
* 作っていなかったため (`#1170` で `type: radial` が消えて唯一の作り手が無くなった)。
|
|
210
|
+
* `#1177` で `compileMind` を `mind-map` 種別に寄せたので、 前提が揃うようになった。
|
|
211
|
+
*
|
|
212
|
+
* ただし **記法から違反が出ることは無い**。 記法の `actors` は「1 つ目が中心、 残りが枝」 の
|
|
213
|
+
* 並びで親を書く場所が無く、 全ての枝が中心の直下 (必ず実在する) になるため。 違反が出るのは
|
|
214
|
+
* 組立て API で親を書き間違えた図になる。
|
|
215
|
+
*/
|
|
205
216
|
function ruleMindMapParentReference(d: CdlDiagram): LintIssue[] {
|
|
206
217
|
const out: LintIssue[] = [];
|
|
207
218
|
for (const n of d.nodes) {
|
|
208
|
-
if (
|
|
219
|
+
if (n.kind === "mind-map" && n.mindData) {
|
|
209
220
|
const known = new Set<string>([n.mindData.rootId]);
|
|
210
221
|
for (const b of n.mindData.branches) known.add(b.id);
|
|
211
222
|
for (const b of n.mindData.branches) {
|
|
@@ -278,13 +289,25 @@ function ruleQuadrantMissingItems(d: CdlDiagram): LintIssue[] {
|
|
|
278
289
|
return out;
|
|
279
290
|
}
|
|
280
291
|
|
|
292
|
+
/**
|
|
293
|
+
* 段の人数が減っていくことを見る。
|
|
294
|
+
*
|
|
295
|
+
* 人数の欄は `{名前}` を書ける (状態から取る形、 cdl の `render/payload-binding.ts` が解く)。
|
|
296
|
+
* その場合ここでは値が決まらないので、**数どうしの組だけを比べる** (#1194)。
|
|
297
|
+
*
|
|
298
|
+
* 素通しで比べると文字列の大小比較になり、`{trial}` が `{signup}` より大きいという理由で
|
|
299
|
+
* 発火する。 実際に見本帳の funnel を状態から取る形にした時、その偽発火が出た。
|
|
300
|
+
*/
|
|
281
301
|
function ruleFunnelMonotonicCount(d: CdlDiagram): LintIssue[] {
|
|
282
302
|
const out: LintIssue[] = [];
|
|
283
303
|
for (const n of d.nodes) {
|
|
284
304
|
if (n.kind === "funnel-stages" && n.funnelData) {
|
|
285
305
|
const stages = n.funnelData;
|
|
286
306
|
for (let i = 1; i < stages.length; i++) {
|
|
287
|
-
|
|
307
|
+
const 今 = stages[i]!.count;
|
|
308
|
+
const 前 = stages[i - 1]!.count;
|
|
309
|
+
if (typeof 今 !== "number" || typeof 前 !== "number") continue;
|
|
310
|
+
if (今 > 前) {
|
|
288
311
|
out.push({
|
|
289
312
|
rule: "funnel-increasing-count",
|
|
290
313
|
severity: "warn",
|
package/src/schemas/diagram.json
CHANGED
|
@@ -14,8 +14,62 @@
|
|
|
14
14
|
},
|
|
15
15
|
"type": {
|
|
16
16
|
"type": "string",
|
|
17
|
-
"enum": [
|
|
18
|
-
|
|
17
|
+
"enum": [
|
|
18
|
+
"sequence",
|
|
19
|
+
"flow",
|
|
20
|
+
"swimlane",
|
|
21
|
+
"er",
|
|
22
|
+
"state",
|
|
23
|
+
"topology",
|
|
24
|
+
"solidity",
|
|
25
|
+
"gantt",
|
|
26
|
+
"class",
|
|
27
|
+
"pie",
|
|
28
|
+
"bar",
|
|
29
|
+
"line",
|
|
30
|
+
"funnel",
|
|
31
|
+
"tree",
|
|
32
|
+
"journey",
|
|
33
|
+
"quadrant",
|
|
34
|
+
"c4",
|
|
35
|
+
"mind"
|
|
36
|
+
],
|
|
37
|
+
"description": "図の種類。 型ごとに actors の書き方が違う。 [関係を描く] sequence (時系列の呼び出し) / flow (処理の流れ) / swimlane (責務ごとの流れ) / er (DB の schema) / state (状態の遷移) / topology (network) / solidity (contract) / class (UML の class) / c4 (architecture) / mind (発想の枝分かれ) は actors に名前を並べ flow に矢印を書く。 [値を描く] pie (割合) / bar (棒の高さ) / line (線の高さ、 書いた順に並ぶ) は actors に `- 名前: \"45\"` の形で数を書く。 funnel (段ごとに減る数) も同じ形。 [語を描く] journey (体験の起伏) は `- 登録: \"不満\"` の形で 最高 / 満足 / 普通 / 不満 / 怒り のどれかを書く。 quadrant (2 軸の仕分け) は `- 重複削除: \"左上\"` の形で 左上 / 右上 / 左下 / 右下 のどれかを書く。 [時期を描く] gantt (工程の並び) は `- 設計: \"1月\"` の形で始まりの時期を書き、 flow の矢印で前後関係を書く。 [親子を描く] tree (親子の入れ子) は actors に名前を並べ flow の矢印で親子を書く (矢印の先が子)"
|
|
38
|
+
},
|
|
39
|
+
"eyebrow": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "図表の箱の上に出す小見出し (省略可)。 効くのは図全体を 1 箱にする型 (pie / bar / line / funnel / tree / journey / quadrant / mind / gantt) だけ。 箱ごとに分かれる型では相手が決まらないため、 actors[].eyebrow に書く"
|
|
42
|
+
},
|
|
43
|
+
"axes": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"additionalProperties": false,
|
|
46
|
+
"description": "quadrant の x / y 軸の端に表示する名前。 記法の axes と同じ。",
|
|
47
|
+
"properties": {
|
|
48
|
+
"x": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"additionalProperties": false,
|
|
51
|
+
"properties": {
|
|
52
|
+
"left": {
|
|
53
|
+
"type": "string"
|
|
54
|
+
},
|
|
55
|
+
"right": {
|
|
56
|
+
"type": "string"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"y": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"additionalProperties": false,
|
|
63
|
+
"properties": {
|
|
64
|
+
"bottom": {
|
|
65
|
+
"type": "string"
|
|
66
|
+
},
|
|
67
|
+
"top": {
|
|
68
|
+
"type": "string"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
19
73
|
},
|
|
20
74
|
"actors": {
|
|
21
75
|
"type": "array",
|
|
@@ -32,19 +86,147 @@
|
|
|
32
86
|
"required": ["name"],
|
|
33
87
|
"additionalProperties": false,
|
|
34
88
|
"properties": {
|
|
35
|
-
"name": {
|
|
89
|
+
"name": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"minLength": 1,
|
|
92
|
+
"description": "actor 名 (flow の from / to で参照される)"
|
|
93
|
+
},
|
|
36
94
|
"kind": {
|
|
37
95
|
"type": "string",
|
|
38
96
|
"description": "node kind。 shape-* を指定して 49 shape 中から選ぶ。 例: 'shape-wallet' / 'shape-smart-contract' / 'shape-cloud' / 'shape-file' / 'actor' (default) / 'function' / 'storage' / 'event' 等"
|
|
39
97
|
},
|
|
40
|
-
"subtitle": {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
98
|
+
"subtitle": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"description": "node 下部の補足テキスト"
|
|
101
|
+
},
|
|
102
|
+
"eyebrow": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"description": "node 上部の分類ラベル (accent 色)"
|
|
105
|
+
},
|
|
106
|
+
"value": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"description": "actor 数値表示 (kind: actor 用)"
|
|
109
|
+
},
|
|
110
|
+
"rows": {
|
|
111
|
+
"type": "array",
|
|
112
|
+
"items": {
|
|
113
|
+
"type": "string"
|
|
114
|
+
},
|
|
115
|
+
"description": "storage 内の column 列 (kind: storage 用)"
|
|
116
|
+
},
|
|
117
|
+
"lane": {
|
|
118
|
+
"type": "string",
|
|
119
|
+
"description": "swimlane / topology で属する lane id"
|
|
120
|
+
},
|
|
121
|
+
"stack": {
|
|
122
|
+
"type": "integer",
|
|
123
|
+
"minimum": 0,
|
|
124
|
+
"description": "lane 内の縦位置 (0-based)"
|
|
125
|
+
},
|
|
126
|
+
"initial": {
|
|
127
|
+
"type": "boolean",
|
|
128
|
+
"description": "state 開始点 (kind: state 用)"
|
|
129
|
+
},
|
|
130
|
+
"final": {
|
|
131
|
+
"type": "boolean",
|
|
132
|
+
"description": "state 終了点 (kind: state 用)"
|
|
133
|
+
},
|
|
134
|
+
"state": {
|
|
135
|
+
"type": "object",
|
|
136
|
+
"description": "parts の状態の上書き。 kind に parts identifier を指定した時だけ使える。",
|
|
137
|
+
"additionalProperties": {
|
|
138
|
+
"type": ["number", "string", "boolean"]
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"tone": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"description": "箱の色調。 success / warning 等の別名も使える。",
|
|
144
|
+
"enum": ["accent", "teal", "success", "error", "warning", "info", "成功", "失敗", "警告", "情報", "中立", "neutral"]
|
|
145
|
+
},
|
|
146
|
+
"color": {
|
|
147
|
+
"type": "string",
|
|
148
|
+
"description": "箱の色名、または # で始まる parts の色番号。",
|
|
149
|
+
"anyOf": [
|
|
150
|
+
{
|
|
151
|
+
"enum": ["accent", "teal", "success", "error", "warning", "info", "成功", "失敗", "警告", "情報", "中立", "neutral"]
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"pattern": "^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
},
|
|
158
|
+
"owner": {
|
|
159
|
+
"type": "string",
|
|
160
|
+
"description": "gantt の工程の担当。"
|
|
161
|
+
},
|
|
162
|
+
"end": {
|
|
163
|
+
"type": "string",
|
|
164
|
+
"description": "gantt の工程が終わる時期。"
|
|
165
|
+
},
|
|
166
|
+
"touchpoint": {
|
|
167
|
+
"type": "string",
|
|
168
|
+
"description": "journey の段階が起きる場所。"
|
|
169
|
+
},
|
|
170
|
+
"opportunity": {
|
|
171
|
+
"type": "string",
|
|
172
|
+
"description": "journey の段階の改善の余地。"
|
|
173
|
+
},
|
|
174
|
+
"posX": {
|
|
175
|
+
"type": "number",
|
|
176
|
+
"description": "箱の絶対 x 座標。"
|
|
177
|
+
},
|
|
178
|
+
"posY": {
|
|
179
|
+
"type": "number",
|
|
180
|
+
"description": "箱の絶対 y 座標。"
|
|
181
|
+
},
|
|
182
|
+
"posW": {
|
|
183
|
+
"type": "number",
|
|
184
|
+
"description": "箱の幅。"
|
|
185
|
+
},
|
|
186
|
+
"posH": {
|
|
187
|
+
"type": "number",
|
|
188
|
+
"description": "箱の高さ。"
|
|
189
|
+
},
|
|
190
|
+
"nodes": {
|
|
191
|
+
"type": "object",
|
|
192
|
+
"description": "箱の中の要素ごとの位置と大きさ。 key は header / footer / s0 等の要素名。",
|
|
193
|
+
"additionalProperties": {
|
|
194
|
+
"type": "object",
|
|
195
|
+
"additionalProperties": false,
|
|
196
|
+
"properties": {
|
|
197
|
+
"posX": {
|
|
198
|
+
"type": "number"
|
|
199
|
+
},
|
|
200
|
+
"posY": {
|
|
201
|
+
"type": "number"
|
|
202
|
+
},
|
|
203
|
+
"posW": {
|
|
204
|
+
"type": "number"
|
|
205
|
+
},
|
|
206
|
+
"posH": {
|
|
207
|
+
"type": "number"
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"scale": {
|
|
213
|
+
"type": "number",
|
|
214
|
+
"description": "parts の描画倍率。 kind に parts identifier を指定した時だけ使える。"
|
|
215
|
+
},
|
|
216
|
+
"pos": {
|
|
217
|
+
"type": "object",
|
|
218
|
+
"additionalProperties": false,
|
|
219
|
+
"description": "auto layout の結果からずらす幅 (dx, dy)。 絶対座標は posX / posY で書く。",
|
|
220
|
+
"required": ["x", "y"],
|
|
221
|
+
"properties": {
|
|
222
|
+
"x": {
|
|
223
|
+
"type": "number"
|
|
224
|
+
},
|
|
225
|
+
"y": {
|
|
226
|
+
"type": "number"
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
48
230
|
}
|
|
49
231
|
}
|
|
50
232
|
]
|
|
@@ -58,32 +240,167 @@
|
|
|
58
240
|
"required": ["from", "to", "label"],
|
|
59
241
|
"additionalProperties": false,
|
|
60
242
|
"properties": {
|
|
61
|
-
"from": {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
|
|
243
|
+
"from": {
|
|
244
|
+
"type": "string",
|
|
245
|
+
"description": "起点 actor 名"
|
|
246
|
+
},
|
|
247
|
+
"to": {
|
|
248
|
+
"type": "string",
|
|
249
|
+
"description": "終点 actor 名"
|
|
250
|
+
},
|
|
251
|
+
"label": {
|
|
252
|
+
"type": "string",
|
|
253
|
+
"description": "矢印上のラベル (関数呼出し名 / メッセージ等)"
|
|
254
|
+
},
|
|
255
|
+
"sub": {
|
|
256
|
+
"type": "string",
|
|
257
|
+
"description": "ラベル下の補足"
|
|
258
|
+
},
|
|
259
|
+
"tone": {
|
|
260
|
+
"type": "string",
|
|
261
|
+
"enum": ["accent", "teal", "success", "error", "warning", "info", "成功", "失敗", "警告", "情報", "中立", "neutral"],
|
|
262
|
+
"description": "矢印の色調。 success / 成功 等の別名も使える。"
|
|
263
|
+
},
|
|
264
|
+
"style": {
|
|
265
|
+
"type": "string",
|
|
266
|
+
"enum": ["solid", "dotted-flow"],
|
|
267
|
+
"description": "矢印の線種"
|
|
268
|
+
},
|
|
269
|
+
"guard": {
|
|
270
|
+
"type": "string",
|
|
271
|
+
"description": "state 遷移の条件 (kind: state 用)"
|
|
272
|
+
},
|
|
273
|
+
"cardinality": {
|
|
274
|
+
"type": "string",
|
|
275
|
+
"description": "ER の多重度 (1..N 等、 kind: er 用)"
|
|
276
|
+
},
|
|
277
|
+
"labelOffsetX": {
|
|
278
|
+
"type": "number",
|
|
279
|
+
"description": "ラベル位置 x 調整"
|
|
280
|
+
},
|
|
281
|
+
"labelOffsetY": {
|
|
282
|
+
"type": "number",
|
|
283
|
+
"description": "ラベル位置 y 調整"
|
|
284
|
+
},
|
|
285
|
+
"overlay": {
|
|
286
|
+
"type": "boolean",
|
|
287
|
+
"description": "true で説明文を矢印の線の上に重ねる (分岐図の条件ラベル用)"
|
|
288
|
+
},
|
|
289
|
+
"pos": {
|
|
290
|
+
"type": "object",
|
|
291
|
+
"additionalProperties": false,
|
|
292
|
+
"description": "矢印の説明文をずらす幅 (dx, dy)。",
|
|
293
|
+
"required": ["x", "y"],
|
|
294
|
+
"properties": {
|
|
295
|
+
"x": {
|
|
296
|
+
"type": "number"
|
|
297
|
+
},
|
|
298
|
+
"y": {
|
|
299
|
+
"type": "number"
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
71
303
|
}
|
|
72
304
|
}
|
|
73
305
|
},
|
|
306
|
+
"states": {
|
|
307
|
+
"type": "object",
|
|
308
|
+
"description": "状態の初期値。 名前 -> 初期値 の object。 optional。 箱の文字に `{名前}` を置くと、 ここに書いた値が描画時に置き換わる。 段で動かすには animation[].tween / animation[].set を使う。",
|
|
309
|
+
"additionalProperties": false,
|
|
310
|
+
"patternProperties": {
|
|
311
|
+
"^[a-zA-Z_][a-zA-Z0-9_]*$": {
|
|
312
|
+
"type": ["number", "string"],
|
|
313
|
+
"description": "初期値。 数か文字列。 名前は英字か _ で始め、 英数字と _ だけを使う"
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
"examples": [
|
|
317
|
+
{
|
|
318
|
+
"inflow": 0,
|
|
319
|
+
"done": 0
|
|
320
|
+
}
|
|
321
|
+
]
|
|
322
|
+
},
|
|
323
|
+
"values": {
|
|
324
|
+
"type": "object",
|
|
325
|
+
"description": "他の値から自動で決まる値。 名前 -> 式 の object。 optional。 式には四則 (+ - * /) と括弧、 比較 (> >= < <= == !=)、 min / max が書ける。 他の値は {名前} で読む。 解くのは描画側で、 参照した値が動けば追随する。",
|
|
326
|
+
"additionalProperties": false,
|
|
327
|
+
"patternProperties": {
|
|
328
|
+
"^[a-zA-Z_][a-zA-Z0-9_]*$": {
|
|
329
|
+
"type": "string",
|
|
330
|
+
"minLength": 1,
|
|
331
|
+
"description": "式。 例 `{inflow} - {done}`"
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
"examples": [
|
|
335
|
+
{
|
|
336
|
+
"waiting": "{inflow} - {done}",
|
|
337
|
+
"busy": "{waiting} > 80"
|
|
338
|
+
}
|
|
339
|
+
]
|
|
340
|
+
},
|
|
74
341
|
"animation": {
|
|
75
342
|
"type": "array",
|
|
76
|
-
"description": "アニメーション phase 配列。 各 phase で focus 対象を highlight
|
|
343
|
+
"description": "アニメーション phase 配列。 各 phase で focus 対象を highlight し、 tween / set で states の値を動かす。 optional。",
|
|
77
344
|
"items": {
|
|
78
345
|
"type": "object",
|
|
79
346
|
"required": ["step"],
|
|
80
347
|
"additionalProperties": false,
|
|
81
348
|
"properties": {
|
|
82
|
-
"step": {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
349
|
+
"step": {
|
|
350
|
+
"type": "string",
|
|
351
|
+
"minLength": 1,
|
|
352
|
+
"description": "phase 名"
|
|
353
|
+
},
|
|
354
|
+
"duration": {
|
|
355
|
+
"type": "number",
|
|
356
|
+
"minimum": 0.1,
|
|
357
|
+
"description": "phase 時間 (秒、 default 1.4)"
|
|
358
|
+
},
|
|
359
|
+
"focus": {
|
|
360
|
+
"type": "array",
|
|
361
|
+
"items": {
|
|
362
|
+
"type": "string"
|
|
363
|
+
},
|
|
364
|
+
"description": "この phase で active 化する actor 名 or edge 'A -> B' の配列"
|
|
365
|
+
},
|
|
366
|
+
"body": {
|
|
367
|
+
"type": "string",
|
|
368
|
+
"description": "phase 説明文"
|
|
369
|
+
},
|
|
370
|
+
"badge": {
|
|
371
|
+
"type": "string",
|
|
372
|
+
"description": "phase 中に表示する badge label"
|
|
373
|
+
},
|
|
374
|
+
"draw": {
|
|
375
|
+
"type": "string",
|
|
376
|
+
"enum": ["line", "bar", "pie"],
|
|
377
|
+
"description": "この phase で起点から描くもの。 語は図種と揃える。 line = 折れ線が左端から右へ伸びる / bar = 棒が横軸から上へ伸びる / pie = 扇が 12 時から時計回りに開く"
|
|
378
|
+
},
|
|
379
|
+
"tween": {
|
|
380
|
+
"type": "object",
|
|
381
|
+
"description": "この phase で補間する状態。 状態名 -> [開始値, 終了値]。 名前は英字か _ で始め、 英数字と _ だけを使う",
|
|
382
|
+
"additionalProperties": false,
|
|
383
|
+
"patternProperties": {
|
|
384
|
+
"^[a-zA-Z_][a-zA-Z0-9_]*$": {
|
|
385
|
+
"type": "array",
|
|
386
|
+
"items": {
|
|
387
|
+
"type": "number"
|
|
388
|
+
},
|
|
389
|
+
"minItems": 2,
|
|
390
|
+
"maxItems": 2
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
"set": {
|
|
395
|
+
"type": "object",
|
|
396
|
+
"description": "この phase の切替で差し替える状態。 状態名 -> 値。 名前は英字か _ で始め、 英数字と _ だけを使う",
|
|
397
|
+
"additionalProperties": false,
|
|
398
|
+
"patternProperties": {
|
|
399
|
+
"^[a-zA-Z_][a-zA-Z0-9_]*$": {
|
|
400
|
+
"type": ["number", "string"]
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
87
404
|
}
|
|
88
405
|
}
|
|
89
406
|
},
|
|
@@ -92,13 +409,38 @@
|
|
|
92
409
|
"description": "全体 canvas サイズ + gap の調整。 optional。",
|
|
93
410
|
"additionalProperties": false,
|
|
94
411
|
"properties": {
|
|
95
|
-
"width": {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"
|
|
100
|
-
|
|
101
|
-
|
|
412
|
+
"width": {
|
|
413
|
+
"type": "number",
|
|
414
|
+
"minimum": 100
|
|
415
|
+
},
|
|
416
|
+
"height": {
|
|
417
|
+
"type": "number",
|
|
418
|
+
"minimum": 100
|
|
419
|
+
},
|
|
420
|
+
"laneWidth": {
|
|
421
|
+
"type": "number",
|
|
422
|
+
"minimum": 100
|
|
423
|
+
},
|
|
424
|
+
"gap": {
|
|
425
|
+
"type": "number",
|
|
426
|
+
"minimum": 0
|
|
427
|
+
},
|
|
428
|
+
"laneGap": {
|
|
429
|
+
"type": "number",
|
|
430
|
+
"minimum": 0
|
|
431
|
+
},
|
|
432
|
+
"nodeGap": {
|
|
433
|
+
"type": "number",
|
|
434
|
+
"minimum": 0
|
|
435
|
+
},
|
|
436
|
+
"labelMargin": {
|
|
437
|
+
"type": "number",
|
|
438
|
+
"minimum": 0
|
|
439
|
+
},
|
|
440
|
+
"scale": {
|
|
441
|
+
"type": "number",
|
|
442
|
+
"description": "図全体の倍率 (既定 1)。 箱 / 文字 / 線 / 間隔がすべて等比で変わる。"
|
|
443
|
+
}
|
|
102
444
|
}
|
|
103
445
|
},
|
|
104
446
|
"lanes": {
|
|
@@ -108,11 +450,36 @@
|
|
|
108
450
|
"type": "object",
|
|
109
451
|
"additionalProperties": false,
|
|
110
452
|
"properties": {
|
|
111
|
-
"x": {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
"
|
|
115
|
-
|
|
453
|
+
"x": {
|
|
454
|
+
"type": "number"
|
|
455
|
+
},
|
|
456
|
+
"width": {
|
|
457
|
+
"type": "number",
|
|
458
|
+
"minimum": 50
|
|
459
|
+
},
|
|
460
|
+
"label": {
|
|
461
|
+
"type": "string"
|
|
462
|
+
},
|
|
463
|
+
"contain": {
|
|
464
|
+
"type": "boolean"
|
|
465
|
+
},
|
|
466
|
+
"lifeline": {
|
|
467
|
+
"type": "boolean"
|
|
468
|
+
},
|
|
469
|
+
"pos": {
|
|
470
|
+
"type": "object",
|
|
471
|
+
"additionalProperties": false,
|
|
472
|
+
"description": "縦列をずらす幅 (dx, dy)。",
|
|
473
|
+
"required": ["x", "y"],
|
|
474
|
+
"properties": {
|
|
475
|
+
"x": {
|
|
476
|
+
"type": "number"
|
|
477
|
+
},
|
|
478
|
+
"y": {
|
|
479
|
+
"type": "number"
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
116
483
|
}
|
|
117
484
|
}
|
|
118
485
|
},
|
|
@@ -124,8 +491,16 @@
|
|
|
124
491
|
"required": ["lanes"],
|
|
125
492
|
"additionalProperties": false,
|
|
126
493
|
"properties": {
|
|
127
|
-
"label": {
|
|
128
|
-
|
|
494
|
+
"label": {
|
|
495
|
+
"type": "string"
|
|
496
|
+
},
|
|
497
|
+
"lanes": {
|
|
498
|
+
"type": "array",
|
|
499
|
+
"items": {
|
|
500
|
+
"type": "string"
|
|
501
|
+
},
|
|
502
|
+
"minItems": 1
|
|
503
|
+
}
|
|
129
504
|
}
|
|
130
505
|
}
|
|
131
506
|
}
|