https://github.com/justinmimbs/elm-module-graph
Visually explore package and module dependencies for an Elm project
https://github.com/justinmimbs/elm-module-graph
dependency-graph elm graph-diagrams
Last synced: about 1 year ago
JSON representation
Visually explore package and module dependencies for an Elm project
- Host: GitHub
- URL: https://github.com/justinmimbs/elm-module-graph
- Owner: justinmimbs
- Created: 2016-12-22T03:20:24.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-10T01:41:00.000Z (over 8 years ago)
- Last Synced: 2025-04-04T22:33:55.678Z (about 1 year ago)
- Topics: dependency-graph, elm, graph-diagrams
- Language: Elm
- Homepage: https://justinmimbs.github.io/elm-module-graph
- Size: 97.7 KB
- Stars: 33
- Watchers: 4
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# elm-module-graph
Visually explore package and module dependencies for an Elm project.
## Examples
Explore dependency graphs for these Elm projects:
- [graph](https://justinmimbs.github.io/elm-module-graph/examples/ellie.html) - [lukewestby/ellie](https://github.com/lukewestby/ellie)
- [graph](https://justinmimbs.github.io/elm-module-graph/examples/elm-spa-example.html) - [rtfeldman/elm-spa-example](https://github.com/rtfeldman/elm-spa-example)
- [graph](https://justinmimbs.github.io/elm-module-graph/examples/time-tracker.html) - [knewter/time-tracker](https://github.com/knewter/time-tracker)
- [graph](https://justinmimbs.github.io/elm-module-graph/examples/tradenomiitti.html) - [Tradenomiliitto/tradenomiitti](https://github.com/Tradenomiliitto/tradenomiitti)
## Usage
1. __Generate__ a `module-graph.json` file for your Elm project with the Python script in this repository.
To generate this file, first save the script, [elm-module-graph.py](https://raw.githubusercontent.com/justinmimbs/elm-module-graph/master/elm-module-graph.py), locally. Execute it, passing it the file path to either an Elm module or an `elm-package.json`.
```sh
./elm-module-graph.py project/src/Main.elm
```
or
```sh
./elm-module-graph.py library/elm-package.json
```
By default it writes to a file in the current working directory named `module-graph.json`, but you can specify a different output location with the `--output` option.
2. __Provide__ that file to this page: [elm-module-graph](https://justinmimbs.github.io/elm-module-graph).
## About
The page displays two graph diagrams. Nodes are vertically sorted so that for each connection the lower node depends on the higher node.
In the Packages graph, clicking a package name will toggle its modules in and out of the Modules graph. In the Modules graph, clicking a module name will highlight the subgraph it's connected to; the nodes are then colored based on distance from the selected module.
Graph diagrams are drawn using [justinmimbs/elm-arc-diagram](http://package.elm-lang.org/packages/justinmimbs/elm-arc-diagram/latest).