holoviz/panel

Tabulator fast theme not working in notebook

MarcSkovMadsen opened this issue · 0 comments

Panel 0.12.6

import panel as pn

pn.extension('tabulator', sizing_mode="stretch_width")

from bokeh.sampledata.autompg import autompg_clean as df
df.head()

pn.widgets.Tabulator(df, pagination='remote', page_size=5)

pn.widgets.Tabulator(df, pagination='remote', page_size=5, theme="fast")

image

Solution

As the fast theme will only work inside a Fast template on a server it would be really nice to just set the theme to the default, simple or site if running in a notebook environment.

Workaround

def environment():
    try:
        get_ipython()
        return "notebook"
    except:
        return "server"

if environment()=="server":
   theme="fast"
else:
   theme="site"