From 318f8df3ef072f08f4e56002fe636396b3e928d0 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Mon, 25 Mar 2024 09:37:54 -0700 Subject: [PATCH] update outdated readme example --- README.md | 65 ++++++++---- docs/assets/example.svg | 214 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 260 insertions(+), 19 deletions(-) create mode 100644 docs/assets/example.svg diff --git a/README.md b/README.md index ebf199e30..1ab3e40d9 100644 --- a/README.md +++ b/README.md @@ -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 +vars: { + d2-config: { + layout-engine: elk + # Terminal theme code + theme-id: 300 + } +} +network: { + cell tower: { + satellites: { + shape: stored_data + style.multiple: true + } -defendants: { - mc: Magnus Carlsen - playmagnus: Play Magnus Group - chesscom: Chess.com - naka: Hikaru Nakamura + transmitter - mc -> playmagnus: Owns majority - playmagnus <-> chesscom: Merger talks - chesscom -> naka: Sponsoring + 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 } -# Accusations -hans -> defendants: 'sueing for $100M' +user: { + shape: person + width: 130 +} -# 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 +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. -D2 render example - -> Rendered with the TALA layout engine. +D2 render example > For more examples, see [./docs/examples](./docs/examples). diff --git a/docs/assets/example.svg b/docs/assets/example.svg new file mode 100644 index 000000000..1e0fd8c9e --- /dev/null +++ b/docs/assets/example.svg @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +NETWORKUSERAPI SERVERLOGSCELL TOWERONLINE PORTALDATA PROCESSORSATELLITESTRANSMITTERUISTORAGE SENDSENDSENDPHONE LOGSMAKE CALL ACCESSDISPLAYPERSIST + + + + + + + + + +