Skip to content

Commit 318f8df

Browse files
committed
update outdated readme example
1 parent 7d84b7c commit 318f8df

File tree

2 files changed

+262
-21
lines changed

2 files changed

+262
-21
lines changed

README.md

+48-21
Original file line numberDiff line numberDiff line change
@@ -46,34 +46,61 @@ https://user-images.githubusercontent.com/3120367/206125010-bd1fea8e-248a-43e7-8
4646
## What does D2 look like?
4747

4848
```d2
49-
# Actors
50-
hans: Hans Niemann
51-
52-
defendants: {
53-
mc: Magnus Carlsen
54-
playmagnus: Play Magnus Group
55-
chesscom: Chess.com
56-
naka: Hikaru Nakamura
57-
58-
mc -> playmagnus: Owns majority
59-
playmagnus <-> chesscom: Merger talks
60-
chesscom -> naka: Sponsoring
49+
vars: {
50+
d2-config: {
51+
layout-engine: elk
52+
# Terminal theme code
53+
theme-id: 300
54+
}
55+
}
56+
network: {
57+
cell tower: {
58+
satellites: {
59+
shape: stored_data
60+
style.multiple: true
61+
}
62+
63+
transmitter
64+
65+
satellites -> transmitter: send
66+
satellites -> transmitter: send
67+
satellites -> transmitter: send
68+
}
69+
70+
online portal: {
71+
ui: {shape: hexagon}
72+
}
73+
74+
data processor: {
75+
storage: {
76+
shape: cylinder
77+
style.multiple: true
78+
}
79+
}
80+
81+
cell tower.transmitter -> data processor.storage: phone logs
82+
}
83+
84+
user: {
85+
shape: person
86+
width: 130
6187
}
6288
63-
# Accusations
64-
hans -> defendants: 'sueing for $100M'
89+
user -> network.cell tower: make call
90+
user -> network.online portal.ui: access {
91+
style.stroke-dash: 3
92+
}
93+
94+
api server -> network.online portal.ui: display
95+
api server -> logs: persist
96+
logs: {shape: page; style.multiple: true}
6597
66-
# Claim
67-
defendants.naka -> hans: Accused of cheating on his stream
68-
defendants.mc -> hans: Lost then withdrew with accusations
69-
defendants.chesscom -> hans: 72 page report of cheating
98+
network.data processor -> api server
7099
```
71100

72101
> There is syntax highlighting with the editor plugins linked below.
73102
74-
<img src="./docs/assets/syntax.png" alt="D2 render example" />
75-
76-
> Rendered with the TALA layout engine.
103+
<img src="./docs/assets/example.svg" alt="D2 render example" />
77104

78105
> For more examples, see [./docs/examples](./docs/examples).
79106

docs/assets/example.svg

+214
Loading

0 commit comments

Comments
 (0)