allow `d3.layout.force().chargeDistance` to take a function
See original GitHub issueA number of settings on the d3.layout.force()
object are dynamic, like linkStrength
, linkDistance
and charge
. They take a function, so the value can be different for each node or link.
This seems to not be the case for chargeDistance
. Is there a reason for this? It would come in handy for me at the moment. I have a number of isolated groups of nodes with their own gravity and enforced bounds, but still with occasional inter-group links. Having the chargeDistance
be limited to the group size of each particular node would help both performance and visible behavior.
Issue Analytics
- State:
- Created 9 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Force Layout - D3 wiki
A flexible force-directed graph layout implementation using position Verlet integration to allow simple constraints. For more on physical simulations, ...
Read more >Forcing Functions: Inside D3.v4 forces and layout transitions
force.strength() allows us to set up an accessor for calculating the force strength for each node. However, instead of running that accessor ...
Read more >D3 Force layout - D3 in Depth
D3's force layout uses physics based rules to position visual elements. This article shows how to use D3's force layout and how to...
Read more >[Solved]-D3.JS theta in force layout-d3.js - appsloveworld.com
I found the easiest way to learn and experiment with how the forces affect the graph was to make temporary sliders that you...
Read more >D3.js 3 documentation - DevDocs
Layouts - derive secondary data for positioning elements; Geography - project spherical coordinates, latitude & longitude math; Geometry - ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Composable forces have been implemented in d3-force for D3 4.0.
The charge is a global (many-body) force, so the charge distance can’t be customized on a per-node basis (or per pair of nodes). However, it would be possible to compose multiple charge forces that affect different subsets of nodes, such that each charge force is local to the subset. See d3/d3-force#2.