Skip to content

Layout does not use active_tools options #5119

@MarcSkovMadsen

Description

@MarcSkovMadsen

I'm trying to create a Panel example for scikit-image.

I have two images (before+after). I want them to share the toolbar and have box_zoom as the default active tool.

But I cannot achieve that.

The first two rows below do not have box_zoom as the active_tool even though I've specified it.

The third has box_zoom as the active_tool but does not share the toolbar.

image

import holoviews as hv
import panel as pn
from skimage import data, filters

image = data.coins()
edges = filters.sobel(image)*256

bounds = (-1, -1, 1, 1)

before_img = hv.Image(image, bounds=bounds).apply.opts(
    cmap="binary_r", height=400, width=400, title="Before", active_tools=["box_zoom"], tools=["hover"]
)
after_img = hv.Image(edges, bounds=bounds).apply.opts(
    cmap="binary_r", height=400, width=400, title="After", active_tools=["box_zoom"], tools=["hover"], colorbar=True
)
layout=(before_img+after_img).apply.opts(active_tools=["box_zoom"])

pn.Column(
    pn.panel(before_img+after_img, sizing_mode="fixed"),
    pn.panel(layout, sizing_mode="fixed"),
    pn.Row(before_img, after_img, sizing_mode="fixed"),
).servable()

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't correct or isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions