Skip to content

Autoresize parent node #2821

Answered by bcakmakoglu
Ranzeb asked this question in Q&A
Feb 7, 2023 · 3 comments · 4 replies
Discussion options

You must be logged in to vote

You're probably looking for the expandParent option?

{
    id: '2',
    data: { label: 'Group A' },
    position: { x: 100, y: 100 },
    className: 'light',
    style: { backgroundColor: 'rgba(255, 0, 0, 0.2)', width: 200, height: 200 },
  },
  {
    id: '2a',
    data: { label: 'Node A.1' },
    position: { x: 10, y: 50 },
    parentNode: '2',
    expandParent: true, // <-- set this to true to expand the parent when reaching it's border
  },

Though be aware that there is no "auto-collapse" option to reverse the resize.

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@Ranzeb
Comment options

@bcakmakoglu
Comment options

@Ranzeb
Comment options

Answer selected by chrtze
Comment options

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

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants