Difference between revisions of "Artefact:Template/org/oomodels/converter/templates/simplediagram-1.0-svg-1.1"

From OOModels
Jump to navigationJump to search
 
(28 intermediate revisions by the same user not shown)
Line 9: Line 9:
==Code==
==Code==


<div class="code">
<OOMCode type="org/oogenerator/Template/2.0">
<span class="oogintro">G-2.0-xml_string-1.0 -*- coding: utf-8; -*-</span>
G-2.0-xml_string-1.0 -*- coding: utf-8; -*-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<span class="oogindentation">  ⋮</span><span class="oogcode">«∀(a:<span class="oogpath">‖"Ⓧ/Diagram/Item"</span>){»</span><span class="oogcontinuation">…</span>
  ⋮▼import java.util.HashMap;▼…
<span class="oogindentation"> </span><span class="oogcode">« String name = ((XMLNode)<span class="oogpath">‖"Ⓧ/@Name"</span>).toString();</span>
  ⋮«HashMap items_by_pos = new HashMap();»…
<span class="oogcode">     String type = ((XMLNode)<span class="oogpath">‖"Ⓧ/@Type"</span>).toString();</span>
  ⋮«∀(a:‖"Ⓧ/Diagram/Item"){»…
<span class="oogcode">    int len = name.length();</span>
  ⋮« String name = ((XMLNode)‖"/@Name").toString();
<span class="oogcode">    int width = len * 10; »</span><span class="oogcontinuation">…</span>
    String type = ((XMLNode)<span class="oogpath">‖"Ⓧ/@Type"</span>).toString();
  <g transform="translate(<span class="oogexpression">◂8*Integer.parseInt(((XMLNode)(<span class="oogpath">‖"Ⓧ/@X"</span>)).toString())▸</span>,<span class="oogexpression">◂16*Integer.parseInt(((XMLNode)(<span class="oogpath">‖"Ⓧ/@Y"</span>)).toString())</span>)">
    int len = name.length();
<span class="oogindentation">    ⋮</span><span class="oogcode">«if(type.equals("Class")){»</span><span class="oogcontinuation">…</span>
    int count = 0;
    <path style="fill:#000000;fill-opacity:0.49803922;stroke:none;stroke-width:1px;"
    ∀(e:‖"Ⓧ/Entry"){
              d="M 2,2 L <span class="oogexpression">◂2+width▸</span>,2 L <span class="oogexpression">◂2+width▸</span>,46 L 2,46 L 2,2 z "/>
      String entry = ((XMLNode)‖"Ⓧ/@Text").toString();
    <path style="fill:#80A0C0;fill-opacity:1;stroke:#000000;stroke-width:1px;"
      if (entry.length() > len) { len = entry.length(); }
              d="M 0,0 L <span class="oogexpression">◂width▸</span>,0 L <span class="oogexpression">◂width▸</span>,44 L 0,44 L 0,0 z "/>
      count++;
<span class="oogindentation">    ⋮</span><span class="oogcode">«}»</span><span class="oogcontinuation">…</span>
    }/
<span class="oogindentation">    ⋮</span><span class="oogcode">«if(type.equals("StateMachine")){»</span><span class="oogcontinuation">…</span>
    int width = len * 10;
    <path style="fill:#000000;fill-opacity:0.49803922;stroke:none;stroke-width:1px;"
    int height = count * 24 + 44;
              d="M 2,2 L <span class="oogexpression">◂2+width▸</span>,2 L <span class="oogexpression">◂2+width▸</span>,46 L 2,46 L 2,2 z "/>
    int x = Integer.parseInt(((XMLNode)(‖"Ⓧ/@X")).toString());
     <path style="fill:#80E080;fill-opacity:1;stroke:#000000;stroke-width:1px;"
    int y = Integer.parseInt(((XMLNode)(‖"Ⓧ/@Y")).toString());
              d="M 0,0 L <span class="oogexpression">◂width▸</span>,0 L <span class="oogexpression">◂width▸</span>,44 L 0,44 L 0,0 z "/>
    Integer[] box = { 8*x, 16*y, 8*x+width, 16*y+height };
<span class="oogindentation">    ⋮</span><span class="oogcode">«}»</span><span class="oogcontinuation">…</span>
    items_by_pos.put(""+x+"-"+y+"", box); »…
<span class="oogindentation">    ⋮</span><span class="oogcode">«if(type.equals("Step")){»</span><span class="oogcontinuation">…</span>
  <a xlink:href="◂‖"Ⓧ/@Link"▸" target="_top">
    <path style="fill:#000000;fill-opacity:0.49803922;stroke:none;stroke-width:1px;"
    <g transform="translate(◂8*x▸,◂16*y▸)">
              d="M 2,2 L <span class="oogexpression">◂2+width▸</span>,2 L <span class="oogexpression">◂13+width▸</span>,24 L <span class="oogexpression">◂2+width▸</span>,46 L 2,46 L 2,2 z "/>
    ⋮«if(type.equals("Class")){»…
    <path style="fill:#e6f28b;fill-opacity:1;stroke:#000000;stroke-width:1px;"
      <path style="fill:#000000;fill-opacity:0.49803922;stroke:none;stroke-width:1px;"
              d="M 0,0 L <span class="oogexpression">◂width▸</span>,0 L <span class="oogexpression">◂11+width▸</span>,22 L <span class="oogexpression">◂width▸</span>,44 L 0,44 L 0,0 z "/>
                d="M 2,2 L ◂2+width▸,2 L ◂2+width▸,◂2+height▸ L 2,◂2+height▸ L 2,2 z "/>
<span class="oogindentation">    ⋮</span><span class="oogcode">«}»</span><span class="oogcontinuation">…</span>
      <path style="fill:#80A0C0;fill-opacity:1;stroke:#000000;stroke-width:1px;"
<span class="oogindentation">    ⋮</span><span class="oogcode">«if(type.equals("Constellation")){»</span><span class="oogcontinuation">…</span>
                d="M 0,0 L ◂width▸,0 L ◂width▸,◂height▸ L 0,◂height▸ L 0,0 z "/>
    <path style="fill:#000000;fill-opacity:0.49803922;fill-rule:evenodd;stroke:none;stroke-width:1px;"
      ⋮«if(count != 0){»…
              d="M 14,2 L <span class="oogexpression">◂8+width▸</span>,2 C <span class="oogexpression">◂15+width▸</span>,2 <span class="oogexpression">◂20+width▸</span>,8 <span class="oogexpression">◂20+width▸</span>,15 L <span class="oogexpression">◂20+width▸</span>,34 C <span class="oogexpression">◂20+width▸</span>,41 <span class="oogexpression">◂15+width▸</span>,47 <span class="oogexpression">◂8+width▸</span>,47 L 14,47 C 7,47 2,41 2,34 L 2,15 C 2,8 7,2 14,2 z "/>
      <path style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1px;"
    <path style="fill:#d8cae2;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;"
                d="M 0,44 L ◂width▸,44 "/>
              d="M 12,0 L <span class="oogexpression">◂6+width▸</span>,0 C <span class="oogexpression">◂13+width▸</span>,0 <span class="oogexpression">◂18+width▸</span>,6 <span class="oogexpression">◂18+width▸</span>,13 L <span class="oogexpression">◂18+width▸</span>,32 C <span class="oogexpression">◂18+width▸</span>,39 <span class="oogexpression">◂13+width▸</span>,45 <span class="oogexpression">◂6+width▸</span>,45 L 12,45 C 5,45 0,39 0,32 L 0,13 C 0,6 5,0 12,0 z "/>
      ⋮«}»…
<span class="oogindentation">    ⋮</span><span class="oogcode">«}»</span><span class="oogcontinuation">…</span>
    ⋮«}»…
    <text y="26" x="<span class="oogexpression">◂1+(width/2)▸</span>"
    ⋮«if(type.equals("StateMachine")){»…
          style="font-size:16px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;
      <path style="fill:#000000;fill-opacity:0.49803922;stroke:none;stroke-width:1px;"
                  text-align:center;text-anchor:middle;fill:#000000;font-family:Sans"><span class="oogexpression">◂name▸</span></text>
                d="M 2,2 L ◂2+width▸,2 L ◂2+width▸,◂2+height▸ L 2,◂2+height▸ L 2,2 z "/>
  </g>
      <path style="fill:#80E080;fill-opacity:1;stroke:#000000;stroke-width:1px;"
  <!-- <span class="oogexpression">◂<span class="oogpath">‖"Ⓧ/@Item"</span>▸</span> -->
                d="M 0,0 L ◂width▸,0 L ◂width▸,◂height▸ L 0,◂height▸ L 0,0 z "/>
<span class="oogindentation">  ⋮</span><span class="oogcode">«}/∀»</span><span class="oogcontinuation">…</span>
      ⋮«if(count != 0){»…
</svg>
      <path style="stroke:#000000;stroke-width:1px;"
</div>
                d="M 0,44 L ◂width▸,44 "/>
      ⋮«}»…
    ⋮«}»…
     ⋮«if(type.equals("Step")){ box[2] += 11; »…
      <path style="fill:#000000;fill-opacity:0.49803922;stroke:none;stroke-width:1px;"
                d="M 2,2 L ◂2+width▸,2 L ◂13+width▸,24 L ◂2+width▸,◂2+height▸ L 2,◂2+height▸ L 2,2 z "/>
      <path style="fill:#e6f28b;fill-opacity:1;stroke:#000000;stroke-width:1px;"
                d="M 0,0 L ◂width▸,0 L ◂11+width▸,22 L ◂width▸,◂height▸ L 0,◂height▸ L 0,0 z "/>
      ⋮«if(count != 0){»…
      <path style="stroke:#000000;stroke-width:1px;"
                d="M 0,44 L ◂width▸,44 "/>
      ⋮«}»…
    ⋮«}»…
    ⋮«if(type.equals("Constellation")){ box[2] += 18; »…
      <path style="fill:#000000;fill-opacity:0.49803922;fill-rule:evenodd;stroke:none;stroke-width:1px;"
                d="M 14,2 L ◂8+width▸,2 C ◂15+width▸,2 ◂20+width▸,8 ◂20+width▸,15 L ◂20+width▸,◂height-10▸ C ◂20+width▸,◂height-3▸ ◂15+width▸,◂height+3▸ ◂8+width▸,◂height+3▸ L 14,◂height+3▸ C 7,◂height+3▸ 2,◂height-3▸ 2,◂height-10▸ L 2,15 C 2,8 7,2 14,2 z "/>
      <path style="fill:#d8cae2;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;"
                d="M 12,0 L ◂6+width▸,0 C ◂13+width▸,0 ◂18+width▸,6 ◂18+width▸,13 L ◂18+width▸,◂height-12▸ C ◂18+width▸,◂height-5▸ ◂13+width▸,◂height+1▸ ◂6+width▸,◂height+1▸ L 12,◂height+1▸ C 5,◂height+1▸ 0,◂height-5▸ 0,◂height-12▸ L 0,13 C 0,6 5,0 12,0 z "/>
      ⋮«if(count != 0){»…
      <path style="stroke:#000000;stroke-width:1px;"
                d="M 2,44 L ◂20+width▸,44 "/>
      ⋮«}»…
    ⋮«}»…
      <text y="26" x="◂1+(width/2)▸"
            style="font-size:16px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;
                  text-align:center;text-anchor:middle;fill:#000000;font-family:Sans">◂name▸</text>
    ⋮«∀(e:‖"Ⓧ/Entry"){»…
      <text y="◂62+Ⓘ*24▸" x="1"
            style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;
                  text-align:center;text-anchor:left;fill:#000000;font-family:Sans">◂‖"Ⓧ/@Text"</text>
    ⋮«}/∀»…
    </g>
  </a>
  ⋮«}/∀»…
  ⋮«∀(a:‖"Ⓧ/Diagram/Generalization"){»…
  ⋮«
      int fromx = Integer.parseInt(((XMLNode)(‖"Ⓧ/@FromX")).toString());
      int fromy = Integer.parseInt(((XMLNode)(‖"Ⓧ/@FromY")).toString());
      int tox = Integer.parseInt(((XMLNode)(‖"/@ToX")).toString());
      int toy = Integer.parseInt(((XMLNode)(‖"Ⓧ/@ToY")).toString());
      Integer[] fb = (Integer[]) items_by_pos.get(""+fromx+"-"+fromy+"");
      Integer[] tb = (Integer[]) items_by_pos.get(""+tox+"-"+toy+"");
      int fx = ((fb[2]+fb[0])/2);
      int fy = fb[1];
      int tx = ((tb[2]+tb[0])/2);
      int ty = tb[3];
    »…
    <g>
      <path style="fill:none;stroke-opacity:1;stroke:#000000;stroke-width:1px"
                d="M ◂tx▸,◂ty▸ L ◂tx-10▸,◂ty+10▸ L ◂tx+10▸,◂ty+10▸ L ◂tx▸,◂ty▸ z "/>
      <path style="fill:none;stroke-opacity:1;stroke:#000000;stroke-width:1px"
                d="M ◂fx▸,◂fy▸ …
                                      ⋮«if(fy-ty>40){»…
                              ⋮L ◂fx▸,◂(fy+ty+10)/2▸ L ◂tx▸,◂(fy+ty+10)/2▸ …
                                      ⋮«}else{»…
                              ⋮L ◂fx▸,◂fy-20▸ L ◂(fx+tx)/2▸,◂fy-20▸ L ◂(fx+tx)/2▸,◂ty+30▸ L ◂tx▸,◂ty+30▸ …
                                      ⋮«}»…
                              ⋮L ◂tx▸,◂ty+10▸ "/>
    </g>
  ⋮«}/∀»…
  ⋮«∀(a:‖"Ⓧ/Diagram/Association"){»…
  ⋮«
      int fromx = Integer.parseInt(((XMLNode)(‖"Ⓧ/@FromX")).toString());
      int fromy = Integer.parseInt(((XMLNode)(‖"Ⓧ/@FromY")).toString());
      int tox = Integer.parseInt(((XMLNode)(‖"Ⓧ/@ToX")).toString());
      int toy = Integer.parseInt(((XMLNode)(‖"Ⓧ/@ToY")).toString());
      if (fromx > tox) { int temp = fromx; fromx = tox; tox = temp; temp = fromy; fromy = toy; toy = temp; }
      Integer[] fb = (Integer[]) items_by_pos.get(""+fromx+"-"+fromy+"");
      Integer[] tb = (Integer[]) items_by_pos.get(""+tox+"-"+toy+"");
      int fx = fb[2];
      int fy = ((fb[3]+fb[1])/2);
      int tx = tb[0];
      int ty = ((tb[3]+tb[1])/2);
    »…
    <g>
      <path style="fill:none;stroke-opacity:1;stroke:#000000;stroke-width:1px"
                d="M ◂fx▸,◂fy▸ …
                                      ⋮«if(tx-fx>40){»…
                              ⋮L ◂(fx+tx)/2▸,◂fy▸ L ◂(fx+tx)/2▸,◂ty▸ …
                                      ⋮«}else{»…
                              ⋮L ◂fx+20▸,◂fy▸ L ◂fx+20▸,◂(fy+ty)/2▸ L ◂fx-20▸,◂(fy+ty)/2▸ L ◂fx-20▸,◂ty▸ …
                                      ⋮«}»…
                              ⋮L ◂tx▸,◂ty▸ "/>
    </g>
  ⋮«}/∀»…
</svg>
</OOMCode>

Latest revision as of 20:15, 18 December 2009

Classification
Type Type:org/oogenerator/Template/2.0
Domain Domain:it/development/formatting
Category Type:org/oomodels/wiki/Template
Maturity final
More
Download Code
Namespace (more)

OOModels main namespace

create new pages

Code[edit]


G-2.0-xml_string-1.0 -*- coding: utf-8; -*-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  ⋮▼import java.util.HashMap;▼«HashMap items_by_pos = new HashMap();»«∀(a:‖"Ⓧ/Diagram/Item"){»« String name = ((XMLNode)‖"Ⓧ/@Name").toString();
     String type = ((XMLNode)<span class="oogpath">‖"Ⓧ/@Type"</span>).toString();
     int len = name.length();
     int count = 0;
     ∀(e:‖"Ⓧ/Entry"){
       String entry = ((XMLNode)‖"Ⓧ/@Text").toString();
       if (entry.length() > len) { len = entry.length(); }
       count++;
     }/∀
     int width = len * 10;
     int height = count * 24 + 44;
     int x = Integer.parseInt(((XMLNode)(‖"Ⓧ/@X")).toString());
     int y = Integer.parseInt(((XMLNode)(‖"Ⓧ/@Y")).toString());
     Integer[] box = { 8*x, 16*y, 8*x+width, 16*y+height };
     items_by_pos.put(""+x+"-"+y+"", box); »
  <a xlink:href="‖"Ⓧ/@Link"" target="_top">
    <g transform="translate(◂8*x▸,◂16*y▸)">
     ⋮«if(type.equals("Class")){»
      <path style="fill:#000000;fill-opacity:0.49803922;stroke:none;stroke-width:1px;"
                d="M 2,2 L ◂2+width▸,2 L ◂2+width▸,◂2+height▸ L 2,◂2+height▸ L 2,2 z "/>
      <path style="fill:#80A0C0;fill-opacity:1;stroke:#000000;stroke-width:1px;"
                d="M 0,0 L ◂width▸,0 L ◂width▸,◂height▸ L 0,◂height▸ L 0,0 z "/>
       ⋮«if(count != 0){»
      <path style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1px;"
                d="M 0,44 L ◂width▸,44 "/>
       ⋮«}»«}»«if(type.equals("StateMachine")){»
      <path style="fill:#000000;fill-opacity:0.49803922;stroke:none;stroke-width:1px;"
                d="M 2,2 L ◂2+width▸,2 L ◂2+width▸,◂2+height▸ L 2,◂2+height▸ L 2,2 z "/>
      <path style="fill:#80E080;fill-opacity:1;stroke:#000000;stroke-width:1px;"
                d="M 0,0 L ◂width▸,0 L ◂width▸,◂height▸ L 0,◂height▸ L 0,0 z "/>
       ⋮«if(count != 0){»
      <path style="stroke:#000000;stroke-width:1px;"
                d="M 0,44 L ◂width▸,44 "/>
       ⋮«}»«}»«if(type.equals("Step")){ box[2] += 11; »
      <path style="fill:#000000;fill-opacity:0.49803922;stroke:none;stroke-width:1px;"
                d="M 2,2 L ◂2+width▸,2 L ◂13+width▸,24 L ◂2+width▸,◂2+height▸ L 2,◂2+height▸ L 2,2 z "/>
      <path style="fill:#e6f28b;fill-opacity:1;stroke:#000000;stroke-width:1px;"
                d="M 0,0 L ◂width▸,0 L ◂11+width▸,22 L ◂width▸,◂height▸ L 0,◂height▸ L 0,0 z "/>
       ⋮«if(count != 0){»
      <path style="stroke:#000000;stroke-width:1px;"
                d="M 0,44 L ◂width▸,44 "/>
       ⋮«}»«}»«if(type.equals("Constellation")){ box[2] += 18; »
      <path style="fill:#000000;fill-opacity:0.49803922;fill-rule:evenodd;stroke:none;stroke-width:1px;"
                d="M 14,2 L ◂8+width▸,2 C ◂15+width▸,2 ◂20+width▸,8 ◂20+width▸,15 L ◂20+width▸,◂height-10▸ C ◂20+width▸,◂height-3▸ ◂15+width▸,◂height+3▸ ◂8+width▸,◂height+3▸ L 14,◂height+3▸ C 7,◂height+3▸ 2,◂height-3▸ 2,◂height-10▸ L 2,15 C 2,8 7,2 14,2 z "/>
      <path style="fill:#d8cae2;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;"
                d="M 12,0 L ◂6+width▸,0 C ◂13+width▸,0 ◂18+width▸,6 ◂18+width▸,13 L ◂18+width▸,◂height-12▸ C ◂18+width▸,◂height-5▸ ◂13+width▸,◂height+1▸ ◂6+width▸,◂height+1▸ L 12,◂height+1▸ C 5,◂height+1▸ 0,◂height-5▸ 0,◂height-12▸ L 0,13 C 0,6 5,0 12,0 z "/>
       ⋮«if(count != 0){»
      <path style="stroke:#000000;stroke-width:1px;"
                d="M 2,44 L ◂20+width▸,44 "/>
       ⋮«}»«}»
      <text y="26" x="◂1+(width/2)▸"
            style="font-size:16px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;
                   text-align:center;text-anchor:middle;fill:#000000;font-family:Sans">◂name▸</text>
     ⋮«∀(e:‖"Ⓧ/Entry"){»
      <text y="◂62+Ⓘ*24▸" x="1"
            style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;
                   text-align:center;text-anchor:left;fill:#000000;font-family:Sans">‖"Ⓧ/@Text"</text>
     ⋮«}/∀»
    </g>
  </a>
  ⋮«}/∀»«∀(a:‖"Ⓧ/Diagram/Generalization"){»« 
      int fromx = Integer.parseInt(((XMLNode)(‖"Ⓧ/@FromX")).toString());
      int fromy = Integer.parseInt(((XMLNode)(‖"Ⓧ/@FromY")).toString());
      int tox = Integer.parseInt(((XMLNode)(‖"Ⓧ/@ToX")).toString());
      int toy = Integer.parseInt(((XMLNode)(‖"Ⓧ/@ToY")).toString());
      Integer[] fb = (Integer[]) items_by_pos.get(""+fromx+"-"+fromy+"");
      Integer[] tb = (Integer[]) items_by_pos.get(""+tox+"-"+toy+"");
      int fx = ((fb[2]+fb[0])/2);
      int fy = fb[1];
      int tx = ((tb[2]+tb[0])/2);
      int ty = tb[3];
    »
    <g>
      <path style="fill:none;stroke-opacity:1;stroke:#000000;stroke-width:1px"
                d="M ◂tx▸,◂ty▸ L ◂tx-10▸,◂ty+10▸ L ◂tx+10▸,◂ty+10▸ L ◂tx▸,◂ty▸ z "/>
      <path style="fill:none;stroke-opacity:1;stroke:#000000;stroke-width:1px"
                d="M ◂fx▸,◂fy▸ «if(fy-ty>40){»
                              ⋮L ◂fx▸,◂(fy+ty+10)/2▸ L ◂tx▸,◂(fy+ty+10)/2▸ «}else{»
                              ⋮L ◂fx▸,◂fy-20▸ L ◂(fx+tx)/2▸,◂fy-20▸ L ◂(fx+tx)/2▸,◂ty+30▸ L ◂tx▸,◂ty+30▸ «}»
                              ⋮L ◂tx▸,◂ty+10▸ "/>
    </g>
  ⋮«}/∀»«∀(a:‖"Ⓧ/Diagram/Association"){»« 
      int fromx = Integer.parseInt(((XMLNode)(‖"Ⓧ/@FromX")).toString());
      int fromy = Integer.parseInt(((XMLNode)(‖"Ⓧ/@FromY")).toString());
      int tox = Integer.parseInt(((XMLNode)(‖"Ⓧ/@ToX")).toString());
      int toy = Integer.parseInt(((XMLNode)(‖"Ⓧ/@ToY")).toString());
      if (fromx > tox) { int temp = fromx; fromx = tox; tox = temp; temp = fromy; fromy = toy; toy = temp; }
      Integer[] fb = (Integer[]) items_by_pos.get(""+fromx+"-"+fromy+"");
      Integer[] tb = (Integer[]) items_by_pos.get(""+tox+"-"+toy+"");
      int fx = fb[2];
      int fy = ((fb[3]+fb[1])/2);
      int tx = tb[0];
      int ty = ((tb[3]+tb[1])/2);
    »
    <g>
      <path style="fill:none;stroke-opacity:1;stroke:#000000;stroke-width:1px"
                d="M ◂fx▸,◂fy▸ «if(tx-fx>40){»
                              ⋮L ◂(fx+tx)/2▸,◂fy▸ L ◂(fx+tx)/2▸,◂ty▸ «}else{»
                              ⋮L ◂fx+20▸,◂fy▸ L ◂fx+20▸,◂(fy+ty)/2▸ L ◂fx-20▸,◂(fy+ty)/2▸ L ◂fx-20▸,◂ty▸ «}»
                              ⋮L ◂tx▸,◂ty▸ "/>
    </g>
  ⋮«}/∀»
</svg>