plotly / plotly/plotly.py

autosizing issue since upgrade from 5.24.1 to 6.3.0

Open
#5,370 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P2
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

Since I upgraded plotly from 5.24.1 to 6.3.0 my diagrams do not take up the whole width of the parent container anymore.
Minimal working example using solara:

import solara
import plotly.express as px

@solara.component
def create_dashboard():
  fig = px.scatter(x=[0, 1, 2, 3, 4], y=[0, 1, 4, 9, 16])
  return solara.Div(
          [solara.FigurePlotly(fig)],
          style={"width": "100%", "display": "flex", "flex": "1 1 auto"},
      ),
  )

@solara.component
def Page():
    create_dashboard()

What is the accepted way of using full width in >6.0.0 ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal Solara example in the issue and compare its autosizing behavior between Plotly 5.24.1 and 6.3.0. Trace how solara.FigurePlotly handles the figure container and determine what usage or change restores full parent width; done means the provided diagram fills its parent after upgrading.

Written by the indexing model from the issue text.

Assessment

Tech stack
plotly, python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.