hvplot icon indicating copy to clipboard operation
hvplot copied to clipboard

.interactive dataframe repr: table columns overlap

Open JanHomann opened this issue 3 years ago • 2 comments

ALL software version info

hvplot                : 0.8.0
pandas                : 1.4.3
holoviews             : 1.14.9
bokeh                 : 2.4.3

Python version        : 3.9.13
IPython version       : 8.4.0
jupyter notebook      : 6.4.12
jupyterlab            : 3.4.3
    
OS                    : Darwin ( = MacOS 11.5.2)
Release               : 20.6.0
Browser               : Safari

Description of expected behavior and the observed behavior

The columns of the dataframe representation in both jupyter notebook and jupyter lab are too narrow, so numbers overlap for a particular example dataframe.

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

import hvplot.pandas
from bokeh.sampledata import airports

df = airports.data
df1 = df.interactive()
df1    # show dataframe

Performing a dynamic calculation on the dataframe doesn't change that behavior

p = pnw.IntSlider(start=0, end=100)
df1[df1.index<p]   # dataframe still squished

Stack traceback and/or browser JavaScript console output

No error message in jupyter notebook / lab. Ne error / warning in javascript console.

Screenshots or screencasts of the bug in action

Screen Shot 2022-07-07 at 3 11 27 PM

Expected behavior

Screen Shot 2022-07-07 at 3 24 15 PM

JanHomann avatar Jul 07 '22 19:07 JanHomann

Update:

It seems like there is a width parameter for .interactive(). Unfortunately .interactive() doesn't seem to have a docstring, so it's far from obvious that there are parameters that you can give it, but I think I found it being used somewhere, that's why I thought about trying it.

With that width parameter the width of the dataframe table output can be controlled. the result is not perfect (because every column gets equal width), but it gets rid of the overlap.

Screen Shot 2022-07-07 at 5 43 45 PM

JanHomann avatar Jul 07 '22 21:07 JanHomann

I see there is a height parameter also. Would be nice if that would go in the docstring of .interactive().

JanHomann avatar Jul 07 '22 22:07 JanHomann

@maximlt Seems to be solved now. So close it? An informative docstring was also added to .interactive, though height is not mentioned as a parameter, but width at least.

JanHomann avatar Jul 10 '23 20:07 JanHomann