Difference between revisions of "Wgraph:Example 4"

From FollowTheScore
Jump to: navigation, search
Line 13: Line 13:
 
First we show the output of the DPL query which is embedded in the ''Wgraph'' definition:
 
First we show the output of the DPL query which is embedded in the ''Wgraph'' definition:
  
{|
+
{|class=wikitable
 +
!DPL result (ordered by target article)
 +
!DPL result (ordered by source article)
 +
|-
 
|
 
|
===== DPL, order by target article =====
 
 
{{#dpl:
 
{{#dpl:
 
   |category=Painter
 
   |category=Painter
Line 27: Line 29:
 
}}
 
}}
 
|
 
|
===== DPL, order by source article =====
 
 
{{#dpl:
 
{{#dpl:
 
   |category=Painter
 
   |category=Painter
Line 39: Line 40:
 
}}
 
}}
 
|}
 
|}
 +
 +
For our graph it does not matter which variant of the DPL query we take.
  
 
{{#wgraph: svg | thumb=40 | wgl |
 
{{#wgraph: svg | thumb=40 | wgl |

Revision as of 19:12, 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.

First we show the output of the DPL query which is embedded in the Wgraph definition:

DPL result (ordered by target article) DPL result (ordered by source article)

For our graph it does not matter which variant of the DPL query we take.

{{#wgraph: svg | thumb=40 | wgl |

 // the painters
 
node 'Van Gogh' { type = 'Expressionism, Painter' }
node 'Renoir' { type = 'Impressionism, Painter' }
node 'Cezanne' { type = 'Painter' }
node 'Manet' { type = 'Painter' }
node 'Signac' { type = 'Impressionism, Painter' }
 // their relations
 
edge from 'Cezanne' to 'Renoir' {}
edge from 'Manet' to 'Renoir' {}
edge from 'Renoir' to 'Cezanne' {}
edge from 'Signac' to 'Renoir' {}
 nodetype 'undefined node' { href '%%' }
 nodetype Impressionism { color lightmagenta href %% }
 nodetype Expressionism { color lightyellow href %% }

}}