d3 / d3-selection

Transform the DOM by selecting elements and joining to data.

Home Page:https://d3js.org/d3-selection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KeyboardEvent support for d3.selection.on()

vincentfs opened this issue · comments

Hi,

In the previous version, keyboard event is supported through d3.event (eg: d3.event.ctrlKey, d3.event.keyCode, etc). This feature affords various interactions beyond simple Left/Right click, and help make better and rich user experience. However, in v6, it is quite difficult to implement these interactions.

Is it possible to add these features back into the event object passed to the listener?

Best regards,
Vincent

The current event is now passed directly to the event listener rather than being exposed as the d3.event global. Otherwise the nature of the event is unchanged — it’s the browser’s native event.

https://github.com/d3/d3-selection/releases/tag/v2.0.0