Reputation: 33
I render a graph using visjs. The shape of the nodes are of type dot. Each node is given a custom size using the size attribute.
When the graph is rendered some of the nodes overlap. So the graph looks like in the following picture:
I expected a graph like the this picture is showing:
What am I doing wrong?
Upvotes: 3
Views: 1206
Reputation: 8316
To be more specific compared to the TERMIN's answer, in the physics configuration example you can see (at least for the barnesHut
solver) that increasing avoidOverlap
prevents overlapping even when springConstant
is equal to zero and
var options = {
"physics": {
"barnesHut": {
"avoidOverlap": 0.2
}
}
}
is probably enough (but you may increase the value according to your needs).
Upvotes: 0