You are here: Foswiki>Tasks Web>Item14361 (12 Dec 2017, MichaelDaum)Edit Attach

Item14361: GraphVizPlugin: not clear how external images may be used

Priority: Normal
Current State: Confirmed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: GraphvizPlugin
Reported By: JohnKnutson
Waiting For:
Last Change By: MichaelDaum
You can create a graphviz diagram using a definition like the following:

digraph "G"
   req0021 [ shape=plaintext,label=<
<table style="rounded" border="1" cellborder="0" cellpadding="0" cellspacing="0" color="#b7c8dc">
  <tr><td gradientangle="90" bgcolor="#f3f8ff:#d4e7fe" width="20"><img scale="false" src="stream-development-badge.png"/></td><td gradientangle="90" bgcolor="#f3f8ff:#d4e7fe" width="80" align="left" valign="middle">req0021</td></tr>
> ]

This doesn't work as dot can't find stream-development-badge.png. I haven't bothered attaching it because it doesn't matter either way. The first time you save a topic on a wiki with GraphVizPlugin installed and enabled, you'll get a text box with dot error output in it about the missing png file, but if you reload that topic again it will render the graph without the image. Not sure why the behavior differs. Mostly I'd just like to know how to correctly set the path to the png so that the plugin will properly render the graph, assuming the png is attached to the topic.

I thought, based on a look at the plugin code, that maybe it was running dot in the pub/topic directory, but if that were the case it should have found the png file.

-- JohnKnutson - 29 Mar 2017

Note that the above graph definition works fine if you run dot on it directly (without the graphviz tags obviously) so long as you have the png files in the directory.

-- JohnKnutson - 29 Mar 2017

I changed my mind, I'm attaching both the embedded image and the results from running dot on the command-line.

-- JohnKnutson - 29 Mar 2017

Thinking about it, my guess as to why the error messages only appear on topic save is that dot actually does generate a graph (With warnings, maybe not errors) so that cached image is used on reload.

After experimenting a bit, it appears dot is being run in the root directory on the web host, but while I get no errors specifying the full path name (not an ideal approach), I also didn't get the image in the output as shown below.

-- JohnKnutson - 29 Mar 2017

  • Image for dot to embed:

  • Results when running dot on the command line:

ItemTemplate edit

Summary GraphVizPlugin: not clear how external images may be used
ReportedBy JohnKnutson
Codebase 1.1.9
SVN Range
AppliesTo Extension
Component GraphvizPlugin
Priority Normal
CurrentState Confirmed
TargetRelease n/a
ReleasedIn n/a
I Attachment Action Size Date Who Comment
foswiki-plugin-bug-ex.gv.pngpng foswiki-plugin-bug-ex.gv.png manage 3 K 29 Mar 2017 - 22:24 JohnKnutson Results when running dot on the command line
stream-development-badge.pngpng stream-development-badge.png manage 889 bytes 29 Mar 2017 - 22:24 JohnKnutson Image for dot to embed
Topic revision: r2 - 12 Dec 2017, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy