GitXplorerGitXplorer
N

lua-graphviz

public
13 stars
5 forks
1 issues

Commits

List of commits on branch master.
Unverified
252951454ec3f77ab49e99b28bb79099fe777c00

version update

committed 8 years ago
Unverified
557a5948ce7f786601b3ebd26ba45cad0264144f

Merge pull request #2 from Nymphium/refactoring

committed 8 years ago
Unverified
76711e3385164bf81a5d0e5bb1788cb2a350382e

make code good

committed 8 years ago
Unverified
527083a70f86ba1e907d5e1e7680e5799f7076df

Merge pull request #1 from yuliying/master

committed 8 years ago
Unverified
1b9826239a69fb0fb43b31dcd64cce6538c12612

remove unneeded comment --indent

yyuliying committed 8 years ago
Unverified
b56e28a49ae3c53e3bcf43ccdd3659a68e69eed3

x

yyuliying committed 8 years ago

README

The README file for this repository.

Lua-Graphviz

Graphviz for Lua

usage

local Graphviz = require("graphviz")

local graph = Graphviz()

install

luarocks install graphviz or git clone https://github.com/nymphium/lua-graphviz && cd lua-graphviz && luarocks make

function

graph:node(nodename, label)

add a node

graph:edge(...)

add a edges

args[1] -> args[2]
args[1] -> args[3]
...
args[1] -> args[n]

graph:source()

return graph as string

digraph {
	graph []
	node []
	edge []
		a [label="hoge"]
		b [label="huga"]
			a -> b
}

graph:write(filename)

write dot file to (filename)

graph:compile(filename, format = "pdf", generated_filename = ("%s.%s"):format(filename, format))

write dot file to (filename) and compile the file (dot -T format filename generated_filename)

graph:render(filename, format = "pdf", generated_filename = ("%s.%s"):format(filename, format))

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")

graph.nodes.style:update(styles), graph.edges.style:update(styles, graph.graph.style:update(styles)

update each style

graph.nodes.style:update{
	fontname = "Inconsolata Regular",
	shape = "rectangle"
}

LICENSE

MIT