twopi root node not in centre

When I add one extra node and edge to my tree it goes from nice concentric (partial) circles with my root not in the centre, to s strange set of concentric circles such that root node is no longer in the centre.

Can anyone tell me whether this is expected behaviour and if so how I might be able to correct it so the root node is always in the centre and all nodes in a circle have the same rank (this is not the case for my added node).

Sample files are attached.

bad.txt5.67 KB
good.txt5.74 KB
good.txt.png81.03 KB
bad.txt.png155.92 KB

Probably an unfortunate

Probably an unfortunate design choice, but notice that root as a node attribute only works in circo, not in twopi. So setting root=true in node 444166 has no effect. Twopi just happens to pick the right node. In the bad case, it picks node 44442 as the most central node. To set the root node in twopi, use the graph attribute




Thanks! Yes, an unfortunate


Yes, an unfortunate design choice, but also not helped by the documentation table, but yes, I see now that the detailed documentation does say circo-only.

My next challenge is that I actually have a forest (mutiple disjoint trees) and thus multiple root nodes, one per tree.  twopi gives me the multiple radial graphs I want, but only lets me specify a single root node rather than one per tree.


I have fixed twopi to allow

I have fixed twopi to allow root as a node attribute, and to handle multiple roots, so each component can specify one. The changes will appear in tomorrow's packages.

I will try to rationalize the

I will try to rationalize the use of the root attribute. Meanwhile, you can do the following:

  - set root=true for the nodes you want to be the root of its tree

  - run

     ccomps -x yourgraph.gv | gvpr  -c 'N[$.root]{$G.root=$.name}' | twopi | gvpack | neato -n2 -Tpdf > out.pdf

where you can replace pdf with whatever output format you want. Also, if you are using a shell with different quoting conventions, you may have to modify the pipeline syntax.

Recent comments