Skip Menu |

This queue is for tickets about the GraphViz CPAN distribution.

Report information
The Basics
Id: 79876
Status: resolved
Worked: 4 min
Priority: 0/
Queue: GraphViz

People
Owner: Nobody in particular
Requestors: TINITA [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.10
Fixed in: (no value)



Subject: Graph name cannot contain the word 'graph'
my $g = GraphViz->new( name => 'Graph', ); my $png = $g->as_png; Error message: Error: <stdin>:1: syntax error near line 1 context: digraph >>> Graph <<< { Workaround: my $g = GraphViz->new( name => '"Graph"', ); I'd use GraphViz2 but we have to use 5.8 on some machines, and GraphViz2 requires 5.14.
Subject: Re: [rt.cpan.org #79876] Graph name cannot contain the word 'graph'
Date: Fri, 28 Sep 2012 08:33:36 +1000
To: bug-GraphViz [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Tina On 27/09/12 19:23, Tina Muller via RT wrote: Show quoted text
> Thu Sep 27 05:23:39 2012: Request 79876 was acted upon. > Transaction: Ticket created by TINITA > Queue: GraphViz > Subject: Graph name cannot contain the word 'graph' > Broken in: 2.10 > Severity: Normal > Owner: Nobody > Requestors: TINITA@cpan.org > Status: new > Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=79876> > > > my $g = GraphViz->new( > name => 'Graph', > ); > my $png = $g->as_png; > > Error message: > Error:<stdin>:1: syntax error near line 1 > context: digraph>>> Graph<<< {
That's a restriction imposed by Graphviz. See the definition of the DOT language: http://www.graphviz.org/content/dot-language where a graph starts off with: graph : [ strict ] (graph | digraph) [ ID ] '{' stmt_list '}' You're trying to use: [strict] graph Graph or [strict] digraph Graph which Graphviz takes to be a syntax error. This also fails: digraph strict { node_1 -> node_2 } I'll make that as not-a-bug in GraphViz. I doubt the authors of Graphviz would consider changing their parser to handle these few cases, although it would be possible. Show quoted text
> Workaround: > my $g = GraphViz->new( > name => '"Graph"', > );
Yep. I got that to work. Show quoted text
> I'd use GraphViz2 but we have to use 5.8 on some machines, and > GraphViz2 requires 5.14.
Sigh. One day... -- Ron Savage http://savage.net.au/ Ph: 0421 920 622
Hi Tina I believe that's a restriction built in to Graphviz's parser, not a bug in GraphViz. Cheers Ron
Am Fr 28. Sep 2012, 00:36:08, RSAVAGE schrieb: Show quoted text
> Hi Tina > > I believe that's a restriction built in to Graphviz's parser, not a
bug Show quoted text
> in GraphViz. > > Cheers > Ron
Hi Ron, I understand that (I thought already that it was such a kind of "bug"). But the error message is a bit puzzling. Maybe it could be added to the documentation that the name should be extra quoted. thanks, tina
Subject: Re: [rt.cpan.org #79876] Graph name cannot contain the word 'graph'
Date: Fri, 28 Sep 2012 09:23:01 +1000
To: bug-GraphViz [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Tina On 28/09/12 09:09, Tina Muller via RT wrote: Show quoted text
> Queue: GraphViz > Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=79876> > > Am Fr 28. Sep 2012, 00:36:08, RSAVAGE schrieb:
>> Hi Tina >> >> I believe that's a restriction built in to Graphviz's parser, not a
> bug
>> in GraphViz. >> >> Cheers >> Ron
> > Hi Ron, > > I understand that (I thought already that it was such a kind of "bug"). > But the error message is a bit puzzling. Maybe it could be added to the > documentation that the name should be extra quoted.
Ah. OK. The msg is output by (AT&T's) Graphviz, not by GraphViz (Perl code). But you're right: I'll add an item the FAQ of both GraphViz and GraphViz2 warning people about this. However, for such a small change I won't release a new version of those packages. -- Ron Savage http://savage.net.au/ Ph: 0421 920 622
Am Fr 28. Sep 2012, 01:23:21, ron@savage.net.au schrieb: Show quoted text
> Ah. OK. The msg is output by (AT&T's) Graphviz, not by GraphViz (Perl
code). Show quoted text
> > But you're right: I'll add an item the FAQ of both GraphViz and > GraphViz2 warning people about this. > > However, for such a small change I won't release a new version of
those Show quoted text
> packages.
Thanks. Yeah, this is not enough for a release. I even hesitated to make bug report, but since GraphViz2 needs 5.14, I guess, version 1 will be around for a while =) (And it actually took me a while to find out why I got the error message. I was outputting an inline svg and got the default "test" title tooltip and just wanted to get rid of this and said name => 'Graph' -> boom ;-)
Subject: Re: [rt.cpan.org #79876] Graph name cannot contain the word 'graph'
Date: Fri, 28 Sep 2012 09:45:55 +1000
To: bug-GraphViz [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Tina On 28/09/12 09:34, Tina Muller via RT wrote: Show quoted text
> Queue: GraphViz > Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=79876> > > Am Fr 28. Sep 2012, 01:23:21, ron@savage.net.au schrieb: >
>> Ah. OK. The msg is output by (AT&T's) Graphviz, not by GraphViz (Perl
> code).
>> >> But you're right: I'll add an item the FAQ of both GraphViz and >> GraphViz2 warning people about this. >> >> However, for such a small change I won't release a new version of
> those
>> packages.
> > Thanks. Yeah, this is not enough for a release. I even hesitated to > make bug report, but since GraphViz2 needs 5.14, I guess, version 1 > will be around for a while =)
Yeah :-(. Show quoted text
> (And it actually took me a while to find out why I got the error > message. I was outputting an inline svg and got the default "test" > title tooltip and just wanted to get rid of this and said name => > 'Graph' -> boom ;-)
Right. I've updated the PODs for Graph::Easy::Marpa, GraphViz, GraphViz2, GraphViz2::Marpa and (the unreleased) GraphViz2::Marpa::PathUtils. As you can see, the new FAQ entry will be seen by many people and will preempt grief for some, which is what makes it worth it. $manx x $thanx; -- Ron Savage http://savage.net.au/ Ph: 0421 920 622
Hi Tina I'm marking this as resolved.