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

Support for embedding plotlywidget instances that use numpy arrays #1117

Merged
merged 10 commits into from
Aug 17, 2018

Conversation

jonmmease
Copy link
Contributor

@jonmmease jonmmease commented Aug 17, 2018

See #1116 for background.

With these updates it is now possible to embed FigureWidget instances 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.2 without 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

…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.
@jonmmease
Copy link
Contributor Author

@tarzzz , if I publish this branch as plotlywidget@0.2.2-rc.1 will you be able to test with this version?
Being an rc, you won't get it without specifying the version explicitly, and I'm not sure if you're able to do that.

@tarzzz
Copy link
Contributor

tarzzz commented Aug 17, 2018

@jonmmease I tested 0.2.2-rc.2 with Plotly Cloud and everything looks good.. !!

@jonmmease
Copy link
Contributor Author

Merged in the CircleCI 2.0 integration

@jonmmease jonmmease added this to the v3.2.0 milestone Aug 17, 2018
@jonmmease
Copy link
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 plotlywidget 0.3 (which will include Plotly.js 1.40). But let me know if you have particular time constraints you're working with.

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.

None yet

2 participants