Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Plotly backend doesn't update downsample1d on zoom #6649

@pepijndevos

Description

@pepijndevos

ALL software version info

(this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc should be added within the dropdown below.)

Software Version Info
annotated-types==0.7.0
anyio==4.9.0
anywidget==0.9.18
argon2-cffi==25.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asttokens==3.0.0
async-lru==2.0.5
attrs==25.3.0
babel==2.17.0
beautifulsoup4==4.13.4
bleach==6.2.0
bokeh==3.7.3
bokeh_sampledata==2024.2
build==1.2.2.post1
certifi==2025.6.15
cffi==1.17.1
charset-normalizer==3.4.2
click==8.2.1
colorcet==3.1.0
comm==0.2.2
contourpy==1.3.2
cycler==0.12.1
datashader==0.18.1
debugpy==1.8.14
decorator==5.2.1
defusedxml==0.7.1
diskcache==5.6.3
docutils==0.21.2
executing==2.2.0
fastapi==0.115.12
fastjsonschema==2.21.1
fonttools==4.58.4
fqdn==1.5.1
h11==0.16.0
h5py==3.14.0
holoviews==1.21.0
httpcore==1.0.9
httptools==0.6.4
httpx==0.28.1
icalendar==6.3.1
idna==3.10
-e git+ssh://[email protected]/Innovoltive/InSpice.git@020f731cba1550419e825d0033351b32058bd01f#egg=InSpice
ipykernel==6.29.5
ipython==9.3.0
ipython_pygments_lexers==1.1.1
ipywidgets==8.1.7
isoduration==20.11.0
itsdangerous==2.2.0
jedi==0.19.2
Jinja2==3.1.6
json5==0.12.0
jsonpointer==3.0.0
jsonschema==4.24.0
jsonschema-specifications==2025.4.1
jupyter==1.1.1
jupyter-console==6.6.3
jupyter-events==0.12.0
jupyter-lsp==2.2.5
jupyter_bokeh==4.0.5
jupyter_client==8.6.3
jupyter_core==5.8.1
jupyter_server==2.16.0
jupyter_server_terminals==0.5.3
jupyterlab==4.4.4
jupyterlab_pygments==0.3.0
jupyterlab_server==2.27.3
jupyterlab_widgets==3.0.15
kiwisolver==1.4.8
linkify-it-py==2.0.3
llvmlite==0.44.0
loro==1.5.1
-e git+ssh://[email protected]/marimo-team/marimo.git@c7e4469976567805b4a82d17f93838cfa2253a4b#egg=marimo
Markdown==3.8
markdown-it-py==3.0.0
MarkupSafe==3.0.2
matplotlib==3.10.3
matplotlib-inline==0.1.7
mdit-py-plugins==0.4.2
mdurl==0.1.2
mistune==3.1.3
multipledispatch==1.0.0
narwhals==1.41.0
nbclient==0.10.2
nbconvert==7.16.6
nbformat==5.10.4
nest-asyncio==1.6.0
notebook==7.4.4
notebook_shim==0.2.4
numba==0.61.2
numpy==2.2.6
-e git+ssh://[email protected]/NyanCAD/Mosaic.git@8d019e95e3595ac7ef41b716292fd8a4c40452d5#egg=nyancad&subdirectory=python/nyancad
-e git+ssh://[email protected]/NyanCAD/Mosaic.git@8d019e95e3595ac7ef41b716292fd8a4c40452d5#egg=nyancad_server&subdirectory=python/nyancad-server
overrides==7.7.0
packaging==25.0
pandas==2.3.0
pandocfilters==1.5.1
panel==1.7.2
param==2.2.1
parso==0.8.4
pexpect==4.9.0
pillow==11.2.1
platformdirs==4.3.8
ply==3.11
prometheus_client==0.22.1
prompt_toolkit==3.0.51
psutil==7.0.0
psygnal==0.13.0
ptyprocess==0.7.0
pure_eval==0.2.3
pycparser==2.22
pyct==0.5.0
pydantic==2.11.7
pydantic_core==2.33.2
Pygments==2.19.1
pymdown-extensions==10.15
pyparsing==3.2.3
pyproject_hooks==1.2.0
python-dateutil==2.9.0.post0
python-dotenv==1.1.0
python-json-logger==3.3.0
pytz==2025.2
pyviz_comms==3.0.6
PyYAML==6.0.2
pyzmq==27.0.0
referencing==0.36.2
requests==2.32.4
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.26.0
scipy==1.16.0
Send2Trash==1.8.3
setuptools==80.9.0
six==1.17.0
sniffio==1.3.1
soupsieve==2.7
stack-data==0.6.3
starlette==0.46.2
terminado==0.18.1
tinycss2==1.4.0
tomlkit==0.13.2
toolz==1.0.0
tornado==6.5.1
tqdm==4.67.1
traitlets==5.14.3
types-python-dateutil==2.9.0.20250516
typing-inspection==0.4.1
typing_extensions==4.14.0
tzdata==2025.2
uc-micro-py==1.0.3
uri-template==1.3.0
urllib3==2.5.0
uvicorn==0.34.3
uvloop==0.21.0
watchfiles==1.1.0
wcwidth==0.2.13
webcolors==24.11.1
webencodings==0.5.1
websocket-client==1.8.0
websockets==15.0.1
widgetsnbextension==4.0.14
xarray==2025.6.1
xyzservices==2025.4.0

Description of expected behavior and the observed behavior

When using the bokeh backend, the data is dynamically resampled when you zoom in. However, with the plotly backend, no resampling is happening on zoom and you just see the downsampled points.

fwiw I only prefer the plotly backend because it allows you to easily zoom only in the X or Y axis while the bokeh box zoom is less sophisticated.

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

import holoviews as hv
import numpy as np
import pandas as pd
import functools
from holoviews.operation.downsample import downsample1d


hv.extension('plotly')
#hv.extension('bokeh')

def _timeplot(data, cols=[]):
    print("timeplot", data, cols)
    traces = {k: hv.Curve(data, 'index', k).redim(**{k:'amplitude', 'index':'time'}) for k in cols}
    if not cols: # hack
        traces = {"dummy": hv.Scatter([])}
    return downsample1d(hv.NdOverlay(traces, kdims='k'))

time = np.linspace(0, 10, 10000)
data = pd.DataFrame(
    {
        "sine_1hz": np.sin(2 * np.pi * 1 * time),
        "sine_5hz": np.sin(2 * np.pi * 5 * time),
        "sine_10hz": np.sin(2 * np.pi * 10 * time),
        "noise": np.random.normal(0, 0.1, len(time)),
        "index": time,
    },
    index=time,
)

plot = _timeplot(data, cols=["sine_1hz", "sine_5hz"])
plot.opts(responsive=True, height=500)

Stack traceback and/or browser JavaScript console output

Screenshots or screencasts of the bug in action

Image

Image

  • I may be interested in making a pull request to address this (I have no idea where to look though)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions