panel icon indicating copy to clipboard operation
panel copied to clipboard

Collapsing a card containing a DataFrame widget triggers "SlickGrid cannot find stylesheet" and "DOMException"

Open skemp117 opened this issue 1 year ago • 0 comments

ALL software version info

(this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc) panel 1.2.1 Edge Version 120.0.2210.133 (Official build) (64-bit) Python 3.11.5

Description of expected behavior and the observed behavior

Expect: Cards to collapse and expand with no problem Actual: Cards collapsing cause the error. Sometimes no error is given, but the dataframe object is not shown

Complete, minimal, self-contained example code that reproduces the issue

import pandas as pd
import panel as pn

pn.extension()

start_time = 1
stop_time = 5
sample_rate = 5
loaded = False
field = 'channel'
df_data = {
    'start_time': start_time, 
    'stop_time': stop_time, 
    'sample_rate': sample_rate, 
    'loaded': loaded
}
df = pd.DataFrame(df_data, index=[field])

df = pd.concat([df,pd.DataFrame(df_data, index=['field'])])
test_data = {'bucket':{'meas':df}}

widget = pn.layout.Column(sizing_mode='stretch_width', scroll=True)

widget.objects = []
widget.append("Hi")
for bucket in test_data:
    buckets_card = pn.Card(title=(f'{bucket}'),sizing_mode='stretch_width')
    for meas in test_data[bucket]:
        meas_card = pn.Card(title=f'{meas}',sizing_mode='stretch_width')
        buckets_card.append(meas_card)
        cb = pn.layout.Column(pn.widgets.DataFrame(test_data[bucket][meas], 
            show_index = True, text_align = 'left', reorderable = False))
        meas_card.append(cb)
    widget.append(buckets_card)

template = pn.template.BootstrapTemplate(
            title='Viewer',
            sidebar=widget,
            sidebar_width = 650,
        )

template.servable()

Stack traceback and/or browser JavaScript console output

localhost-1705511967565.log

Screenshots or screencasts of the bug in action

image image

  • [ ] I may be interested in making a pull request to address this

skemp117 avatar Jan 17 '24 17:01 skemp117