I try to use graphviz to draw graph with minimum crossing number to make it understandable. Graphviz do it well with default settings, but sometimes it create many intersections of outgoing arrows.
Can I change the style of drawing lines outgoing using DOT language? Problem lines is
33->105;
33->73;
33->45;
If you use dot for your layout, you may try using concentrate=true which does merge edges in some cases:
Example:
Related
I used word to make this graph, how to make it in dot language? The line style is perpendicular. Thanks very much!
You can use the 'pos' attribute to place your nodes on an imaginary grid:
graph X
{
a [pos="1,1"]
b [pos="2,2"]
c [pos="2,3"]
d [pos="2,4"]
}
and then use the appropriate flag to the layout program to override neato's desire to place your nodes (you may also need to fiddle with the size of your nodes). You probably end up with edges which are not straight. In that case, define invisible nodes for the junction points on your imaginary grid and draw edges from your top node to the invisible ones and from the invisible ones to RIL_Init and so on. If your graphs are big, this will get pretty tedious..still straightforward...and you still get all the output options of graphviz. The need for pos="1,1!" usually comes up too, the bang meaning 'put it exactly there'.
I have a graph with a lot of objects. A number of these objects have no links. GraphVis lays these out on one long horizontal line on the top of the diagram.
Is there anyway to make GraphViz have a maximum width, so unconnected objects go on the next "line" ?
Add invisible edges between them. This will force graphviz to layout these nodes like the ordinary ones.
I would like to use graphviz for a project and am unable to get the behaviour I want. I have a graph that I can draw with graphviz just fine, but I also have a version of the same graph that has some extra edges. I would like the second graph to be drawn with the nodes in the same positions as the first one and the edges in the same positions, but the new edges to be drawn without avoiding any overlap with nodes.
To get a better idea of what I want, imagine a Powerpoint slide with a graph and then on the next slide the same graph with these extra edges that appear on top of the first graph, wihtout modifying the look of the old parts of the graph. That is the effect I want.
I think the effect could be achieved by having some edges ignore any overlapping constraints. I could not figure out how to control the overlap between edges and nodes for particular edges (or even for all edges).
Any ideas?
You can get dot to output another .dot file, with positions assigned to all elements, via dot -Tdot (or maybe dot -Txdot). Add your additional edges to that file, and run it through dot again to produce your second graph.
Consider the manually drawn red arrow in this graph:
I want to tell graphviz to draw an arrow like that, although the particular path is not important. The important thing is that the existing graph not change at all. Essentially, I want to instruct graphviz to
Draw a certain graph
Keeping that graph fixed, add a new edge to it
Is this possible?
Yes, it should be possible.
If you have a certain graph (e.g. data.dot) and run this file through dot without specifying an output format, dot will output a dot file with added coordinates (attribute pos for nodes and edges). If you save this output (dot data.dot > data_pos.dot) you can add your new edge to it and you can generate your two output files.
You might have to enlarge the bounding box graph [bb="..."]; for the new edge not to mess with positions tho.
Is there any way to force graphviz to always draw the nodes above edges even if the edge is drawn over (or preferably under) the node?
So far I have tried ordering them and different layer options but not found a way that works.
You'll want to specify outputorder="edgesfirst". This can be found in the documentation.