widget-cookiecutter | cookiecutter template for creating a custom Jupyter widget
kandi X-RAY | widget-cookiecutter Summary
kandi X-RAY | widget-cookiecutter Summary
With widget-cookiecutter you can create a custom Jupyter interactive widget project with sensible defaults. widget-cookiecutter helps custom widget authors get started with best practices for the packaging and distribution of a custom Jupyter interactive widget library.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of widget-cookiecutter
widget-cookiecutter Key Features
widget-cookiecutter Examples and Code Snippets
Community Discussions
Trending Discussions on widget-cookiecutter
QUESTION
I want to create an interactive JupyterLab Notebook application, and I need to create a series of custom Widgets. So I started looking into this matter, and the more I look the more confused I become. To make things simple I will ask a bunch of simple questions:
- One of the most common ways to use widgets on Jupyter Notebooks is to use the ipywidgets library. Right?
- Unlike the classic Notebook, the Notebook of JupyterLab cannot render JavaScript directly. As a result, the tutorials about custom widget creation in the ipywidgets docs are impossible to run on JupyterLab. Right?
- If one wants to run JavaScript on the Notebook of JupyterLab she or he will have to do it through an extension. In case of ipywidgets, one will have to install @jupyter-widgets/jupyterlab-manager. Right?
- If you want to write a custom widget using the ipywidgets library, there are two GitHub projects that you could use as a starting point: widget-cookiecutter and widget-ts-cookiecutter. To my understanding, the former is based on JavaScript while the latter on TypeScript. Also, the first appears to be inactive for quite some type, while the second is more active. Is the JupyterWidgets team planning to focus on TypeScript? Which one should I follow?
- The cookiecutter projects do not really have a documentation. I am really confused and struggling to understand their code. Sure, I can copy-paste them and start messing around until I figure out how the whole thing works and what are the "hooks" or "entry points" in the code, but I would really appreciate if someone could give me some additional pointers.
- Is the JupyterWidgets an "official" project of the Jupyter project? Given the very small number of members in the project I wonder how safe is to base my work on ipywidgets. Keep in mind that the "DeclarativeWidgets" project has abandoned long time ago.
- Are there other libraries that implement more widgets than the ones found in ipywidgets and also run on JupyterLab?
- I want to create a Web application for server-side data processing. My initial goal was to create an app/service that does not expect from the user to do any coding, and performs everything through the use of html/JavaScript widgets. That could be implemented using an Angular/React front-end and a Python/Django/Flask back-end. However, later on, I realised that there are cases where the user may want to do some additional custom/arbitrary processing on the server. This is why I considered JupyterLab. I wonder if it would be best and if it is possible to just create, for example, a normal Angular/Python font/back-end, and somehow wrap this up in a JupyterLab extension that will provide a mechanism to access the data from this app/service and bring it to the notebook for further processing.
Thanks in advance
...ANSWER
Answered 2017-Dec-15 at 10:40First of all, remember that JupyterLab is not stable yet and internal API are still changing quite a bit. The biggest part of your frustration is trying to find information about a project that is changing every week (should stabilize early 2018 for reference).
This lead to minimal effort writing documentation and example for users, as anyway the documents will be wrong a week later. So your confusion and lack of activity is normal for now.
Once Lab stabilizes and the IPywidget team start porting everything you should see an improvement.
QUESTION
I am writing a custom Jupyter widget (made from the cookiecutter) that would ideally have some custom javascript but then also make use of existing widgets as well.
I can't find documentation on nesting widgets. How would I make a custom widget that has parts that are custom javascript, as well as using existing widgets?
...ANSWER
Answered 2017-Oct-05 at 19:02Asked too soon. You can use the Box widget (or VBox/HBox). See the example code in the doc string.
Things like,
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install widget-cookiecutter
pip install -e . (installs python package for development, runs npm install and npm run build)
jupyter nbextension install --py --symlink --sys-prefix <python_package_name> (symlinks nbextension/ directory into <jupyter path>/nbextensions/<extension_name>/). Now the notebook has access to the frontend code.
jupyter nbextension enable --py --sys-prefix <python_package_name> (copies <npm_package_name>.json into <environment path>/etc/jupyter/nbconfig/notebook.d/ directory). Now the notebook will load your frontend code on page load.
After making Python code changes, restarting the notebook kernel will be enough to reflect changes
After making JavaScript code changes: cd js yarn run build Refresh browser to reflect changes
To develop this package against JupyterLab, run:.
pip install -e . (installs python package for development, runs yarn install and yarn run build and installs the labextension)
jupyter labextension develop <python_package_name> --overwrite
After making Python code changes, restarting the notebook kernel will be enough to reflect changes
After making JavaScript code changes: cd js yarn run build Refresh browser to reflect changes
When installing published package in non-development mode.
pip install installs python package for access from kernel and copies frontend code files from nbextension/ directory into <jupyter path>/nbextensions/<extension_name>/ and enables by copying <npm_package_name>.json file into <environment path>/etc/jupyter/nbconfig/notebook.d/ directory.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page