The main API of ShowGraphviz.jl is @deriveall. Given a type that defines
show on DOT language MIME typetext/vnd.graphviz, it defines show methods
for various image types such as PNG, GIF, SVG, PDF, etc.
struct HelloWorld end
Base.show(io::IO, ::MIME"text/vnd.graphviz", ::HelloWorld) =
print(io, "digraph G {Hello->World}")
using ShowGraphviz
ShowGraphviz.@deriveall HelloWorld
svg = sprint(show, "image/svg+xml", HelloWorld())
occursin("<svg", svg)
# output
trueAll top level functions and types (but not modules) defined in ShowGraphviz
are public API.
ShowGraphviz.@derive type mimes...: Similar to@deriveallbut only define the methods with specifiedmimes.ShowGraphviz.show(io, mime, x): showxas an image of MIME typemimeusingdotcommand line program.ShowGraphviz.setoption(io, option): Set command line option fordotprogram viaIOContext.ShowGraphviz.addoption(io, option): Append option.ShowGraphviz.getoption(io): Get option.
ShowGraphviz.DOT(source): a wrapper object that converts DOTsourceShowGraphviz.dot"source": createDOTusing a string macroShowGraphviz.CONFIG.dot:dotcommandShowGraphviz.CONFIG.dot_option: globaldotcommand option