Imagine if I added this right in here in the wiki page source:
digraph foo {
rankdir=LR
a -> b -> c
}
But instead of showing the source it automaticly created a foo.gif and attached it
at this point in the text like this:
It would be very useful for quick diagrams and would work with anyone's browser.
This is all based on the
dot and
neato graph-based generators in the
GraphViz
package. These programs also have support for generating imagemaps and embedding URLs
on each node of a graph.
Note the GIF would not become an attachment like this example. It would be part of
the page be regenerated anytime the page is editted.
Also I can imagine PIC support would be useful for some people. I know some people
that can create diagrams in PIC very quickly.
--
WayneScott - 14 Nov 2001
I have used Graphviz for doinf a graphic map of the Groups relations (
http://twiki.dsi.uniroma1.it/twiki/view/TWiki/GroupsMap
)
That tool is very very handy!
--
AndreaSterbini - 15 Nov 2001
Hmm. Is there a
GroupsMapPlugIn?
--
MartinCleaver - 15 Nov 2001
It will, as soon I have ported all my stuff to
TWikiRelease01Sep2001.
--
AndreaSterbini - 15 Nov 2001
But the point of this proposal is to allow the user to create any arbitrary graphics on
a wiki page. People keep pointing out many neat browsers and viewers for webs and links
using
WebDot, but I just want an eazy way to create pictures for people who don't
have or want a big Java widget.
Also why do people use a
WebDot server rather than just calling
dot directly from
the
CGI script?
--
WayneScott - 28 Nov 2001
Wayne, people typically use a
WebDot server because it can be efficiently set up to only re-render the image when the dot content has changed. This can be a significant CPU savings as well as savings on the bandwidth for transporting unchanged gif images.
--
JohnCavanaugh - 17 Feb 2002
Just FYI, but I ported the
WebMap stuff to
TWikiRelease01Sep2001 and in the process fixed up quite a few bugs. We are happily using it on our internal TWiki, but it has definitely reached the ceiling of its capabilities.
I hope to spend some time working on a generic plugin like
WebDOTPlugin to base a future version of
WebMap off of. I just need there to be 30 hours in a day so I could sneak in a few productive hours of development.
--
JohnCavanaugh - 17 Feb 2002
This sounds useful - perhaps you could post your
WebMap code here? Would be useful to get this working on a more recent TWiki codebase.
--
RichardDonkin - 18 Feb 2002
I uploaded my newer patched version over on the
WebMap page. Enjoy.
--
JohnCavanaugh - 26 Feb 2002
Thanks, I'll have a go with this.
--
RichardDonkin - 26 Feb 2002
I've had some success using the Webdot
CGI script included with Graphviz in conjuction with Twiki.
Specifically, I've put the Webdot
CGI in with the other TWiki
CGI's, and made a one line change to Webdot, aside from the standard configuration changes.
I've set it up so I can create a Twiki topic or page that contains proper Graphviz graph data. Then on a separate page where I want the graph to appear based on the content of the prior topic, I simply add a link to the Webdot
CGI and include the full pathname of the Twiki datafile.
For instance, a new topic called
TestDotFile containing only:
graph dottest {
A -- B -- C;
B -- D;
D -- {E F};
}
could be graphed in any other topic by the following URL:
https://mytwikiserver.com/twiki/bin/webdot.cgi?file:/home/twiki/data/Test/TestDotFile.txt.neato.png
The URL would appear as the graph in the document, like so.
This patch runs the file through grep to remove META tags before passing the TWiki data file into Graphviz.
205c205
< $cmd = "DOTFONTPATH=\"$DotFontPath\" grep -v '^\%META' $dotfile | $GraphvizBinDir/$layouter -T$dottag > $tmpfile";
---
> $cmd = "DOTFONTPATH=\"$DotFontPath\" $GraphvizBinDir/$layouter -T$dottag < $dotfile > $tmpfile";
As the topic containing the graph data changes, so does the image on the page with the link to Webdot, with a refresh.
This isn't as slick as embedding the graph directly into the Twiki topic page, but works without any major changes or new plugins. It enables you to take advantage of the benefits of Twiki pages for a Graphviz graph, and use that graph in multiple places.
Comments?
--
RussellAdams - 18 Jun 2002
Hmm. Simple enough idea but I don't like the notion of having yet another file in the bin directory.
Since you have this working already could you give us a demo by putting it on an internet accessible website?
Ta.
--
MartinCleaver - 14 Aug 2002
I haven't an internet accessible website at my disposal.
However, if someone has an internet accessible Twiki installation, I'd be happy to help setup a demonstration. Email me.
Giving the method further thought...
A plugin for Graphviz could be done via inline statements, and modifications made to the rendering engine to render the graph on the fly. The example below would result in a graph displayed in the topic page.
<graph>
digraph foo {
rankdir=LR
a -> b -> c
}
</graph>
However, it also makes the graph page specific.
I think I prefer creating a separate topic to contain the structure of the graph versus having the structure embedded in the current topic. This allows multiple topics to link in the same graph, while preserving the TWikized topic benefits (ie. ACLs, VC).
What would be a good syntax to link in another topic as a graph? The extended URL I manually created to hit Webdot behind TWiki's back won't do for normal users. Maybe like this...
<graph topic=MyGraph />
Using the Webdot
CGI supplied with Graphviz is faster than reimplementing a Graphviz interface. Webdot is already optimized to cache images to prevent repetitive rendering. Perhaps its only fault is exec'ing Graphviz instead of using the PERL interface. A real TWiki plugin should also take into account METADATA lines in the topic source file. Maybe a merger of Webdot with a TWiki plugin to add new syntax hooks?
Lastly, perhaps the syntax above isn't so bad. Having the flexability to have an effortless inline graph, or a large shared graph in its own topic would be the ideal syntax for a Graphviz plugin.
Where would one start writing a TWiki plugin? I'm handy with PERL, just not familiar with the TWiki API.
--
RussellAdams - 15 Aug 2002
there is a perl cgi interface available from
http://www.research.att.com/sw/tools/graphviz/extras/webdot.pl
; that's what i'm using at
SaneAsylum:Sandbox.TestTopicWebDotPlugin
. i've also got some (somewhat redhat-specific) instructions for
SaneAsylum:It.InstallingWebDot
--
WillNorris - 05 Dec 2003
ColeBeck's
DirectedGraphPlugin offers Graphviz funtionality in a TWiki topic.
--
PeterThoeny - 27 Mar 2005