-
Notifications
You must be signed in to change notification settings - Fork 946
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
Cookiecutter based tutorial #2731
Comments
cc @ianhi who has been taking some notes on the making of custom widgets: https://github.com/ianhi/custom-ipywidget-howto Maybe we can incorporate some of these notes in the cookiecutter base tutorial? Also cc @martinRenou who has been updating the Jupyter Widgets tutorial lately: https://github.com/jupyter-widgets/tutorial (although the Jupyter Widgets tutorial probably doesn't cover the creation of custom widgets?) |
That's a 👍x9999 for me
Indeed, we simply mention it and give links to the cookiecutters. |
@jtpio related to this I think fixing images in low level widget docs would be helpful: #2908
👍 I've had mild ambitions of adding small examples to that - but making those for a cookiecutter tutorial sounds better. It sounds as though you're imagining a single large narrative style tutorial? Something else to consider (perhaps in addition) is having many small (standalone) examples that demonstrate specific things. For example I felt that by focusing only on messages in https://github.com/ianhi/widget_message_speed I learned a lot about messages. Small examples like that that deal with messages, serialization etc in isolation could also be helpful. |
Yes the idea was to replace the one that we removed in a previous PR :) https://ipywidgets.readthedocs.io/en/stable/examples/Widget%20Custom.html
That sounds like a good idea 👍 Maybe there could be something similar to the JupyterLab extension examples, but focused on custom widgets instead? |
That would be awesome. I have multiple times ended up at the widgets-tutorial thinking that it would be just that.
I don't think there's actually a link to the cookiecutter in the readme - might be nice to add that. Another related thing is that on this page: https://jupyter.org/widgets only the |
In addition to a tutorial I think have an official listing of all the methods availiable to both the |
Good catch 👍 We would need to modify this page to link to the TS cookiecutter: https://github.com/jupyter/jupyter.github.io/blob/master/widgets.html edit: opened jupyter/jupyter.github.io#373
Those could probably be automatically be generated? (api docs / typedoc) |
Would this require the widget docstring comments to be formatted the same way as the backbonejs?
How did you take such a long screenshot???? |
Not sure about the backbonejs methods yet. Maybe there is a way to reuse the same tooling as in JupyterLab to output API docs like this: https://jupyterlab.github.io/jupyterlab/modules/_coreutils_src_index_.html
Using Firefox built-in screenshot tool. It's really useful especially for PRs that update the documentation. |
Opened #2919 to start updating the tutorial. Feedback welcome! |
Thanks @ianhi for the screenshot, It looks like it could indeed already be helpful 👍 |
Just wanted to say as a prospective widget developer, having a basic tutorial would be a huge help. I've been able to get the example JS cookie cutter widget working (ran into issues with the TS cookiecutter tests not working, could open an issue in that repo if it would be helpful), but haven't been able to get much farther so far. I was actually just getting ready to start the custom widget tutorial, and came here after I saw it was removed on latest. Tangentially, I'm working to use a React component in the frontend, and working off of some discussion here: #2207 Is there any interest in what @jasongrout mentioned about have a cookiecutter or tutorial for using React in ipywidgets? |
@elliothershberg I feel your pain. I figured things out primarily by looking at existing widgets. In particular I'd recommend looking at ipycanvas, the notes i've collected https://github.com/ianhi/custom-ipywidget-howto, and the jupyter-widgets gitter https://gitter.im/jupyter-widgets/Lobby Also, per #2908, you should read the notebook source of the low level tutorial https://github.com/jupyter-widgets/ipywidgets/blob/master/docs/source/examples/Widget%20Low%20Level.ipynb
The tests have at various times broken but it should still generated working widgets. One other thing to maybe be aware of is that given that jlab3 is around the corner it may be worth your while to work off the jlab3 branch of the cookiecutter.
See also ianhi/custom-ipywidget-howto#10
I don't think that this is possible in jupyterlab. If you want the python side of your widget to be automatically reloaded every time you run a method then you can use autoreload like so: %load_ext autoreload
%autoreload 2
import my_widget |
No, but the new prebuilt (federated) extension system in JupyterLab 3.0 should hopefully improve the workflow on that level (no need to rebuild JupyterLab entirely, just the widget). |
The previous "Custom Widget" has now been removed from the documentation (see #2677), as it was using patterns specific to the classic notebook.
As mentioned in this comment, we could instead have a tutorial based on the TypeScript tutorial, similar to the Let’s Make an Astronomy Picture of the Day JupyterLab Extension.
The text was updated successfully, but these errors were encountered: