GithubHelp home page GithubHelp logo

obarbeau / lein-ns-dep-graph Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hilverd/lein-ns-dep-graph

0.0 1.0 0.0 215 KB

Show namespace dependencies of Clojure project sources as a graph

Clojure 100.00%

lein-ns-dep-graph's Introduction

Clojars Project

lein-ns-dep-graph

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

Acknowledgements

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

Requirements

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.3.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.3.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 clojure.java.io, 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]

You can exclude namespaces using a regex, for example:

lein ns-dep-graph -exclude "utils\..*"

This will filter any namespace starting with utils..

Examples

Below is the namespace dependency graph obtained for Hiccup.

Hiccup namespace dependency graph

License

Copyright © 2021 Hilverd Reker.

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

lein-ns-dep-graph's People

Contributors

danielcompton avatar hilverd avatar obarbeau avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.