Wgraph:Sample Genealogy 2

From FollowTheScore
Revision as of 13:28, 21 July 2007 by Gero (talk | contribs) (New page: == 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. ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 layoutr 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 Gero_Scholz      { type male   label "Gero Scholz\n* 24.09.1956" }
 node Rosa_Scholz      { type female label "Rosa Scholz\n* 05.07.1949" }
 node Bernhard_Scholz  { type male   label "Bernhard Scholz\n* 31.07.1987" }
 node Andreas_Scholz   { type male   label "Andreas Scholz\n* 18.01.1989" }
 node Lena_Scholz      { type female label "Lena Scholz\n* 14.03.1994" }
 edge Lena_Scholz        Gero_Scholz        { type father }
 edge Andreas_Scholz     Gero_Scholz        { type father }
 edge Bernhard_Scholz    Gero_Scholz        { type father }
 edge Lena_Scholz        Rosa_Scholz        { type mother }
 edge Andreas_Scholz     Rosa_Scholz        { type mother }
 edge Bernhard_Scholz    Rosa_Scholz        { type mother }
 edge Rosa_Scholz        Gero_Scholz        { type marriage label 02.01.1987 }
   edge from "Gero Scholz" to "Gero Scholz" "_info" { type info }
 node "Gero Scholz" "_info" { type info label "that & this" }
   edge from "Rosa Scholz" to "Rosa Scholz" "_info" { type info }
 node "Rosa Scholz" "_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 Gero_Scholz      { type male   label "Gero Scholz\n*'' 24.09.1956''" }
  node Rosa_Scholz      { type female label "Rosa Scholz\n*'' 05.07.1949''" }
  node Bernhard_Scholz  { type male   label "Bernhard Scholz\n*'' 31.07.1987''" }
  node Andreas_Scholz   { type male   label "Andreas Scholz\n*'' 18.01.1989''" }
  node Lena_Scholz      { type female label "Lena Scholz\n*'' 14.03.1994''" }

  edge Lena_Scholz        Gero_Scholz        { type father }
  edge Andreas_Scholz     Gero_Scholz        { type father }
  edge Bernhard_Scholz    Gero_Scholz        { type father }
  edge Lena_Scholz        Rosa_Scholz        { type mother }
  edge Andreas_Scholz     Rosa_Scholz        { type mother }
  edge Bernhard_Scholz    Rosa_Scholz        { type mother }

  edge Rosa_Scholz        Gero_Scholz        { type marriage label 02.01.1987 }

  {{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 ..