This commit is contained in:
Alexander Wang 2023-03-17 17:17:52 -07:00
parent 7bd18b6081
commit 1d95ac4d4a
No known key found for this signature in database
GPG key ID: D89FA31966BDBECE
2 changed files with 140 additions and 100 deletions

View file

@ -1,57 +1,61 @@
input: |d2
# D2 script
hello -> world
|
input -> compiler.parse
input -> compiler
compiler: {
parse -> AST
AST: Abstract Syntax Tree {
shape: oval
fill: honeydew
width: 300
height: 100
style: {
fill: "#7B90D2"
font-color: white
}
AST -> compile
}
compiler.compile -> graph
compiler -> graph
graph: Graph\n(shapes & connections) {
shape: oval
fill: honeydew
style.fill: "#A8D8B9"
}
graph -> Set Dimensions
Set Dimensions -> Use ruler to measure all texts -> measured graph
Set Dimensions -> Use given, premeasured dimensions -> measured graph
configs -> graph mods
measured graph: {
shape: oval
fill: honeydew
}
graph -> graph mods -> layout
measured graph -> layout engine -> positioned graph
positioned graph: {
shape: oval
fill: honeydew
}
# Set Dimensions -> Use ruler to measure all texts -> measured graph
# Set Dimensions -> Use given, premeasured dimensions -> measured graph
positioned graph -> exporter -> diagram
diagram: finalized diagram (styled) {
shape: oval
fill: honeydew
}
diagram -> render SVG
render SVG -> use sketch post processor: optional
use sketch post processor -> SVG bytes
SVG bytes: {
shape: oval
fill: honeydew
}
SVG bytes -> screenshot for PNG: optional
# measured graph: {
# shape: oval
# style.fill: honeydew
# }
#
# measured graph -> layout engine -> positioned graph
#
# positioned graph: {
# shape: oval
# style.fill: honeydew
# }
#
# positioned graph -> exporter -> diagram
#
# diagram: finalized diagram (styled) {
# shape: oval
# style.fill: honeydew
# }
#
# 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