Pass the node to the supstance drag event listener#98
Pass the node to the supstance drag event listener#98sf-wind wants to merge 4 commits intoandredumas:masterfrom
Conversation
Conflicts: dist/techan.js dist/techan.min.js dist/techan.min.js.map Merge from forked source.
to the tick date, even if that date is smaller than the tick date. Currently it only uses the closest date that is greater than the tick date.
|
Hi @sf-wind Thanks again for the contribution. This appears to have pull request #100 merged in already making a bit harder to review. I also won't be able to merge it in until #100 is merged in. Any chance those commits could be taken out? Otherwise this one will have to wait until then. cheers |
There was a problem hiding this comment.
This is handy, but it should align to d3 the api, generally passing (d, i) as parameters and this being the node as documented here https://github.com/mbostock/d3/wiki/Selections#on
The specified listener is invoked in the same manner as other operator functions, being passed the current datum d and index i, with the this context as the current DOM element.
|
Thanks. This is my first pull request and I did it on my master branch by mistake. As for the d3 api, I'm not quite familiar with and I will definite take a look. |
In my use case, when dragging a line, some other related lines also move. I use it to implement fibonacci trend, so the registered drag event listener needs to know which line is dragged. So add the node as a second argument.