From GamingWiki
Line 5: | Line 5: | ||
-->{{#vardefine: root | {{{root|{{PAGENAME}}}}} }}<!-- | -->{{#vardefine: root | {{{root|{{PAGENAME}}}}} }}<!-- | ||
− | --><noinclude>{{#vardefine: root | | + | --><noinclude>{{#vardefine: root | David Shu }}</noinclude><!-- |
-->{{#hashdefine: relhash |<!-- | -->{{#hashdefine: relhash |<!-- | ||
Line 15: | Line 15: | ||
-->}}<!-- | -->}}<!-- | ||
− | -->{{# | + | -->{{#hashdefine: invhash |<!-- |
+ | -->{{#ask: [[Is relationship of::+]][[Has name::{{#var:root}}]] | ||
+ | |mainlabel=- | ||
+ | |?Is relationship of= | ||
+ | |?Has description= | ||
+ | |format=array |propsep=;|sep=,}}<!-- | ||
+ | -->}}<!-- | ||
+ | |||
+ | -->{{#if: {{#expr:{{#hashsize: relhash}} or {{#hashsize: invhash}}}}|<!-- | ||
-->{{#tag:graphviz | | -->{{#tag:graphviz | | ||
digraph character { | digraph character { | ||
{ | { | ||
− | node [fontcolor=blue]; | + | node [fontcolor=blue,fontsize=12]; |
"{{#var:root}}" [URL="{{#var:root}}"]; | "{{#var:root}}" [URL="{{#var:root}}"]; | ||
− | {{#hashprint: relhash |;|%%%% |@@@@ |"%%%%" [URL="%%%%" | + | {{#hashprint: relhash |;|%%%% |@@@@ |"%%%%" [URL="%%%%"]}}; |
+ | {{#hashprint: invhash |;|%%%% |@@@@ |"%%%%" [URL="%%%%"]}}; | ||
} | } | ||
− | edge [len=2]; | + | edge [len=2,fontsize=10]; |
{{#hashprint: relhash ||%%%% |@@@@ |"{{#var:root}}" -> "%%%%" [label="@@@@"];}} | {{#hashprint: relhash ||%%%% |@@@@ |"{{#var:root}}" -> "%%%%" [label="@@@@"];}} | ||
+ | {{#hashprint: invhash ||%%%% |@@@@ |"%%%%" -> "{{#var:root}}" [label="@@@@"];}} | ||
} | } | ||
− | |border=frame |format=png |renderer= | + | |border=frame |format=png |renderer=dot }}<!-- |
-->}}<!-- endifeq | -->}}<!-- endifeq | ||
--></onlyinclude> | --></onlyinclude> |
Revision as of 19:08, 27 November 2011
Draw a graph of the relationships of a character or other entity.
<graphviz border="frame" format="png" renderer="dot">
digraph character { { node [fontcolor=blue,fontsize=12]; "David Shu" [URL="David Shu"]; "Template:((#ask: Is relationship of::David Shu |mainlabel=- |?Has name= |?Has description= |format=array |propsep=" [URL="Template:((#ask: Is relationship of::David Shu |mainlabel=- |?Has name= |?Has description= |format=array |propsep="];"Template:))" [URL="Template:))"]; "Template:((#ask: Is relationship of::+Has name::David Shu |mainlabel=- |?Is relationship of= |?Has description= |format=array |propsep=" [URL="Template:((#ask: Is relationship of::+Has name::David Shu |mainlabel=- |?Is relationship of= |?Has description= |format=array |propsep="];"Template:))" [URL="Template:))"]; } edge [len=2,fontsize=10]; "David Shu" -> "Template:((#ask: Is relationship of::David Shu |mainlabel=- |?Has name= |?Has description= |format=array |propsep=" [label="|sep="];"David Shu" -> "Template:))" [label=""]; "Template:((#ask: Is relationship of::+Has name::David Shu |mainlabel=- |?Is relationship of= |?Has description= |format=array |propsep=" -> "David Shu" [label="|sep="];"Template:))" -> "David Shu" [label=""]; }
</graphviz>