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

subcoordinates_y breaks DynamicMap #6120

Closed
ahuang11 opened this issue Feb 19, 2024 · 7 comments
Closed

subcoordinates_y breaks DynamicMap #6120

ahuang11 opened this issue Feb 19, 2024 · 7 comments
Labels
type: bug Something isn't correct or isn't working

Comments

@ahuang11
Copy link
Collaborator

ahuang11 commented Feb 19, 2024

from functools import partial
import holoviews as hv
from holoviews.streams import RangeX
hv.extension("bokeh")


def update(x0, x_range):
    if not x_range:
        x_range = [0, 1]
    print(x_range)
    xdata = [x0, 1, 2, x_range[-1]]
    return hv.Curve(((xdata, (0, 1, 2, 3))), label=str(x0)).opts(subcoordinate_y=True)


range_x = RangeX()
overlay = hv.Overlay([])
overlay *= hv.DynamicMap(partial(update, 0), streams=[range_x])
overlay *= hv.DynamicMap(partial(update, 1), streams=[range_x])
overlay

Removing subcoordinate_y makes the dynamicmap update again.

Expected

Screen.Recording.2024-02-19.at.1.11.23.PM.mov

Broken

Screen.Recording.2024-02-19.at.1.12.04.PM.mov
@hoxbro
Copy link
Member

hoxbro commented Feb 19, 2024

What version of holoviews are you using? Can you try running on main (if not already)

@ahuang11
Copy link
Collaborator Author

Originally 1.18.1; now main, but same behavior.

@ahuang11
Copy link
Collaborator Author

ahuang11 commented Feb 19, 2024

Here's another variation that also doesn't work :):

from functools import partial
import panel as pn
import holoviews as hv
from holoviews.streams import RangeX
hv.extension("bokeh")


def update(x_range):
    if not x_range:
        x_range = [0, 1]
    print(x_range)
    overlay = hv.Overlay([])
    for x0 in [0, 1]:
        xdata = [x0, 1, 2, x_range[-1]]
        overlay *= hv.Curve(((xdata, (0, 1, 2, 3))), label=str(x0)).opts(subcoordinate_y=True)
    return overlay


range_x = RangeX()
overlay = hv.DynamicMap(update, streams=[range_x])
overlay

@hoxbro
Copy link
Member

hoxbro commented Feb 19, 2024

Are you sure it is the same behavior because the zoom tool should behave differently on the main? Because of #6051

@ahuang11
Copy link
Collaborator Author

ahuang11 commented Feb 19, 2024

Okay, maybe it's just RangeX that doesn't work?

from functools import partial
import panel as pn
import holoviews as hv
from holoviews.streams import Tap
hv.extension("bokeh")


def update(x, y):
    # if not x_range:
    #     x_range = [0, 1]
    # print(x_range)
    print(x, y)
    overlay = hv.Overlay([])
    for x0 in [0, 1]:
        xdata = [x0, 1, 2, y]
        overlay *= hv.Curve(((xdata, (0, 1, 2, 3))), label=str(x0)).opts(subcoordinate_y=True)
    return overlay


range_x = Tap()
overlay = hv.DynamicMap(update, streams=[range_x])
overlay

@ahuang11
Copy link
Collaborator Author

:) Wow @hoxbro you're quite magical.

I forgot to pull the latest main...

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

No branches or pull requests

2 participants