Skip to content

Matplotlib IPython Widget #4582

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

Closed
blink1073 opened this issue Jul 4, 2015 · 10 comments
Closed

Matplotlib IPython Widget #4582

blink1073 opened this issue Jul 4, 2015 · 10 comments

Comments

@blink1073
Copy link
Member

I created a stub of a demo for a matplotlib interactive widget targeting IPython 3.2, for discussion.

https://gist.github.com/blink1073/0421d774677f8ffb98fe
http://nbviewer.ipython.org/gist/blink1073/0421d774677f8ffb98fe

@blink1073
Copy link
Member Author

cc @pelson

@blink1073
Copy link
Member Author

Here's what it comes down to: we create a random div here.
If I instead force it to use the div created by the ipywidget, we get the initial draw, but then find_output_cell fails.

I see two options:

  1. Modify FigureManagerNbAgg to accept an optional uuid and add some hackery to find_output_cell to handle the widget case.
  2. Make the notebook backend always use a widget. We can still export a raw static display. See the QGrid widget I created for an example.

@tacaswell
Copy link
Member

So long as on save you still get a static png I am in favor of option 2.

The future work on figure serialization + the future work on persistent widgets has a very nice synergy.

@pelson
Copy link
Member

pelson commented Sep 3, 2015

I'm in favour of option 2 too if we can pull it off. Is there anything I can help with, or have you got everything you need @blink1073?

@blink1073
Copy link
Member Author

@pelson, all I need is another 6 hours a day 😄

@pelson
Copy link
Member

pelson commented Sep 3, 2015

I know that feeling 😄

@ellisonbg
Copy link

I also think the notebook backend should always use a widget.

@fariza
Copy link
Member

fariza commented Sep 22, 2015

@blink1073 did you see structure of ToolManager and the interaction with Tools (the result of MEP22)
Also, with MEP27 @OceanWolf is introducing a new architecture of FigureManager, Window, layout...
I say this because to finalize MEP22 and MEP27 we are going to be porting all the backends, and with this and all new development (backend related) it would be easier if it's compatible with the new structure of things.

@blink1073
Copy link
Member Author

I was only planning to attack the "which websocket" and "which div" part of the equation, at least to start.

@OceanWolf
Copy link
Member

Not sure if that will overlap, I haven't seen much of the code of NbAgg yet, only WebAgg which I rewrite a large part of including the websocket and div part... I did most of it, but it annoyed the heck out of me (having spent about 40 hours on it, where as the other backends only took around 4 or so), then it went on ice to concentrate on the main branch (GTK3) of MEP27. Imagine then I will do the easy TkAgg before resuming WebAgg and fix up NbAgg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants