update outdated readme example

This commit is contained in:
Alexander Wang 2024-03-25 09:37:54 -07:00
parent 7d84b7c1b9
commit 318f8df3ef
No known key found for this signature in database
GPG key ID: BE3937D0D52D8927
2 changed files with 260 additions and 19 deletions

View file

@ -46,34 +46,61 @@ https://user-images.githubusercontent.com/3120367/206125010-bd1fea8e-248a-43e7-8
## What does D2 look like? ## What does D2 look like?
```d2 ```d2
# Actors vars: {
hans: Hans Niemann d2-config: {
layout-engine: elk
defendants: { # Terminal theme code
mc: Magnus Carlsen theme-id: 300
playmagnus: Play Magnus Group }
chesscom: Chess.com }
naka: Hikaru Nakamura network: {
cell tower: {
mc -> playmagnus: Owns majority satellites: {
playmagnus <-> chesscom: Merger talks shape: stored_data
chesscom -> naka: Sponsoring style.multiple: true
} }
# Accusations transmitter
hans -> defendants: 'sueing for $100M'
# Claim satellites -> transmitter: send
defendants.naka -> hans: Accused of cheating on his stream satellites -> transmitter: send
defendants.mc -> hans: Lost then withdrew with accusations satellites -> transmitter: send
defendants.chesscom -> hans: 72 page report of cheating }
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
``` ```
> There is syntax highlighting with the editor plugins linked below. > There is syntax highlighting with the editor plugins linked below.
<img src="./docs/assets/syntax.png" alt="D2 render example" /> <img src="./docs/assets/example.svg" alt="D2 render example" />
> Rendered with the TALA layout engine.
> For more examples, see [./docs/examples](./docs/examples). > For more examples, see [./docs/examples](./docs/examples).

214
docs/assets/example.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 280 KiB