save
This commit is contained in:
parent
7bd18b6081
commit
1d95ac4d4a
2 changed files with 140 additions and 100 deletions
|
|
@ -1,57 +1,61 @@
|
||||||
input: |d2
|
input: |d2
|
||||||
|
# D2 script
|
||||||
hello -> world
|
hello -> world
|
||||||
|
|
|
|
||||||
|
|
||||||
input -> compiler.parse
|
input -> compiler
|
||||||
|
|
||||||
compiler: {
|
compiler: {
|
||||||
parse -> AST
|
width: 300
|
||||||
AST: Abstract Syntax Tree {
|
height: 100
|
||||||
shape: oval
|
style: {
|
||||||
fill: honeydew
|
fill: "#7B90D2"
|
||||||
|
font-color: white
|
||||||
}
|
}
|
||||||
|
|
||||||
AST -> compile
|
|
||||||
}
|
}
|
||||||
|
|
||||||
compiler.compile -> graph
|
compiler -> graph
|
||||||
graph: Graph\n(shapes & connections) {
|
graph: Graph\n(shapes & connections) {
|
||||||
shape: oval
|
shape: oval
|
||||||
fill: honeydew
|
style.fill: "#A8D8B9"
|
||||||
}
|
}
|
||||||
|
|
||||||
graph -> Set Dimensions
|
configs -> graph mods
|
||||||
Set Dimensions -> Use ruler to measure all texts -> measured graph
|
|
||||||
Set Dimensions -> Use given, premeasured dimensions -> measured graph
|
|
||||||
|
|
||||||
measured graph: {
|
graph -> graph mods -> layout
|
||||||
shape: oval
|
|
||||||
fill: honeydew
|
|
||||||
}
|
|
||||||
|
|
||||||
measured graph -> layout engine -> positioned graph
|
|
||||||
|
|
||||||
positioned graph: {
|
# Set Dimensions -> Use ruler to measure all texts -> measured graph
|
||||||
shape: oval
|
# Set Dimensions -> Use given, premeasured dimensions -> measured graph
|
||||||
fill: honeydew
|
|
||||||
}
|
|
||||||
|
|
||||||
positioned graph -> exporter -> diagram
|
# measured graph: {
|
||||||
|
# shape: oval
|
||||||
diagram: finalized diagram (styled) {
|
# style.fill: honeydew
|
||||||
shape: oval
|
# }
|
||||||
fill: honeydew
|
#
|
||||||
}
|
# measured graph -> layout engine -> positioned graph
|
||||||
|
#
|
||||||
diagram -> render SVG
|
# positioned graph: {
|
||||||
|
# shape: oval
|
||||||
render SVG -> use sketch post processor: optional
|
# style.fill: honeydew
|
||||||
|
# }
|
||||||
use sketch post processor -> SVG bytes
|
#
|
||||||
|
# positioned graph -> exporter -> diagram
|
||||||
SVG bytes: {
|
#
|
||||||
shape: oval
|
# diagram: finalized diagram (styled) {
|
||||||
fill: honeydew
|
# shape: oval
|
||||||
}
|
# style.fill: honeydew
|
||||||
|
# }
|
||||||
SVG bytes -> screenshot for PNG: optional
|
#
|
||||||
|
# diagram -> render SVG
|
||||||
|
#
|
||||||
|
# render SVG -> use sketch post processor: optional
|
||||||
|
#
|
||||||
|
# use sketch post processor -> SVG bytes
|
||||||
|
#
|
||||||
|
# SVG bytes: {
|
||||||
|
# shape: oval
|
||||||
|
# style.fill: honeydew
|
||||||
|
# }
|
||||||
|
#
|
||||||
|
# SVG bytes -> screenshot for PNG: optional
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 982 KiB After Width: | Height: | Size: 242 KiB |
Loading…
Reference in a new issue