Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing function Group.addGroup / Group.addGroups #961

Open
JensWinkler91 opened this issue Aug 5, 2023 · 9 comments
Open

Missing function Group.addGroup / Group.addGroups #961

JensWinkler91 opened this issue Aug 5, 2023 · 9 comments

Comments

@JensWinkler91
Copy link

What problem does this feature solve?

The API allows us to manually add nodes to a group by using group.addNodes(nodes).

However, i can't find any function to add a subgroup to a group although the feature is supported (see includeGroups). I'd expect that there's a function like group.addGroups(groups).

Do i miss something?

@noonnightstorm
Copy link
Collaborator

I will support as soon as possible

@noonnightstorm
Copy link
Collaborator

I think you should call canvas.addGroup , but not Group.addGroups.

@JensWinkler91
Copy link
Author

But canvas.addGroup would add a new group to the canvas. That's not what i want to do.

I just want to change the parent of a group that already exist.
Afterwards the subgroup should me moved when the parent group is moved.

@noonnightstorm
Copy link
Collaborator

canvas.addGroup({
  id: 'xxx',
  group: 'xxx' // you can pass group id
})

@JensWinkler91
Copy link
Author

JensWinkler91 commented Aug 14, 2023

@noonnightstorm

Your code sample would create a new subgroup, right?
I'd like to turn an existing group into a subgroup.

Edited:
I tried your code snippet. It doesn't work.
I think the functions Group.addGroups and Group.removeGroups are really missing.

@noonnightstorm
Copy link
Collaborator

Maybe you can canvas.removeGroups and canvas.addGroups.

@JensWinkler91
Copy link
Author

JensWinkler91 commented Aug 21, 2023

I already tried it but it does not work.

When i use canvas.removeGroups and canvas.addGroups the nodes won't be part of the group anymore.
That means that the nodes of the group don't move when i move the group itself.

@JensWinkler91
Copy link
Author

JensWinkler91 commented Aug 27, 2023

@noonnightstorm

I currently don't get the problem with that issue as the behavior already exists when you drag and drop a group into another group.

Could you please tell me what's the difficulty?

@JensWinkler91
Copy link
Author

JensWinkler91 commented Sep 7, 2023

@noonnightstorm

I would really appreciate your help in this case.
Is there any chance to get a response?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants