Skip to content

[BUG] autosize does not autosizes graph height to browser window size #259

@Olivier0330

Description

@Olivier0330

When creating a plotly.graph_objects.Figure() object without the resampling, the plot automatically scales when changing the window size of the browser.
With the plotly_resanpler.FigureResampler(plotly.graph_objects.Figure()) object, only the width of the plot automatically scales with the window size and not the height.

import plotly.graph_objects as go
import pandas as pd
import plotly_resampler

df = pd.read_csv(<filename>)

fig = plotly_resampler.FigureResampler(go.Figure().update_layout(autosize=True))
for col in df.columns:
    fig.add_trace(
        go.Scattergl(name=col, text=df[col].values,
                     hovertemplate=hover_template(column=col)),
        hf_x=df.index,
        hf_y=df[col]
    )

fig.update_layout(
    autosize=True
)

fig.show_dash()

Versions
Python 3.10
Plotly 5.11.0
Plotly-resampler 0.8.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions