question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nested Nodes ordering instable

See original GitHub issue

I’m submitting a…


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Current behavior

When working with expanding and collapsing nested nodes, reaflow seems to change the ordering of the nodes (even though the sequence of the input arrays stays similar).

Expected behavior

I would expect reaflow not to change the ordering of the nodes on the canvas depending on if it needs to draw edges to children or not.

Minimal reproduction of the problem with instructions

To reproduce the problem, note in which sequence the nodes are laid out on the canvas. Then click on nodes 2 and 3 to expand or collapse them, which will display the children of nodes 2 and 3.

I recorded a gif that demonstrates the problematic behaviour:

CleanShot 2021-07-21 at 11 10 02

You can play around with that example here: https://codesandbox.io/s/vigorous-agnesi-nzl6f

What is the motivation / use case for changing the behavior?

From a user’s perspective, nodes changing where they are displayed can confuse and make it difficult to understand complex graphs.

Environment


Libs:
- react version: 17.0.2
- reaflow: 3.1.3


Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [x] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

The code sandbox example is a bit hacky. I hope that doesn’t distract from the actual issue.

@amcdnl I’m happy to contribute, but I need guidance/pointers on where to start investigating?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
amcdnlcommented, Aug 30, 2021

Collapse and expand isn’t built in out of the box but essentially all you need to do is manipulate your graph. I will try to put together a demo on this!

0reactions
Vishal-Isharanicommented, Nov 5, 2022

The same is happening with a simple list of nodes, Check out this https://react-3qjytm.stackblitz.io

Read more comments on GitHub >

github_iconTop Results From Across the Web

Order by in nested eager loading in sequelize not working
i want to to apply order by on all four of my models. Query: var tehsilQuery = { include: [{ model: Ilr, as:...
Read more >
Faster and Better Nested Dissection Orders for Customizable ...
We compute contraction orders via recursive bisection, using node separators instead of edge cuts. This method is also called nested dissection ...
Read more >
How to draw nested nodes? - tikz pgf - LaTeX Stack Exchange
I am looking here for the right direction to follow in order to draw such graphs. It's worth noting that in this case...
Read more >
Languages of Nested Trees * - UT Computer Science
problem of branching-time software model checking may be phrased as a ... structure of jump-edges, we can classify nodes in a nested tree...
Read more >
Nested set model - Wikipedia
The nested set model is a technique for representing nested sets in relational databases. ... which visits each node twice, assigning numbers in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found