Skip to content

Commit

Permalink
chore: add changeset
Browse files Browse the repository at this point in the history
Signed-off-by: braks <[email protected]>
  • Loading branch information
bcakmakoglu committed Jan 4, 2023
1 parent 94344a6 commit ea5c35e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/hot-bobcats-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vue-flow/core': patch
---

Re-calculate position when node extent changes
13 changes: 11 additions & 2 deletions examples/vite/src/Nesting/Nesting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Background } from '@vue-flow/background'
import { Controls } from '@vue-flow/controls'
import { MiniMap } from '@vue-flow/minimap'
const { onConnect, addEdges, addNodes } = useVueFlow({
const { onConnect, addEdges, addNodes, findNode } = useVueFlow({
fitViewOnInit: true,
connectionMode: ConnectionMode.Loose,
nodes: [
Expand All @@ -14,7 +14,7 @@ const { onConnect, addEdges, addNodes } = useVueFlow({
label: 'Node 2',
position: { x: 100, y: 100 },
class: 'light',
style: { backgroundColor: 'rgba(255, 0, 0, 0.8)', width: '200px', height: '200px' },
style: { backgroundColor: 'rgba(255, 0, 0, 0.8)' },
},
{
id: '2a',
Expand Down Expand Up @@ -88,6 +88,15 @@ onMounted(() => {
parentNode: '2',
},
])
setTimeout(() => {
const node = findNode('999')!
node.expandParent = false
node.extent = {
range: 'parent',
padding: [10],
}
})
})
</script>

Expand Down

2 comments on commit ea5c35e

@vercel
Copy link

@vercel vercel bot commented on ea5c35e Jan 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on ea5c35e Jan 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.