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

Getting mpld3 plots to play with StaticInteractive widgets #12

Open
ajasja opened this issue Sep 18, 2014 · 4 comments
Open

Getting mpld3 plots to play with StaticInteractive widgets #12

ajasja opened this issue Sep 18, 2014 · 4 comments

Comments

@ajasja
Copy link

ajasja commented Sep 18, 2014

Would it be possible to use StaticInteractive with mpld3 plots?

I have tried several of the most obvious things, none of which work.

Example notebook here.

@jakevdp
Copy link
Owner

jakevdp commented Sep 21, 2014

Probably possible, but I've not had time to invest in it. I think that @danielballan has done something along these lines.

@danielballan
Copy link

Hi, @ajasja. I implemented something like this using IPython's widgets (as opposed to Jake's ipywidgets). The widgets of ipywidgets are static -- every plot for every possible widget setting is precomputed and stored in the notebook. Therefore, ipywidgets work in blog posts and generally in static webpages unconnected to an IPython kernel. IPython's widgets rely on a live IPython kernel; they compute output as needed, and they do not save a static representation of the output. Some static persistence is promised in version 3.0, but (last I heard) IPython may or may not ever include fully interactive widgets without a kernel.

Take a look at #220 for an example of my approach. I haven't made time to revisit it -- I'm trying to defend my thesis in the coming months! -- but I'd be happy to share more of my examples if you are interested.

@danielballan
Copy link

Oops: that is, mpld3/mpld3#220.

@ajasja
Copy link
Author

ajasja commented Sep 22, 2014

@danielballan Yes, I appreciate the difference between the static and (dynamic) IPyhon widgets. This is exactly why I'm asking about the static case. I was hoping there was an easy way to get this working. (I thought it was just a matter of somehow correctly returning the output of mpld3, so it would be captured by the correct <div> tag.)
I coded up some quick and nice UI for examining our multidimensional dataset, but I'm having trouble to send this to my advisor and co workers. (I would have to host an Ipython kernel, with all the sandboxing and security precautions...)
If mpld3 worked with static interactive widgets, this rather large problem goes away.

For now I just changed to matplotlibs default inline rendering (and made the plots a bit larger), which works with static widgets. This is much better than nothing, but having mpld3 with tooltips and zooming would be really impressive. But since I have a thesis to defend as well (in the next 3-6 months) I also can't devote much time to non thesis stuff.

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

No branches or pull requests

3 participants