The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Dot::Writer

SYNOPSIS

    use Dot::Writer qw(write_dot);

    write_dot({
        name   => "MyGraph",
        graph  => \%graph,
        colors => \%colors,
        out    => "outfile"
    });


    # Or you can use a hash
    my $options = {
        name      => "MyGraph",
        graph     => \%graph,
        node_attr => \%colors,
        out       => "outfile"
    };

    write_dot($options);

DESCRIPTION

This module writes DOT files. To do it, it needs at least two arguments (graph and out). The "colors" and "name" arguments are optional.

name

Name of the graph to write on the graph initialization statement.

    digraph MyGraph {
        ...
    }
graph

A hash reference with the graph. It should have the following structure:

    %hash = (
        parent1 => child1 = "color|attr1|attr2|..."
                => child2 = "color|attr1|attr2|..."

        parent2 => child3 = "color|attr1|attr2|..."
                => child4 = "color|attr1|attr2|..."
        ...
    )
colors

A hash ref with the colors for each node.The keys should be the node IDs of your nodes. This argument is optional. If not set, no color will be specified.

out

A file to write it