Skip to content

Rekihyt/nimviz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nimviz

A very barebones wrapper for the graphviz c api. Currently untested on windows/macos.

Requires the graphviz dev files and headers. The debian package for them is libgraphviz-dev.

Examples

Basic graph opening and closing and render. You can quickly view output using fim:

nimble build; ./binary | dot -Tjpg | fim -i --autowindow
import nimviz

var
  graph = agOpen("G", agDirected)
  context = gvContext()
  node1 = graph.agNode("node1")
  node2 = graph.agNode("node2")
  # Create an edge
  edge1 = graph.agEdge(node1, node2, "edge1")

# Set an attribute
discard node2.agSafeSet("color", "green")

discard gvLayout(context, graph, "fdp")
discard gvRender(context, graph, "dot", cast[ptr File](stdout))

discard gvFreeLayout(context, graph)
discard agClose(graph)
discard gvFreeContext(context)

Not Working

Any nested structures, such as DtLinkT and their dependencies.

About

A wrapper for the graphviz c api.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published