Разместите узлы Graphviz рядом без стрелки - PullRequest
0 голосов
/ 25 февраля 2020

Есть ли какой-нибудь способ достичь того же результата, что и this image (выполненный в краске) ​​автоматически на Graphviz? Синие узлы предназначены исключительно для информации, и каждый узел должен иметь один на своей стороне.

Ответы [ 2 ]

0 голосов
/ 07 марта 2020

Используя комбинацию nodesep , margin , подграфа s и кластеров , вы можете довольно близко подойти:

digraph pairs { nodesep=.02
  splines=line 
  subgraph cluster_1 { margin="24"  peripheries=0 
   { edge [style=invis] rank=same
    n1 [ label="a"    shape=oval height=.6  ]
    n1_X [   shape=rect color=blue height=.4 ]
    n1 -> n1_X  [style=invis]
   }
  }

  subgraph cluster_2 { margin="24"  peripheries=0 
   { edge [style=invis] rank=same
    n2 [ label="{2}"    shape=oval height=.6  ]
    n2_X [   shape=rect color=blue height=.4 ]
    n2 -> n2_X  [style=invis]
   }
  }

// more of the same ...

  edge[dir=none]
n1 -> {n2 n3 n4 n5 }
n2 -> {n6 n7 }
n3 -> {n6 n8 n9 }
n4 -> {n7 n10 n13 }
n5 -> {n8 n10 }
n6 -> {n11 n15 }
n7 -> {n15 }
n8 -> {n11 n12 }
n9 -> {n12 n13 }
n10 -> {n14 }
n11 -> {n17 }
n12 -> {n16 }
n13 -> {n15 n16 }
n14 -> {n16 }
n15 -> {n17 }
n16 -> {n17 }
}

enter image description here

0 голосов
/ 03 марта 2020

Используйте xlabel с html таблицей или невидимыми краями

digraph G {

A[xlabel=<<table border="1" cellborder="0" color="blue"><tr><td>a</td></tr></table>>]
A->B->D
A->C->D
{
    node[shape=rect color=blue]
A1 B1 C1 D1
}
{
    edge[dir=none style=dotted]
    //edge[dir=none color=invis]
{rank=same A->A1}
{rank=same B->B1}
{rank=same C->C1}
{rank=same D->D1}
}
}

enter image description here

...