holoviz / hvplot

A high-level plotting API for pandas, dask, xarray, and networkx built on HoloViews
https://hvplot.holoviz.org
BSD 3-Clause "New" or "Revised" License
1.14k stars 108 forks source link

.interactive dataframe repr: table columns overlap #770

Open JanHomann opened 2 years ago

JanHomann commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

JanHomann commented 1 year ago

@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.