How to detect if node is inside viewport? #1616
-
How to detect if node is inside viewport? |
Beta Was this translation helpful? Give feedback.
Answered by
bcakmakoglu
Sep 12, 2024
Replies: 1 comment
-
You can use the const nodes = ref([...])
const { viewport } = useVueFlow()
const nodesInViewport = getNodesInside(
nodes.value,
{
x: 0,
y: 0,
width: state.dimensions.width,
height: state.dimensions.height,
},
viewport.value,
) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
bcakmakoglu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use the
getNodesInside
utility that is exported by@vue-flow/core