Include topic hierarchy into your dot graphs


You are using DirectedGraphPlugin and would like to include part of the parent-child topic hierarchy into your graphs. You have examined DirectedGraphWebMapPlugin and have determined that it doesn't meet your needs.


You have information stored in your structured wiki over many topics arranged into a logical hierarchy by setting the topic parents appropriately.

You are using DirectedGraphPlugin to do visualisation of some or all of this information and would like to avoid hand-writing dot graph code that would be a duplicate of the natural topic hierarchy that is already in place.


Create a topic (for example's sake, Main.TopicTree2Dot) with the following:

   header="\"%QTOPIC%\" [URL=\"%SCRIPTURLPATH{view}%/%QWEB%/%QTOPIC%\"];$n$n"
   format="\"$expand(parent)\" -> \"$topic\";$n$n\"$topic\" [URL=\"%SCRIPTURLPATH{"view"}%/%QWEB%/$topic\"];$n"

You can then include this topic with the appropriate parameters in the middle of your dot code, for example:
<dot map="on" vectorformats="svg jpg">
digraph G {
  %INCLUDE{"Main.TopicTree2Dot" QWEB="SomeWeb" QTOPIC="TopicParentWithChildren"}%

Known Uses

Known Limitations

See Also

-- PaulHarvey - 29 Sep 2009

BestPracticeTipsForm edit

Category Using Extensions
Topic revision: r4 - 05 Dec 2009, PaulHarvey - This page was cached on 10 Jan 2018 - 05:22.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License