Wgraph:Sample Genealogy 2

From FollowTheScore
Jump to: navigation, search

We use mediawiki templates to hide basic layout characteristics

Maybe we want to draw more than one genealogy tree. And of course all of them should follow the same layout pattern. Ideally it should be possible to change that layout pattern at a central point without having to edit all the individual trees.

  • We put global graph properties (orientation etc.) into a template.
  • We put all the type definitions in the same template.
  • We define another template which cares for 'comment nodes'. It creates an info node and attaches it to a given node.
  • Note that the sequence of statements in a WGL graph description does not matter.

Now the WGL source can be reduced to the core of its contents.

{{#wgraph: svg | thumb = 80 |

 node John_Smith       { type male   label "John Smith\n* 21.06.1952" }
 node Bella_Smith      { type female label "Bella Smith\n* 03.04.1955" }
 node Dave_Smith       { type male   label "Dave Smith\n* 30.05.1986" }
 node Paul_Smith       { type male   label "Paul Smith\n* 28.02.1988" }
 node Susan_Smith      { type female label "Susan Smith\n* 04.06.1995" }
 edge Susan_Smith        John_Smith         { type father }
 edge Paul_Smith         John_Smith         { type father }
 edge Dave_Smith         John_Smith         { type father }
 edge Susan_Smith        Bella_Smith        { type mother }
 edge Paul_Smith         Bella_Smith        { type mother }
 edge Dave_Smith         Bella_Smith        { type mother }
 edge Bella_Smith        John_Smith         { type marriage label 01.03.1985 }
   edge from "John Smith" to "John Smith" "_info" { type info }
 node "John Smith" "_info" { type info label "that & this" }
   edge from "Bella Smith" to "Bella Smith" "_info" { type info }
 node "Bella Smith" "_info" { type info label "this and that" }
   nodetype male    { shape box color #ddddff bordercolor #9999ff width 140 textwidth 20 }
 nodetype female  { shape box color #ffdddd bordercolor #ff9999 width 140 textwidth 20 }
 edgetype father   { color #7777ff backarrowsize 10 backarrowstyle solid arrowsize 0 }
 edgetype mother   { color #ff7777 backarrowsize 10 backarrowstyle solid arrowsize 0 }
 edgetype marriage { kind rightnear arrowstyle line  backarrowstyle line backarrowsize 10 color #ff77ff }
 nodetype info     { color #f0f0f0 borderstyle dashed bordercolor #e0e0e0 }
 edgetype info     { kind near arrowstyle none linestyle dotted color lightgray }
 nodetype 'undefined node' { bordercolor red 
                          // label '%%?' 
 }
 orientation bottom_to_top
 splines yes


}}

  node John_Smith       { type male   label "John Smith\n*'' 21.06.1952''" }
  node Bella_Smith      { type female label "Bella Smith\n*'' 03.04.1955''" }
  node Dave_Smith       { type male   label "Dave Smith\n*'' 30.05.1986''" }
  node Paul_Smith       { type male   label "Paul Smith\n*'' 28.02.1988''" }
  node Susan_Smith      { type female label "Susan Smith\n*'' 04.06.1995''" }

  edge Susan_Smith        John_Smith         { type father }
  edge Paul_Smith         John_Smith         { type father }
  edge Dave_Smith         John_Smith         { type father }
  edge Susan_Smith        Bella_Smith        { type mother }
  edge Paul_Smith         Bella_Smith        { type mother }
  edge Dave_Smith         Bella_Smith        { type mother }

  edge Bella_Smith        John_Smith         { type marriage label 01.03.1985 }

  {{Wgraph:Genealogy Comment|Gero Scholz|some additional information}}
  {{Wgraph:Genealogy Comment|Rosa Scholz|some additional information}}
  {{Wgraph:Genealogy Graph}}
continue with Wgraph:Sample Genealogy 3 ..
back to       Wgraph:Sample Genealogy ..