Difference between revisions of "Wgraph:Sample Genealogy 2"

From FollowTheScore
Jump to: navigation, search
 
Line 11: Line 11:
  
 
{{#wgraph: svg | thumb = 80 |
 
{{#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 }
+
   node John_Smith      { type male  label "John Smith\n*'' 21.06.1952''" }
   edge Andreas_Scholz    Gero_Scholz        { type father }
+
   node Bella_Smith      { type female label "Bella Smith\n*'' 03.04.1955''" }
   edge Bernhard_Scholz    Gero_Scholz        { type father }
+
   node Dave_Smith      { type male  label "Dave Smith\n*'' 30.05.1986''" }
   edge Lena_Scholz        Rosa_Scholz        { type mother }
+
   node Paul_Smith      { type male   label "Paul Smith\n*'' 28.02.1988''" }
   edge Andreas_Scholz    Rosa_Scholz        { type mother }
+
   node Susan_Smith      { type female label "Susan Smith\n*'' 04.06.1995''" }
   edge Bernhard_Scholz    Rosa_Scholz        { type mother }
 
  
   edge Rosa_Scholz       Gero_Scholz       { type marriage label 02.01.1987 }
+
   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 }
  
   {{Wgraph:Genealogy Comment|Gero Scholz|that & this}}
+
  edge Bella_Smith        John_Smith        { type marriage label 01.03.1985 }
   {{Wgraph:Genealogy Comment|Rosa Scholz|this and that}}
+
 
 +
   {{Wgraph:Genealogy Comment|John Smith|that & this}}
 +
   {{Wgraph:Genealogy Comment|Bella Smith|this and that}}
 
   {{Wgraph:Genealogy Graph}}
 
   {{Wgraph:Genealogy Graph}}
 
}}
 
}}
  
 
<pre><nowiki>
 
<pre><nowiki>
   node Gero_Scholz      { type male  label "Gero Scholz\n*'' 24.09.1956''" }
+
   node John_Smith      { type male  label "John Smith\n*'' 21.06.1952''" }
   node Rosa_Scholz     { type female label "Rosa Scholz\n*'' 05.07.1949''" }
+
   node Bella_Smith     { type female label "Bella Smith\n*'' 03.04.1955''" }
   node Bernhard_Scholz  { type male  label "Bernhard Scholz\n*'' 31.07.1987''" }
+
   node Dave_Smith      { type male  label "Dave Smith\n*'' 30.05.1986''" }
   node Andreas_Scholz  { type male  label "Andreas Scholz\n*'' 18.01.1989''" }
+
   node Paul_Smith      { type male  label "Paul Smith\n*'' 28.02.1988''" }
   node Lena_Scholz     { type female label "Lena Scholz\n*'' 14.03.1994''" }
+
   node Susan_Smith     { type female label "Susan Smith\n*'' 04.06.1995''" }
  
   edge Lena_Scholz        Gero_Scholz       { type father }
+
   edge Susan_Smith       John_Smith        { type father }
   edge Andreas_Scholz    Gero_Scholz        { type father }
+
   edge Paul_Smith        John_Smith        { type father }
   edge Bernhard_Scholz    Gero_Scholz        { type father }
+
   edge Dave_Smith        John_Smith        { type father }
   edge Lena_Scholz       Rosa_Scholz       { type mother }
+
   edge Susan_Smith       Bella_Smith       { type mother }
   edge Andreas_Scholz    Rosa_Scholz       { type mother }
+
   edge Paul_Smith        Bella_Smith       { type mother }
   edge Bernhard_Scholz    Rosa_Scholz       { type mother }
+
   edge Dave_Smith        Bella_Smith       { type mother }
  
   edge Rosa_Scholz        Gero_Scholz       { type marriage label 02.01.1987 }
+
   edge Bella_Smith       John_Smith        { type marriage label 01.03.1985 }
  
 
   {{Wgraph:Genealogy Comment|Gero Scholz|some additional information}}
 
   {{Wgraph:Genealogy Comment|Gero Scholz|some additional information}}

Latest revision as of 20:39, 17 October 2009

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