Panel: Dataframe widget overlaps other widgets

Created on 20 Oct 2020  路  4Comments  路  Source: holoviz/panel

ALL software version info

Panel 0.9.7

Description of expected behavior and the observed behavior

When layout out the Dataframe widget in a column with other widgets, the dataframe widget will overlap any widgets underneath it.

You can see in the example below that the download text appears in the "right" place, at 300px down, where the dataframe should end, but the dataframe just continues on beyond that, overlapping the download text (and making it unclickable).

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

import panel as pn
import pandas as pd 
import param
pn.extension()

class Report(param.Parameterized):

    def __init__(self, **params):
        super().__init__(**params)

        self.df = pd.concat([pd.util.testing.makeMixedDataFrame()] * 100)

        # construct file path
        self.file_path = 'report.csv'
        # write to file
        self.df.to_csv(self.file_path, index=False)
        self.file_download = pn.widgets.FileDownload(file=self.file_path, filename=self.file_path)


    def panel(self):

        data_pane = pn.Row(pn.widgets.DataFrame(self.df, width_policy='max'), height=300, sizing_mode='stretch_width')

        return pn.Column(
            data_pane,
            pn.Spacer(height=1),
            self.file_download,
            sizing_mode="stretch_width",
            height=800,
        )

rep = Report()
rep.panel()

Screenshots or screencasts of the bug in action

image

bug

All 4 comments

This is very similar to this issue but its slightly different so I opened this separate issue with a different example.

Works okay if the size is set on the widget itself, which is what matters:

        data_pane = pn.Row(pn.widgets.DataFrame(self.df, width_policy='max', height=300), sizing_mode='stretch_width')

Thanks for the issue in any case though, not sure why the table overflows the Column but I think that's a bokeh issue.

I should have caught that! Thanks for the fix!

Was this page helpful?
0 / 5 - 0 ratings