Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

graphviz with combined edges

I'm looking for a way to achieve something like this in graphviz:

          --- node B 
          |
node A ---
          |
          --- node C

another example (at the bottom): http://machining.grundfos.de/media/60727/grundfos_pumpenhandbuch.pdf#23

Is there a way of doing that with graphviz?

so far I only got orthogonal edges:

digraph G {
 graph [rankdir=LR,splines=ortho,concentrate=true];
 node [shape=box,];
 edge [dir=none];

 a -> b;
 a -> c;
}
like image 821
wombalton Avatar asked Mar 24 '14 18:03

wombalton


People also ask

What are the attributes used by GraphViz tools?

The table below describes the attributes used by various Graphviz tools. The table gives the name of the attribute, the graph components (node, edge, etc.) which use the attribute and the type of the attribute (strings representing legal values of that type).

What is the use of xdot label in GraphViz?

Only used for xdot output. If unset, graphviz will set this attribute to the xdot version used for output. External label for a node or edge. For nodes, the label will be placed outside of the node but near it. For edges, the label will be placed near the center of the edge.

What is the-s command in GraphViz?

By default, the coordinates are assumed to be in inches. However, the -s command line flag can be used to specify different units. As the output coordinates are in points, feeding the output of a graph laid out by a Graphviz program into neato or fdp will almost always require the -s flag.

How to set the color of a node in GraphViz?

All Graphviz attributes are specified by name-value pairs. Thus, to set the color of a node abc, one would use digraph { abc


1 Answers

you must introduce intermediate (eventually hidden) nodes to act as split points. For instance:

digraph G {
 graph [rankdir=LR,splines=ortho,concentrate=true];
 node [shape=box,];
 edge [dir=none];
 i [shape=point];
 a -> i -> b;
 a -> i -> c;
}

yields

enter image description here

like image 160
CapelliC Avatar answered Sep 28 '22 18:09

CapelliC