Skeeve has asked for the wisdom of the Perl Monks concerning the following question:

Dear fellow monks!

I recently discovered the Graph editor yEd and want to create input files for it, for visualising some data I have.
So I first started out writing the source explicitly.
That's boring and error prone
Now I think about using XML::Twig as I already know this well.
But maybe some of you know of alternatives that already can handle GraphML. My (Super-)Search didn't reveal any node at all. Search on CPAN was also unsuccessful.

s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

Replies are listed 'Best First'.
Re: GraphML module?
by ptum (Priest) on Jun 08, 2006 at 15:11 UTC

    A few thoughts based on very limited knowledge ...

    If I was thinking of traditional line and bar graphs, I'd probably look into extending GD::Graph::Data to be able to accept GraphML.

    If I was thinking more in terms of flowcharts, I'd look into extending something like Graph::Easy.


    No good deed goes unpunished. -- (attributed to) Oscar Wilde
      Maybe I don't understand, but I don't want to extend an existing module. I'm searching for a module that will create GraphML.

      Right now I'm already implementing it with XML::Twig.

      I read a GraphML file which I use as a kind of template, with XML::Twig. Cut out all the nodes and sub graphs which I copy, modify and paste it back in.

      Works quite well...

      s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
      +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

        Sorry, my earlier posting wasn't directly responding to your question ... but you hadn't received any answers, and I am interested in this general problem space. Sounds like your XML::Twig solution is the best you're going to find -- I didn't find anything in CPAN either.

        I was trying to get at the underlying problem, wondering what kind of graphs you are building, and why.


        No good deed goes unpunished. -- (attributed to) Oscar Wilde