Skip to content
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

Plotly figure cropped with JupyterLab 4.0.0a30 #13227

Closed
jtpio opened this issue Oct 11, 2022 · 6 comments
Closed

Plotly figure cropped with JupyterLab 4.0.0a30 #13227

jtpio opened this issue Oct 11, 2022 · 6 comments
Assignees
Labels
bug tag:Regression Behavior that had been broken, was fixed, and is broken again tag:Virtual Rendering Lazy and virtual rendering of notebook issues and PRs
Milestone

Comments

@jtpio
Copy link
Member

jtpio commented Oct 11, 2022

Description

Reporting here since this is an issue with JupyterLab 4 but not with 3:

4.0.0a30

image

3.4.7

image

Reproduce

  1. pip install plotly pandas
  2. Open JupyterLab
  3. Run a cell with the following content:
import plotly.express as px
fig = px.scatter(x=[0, 1, 2, 3, 4], y=[0, 1, 4, 9, 16])
fig.show()

Expected behavior

The figure should be displayed correctly.

Context

  • Operating System and version: Fedora 36
  • Browser and version: Firefox 105
  • JupyterLab version: 4.0.0a30

cc @fcollonval who might know if that could be related to the virtual notebook changes

@jtpio jtpio added bug status:Needs Triage Applied to new issues that need triage and removed status:Needs Triage Applied to new issues that need triage labels Oct 11, 2022
@jtpio jtpio added this to the 4.0.0 milestone Oct 11, 2022
@fcollonval
Copy link
Member

@jtpio does it resize after a certain delay or not? Because at first the plotly height is small as it displays here (I saw that in the integration tests).

@jtpio
Copy link
Member Author

jtpio commented Oct 12, 2022

No it does not seem to resize, even when resizing the window or triggering changes:

plotly-figure-cropped.mp4

@fcollonval
Copy link
Member

Thanks for the screencast.

@JasonWeill JasonWeill modified the milestones: 4.0.0, 4.1.0 Feb 1, 2023
@fcollonval fcollonval modified the milestones: 4.1.0, 4.0.0 Feb 2, 2023
@JasonWeill JasonWeill added tag:Regression Behavior that had been broken, was fixed, and is broken again tag:Virtual Rendering Lazy and virtual rendering of notebook issues and PRs labels Feb 8, 2023
@fcollonval
Copy link
Member

I can confirm this is still happening on master

I think the reason is that the CSS rule applied is:

In CSS 2, the effect of min-height and max-height on tables, inline tables, table cells, table rows, and row groups is undefined.

coupled to the current set of CSS rule:

image

Setting height instead of min-height works but I think it needs to be applied upstream.


ref: https://drafts.csswg.org/css2/#min-max-heights

The switch to table layout was done in #11508

@jtpio
Copy link
Member Author

jtpio commented Jun 6, 2023

Update: this was fixed in plotly/plotly.py#4227.

We can keep the issue open until there is a new release with the fix.

@jtpio
Copy link
Member Author

jtpio commented Jun 8, 2023

Closing as it is now fixed with Plotly 5.15.0: https://github.com/plotly/plotly.py/releases/tag/v5.15.0

image

@jtpio jtpio closed this as completed Jun 8, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug tag:Regression Behavior that had been broken, was fixed, and is broken again tag:Virtual Rendering Lazy and virtual rendering of notebook issues and PRs
Projects
None yet
Development

No branches or pull requests

3 participants