d3 / d3-force

Force-directed graph layout using velocity Verlet integration.
https://d3js.org/d3-force
ISC License
1.81k stars 376 forks source link

Method to get all forces currently set (or at least clear them) #203

Open RLesser opened 2 years ago

RLesser commented 2 years ago

I'm working on something where I'd like to be able to see all the currently set forces on a simulation. This information is stored in the forces map, but this isn't accessible through any method. Would it be possible to add a forces() method that returns that map, or a list of the defined forces?

Alternatively, some way to clear all current forces from a simulation would also satisfy this goal.

Would love to hear thoughts on this!