local Graphviz = require("graphviz")
local graph = Graphviz()
luarocks install graphviz
or git clone https://github.com/nymphium/lua-graphviz && cd lua-graphviz && luarocks make
add a node
add a edges
args[1] -> args[2]
args[1] -> args[3]
...
args[1] -> args[n]
return graph as string
digraph {
graph []
node []
edge []
a [label="hoge"]
b [label="huga"]
a -> b
}
write dot file to (filename
)
write dot file to (filename
) and compile the file (dot -T format filename generated_filename
)
write dot file to (filename
), compile the dot file as format
, and open the generated file
it only calls graph:write(filename)
, graph:compile(filename, format, generated_file)
and io.pcall(()"xdg-open %s &"):format(generated_filename))
graph:render("file", "pdf")
update each style
graph.nodes.style:update{
fontname = "Inconsolata Regular",
shape = "rectangle"
}