Hi;
I’m sharing full code to replicate problem.
import numpy as np, pandas as pd
import panel as pn, param
import holoviews as hv
import geoviews as gv #sorun olusturuyor
hv.extension('bokeh', logo=False, sizing_mode='stretch_both')
class dashboard(param.Parameterized):
def __init__(self, **params):
super(dashboard, self).__init__(**params)
def viewable(self):
dates = np.arange('2022-01-01', 10, dtype='M8[D]')
result_dict = {}
for date in dates[:4]:
xs = range(-10,11)
ys = np.random.randint(1,10,len(list(xs)))
step_graph = hv.Curve((xs, ys))
result_dict[(pd.to_datetime(date).date().strftime("%Y-%m-%d"))] = step_graph
kdims = [hv.Dimension(('date', 'Tarih'), default="2022-01-01")]
holomap = hv.HoloMap(result_dict, kdims=kdims)
return holomap
def date2(self):
dates = np.arange('2022-01-01', 10, dtype='M8[D]')
result_dict = {}
for date in dates[:4]:
xs = range(-10,11)
ys = np.random.randint(1,10,len(list(xs)))
step_graph = hv.Curve((xs, ys))
result_dict[(pd.to_datetime(date).date().strftime("%Y-%m-%d"))] = step_graph
kdims = [hv.Dimension(('date', 'Tarih'), default="2022-01-01")]
holomap = hv.HoloMap(result_dict, kdims=kdims)
return holomap
def place(self):
places = ["place1","place2","place3","place4"]
result_dict = {}
for place in places:
xs = range(-10,11)
ys = np.random.randint(1,10,len(list(xs)))
step_graph = hv.Curve((xs, ys))
result_dict[(place)] = step_graph
kdims = [hv.Dimension(('place', 'Place'), default="place1")]
holomap = hv.HoloMap(result_dict, kdims=kdims)
return holomap
def run():
dashborad_instance = dashboard(name="")
component1 = dashborad_instance.viewable().opts(responsive=True)
component1 = pn.Card(pn.panel(component1, height=600,sizing_mode='stretch_width'),
title="panel1",
collapsible=False,
active_header_background="#94F1F2", sizing_mode='stretch_both')
component2 = dashborad_instance.date2().opts(responsive=True)
component2 = pn.Card(pn.panel(component2, height=600,sizing_mode='stretch_width'),
title="panel 2",
collapsible=False,
active_header_background="#94F1F2", sizing_mode='stretch_both')
component3 =dashborad_instance.place().opts(responsive=True)
component3 = pn.Card(pn.panel(component3, height=500,sizing_mode='stretch_width'),
title="Panel3",
collapsible=False,
active_header_background="#94F1F2", sizing_mode='stretch_both')
plot1 = pn.Column(pn.panel(component1,sizing_mode="stretch_width"),
pn.panel(component2,sizing_mode="stretch_width"),
pn.panel(component3,sizing_mode="stretch_width"),sizing_mode='stretch_both')
return plot1
run().save("./raporlar/rapora.html", embed=True)
If you don’t add component3, first 2 holoviews will work as it should be but when you run the above code, last holoview will work but others will not work. Please first change the last select box and then try first or second one. Then you will experience problem.