vasturiano/force-graph

How to control the length between nodes and clusters of nodes

Opened this issue · 3 comments

moda20 commented

Hi, i am creating a graph with a central node and 4 clusters each with as mcuh as 1k nodes, the issue i am having is the distance between the central node and the clusters. this doesn't seem to be configurable in any way from the available interface.
by default the length it seems to be related to the number of nodes in each cluster, but can't be configured to be otherway

in the attached pic, the length i am speaking with is the dashed line

Screenshot 2023-01-23 at 16 06 11

You can control the intended distances per link using the forceLink distance method.

This method can be accessed via:

myGraph.d3Force('link').distance(link => ...)
moda20 commented

@vasturiano thanks, but the a small problem there is that i also need to change the charge force to achieve what i want to do but that has a weird bug, and i created an issue about it

Hello @moda20,

can i have the code you used for clustering?

Thank you.