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

Page refresh for notebook does not work for widgets with buffers #1642

Closed
maartenbreddels opened this issue Aug 16, 2017 · 10 comments · Fixed by #1643
Closed

Page refresh for notebook does not work for widgets with buffers #1642

maartenbreddels opened this issue Aug 16, 2017 · 10 comments · Fixed by #1643
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Milestone

Comments

@maartenbreddels
Copy link
Member

Using latest ipyvolume on pypi:

import ipyvolume as ipv
ipv.examples.klein_bottle()

Refresh, and one of my deserializers is missing a .buffer property.

@jasongrout jasongrout added this to the 7.0 milestone Aug 16, 2017
@jasongrout
Copy link
Member

to install, pip install --pre ipyvolume? Or can you post a simple self-contained example?

@maartenbreddels
Copy link
Member Author

Yes, that should work (not sure if I have time for that soon)

@jasongrout
Copy link
Member

I'm working on a simple example by converting the Image widget to use binary transfer now that we have it. I think it will be good to have at least one controls widget using the binary transfer.

@jasongrout
Copy link
Member

At least one problem is jashkenas/underscore#2692 - since underscore seems to treat all dataviews and array buffers as equal, the appropriate change handlers are not called when a binary attribute is set if it is just a dataview or array buffer.

@maartenbreddels
Copy link
Member Author

What does lodash say?

@jasongrout
Copy link
Member

Looking more into it, it seems that underscore is pretty much abandoned at this point. Lodash 4.17.4 returns the correct result, but it's not clear at all how to change backbone to depend on lodash without actually changing the backbone package to something else.

I think this is another vote for replacing backbone in widgets.

@jasongrout
Copy link
Member

For now, I'm working on a workaround.

@maartenbreddels
Copy link
Member Author

See also my msg #1339 (comment) about _.eq being really slow (comparing each element), so it's slow and/or broken. Would be nice if that can be worked around as well.

@jasongrout
Copy link
Member

ah yes, I thought I remembered seeing another problem with underscore's equality checking. Thanks.

@jasongrout
Copy link
Member

Actually, my workaround is to default to that really slow checking! I'm not sure of another way to work around the deficiency in underscore.

jasongrout added a commit to jasongrout/ipywidgets that referenced this issue Aug 16, 2017
Underscore 1.8.3’s _.eq assumes all DataView and ArrayBuffers are the same, so backbone will not trigger a change event when attributes are set (see jashkenas/underscore#2692). Lodash 4 does distinguish between different dataviews or arraybuffers, but I can’t figure out how to get backbone to depend on lodash instead of underscore, and don’t want to try changing such a fundamental thing this close to a release.

Fixes jupyter-widgets#1642
jasongrout added a commit to jasongrout/ipywidgets that referenced this issue Aug 17, 2017
Underscore 1.8.3’s _.eq assumes all DataView and ArrayBuffers are the same, so backbone will not trigger a change event when attributes are set (see jashkenas/underscore#2692). Lodash 4 does distinguish between different dataviews or arraybuffers, so we'll use the Lodash isEqual.

Fixes jupyter-widgets#1642
@github-actions github-actions bot added the resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Feb 10, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants