Skip to content

FigureWidget: resizing can only expand but cannot shrink #3689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
martinRenou opened this issue Apr 22, 2022 · 5 comments
Closed

FigureWidget: resizing can only expand but cannot shrink #3689

martinRenou opened this issue Apr 22, 2022 · 5 comments

Comments

@martinRenou
Copy link
Contributor

When executing the following in a JupyterLab Notebook, increasing the window size results in the plot correctly expanding, but reducing the size of the window does not shrink the plot correctly (see following GIF):

import ipywidgets as widgets

import plotly.graph_objects as go
import plotly.express as px


fig = px.line([1, 2, 3, 4, 6], template='plotly_dark')

fw = go.FigureWidget(fig)

fw

resizing

@Alexboiboi
Copy link

@martinRenou @nicolaskruchten
When building dashbords with resizable windows and FigureWidgets this is getting quite annoying. Is there any workaround ?

@martinRenou
Copy link
Contributor Author

I never took the time to look deeper into it unfortunately. And I cannot really think of a workaround.

@Alexboiboi
Copy link

I never took the time to look deeper into it unfortunately. And I cannot really think of a workaround.

Hi @martinRenou, this hack (#2062) is kinda working

@Alexboiboi
Copy link

Hi @martinRenou,

looks like the latest release (5.12) solves this issue.

Worth looking at [bqplot/bqplot#1531] to adress a similiar issue when the FigureWidget is inside another container.

@nicolaskruchten
Copy link
Contributor

Ok great! Let's open a separate issue for any lingering problems plz. No one on the Plotly team is really actively working on the Widget side of things so PRs are very welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants