Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Range tool is variably and incorrectly present on the target plot in Panel app #5315

Closed
droumis opened this issue Jul 25, 2023 · 4 comments
Closed
Labels
type: bug Something isn't correct or isn't working

Comments

@droumis
Copy link
Member

droumis commented Jul 25, 2023

ALL software version info

Python : 3.9.16 | packaged by conda-forge | (main, Feb 1 2023, 21:38:11)
[Clang 14.0.6 ]
Operating system : macOS-13.4.1-arm64-arm-64bit
holoviews : 1.17.0a1

bokeh : 3.2.1
colorcet : 3.0.1
cudf : -
dask : 2023.7.1
datashader : 0.15.0
geoviews : -
hvplot : 0.8.3
ibis : -
IPython : 8.14.0
jupyter_bokeh : -
jupyterlab : 3.6.4
matplotlib : 3.7.2
networkx : 3.1
notebook : 6.5.4
numba : 0.57.1
numpy : 1.24.3
pandas : 1.5.3
panel : 1.2.0
param : 1.13.0
PIL : 10.0.0
plotly : -
pyarrow : -
scipy : 1.11.1
skimage : 0.21.0
spatialpandas : -
streamz : -
xarray : 2023.5.0

Description of expected behavior and the observed behavior

When using a Range Tool across plots in a Panel app, the Range tool is variably and incorrectly present on the target plot, even when shared_axes are set to False.

This issue doesn't seem to occur when using a HoloViews Layout like (data_viewer + minimap).cols(1), but of course a hv layout does not provide the same functionality that Panel does so it's not an adequate replacement.

Complete, minimal, self-contained example code that reproduces the issue

import numpy as np
import holoviews as hv
import panel as pn; pn.extension()
from holoviews.plotting.links import RangeToolLink
hv.extension('bokeh')

time = np.linspace(0, 10, 500)
data = np.random.rand(10, 500)

channel_curves = [hv.Curve((time, data[i, :] + i), "Time").opts(shared_axes=False) for i in range(data.shape[0])]

data_viewer = hv.Overlay(channel_curves).opts(shared_axes=False)

minimap = hv.Image((time, np.arange(data.shape[0]), data), ["Time", "Channel"]).opts(shared_axes=False)

RangeToolLink(minimap, list(data_viewer.values())[0], axes=["x", "y"])

app = pn.Column(pn.Row(data_viewer), minimap).servable()
app

Stack traceback and/or browser JavaScript console output

Screenshots or screencasts of the bug in action

Range Tool is correctly absent on top data_viewer plot

image

No code changed, just re-executed the notebook cell a couple times, and the Range Tool is now incorrectly present on top data_viewer plot

image

@droumis droumis added the TRIAGE Default label for untriaged issues label Jul 25, 2023
@droumis droumis moved this to Todo in CZI R5 neuro Jul 25, 2023
@philippjfr philippjfr added type: bug Something isn't correct or isn't working and removed TRIAGE Default label for untriaged issues labels Jul 25, 2023
@philippjfr philippjfr added this to the next milestone Jul 25, 2023
@droumis
Copy link
Member Author

droumis commented Aug 4, 2023

Creating the Panel layout like pn.Column(eeg_viewer + minimap) instead of pn.Column(pn.Row(eeg_viewer), minimap) is a workaround

@droumis
Copy link
Member Author

droumis commented Aug 8, 2023

Creating the Panel layout like pn.Column(eeg_viewer + minimap) instead of pn.Column(pn.Row(eeg_viewer), minimap) is a workaround

Unfortunately, this workaround causes the target plot and the source plot to be spaced too far apart when served as an app:

image

Which was an issue originally surfaced here.

I wonder if there's a way to control the spacing (keeping the plots close) when still preventing the RangeTool issue?

@droumis
Copy link
Member Author

droumis commented Jan 1, 2024

Can confirm that the original issue ('Range tool is variably and incorrectly present on the target plot in Panel app') is still present in the latest Panel version.

The workaround is proving hard to replicate with an MRE.. will keep trying to nail down the issue.

@philippjfr philippjfr modified the milestones: v1.4.0, v1.4.x Mar 13, 2024
@droumis
Copy link
Member Author

droumis commented Apr 2, 2024

I'll close this for now.. The issues raised (in both the original implementation and workaround) are still present, but are probably difficult to address and they aren't actually preventing functionality. Ideally, it would be great to have a jslink like RangeToolLink be applied across Panel panes, but I think we'll have to rely on HoloViews for layout for the foreseeable future.

@droumis droumis closed this as completed Apr 2, 2024
@droumis droumis moved this from Todo to dropped in CZI R5 neuro Apr 2, 2024
@philippjfr philippjfr removed this from the v1.4.x milestone Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

No branches or pull requests

2 participants