2017-05-03 3 views
0

Voilà ce que je veux produire dans un graphique DOT:Graphviz/DOT: Comment avoir la flèche "redirigé"

graph

je le code suivant:

\digraph 
[scale=0.7]{g1} 
{ 
    margin="0 0 0 0"; 
    rankdir="TB"; 
"X" [shape=invhouse]; 
" " [shape=house]; 
"100" [shape=cylinder]; 
"X" -> "100" 
"X" -> "+"; 
"100" -> "+" 
"+" -> " "; 
} 

J'ai aussi avoir le code suivant, qui est plus proche dans un sens, mais visuellement ne ressemble à rien de ce que je veux:

digraph { 
     node[ shape = plaintext ]; 
     a [label="X", shape = invhouse] 
     b [label="+", shape = ellipse] 
     ab1 [label="dummy", style=invis, shape=point] 
     ab2 [label="dummy", style=invis, shape=point] 
     c [label="100", shape = cylinder] 
     d [label=" ", shape=house] 
     subgraph cluster_0 { 
     style=invis 
       a -> ab1 [arrowhead=none]; 
       ab1 -> c; 
       c -> ab2; 
       ab1 -> ab2 [arrowhead=none]; 
       ab2 -> b; 
       b -> d; 
     } 
} 

Comment puis-je changer mon (mes) code (s) de manière appropriée? Toute aide serait grandement appréciée.

Répondre

0

L'attribut group permet d'amener les noeuds à la ligne.

digraph { 
    node[ shape = plaintext group=abd]; 
    a [label="X", shape = invhouse] 
    b [label="+", shape = ellipse] 
    ab1 [label="dummy", style=invis, shape=point] 
    ab2 [label="dummy", style=invis, shape=point] 
    c [label="100", shape = cylinder, group=c] 
    d [label=" ", shape=house] 
    subgraph cluster_0 { 
    style=invis 
      a -> ab1 [arrowhead=none]; 
      ab1 -> c; 
      c -> ab2; 
      ab1 -> ab2 [arrowhead=none]; 
      ab2 -> b; 
      b -> d; 
    } 
} 

straightened out

+0

C'est génial, merci! –