Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bradleyjkemp/memviz
Visualize your Go data structures using graphviz
https://github.com/bradleyjkemp/memviz
go golang graphviz visualization
Last synced: 15 minutes ago
JSON representation
Visualize your Go data structures using graphviz
- Host: GitHub
- URL: https://github.com/bradleyjkemp/memviz
- Owner: bradleyjkemp
- License: mit
- Created: 2017-11-17T20:43:14.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T20:23:51.000Z (over 3 years ago)
- Last Synced: 2025-01-18T22:37:59.801Z (7 days ago)
- Topics: go, golang, graphviz, visualization
- Language: Go
- Homepage:
- Size: 87.9 KB
- Stars: 1,297
- Watchers: 30
- Forks: 51
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- my-awesome - bradleyjkemp/memviz - 04 star:1.3k fork:0.1k Visualize your Go data structures using graphviz (Go)
- go-awesome - memviz - graphical data structure (Open source library / Development Aid Package)
- awesome-golang-repositories - memviz
README
# memviz [![Build Status](https://travis-ci.org/bradleyjkemp/memviz.svg?branch=master)](https://travis-ci.org/bradleyjkemp/memviz) [![Coverage Status](https://coveralls.io/repos/github/bradleyjkemp/memviz/badge.svg)](https://coveralls.io/github/bradleyjkemp/memviz?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/bradleyjkemp/memviz)](https://goreportcard.com/report/github.com/bradleyjkemp/memviz) [![GoDoc](https://godoc.org/github.com/bradleyjkemp/memviz?status.svg)](https://godoc.org/github.com/bradleyjkemp/memviz)
How would you rather debug a data structure?
"Pretty" printed
Visual graph
(*test.fib)(0xc04204a5a0)({
index: (int) 5,
prev: (*test.fib)(0xc04204a580)({
index: (int) 4,
prev: (*test.fib)(0xc04204a560)({
index: (int) 3,
prev: (*test.fib)(0xc04204a540)({
index: (int) 2,
prev: (*test.fib)(0xc04204a520)({
index: (int) 1,
prev: (*test.fib)(0xc04204a500)({
index: (int) 0,
prev: (*test.fib)(),
prevprev: (*test.fib)()
}),
prevprev: (*test.fib)()
}),
prevprev: (*test.fib)(0xc04204a500)({
index: (int) 0,
prev: (*test.fib)(),
prevprev: (*test.fib)()
})
}),
.
.
.
## Usage
`memviz` takes a pointer to an arbitrary data structure and generates output that can be used to generate an easy to
understand diagram using [graphviz](https://graphviz.org/about/).To generate a diagram, first you will need to install graphviz on your system following the instructions [here](https://graphviz.org/download/).
Next, use ```memviz.Map(out, &data)``` to generate a graphviz [dot file](https://graphviz.org/doc/info/lang.html) and
then pipe the output into graphviz.For examples of how to use `memviz`, see the code sample in the [example](https://github.com/bradleyjkemp/memviz/example)
folder and the tests in [memviz_test.go](https://github.com/bradleyjkemp/memviz/blob/master/memviz_test.go).