@cardenelabs/dragon 0.26.0 → 0.28.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 +42 -8
- package/dist/index.cjs +1417 -369
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +225 -113
- package/dist/index.d.ts +225 -113
- package/dist/index.js +1416 -370
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/compile.ts +1572 -303
- package/src/index.ts +5 -3
- package/src/json-parser.ts +171 -71
- package/src/notation-lint.ts +112 -74
- package/src/schemas/diagram.json +92 -30
- package/src/types.ts +59 -40
- package/src/v05/input-table.generated.ts +6 -4
- package/src/v05/parser-types.ts +12 -1
- package/src/v05/parser.ts +412 -77
package/src/notation-lint.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 記法の検査 (図を書く人向けの修正システム)。
|
|
3
3
|
*
|
|
4
|
-
* cdl / dragon
|
|
5
|
-
*
|
|
4
|
+
* cdl / dragon の記法で書いた図 (`CdlDiagram`) を決まった規則で検査し、直し方を修正案
|
|
5
|
+
* (`suggestion`) として返す純粋関数。 言語モデルは使わない。
|
|
6
6
|
*
|
|
7
|
-
* 検知システム (`check:cdl` / `check:dragon` / `check:kind`)
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* 検知システム (`check:cdl` / `check:dragon` / `check:kind`) は開発者向けで実装の不具合を
|
|
8
|
+
* 見つける。 こちらは図を書く人向けで、読む人へ伝わらない書き方 (図の説明に入り込んだ実装の
|
|
9
|
+
* 書き方、無い部品を指す参照、値や項目が空の図表など) を見つける。
|
|
10
10
|
*
|
|
11
11
|
* 使い方:
|
|
12
|
-
* import { lintDiagram } from "@cardenelabs/dragon";
|
|
12
|
+
* import { lintDiagram, autoFix } from "@cardenelabs/dragon";
|
|
13
13
|
* const report = lintDiagram(diagram);
|
|
14
|
-
* // report.issues
|
|
15
|
-
* // report.
|
|
16
|
-
*
|
|
14
|
+
* // report.issues = LintIssue[]
|
|
15
|
+
* // report.autoFixableCount = 自動修正で実際に解消できる指摘の数
|
|
16
|
+
* const patched = autoFix(diagram); // 自動修正を当てた新しい図 (元の図は変えない)
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* 道具:
|
|
19
|
+
* node packages/dragon/scripts/dragon-lint.mjs apps/playground-spa/src/topics/catalog/presets.cdl.ts
|
|
20
20
|
*/
|
|
21
21
|
import type { CdlDiagram, CdlNode } from "@cardenelabs/cdl";
|
|
22
22
|
|
|
@@ -28,9 +28,12 @@ export type LintIssue = {
|
|
|
28
28
|
severity: LintSeverity;
|
|
29
29
|
/** 該当対象 (node id / edge id / diagram id) */
|
|
30
30
|
target: string;
|
|
31
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* 書き手向けの指摘の文。 書き手が打ち込む識別子と書き手の値は `` ` `` で囲み、 残りは日本語で書く
|
|
33
|
+
* (画面側の `lint-message-words.test.ts` が全規則の文を判定に通す)
|
|
34
|
+
*/
|
|
32
35
|
message: string;
|
|
33
|
-
/**
|
|
36
|
+
/** 修正案。 自動修正できる指摘は自動修正が書く値そのもの、 できない指摘は直し方の文 */
|
|
34
37
|
suggestion?: string;
|
|
35
38
|
/** autoFix() が本 issue を自動解消できるか */
|
|
36
39
|
autoFixable: boolean;
|
|
@@ -43,11 +46,21 @@ export type LintReport = {
|
|
|
43
46
|
autoFixableCount: number;
|
|
44
47
|
};
|
|
45
48
|
|
|
49
|
+
/**
|
|
50
|
+
* 図の説明に入り込んだ実装の書き方と、 読む人に何が伝わらないか。
|
|
51
|
+
*
|
|
52
|
+
* 文は理由だけを持ち、 直し方の例を書かない。 直し方は修正案 (`suggestion`) が自動修正の
|
|
53
|
+
* 出力から作る。 例を字で書くと、 自動修正の出力を変えた日に例だけが古い文型で残る
|
|
54
|
+
* (実測 = #1934 で出力を変えた後も `「〜 を示す図」 のように` が残っていた、 #1940)。
|
|
55
|
+
*/
|
|
46
56
|
const REDUNDANT_TOPIC_PATTERNS: Array<{ pattern: RegExp; hint: string }> = [
|
|
47
|
-
{ pattern: /\bpreset\s*\(/i, hint: "
|
|
48
|
-
{ pattern: /render\s*未実装/, hint: "
|
|
49
|
-
{
|
|
50
|
-
|
|
57
|
+
{ pattern: /\bpreset\s*\(/i, hint: "`preset (…)` は作り手の書き方で、 読む人には何を示す図かが伝わらない" },
|
|
58
|
+
{ pattern: /render\s*未実装/, hint: "`render 未実装` は作り手向けの控えで、 カタログに出す説明には要らない" },
|
|
59
|
+
{
|
|
60
|
+
pattern: /SVG\s+(polyline|arc|rect|path)/i,
|
|
61
|
+
hint: "`SVG` の描き方の名前 (`polyline` / `arc` / `rect` / `path`) は実装の詳細で、 何を示す図かが伝わらない",
|
|
62
|
+
},
|
|
63
|
+
{ pattern: /\bpolygon\b/i, hint: "`polygon` は実装の言葉で、 何を示す図かが伝わらない" },
|
|
51
64
|
];
|
|
52
65
|
|
|
53
66
|
/**
|
|
@@ -85,32 +98,46 @@ export function autoFix(d: CdlDiagram): CdlDiagram {
|
|
|
85
98
|
return patched;
|
|
86
99
|
}
|
|
87
100
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
101
|
+
/**
|
|
102
|
+
* 図の型ごとに、 自動修正が書く説明「{shows}を示す{name}」 の 2 つの部品。
|
|
103
|
+
*
|
|
104
|
+
* `name` はカタログが同じ型の見本に付けた名前 (`apps/playground-spa/src/lib/i18n.ts` の
|
|
105
|
+
* `ITEM_NAME_JA` の `preset*`) と同じ字にする。 利用者は自動修正で書き換わった説明の名前で
|
|
106
|
+
* カタログを探すため、 呼び名が割れると同じ型の見本に辿り着けない。 照らす検査は画面側の
|
|
107
|
+
* `lint-topic-names.test.ts` が持つ (この package は画面側の file を読まない)。
|
|
108
|
+
*
|
|
109
|
+
* 説明の末尾を型の名前にするのは、 名前の多くが `図` で終わるため。 旧い文型
|
|
110
|
+
* 「{名前} を示す図」 のまま名前を差し替えると `工程表 を示す図` / `状態遷移図 を示す図` の
|
|
111
|
+
* ように図が重なる。 カタログの見本の説明 (`全体に対する内訳の割合を示す円グラフ`) と同じ並びにした。
|
|
112
|
+
*
|
|
113
|
+
* `chart` と `bar chart` はカタログに同じ型の見本が無いので、 図表の日常語で呼ぶ。
|
|
114
|
+
*/
|
|
115
|
+
const KIND_TO_JA: Record<string, { shows: string; name: string }> = {
|
|
116
|
+
chart: { shows: "項目ごとの数値", name: "グラフ" },
|
|
117
|
+
"line chart": { shows: "値の移り変わり", name: "折れ線グラフ" },
|
|
118
|
+
"pie chart": { shows: "全体に対する内訳の割合", name: "円グラフ" },
|
|
119
|
+
"bar chart": { shows: "項目ごとの値の大きさ", name: "棒グラフ" },
|
|
120
|
+
flow: { shows: "処理の順番", name: "フロー" },
|
|
121
|
+
swimlane: { shows: "役割ごとの縦列に分けた処理の流れ", name: "スイムレーン" },
|
|
122
|
+
sequence: { shows: "要素どうしのやり取りの順番", name: "シーケンス図" },
|
|
123
|
+
topology: { shows: "システムの構成要素と接続", name: "トポロジー図" },
|
|
124
|
+
er: { shows: "表どうしの関係", name: "ER図" },
|
|
125
|
+
stateMachine: { shows: "状態と遷移の条件", name: "状態遷移図" },
|
|
126
|
+
stateMachine2: { shows: "親の状態の中に置いた子の状態と遷移の条件", name: "入れ子の状態遷移図" },
|
|
127
|
+
infrastructure: { shows: "クラウドとネットワークの構成", name: "階層構成図" },
|
|
128
|
+
classDiagram: { shows: "クラスどうしの関係", name: "クラス図" },
|
|
129
|
+
tree: { shows: "組織や分類の親子の関係", name: "階層図" },
|
|
130
|
+
userJourney: { shows: "利用者の気持ちの移り変わり", name: "体験の道筋" },
|
|
131
|
+
mindMap: { shows: "中心の主題から広がる発想", name: "枝分かれ図" },
|
|
132
|
+
funnel: { shows: "段階ごとに残る数と離れる数", name: "絞り込み図" },
|
|
133
|
+
quadrant: { shows: "2 つの軸で分けた項目の位置", name: "四象限図" },
|
|
134
|
+
gantt: { shows: "作業の期間と前後の関係", name: "工程表" },
|
|
135
|
+
flowchart: { shows: "分岐や判定を含む処理の順番", name: "流れ図" },
|
|
136
|
+
network: { shows: "機器と区画のつながり", name: "ネットワーク図" },
|
|
110
137
|
};
|
|
111
138
|
|
|
112
139
|
function applyTopicAutoFix(topic: string): string {
|
|
113
|
-
// 1. 先頭の kind name を検出、
|
|
140
|
+
// 1. 先頭の kind name を検出、 マッチしたら「{shows}を示す{name}」 に置換
|
|
114
141
|
const kindMatch = topic.match(
|
|
115
142
|
/^\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,
|
|
116
143
|
);
|
|
@@ -118,7 +145,8 @@ function applyTopicAutoFix(topic: string): string {
|
|
|
118
145
|
const kind = kindMatch[1]!.toLowerCase();
|
|
119
146
|
const canonical = Object.keys(KIND_TO_JA).find((k) => k.toLowerCase() === kind);
|
|
120
147
|
if (canonical) {
|
|
121
|
-
|
|
148
|
+
const { shows, name } = KIND_TO_JA[canonical]!;
|
|
149
|
+
return `${shows}を示す${name}`;
|
|
122
150
|
}
|
|
123
151
|
}
|
|
124
152
|
|
|
@@ -131,21 +159,31 @@ function applyTopicAutoFix(topic: string): string {
|
|
|
131
159
|
return out;
|
|
132
160
|
}
|
|
133
161
|
|
|
162
|
+
/**
|
|
163
|
+
* 図の説明に実装の書き方が入っていないかを見る。
|
|
164
|
+
*
|
|
165
|
+
* **自動修正で消えるかは、 直した後の説明にもう 1 度当てて決める** (#1940)。 自動修正が消すのは
|
|
166
|
+
* 先頭の型の名前と、 括弧の中の実装の言葉だけで、 括弧の外の `SVG polyline を使う` は字が変わらない。
|
|
167
|
+
* 当てずに「直せる」 と返すと、 道具が直せる数に入れ、 直したはずの指摘が次の検査でまた出る。
|
|
168
|
+
*
|
|
169
|
+
* 修正案は、 直せる時は自動修正が書く値そのもの (`LintIssue.suggestion` の約束)、 直せない時は
|
|
170
|
+
* 直し方の文にする。 文の例は書き換え先の表から作り、 字で書かない。
|
|
171
|
+
*/
|
|
134
172
|
function ruleTopicRedundancy(d: CdlDiagram): LintIssue[] {
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
173
|
+
const 当たる = REDUNDANT_TOPIC_PATTERNS.filter(({ pattern }) => pattern.test(d.topic));
|
|
174
|
+
if (当たる.length === 0) return [];
|
|
175
|
+
const 直した後 = applyTopicAutoFix(d.topic);
|
|
176
|
+
const 直せる = !REDUNDANT_TOPIC_PATTERNS.some(({ pattern }) => pattern.test(直した後));
|
|
177
|
+
const 例 = KIND_TO_JA.gantt!;
|
|
178
|
+
const 手で直す = `何を示す図かを文で書き直す (「${例.shows}を示す${例.name}」 のように)`;
|
|
179
|
+
return 当たる.map(({ hint }) => ({
|
|
180
|
+
rule: "topic-redundant-implementation-detail",
|
|
181
|
+
severity: "warn",
|
|
182
|
+
target: d.id,
|
|
183
|
+
message: `図の説明 \`${d.topic}\` に実装の書き方が入っている。 ${hint}`,
|
|
184
|
+
suggestion: 直せる ? 直した後 : 手で直す,
|
|
185
|
+
autoFixable: 直せる,
|
|
186
|
+
}));
|
|
149
187
|
}
|
|
150
188
|
|
|
151
189
|
function ruleEmptyChartData(d: CdlDiagram): LintIssue[] {
|
|
@@ -158,8 +196,8 @@ function ruleEmptyChartData(d: CdlDiagram): LintIssue[] {
|
|
|
158
196
|
rule: "chart-empty-datum",
|
|
159
197
|
severity: "warn",
|
|
160
198
|
target: n.id,
|
|
161
|
-
message:
|
|
162
|
-
suggestion:
|
|
199
|
+
message: `図表 \`${n.id}\` に値 (\`datum\`) が 1 件も無く、 図表が描かれない`,
|
|
200
|
+
suggestion: `\`.datum({ id, label, value })\` で値を 1 件以上足す`,
|
|
163
201
|
autoFixable: false,
|
|
164
202
|
});
|
|
165
203
|
}
|
|
@@ -168,8 +206,8 @@ function ruleEmptyChartData(d: CdlDiagram): LintIssue[] {
|
|
|
168
206
|
rule: "chart-single-datum",
|
|
169
207
|
severity: "info",
|
|
170
208
|
target: n.id,
|
|
171
|
-
message:
|
|
172
|
-
suggestion:
|
|
209
|
+
message: `図表 \`${n.id}\` の値 (\`datum\`) が 1 件だけで、 比べることも移り変わりを追うこともできない`,
|
|
210
|
+
suggestion: `値を 2 件以上にする (折れ線グラフは 3 件以上で傾きが読める)`,
|
|
173
211
|
autoFixable: false,
|
|
174
212
|
});
|
|
175
213
|
}
|
|
@@ -190,8 +228,8 @@ function ruleGanttUnknownDependsOn(d: CdlDiagram): LintIssue[] {
|
|
|
190
228
|
rule: "gantt-unknown-depends-on",
|
|
191
229
|
severity: "warn",
|
|
192
230
|
target: t.id,
|
|
193
|
-
message:
|
|
194
|
-
suggestion:
|
|
231
|
+
message: `作業 \`${t.id}\` の \`dependsOn\` が、 無い作業 \`${t.dependsOn}\` を指している`,
|
|
232
|
+
suggestion: `\`dependsOn\` を既にある作業の \`id\` に直すか、 \`dependsOn\` を外す`,
|
|
195
233
|
autoFixable: false,
|
|
196
234
|
});
|
|
197
235
|
}
|
|
@@ -225,8 +263,8 @@ function ruleMindMapParentReference(d: CdlDiagram): LintIssue[] {
|
|
|
225
263
|
rule: "mindmap-unknown-parent",
|
|
226
264
|
severity: "warn",
|
|
227
265
|
target: b.id,
|
|
228
|
-
message:
|
|
229
|
-
suggestion:
|
|
266
|
+
message: `枝 \`${b.id}\` の \`parent\` が、 無い枝 \`${b.parent}\` を指している`,
|
|
267
|
+
suggestion: `\`parent\` を中心 (\`${n.mindData.rootId}\`) か、 既にある枝の \`id\` に直す`,
|
|
230
268
|
autoFixable: false,
|
|
231
269
|
});
|
|
232
270
|
}
|
|
@@ -247,8 +285,8 @@ function ruleTreeParentReference(d: CdlDiagram): LintIssue[] {
|
|
|
247
285
|
rule: "tree-unknown-parent",
|
|
248
286
|
severity: "warn",
|
|
249
287
|
target: t.id,
|
|
250
|
-
message:
|
|
251
|
-
suggestion:
|
|
288
|
+
message: `階層図の項目 \`${t.id}\` の \`parent\` が、 無い項目 \`${t.parent}\` を指している`,
|
|
289
|
+
suggestion: `\`parent\` を既にある項目の \`id\` に直すか、 \`parent\` を外して一番上の項目にする`,
|
|
252
290
|
autoFixable: false,
|
|
253
291
|
});
|
|
254
292
|
}
|
|
@@ -268,8 +306,8 @@ function ruleQuadrantMissingItems(d: CdlDiagram): LintIssue[] {
|
|
|
268
306
|
rule: "quadrant-empty",
|
|
269
307
|
severity: "warn",
|
|
270
308
|
target: n.id,
|
|
271
|
-
message:
|
|
272
|
-
suggestion:
|
|
309
|
+
message: `四象限図 \`${n.id}\` に項目 (\`item\`) が 1 件も無く、 軸だけが描かれる`,
|
|
310
|
+
suggestion: `\`.item({ id, title, quadrant })\` で項目を 1 件以上足す (\`quadrant\` は \`topLeft\` などの 4 区画から選ぶ)`,
|
|
273
311
|
autoFixable: false,
|
|
274
312
|
});
|
|
275
313
|
}
|
|
@@ -279,8 +317,8 @@ function ruleQuadrantMissingItems(d: CdlDiagram): LintIssue[] {
|
|
|
279
317
|
rule: "quadrant-single-quadrant",
|
|
280
318
|
severity: "info",
|
|
281
319
|
target: n.id,
|
|
282
|
-
message:
|
|
283
|
-
suggestion:
|
|
320
|
+
message: `四象限図 \`${n.id}\` の項目がすべて 1 つの区画に集まり、 4 つに分けた意味が薄い`,
|
|
321
|
+
suggestion: `項目を 2 つ以上の区画に分ける。 強みと弱みを並べる分析 (\`SWOT\`) や優先度を決める図は、 4 つの区画に散らして使う`,
|
|
284
322
|
autoFixable: false,
|
|
285
323
|
});
|
|
286
324
|
}
|
|
@@ -290,13 +328,13 @@ function ruleQuadrantMissingItems(d: CdlDiagram): LintIssue[] {
|
|
|
290
328
|
}
|
|
291
329
|
|
|
292
330
|
/**
|
|
293
|
-
*
|
|
331
|
+
* 段階の人数が減っていくことを見る。
|
|
294
332
|
*
|
|
295
333
|
* 人数の欄は `{名前}` を書ける (状態から取る形、 cdl の `render/payload-binding.ts` が解く)。
|
|
296
334
|
* その場合ここでは値が決まらないので、**数どうしの組だけを比べる** (#1194)。
|
|
297
335
|
*
|
|
298
336
|
* 素通しで比べると文字列の大小比較になり、`{trial}` が `{signup}` より大きいという理由で
|
|
299
|
-
* 発火する。
|
|
337
|
+
* 発火する。 実際にカタログの funnel を状態から取る形にした時、その偽発火が出た。
|
|
300
338
|
*/
|
|
301
339
|
function ruleFunnelMonotonicCount(d: CdlDiagram): LintIssue[] {
|
|
302
340
|
const out: LintIssue[] = [];
|
|
@@ -312,8 +350,8 @@ function ruleFunnelMonotonicCount(d: CdlDiagram): LintIssue[] {
|
|
|
312
350
|
rule: "funnel-increasing-count",
|
|
313
351
|
severity: "warn",
|
|
314
352
|
target: stages[i]!.id,
|
|
315
|
-
message:
|
|
316
|
-
suggestion:
|
|
353
|
+
message: `段階 \`${stages[i]!.id}\` の数 (${今}) が前の段階 (${前}) より多い。 絞り込み図は段階が進むほど数が減る`,
|
|
354
|
+
suggestion: `段階の順番を確かめる。 数が増える流れを示すなら、 折れ線グラフ (\`chart-line\`) などの別の図にする`,
|
|
317
355
|
autoFixable: false,
|
|
318
356
|
});
|
|
319
357
|
}
|
package/src/schemas/diagram.json
CHANGED
|
@@ -241,28 +241,6 @@
|
|
|
241
241
|
"type": "number",
|
|
242
242
|
"description": "箱の高さ。"
|
|
243
243
|
},
|
|
244
|
-
"nodes": {
|
|
245
|
-
"type": "object",
|
|
246
|
-
"description": "箱の中の要素ごとの位置と大きさ。 key は header / footer / s0 等の要素名。",
|
|
247
|
-
"additionalProperties": {
|
|
248
|
-
"type": "object",
|
|
249
|
-
"additionalProperties": false,
|
|
250
|
-
"properties": {
|
|
251
|
-
"posX": {
|
|
252
|
-
"type": "number"
|
|
253
|
-
},
|
|
254
|
-
"posY": {
|
|
255
|
-
"type": "number"
|
|
256
|
-
},
|
|
257
|
-
"posW": {
|
|
258
|
-
"type": "number"
|
|
259
|
-
},
|
|
260
|
-
"posH": {
|
|
261
|
-
"type": "number"
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
},
|
|
266
244
|
"scale": {
|
|
267
245
|
"type": "number",
|
|
268
246
|
"description": "parts の描画倍率。 kind に parts identifier を指定した時だけ使える。"
|
|
@@ -523,6 +501,10 @@
|
|
|
523
501
|
"type": "string",
|
|
524
502
|
"description": "ラベル下の補足"
|
|
525
503
|
},
|
|
504
|
+
"tailSub": {
|
|
505
|
+
"type": "string",
|
|
506
|
+
"description": "クラス図の出どころ側の多重度 (例 \"1\")。 sub が行き先の端の多重度。 クラス図でだけ効く"
|
|
507
|
+
},
|
|
526
508
|
"tone": {
|
|
527
509
|
"type": "string",
|
|
528
510
|
"enum": [
|
|
@@ -581,7 +563,7 @@
|
|
|
581
563
|
"many",
|
|
582
564
|
"zero-many"
|
|
583
565
|
],
|
|
584
|
-
"description": "着き先側の端の形。 端の形で関係の種類を示す = triangle (
|
|
566
|
+
"description": "着き先側の端の形。 端の形で関係の種類を示す = triangle (継承・実装) / diamond (集約・コンポジション) / open (関連・依存) / crow (多) / one / zero-one / many / zero-many (個数)。 書かなければ塗った三角になる。"
|
|
585
567
|
},
|
|
586
568
|
"tailHead": {
|
|
587
569
|
"type": "string",
|
|
@@ -658,6 +640,18 @@
|
|
|
658
640
|
"type": "boolean",
|
|
659
641
|
"description": "true で説明文を矢印の線の上に重ねる (分岐図の条件ラベル用)"
|
|
660
642
|
},
|
|
643
|
+
"fromPartNode": {
|
|
644
|
+
"type": "string",
|
|
645
|
+
"minLength": 1,
|
|
646
|
+
"pattern": "\\S",
|
|
647
|
+
"description": "from が部品の時、矢印を繋ぐ部品の中の要素の id。 要素を 1 つだけ持つ部品は書かなくてもその要素に繋ぐ。 要素を 2 つ以上持つ部品は書かないと矢印を外して知らせる"
|
|
648
|
+
},
|
|
649
|
+
"toPartNode": {
|
|
650
|
+
"type": "string",
|
|
651
|
+
"minLength": 1,
|
|
652
|
+
"pattern": "\\S",
|
|
653
|
+
"description": "to が部品の時、矢印を繋ぐ部品の中の要素の id。 要素を 1 つだけ持つ部品は書かなくてもその要素に繋ぐ。 要素を 2 つ以上持つ部品は書かないと矢印を外して知らせる"
|
|
654
|
+
},
|
|
661
655
|
"pos": {
|
|
662
656
|
"type": "object",
|
|
663
657
|
"additionalProperties": false,
|
|
@@ -780,9 +774,13 @@
|
|
|
780
774
|
"tree",
|
|
781
775
|
"gantt",
|
|
782
776
|
"funnel",
|
|
783
|
-
"slope"
|
|
777
|
+
"slope",
|
|
778
|
+
"gauge",
|
|
779
|
+
"radial",
|
|
780
|
+
"stacked",
|
|
781
|
+
"waffle"
|
|
784
782
|
],
|
|
785
|
-
"description": "この phase で起点から描くもの。 語は図種と揃える。 line / journey = 線が左端から右へ伸びる / bar = 棒が横軸から上へ伸びる / pie = 扇が 12 時から時計回りに開く / mind = 枝が中心から外へ伸びる / tree = 枝が根から下へ伸びる / gantt = 帯が各始端から右へ伸びる / funnel = 段が上端から順に積まれる / slope = 線が左の軸から右の軸へ伸びる"
|
|
783
|
+
"description": "この phase で起点から描くもの。 語は図種と揃える。 line / journey = 線が左端から右へ伸びる / bar = 棒が横軸から上へ伸びる / pie = 扇が 12 時から時計回りに開く / mind = 枝が中心から外へ伸びる / tree = 枝が根から下へ伸びる / gantt = 帯が各始端から右へ伸びる / funnel = 段が上端から順に積まれる / slope = 線が左の軸から右の軸へ伸びる / gauge = 弧が 9 時から上を通って 3 時へ伸びる / radial = 各輪が 12 時から時計回りに開く / stacked = 帯が左端から右へ伸びる / waffle = 印が左上から読む向きに 1 個ずつ埋まる"
|
|
786
784
|
},
|
|
787
785
|
"drawRatio": {
|
|
788
786
|
"type": "number",
|
|
@@ -2017,10 +2015,43 @@
|
|
|
2017
2015
|
"min": {
|
|
2018
2016
|
"type": "number"
|
|
2019
2017
|
},
|
|
2018
|
+
"offLabel": {
|
|
2019
|
+
"type": "string",
|
|
2020
|
+
"minLength": 1,
|
|
2021
|
+
"description": "切り替え (toggle) が切の時に、箱の字の差し込みへ描く名前。 省略すると false を描く。"
|
|
2022
|
+
},
|
|
2023
|
+
"onLabel": {
|
|
2024
|
+
"type": "string",
|
|
2025
|
+
"minLength": 1,
|
|
2026
|
+
"description": "切り替え (toggle) が入の時に、箱の字の差し込みへ描く名前。 省略すると true を描く。"
|
|
2027
|
+
},
|
|
2020
2028
|
"options": {
|
|
2021
2029
|
"type": "array",
|
|
2030
|
+
"description": "選択肢。 文字列は値と名前を兼ね、{ value, label } の組は value を値にして label を操作部の選択肢と箱の字の差し込みに描く。 2 つを混ぜて書ける。",
|
|
2022
2031
|
"items": {
|
|
2023
|
-
"
|
|
2032
|
+
"oneOf": [
|
|
2033
|
+
{
|
|
2034
|
+
"type": "string"
|
|
2035
|
+
},
|
|
2036
|
+
{
|
|
2037
|
+
"type": "object",
|
|
2038
|
+
"additionalProperties": false,
|
|
2039
|
+
"required": [
|
|
2040
|
+
"value",
|
|
2041
|
+
"label"
|
|
2042
|
+
],
|
|
2043
|
+
"properties": {
|
|
2044
|
+
"value": {
|
|
2045
|
+
"type": "string",
|
|
2046
|
+
"minLength": 1
|
|
2047
|
+
},
|
|
2048
|
+
"label": {
|
|
2049
|
+
"type": "string",
|
|
2050
|
+
"minLength": 1
|
|
2051
|
+
}
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
]
|
|
2024
2055
|
}
|
|
2025
2056
|
},
|
|
2026
2057
|
"placeholder": {
|
|
@@ -2194,11 +2225,34 @@
|
|
|
2194
2225
|
},
|
|
2195
2226
|
"formulas": {
|
|
2196
2227
|
"type": "object",
|
|
2197
|
-
"description": "つまみの値から決まる値。 名前を鍵、式を値に書く。 `values` とは経路が別で、式は名前を中括弧で囲わない (例 \"input * 2\")。",
|
|
2228
|
+
"description": "つまみの値から決まる値。 名前を鍵、式を値に書く。 `values` とは経路が別で、式は名前を中括弧で囲わない (例 \"input * 2\")。 操作部に出す名札を付ける時は { \"expression\": \"input * 2\", \"label\": \"2 倍\" } の組で書く。",
|
|
2198
2229
|
"additionalProperties": {
|
|
2199
|
-
"
|
|
2200
|
-
|
|
2201
|
-
|
|
2230
|
+
"oneOf": [
|
|
2231
|
+
{
|
|
2232
|
+
"type": "string",
|
|
2233
|
+
"minLength": 1,
|
|
2234
|
+
"pattern": "\\S"
|
|
2235
|
+
},
|
|
2236
|
+
{
|
|
2237
|
+
"type": "object",
|
|
2238
|
+
"additionalProperties": false,
|
|
2239
|
+
"required": ["expression"],
|
|
2240
|
+
"properties": {
|
|
2241
|
+
"expression": {
|
|
2242
|
+
"type": "string",
|
|
2243
|
+
"minLength": 1,
|
|
2244
|
+
"pattern": "\\S",
|
|
2245
|
+
"description": "式 (例 \"input * 2\")"
|
|
2246
|
+
},
|
|
2247
|
+
"label": {
|
|
2248
|
+
"type": "string",
|
|
2249
|
+
"minLength": 1,
|
|
2250
|
+
"pattern": "\\S",
|
|
2251
|
+
"description": "操作部に式の名前として出す名札。 書かなければ名前をそのまま出す"
|
|
2252
|
+
}
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
]
|
|
2202
2256
|
},
|
|
2203
2257
|
"propertyNames": {
|
|
2204
2258
|
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
|
|
@@ -2228,6 +2282,14 @@
|
|
|
2228
2282
|
],
|
|
2229
2283
|
"description": "矢印をいつ出すか。 phase (既定) = 段が名指しする矢印はその段が来るまで描かない。 all = 段に関わらず最初から全部描く。"
|
|
2230
2284
|
},
|
|
2285
|
+
"relations": {
|
|
2286
|
+
"type": "string",
|
|
2287
|
+
"enum": [
|
|
2288
|
+
"off",
|
|
2289
|
+
"hover"
|
|
2290
|
+
],
|
|
2291
|
+
"description": "箱に触れると関係する線だけを光らせるか。 off (既定) = 何もしない。 hover = 箱に触れた時にその箱と繋がる線と相手の箱だけが光り、他が沈む。 順番を持たないクラス図と ER 図で使う。"
|
|
2292
|
+
},
|
|
2231
2293
|
"bands": {
|
|
2232
2294
|
"type": "array",
|
|
2233
2295
|
"description": "順序図で面が動いている間の帯。 書かなければ面ごとに「最初に関わった段から最後まで」 の 1 本になる。",
|