Skip to content

Commit

Permalink
update outdated readme example
Browse files Browse the repository at this point in the history
  • Loading branch information
alixander committed Mar 25, 2024
1 parent 7d84b7c commit 318f8df
Show file tree
Hide file tree
Showing 2 changed files with 262 additions and 21 deletions.
69 changes: 48 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,34 +46,61 @@ https://user-images.githubusercontent.com/3120367/206125010-bd1fea8e-248a-43e7-8
## What does D2 look like?

```d2
# Actors
hans: Hans Niemann
defendants: {
mc: Magnus Carlsen
playmagnus: Play Magnus Group
chesscom: Chess.com
naka: Hikaru Nakamura
mc -> playmagnus: Owns majority
playmagnus <-> chesscom: Merger talks
chesscom -> naka: Sponsoring
vars: {
d2-config: {
layout-engine: elk
# Terminal theme code
theme-id: 300
}
}
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
}
# Accusations
hans -> defendants: 'sueing for $100M'
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}
# Claim
defendants.naka -> hans: Accused of cheating on his stream
defendants.mc -> hans: Lost then withdrew with accusations
defendants.chesscom -> hans: 72 page report of cheating
network.data processor -> api server
```

> There is syntax highlighting with the editor plugins linked below.
<img src="./docs/assets/syntax.png" alt="D2 render example" />

> Rendered with the TALA layout engine.
<img src="./docs/assets/example.svg" alt="D2 render example" />

> For more examples, see [./docs/examples](./docs/examples).
Expand Down
214 changes: 214 additions & 0 deletions docs/assets/example.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 318f8df

Please sign in to comment.