I use Jung to draw graphs. Below is a simple graph with tree layout that looks fine. All renderers and transformers are default.
alt text http://czuk.eu/stackoverflow/ballon_layout_default_size.png
Now, I have changed the default size of the nodes to 100px by setting a custom VertexShapeTransformer
. The problem is that the nodes started to overlap. Here you can see how it looks:
alt text http://czuk.eu/stackoverflow/ballon_layout_size_100px.png
Is it possible to get rid of the vertex overlapping? Is it a matter of layout or some kind of shape transformation?
Thank you in advance for any suggestions :-)
After not so long investigation I found out that there are two static attributes responsible for setting the minimum distances between vertexes. These are TreeLayout.DEFAULT_DISTX
and TreeLayout.DEFAULT_DISTY
. Unfortunately, those attributes define a fixed minimum distance between vertexes but do not consider the real size of each vertex that may differ. The setting is valid for the TreeLayout
and the BalloonLayout
that extends the TreeLayout
.
I also tries other layout but I could not find an analogical solution. This issue is for another question ;-)