jsoncrack.com icon indicating copy to clipboard operation
jsoncrack.com copied to clipboard

Adaptive collapsing of node trees

Open tram98 opened this issue 2 years ago • 2 comments

Feature

A good addition could be to re-render the node tree when a node is collapsed or expanded. This would reduce the spread of different nodes around those less important to the user. Making the nodes draggable could be a different approach, but I might be getting ahead.

Thank you very much for the tool!!!

Cheers, Jannick

Alternative solutions or implementations

No response

Other context

No response

tram98 avatar Feb 14 '23 16:02 tram98

This would be really great, to trigger this the nodes and edges data should be updated. This behaviour will trigger a render on whole canvas and cause lagging while painting large data. To avoid this current behaviour is to hide/display through CSS. We can take suggestions for this in this issue.

AykutSarac avatar Feb 14 '23 18:02 AykutSarac

I have no expertise in Webdev, so i fear that my capabilities to support here will be limited.

tram98 avatar Feb 14 '23 21:02 tram98

Hi @tram98, it would be expensive to trigger a re-render when expanding or collapsing nodes, especially for large trees. However, could you please provide more information about the use case of adaptive collapsing of node trees with an example as to understand the desired behaviour in detail? Thanks

faizanu94 avatar Mar 26 '23 17:03 faizanu94

Hey there,

the basic idea would as follows: Suppose you have a big tree with 3 big nodes that take up a lot of space. When I collapse the node in the middle, there is a big empty space between the top and bottom nodes. Therefore, i would suggest repainting the elements on the same level when an element is (un)collapsed.

Is that explanation clear enough?

tram98 avatar Apr 01 '23 22:04 tram98

Hey there ! Dragging would be pretty nice and doable for now, Although selective re-rendering is a 'no-idea-on-that-yet' for me. Would like to contribute on this. Its marked unassigned, shall i take this up ? @AykutSarac

hammadahamed avatar Sep 23 '23 20:09 hammadahamed

Initially when collapsing implemented it was re-rendering the entire graph. For big graphs, this is very inefficient.

AykutSarac avatar Sep 26 '23 07:09 AykutSarac

I've opened a new issue for follow-up with details. #356

AykutSarac avatar Sep 26 '23 07:09 AykutSarac