Graph:...aVinci(3pm)

πŸ’– Graph::Writer::daVinci β€” bestie edition πŸ’–

okay so real quick: this is Graph::Writer::daVinci(3pm), a page from the User Contributed Perl Documentation collection. sit down, hydrate, let's talk directed graphs and daVinci files πŸŽ€


✨ NAME ✨

Graph::Writer::daVinci β€” write out a directed graph in daVinci format. that's it, that's the whole job, and she does it flawlessly πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

  use Graph;
  use Graph::Writer::daVinci;

  $graph = Graph->new();
  # add edges and nodes to the graph

  $writer = Graph::Writer::daVinci->new();
  $writer->write_graph($graph, 'mygraph.davinci');

look at that. four lines of setup and you're out here living your best graph-writing life. iconic, honestly 🫢


🌸 DESCRIPTION 🌸

so Graph::Writer::daVinci is a class. it's a class whose entire personality is writing out a directed graph in the file format that the daVinci tool uses. that's the vibe. that's the assignment.

and here's the thing, bestie, the graph you hand it must be an instance of the Graph class. and Graph isn't just one class, no ma'am β€” it's actually a set of classes, and they were developed by Jarkko Hietaniemi. we stan a modular king πŸ‘‘


πŸ’œ METHODS πŸ’œ

πŸŽ€ new()

constructor!! generate a brand-new writer instance, fresh out the box:

  $writer = Graph::Writer::daVinci->new();

and here's the tea: this doesn't take any arguments. none. zero. don't even try it. just vibes ✨


πŸŽ€ write_graph()

this is the main character method fr fr. write a specific graph out to a named file:

  $writer->write_graph($graph, $file);

and about that $file argument β€” she's flexible, okay?? it can either be a filename, or a filehandle for a file you already opened. your choice, no judgement, we love options πŸ’–


🌈 SEE ALSO 🌈

  • http://www-b-novative.de/ β€” wait, no, let me say it right, the actual link is http://www.b-novative.de/ and it's the home page for the daVinci. go say hi πŸ¦‹
  • Graph β€” Jarkko Hietaniemi's modules for representing directed graphs, and you can grab them from CPAN under modules/by-module/Graph/. go get 'em ⭐
  • Algorithms in Perl β€” the O'Reilly book, and yes it has a chapter on directed graphs, and yes that chapter is based around Jarkko's modules. read it, it's giving academic baddie πŸ“š
  • Graph::Writer β€” the base-class for Graph::Writer::daVinci. she's the momager. respect her πŸ’…

πŸ‘‘ REPOSITORY πŸ‘‘

<https://github.com/neilb/Graph-ReadWrite>

go ahead and star it. you know you want to ⭐


🌟 AUTHOR 🌟

Neil Bowers <neil@bowers.com> πŸ’Œ


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.

(translation: it's free, it's open, use it, remix it, just keep the same Perl terms and we're all good 🫢)


aaaand that's the whole page, bestie!! no cap, you now know everything this manpage knows 🧚

and real quick, the sign-off energy: this page came from perl v5.32.1 and was last dated 2021-09-19. bye babes, go write some graphs πŸ’–βœ¨
πŸ“¦ where this page comes from