rebase on master
This commit is contained in:
parent
2a0bd22451
commit
11b0ec79a3
3 changed files with 68 additions and 0 deletions
4
Makefile
4
Makefile
|
|
@ -24,3 +24,7 @@ race: fmt
|
||||||
.PHONY: js
|
.PHONY: js
|
||||||
js: gen
|
js: gen
|
||||||
cd d2js/js && NPM_VERSION="${NPM_VERSION}" prefix "$@" ./make.sh all
|
cd d2js/js && NPM_VERSION="${NPM_VERSION}" prefix "$@" ./make.sh all
|
||||||
|
|
||||||
|
.PHONY: themesdemo
|
||||||
|
themesdemo:
|
||||||
|
$(MAKE) -C ./testdata/examples/
|
||||||
|
|
|
||||||
14
testdata/examples/Makefile
vendored
Normal file
14
testdata/examples/Makefile
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
D2 := ../../d2
|
||||||
|
|
||||||
|
SVGS = $(shell $(D2) themes | gawk -F':' '/^-/{ printf "out/themex-%03d.svg ",$$2 }' || :)
|
||||||
|
|
||||||
|
.PHONY:
|
||||||
|
all: $(D2) $(SVGS)
|
||||||
|
|
||||||
|
$(D2):
|
||||||
|
cd $(dir $@) && go build
|
||||||
|
$(MAKE) $(SVGS)
|
||||||
|
# D2 as dependency to expire results if recompiled
|
||||||
|
out/themex-%.svg: themex.d2 $(D2)
|
||||||
|
$(info Building $@ from $< ...)
|
||||||
|
$(D2) -t $$(( 10#$* )) $< $@
|
||||||
50
testdata/examples/themex.d2
vendored
Normal file
50
testdata/examples/themex.d2
vendored
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
|
||||||
|
vars: {
|
||||||
|
d2-config: {
|
||||||
|
layout-engine: elk
|
||||||
|
}
|
||||||
|
}
|
||||||
|
network: {
|
||||||
|
cell tower: {
|
||||||
|
satellites: {
|
||||||
|
shape: stored_data
|
||||||
|
style.multiple: true
|
||||||
|
}
|
||||||
|
|
||||||
|
transmitter
|
||||||
|
|
||||||
|
satellites -> transmitter: send
|
||||||
|
satellites -> transmitter: send
|
||||||
|
satellites -> transmitter: send
|
||||||
|
}
|
||||||
|
|
||||||
|
online portal: {
|
||||||
|
ui: {shape: hexagon}
|
||||||
|
}
|
||||||
|
|
||||||
|
data processor: {
|
||||||
|
storage: {
|
||||||
|
shape: cylinder
|
||||||
|
style.multiple: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cell tower.transmitter -> data processor.storage: phone logs
|
||||||
|
}
|
||||||
|
|
||||||
|
user: {
|
||||||
|
shape: person
|
||||||
|
width: 130
|
||||||
|
}
|
||||||
|
|
||||||
|
user -> network.cell tower: make call
|
||||||
|
user -> network.online portal.ui: access {
|
||||||
|
style.stroke-dash: 3
|
||||||
|
}
|
||||||
|
|
||||||
|
api server -> network.online portal.ui: display
|
||||||
|
api server -> logs: persist
|
||||||
|
logs: {shape: page; style.multiple: true}
|
||||||
|
|
||||||
|
network.data processor -> api server
|
||||||
|
|
||||||
Loading…
Reference in a new issue