Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Create interactive matplotlib gallery #10

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

Open
mdboom opened this issue May 23, 2018 · 5 comments
Open

Create interactive matplotlib gallery #10

mdboom opened this issue May 23, 2018 · 5 comments
Labels
enhancement New feature or request

Comments

@mdboom
Copy link
Contributor

mdboom commented May 23, 2018

It should be possible to use this thing to put together an interactive matplotlib gallery.

@mdboom mdboom added the enhancement New feature or request label May 23, 2018
@rth
Copy link
Member

rth commented Aug 28, 2018

One possibility could be to integrate with sphinx-gallery (cf this example gallery, for instance). A number of projects are using it and it currently allows to export a Jupyter notebook (or launch it in Binder). Adding another button with the Iodide notebook, might be useful.

Though the issue is that it often in project CIs, so it means that the CI would also have to build the pyodide package for the project in question. If we provide a docker image with pyodide, that might simplify things, but I still wonder if this is the right use case...

@mdboom
Copy link
Contributor Author

mdboom commented Aug 28, 2018

There is some work afoot to make the Jupyter / Binder buttons configurable, so adding pyodide support would be as simple as adding an option to the sphinx conf.py

I don't think there would need to be a docker image -- it could just link to the pyodide served at https://iodide.io/pyodide-demo. At worst, we'd just need to provide a directory of built files if someone wanted to serve it locally, since there is no server-side component.

@madhur-tandon
Copy link
Member

@mdboom @rth Can I be assigned this perhaps? Moreover, Can I get some details on what is to be done exactly along with some starter tips as well? Lastly, the above discussion refers to a docker image, is it the same one that we use by running ./run_docker ?

@mdboom
Copy link
Contributor Author

mdboom commented Jan 9, 2019

I don't think the docker approach is necessary -- we just need to serve a prebuilt pyodide somewhere (which we already do).

This probably will require coordination with the sphinx-gallery and matplotlib projects. The sphinx-gallery would need to be updated to provide "run in pyodide" as one of the options for the bottom of each example page (or a generic way to add additional links there). For an example, look at the bottom of this page. There are two buttons there generated by sphinx-gallery -- we want to add a third.

Then we'd need to coordinate with matplotlib to update to that new version / configuration of sphinx-gallery.

Thanks for offering to take this on, but just a heads up: large parts of this are community cat herding, more than coding... :)

@larsoner
Copy link

larsoner commented Sep 29, 2020

Just saw this issue come up on Gitter ...

The sphinx-gallery would need to be updated to provide "run in pyodide" as one of the options for the bottom of each example page (or a generic way to add additional links there). For an example, look at the bottom of this page. There are two buttons there generated by sphinx-gallery -- we want to add a third.

As a maintainer of sphinx-gallery I'm sure we could figure out an API. We have opt-in support for optional Binder integration, adding another opt-in integration would be fine. To really make it general, we could easily (at our end) add something like:

sphinx_gallery_conf = {
    ...
    'extra_button_rst': None,
}

where you can have None (default) or a callable that takes a few arguments to say what example is being built (the binder code uses the example filename, gallery_conf of sphinx-gallery info, and a related binder_conf), and returns RST to insert to the sphinx-gallery button RST (e.g., via one more format arg). Then all configuration, etc. can be done at the extra-button-implementer's end, knowing that your RST will be inserted in the right place / the same place as the binder RST.

Then we'd need to coordinate with matplotlib to update to that new version / configuration of sphinx-gallery.

FWIW I added animations support to sphinx-gallery and it was fairly easy to then get it added to matplotlib. Adding pyodide seems like a bigger step, though, so someone might want to check to see if matplotlib folks are on board before putting too much work into it.

@rth rth transferred this issue from pyodide/pyodide Sep 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants