Skip to content
Show namespace dependencies of Clojure project sources as a graph
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Clojars Project


This is a Leiningen plugin to show the namespace dependencies of Clojure project sources as a graph.

Added Features

For a custom named file add this -name to the command line run like this:

lein ns-dep-graph -name my-dep-graph


The plugin itself is tiny, all the hard work is done by and Rhizome.


You will need to have Graphviz installed. Run dot -V at the command line to check.

Installation and Usage

Put [lein-ns-dep-graph "0.2.0-SNAPSHOT"] into the :plugins vector of your :user profile, or if you are on Leiningen 1.x do lein plugin install lein-ns-dep-graph 0.2.0-SNAPSHOT. Then run

lein ns-dep-graph

from a Clojure project directory. This outputs a file ns-dep-graph.png showing the internal namespace dependencies of the project's .clj sources. Dependencies on external namespaces, say, are not shown.

You can also pass an optional platform argument to generate a graph for ClojureScript

lein ns-dep-graph -platform :cljs # or
lein ns-dep-graph -platform :clj

You can also pass an option parents argument, to generate a graph showing only the nodes that have (one of) those namespaces as their transitive parent:

lein ns-dep-graph -parents [my-app.module.b.core]


Below is the namespace dependency graph obtained for Hiccup.

Hiccup namespace dependency graph


Copyright © 2013 Hilverd Reker.

Distributed under the Eclipse Public License, the same as Clojure.

You can’t perform that action at this time.