visdesignlab / upset2

UpSet - Visualizing Intersecting Sets
https://upset.multinet.app/
BSD 3-Clause "New" or "Revised" License
41 stars 7 forks source link

Bugfix: no Trrack action for unchanged filters #319

Closed NateLanza closed 4 months ago

NateLanza commented 4 months ago

Does this PR close any open issues?

Closes #306

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

Previously, moving the degree filter slider around and returning it to its original position dispatched a trrack action to the provenance graph despite no change being made. In addition, changing only the lower or upper bound would dispatch an action for the unchanged bound. This fixes both issues by only dispatching actions for changed bounds after the slider is released.

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

Have you added or updated relevant tests?

Have you added or updated relevant documentation?

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

TODOs:

netlify[bot] commented 4 months ago

Deploy Preview for upset2 ready!

Name Link
Latest commit 725d44d6d49fe8d4214c67318d8e3ebc805dcc4c
Latest deploy log https://app.netlify.com/sites/upset2/deploys/6601a8d61a763300086820e4
Deploy Preview https://deploy-preview-319--upset2.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 configuration.

NateLanza commented 4 months ago

@JakeWags I'm not sure if this is exactly what you had in mind; lmk what you think. It might make more sense to have all of the actions confirm that change has occurred before updating the provenance graph, but it appears that declining to update the state inside one of the action callback functions still adds a node to the trrack graph, so I wasn't able to stop the action there. I'm not seeing another place to halt the action except before it's dispatched, which I've done here.

JakeWags commented 4 months ago

@JakeWags I'm not sure if this is exactly what you had in mind; lmk what you think. It might make more sense to have all of the actions confirm that change has occurred before updating the provenance graph, but it appears that declining to update the state inside one of the action callback functions still adds a node to the trrack graph, so I wasn't able to stop the action there. I'm not seeing another place to halt the action except before it's dispatched, which I've done here.

I think this solution works fine because there really isn't anything else which both updates Trrack state AND can be set to the current value.