diff --git a/Makefile b/Makefile index a300c50..1a2dec3 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index a31d666..f4f3741 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/assets/project.d2 b/assets/project.d2 new file mode 100644 index 0000000..b07f0a7 --- /dev/null +++ b/assets/project.d2 @@ -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 +} diff --git a/assets/project.svg b/assets/project.svg new file mode 100644 index 0000000..8b9d7e6 --- /dev/null +++ b/assets/project.svg @@ -0,0 +1,43 @@ + +ProjectPendingActiveCompletedArchived + + +Activate + + +Archive + + +Complete + + +Restore \ No newline at end of file diff --git a/examples/README.md b/examples/README.md index deb4263..6a2484b 100644 --- a/examples/README.md +++ b/examples/README.md @@ -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 +```