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

HLines not working with .apply() properly #6197

Open
SinisterMJ opened this issue Apr 17, 2024 · 0 comments
Open

HLines not working with .apply() properly #6197

SinisterMJ opened this issue Apr 17, 2024 · 0 comments

Comments

@SinisterMJ
Copy link

ALL software version info

bokeh 3.4.0
notebook 7.1.2
holoviews 1.18.3
python 3.11.8
Google Chrome Version 123.0.6312.123 (64-bit)

Description of expected behavior and the observed behavior

Expected behavior:
when the zoom allows for the y-range to show 30 lines, they should be displayed.

Observed behavior:
the lines never show, no matter how much I zoom in

Note: if using VLines() instead of HLines(), it works fine

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

import holoviews as hv
import numpy as np
hv.extension('bokeh')

def filter_lines(lines, x_range, y_range):
    if x_range is None or y_range is None:
        return lines
    if len(lines[x_range, y_range]) > 30:
        return lines[x_range, y_range].opts(alpha=0.0)
    return lines[x_range, y_range]

list_lines = np.arange(0, 60, 1)
lines = hv.HLines(list_lines)

range_stream = hv.streams.RangeXY(source=lines)
streams=[range_stream]

filtered = lines.apply(filter_lines, streams=streams)
display(filtered + lines)

Screenshots or screencasts of the bug in action

HLines

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