@cardenelabs/dragon 0.42.2 → 0.43.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 +34 -1
- package/dist/cli.cjs +1723 -493
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1723 -493
- package/dist/cli.js.map +1 -1
- package/dist/export.cjs +1636 -498
- package/dist/export.cjs.map +1 -1
- package/dist/export.d.cts +1 -1
- package/dist/export.d.ts +1 -1
- package/dist/export.js +1636 -498
- package/dist/export.js.map +1 -1
- package/dist/index.cjs +1651 -417
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +66 -3
- package/dist/index.d.ts +66 -3
- package/dist/index.js +1651 -417
- package/dist/index.js.map +1 -1
- package/dist/{ink-B8EZL7JV.d.cts → ink-B6s_SMXG.d.cts} +23 -3
- package/dist/{ink-B8EZL7JV.d.ts → ink-B6s_SMXG.d.ts} +23 -3
- package/dist/node.cjs +1102 -475
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +1102 -475
- package/dist/node.js.map +1 -1
- package/dist/player.global.js +3 -2
- package/package.json +1 -1
- package/src/index.ts +4 -1
- package/src/layout/tree.ts +458 -0
- package/src/look/values.ts +42 -0
- package/src/messages.ts +34 -2
- package/src/parser.ts +89 -1
- package/src/printer.ts +6 -1
- package/src/render/icons.ts +2 -0
- package/src/render/svg.ts +41 -3
- package/src/render/tree.ts +164 -0
- package/src/schema.ts +27 -3
- package/src/schemas/diagram.schema.json +79 -14
- package/src/schemas/validate-diagram.js +1 -1
- package/src/timeline.ts +2 -2
- package/src/words.ts +12 -2
package/README.md
CHANGED
|
@@ -77,7 +77,7 @@ mountDiagram(host, parsed.diagram, {
|
|
|
77
77
|
3. 空白を含む名前と文は、行末か `[` の前に置く。`,` か `]` を含む値と、`[` を含む名前だけを `"` で囲む
|
|
78
78
|
4. 入れ子は `group … end` だけ。段は次の `step` までで、字下げは読みやすさのために付ける。`say` の続きの行だけは `say` より深く字下げする
|
|
79
79
|
|
|
80
|
-
行の頭の語は `sequence` `architecture` `state` `git` `time` `group` `end` `box` `branch` `scale` `period` `row` `point` `zoom` `strip` `step` `say` `code` `source` `commit` `mark` `span` `act` `note` `set` で、線の行は `名札 -> 名札` と書く。
|
|
80
|
+
行の頭の語は `sequence` `architecture` `state` `git` `time` `tree` `group` `end` `box` `branch` `scale` `period` `row` `point` `zoom` `strip` `step` `say` `code` `source` `commit` `mark` `span` `leaf` `node` `act` `note` `set` で、線の行は `名札 -> 名札` と書く。
|
|
81
81
|
箱の行の属性 `link` に飛び先を書くと、描いた図でその箱が飛び先への link になる。
|
|
82
82
|
段の中の `source <名前> [url: <URL>]` の行は段の出典になり、1 つの段に何行でも書け、読み上げの段の一覧に名前の link で出る。
|
|
83
83
|
飛び先と出典の URL には、`/` で始まる path か、`http://` か `https://` で始まる URL だけを書ける。
|
|
@@ -225,6 +225,39 @@ step C0 が確定する
|
|
|
225
225
|
span 0-31: 確定して戻せない [shape: box, color: rose]
|
|
226
226
|
```
|
|
227
227
|
|
|
228
|
+
### 木の図
|
|
229
|
+
|
|
230
|
+
`tree` で始めると、葉の値を親へ畳み上げて1つの根にまとめる構造を段ごとに追う木の図になる。段の中の `leaf <名札> [hash: <値>]` で葉を、`node <名札> of <子>, <子> [hash: <値>]` で親を書くと、書いた段で箱が現れる。
|
|
231
|
+
葉は書いた順に左から並び、親は子の真ん中の上に置かれ、どの親にも組まれなかった箱が根になる。
|
|
232
|
+
親子の箱どうしの線の運ぶ物は木の線の上を走り、通った木の線はその色で残る。木の線を運ぶ物が通った段から後は、運ぶ物を送るか受けた箱だけを濃く出す。
|
|
233
|
+
|
|
234
|
+
```dragon
|
|
235
|
+
tree 取引が含まれることを確かめる
|
|
236
|
+
|
|
237
|
+
step 取引ごとに値を出す
|
|
238
|
+
say 4件の取引それぞれから値を出す。この値が木の葉になる。
|
|
239
|
+
leaf 取引1 [hash: 3fa0]
|
|
240
|
+
leaf 取引2 [hash: 8b04]
|
|
241
|
+
leaf 取引3 [hash: c41d]
|
|
242
|
+
leaf 取引4 [hash: e5f8]
|
|
243
|
+
|
|
244
|
+
step 2つずつ組む
|
|
245
|
+
say 隣どうしの値を2つずつつないで、もう1度値を出す。親が2つできる。
|
|
246
|
+
node 1と2 of 取引1, 取引2 [hash: 7a21]
|
|
247
|
+
node 3と4 of 取引3, 取引4 [hash: b9e4]
|
|
248
|
+
|
|
249
|
+
step 根ができる
|
|
250
|
+
say 残った2つを組むと、全ての取引の値をまとめた根が1つできる。
|
|
251
|
+
node 根 of 1と2, 3と4 [hash: e71c]
|
|
252
|
+
|
|
253
|
+
step 取引3から根まで上る
|
|
254
|
+
say 隣の値を受け取りながら親へ上る。取引1と取引2を読まなくても、根の値が出る。
|
|
255
|
+
取引3 -> 3と4 [tag: c41d]
|
|
256
|
+
取引4 -> 3と4 [tag: e5f8]
|
|
257
|
+
3と4 -> 根 [tag: b9e4]
|
|
258
|
+
1と2 -> 根 [tag: 7a21]
|
|
259
|
+
```
|
|
260
|
+
|
|
228
261
|
## 書き出し
|
|
229
262
|
|
|
230
263
|
書き出しは画面なしの Chromium で、頁と同じ描画を時刻を止めて 1 コマずつ撮る。
|