observablehq / framework

A static site generator for data apps, dashboards, reports, and more. Observable Framework combines JavaScript on the front-end for interactive graphics with any language on the back-end for data analysis.
https://observablehq.com/framework/
ISC License
2.58k stars 126 forks source link

An option to disable the loading spinner #860

Open zachcp opened 9 months ago

zachcp commented 9 months ago

Thanks Framework Team - this is really great.

Currently, unresolved promises show a rotating arrow as seen here. In some cases it would be nice to toggle the visibility for reactive in puts - e.g. don't show anything at all until the promise resolves. Maybe there is already a way to do that - in which case adding a bit more to the Promises docs would be quite helpful.

mbostock commented 9 months ago

One way to do this is with a style:

.observablehq--loading::before {
  display: none;
}

Can you talk more about when/why you’d want to turn this off? Like, for a specific code block, for a page, or globally? I think it’s generally good to show that some computation is happening to the user.

You may also be able to bypass the spinner by not writing blocking code, but I’ll need to understand the use case a bit better to suggest a specific solution.

zachcp commented 9 months ago

Thanks @mbostock . Long time listener; first time caller.