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

NAME

Graph::Layout::Aesthetic::Monitor::GnuPlot - Display progress of a graph layout using gnuplot

SYNOPSIS

    use Graph::Layout::Aesthetic::Monitor::GnuPlot;
    $monitor = Graph::Layout::Aesthetic::Monitor::GnuPlot->new(%parameters);

    # Now use it with Graph::Layout::Aesthetic object $aglo:
    $aglo->gloss(monitor => $monitor);

    # That's the basics. You likely won't need the stuff after this point
    $monitor->plot($aglo);
    $monitor->command($command);
    $monitor->command_flush($command);
    $monitor->commandf($format, @arguments);
    $time = $monitor->last_plot_time;

DESCRIPTION

Graph::Layout::Aesthetic::Monitor::GnuPlot is a simple class based on gnuplot that is meant to help you to monitor the progress of a graph layout. It has the right interface so it can be directly used as the value of the monitor parameter to Graph::Layout::Aesthetic method gloss.

METHODS

$monitor = Graph::Layout::Aesthetic::Monitor::GnuPlot->new(%parameters)

Creates a new Graph::Layout::Aesthetic::Monitor::GnuPlot object. The parameters are name/value pairs which currently can be:

after_plot => $callback

Whenever the plot method is called, this callback is also executed after flushing the actual plot commands to gnuplot like this:

    $callback->($aglo, $monitor);

Unless $callback is false (the default) in which case nothing gets done.

$monitor->plot($aglo)

Takes the current Graph::Layout::Aesthetic $aglo state and plots it. At the end of this call the after_plot callback is done if any was given.

This method usually gets called implicitly by the Graph::Layout::Aesthetic method gloss.

$monitor->command($command)

Sends $command directly to gnuplot. Since no flush on the controlling pipe is done the command may (or may not) get buffered and therefore not executed until something flushes it. See command_flush.

A newline gets appended to the $command internally.

$monitor->command_flush($command)

The same as command, but also flushes the controlling pipe to gnuplot. So all already buffered commands and this command will get executed.

$monitor->commandf($format, @arguments)

The same as command, but with a printf style interface.

$time = $monitor->last_plot_time

Return the epoch time of the last time a plot method call returned. Returns undef if a plot has never been done yet.

EXPORTS

None.

SEE ALSO

Graph::Layout::Aesthetic, gnuplot(1)

AUTHOR

Ton Hospel, <Graph-Layout-Aesthetic@ton.iguana.be>

COPYRIGHT AND LICENSE

Copyright (C) 2004 by Ton Hospel

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.6.1 or, at your option, any later version of Perl 5 you may have available.