Skip to content

Adjusting link force depending on group? #374

Answered by vasturiano
vzakharov asked this question in Q&A
Discussion options

You must be logged in to vote

@vzakharov thanks for reaching out.

A given force has usually multiple parameters that could be configured based on some data parameter. I'm not sure which parameter of the link force you want to update but assuming it is the strength, you could do something like this:

.d3Force('link').strength(link => link.group === 'weakLink' ? 0.1 : 1)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by vzakharov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants