uber/react-vis-force

Unable to add variable distances

Codewithsk opened this issue · 3 comments

Each link in my graph has to have a different distance depending on a value I feed it. I've been breaking my head over this for a week and haven't been able to figure this out. It doesn't look like there's support for this in the library but if I had to implement it, where would I have to do it?

+1

Did anyone figure out a way to do this? THX!

@Codewithsk I'm thinking you can pass distance to the simulationOptions prop in the same way that you can pass strength (see https://github.com/uber/react-vis-force/blob/master/stories/index.js#L115).

Or, as the storybook examples suggest, perhaps strength itself will work. The d3 docs are somewhat vague: https://npm.runkit.com/d3-force#link_distance.