visdesignlab / upset2

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

Update datatable dispatch to localforage and add loading spinner #329

Closed JakeWags closed 3 months ago

JakeWags commented 4 months ago

Does this PR close any open issues?

Closes #304

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

This PR migrates the datatable state dispatch from localStorage (native DOM api) to localforage which uses INDEXEDDB or a WEBSQL database of configurable size to save local values. The configuration specified uses 30MB as the default storage size, as well as specifying fallback drivers if INDEXEDDB fails to load.

This migration is necessary because the localstorage limit is smaller than many medium to large datasets and the existing implementation does not account for this in any way. The current behavior is confusing for the end user because it either shows nothing (if the user hasn't cached any datatable before) or shows the previously cached datatables if the user has opened a different dataset's table.

Additionally, the PR adds a "loading" spinner wheel for long state dispatch delays. This uses the MUI backdrop element to overlay the spinner over the plot.

Finally, the PR adds light error handling to the datatable by notifying the user if there was an error dispatching their plot's state. This should only occur if the dataset's dispatched size is OVER 30MB.

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 4061b79b2cb996e465f093361b88d6c3617c5b77
Latest deploy log https://app.netlify.com/sites/upset2/deploys/660b2e0319fed60008da1964
Deploy Preview https://deploy-preview-329--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.