Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GraphViz2 rather than GraphViz Perl module? #24

Open
mohawk2 opened this issue Apr 20, 2024 · 1 comment
Open

Use GraphViz2 rather than GraphViz Perl module? #24

mohawk2 opened this issue Apr 20, 2024 · 1 comment

Comments

@mohawk2
Copy link

mohawk2 commented Apr 20, 2024

I just learned of this project today, and it's really cool!

Thought you'd be interested to know of the GraphViz2 module, which may make things easier/better in this script. Example usage:

From https://github.com/PDLPorters/pdl/blob/master/perldl#L335-L338:

  my $g = PDL::Core::pdumpgraph(PDL::Core::pdumphash($pdl));
  require GraphViz2;
  my $gv = GraphViz2->from_graph(PDL::Core::pdumpgraphvizify($g));
  $gv->run(format => $format, output_file => $file);

The general idiom is you make a Graph object, then annotate it (e.g. with a graphvizify procedure such as https://github.com/PDLPorters/pdl/blob/ac270e21cafeda8726dd64fa4b90e4a6e686c8c2/Basic/Core/Core.pm#L2394-L2439), then GraphViz2 can run with it.

@koknat
Copy link
Owner

koknat commented Apr 20, 2024

Hi @mohawk2
Thanks for the feedback!
I had considered moving from GraphViz to GraphViz2, but chose not to because of the additional Perl dependencies (Moo and 5.8.8 vs 5.6.0).
My assumption is that the more steps are needed to install 'callGraph', the fewer people will spend the effort to install it.
Installation of the Moo dependency is trivial for those of us experienced with Perl, but since callGraph supports many languages, most users may be completely new to Perl.
For the same reason, I designed the callGraph code as a monolith, as it's then easier for a user to copy between machines or give to a friend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants