https://github.com/ltalirz/holoviews-dynamic-hover
Combines datashader with dynamic bokeh overlay depending on zoom level
https://github.com/ltalirz/holoviews-dynamic-hover
bokeh datashader holoviews
Last synced: over 1 year ago
JSON representation
Combines datashader with dynamic bokeh overlay depending on zoom level
- Host: GitHub
- URL: https://github.com/ltalirz/holoviews-dynamic-hover
- Owner: ltalirz
- Created: 2019-12-20T10:52:10.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-20T11:23:48.000Z (over 6 years ago)
- Last Synced: 2025-01-10T17:53:39.738Z (over 1 year ago)
- Topics: bokeh, datashader, holoviews
- Language: Python
- Size: 3.91 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# holoviews with dynamic bokeh overlay
**Problem**: You want to make a two-dimensional scatter plot of a data set but the data set
is too large (> 50k points) to be sensibly visualized with [`bokeh`](https://bokeh.org/).
At the same time, you would like to retain the ability to interact with individual points to find out more information about them (e.g. via the `hover` tool).
**Solution**: Use [`holoviews`](http://holoviews.org/), start with a full view of the plot rendered with [`datashader`](https://datashader.org/),
and overlay with a [`bokeh`](https://bokeh.org/) scatter plot only once the user has zoomed in far enough.

## Prerequisites
With [`conda`](https://docs.conda.io/en/latest/):
```
conda install -c pyviz bokeh datashader fastparquet python-snappy
```
Tested with python 3.7, holoviews 1.12.7 and datashader 0.9.0
## Run
Run jupyter notebook via
```
jupyter notebook dynamic_overlay.ipynb
```
Serve as web page via bokeh
```
bokeh serve dynamic_overlay.py --show
```
Note: `bokeh_app.py` shows how to integrate this into an existing bokeh app
via manipulation of `curdoc()`.
## Credits
All credits due to @philippjfr for not only creating the great holoviews package but also providing [great support](https://discourse.holoviz.org/t/how-to-show-hide-overlay-depending-on-zoom-level/61/2).