panel icon indicating copy to clipboard operation
panel copied to clipboard

HoloViews backend Plotly is not responsive

Open MarcSkovMadsen opened this issue 2 years ago • 0 comments

I'm trying to create a Panel demo app using hvplot, HoloViews and the Plotly backend. The problem is that its not responsive. This is friction and makes it so much harder to use the tools you know and love.

import pandas as pd
import hvplot.pandas
import panel as pn
import holoviews as hv
import holoviews.plotting.mpl

pn.extension("plotly", sizing_mode="stretch_width")

hv.extension("bokeh", "plotly")

data = pd.DataFrame(
    {
        "x": [1, 2, 3, 4, 5, 6],
        "y": [2, 4, 8, 16, 32, 64],
    }
)
plot = data.hvplot(x="x", y="y", responsive=True)

pn.pane.HoloViews(plot, backend="plotly", sizing_mode="stretch_width", height=400).servable()
pn.pane.HoloViews(plot, backend="bokeh", sizing_mode="stretch_width", height=400).servable()

image

Additional Context

Please dont tell me I can use a hook. Hooks sound complex. Its a last resort. Not something that should be needed for basic usage.

Responsive behaviour is what I see users ask for all the time. I've never seen a use case where people want fixed size. And if responsive behaviour is difficult to achieve then they leave because they have too many other problems to solve.

MarcSkovMadsen avatar Jul 02 '22 06:07 MarcSkovMadsen