I’m looking to display “loading” indicator while plot is plotting behind the scene .
How do, I show a “loading spinner”?
in an observable cell you can do:
{
yield html`loading…`;
yield Plot.plot({ marks: [] });
}
If the slow part is not so much the plotting but actually loading a large dataset, you could do something like this:
{
yield html`loading…`;
const data = await fetch("https://slow data API url");
yield Plot.plot({ marks: [] });
}
And if you want to get extra fancy you can find a guide here:
Note that part 3 is a bit short on explanations, but has all the code there.