# Dependency graph Dependency graphs are the one diagram you should almost never draw manually. They are generated by tooling, and DOT is the format most tools already emit. Paste the DOT output into a diagram and it renders, versioned, on the page. --- ## When to reach for one * Package or module dependency trees from a build tool. * Service call graphs exported from tracing. * Build pipelines, where the order is derived from dependencies. --- ## How to draw it in Capable | **Route** | **Use when** | | --------- | ---------------------------------------------------- | | Graphviz | The format your tooling already produces. | | Mermaid | Small, hand-maintained graphs where DOT is overkill. | --- ## A worked example A module dependency graph, with a cycle worth arguing about: ![Dependency graph](https://help.gocapable.com/images/att1417773076.svg) The source, which you can paste into a new diagram and edit: ``` digraph deps { rankdir=LR; node [shape=box, fontname="Helvetica"]; api -> core; web -> core; web -> api; worker -> core; worker -> api; core -> utils; api -> utils; reports -> api; reports -> core; } ``` --- ## A few things that catch people out * Regenerate rather than edit. A hand-edited dependency graph is wrong within a week. * Cycles are the reason to draw this at all; make them visible rather than tidying them away. * Very large graphs hit the rendering limits. Filter before you paste. See [Reference](https://help.gocapable.com/diagrams/reference.html). --- ## Related [Git branching diagramExplaining a branching model without a whiteboard.](https://help.gocapable.com/diagrams/git-branching-diagram.html) [Requirements diagramWhat satisfies what, and what verifies it.](https://help.gocapable.com/diagrams/requirements-diagram.html) [ExamplesWorking diagrams you can copy.](https://help.gocapable.com/diagrams/examples.html) --- _Cheap to change means it stays true._