patorjk/d3-context-menu

Accessing event information with D3 6.x

danielePala opened this issue · 2 comments

In D3 6.x the global d3.event has been removed, so in order to access event information from the context menu callbacks I think it would be useful to add the event as a second input parameter, in addition to the datum d.
Is this something you are willing to add?

I think this sounds reasonable, though it would need to be the 3rd parameter since the index is passed as the second parameter.

I would accept a PR for this.

Submitted PR #59 where the second argument of the callbacks will be the event for D3 6.x and the index for D3 5.x or earlier. This because the index argument will be undefined for D3 6.x, while the event argument is not needed for D3 5.x or earlier.