my %graphviz_programs = (
"dot" => 1, "neato" => 1, "fdp" => 1, "twopi" => 1, "circo" => 1
);
my %graphviz_programs = (
"dot" => 1, "neato" => 1, "fdp" => 1, "twopi" => 1, "circo" => 1
);
$SIG{PIPE}=sub { $sigpipe=1 };
$pid=open2(*IN, *OUT, "$params{prog} -Tpng");
# open2 doesn't respect "use open ':utf8'"
$SIG{PIPE}=sub { $sigpipe=1 };
$pid=open2(*IN, *OUT, "$params{prog} -Tpng");
# open2 doesn't respect "use open ':utf8'"
if (! $params{preview}) {
writefile($dest, $config{destdir}, $png, 1);
}
else {
if (! $params{preview}) {
writefile($dest, $config{destdir}, $png, 1);
}
else {
eval q{use MIME::Base64};
error($@) if $@;
return "<img src=\"data:image/png;base64,".
eval q{use MIME::Base64};
error($@) if $@;
return "<img src=\"data:image/png;base64,".
my %params=@_;
$params{src} = "" unless defined $params{src};
$params{type} = "digraph" unless defined $params{type};
$params{prog} = "dot" unless defined $params{prog};
my %params=@_;
$params{src} = "" unless defined $params{src};
$params{type} = "digraph" unless defined $params{type};
$params{prog} = "dot" unless defined $params{prog};