bjlittle / geovista

Cartographic rendering and mesh analytics powered by PyVista

Home Page:https://geovista.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dynamically load interactive examples in documentation

banesullivan opened this issue Β· comments

πŸ› Bug Report

Some of the documentation examples in the gallery are taking a bit of time to load for me and might make the examples unresponsive for people with low bandwidth.

How to Reproduce

Load an example page like https://geovista.readthedocs.io/en/latest/generated/gallery/spatial_index/uber_h3.html and notice the ~45MB scene being immediately downloaded.

Expected Behaviour

The scene could load dynamically upon request. PyVista's image scraper implements this for you! I thought it was the default, but maybe it was turned off here or a dependency is missing? Or perhaps this is new to 0.43.1 and the version of PyVista just needs to be bumped to get these tabs?

@bjlittle, was the choice to make all examples dynamic by default intentional?

What I'm thinking these scenes should look like:

Screen.Recording.2023-12-26.at.5.24.43.PM.mov

Ah I think PyVista just needs to be bumped to get this

- pyvista >=0.40,<0.42.2

pyvista>=0.40,<0.42.2

Yeah. We need to solve #447 to use it.

Aha, thanks for pointing me there, @tkoyama010 -- I'll take a look at that in the coming days and see if I can help fix it

@banesullivan I noticed the lush Static Scene / Interactive Scene feature on the pyvista docs and was wondering how it was done ... now I know, thanks.

Yeah, it would be good to get unpinned, so I'll throw some effort into that ... I need to provide some explanations to @tkoyama010, so I'll do that when I can.

Also, I just thought I'd try going totally interactive with the gallery just to see how it would behave, but having the ability to choose between static and interactive would be ideal.

I also recently cached all the assets required for rendering prior to building the docs on the rtd server (#605), so this should make a slight performance improvement.

Also, in hindsight, I may now choose to drop some of the larger examples, particularly if they're not highlighting anything new/different from other lighter weight examples in the gallery πŸ‘