datacommonsorg / website

Code for the Data Commons website
https://datacommons.org
Apache License 2.0
21 stars 74 forks source link

Added lazy loading for remaining tiles #4328

Closed dwnoble closed 3 weeks ago

dwnoble commented 1 month ago

Adds lazy loading to:

Adds new lazyLoadMargin option to specify how close the component should be to the viewport before lazy loading

For the explore page, all components except for the map will load when they are within 1000px of the viewport (this way as the user scrolls down, the next component will have already started rendering). Since the map rendering can take a while, the margin is 0px meaning it won't load until the map is actually in the viewport (which is also the current behavior for the map)

Demo: LazyLoad.webm