holoviews icon indicating copy to clipboard operation
holoviews copied to clipboard

Datashade fails to update all figures on zoom.

Open cmac994 opened this issue 1 year ago • 1 comments

The issue I've encountered involves the failure of the holoviews datashade method to correctly update multi-plot displays upon zoom.

I am using:

Python 3.9.13 holoviews 1.15.0 jupyterlab 3.4.4 bokeh 2.4.3 datashader 0.14.1 jupyter_bokeh 3.0.4 pyviz-comms 2.2.0

extensions are: @bokeh/jupyter_bokeh v3.0.4 enabled OK @pyviz/jupyterlab_pyviz v2.0 enabled OK

For simplicity, the example I am using is adapted from a former datashader issue.

import numpy as np
np.random.seed(42)

import holoviews as hv
from holoviews.operation.datashader import datashade
from holoviews import opts, dim
hv.extension('bokeh')

from colorcet import fire
datashade.cmap=fire[50:]

def gaussians(specs=[(1.5,0,1.0),(-1.5,0,1.0)],num=100):
    """
    A concatenated list of points taken from 2D Gaussian distributions.
    Each distribution is specified as a tuple (x,y,s), where x,y is the mean
    and s is the standard deviation.  Defaults to two horizontally
    offset unit-mean Gaussians.
    """
    np.random.seed(1)
    dists = [(np.random.normal(x,s,num), np.random.normal(y,s,num)) for x,y,s in specs]
    return np.hstack([d[0] for d in dists]), np.hstack([d[1] for d in dists])

dist = gaussians(specs=[(2,2,0.02), (2,-2,0.1), (-2,-2,0.5), (-2,2,1.0), (0,0,3)], num=10000000)

datashade(hv.Points(dist)) + datashade(hv.Points(dist))

When the code above is executed two holoviews figures are shown side-by-side. When the box-zoom tool or wheel zoom tool is used the zoom level changes for both figures. However, only the plot for which the cursor is over updates correctly. Curiously, this issue is not observed after downgrading to holoviews: 1.14.9. For this reason, I have posted this issue here.

datashade_multiplot_update_fail_full

cmac994 avatar Aug 09 '22 04:08 cmac994

Same as #5381, this is because of changes made in #5265.

hoxbro avatar Aug 09 '22 14:08 hoxbro

@Hoxbro and @philippjfr , is this issue still applicable? If so it seems urgent to fix.

jbednar avatar Oct 26 '22 01:10 jbednar

Should have been resolved in 1.15.1

philippjfr avatar Oct 26 '22 07:10 philippjfr

Yes, it has been resolved.

https://user-images.githubusercontent.com/19758978/197961974-1b86b46c-dc63-4c86-a853-f671e2ab77f2.mp4

hoxbro avatar Oct 26 '22 07:10 hoxbro