No description
Find a file
2021-01-30 10:41:36 -07:00
src add cdt 2020-07-04 09:33:06 -07:00
tests/src init 2020-06-12 23:26:49 -07:00
.gitignore init 2020-06-12 23:26:49 -07:00
nimviz.nimble Better example, fix a few names 2020-06-13 19:39:31 -07:00
README.md add not working section 2021-01-30 10:41:36 -07:00

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.