What does D2 appear like?
hans: Hans Niemann
mc: Magnus Carlsen
playmagnus: Play Magnus Group
naka: Hikaru Nakamura
mc -> playmagnus: Owns majority
playmagnus <-> chesscom: Merger talks
chesscom -> naka: Sponsoring
hans -> defendants: 'sueing for $100M'
defendants.naka -> hans: Accused of dishonest on his stream
defendants.mc -> hans: Misplaced then withdrew with accusations
defendants.chesscom -> hans: 72 web page report of dishonest
There may be syntax highlighting with the editor plugins linked under.
Rendered with the TALA format engine.
For extra examples, see ./docs/examples.
Probably the most handy means to make use of D2 is to simply run it as a CLI executable to supply SVGs from
# First, set up D2 curl -fsSL https://d2lang.com/set up.sh | sh -s -- echo 'x -> y -> z' > in.d2 d2 --watch in.d2 out.svg
A browser window will open with
out.svg and live-reload on modifications to
The best strategy to set up is with our set up script:
curl -fsSL https://d2lang.com/set up.sh | sh -s --
You possibly can run the set up script with
--dry-run to see the instructions that will probably be used to put in with out executing them.
Or when you’ve got Go put in you may set up from supply although you gained’t get the manpage:
go set up oss.terrastruct.com/[email protected]
You can even set up a launch from supply which can embrace manpages. See ./docs/INSTALL.md#source-release.
To uninstall with the set up script:
curl -fsSL https://d2lang.com/set up.sh | sh -s -- --uninstall
For detailed set up docs, see ./docs/INSTALL.md. We exhibit various strategies and examples for every OS.
As effectively, the functioning of the set up script is described intimately to alleviate any concern of its use. We suggest utilizing your OS’s package deal supervisor immediately as a substitute for improved safety however the set up script is in no way insecure.
Along with being a runnable CLI device, D2 may also be used to supply diagrams from Go packages.
D2 consists of a wide range of official themes to fashion your diagrams fantastically proper out of the field. See ./d2themes to browse the out there themes and make or contribute your personal creation.