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

Add event listener for resize events #3124

Merged
merged 10 commits into from
Jun 30, 2021

Conversation

ibdafna
Copy link
Member

@ibdafna ibdafna commented Feb 17, 2021

This PR adds an event listener so that lumino based widgets rendered in a classic notebook can receive a resize message when a window resize event triggers.

@ibdafna ibdafna requested a review from jasongrout February 17, 2021 03:42
@jasongrout
Copy link
Member

Fixes #2467

packages/base/src/widget.ts Outdated Show resolved Hide resolved
@jasongrout
Copy link
Member

@ibdafna, thanks for looking into this.

I think we should register the handler in the classic notebook widget manager once, then when it is triggered, have the classic notebook manager go through each of the top-level widgets and trigger the lumino event. And probably do the same for the html manager.

The way things are set up right now in this PR, it looks like every widget will register a handler with window (whether it needs to or not).

@ibdafna - I'm happy to connect over video to walk through this if you want.

@ibdafna
Copy link
Member Author

ibdafna commented Feb 18, 2021

@ibdafna, thanks for looking into this.

I think we should register the handler in the classic notebook widget manager once, then when it is triggered, have the classic notebook manager go through each of the top-level widgets and trigger the lumino event. And probably do the same for the html manager.

The way things are set up right now in this PR, it looks like every widget will register a handler with window (whether it needs to or not).

@ibdafna - I'm happy to connect over video to walk through this if you want.

Thank you - yes, I'll reach out!

@ibdafna ibdafna force-pushed the classic_nb_resize branch 2 times, most recently from cfe0537 to 967beac Compare February 19, 2021 23:36
Copy link
Member

@jasongrout jasongrout left a comment

Choose a reason for hiding this comment

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

Thanks! I found a few things while testing, noted below.

widgetsnbextension/src/extension.js Outdated Show resolved Hide resolved
packages/base/src/widget.ts Outdated Show resolved Hide resolved
packages/html-manager/src/htmlmanager.ts Outdated Show resolved Hide resolved
@jasongrout jasongrout self-assigned this Jun 1, 2021
@jasongrout
Copy link
Member

FYI, I rebased on master

@jasongrout
Copy link
Member

@ibdafna - I rebased and fixed a few issues with the examples, and checked manually that the resize event is now happening for the classic notebook and the html manager. Thanks again!

abdelq added a commit to abdelq/plotly.py that referenced this pull request Oct 20, 2022
abdelq added a commit to abdelq/plotly.py that referenced this pull request Oct 30, 2022
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

Successfully merging this pull request may close these issues.

3 participants