#Get the XY coordinates of the middle of the screen (flow)

1 messages · Page 1 of 1 (latest)

indigo valve
#

How can i get the XY coords of the middle of the flow, which is currently shown?

#

ive seen the useViewport hook, but:

opaque bolt
#

Well basically all you need to do is get the measurements of the current screen, divide height and width by 2, use those values as your screen coordinates and project it onto React Flow using the project helper and you have the center