Generate Graphvis diagrams with Go using https://github.com/awalterschulze/gographviz
To generate the .png file, run the program like this:
go run graphvis.go | dot -Tpng -o g.png
Result: https://i.imgur.com/Mf5ZJYS.png
Generate Graphvis diagrams with Go using https://github.com/awalterschulze/gographviz
To generate the .png file, run the program like this:
go run graphvis.go | dot -Tpng -o g.png
Result: https://i.imgur.com/Mf5ZJYS.png
package main | |
import ( | |
"fmt" | |
"github.com/awalterschulze/gographviz" | |
) | |
func main() { | |
g := gographviz.NewGraph() | |
g.SetName("G") | |
g.SetDir(true) | |
g.AddNode("G", "A", nil) | |
g.AddNode("G", "B", nil) | |
g.AddEdge("A", "B", true, nil) | |
s := g.String() | |
fmt.Println(s) | |
} |