Giter Club home page Giter Club logo

morpheus's Introduction

CircleCI codecov

Morpheus

Generate dependency graph(s) for variables in Clojure(Script) namespaces.

Usage

Add an alias for morpheus in your deps.edn.

{:aliases
  {:morpheus {:extra-deps {thomasa/morpheus {:git/url "https://github.com/benedekfazekas/morpheus.git"
                                             :git/sha "ac982a62ef5141b556bd18e352b9e318ec129818"}}
              :main-opts ["-m" "thomasa.morpheus.main"]}}}

Run it in your project, provide directory to generate output files into -- directory needs to exist, format -- png, svg and dot is supported, latter is default -- and a list of paths to analyse.

Morpheus will generate a two files per project variable. One file with a given var's dependency graph where nodes are other variables in the project or in one of the dependencies of the project. The other file will show the usages of a project variable. Usages graphs are also generated for external vars, eg. vars of the dependencies of the project. For example:

clj -A:morpheus -d graphs -f png src test

Use -r option to generate graphs only for a given var and its dependencies. For example

clj -A:morpheus -d graphs -f png -r 'thomasa.morpheus.core/filename' src test

Use -e option to exclude some vars from the graphs generated by morpheus. For example

clj -A:morpheus -d graphs -f png -e 'clojure.core/.*|:clj-kondo/unknown-namespace/.*' src test

to filter out all clojure core vars and references to java interop calls.

For anything else than a dot file you need to have graphiz installed. Alternatively you can use a viewer online, for example edotor.

If you generate svg format you can leverage the references added to the graph nodes and the edges (arrows) between the nodes. You can navigate to subgraphs in your dependency tree by clicking an edge between two nodes. And toggle between the dependency graph and the usages graph by clicking a node. This means navigation has CHANGED compared to previous versions where clicking a node navigated to the subgraph.

Example

Dependency graph

mranderson.move__replace-in-import.svg

Usages graph

mranderson.util__info-usgs.svg

Uses clj-kondo to analyse namespaces under provided paths.

morpheus's People

Contributors

benedekfazekas avatar ssyh 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.