Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

ForceDirectedLayout avoiding link collisions

$
0
0

@g.bartoli wrote:

I've another question for you. I'm not expecting the final solution, but just some guidelines would be great.
I'm experimenting with ForceDirectedLayout and tweaking arrangement options (spring length, electrical charge, etc...), I obtained a good result with my data, i.e. the nodes are correctly placed without overlaps.

However, I realized that nodes are positioned taking into account only the positions of the other nodes and not where the actual links are drawn. You can see this behavior in the following screenshot.

Manually dragging some nodes around, I can obtain the desired results, where nodes and links are not colliding, and labels are visible, too.

I see from the Dynamic Ports sample that using custom connections, node ports, avoidNodes and JumpGap, links can be kept parallel and not colliding, but I was hoping that this overhead could be avoided for a simpler case like mine, where there is no interaction, just an alternative view of data otherwise displayed with a TreeLayout.

Do you have some suggestions on how to automatically get an better initial positioning of nodes taking into account link/node collisions?

Many thanks,
Guido

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles