autogenerated sublibrary diagram (#1720)

Towards #1689

![sublibrary-graph](https://github.com/swarm-game/swarm/assets/261693/b300fb0d-be59-4fc9-a042-04ceaf4909b2)
This commit is contained in:
Karl Ostmo 2024-01-08 12:16:00 -08:00 committed by GitHub
parent a388af6155
commit a94ab9d97c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 100 additions and 2 deletions

View File

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.43.0 (0)
-->
<!-- Title: plan Pages: 1 -->
<svg width="254pt" height="264pt"
viewBox="0.00 0.00 254.00 264.02" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 260.02)">
<title>plan</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-260.02 250,-260.02 250,4 -4,4"/>
<!-- swarm&#45;0.5.0.0:exe:swarm -->
<g id="node1" class="node">
<title>swarm&#45;0.5.0.0:exe:swarm</title>
<path fill="none" stroke="brown" stroke-width="2" d="M211,-36C211,-36 35,-36 35,-36 29,-36 23,-30 23,-24 23,-24 23,-12 23,-12 23,-6 29,0 35,0 35,0 211,0 211,0 217,0 223,-6 223,-12 223,-12 223,-24 223,-24 223,-30 217,-36 211,-36"/>
<text text-anchor="middle" x="123" y="-14.3" font-family="Times,serif" font-size="14.00">swarm&#45;0.5.0.0:exe:swarm</text>
</g>
<!-- swarm&#45;0.5.0.0:lib:swarm&#45;web -->
<g id="node2" class="node">
<title>swarm&#45;0.5.0.0:lib:swarm&#45;web</title>
<path fill="none" stroke="gray" stroke-width="2" d="M224.5,-80C224.5,-80 21.5,-80 21.5,-80 15.5,-80 9.5,-74 9.5,-68 9.5,-68 9.5,-56 9.5,-56 9.5,-50 15.5,-44 21.5,-44 21.5,-44 224.5,-44 224.5,-44 230.5,-44 236.5,-50 236.5,-56 236.5,-56 236.5,-68 236.5,-68 236.5,-74 230.5,-80 224.5,-80"/>
<text text-anchor="middle" x="123" y="-58.3" font-family="Times,serif" font-size="14.00">swarm&#45;0.5.0.0:lib:swarm&#45;web</text>
</g>
<!-- swarm&#45;0.5.0.0:exe:swarm&#45;&gt;swarm&#45;0.5.0.0:lib:swarm&#45;web -->
<g id="edge1" class="edge">
<title>swarm&#45;0.5.0.0:exe:swarm&#45;&gt;swarm&#45;0.5.0.0:lib:swarm&#45;web</title>
<path fill="none" stroke="brown" d="M123,-36.15C123,-36.31 123,-36.47 123,-36.63"/>
<polygon fill="brown" stroke="brown" points="119.5,-33.89 123,-43.89 126.5,-33.89 119.5,-33.89"/>
</g>
<!-- swarm&#45;0.5.0.0 -->
<g id="node3" class="node">
<title>swarm&#45;0.5.0.0</title>
<path fill="none" stroke="blue" stroke-width="2" d="M170.5,-124.01C170.5,-124.01 75.5,-124.01 75.5,-124.01 69.5,-124.01 63.5,-118.01 63.5,-112.01 63.5,-112.01 63.5,-100.01 63.5,-100.01 63.5,-94.01 69.5,-88.01 75.5,-88.01 75.5,-88.01 170.5,-88.01 170.5,-88.01 176.5,-88.01 182.5,-94.01 182.5,-100.01 182.5,-100.01 182.5,-112.01 182.5,-112.01 182.5,-118.01 176.5,-124.01 170.5,-124.01"/>
<text text-anchor="middle" x="123" y="-102.31" font-family="Times,serif" font-size="14.00">swarm&#45;0.5.0.0</text>
</g>
<!-- swarm&#45;0.5.0.0:lib:swarm&#45;web&#45;&gt;swarm&#45;0.5.0.0 -->
<g id="edge2" class="edge">
<title>swarm&#45;0.5.0.0:lib:swarm&#45;web&#45;&gt;swarm&#45;0.5.0.0</title>
<path fill="none" stroke="gray" d="M123,-80.16C123,-80.32 123,-80.48 123,-80.64"/>
<polygon fill="gray" stroke="gray" points="119.5,-77.9 123,-87.9 126.5,-77.9 119.5,-77.9"/>
</g>
<!-- swarm&#45;0.5.0.0:lib:swarm&#45;engine -->
<g id="node4" class="node">
<title>swarm&#45;0.5.0.0:lib:swarm&#45;engine</title>
<path fill="none" stroke="gray" stroke-width="2" d="M234,-168.01C234,-168.01 12,-168.01 12,-168.01 6,-168.01 0,-162.01 0,-156.01 0,-156.01 0,-144.01 0,-144.01 0,-138.01 6,-132.01 12,-132.01 12,-132.01 234,-132.01 234,-132.01 240,-132.01 246,-138.01 246,-144.01 246,-144.01 246,-156.01 246,-156.01 246,-162.01 240,-168.01 234,-168.01"/>
<text text-anchor="middle" x="123" y="-146.31" font-family="Times,serif" font-size="14.00">swarm&#45;0.5.0.0:lib:swarm&#45;engine</text>
</g>
<!-- swarm&#45;0.5.0.0&#45;&gt;swarm&#45;0.5.0.0:lib:swarm&#45;engine -->
<g id="edge3" class="edge">
<title>swarm&#45;0.5.0.0&#45;&gt;swarm&#45;0.5.0.0:lib:swarm&#45;engine</title>
<path fill="none" stroke="blue" d="M123,-124.16C123,-124.32 123,-124.48 123,-124.64"/>
<polygon fill="blue" stroke="blue" points="119.5,-121.9 123,-131.9 126.5,-121.9 119.5,-121.9"/>
</g>
<!-- swarm&#45;0.5.0.0:lib:swarm&#45;lang -->
<g id="node5" class="node">
<title>swarm&#45;0.5.0.0:lib:swarm&#45;lang</title>
<path fill="none" stroke="gray" stroke-width="2" d="M225.5,-212.02C225.5,-212.02 20.5,-212.02 20.5,-212.02 14.5,-212.02 8.5,-206.02 8.5,-200.02 8.5,-200.02 8.5,-188.02 8.5,-188.02 8.5,-182.02 14.5,-176.02 20.5,-176.02 20.5,-176.02 225.5,-176.02 225.5,-176.02 231.5,-176.02 237.5,-182.02 237.5,-188.02 237.5,-188.02 237.5,-200.02 237.5,-200.02 237.5,-206.02 231.5,-212.02 225.5,-212.02"/>
<text text-anchor="middle" x="123" y="-190.32" font-family="Times,serif" font-size="14.00">swarm&#45;0.5.0.0:lib:swarm&#45;lang</text>
</g>
<!-- swarm&#45;0.5.0.0:lib:swarm&#45;engine&#45;&gt;swarm&#45;0.5.0.0:lib:swarm&#45;lang -->
<g id="edge4" class="edge">
<title>swarm&#45;0.5.0.0:lib:swarm&#45;engine&#45;&gt;swarm&#45;0.5.0.0:lib:swarm&#45;lang</title>
<path fill="none" stroke="gray" d="M123,-168.17C123,-168.33 123,-168.49 123,-168.65"/>
<polygon fill="gray" stroke="gray" points="119.5,-165.91 123,-175.91 126.5,-165.91 119.5,-165.91"/>
</g>
<!-- swarm&#45;0.5.0.0:lib:swarm&#45;util -->
<g id="node6" class="node">
<title>swarm&#45;0.5.0.0:lib:swarm&#45;util</title>
<path fill="none" stroke="gray" stroke-width="2" d="M222,-256.02C222,-256.02 24,-256.02 24,-256.02 18,-256.02 12,-250.02 12,-244.02 12,-244.02 12,-232.02 12,-232.02 12,-226.02 18,-220.02 24,-220.02 24,-220.02 222,-220.02 222,-220.02 228,-220.02 234,-226.02 234,-232.02 234,-232.02 234,-244.02 234,-244.02 234,-250.02 228,-256.02 222,-256.02"/>
<text text-anchor="middle" x="123" y="-234.32" font-family="Times,serif" font-size="14.00">swarm&#45;0.5.0.0:lib:swarm&#45;util</text>
</g>
<!-- swarm&#45;0.5.0.0:lib:swarm&#45;lang&#45;&gt;swarm&#45;0.5.0.0:lib:swarm&#45;util -->
<g id="edge5" class="edge">
<title>swarm&#45;0.5.0.0:lib:swarm&#45;lang&#45;&gt;swarm&#45;0.5.0.0:lib:swarm&#45;util</title>
<path fill="none" stroke="gray" d="M123,-212.17C123,-212.33 123,-212.49 123,-212.65"/>
<polygon fill="gray" stroke="gray" points="119.5,-209.91 123,-219.91 126.5,-209.91 119.5,-209.91"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@ -0,0 +1,19 @@
#!/bin/bash -ex
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd $SCRIPT_DIR/..
# First, install cabal-plan:
#
# cabal install cabal-plan
# If the swarm.cabal file has changed, you may need to remove
# the 'plan.json' file from the cache and regenerate.
#
# Note that "rm -f dist-newstyle/cache/plan.json" is insufficient;
# we need remove the whole cache:
rm -r dist-newstyle/cache
cabal build
cabal-plan --hide-global --hide-builtin dot --tred --root swarm | twopi -Tsvg -o docs/image/sublibrary-graph.svg

View File

@ -22,8 +22,7 @@ description: Swarm is a 2D programming and resource gathering
* swarm TUI
* swarm app
To maintain this separation, inner layers should avoid introducing
dependencies on layers above them.
<<docs/image/sublibrary-graph.svg>>
license: BSD-3-Clause
license-file: LICENSE
@ -39,6 +38,7 @@ extra-source-files: CHANGELOG.md
editors/vscode/syntaxes/*.json
editors/vim/*.vim
editors/vim/*.lua
extra-doc-files: docs/image/sublibrary-graph.svg
data-dir: data/
data-files: *.yaml, worlds/*.world, scenarios/**/*.yaml, scenarios/**/*.txt, scenarios/**/*.sw, *.txt, test/language-snippets/**/*.sw