Skip to content
Discussion options

You must be logged in to vote

I managed to get the desired behavior accessing directly the DOM elements by the default reactflow classnames:

  • react-flow__controls-zoomin

  • react-flow__controls-zoomout

And setting the cursor and opacity style properties.
To understand when the maximum zoom or the minimum zoom was reached, I counted the number of clicks necessary to reach the max and minimum levels and used the onZoomIn and onZoomOut callbacks of the react-flow component to set an internal state variable currentZoomLevel and used that to set the style properties.

Hope this can be useful for anyone else!

Replies: 3 comments 10 replies

Comment options

You must be logged in to vote
4 replies
@vibhorSharma7
Comment options

@bcakmakoglu
Comment options

@vibhorSharma7
Comment options

@bcakmakoglu
Comment options

Answer selected by alessiopunturo
Comment options

You must be logged in to vote
1 reply
@yairEO
Comment options

Comment options

You must be logged in to vote
5 replies
@bcakmakoglu
Comment options

@yairEO
Comment options

@bcakmakoglu
Comment options

@yairEO
Comment options

@raywei2023
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants