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

Fix dynamic notebook widgets resizing #13289

Merged
merged 2 commits into from
Jan 22, 2024

Conversation

jonah-iden
Copy link
Contributor

What it does

fixes #13139

fixes resizing of the output iframe when the content changes

How to test

  • You need pip install plotly in your python env
  • create a note book
  • add following cell and execute it
# x and y given as array_like objects
import plotly.express as px
fig = px.scatter(x=[0, 1, 2, 3, 4], y=[0, 1, 4, 9, 16])
fig.show()

it should now resize correctly

Follow-ups

Review checklist

Reminder for reviewers

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
@@ -313,11 +313,20 @@ export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
private onRenderCompleted(): void {
// we need to check for all images are loaded. Otherwise we can't determine the correct height of the output
const images = Array.from(document.images);
console.log(images);
images?.forEach(img => img.onresize = e => console.log(e));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you forgot to remove the debug logging?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ups yes thanks for pointing that out

removed forgotten debug changes
@msujew msujew changed the title fix resizing of dynamic widgets Fix dynamic notebook widgets resizing Jan 20, 2024
@bvenreply
Copy link
Contributor

Working great on my end. Thanks @jonah-iden

@JonasHelming
Copy link
Contributor

@jonah-iden Great! Let's get this into the relese on Thursday!

@jonah-iden jonah-iden merged commit 1a56ba9 into master Jan 22, 2024
14 checks passed
@github-actions github-actions bot added this to the 1.46.0 milestone Jan 22, 2024
@msujew msujew deleted the jiden/fix-resizing-of-dynamic-output-widgets branch January 22, 2024 12:08
@msujew msujew added the notebook issues related to notebooks label Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notebook issues related to notebooks
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Notebook web view iframe is collapsed
5 participants