bkrem / react-d3-tree

:deciduous_tree: React component to create interactive D3 tree graphs
https://bkrem.github.io/react-d3-tree
MIT License
1.09k stars 270 forks source link

Customize zoom behaviour #371

Open ra2dev opened 2 years ago

ra2dev commented 2 years ago

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)

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.

arky commented 2 years ago

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