multinet-app / multimatrix

A adjacency matrix visualization built to work with the multinet ecosystem.
https://multinet.app
Apache License 2.0
1 stars 0 forks source link

Make matrix and lineup stay in sync when sorting and fix additional sorting related bugs #413

Closed JackWilb closed 2 years ago

JackWilb commented 2 years ago

Does this PR close any open issues?

Closes #401 Closes #397 Closes #263 (no more crashing)

Give a longer description of what this PR addresses and why it's needed

This PR addresses a couple of issue that we had with lineup sorting, hovering, and some configuration.

I made the sorting much more robust, while not fully refactoring the code. Lineup now tracks a permutingMatrix, which stores lineup's current difference in sort order from the matrix. We need to track this, because when lineup loads with a specific order and is sorted, we need to track the delta. When the matrix is sorted, we can just replace the lineup data so it stays in sync. This approach is much more successful than my previous attempts.

When I added this permutingMatrix, it broke the hovering. As a fix, I use the permutingMatrix as the map for which nodes are hovered.

There was also an old function in the lineup component that was supposed to track if multiple rows had been selected. That never worked, because of the way we use selection to hover multiple rows at once (thus taking away our ability to select multiple rows in the lineup). I removed the function for now, since it was conflicting with the hovering logic.

Finally, I grouped all the lineup configuration into one block, and disabled animations, which makes it feel much more snappy.

Provide pictures/videos of the behavior before and after these changes (optional)

Same as before, sorting just works now.

Are there any additional TODOs before this PR is ready to go?

TODOs:

netlify[bot] commented 2 years ago

Deploy Preview for multimatrix ready!

Name Link
Latest commit 385c445c11e95139124b9497b9bb6d3c65da87cc
Latest deploy log https://app.netlify.com/sites/multimatrix/deploys/62d9831587848000074c6cec
Deploy Preview https://deploy-preview-413--multimatrix.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

gotdairyya commented 2 years ago

All the filtering and sorting work!

Do you want to control filtering with LineUp?

JackWilb commented 2 years ago

All the filtering and sorting work!

Do you want to control filtering with LineUp?

Yeah, it should work with all the buttons. I think we have open issues for the filtering, though