This repository was archived by the owner on Mar 4, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
gonuts/godot
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Package godot provides a method of programatically building graphs which can be output into AT&T "dot" syntax. For more information about AT&T dot syntax, consult the documentation: Grammar: http://www.graphviz.org/doc/info/lang.html Examples: http://www.graphviz.org/Gallery.php Graphviz Software: http://www.graphviz.org/Download.php A short example follows: package main import "os" import "godot" func main() { graph := NewGraph(godot.Undirected) nodeA := &godot.Node{Label: "A"} nodeB := &godot.Node{Label: "B"} graph.AddNodes(nodeA, nodeB) edge1 := &godot.Edge{Src: nodeA, Dst: nodeB} graph.AddEdges(edge1) dot := graph.Build() dot.Write(os.Stdout) } The above example will write the following to stdout: graph { 0 [label="A"]; 1 [label="B"]; 0 -- 1; } Which can be converted to a png file using the "dot" program available from www.graphviz.org: $ go run main.go | dot -Tpng > example.png A more detailed example can be found in the example subdirectory.
About
Package godot provides a method of programatically building graphs which can be output into AT&T "dot" syntax.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published