silx-kit / h5web

React components for data visualization and exploration
https://h5web.panosc.eu/
MIT License
161 stars 17 forks source link

Add prefetch buttons below dimension sliders #1635

Closed axelboc closed 3 weeks ago

axelboc commented 1 month ago

This is another experiment for #1578

I add a button below every dimension slider to prefetch the entire dimension. This lacks polish, obviously, but it shows what a user-controlled UI for prefetching entire dimensions could look like and feel like:

Peek 2024-05-06 09-23

One major limitation of our data provider architecture, currently, is that we have no way to know whether a slice has already been fetched and is available in the cache. This means we can't, for instance, reduce the debouncing delay (or switch to throttling) and disable the prefetch button when the entire dimension is already cached.

Technically, it is doable with the latest version of react-suspense-fetch (by calling store.get() and wrapping it with try/catch), but very hacky. Also, since the library is no longer maintained, I would prefer switching to another, more robust, suspense-based fetching library instead.