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
Layout does not use active_tools options #5119
Labels
TRIAGE
Needs triaging
Comments
I can reproduce that, though I don't know if the problem is in HoloViews or the underlying Bokeh code. |
Just got hit by this again. There is also a user reporting the issue on Discourse: https://discourse.holoviz.org/t/how-to-set-active-tools-for-layout/2006 |
Just got hit by this again trying to create a dashboard with crossfiltering for Panel tutorials. import holoviews as hv
import numpy as np
import pandas as pd
import panel as pn
from bokeh.models.formatters import NumeralTickFormatter
pn.extension(sizing_mode="stretch_width")
ACCENT = "teal"
SHORT_NAMES = {
"Changzhou Railcar Propulsion Engineering Research and Development Center": "Changzhou",
"Siemens Gamesa Renewable Energy": "Siemens Gamesa",
}
@pn.cache()
def _download_data():
return pd.read_csv("https://assets.holoviz.org/panel/tutorials/turbines.csv.gz")
@pn.cache
def get_data():
data = _download_data()
mask = data.t_manu.isin(list(SHORT_NAMES))
data.loc[mask, "t_manu"] = data.loc[mask, "t_manu"].map(SHORT_NAMES)
data.t_cap = data.t_cap/10**6
return data
# @pn.cache
def plot_with_crossfilter():
data = get_data()
# Define shared dataset
ds = hv.Dataset(data, ["t_manu", "p_year", "t_cap"], "t_cap")
# Create plots
ds_by_year = ds.aggregate("p_year", function=np.sum).sort("p_year")
ds_by_manufacturer = ds.aggregate("t_manu", function=np.sum).sort("t_cap", reverse=True)
formatter = NumeralTickFormatter(format="0,0")
plot_by_year = hv.Bars(ds_by_year, ("p_year", "Year"), ("t_cap", "Capacity (GW)")).opts(
responsive=True, xrotation=90, yformatter=formatter, color=ACCENT, tools=["hover"], active_tools=['box_select']
)
plot_by_manufacturer = hv.Bars(ds_by_manufacturer, ("t_manu", "Manufacturer"), ("t_cap", "Capacity (GW)")).opts(
responsive=True, xrotation=90, yformatter=formatter, color=ACCENT, tools=["hover"], active_tools=['box_select']
)
# Link plots
layout = (plot_by_year + plot_by_manufacturer).cols(1)
selections = hv.link_selections(layout)
return selections
cross_filter_plot = plot_with_crossfilter()
pn.template.FastListTemplate(
title="Windturbine Dashboard with Crossfiltering",
main=[cross_filter_plot],
main_layout=None,
accent=ACCENT,
).servable() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 theactive_tool
even though I've specified it.The third has
box_zoom
as theactive_tool
but does not share the toolbar.The text was updated successfully, but these errors were encountered: