D3 zoom: independent pinch angle X and Y scaling

I have a two-dimensional svg diagram made with d3 that uses d3.behavior.zoom () for mouse scaling and pinch gestures on touch devices.

It works fine, but I would like to be able to scale only X or only Y independently, when the pinch is directed mainly along one of the axes. If the pinch goes diagonally, let it increase both X and Y, as it is now.

Any suggestions on the approach that is best to take here?

+4
source share

Source: https://habr.com/ru/post/1658609/


All Articles