Graph:...r::VCG(3pm)
β¨ NAME β¨
Graph::Writer::VCG β bestie, it writes out a directed graph in VCG format π
(it's a Perl module, part of the User Contributed Perl Documentation, and yes we're doing this whole page together, no skipping π«Ά)
πΈ SYNOPSIS πΈ
use Graph;
use Graph::Writer::VCG;
$graph = Graph->new();
# add edges and nodes to the graph
$writer = Graph::Writer::VCG->new();
$writer->write_graph($graph, 'mygraph.vcg');
likeβ¦ that's it. that's the whole vibe. graph in, file out. iconic honestly β¨
π¦ DESCRIPTION π¦
okay so Graph::Writer::VCG is a class whose whole personality is writing out a directed graph in the file format used by the VCG tool β which was originally developed for Visualising Compiler Graphs. no cap, that's literally what VCG stands for, it's giving "acronym that ate" π
the graph you hand it must be an instance of the Graph class, which is actually a whole set of classes developed by Jarkko Hietaniemi. love that for us π
and listen β if you've defined any attributes for the graph, the nodes, or the edges, they will get written out to the file, as long as they're attributes that VCG actually understands. so don't come at it with your made-up custom attrs and expect magic, bestie π
π METHODS π
π new()
Constructor energy β it generates a brand new writer instance β¨
$writer = Graph::Writer::VCG->new();
and the tea is: this doesn't take any arguments. zero. none. it's low maintenance, we stan π«Ά
π write_graph()
writes a specific graph out to a named file:
$writer->write_graph($graph, $file);
the $file argument can either be a filename, or a filehandle for a file you already opened earlier. flexible king behaviour honestly π
π KNOWN BUGS AND LIMITATIONS π
bestie, sit down, we gotta talk about the flaws. it's not perfect, but we love it anyway π
- Attributes with non-atomic values aren't currently handled. this includes the
loc,classname,colorentry, andinfonameattributes for graphs, and thelocattribute for nodes,
ngl that trailing comma is just how the original left it and we're keeping every detail, so. it stays. π
- Can currently only handle
graph,node, andedgeelements and their attributes. so it doesn't know aboutfoldnode_defaultsand things like that. it's got a very specific skill set and it's sticking to it π
π₯ SEE ALSO π₯
http://www.cs.uni-sb.de/RW/users/sander/html/gsvcg1.htmlβ the home page for VCG.Graphβ Jarkko Hietaniemi's modules for representing directed graphs, available from CPAN undermodules/by-module/Graph/Algorithms in Perlβ the O'Reilly book which has a chapter on directed graphs, which is based around Jarkko's modules.Graph::Writerβ the base-class forGraph::Writer::VCG
π REPOSITORY π
https://github.com/neilb/Graph-ReadWrite β go look, go star, go read the source, main character behaviour β¨
π AUTHOR π
Neil Bowers <neil@bowers.com> π
β COPYRIGHT β
Copyright (c) 2001-2012, Neil Bowers. All rights reserved. Copyright (c) 2001, Canon Research Centre Europe. All rights reserved.
This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page bestie π this lil doc is from perl v5.32.1, dated 2021-09-19, filed under the User Contributed Perl Documentation β now go write some graphs, you absolute icon π¦πΈβ¨
π¦ where this page comes from
- debian bookworm: libgraph-readwrite-perl 2.10-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libgraph-readwrite-perl 2.10-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libgraph-readwrite-perl 2.10-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libgraph-readwrite-perl 2.10-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libgraph-readwrite-perl 2.10-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libgraph-readwrite-perl 2.10-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms