Wgraph:Sample Genealogy 3
From Dpldemo
We add a "semantic template" which hides Wgraph layout syntax completely
Can we go any further in our search for abstraction? Yes, we can put the semantics of genealogy in foreground instead of the graphical aspect. This will open new doors. So our next step is to define a template which carries the semantics of the application domain.
- In our example this means to define a genealogy template for a person which expects parameters like 'father' and 'mother'.
- As not all parameters may be filled we have to take care for such situations.
- Authors using the person template may add spaces and line breaks in the template call. We do not want to see these whitespace characters in the graph. WGL´s mechanism of string concatenation and white space stripping is quite helpful in this regard.
Now the source for our graph begins to look really nice:
(made with Wgraph)
{{#wgraph: svg | thumb = 80 |
{{Wgraph:Genealogy Graph}}
{{Wgraph:Genealogy Person
| John Smith
| male
| born = 21.06.1952
| info = that & this
| married to = Bella Smith
| marriage=01.03.1985
}}
{{Wgraph:Genealogy Person| Bella Smith |female|born=03.04.1955|info=this and that}}
{{Wgraph:Genealogy Person| Dave Smith |male |born=30.05.1986|father=John Smith|mother=Bella Smith}}
{{Wgraph:Genealogy Person| Paul Smith |male |born=28.02.1988|father=John Smith|mother=Bella Smith}}
{{Wgraph:Genealogy Person| Susan Smith |female|born=04.06.1995|father=Gero Scholz|mother=Rosa Scholz}}
}}
continue with Wgraph:Sample Genealogy 4 .. back to Wgraph:Sample Genealogy 2 ..