Skip to content

Commit

Permalink
Chore: Adding a D2 diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
joshleaves committed Apr 2, 2024
1 parent 1d5cbcb commit 495319a
Show file tree
Hide file tree
Showing 3 changed files with 229 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Of note:
## [2017.21.1]
### Added
- Solved [exercice for 2017, day 21](src/year_2017/21.rs).
- Trying my hand at [D2](https://d2lang.com/) to describe how the code parts interact together.

## [2017.20.1]
### Added
Expand Down
64 changes: 64 additions & 0 deletions diagram.d2
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
vars: {
d2-config: {
layout-engine: elk
# Terminal theme code
theme-id: 300
}
}

user: {
shape: person
width: 130
}

developer: {
shape: person
width: 130
}

project: {
test: {
sample test
input test
cli test
}
benches: {
year
day
}

binary: {
advent-rs: {shape: hexagon}
}

library: {
solve(): {
shape: stored_data
style.multiple: true
}

individual year

solve() -> individual year: 2015
solve() -> individual year: 2016
solve() -> individual year: 2016

individual day

individual year -> individual day
}
}

user -> project.library: use crate {
style.stroke-dash: 3
}
user -> project.binary.advent-rs: command line
developer -> project.test: test exercises
developer -> project.benches: run benchmark

project.binary.advent-rs -> project.library.solve()
project.test.cli test -> project.binary.advent-rs
project.test.input test -> project.library.individual year
project.test.sample test -> project.library.individual day
project.benches.year -> project.library.individual year
project.benches.day -> project.library.individual day
Loading

0 comments on commit 495319a

Please sign in to comment.