From GamingWiki
Jump to: navigation, search
 
(12 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
<onlyinclude><!--
 
<onlyinclude><!--
  
-->{{#ask: [[Bob Hurst]][[:+]]
+
-->{{#vardefine: root | {{{root|{{PAGENAME}}}}} }}<!--
|?name
 
|?high concept
 
|?has relationship=relationship
 
|?has relationship#name|+index=1
 
|?has relationship#desc|+index=2
 
|format=table }}<!--
 
-->
 
SIO testing:
 
{{#ask: [[is relationship of character::Bob Hurst]]
 
|mainlabel=-
 
|?has name
 
|?has description
 
|format=table}}<!--
 
--><!-- {{#arrayprint: relationships}} --><!--
 
  
--><graphviz border='frame' format='png' renderer='neato'>
+
--><noinclude>{{#vardefine: root | Maia Guarao }}</noinclude><!--
 +
 
 +
-->{{#hashdefine: relhash |<!--
 +
  -->{{#ask: [[Is relationship of::{{#var:root}}]]
 +
      |mainlabel=-
 +
      |?Has name=
 +
      |?Has description=
 +
      |format=array |propsep=;|sep=,}}<!--
 +
-->}}<!--
 +
 
 +
-->{{#hashdefine: invhash |<!--
 +
  -->{{#ask: [[Is relationship of::+]][[Has name::{{#var:root}}]]
 +
      |mainlabel=-
 +
      |?Is relationship of=
 +
      |?Has description=
 +
      |format=array |propsep=;|sep=,}}<!--
 +
-->}}<!--
 +
 
 +
-->{{#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 |
 
  digraph character {
 
  digraph character {
   {
+
   rankdir=LR;
   node [fontcolor=blue];
+
   node [fontcolor=blue,fontsize=12];
   Bob_Hurst  [URL="Bob Hurst",  label="Bob Hurst"];
+
   "{{#var:root}}" [URL="{{#var:root}}"];
   Jack_Marks [URL="Jack Marks", label="Jack Marks"];
+
 
   Xu_Xi_Meng [URL="Xu Xi Meng", label="Xu Xi Meng"];
+
   { rank=same;
 +
{{#if: {{#var:hasrel}}|{{#hashprint: relhash ||%%%% |@@@@ |{{#if: %%%%|
 +
  "%%%%" [URL="%%%%"];
 +
}}}}}}
 +
{{#if: {{#var:hasinv}}|{{#hashprint: invhash ||%%%% |@@@@ |{{#if: %%%%|
 +
   {"%%%%" [URL="%%%%"]};
 +
}}}}}}
 
   }
 
   }
   edge [len=2];
+
 
   Bob_Hurst -> Jack_Marks [label="went to school with"];
+
   edge [fontsize=9];
   Bob_Hurst -> Xu_Xi_Meng [label="was a ghoul servitor for"];
+
{{#if: {{#var:hasrel}}|{{#hashprint: relhash ||%%%% |@@@@ |{{#if: %%%%|
 +
   "{{#var:root}}" -> "%%%%" [label="@@@@"];
 +
}}}}}}
 +
{{#if: {{#var:hasinv}}|{{#hashprint: invhash ||%%%% |@@@@ |{{#if: %%%%|
 +
   "%%%%" -> "{{#var:root}}" [label="@@@@"];
 +
}}}}}}
 +
 
 
  }
 
  }
</graphviz><!--
+
|border=frame |format=png |renderer=dot }}<!-- endtag
 +
 
 +
-->}}<!-- endif
  
 
--></onlyinclude>
 
--></onlyinclude>

Latest revision as of 18:51, 6 May 2014

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>