Skip to content

norm framewise broken for Overlays inside DynamicMaps #3637

@basnijholt

Description

@basnijholt

Take this function

offset = 0


def plot_generator(overlay):
    global offset
    while True:
        ys = np.random.rand(10) + offset
        offset += 0.1
        if overlay:
            yield hv.Curve(ys) * hv.Scatter(ys)
        else:
            yield hv.Curve(ys)


get_dm = lambda overlay: hv.DynamicMap(
    plot_generator(overlay), streams=[hv.streams.Stream.define("Next")()]
).opts(norm=dict(framewise=True))

Now everything is fine like this:

dm = get_dm(overlay=False)
dm

dm.periodic(0.5)  #next cell

gives:
false

But when there is an overlay, it doesn't work:

dm = get_dm(overlay=True)
dm

dm.periodic(0.5)  #next cell

gives:
true

This blocks python-adaptive/adaptive#186.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions