0

I want to create an interactive dashboard as a standalone-application, being launched with only Firefox. Here's some simple example code with two buttons and a plot. it's exporting an html-file. but the elements seem not to react, when opened in Firefox...


import pandas as pd
import numpy as np
import hvplot.pandas 
import panel as pn 
import holoviews as hv



np.random.seed(1234)
cols = ['Col1', 'Col2', 'Col3', 'Col4']
adf = pd.DataFrame(np.random.rand(3, 4), columns=cols)
bdf = pd.DataFrame(np.random.rand(3, 4), columns=cols)
adf['Type'] = 'A'
bdf['Type'] = 'B'

df = pd.concat([adf,bdf])
df.index.names = ['idx']

typebutton = pn.widgets.RadioButtonGroup(name='Typebutton', options=['A','B'],button_type='success')
dfi = df.interactive(width=800)
df_inter = (dfi[dfi.Type == typebutton])

#df_inter
plot = df_inter.hvplot(kind='box', y=['Col1','Col2','Col3', 'Col4'], legend=False)
plot

template = pn.template.FastListTemplate(
    title='stackoverflow export panel to html', 
    sidebar=[pn.pane.Markdown("## Settings"),
             'Interactive Elements',typebutton], 
    main=[plot.panel()],
    accent_base_color="#88d8b0",
    header_background="#88d8b0",
)

template.servable();

from bokeh.resources import INLINE
template.save('interactive_elements.html', resources=INLINE)
  • what exactly is not working or not interactive? – Ola Galal Aug 04 '22 at 07:41
  • Chart works for me, buttons are clickable but do not execute any function (as expected) - however the thing loaded quite a bit - you might have problems fetching the resources (firewall?) - try opening the html in a different browser and/or use a direct connection – mnikley Aug 04 '22 at 07:45
  • There are two buttons which let you switch between which dataframe is ploted! In the HTML-File the buttons are click-able but the plot isn't changing – Paul Borowy Aug 04 '22 at 08:28

0 Answers0