From deb33eb614af95ed2ff6394bf4c93729425246cd Mon Sep 17 00:00:00 2001 From: Kyle Barron Date: Tue, 17 Oct 2023 16:05:04 -0400 Subject: [PATCH] docs about pydeck vs lonboard differences --- docs/alternatives.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/alternatives.md b/docs/alternatives.md index a3b5fab1..74dd3577 100644 --- a/docs/alternatives.md +++ b/docs/alternatives.md @@ -12,6 +12,16 @@ The downside of ipyleaflet is that it doesn't support large datasets as well. It Lonboard does not try to cover deck.gl's _full_ API, but rather has an opinionated approach that nudges users to the fastest rendering for many common use cases. +### Why not contribute back to pydeck? + +Pydeck and lonboard have very different goals. + +A stated goal of pydeck is to be non-opinionated and to allow users with various data sources (GeoJSON strings, URLs to arbitrary data sources, etc.) to render. It makes sense for "official" bindings to be non-opinionated, but lonboard takes an opposite tack. By forcing users to use Arrow, we can get reliably fast performance the very common use case of rendering `GeoDataFrame`s. A downside here is that an Arrow-based implementation has required dependencies that pydeck wouldn't want. `pyarrow` on the Python side is 90MB on disk. Arrow JS on the JS side is ~200kb, and the default `parquet-wasm` build is ~1MB. + +Pydeck is tightly tied into the deck.gl [JSON renderer](https://deck.gl/docs/api-reference/json/overview), which allows describing a map state fully in JSON. It's not clear how this would work with the JavaScript GeoArrow layers. + +Aside from this, pydeck and lonboard use different widget architectures. Pydeck is built on the historical ipywidget layout, using the [widget cookiecutter as inspiration](https://github.com/jupyter-widgets/widget-ts-cookiecutter) and having a separate Jupyter Widget package published to NPM. Lonboard takes a newer approach (unavailable at the time pydeck was created) that uses [Anywidget](https://anywidget.dev/), vastly simplifying the widget process. + ## Lonboard vs datashader [Datashader](https://datashader.org/) is a truly _scalable_ rendering library. Datashader will re-render your data from scratch when panning around in a map. This allows datashader to _aggregate_ the source data before rendering. Datashader _minimizes the amount of data being rendered_ and thus, in theory, Datashader should perform well for datasets as large as your computer's memory.