From GamingWiki
Line 5: | Line 5: | ||
-->{{#vardefine: root | {{{root|{{PAGENAME}}}}} }}<!-- | -->{{#vardefine: root | {{{root|{{PAGENAME}}}}} }}<!-- | ||
− | --><noinclude>{{#vardefine: root | | + | --><noinclude>{{#vardefine: root | Maia Guarao }}</noinclude><!-- |
-->{{#hashdefine: relhash |<!-- | -->{{#hashdefine: relhash |<!-- | ||
Line 23: | Line 23: | ||
-->}}<!-- | -->}}<!-- | ||
− | -->{{#if: {{#hashprint: relhash}}{{#hashprint: invhash}}|<!-- | + | -->{{#vardefine:hasrel|{{#if: {{#hashprint: relhash}}|1}}}}<!-- |
+ | -->{{#vardefine:hasinv|{{#if: {{#hashprint: invhash}}|1}}}}<!-- | ||
+ | |||
+ | --><noinclude>{{#tag:pre|{{#hashprint: relhash}} }}</noinclude><!-- | ||
+ | --><noinclude>{{#tag:pre|{{#hashprint: invhash}} }}</noinclude><!-- | ||
+ | |||
+ | -->{{#if: {{#var:hasrel}}{{#var:hasinv}}|<!-- | ||
+ | |||
+ | Trim out "<MANY>" from descriptions | ||
+ | -->{{#hashprint: relhash ||%%%%|@@@@|{{#if:{{#explode:@@@@|<MANY>|1}}|{{#hashinclude:relhash|%%%%={{#explode:@@@@|<MANY>|0}}}}}}}}<!-- | ||
+ | -->{{#hashprint: invhash ||%%%%|@@@@|{{#if:{{#explode:@@@@|<MANY>|1}}|{{#hashinclude:invhash|%%%%={{#explode:@@@@|<MANY>|0}}}}}}}}<!-- | ||
-->{{#tag: graphviz | | -->{{#tag: graphviz | | ||
Line 31: | Line 41: | ||
{ rank=same; | { rank=same; | ||
− | {{#if: {{# | + | {{#if: {{#var:hasrel}}|{{#hashprint: relhash ||%%%% |@@@@ |{{#if: %%%%| |
"%%%%" [URL="%%%%"]; | "%%%%" [URL="%%%%"]; | ||
}}}}}} | }}}}}} | ||
− | {{#if: {{# | + | {{#if: {{#var:hasinv}}|{{#hashprint: invhash ||%%%% |@@@@ |{{#if: %%%%| |
{"%%%%" [URL="%%%%"]}; | {"%%%%" [URL="%%%%"]}; | ||
}}}}}} | }}}}}} | ||
Line 40: | Line 50: | ||
edge [fontsize=9]; | edge [fontsize=9]; | ||
− | {{#if: {{# | + | {{#if: {{#var:hasrel}}|{{#hashprint: relhash ||%%%% |@@@@ |{{#if: %%%%| |
"{{#var:root}}" -> "%%%%" [label="@@@@"]; | "{{#var:root}}" -> "%%%%" [label="@@@@"]; | ||
}}}}}} | }}}}}} | ||
− | {{#if: {{# | + | {{#if: {{#var:hasinv}}|{{#hashprint: invhash ||%%%% |@@@@ |{{#if: %%%%| |
"%%%%" -> "{{#var:root}}" [label="@@@@"]; | "%%%%" -> "{{#var:root}}" [label="@@@@"]; | ||
}}}}}} | }}}}}} | ||
} | } | ||
− | |border=frame |format=png |renderer=dot }}<!-- | + | |border=frame |format=png |renderer=dot }}<!-- endtag |
− | -->}}<!-- | + | -->}}<!-- endif |
--></onlyinclude> | --></onlyinclude> |
Revision as of 00:58, 16 July 2012
Draw a graph of the relationships of a character or other entity.
|sep=,
|sep=,
<graphviz border="frame" format="png" renderer="dot">
digraph character { [rankdir=LR] node [fontcolor=blue,fontsize=12]; "Maia Guarao" [URL="Maia Guarao"];
{ rank=same;
"Template:((#ask: Is relationship of::Maia Guarao
|mainlabel=- |?Has name= |?Has description= |format=array |propsep=" [URL="Template:((#ask: Is relationship of::Maia Guarao |mainlabel=- |?Has name= |?Has description= |format=array |propsep="];"Template:))" [URL="Template:))"];
{"Template:((#ask: Is relationship of::+Has name::Maia Guarao
|mainlabel=- |?Is relationship of= |?Has description= |format=array |propsep=" [URL="Template:((#ask: Is relationship of::+Has name::Maia Guarao |mainlabel=- |?Is relationship of= |?Has description= |format=array |propsep="]};{"Template:))" [URL="Template:))"]}; }
edge [fontsize=9];
"Maia Guarao" -> "Template:((#ask: Is relationship of::Maia Guarao
|mainlabel=- |?Has name= |?Has description= |format=array |propsep=" [label="|sep="];"Maia Guarao" -> "Template:))" [label=""];
"Template:((#ask: Is relationship of::+Has name::Maia Guarao
|mainlabel=- |?Is relationship of= |?Has description= |format=array |propsep=" -> "Maia Guarao" [label="|sep="];"Template:))" -> "Maia Guarao" [label=""];
}
</graphviz>