Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chuongtrh/godepviz
Visualize Go dependency in Graphviz DOT format.
https://github.com/chuongtrh/godepviz
golang graphviz visualization
Last synced: about 2 months ago
JSON representation
Visualize Go dependency in Graphviz DOT format.
- Host: GitHub
- URL: https://github.com/chuongtrh/godepviz
- Owner: chuongtrh
- Created: 2020-10-02T16:42:40.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-18T04:48:12.000Z (over 2 years ago)
- Last Synced: 2024-06-21T18:08:17.936Z (7 months ago)
- Topics: golang, graphviz, visualization
- Language: Go
- Homepage: https://godepgraph.vercel.app
- Size: 5.96 MB
- Stars: 13
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# godepviz
Visualize Go dependency in Graphviz DOT format.
Support visualize package from [https://pkg.go.dev](https://pkg.go.dev/)
## Installation
```bash
$ go get github.com/chuongtrh/godepviz
```## Usage
```bash
$ godepviz github.com/gofiber/fiber/v2
```The output is a graph in [Graphviz](http://graphviz.org/) dot format.
```base
digraph G {
rankdir="LR";
pad=.25;
ratio=fill;
dpi=360;
node [shape=box];
"github.com/gofiber/fiber/v2" -> "github.com/valyala/fasthttp";
"github.com/valyala/fasthttp" -> "github.com/andybalholm/brotli";
"github.com/valyala/fasthttp" -> "github.com/klauspost/compress/flate";
"github.com/valyala/fasthttp" -> "github.com/klauspost/compress/gzip";
"github.com/valyala/fasthttp" -> "github.com/klauspost/compress/zlib";
"github.com/valyala/fasthttp" -> "github.com/valyala/bytebufferpool";
"github.com/gofiber/fiber/v2" -> "github.com/valyala/fasthttp/reuseport";
"github.com/valyala/fasthttp/reuseport" -> "github.com/valyala/tcplisten";
"github.com/gofiber/fiber/v2" [style=filled];
}
```You can view a output graph with tool [https://dreampuf.github.io/GraphvizOnline](https://dreampuf.github.io/GraphvizOnline)
or [http://viz-js.com](http://viz-js.com)If you have the **graphviz** tools installed you can render it by piping the output to dot:
```bash
$ godepviz github.com/gofiber/fiber/v2 | dot -Tpng -o godep.png
```Export SVG file with a large graph have many nodes of dependencies
```bash
$ godepviz github.com/gofiber/fiber/v2 | dot -Gdpi=0 -T svg -o godep.svg
```Run from source code
```bash
$ go run main.go go.uber.org/zap | dot -Tpng -o godep.png
```## Example
- Package `net/http`
![Example net/http](./screenshots/godep.png)
- Package `github.com/labstack/echo/v4`
![Example github.com/labstack/echo/v4](./screenshots/godep1.png)
- Package `github.com/gofiber/fiber/v2`
![Example github.com/gofiber/fiber/v2](./screenshots/godep.svg)
## License
MIT