react-d3-tree icon indicating copy to clipboard operation
react-d3-tree copied to clipboard

Customize zoom behaviour

Open ra2dev opened this issue 3 years ago • 1 comments
trafficstars

Request type

Feature Request

Motivation

Currently if we have long page and stop scrolling at our Tree component, if you will continue scroll: it will zoom in/out instead of continuing scrolling. Instead of it we would expect to have this behaviour customizable - for example to pass customFilter

As a reference we can check google maps scroll/zoom behaviour where it allow us to scroll if you hovered map and you can zoom if you pressed Shift *(or ctrl in other apps).

What is the actual behavior/output?

No possibility to customize when zoom should be triggered.

What is the behavior/output you expect?

Allow possibility to customize when zoom triggered.

Example Implementation

Example sandbox - https://codesandbox.io/s/strange-grass-zhmuu (include current behaviour and custom behaviour)

  • POC repo: https://github.com/Romroot/react-d3-tree
  • sample changes: https://github.com/Romroot/react-d3-tree/commit/a5097fdec9e72c3c0d2f8868e12cdb53ef3b38ce
  • sample package: [email protected]

What version of react-d3-tree are you using?

3.2.2

P.S. I will provide POC and if feature will be approved I can create PR.

ra2dev avatar Jan 04 '22 20:01 ra2dev

@ra2dev Using 'Control + Scroll wheel' will conflict with Firefox default page zoom behavior.

arky avatar Jun 13 '22 07:06 arky