Support for embedding plotlywidget instances that use numpy arrays#1117
Merged
Support for embedding plotlywidget instances that use numpy arrays#1117
Conversation
…tate. For some reason, this required renaming 'buffer' in the array representation object. Perhaps a conflict with naming conventions in ipywidgets. So the buffers are now stored in property named `value`
- Render initial empty figure on 'before-attach' event. This keeps the figure view from collapsing when opening a classic notebook that was saved with embedded widget state - Autoresize width even if height has been explicitly set - Autoresize in the classic notebook by responding to window resize events.
If the new plotlywidget can work with current version of plotly.py then we can put out a patch release of the widget only.
The buffer is named `buffer` when sent from plotly.py<=3.1.1, but it is named `value` when restoring from saved widget state and when receiving updates from plotly.py>=3.2.
finished rendering.
Contributor
Author
|
@tarzzz , if I publish this branch as |
Closed
Contributor
|
@jonmmease I tested |
Contributor
Author
|
Merged in the CircleCI 2.0 integration |
Contributor
Author
|
@tarzzz Great! I'm going to merge this. My plan is to release this along with plotly.py version 3.2.0 and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #1116 for background.
With these updates it is now possible to embed
FigureWidgetinstances containing numpy arrays in static contexts (e.g. nbviewer, and soon Plotly Cloud).I also took to opportunity to update the auto-resizing logic to:
This change involves no changes to the Python library, so we should be able to release this as
plotlywidget@0.2.2without making a release of plotly.py yet.Also, to help with embedding, this version emits an event named
'plotlywidget-after-render'when the widget rendering process is complete.cc @tarzzz