doc: add project example to readme

This commit is contained in:
Dmitriy Pleshevskiy 2022-11-30 16:50:16 +03:00
parent 284a7a45e3
commit e36d9f8544
Signed by: pleshevskiy
GPG Key ID: 1B59187B161C0215
5 changed files with 82 additions and 2 deletions

View File

@ -5,7 +5,8 @@ NPM_PUB := npm publish
D2 := nix run git+https://git.pleshevski.ru/mynix/tools\\\#d2 --
DIAGRAMS := \
turnstile
turnstile \
project
turnstile_theme_args := --layout elk --theme 101

View File

@ -26,7 +26,7 @@ const sm = new StateMachineBuilder()
.build(locked);
```
You can find the full example in the [examples](./examples/) folder.
You can find more examples [here](./examples/README.md)
# Installation

26
assets/project.d2 Normal file
View File

@ -0,0 +1,26 @@
direction: right
Project: {
pen: Pending {
shape: circle
}
act: Active {
shape: circle
style.fill: "#9ae49a"
}
com: Completed {
shape: circle
style.fill: "#eaea7e"
}
arc: Archived {
shape: circle
style.fill: "#ff7e7e"
}
pen -> act: Activate
pen -> arc: Archive
act -> com: Complete
arc -> pen: Restore
}

43
assets/project.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 471 KiB

View File

@ -15,3 +15,13 @@ passes through, the arms are locked again until another coin is inserted.
```sh
deno run ./examples/turnstile.ts
```
## Project
This is more complex example illustrate all features of this library
![Project diagram](https://git.pleshevski.ru/pleshevskiy/it-fsm/raw/branch/main/assets/project.svg)
```sh
deno run ./examples/project.ts
```