holoviz / holoviz/hvplot

.interactive adds and removes a scrollbar

Open
#877 0 comments 0 reactions 0 assignees View on GitHub
api: interactive
Dominant language
Python
Stars
1.4k
Forks
124
Avg merge
1d 18h
Merged PRs (30d)
1

Description

When trying out the example below in a Jupyter Notebook a scrollbar is added and removed when I use the widgets.

This is a bad user experience.

My guess is that this can be solved by adding some padding or wrapping things in an additional container.

![interactive-altair](https://user-images.githubusercontent.com/42288570/187074705-f3f26012-5b1c-40ee-b861-89bd63974e97.gif)

```python
import altair as alt
import panel as pn
pn.extension("vega")

def altair_plot(source):
return alt.Chart(source, width="container").mark_line().encode(x="bill_length_mm", y="bill_depth_mm")

import hvplot.pandas # noqa
import panel as pn
from bokeh.sampledata.penguins import data as df

w_sex = pn.widgets.MultiSelect(name='Sex', value=['MALE'], options=['MALE', 'FEMALE'])
w_body_mass = pn.widgets.FloatSlider(name='Min body mass', start=2700, end=6300, step=50)

dfi = df.interactive(loc='left', sizing_mode="stretch_width")
dfi.loc[(dfi['sex'].isin(w_sex)) & (dfi['body_mass_g'] > w_body_mass)].pipe(altair_plot)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.