[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: *SPAM* Re: [ANN] LuaGRAPH 2.0 - A binding to the graphviz library
- From: Herbert Leuwer <herbert.leuwer@...>
- Date: Sat, 4 Mar 2017 11:08:38 +0100
> Ideally I await interface like
>
> local gv_graph = c_gv_graph:create()
> gv_graph:add_edge('A', 'B')
> gv_graph:add_edge('A', 'C')
> gv_graph:add_edge('C', 'B')
>
> local gv_graph_str = gv_graph:serialize()
>
>
> -- Martin
>
I assume .gv file is the representation of a graph in Graphviz „DOT“ notation:
> g=graph.open("g")
> g:edge('A','B')
> g:edge('A','C')
> g:edge('C','B')
> g:write()
digraph g {
node [label="\N"];
A -> B [key="edge@1"];
A -> C [key="edge@2"];
C -> B [key="edge@3"];
}
Use g:write(FILENAME) to write the graph to file FILENAME.
-- Herbert