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

Use of 'shared_axes=False' with downsample1D breaks opts #6395

Open
1 task
droumis opened this issue Sep 27, 2024 · 0 comments
Open
1 task

Use of 'shared_axes=False' with downsample1D breaks opts #6395

droumis opened this issue Sep 27, 2024 · 0 comments

Comments

@droumis
Copy link
Member

droumis commented Sep 27, 2024

ALL software version info

Software Version Info
Python              :  3.11.10 | packaged by conda-forge | (main, Sep 22 2024, 14:11:13) [Clang 17.0.6 ]
Operating system    :  macOS-13.5.2-arm64-arm-64bit
Panel comms         :  default

holoviews           :  1.19.1

bokeh               :  3.5.2
colorcet            :  3.1.0
cudf                :  -
cupy                :  -
dask                :  2024.9.0
dask-expr           :  1.1.14
datashader          :  0.16.3
geoviews            :  -
hvplot              :  0.10.0
ibis-framework      :  -
IPython             :  8.27.0
ipywidgets-bokeh    :  -
jupyter-bokeh       :  -
jupyterlab          :  4.2.5
matplotlib          :  3.9.2
networkx            :  -
notebook            :  6.5.7
numba               :  0.60.0
numpy               :  1.26.4
pandas              :  2.2.3
panel               :  1.5.0
param               :  2.1.1
pillow              :  10.4.0
plotly              :  -
pyarrow             :  17.0.0
pyviz-comms         :  3.0.3
scikit-image        :  -
scipy               :  1.14.1
spatialpandas       :  -
streamz             :  -
tsdownsample        :  0.1.3
xarray              :  2024.9.0

Description of expected behavior and the observed behavior

The use of the same kdims across plots is required for an annotator to be applied to both.
The use of the same kdims when applying a RangeToolLink requires use of shared_axes=False on the layout.
The use of shared_axes=False with downsample1D appears to break the proper opts assignment.

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

import pandas as pd
import numpy as np
import hvplot.pandas
import holoviews as hv; hv.extension('bokeh')
from holoviews.plotting.links import RangeToolLink

from holonote.annotate import Annotator
from holonote.app import PanelWidgets, AnnotatorTable
from holonote.annotate.connector import SQLiteDB

annotator = Annotator({'time': float}, fields=["description"],
                      connector=SQLiteDB(filename=':memory:'),
                      groupby = "description"
                     )
annotator.set_regions(time=(20,40))
annotator.add_annotation(description="test")

n_samples = 1000
data = np.random.randn(n_samples)

df = pd.DataFrame({'time': np.arange(len(data)), 'value': data})
plot = hv.Curve(df, ['time'], ['value']).opts(responsive=True, height=200)
plot = downsample1d(plot)#.opts(responsive=True, height=200)
mmap = hv.Curve(df, ['time'], ['value']).opts(height=100, responsive=True, toolbar=None)
# mmap = mmap.redim(time='redim_time', value='redim_value')
link = RangeToolLink(mmap, plot, axes=["x", "y"])

app = (plot + mmap).cols(1).opts(shared_axes=False)

app * annotator

# workaround
# anno_plot = (annotator * plot).opts(responsive=True, height=200)
# anno_mmap = (annotator * mmap)
# (anno_plot + anno_mmap).cols(1).opts(shared_axes=False)

Stack traceback and/or browser JavaScript console output

Screenshots or screencasts of the bug in action

Sound on!
GMT20240927-175722_Clip_Demetris.Roumis.s.Clip.09_27_2024.mp4
  • I may be interested in making a pull request to address this
@droumis droumis transferred this issue from holoviz/holonote Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant