Viz
NAME
Doc::TypeGraph::Viz - Output graph in .dot format (from GraphViz)
SYNOPSIS
my $tg = Doc::TypeGraph.new-from-file('test-type-graph.txt'); my $viz = Doc::TypeGraph::Viz.new;
my $path = "/tmp"; $viz.write-type-graph-images(:$path, :force, type-graph => $tg);
DESCRIPTION
Class for rendering Doc::TypeGraph
objects in a rather rigid way;
GraphViz's .dot
format is used for expressing the relationships,
and they are then rendered using the dot
program.
METHODS
method new-for-type ($type, *%attrs)
Adds a new node for a type, with any attribute
method as-dot (:$size)
Renders as a dot document with the indicated size
method to-dot-file ($file)
Saves the dot representation to an actual file
method to-file ($file, :$format = 'svg', :$size --> Promise:D)
Runs dot
on the file, returning a Promise
so that it can be used
asynchronously.
method write-type-graph-images(:$type-graph, :$path, :$force) {
Write the images to storage.
sub viz-group($type)
Return the group depending on the type
sub viz-hints($group)
Return the hints depending on the group