Blazor.Diagrams icon indicating copy to clipboard operation
Blazor.Diagrams copied to clipboard

Expand collapse nodes

Open jm942 opened this issue 3 years ago • 6 comments

Hi, just discovering diagrams and looks interesting. Is there a way to expand or collapse child nodes when clicking on a port ? This would be interesting for large diagrams.

jm942 avatar Apr 11 '21 17:04 jm942

Hello, are you referring to groups?

zHaytam avatar Apr 11 '21 17:04 zHaytam

Hi, Not really groups i think. As i have large diagrams to make it more readable i was more thinking to have a behaviour like this: https://observablehq.com/@d3/collapsible-tree

jm942 avatar Apr 12 '21 06:04 jm942

Hey, I'm afraid that something like that will need to be handled by you. At least for now. You can easily do this by adding some kind of Children property to your custom nodes, whenever a link is added you populate that property. You can also add events to your custom node's widget so that when it's clicked, you stop showing all the nodes that are in Children (using some kind of IsVisible property for example).

This might be added to this library, but without Tree layouts and stuff, it wouldn't be that great.

zHaytam avatar Apr 12 '21 10:04 zHaytam

Ok thanks for the info. I will try the suggested approach

jm942 avatar Apr 13 '21 12:04 jm942

Okay, let me know how it goes. I'm working on tree diagrams too right now, and I might need this feature. If I do, I might end up adding it to the library directly.

zHaytam avatar Apr 13 '21 12:04 zHaytam

Great to hear you are thinking about that! Would a tree layout or something similar also handle auto-positioning the items?

hypervtechnics avatar Apr 13 '21 12:04 hypervtechnics