{"id":16282143,"url":"https://github.com/ianhi/custom-ipywidget-howto","last_synced_at":"2025-03-20T02:30:24.620Z","repository":{"id":53587727,"uuid":"267743974","full_name":"ianhi/custom-ipywidget-howto","owner":"ianhi","description":"accumulated knowledge on how to make a custom jupyter widget","archived":false,"fork":false,"pushed_at":"2021-03-23T00:44:42.000Z","size":813,"stargazers_count":15,"open_issues_count":16,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-28T22:35:12.506Z","etag":null,"topics":["custom-jupyter-widget","ipywidgets","jupyter-widget","jupyter-widgets"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ianhi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-29T02:13:36.000Z","updated_at":"2024-07-21T21:05:35.000Z","dependencies_parsed_at":"2022-09-13T19:51:45.272Z","dependency_job_id":null,"html_url":"https://github.com/ianhi/custom-ipywidget-howto","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianhi%2Fcustom-ipywidget-howto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianhi%2Fcustom-ipywidget-howto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianhi%2Fcustom-ipywidget-howto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianhi%2Fcustom-ipywidget-howto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ianhi","download_url":"https://codeload.github.com/ianhi/custom-ipywidget-howto/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244039202,"owners_count":20387835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["custom-jupyter-widget","ipywidgets","jupyter-widget","jupyter-widgets"],"created_at":"2024-10-10T19:09:50.495Z","updated_at":"2025-03-20T02:30:24.168Z","avatar_url":"https://github.com/ianhi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Custom Jupyter Widgets by Example\n\n[![Github Actions Status](https://github.com/ianhi/custom-ipywidget-howto/workflows/CI/badge.svg)](https://github.com/ianhi/custom-ipywidget-howto/actions?query=workflow%3ACI)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jupyterlab/extension-examples/master?urlpath=lab)\n\nThe goal of this repository is to show how to develop custom [Jupyter Widgets](https://github.com/ianhi/custom-ipywidget-howto), presented as short tutorial series.\n\nIf you feel something is missing or have an idea for a way to improve this please open an [issue](https://github.com/ianhi/custom-ipywidget-howto/issues/new)\n\n## Getting Started\n\n```bash\n# clone the repository\ngit clone https://github.com/ianhi/custom-ipywidget-howto.git jupyter-widget-examples\n```\n\n## Develop by Examples\n\nStart with the [Hello World](hello-world) and then jump to the topic you are interested in.\n\n- [Hello World](hello-world)\n\n### [Hello World](hello-world)\n\nSet up the development environment and print to the console.\n\nTODO: add screenshot\n\n## Develop and Use the Examples\n\n### Build and Install all the widgets at once\n\n```bash\n# install the dependencies\nyarn\n\n# install the Python packages\nyarn run install-py\n\n# rebuild the packages\nyarn run build-ext\n\n# (optional) link your development version of the extension with JupyterLab\nyarn run install:ext\n```\n\n### Build and Install one Example\n\nGo to the example directory you want to install, e.g. `cd ./hello-world`, and run the following commands:\n\n```bash\n# install the package in development mode\npython -m pip install -e .\n\n# (optional) link your development version of the extension with JupyterLab\nyarn run install:extension\n\n# rebuild the package\nyarn run build\n```\n\n### Change the Sources\n\nIf you want to develop and iterate on the code, you will need to open 2 terminals.\n\nIn terminal 1, go to the extension folder and run the following:\n\n```bash\nyarn watch\n```\n\nThen in terminal 2, start JupyterLab with the watch flag:\n\n```bash\njupyter lab --watch\n```\n\nFrom there, you can change your extension source code, it will be recompiled,\nand you can refresh your browser to see your changes.\n\nWe are using [embedme](https://github.com/zakhenry/embedme) to embed code snippets into the markdown READMEs. If you make changes to the source code, ensure you update the README and run `yarn embedme` from the root of the repository to regenerate the READMEs.\n\n### Add a new example\n\nYou can use the TypeScript cookiecutter to quickly bootstrap a new custom widget example:\n\n```bash\n# install cookiecutter\npip install cookiecutter\n\n# create a new custom widget\ncookiecutter https://github.com/jupyter-widgets/widget-ts-cookiecutter\n```\n\nThen answer the prompts to give a new name to the example.\n\n## Install a Custom Jupyter Widget\n\nOnce your widget is published on [pypi.org](https://pypi.org/) (outside of this scope), you can install it\nwith the following command:\n\n```bash\npip install \u003cpublished_widget\u003e\n```\n\n## Additional resources\n\nTo learn widgets I recommend the following resources outside this:\n\n1. [Low Level Widget Tutorial](https://ipywidgets.readthedocs.io/en/latest/examples/Widget%20Low%20Level.html)\n2. Look at existing widgets. Some widgets good widgets to look at are:\n   - [ipympl](https://github.com/matplotlib/ipympl)\n   - [ipycanvas](https://github.com/martinRenou/ipycanvas)\n   - [ipycytoscape](https://github.com/quantstack/ipycytoscape)\n3. [Jupyter-widgets Gitter](https://gitter.im/jupyter-widgets/Lobby)\n4. [Jupyter-Widgets Discourse](https://discourse.jupyter.org/c/widgets/46)\n\n## About Jupyter Widgets\n\nTODO\n\n## Community Guidelines and Code of Conduct\n\nThis examples repository is a Jupyter project and follows the Jupyter\n[Community Guides and Code of Conduct](https://jupyter.readthedocs.io/en/latest/community/content-community.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianhi%2Fcustom-ipywidget-howto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fianhi%2Fcustom-ipywidget-howto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianhi%2Fcustom-ipywidget-howto/lists"}