Difference between revisions of "Wgraph:Example 4"

From FollowTheScore
Jump to: navigation, search
Line 36: Line 36:
 
</pre></nowiki>
 
</pre></nowiki>
  
 +
<nowiki><pre>
 
===== DPL, order by target article =====
 
===== DPL, order by target article =====
 
{{#dpl:
 
{{#dpl:
Line 59: Line 60:
 
   }}
 
   }}
 
}}
 
}}
 +
</pre></nowiki>
  
 
[[Category:Wgraph]]
 
[[Category:Wgraph]]

Revision as of 11:40, 23 July 2007

In this example we do not use relations which were explicitly defined via template calls. Instead we use the normal hyperlinks.

Thus we loose some semantics but we can apply this kind of graph generation to any existing wiki contents!

To make the graph prettier, we assign colors to the categories (Impressionism = magenta, Expressionism = yellow). We could also make shapes dependent from (other) categories ..

Our example shows links from articles of category "Painter" to other articles of category "Painter". Note the birectional link between Renoir and Cezanne.

In the SVG graph each node points to its wiki page. <pre> {{#wgraph: svg | thumb=40 | wgl | // the painters {{#dpl: |category=Painter |mode=userformat |addcategories=true |listseparators=,\n node '%PAGE%' { type = '%CATNAMES%' },, }} // their relations {{#dpl: |category=Painter |mode=userformat |listseparators=,\n edge from '%PAGE%' to '%PAGESEL%' {},, |linksto={{#dpl: |mode=userformat |category=Painter |listseparators=,%PAGE%¦,, }} }} nodetype 'undefined node' { href '%%' } nodetype Impressionism { color lightmagenta href %% } nodetype Expressionism { color lightyellow href %% } }} </pre>

<pre> ===== DPL, order by target article ===== {{#dpl: |category=Painter |mode=userformat |listseparators=,\n* [[%PAGESEL%]] - [[%PAGE%]],, |linksfrom={{#dpl: |mode=userformat |category=Painter |listseparators=,%PAGE%¦,, }} }} ===== DPL, order by source article ===== {{#dpl: |category=Painter |mode=userformat |listseparators=,\n* [[%PAGE%]] -- [[%PAGESEL%]],, |linksto={{#dpl: |mode=userformat |category=Painter |listseparators=,%PAGE%¦,, }} }} </pre>