CityScope / CS_cityscopeJS

Create, design, and publish @CityScope projects on the web
https://cityscope.media.mit.edu/CS_cityscopeJS/
GNU General Public License v3.0
20 stars 16 forks source link

Apply loading spinner when grid updates #20

Closed RELNO closed 4 years ago

RELNO commented 4 years ago

Upon changes to grid (either via UI or from TUI), spinner should indicate await behavior till each module has been successfully updated.

gok03 commented 4 years ago

Deckgl does not have native methods to support this feature.

This requires the use of react lifecycle methods. I am trying to achieve this by using componentWillMount and componentDidMount. We need to start the spinner when the state is changed for menu items and stop it when render is completed.

RELNO commented 4 years ago

Deckgl does not have native methods to support this feature.

Sure, see the placeholder already in the menu

This requires the use of react lifecycle methods.

yes -- it's actually a bit more tricky:

gok03 commented 4 years ago

Need some clarity here,

  1. Why to show spinners, when the meta URL call is happening in background. i.e, the sidebar might be closed in the data update intervals. Or should we have a full page loader/spinner.
  2. If sidebar is open, Will the spinners be shown for only toggled-on layers when there is a data update?
RELNO commented 4 years ago
  1. Why to show spinners, when the meta URL call is happening in background. i.e, the sidebar might be closed in the data update intervals. Or should we have a full page loader/spinner.

in case the sidebar is closed, a small icon should show on some corner to indicate general loading. In the sidebar, we do need to show this for each layer separately.

  1. If sidebar is open, Will the spinners be shown for only toggled-on layers when there is a data update?

I guess for both. So that if user uses toggle during loading, they know that current view is still old, and new data is coming. What do you think?

gok03 commented 4 years ago

I think the UI should be consistent irrespective of user actions. We might have a tag like "Late Updated: 21/1/20 22:36:05" and over this a spinner that gets enabled on data fetch. Once the new data is updated, the tag might be updated with timestamp and spinner is disabled.

RELNO commented 4 years ago

Reopening, see #38