Closed nathanhack closed 5 years ago
The index and nodes will probably be going away in the future (major version) because it leads to a memory leak. https://github.com/d3/d3-selection/issues/189
Ah. Giving the case that it is going to change in the next major version (is it going to be soon?) I would prefer to do almost the opposite of what I did, with one addendum.
How does this sound, I'll remove all mention to d,i, and nodes from the listeners (in d3-drag) leaving the link to selection.on and if the link to selection.on listeners isn't there add it (which I believe it is so no action needed)? That way when the next major version rolls around the only place that'll need updating is the one in selection.on. and for the addendum I'll update the selection.on section to help those being redirected so that it is a bit more clear (not sure what that would be atm but I'll give it some thought and if i come up with something i can put in a PR).
Closing as this will be addressed when we update to d3-selection@2, which removed d3.event and the index, nodes callback arguments.
While working through an example I realized the descriptions were missing the
nodes
that would be passed to the function. With it explicitly being left out it seemed to imply they would not be included. Having them all there, makes it clear. (I must say I personally prefer it explicitly listing it next the function rather than a link to be inferred).