0

I am trying to create a diagram using grViz function from DiagrammeR package in R. But for some reason which I can not understand, two edges that I thought should be of equal length are drawn with different lengths which makes it asymmetrical.

Here is my code:

DiagrammeR::grViz("
      digraph G{
      rankdir = LR;
      rank1 [style = invisible];
      rank2 [style = invisible];
      rank3 [style = invisible];
      
      rank1 -> rank2 -> rank3 [color = white];

      graph[layout = dot,
      rankdir = LR,
      overlap = true,
      fontsize = 50]
      
      node[shape = circle,
      fixedsize = true
      width = 1.3
      ]
      
HFI [label = 'A']
NI  [label = 'B']      
PRD [abel = 'C']
BMI [label = 'D']
VA  [label = 'E']
OL  [label = 'F']
CH  [label = 'G']

NI -> CH [label = 'H2']
PRD -> CH [label = 'H4']
HFI -> VA [label = 'H6']
BMI -> VA [label = 'H5']
VA -> CH [label = 'H3']
OL -> CH [label = 'H1']

{rank = same;
rank1 -> BMI -> HFI [style=invis];
rankdir = TB;}
{
rank = same;
rank2 -> OL -> NI -> VA -> PRD [style=invis];
rankdir = TB;
}
}")

Here is the result I get: enter image description here

I want H5 and H6 (the left-most edges) to appear with the same length.

0 Answers0