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

Consider .ipynb as save format #1

Open
jeremydouglass opened this issue Aug 23, 2019 · 6 comments
Open

Consider .ipynb as save format #1

jeremydouglass opened this issue Aug 23, 2019 · 6 comments

Comments

@jeremydouglass
Copy link

Very, very cool prototype. I tested it for a bit and really enjoyed it.

One suggestion you may have already thought of: the load / save format might be an .ipynb file -- even though you aren't interested in using the Jupyter interface. My reason for suggesting this is the format then potentially leverages a ton of existing tooling -- everything from GitHub integrated file previews to command line converters.

@jeremydouglass
Copy link
Author

I also took a quick look at thin notebook interfaces such as the nteract desktop app, which comes preconfigured with node.js / ijavascript to see if it could provide a UI interface with all the printing etc., and be customized with p5.js sketch cells. But it isn't a quick win -- nteract isn't a browser or electron app, so it gives "ReferenceError: window is not defined" when you require p5.js.

There is a binder for nteract-on-jupyter that does something similar in the browser, and it can load p5.js, but then you are more or less where you are with Observable -- perhaps too much to strip away as opposed to building something elegant up.

@jtpio
Copy link

jtpio commented Mar 23, 2020

@jeremydouglass it is indeed a very cool prototype!

Being active in the Jupyter community, I decided to implement something similar (keeping a minimal and simple feel) but with a different approach: by reusing existing components from JupyterLab (one of the Jupyter frontends). One advantage is to be able to leverage existing plugins from the growing JupyterLab ecosystem. Also, the .ipynb format comes for free.

The work is currently happening in this repo: https://github.com/jtpio/p5-notebook. And there is a demo with everything running in the browser: https://jtp.io/p5-notebook-demo.

There are of course still a lot of things to implement to make the notebook experience as nice as possible! (some of them are listed in the 1.0 milestone)

The current state should already tick some of the boxes listed in https://github.com/aparrish/nb5js-proof-of-concept#rationale.

cc @aparrish if you have any feedback :)

@jeremydouglass
Copy link
Author

Thanks for sharing that, jtpio -- very exciting!

Is the idea that a p5.js kernel could be added to a standard JupyterLab installation?

Or is your approach focused on creating a lightweight web-hosted frontend, like editor.p5js.org but notebook-y? Or both?

@jeremydouglass
Copy link
Author

Hmm -- just saw your ipyp5 repo as well:

https://github.com/jtpio/ipyp5

...I'm realizing I don't yet understand enough about Jupyter architecture to know the difference between approaches using a Jupter widget vs a Jupter kernel vs whatever it is that Jyve does (run Jupyter on the client?).

@jtpio
Copy link

jtpio commented Mar 23, 2020

Is the idea that a p5.js kernel could be added to a standard JupyterLab installation?

The jyve project does this! https://github.com/deathbeds/jyve

As of today it still targets a previous version of JupyterLab, but it should possible to update it to work with the latest (2.0).

Or is your approach focused on creating a lightweight web-hosted frontend, like editor.p5js.org but notebook-y? Or both?

For the p5 version of the notebook interface the goal would indeed be to keep it lightweight and simple. But technically it should be possible too have one implementation of a kernel running in the browser (like jyve or the one in p5-notebook) and reuse it across frontends.

@jtpio
Copy link

jtpio commented Mar 23, 2020

...I'm realizing I don't yet understand enough about Jupyter architecture to know the difference between approaches using a Jupter widget vs a Jupter kernel vs whatever it is that Jyve does (run Jupyter on the client?).

The p5-notebook does something similar to what jyve does, as it can run everything in the browser.

Jupyter Widgets are built around backend and frontend components. Most widgets out there are ipywidgets, which means that users write code and UI elements in Python, and the interactions get synced to the frontend using the widget protocol over the Jupyter protocol. But this requires a real backend being able to start the Python kernels.
In the case of ipyp5, the idea is to define widgets in Python and let the frontend use p5.js to run the sketches natively in the browser (but this is still an experiment / wip).

A Jupyter Kernel typically runs on the backend side, typically managed by a notebook or Jupyter Server using underlying tools like jupyter_client.
For the p5 notebook and jyve, the idea is to have a kernel that looks and behaves the same as a proper kernel by implementing the Jupyter Protocol: https://jupyter-client.readthedocs.io/en/stable/messaging.html

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

2 participants