Many robots and some humans browse sites without JavaScript support, in which case they can only see “Loading…”. I do not expect plotly.js to run in a browser without JS, but I hope there is an easy way to place a stub when JavaScript is disabled.
Is this possible and how do I do this?
Here are desiderata ordered from basic to ideal.
- Replace “Loading…” with custom text.
- Replace “Loading…” with a custom page (i.e. html tags, images etc)
- Same as 2, but defined programmatically using Dash.html components (as opposed to being placed in assets or otherwise injected from a static file)
- Same as 3, but the static page is produced by a
layout()
callable on request. - Each endpoint (or, to be precise, a GET request path) displays its own page when JavaScript is disabled
- Same as 5. but defined programmatically using Dash.html components.
- Same as 6, but the static pages are produced by
layout()
callables on request.
I have some but a shallow understanding of how Dash renders a page in a browser and how it interacts with Flask. For instance, I’ve never worked with JS beyond simple client-side callbacks or with Flask views and template rendering. I would be grateful for answers that keep this in mind when outlining if and how any of 1…7 are achievable and what components of the entire system have to be changed.