# Fantastic dependency graph vizualizer and writeup

**URL:** <https://discourse.haskell.org/t/fantastic-dependency-graph-vizualizer-and-writeup/13379>\
**Category:** Uncategorized\
**Created:** [December 8, 2025, 11:36pm UTC](https://discourse.haskell.org/t/fantastic-dependency-graph-vizualizer-and-writeup/13379 "2025-12-08T23:36:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sclv](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/sclv/32/71_2.png) [@sclv](https://discourse.haskell.org/u/sclv)\
**Post date:** [December 8, 2025, 11:36pm UTC](https://discourse.haskell.org/t/fantastic-dependency-graph-vizualizer-and-writeup/13379/1 "2025-12-08T23:36:24Z")

</div>

Someone took the famous xkcd comic about dependency trees, hit it with some computer science and created a great toy. Would love someone with free time to extend the tool to run on hackage packages as well!

> **[Stacktower: An Accidental Deep Dive](https://stacktower.io/)**
>
> How an XKCD comic led to teaching myself graph theory — a journey through NP-hard problems, PQ-trees, and layered graph algorithms.

---

<div class="post-metadata">

**Author:** ![Ambrose](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/ambrose/32/5672_2.png) [@Ambrose](https://discourse.haskell.org/u/Ambrose)\
**Post date:** [December 9, 2025, 6:47am UTC](https://discourse.haskell.org/t/fantastic-dependency-graph-vizualizer-and-writeup/13379/2 "2025-12-09T06:47:02Z")

</div>

Does it create SVGs? I suspect some codebases might need it…

---

<div class="post-metadata">

**Author:** ![aspiwack](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/aspiwack/32/2240_2.png) [@aspiwack](https://discourse.haskell.org/u/aspiwack)\
**Post date:** [December 12, 2025, 9:27am UTC](https://discourse.haskell.org/t/fantastic-dependency-graph-vizualizer-and-writeup/13379/3 "2025-12-12T09:27:28Z")

</div>

It does create SVGs. That being said, dependencies in my projects are too messy for the renderer. They have non-planar crossing that the renderer doesn’t manage to eliminate. The graphs I tried all look pretty blocky too, which isn’t that insightful.

For the record, to generate a dependency graph with Stack I’ve come up with the following

```bash
$ stack dot --external > deps.dot # you can remove some packages with e.g. --prune "package1,package2"
$ dot -Tdot_json deps.dot > deps.json
$ cat deps.json | jq '(.objects | map({(._gvid|tostring): .name}) | add) as $objects | {nodes: .objects | map(select(.["name"] != "%1")) | map({id:.name}), edges: .edges | map({from: $objects[.tail|tostring], to: $objects[.head|tostring]})}' > deps-stacked.json
$ stacktower render deps-stacked.json -t tower --style handdrawn --merge -o deps.svg

```

This won’t have all the metadata that native parsers have, just the packages. But you can play with it that way 🙂 .
