-
Notifications
You must be signed in to change notification settings - Fork 226
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
Make image as part of the widget model - alternate implementation #376
Make image as part of the widget model - alternate implementation #376
Conversation
234f484
to
76eabcd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! I this this is better than #369.
Maybe the only eventual improvement (with changes in ipywidgets) would be to de-duplicate the data by being able to pull the image from the png in the mimebundle.
If you think this is done then all good to merge from me
this.send_message('refresh'); | ||
this.send_message('send_image_mode'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this ordering matter? Why is it necessary to change it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't matter, I didn't mean to change it I will revert
Though I believe this doesn't work properly (yet?). It does not work if there is no front-end. For example it doesn't work if you execute the Notebook with nbconvert, or if you generate documentation with jupyter sphinx. |
I would be in favor of #369 actually. Ideally, we would have it as a synced trait, but instead of sending the entire image every single time, we would sync the backend/frontend traits sending only image diffs. This is an optimization that I would like to see being implemented more generally in ipywidgets. For example, when syncing a List trait it would be better to send diffs of this list instead of the entire list. |
I will explore implementing this with special serialization/deserialization. But I am not confident it can work without changing ipywidgets's core. |
That sounds good to me. The big reason I preferred this approach was the effect on performance and not painting ourselves into a corner w.r.t true blitting.
Definitely agree! |
30f7dba
to
52cfd53
Compare
I am not sure we can make it work with the custom serialization... I updated this PR to save the state Python side as well, it should work with nbconvert now. |
I wonder if the toolbar should even be visible |
461a7fd
to
44771c2
Compare
44771c2
to
53db24c
Compare
cc. @ianhi