├── .npmrc ├── packages ├── output │ ├── .gitignore │ ├── src │ │ ├── index.ts │ │ └── output.ts │ ├── tsconfig.json │ └── package.json ├── base │ ├── .gitignore │ ├── .jshintrc │ ├── .npmignore │ ├── tsconfig.json │ ├── test │ │ ├── src │ │ │ └── index.ts │ │ ├── tsconfig.json │ │ ├── karma.conf.js │ │ ├── webpack.conf.js │ │ ├── karma-cov.conf.js │ │ └── webpack-cov.conf.js │ ├── src │ │ ├── version.ts │ │ ├── index.ts │ │ └── registry.ts │ └── css │ │ └── index.css ├── html-manager │ ├── .gitignore │ ├── test │ │ ├── src │ │ │ └── index.ts │ │ ├── tsconfig.json │ │ ├── karma.conf.js │ │ └── webpack.conf.js │ ├── tsconfig.json │ ├── css │ │ └── output.css │ ├── src │ │ ├── embed.ts │ │ ├── embed-amd-render.ts │ │ ├── index.ts │ │ └── output_renderers.ts │ ├── amd-public-path.js │ └── scripts │ │ └── concat-amd-build.js ├── base-manager │ ├── .gitignore │ ├── .jshintrc │ ├── .npmignore │ ├── test │ │ ├── src │ │ │ └── index.ts │ │ ├── tsconfig.json │ │ ├── karma.conf.js │ │ ├── karma-cov.conf.js │ │ ├── webpack.conf.js │ │ └── webpack-cov.conf.js │ ├── src │ │ └── index.ts │ └── tsconfig.json ├── controls │ ├── .jshintrc │ ├── .gitignore │ ├── .npmignore │ ├── css │ │ ├── widgets.css │ │ └── nouislider.less │ ├── src │ │ ├── version.ts │ │ ├── index.ts │ │ ├── utils.ts │ │ ├── widget_core.ts │ │ └── widget_audio.ts │ ├── test │ │ ├── tsconfig.json │ │ ├── karma.conf.js │ │ ├── src │ │ │ └── index.ts │ │ ├── karma-cov.conf.js │ │ ├── webpack.conf.js │ │ └── webpack-cov.conf.js │ ├── tsconfig.json │ └── README.md └── schema │ ├── README.md │ ├── index.js │ ├── v2 │ └── view.schema.json │ ├── package.json │ └── v1 │ ├── view.schema.json │ └── state.schema.json ├── .prettierrc ├── python ├── ipywidgets │ ├── ipywidgets │ │ ├── tests │ │ │ └── __init__.py │ │ ├── widgets │ │ │ ├── tests │ │ │ │ ├── __init__.py │ │ │ │ ├── data │ │ │ │ │ └── jupyter-logo-transparent.png │ │ │ │ ├── test_widget_button.py │ │ │ │ ├── test_widget_float.py │ │ │ │ ├── test_docutils.py │ │ │ │ ├── test_send_state.py │ │ │ │ ├── test_link.py │ │ │ │ ├── test_widget_box.py │ │ │ │ ├── test_widget_string.py │ │ │ │ └── test_datetime_serializers.py │ │ │ ├── widget_style.py │ │ │ ├── widget_core.py │ │ │ ├── docutils.py │ │ │ ├── widget_color.py │ │ │ ├── valuewidget.py │ │ │ ├── __init__.py │ │ │ ├── widget_description.py │ │ │ └── widget_controller.py │ │ ├── _version.py │ │ ├── view.schema.json │ │ ├── comm.py │ │ └── __init__.py │ ├── pyproject.toml │ ├── setup.py │ ├── MANIFEST.in │ ├── README.md │ ├── LICENSE │ └── setup.cfg ├── jupyterlab_widgets │ ├── .prettierrc │ ├── .eslintignore │ ├── .prettierignore │ ├── .gitignore │ ├── jupyterlab_widgets │ │ ├── _version.py │ │ ├── .gitignore │ │ └── __init__.py │ ├── install.json │ ├── tsconfig.json │ ├── schema │ │ └── plugin.json │ ├── MANIFEST.in │ ├── .cookiecutter_replay │ ├── src │ │ ├── index.ts │ │ └── semvercache.ts │ ├── .eslintrc.js │ └── pyproject.toml └── widgetsnbextension │ ├── .jshintrc │ ├── widgetsnbextension.json │ ├── MANIFEST.in │ ├── widgetsnbextension │ ├── _version.py │ └── __init__.py │ ├── README.md │ ├── src │ ├── widget_output.css │ └── save_state.js │ ├── amd-public-path.js │ ├── pyproject.toml │ ├── webpack.config.js │ ├── setup.py │ ├── setup.cfg │ ├── package.json │ └── LICENSE ├── examples ├── web3 │ ├── .jshintrc │ ├── .gitignore │ ├── tsconfig.json │ ├── scripts │ │ └── copyfiles.js │ ├── src │ │ ├── widgets.css │ │ ├── manager.ts │ │ └── index.ts │ ├── widget_code.json │ ├── webpack.config.js │ ├── README.md │ ├── index.html │ └── package.json ├── web4 │ ├── index.js │ ├── webpack.config.js │ ├── package.json │ └── README.md ├── web2 │ ├── widget_code.py │ ├── webpack.config.js │ ├── package.json │ ├── index.js │ ├── index.html │ ├── README.md │ └── manager.js ├── web1 │ ├── index.html │ ├── webpack.config.js │ ├── README.md │ ├── test │ │ └── index.js │ ├── package.json │ ├── karma.config.js │ ├── manager.js │ └── index.js └── embed-amd │ └── README.md ├── tests └── jlogo-small.png ├── .vscode └── extensions.json ├── docs ├── source │ ├── interact.gif │ ├── explanation │ │ └── index.md │ ├── examples │ │ ├── images │ │ │ ├── flexbox.png │ │ │ ├── widgets.PNG │ │ │ ├── WidgetArch.png │ │ │ ├── grid-area.png │ │ │ ├── grid-cell.png │ │ │ ├── grid-line.png │ │ │ ├── grid-track.png │ │ │ ├── inputoutput.PNG │ │ │ ├── Big.Buck.Bunny.mp3 │ │ │ ├── Big.Buck.Bunny.mp4 │ │ │ ├── ParallelKernels.png │ │ │ ├── WidgetModelView.png │ │ │ ├── grid-start-end-a.png │ │ │ ├── grid-start-end-b.png │ │ │ ├── grid-start-end-d.png │ │ │ ├── VizInteractCompute.png │ │ │ ├── applayout-weather.png │ │ │ ├── gaussian_with_grid.png │ │ │ ├── MultilanguageKernels.png │ │ │ ├── custom-widget-hello.png │ │ │ ├── custom-widget-result.png │ │ │ ├── grid-justify-self-end.png │ │ │ ├── gaussian_with_grid_tiny.png │ │ │ ├── grid-justify-self-start.png │ │ │ ├── grid-justify-self-center.png │ │ │ ├── grid-justify-self-stretch.png │ │ │ ├── flex-container.svg │ │ │ ├── align-self.svg │ │ │ ├── flex-wrap.svg │ │ │ ├── flex-items.svg │ │ │ ├── flex-grow.svg │ │ │ └── flex-direction1.svg │ │ └── Controller.ipynb │ ├── examples.md │ ├── tutorials │ │ └── index.md │ ├── reference │ │ ├── index.md │ │ └── jupyter-widgets.md │ ├── contributing.md │ ├── _static │ │ └── theme.css │ ├── _templates │ │ ├── sidebar-nav-bs-index.html │ │ └── demo.html │ ├── ipywidgets_docs_utils.py │ └── how-to │ │ └── index.md ├── lite │ ├── jupyter-lite.json │ └── jupyter_lite_config.json ├── requirements.txt ├── Readme.md └── environment.yml ├── lerna.json ├── .lintstagedrc ├── .binder ├── postBuild ├── requirements.txt └── README ├── ui-tests ├── tests │ ├── notebooks │ │ └── WidgetArch.png │ ├── widgets.test.ts-snapshots │ │ ├── widgets-cell-0-linux.png │ │ ├── widgets-cell-1-linux.png │ │ ├── widgets-cell-2-linux.png │ │ ├── widgets-cell-3-linux.png │ │ ├── widgets-cell-4-linux.png │ │ ├── widgets-cell-5-linux.png │ │ ├── widgets-cell-6-linux.png │ │ ├── widgets-cell-7-linux.png │ │ ├── widgets-cell-8-linux.png │ │ ├── widgets-cell-9-linux.png │ │ ├── widgets-cell-10-linux.png │ │ ├── widgets-cell-11-linux.png │ │ ├── widgets-cell-12-linux.png │ │ ├── widgets-cell-13-linux.png │ │ ├── widgets-cell-14-linux.png │ │ ├── widgets-cell-15-linux.png │ │ ├── widgets-cell-16-linux.png │ │ ├── widgets-cell-17-linux.png │ │ ├── widgets-cell-18-linux.png │ │ ├── widgets-cell-19-linux.png │ │ ├── widgets-cell-20-linux.png │ │ ├── widgets-cell-21-linux.png │ │ ├── widgets-cell-22-linux.png │ │ ├── widgets-cell-23-linux.png │ │ ├── widgets-cell-24-linux.png │ │ ├── widgets-cell-25-linux.png │ │ ├── widgets-cell-26-linux.png │ │ ├── widgets-cell-27-linux.png │ │ ├── widgets-cell-28-linux.png │ │ ├── widgets-cell-29-linux.png │ │ ├── widgets-cell-30-linux.png │ │ ├── widgets-cell-31-linux.png │ │ ├── widgets-cell-32-linux.png │ │ ├── widgets-cell-33-linux.png │ │ ├── widgets-cell-34-linux.png │ │ ├── widgets-cell-35-linux.png │ │ ├── widgets-cell-36-linux.png │ │ ├── widgets-cell-37-linux.png │ │ ├── widgets-cell-38-linux.png │ │ ├── widgets-cell-39-linux.png │ │ ├── widgets-cell-40-linux.png │ │ ├── widgets-cell-41-linux.png │ │ ├── widgets-cell-42-linux.png │ │ ├── widgets-cell-43-linux.png │ │ └── widgets-cell-44-linux.png │ └── widgets.test.ts ├── jupyter_server_config.py ├── playwright.config.js └── package.json ├── CODE_OF_CONDUCT.md ├── scripts ├── hashes ├── hashes_fedora ├── release_template.txt └── strip_examples.py ├── .readthedocs.yaml ├── .github ├── workflows │ ├── lock.yml │ ├── lint.yml │ ├── answered.yml │ ├── devinstall.yml │ ├── binder-on-pr.yml │ └── build.yml ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── custom_widget_issue.md │ ├── documentation.md │ ├── feature_request.md │ └── bug_report.md └── dependabot.yml ├── typedoc.json ├── tsconfigbase.json ├── tsconfig.typedoc.json ├── .gitignore ├── .yarnrc.yml ├── .eslintrc.json ├── CONTRIBUTING.md ├── LICENSE └── dev-install.sh /.npmrc: -------------------------------------------------------------------------------- 1 | engine-strict = true 2 | -------------------------------------------------------------------------------- /packages/output/.gitignore: -------------------------------------------------------------------------------- 1 | lib/ -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } -------------------------------------------------------------------------------- /python/ipywidgets/ipywidgets/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/base/.gitignore: -------------------------------------------------------------------------------- 1 | lib/ 2 | test/coverage/ 3 | -------------------------------------------------------------------------------- /packages/html-manager/.gitignore: -------------------------------------------------------------------------------- 1 | lib/ 2 | dist/ 3 | -------------------------------------------------------------------------------- /examples/web3/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "esnext": true 3 | } 4 | -------------------------------------------------------------------------------- /packages/output/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './output'; 2 | -------------------------------------------------------------------------------- /python/ipywidgets/ipywidgets/widgets/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/web3/.gitignore: -------------------------------------------------------------------------------- 1 | lib/ 2 | built/ 3 | node_modules/ 4 | -------------------------------------------------------------------------------- /packages/base-manager/.gitignore: -------------------------------------------------------------------------------- 1 | lib/ 2 | test/coverage/ 3 | -------------------------------------------------------------------------------- /examples/web4/index.js: -------------------------------------------------------------------------------- 1 | require('@jupyter-widgets/html-manager/lib/embed'); 2 | -------------------------------------------------------------------------------- /python/jupyterlab_widgets/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /packages/base/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "esnext": true, 3 | "expr": true, 4 | "node": true 5 | } 6 | -------------------------------------------------------------------------------- /python/jupyterlab_widgets/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | coverage 4 | **/*.d.ts 5 | tests 6 | -------------------------------------------------------------------------------- /packages/controls/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "esnext": true, 3 | "expr": true, 4 | "node": true 5 | } 6 | -------------------------------------------------------------------------------- /tests/jlogo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/tests/jlogo-small.png -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"] 3 | } 4 | -------------------------------------------------------------------------------- /docs/source/interact.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/interact.gif -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "npmClient": "yarn", 3 | "useWorkspaces": true, 4 | "version": "independent" 5 | } 6 | -------------------------------------------------------------------------------- /packages/base-manager/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "esnext": true, 3 | "expr": true, 4 | "node": true 5 | } 6 | -------------------------------------------------------------------------------- /python/jupyterlab_widgets/.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | **/node_modules 3 | **/lib 4 | **/package.json 5 | -------------------------------------------------------------------------------- /packages/controls/.gitignore: -------------------------------------------------------------------------------- 1 | css/widgets.built.css 2 | lib-embed/ 3 | docs-embed/ 4 | dist/ 5 | test/coverage/ 6 | -------------------------------------------------------------------------------- /python/widgetsnbextension/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "esnext": true, 3 | "expr": true, 4 | "node": true 5 | } 6 | -------------------------------------------------------------------------------- /.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "**/*{.ts,.tsx,.js,.jsx,.css,.json}": [ 3 | "prettier --write", 4 | "git add" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /.binder/postBuild: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | npm install -g yarn 6 | yarn set version stable 7 | 8 | ./dev-install.sh 9 | -------------------------------------------------------------------------------- /docs/source/explanation/index.md: -------------------------------------------------------------------------------- 1 | # Explanation 2 | 3 | ```{toctree} 4 | :maxdepth: 1 5 | ../examples/Widget Low Level 6 | ``` 7 | -------------------------------------------------------------------------------- /packages/base/.npmignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | test/ 4 | .jshintrc 5 | karma.conf.js 6 | build_css.js 7 | examples/ 8 | -------------------------------------------------------------------------------- /packages/controls/.npmignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | test/ 4 | .jshintrc 5 | karma.conf.js 6 | build_css.js 7 | examples/ 8 | -------------------------------------------------------------------------------- /packages/base-manager/.npmignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | test/ 4 | .jshintrc 5 | karma.conf.js 6 | build_css.js 7 | examples/ 8 | -------------------------------------------------------------------------------- /docs/source/examples/images/flexbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/flexbox.png -------------------------------------------------------------------------------- /docs/source/examples/images/widgets.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/widgets.PNG -------------------------------------------------------------------------------- /python/widgetsnbextension/widgetsnbextension.json: -------------------------------------------------------------------------------- 1 | { 2 | "load_extensions": { 3 | "jupyter-js-widgets/extension": true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ui-tests/tests/notebooks/WidgetArch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/notebooks/WidgetArch.png -------------------------------------------------------------------------------- /docs/source/examples/images/WidgetArch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/WidgetArch.png -------------------------------------------------------------------------------- /docs/source/examples/images/grid-area.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/grid-area.png -------------------------------------------------------------------------------- /docs/source/examples/images/grid-cell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/grid-cell.png -------------------------------------------------------------------------------- /docs/source/examples/images/grid-line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/grid-line.png -------------------------------------------------------------------------------- /docs/source/examples/images/grid-track.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/grid-track.png -------------------------------------------------------------------------------- /docs/source/examples/images/inputoutput.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/inputoutput.PNG -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | Please refer to [Project Jupyter's Code of Conduct](https://github.com/jupyter/governance/blob/master/conduct/code_of_conduct.md). 2 | -------------------------------------------------------------------------------- /docs/source/examples/images/Big.Buck.Bunny.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/Big.Buck.Bunny.mp3 -------------------------------------------------------------------------------- /docs/source/examples/images/Big.Buck.Bunny.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/Big.Buck.Bunny.mp4 -------------------------------------------------------------------------------- /docs/source/examples/images/ParallelKernels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/ParallelKernels.png -------------------------------------------------------------------------------- /docs/source/examples/images/WidgetModelView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/WidgetModelView.png -------------------------------------------------------------------------------- /docs/source/examples/images/grid-start-end-a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/grid-start-end-a.png -------------------------------------------------------------------------------- /docs/source/examples/images/grid-start-end-b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/grid-start-end-b.png -------------------------------------------------------------------------------- /docs/source/examples/images/grid-start-end-d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/grid-start-end-d.png -------------------------------------------------------------------------------- /docs/source/examples/images/VizInteractCompute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/VizInteractCompute.png -------------------------------------------------------------------------------- /docs/source/examples/images/applayout-weather.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/applayout-weather.png -------------------------------------------------------------------------------- /docs/source/examples/images/gaussian_with_grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/gaussian_with_grid.png -------------------------------------------------------------------------------- /docs/source/examples/images/MultilanguageKernels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/MultilanguageKernels.png -------------------------------------------------------------------------------- /docs/source/examples/images/custom-widget-hello.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/custom-widget-hello.png -------------------------------------------------------------------------------- /docs/source/examples/images/custom-widget-result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/custom-widget-result.png -------------------------------------------------------------------------------- /docs/source/examples/images/grid-justify-self-end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/grid-justify-self-end.png -------------------------------------------------------------------------------- /docs/source/examples/images/gaussian_with_grid_tiny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/gaussian_with_grid_tiny.png -------------------------------------------------------------------------------- /docs/source/examples/images/grid-justify-self-start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/grid-justify-self-start.png -------------------------------------------------------------------------------- /python/jupyterlab_widgets/.gitignore: -------------------------------------------------------------------------------- 1 | *.bundle.* 2 | lib/ 3 | node_modules/ 4 | *.egg-info/ 5 | .ipynb_checkpoints 6 | *.tsbuildinfo 7 | jupyterlab_widgets/labextension 8 | -------------------------------------------------------------------------------- /docs/source/examples/images/grid-justify-self-center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/grid-justify-self-center.png -------------------------------------------------------------------------------- /docs/source/examples/images/grid-justify-self-stretch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/docs/source/examples/images/grid-justify-self-stretch.png -------------------------------------------------------------------------------- /packages/html-manager/test/src/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | import './output_test'; 5 | -------------------------------------------------------------------------------- /packages/base-manager/test/src/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | import './manager_test'; 5 | -------------------------------------------------------------------------------- /docs/lite/jupyter-lite.json: -------------------------------------------------------------------------------- 1 | { 2 | "jupyter-lite-schema-version": 0, 3 | "jupyter-config-data": { 4 | "disabledExtensions": ["@jupyterlite/javascript-kernel-extension"] 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/web3/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/*"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/base/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/*"] 8 | } 9 | -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-0-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-0-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-1-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-1-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-2-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-2-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-3-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-3-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-4-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-4-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-5-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-5-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-6-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-6-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-7-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-7-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-8-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-8-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-9-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-9-linux.png -------------------------------------------------------------------------------- /python/jupyterlab_widgets/jupyterlab_widgets/_version.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Jupyter Development Team. 2 | # Distributed under the terms of the Modified BSD License. 3 | 4 | __version__ = '3.0.16' 5 | -------------------------------------------------------------------------------- /python/widgetsnbextension/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE 2 | graft widgetsnbextension/static 3 | graft src 4 | include package.json 5 | include webpack.config.js 6 | include widgetsnbextension.json 7 | -------------------------------------------------------------------------------- /python/widgetsnbextension/widgetsnbextension/_version.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Jupyter Development Team. 2 | # Distributed under the terms of the Modified BSD License. 3 | 4 | __version__ = '4.0.15' 5 | -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-10-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-10-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-11-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-11-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-12-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-12-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-13-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-13-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-14-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-14-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-15-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-15-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-16-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-16-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-17-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-17-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-18-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-18-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-19-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-19-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-20-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-20-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-21-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-21-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-22-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-22-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-23-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-23-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-24-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-24-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-25-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-25-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-26-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-26-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-27-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-27-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-28-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-28-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-29-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-29-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-30-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-30-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-31-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-31-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-32-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-32-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-33-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-33-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-34-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-34-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-35-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-35-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-36-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-36-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-37-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-37-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-38-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-38-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-39-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-39-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-40-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-40-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-41-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-41-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-42-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-42-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-43-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-43-linux.png -------------------------------------------------------------------------------- /ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-44-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/ui-tests/tests/widgets.test.ts-snapshots/widgets-cell-44-linux.png -------------------------------------------------------------------------------- /packages/base/test/src/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | import './widget_test'; 5 | import './utils_test'; 6 | -------------------------------------------------------------------------------- /packages/base-manager/src/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | export * from './manager-base'; 5 | export * from './utils'; 6 | -------------------------------------------------------------------------------- /python/ipywidgets/ipywidgets/widgets/tests/data/jupyter-logo-transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/HEAD/python/ipywidgets/ipywidgets/widgets/tests/data/jupyter-logo-transparent.png -------------------------------------------------------------------------------- /packages/controls/css/widgets.css: -------------------------------------------------------------------------------- 1 | /* Copyright (c) Jupyter Development Team. 2 | * Distributed under the terms of the Modified BSD License. 3 | */ 4 | 5 | @import './labvariables.css'; 6 | @import './widgets-base.css'; 7 | -------------------------------------------------------------------------------- /ui-tests/jupyter_server_config.py: -------------------------------------------------------------------------------- 1 | from jupyterlab.galata import configure_jupyter_server 2 | 3 | configure_jupyter_server(c) 4 | 5 | # Uncomment to set server log level to debug level 6 | # c.ServerApp.log_level = "DEBUG" 7 | -------------------------------------------------------------------------------- /.binder/requirements.txt: -------------------------------------------------------------------------------- 1 | bqplot 2 | ipyleaflet 3 | jupyterlab-myst 4 | jupyterlab==4.0.7 5 | matplotlib 6 | nbclassic 7 | networkx 8 | notebook==7.0.5 9 | numpy 10 | pandas 11 | scikit-image 12 | scikit-learn 13 | sympy 14 | -------------------------------------------------------------------------------- /packages/schema/README.md: -------------------------------------------------------------------------------- 1 | # Jupyter Widgets Schema 2 | 3 | JSON schema for the json serialization of Jupyter Interactive Widgets. 4 | 5 | ## Package Install 6 | 7 | **Prerequisites** 8 | 9 | - [node](http://nodejs.org/) 10 | -------------------------------------------------------------------------------- /examples/web3/scripts/copyfiles.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | var fs = require('fs-extra'); 5 | fs.copySync('src/widgets.css', 'lib/widgets.css'); 6 | -------------------------------------------------------------------------------- /scripts/hashes: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | for f in $@ 3 | do 4 | echo "$f" 5 | echo md5: `md5 -q "$f"` 6 | echo sha1: `shasum -a 1 "$f" | awk '{print $1}'` 7 | echo sha256: `shasum -a 256 "$f" | awk '{print $1}'` 8 | echo 9 | done 10 | -------------------------------------------------------------------------------- /examples/web2/widget_code.py: -------------------------------------------------------------------------------- 1 | from ipywidgets import VBox, jsdlink, IntSlider, Button 2 | 3 | s1, s2 = IntSlider(max=200, value=100), IntSlider(value=40) 4 | b = Button(icon='legal') 5 | jsdlink((s1, 'value'), (s2, 'max')) 6 | VBox([s1, s2, b]) 7 | -------------------------------------------------------------------------------- /packages/base/src/version.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | export const JUPYTER_WIDGETS_VERSION = '2.0.0'; 5 | 6 | export const PROTOCOL_VERSION = '2.1.0'; 7 | -------------------------------------------------------------------------------- /python/jupyterlab_widgets/install.json: -------------------------------------------------------------------------------- 1 | { 2 | "packageManager": "python", 3 | "packageName": "jupyterlab_widgets", 4 | "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_widgets" 5 | } 6 | -------------------------------------------------------------------------------- /python/jupyterlab_widgets/jupyterlab_widgets/.gitignore: -------------------------------------------------------------------------------- 1 | *.suo 2 | *.user 3 | .DS_Store 4 | node_modules 5 | typings/tsd.d.ts 6 | npm-debug.log 7 | test/build 8 | test/coverage 9 | lib 10 | dist 11 | build 12 | docs 13 | example/*.js 14 | static/ 15 | -------------------------------------------------------------------------------- /scripts/hashes_fedora: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | for f in $@ 3 | do 4 | echo "$f" 5 | echo md5: `md5sum "$f" | awk '{print $1}'` 6 | echo sha1: `sha1sum "$f" | awk '{print $1}'` 7 | echo sha256: `sha256sum "$f" | awk '{print $1}'` 8 | echo 9 | done 10 | -------------------------------------------------------------------------------- /python/ipywidgets/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | # These are the assumed default build requirements from pip: 3 | # https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support 4 | requires = ["setuptools>=40.8.0", "wheel"] 5 | build-backend = "setuptools.build_meta" -------------------------------------------------------------------------------- /packages/base-manager/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/*"], 8 | "references": [ 9 | { 10 | "path": "../base" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /packages/output/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"], 8 | "references": [ 9 | { 10 | "path": "../base" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /packages/schema/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | v1: { 3 | state: require('./v1/state.schema.json'), 4 | view: require('./v1/view.schema.json'), 5 | }, 6 | v2: { 7 | state: require('./v2/state.schema.json'), 8 | view: require('./v2/view.schema.json'), 9 | }, 10 | }; 11 | -------------------------------------------------------------------------------- /python/ipywidgets/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) IPython Development Team. 4 | # Copyright (c) Jupyter Development Team. 5 | # Distributed under the terms of the Modified BSD License. 6 | 7 | from setuptools import setup 8 | if __name__ == '__main__': 9 | setup() 10 | -------------------------------------------------------------------------------- /packages/base/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfigbase", 3 | "compilerOptions": { 4 | "types": ["mocha"], 5 | "outDir": "build", 6 | "rootDir": "src" 7 | }, 8 | "include": ["src/*"], 9 | "references": [ 10 | { 11 | "path": ".." 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /docs/source/examples.md: -------------------------------------------------------------------------------- 1 | # Examples 2 | 3 | There is a subdirectory called examples in the GitHub repo for `ipywidgets`. In the samples subdirectory are two directories, notebooks and development. 4 | 5 | 7 | -------------------------------------------------------------------------------- /packages/controls/src/version.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | /** 5 | * The version of the Jupyter controls widget attribute spec that this package 6 | * implements. 7 | */ 8 | export const JUPYTER_CONTROLS_VERSION = '2.0.0'; 9 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | build: 4 | os: 'ubuntu-22.04' 5 | tools: 6 | python: 'mambaforge-4.10' 7 | python: 8 | install: 9 | - method: pip 10 | path: ./python/ipywidgets 11 | conda: 12 | environment: docs/environment.yml 13 | sphinx: 14 | configuration: docs/source/conf.py 15 | -------------------------------------------------------------------------------- /docs/source/tutorials/index.md: -------------------------------------------------------------------------------- 1 | # Tutorials 2 | 3 | ```{toctree} 4 | :caption: For Custom Widget Authors 5 | :maxdepth: 1 6 | ../examples/Widget Custom 7 | ``` 8 | 9 | ```{hint} 10 | For a more in-depth tutorial, see the 11 | [dedicated GitHub repository](https://github.com/jupyter-widgets/tutorial). 12 | ``` 13 | -------------------------------------------------------------------------------- /packages/base-manager/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfigbase", 3 | "compilerOptions": { 4 | "types": ["mocha"], 5 | "outDir": "build", 6 | "rootDir": "src" 7 | }, 8 | "include": ["src/*"], 9 | "references": [ 10 | { 11 | "path": ".." 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /packages/controls/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfigbase", 3 | "compilerOptions": { 4 | "types": ["mocha"], 5 | "outDir": "build", 6 | "rootDir": "src" 7 | }, 8 | "include": ["src/**/*"], 9 | "references": [ 10 | { 11 | "path": ".." 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /packages/html-manager/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfigbase", 3 | "compilerOptions": { 4 | "types": ["mocha"], 5 | "outDir": "build", 6 | "rootDir": "src" 7 | }, 8 | "include": ["src/*"], 9 | "references": [ 10 | { 11 | "path": ".." 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /packages/controls/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src", 6 | "types": ["mathjax", "node"] 7 | }, 8 | "include": ["src/**/*"], 9 | "references": [ 10 | { 11 | "path": "../base" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /docs/source/reference/index.md: -------------------------------------------------------------------------------- 1 | # Reference 2 | 3 | ```{toctree} 4 | :caption: History 5 | :maxdepth: 1 6 | ../changelog 7 | ``` 8 | 9 | ```{toctree} 10 | :caption: Python API 11 | :maxdepth: 1 12 | ipywidgets 13 | ../genindex 14 | ../modindex 15 | ``` 16 | 17 | ```{toctree} 18 | :caption: JS API 19 | :maxdepth: 1 20 | jupyter-widgets 21 | ``` 22 | -------------------------------------------------------------------------------- /ui-tests/playwright.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('@jupyterlab/galata/lib/playwright-config'); 2 | 3 | module.exports = { 4 | ...baseConfig, 5 | timeout: 240000, 6 | webServer: { 7 | command: 'jlpm start', 8 | url: 'http://localhost:8888/lab', 9 | timeout: 120 * 1000, 10 | reuseExistingServer: !process.env.CI, 11 | }, 12 | retries: 1, 13 | }; 14 | -------------------------------------------------------------------------------- /packages/controls/test/karma.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = function (config) { 2 | config.set({ 3 | basePath: '..', 4 | frameworks: ['mocha'], 5 | reporters: ['mocha'], 6 | files: ['test/build/bundle.js'], 7 | port: 9876, 8 | colors: true, 9 | singleRun: true, 10 | logLevel: config.LOG_INFO, 11 | browserNoActivityTimeout: 30000, 12 | }); 13 | }; 14 | -------------------------------------------------------------------------------- /packages/base-manager/test/karma.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = function (config) { 2 | config.set({ 3 | basePath: '..', 4 | frameworks: ['mocha'], 5 | reporters: ['mocha'], 6 | files: ['test/build/bundle.js'], 7 | port: 9876, 8 | colors: true, 9 | singleRun: true, 10 | logLevel: config.LOG_INFO, 11 | browserNoActivityTimeout: 30000, 12 | }); 13 | }; 14 | -------------------------------------------------------------------------------- /packages/html-manager/test/karma.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = function (config) { 2 | config.set({ 3 | basePath: '..', 4 | frameworks: ['mocha'], 5 | reporters: ['mocha'], 6 | files: ['test/build/bundle.js'], 7 | port: 9876, 8 | colors: true, 9 | singleRun: true, 10 | logLevel: config.LOG_INFO, 11 | browserNoActivityTimeout: 30000, 12 | }); 13 | }; 14 | -------------------------------------------------------------------------------- /packages/controls/test/src/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | import './widget_date_test'; 5 | import './widget_datetime_test'; 6 | import './widget_time_test'; 7 | import './widget_selection_test'; 8 | import './widget_string_test'; 9 | import './widget_upload_test'; 10 | import './lumino/currentselection_test'; 11 | -------------------------------------------------------------------------------- /examples/web3/src/widgets.css: -------------------------------------------------------------------------------- 1 | /* Copyright (c) Jupyter Development Team. 2 | * Distributed under the terms of the Modified BSD License. 3 | */ 4 | 5 | /* 6 | * This example shows how to customize the theming and still compile the CSS 7 | * down to something that all browsers support. 8 | */ 9 | @import '@jupyter-widgets/controls/css/widgets.css'; 10 | :root { 11 | --jp-widgets-border-width: 2px; 12 | } 13 | -------------------------------------------------------------------------------- /examples/web1/index.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 |In this widget example, you will see a text box widget and a rendered HTML widget which are linked together. Type into the text box to see the HTML widget automatically updated.
9 |
10 |
11 |
--------------------------------------------------------------------------------
/examples/web1/webpack.config.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 | var webpack = require('webpack');
3 |
4 | module.exports = {
5 | mode: 'development',
6 | devtool: 'source-map',
7 | entry: './index.js',
8 | output: {
9 | filename: 'index.built.js',
10 | path: path.resolve(__dirname, 'built'),
11 | },
12 | module: {
13 | rules: [{ test: /\.css$/i, use: ['style-loader', 'css-loader'] }],
14 | },
15 | };
16 |
--------------------------------------------------------------------------------
/python/jupyterlab_widgets/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfigbase",
3 | "compilerOptions": {
4 | "outDir": "lib",
5 | "rootDir": "src"
6 | },
7 | "include": ["src/**/*"],
8 | "references": [
9 | {
10 | "path": "../../packages/base"
11 | },
12 | {
13 | "path": "../../packages/controls"
14 | },
15 | {
16 | "path": "../../packages/output"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/base/test/karma.conf.js:
--------------------------------------------------------------------------------
1 | module.exports = function (config) {
2 | config.set({
3 | basePath: '..',
4 | frameworks: ['mocha'],
5 | reporters: ['mocha'],
6 | mochaReporter: {
7 | showDiff: true,
8 | },
9 | files: ['test/build/bundle.js'],
10 | port: 9876,
11 | colors: true,
12 | singleRun: true,
13 | logLevel: config.LOG_INFO,
14 | browserNoActivityTimeout: 30000,
15 | });
16 | };
17 |
--------------------------------------------------------------------------------
/packages/html-manager/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfigbase",
3 | "compilerOptions": {
4 | "outDir": "lib",
5 | "rootDir": "src"
6 | },
7 | "include": ["src/*"],
8 | "references": [
9 | {
10 | "path": "../base"
11 | },
12 | {
13 | "path": "../base-manager"
14 | },
15 | {
16 | "path": "../controls"
17 | },
18 | {
19 | "path": "../output"
20 | }
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/packages/base/src/index.ts:
--------------------------------------------------------------------------------
1 | // Copyright (c) Jupyter Development Team.
2 | // Distributed under the terms of the Modified BSD License.
3 |
4 | export * from './widget';
5 | export * from './manager';
6 | export * from './widget_layout';
7 | export * from './widget_style';
8 | export * from './services-shim';
9 | export * from './viewlist';
10 | export * from './version';
11 | export * from './utils';
12 | export * from './registry';
13 | export * from './errorwidget';
14 |
--------------------------------------------------------------------------------
/python/jupyterlab_widgets/schema/plugin.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Jupyter Widgets",
3 | "description": "Jupyter widgets settings.",
4 | "additionalProperties": false,
5 | "properties": {
6 | "saveState": {
7 | "type": "boolean",
8 | "title": "Save Jupyter widget state in notebooks",
9 | "description": "Automatically save Jupyter widget state when a notebook is saved.",
10 | "default": false
11 | }
12 | },
13 | "type": "object"
14 | }
15 |
--------------------------------------------------------------------------------
/python/ipywidgets/ipywidgets/widgets/tests/test_widget_button.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) Jupyter Development Team.
2 | # Distributed under the terms of the Modified BSD License.
3 |
4 | import inspect
5 | import pytest
6 | from ipywidgets import Button
7 |
8 | def test_deprecation_fa_icons():
9 | with pytest.deprecated_call() as record:
10 | Button(icon='fa-home')
11 | assert len(record) == 1
12 | assert record[0].filename == inspect.stack(context=0)[1].filename
13 |
--------------------------------------------------------------------------------
/.github/workflows/lock.yml:
--------------------------------------------------------------------------------
1 | name: 'Lock Closed Threads'
2 |
3 | on:
4 | schedule:
5 | - cron: '0 0 * * *'
6 |
7 | jobs:
8 | lock:
9 | runs-on: ubuntu-latest
10 | steps:
11 | - uses: dessant/lock-threads@v2
12 | with:
13 | github-token: ${{ github.token }}
14 | issue-lock-inactive-days: '90'
15 | issue-lock-labels: 'resolved-locked'
16 | pr-lock-inactive-days: '90'
17 | pr-lock-labels: 'resolved-locked'
18 |
--------------------------------------------------------------------------------
/.binder/README:
--------------------------------------------------------------------------------
1 | This directory holds configuration files for https://mybinder.org/.
2 |
3 | The interactive notebooks can be accessed with this link:
4 | https://mybinder.org/v2/gh/jupyter-widgets/ipywidgets/main?filepath=docs/source/examples
5 |
6 | To check out a different version, just replace `main` with the desired
7 | branch/tag name or commit hash.
8 |
9 | To use JupyterLab, use:
10 | https://mybinder.org/v2/gh/jupyter-widgets/ipywidgets/main?urlpath=lab/tree/docs/source/examples
11 |
--------------------------------------------------------------------------------
/docs/lite/jupyter_lite_config.json:
--------------------------------------------------------------------------------
1 | {
2 | "LiteBuildConfig": {
3 | "extra_ignore_contents": [
4 | "Layout Example\\.ipynb",
5 | "Layout Templates\\.ipynb",
6 | "Variable Inspector\\.ipynb"
7 | ],
8 | "contents": ["../source/examples"]
9 | },
10 | "PipliteAddon": {
11 | "piplite_urls": [
12 | "../../python/ipywidgets/dist",
13 | "../../python/widgetsnbextension/dist",
14 | "../../python/jupyterlab_widgets/dist"
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/docs/source/contributing.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | The ipywidgets package is under the [Jupyter-Widgets](https://github.com/jupyter-widgets) [software subproject](https://jupyter.org/governance/software_subprojects.html).
4 |
5 | We appreciate contributions from the community.
6 |
7 | We follow the [IPython Contributing Guide](https://github.com/ipython/ipython/blob/main/CONTRIBUTING.md)
8 | and [Jupyter Contributing Guides](https://jupyter.readthedocs.io/en/latest/contributor/content-contributor.html).
9 |
--------------------------------------------------------------------------------
/typedoc.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://typedoc.org/schema.json",
3 | "entryPointStrategy": "packages",
4 | "entryPoints": [
5 | "packages/base",
6 | "packages/base-manager",
7 | "packages/controls",
8 | "packages/html-manager",
9 | "packages/output",
10 | "python/jupyterlab_widgets"
11 | ],
12 | "githubPages": false,
13 | "logLevel": "Verbose",
14 | "name": "jupyter-widgets",
15 | "out": "docs/typedoc/typedoc",
16 | "tsconfig": "tsconfig.typedoc.json"
17 | }
18 |
--------------------------------------------------------------------------------
/packages/html-manager/css/output.css:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | | Copyright (c) Jupyter Development Team.
3 | | Distributed under the terms of the Modified BSD License.
4 | |----------------------------------------------------------------------------*/
5 |
6 | /*
14 | `;
17 | }
18 |
--------------------------------------------------------------------------------
/python/ipywidgets/MANIFEST.in:
--------------------------------------------------------------------------------
1 | include LICENSE
2 | include CONTRIBUTING.md
3 | include README.md
4 | include package.json
5 |
6 | # Documentation
7 | graft docs
8 | exclude docs/\#*
9 |
10 | # Tests
11 | graft ipywidgets/tests
12 |
13 | # Static Assets
14 | graft ipywidgets/static
15 |
16 | # Docs subdirs we want to skip
17 | prune docs/build
18 | prune docs/dist
19 |
20 | # Patterns to exclude from any directory
21 | global-exclude *~
22 | global-exclude *.pyc
23 | global-exclude *.pyo
24 | global-exclude .git
25 | global-exclude .ipynb_checkpoints
26 |
27 | # Exclude build scripts
28 | exclude scripts
29 |
--------------------------------------------------------------------------------
/examples/web4/webpack.config.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 | var webpack = require('webpack');
3 |
4 | module.exports = {
5 | mode: 'development',
6 | devtool: 'source-map',
7 | entry: './index.js',
8 | output: {
9 | filename: 'index.built.js',
10 | path: path.resolve(__dirname, 'built'),
11 | },
12 | module: {
13 | rules: [
14 | { test: /\.css$/, use: ['style-loader', 'css-loader'] },
15 | // required to load font-awesome
16 | { test: /\.(woff|woff2|eot|ttf|otf)$/i, type: 'asset/resource' },
17 | { test: /\.svg$/i, type: 'asset' },
18 | ],
19 | },
20 | };
21 |
--------------------------------------------------------------------------------
/python/widgetsnbextension/src/widget_output.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Jupyter Development Team.
3 | * Distributed under the terms of the Modified BSD License.
4 | */
5 |
6 | /* Override the correction for the prompt area in https://github.com/jupyter/notebook/blob/dd41d9fd5c4f698bd7468612d877828a7eeb0e7a/IPython/html/static/notebook/less/outputarea.less#L110 */
7 | .jupyter-widgets-output-area div.output_subarea {
8 | max-width: 100%;
9 | }
10 |
11 | /* Work-around for the bug fixed in https://github.com/jupyter/notebook/pull/2961 */
12 | .jupyter-widgets-output-area > .out_prompt_overlay {
13 | display: none;
14 | }
15 |
--------------------------------------------------------------------------------
/packages/base-manager/test/karma-cov.conf.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 |
3 | module.exports = function (config) {
4 | config.set({
5 | basePath: '..',
6 | browsers: ['Firefox'],
7 | frameworks: ['mocha'],
8 | reporters: ['mocha', 'coverage'],
9 | files: ['test/build/coverage.js'],
10 | coverageReporter: {
11 | reporters: [
12 | { type: 'text' },
13 | { type: 'lcov', dir: 'test/coverage' },
14 | { type: 'html', dir: 'test/coverage' },
15 | ],
16 | },
17 | port: 9876,
18 | colors: true,
19 | singleRun: true,
20 | logLevel: config.LOG_INFO,
21 | });
22 | };
23 |
--------------------------------------------------------------------------------
/packages/controls/test/karma-cov.conf.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 |
3 | module.exports = function (config) {
4 | config.set({
5 | basePath: '..',
6 | browsers: ['Firefox'],
7 | frameworks: ['mocha'],
8 | reporters: ['mocha', 'coverage'],
9 | files: ['test/build/coverage.js'],
10 | coverageReporter: {
11 | reporters: [
12 | { type: 'text' },
13 | { type: 'lcov', dir: 'test/coverage' },
14 | { type: 'html', dir: 'test/coverage' },
15 | ],
16 | },
17 | port: 9876,
18 | colors: true,
19 | singleRun: true,
20 | logLevel: config.LOG_INFO,
21 | });
22 | };
23 |
--------------------------------------------------------------------------------
/examples/web3/widget_code.json:
--------------------------------------------------------------------------------
1 | [
2 | "from ipywidgets import IntSlider, Output, Text, VBox",
3 | "from IPython.display import Image, display",
4 | "",
5 | "s = IntSlider(min=1, max=500, value=200, description='Width')",
6 | "t = Text(description='Area', disabled=True)",
7 | "o = Output()",
8 | "display(VBox([s, t, o]))",
9 | "",
10 | "def update(change=None):",
11 | " width = s.value",
12 | " t.value = str(width ** 2)",
13 | " o.outputs = ()",
14 | " img = Image(url='jupyter-logo.svg', width=width)",
15 | " o.append_display_data(img)",
16 | "",
17 | "s.observe(update, names='value')",
18 | "update()"
19 | ]
20 |
--------------------------------------------------------------------------------
/.github/workflows/lint.yml:
--------------------------------------------------------------------------------
1 | name: Lint
2 |
3 | on: [push, pull_request]
4 |
5 | jobs:
6 | lint:
7 | name: Lint
8 | runs-on: ubuntu-latest
9 |
10 | steps:
11 | - uses: actions/checkout@v4
12 |
13 | - name: Install Python
14 | uses: actions/setup-python@v4
15 | with:
16 | python-version: '3.13'
17 | architecture: 'x64'
18 |
19 | - name: Install dependencies
20 | run: |
21 | python -m pip install jupyterlab
22 |
23 | - name: yarn install, integrity, lint
24 | run: |
25 | jlpm --immutable
26 | jlpm integrity
27 | jlpm lint:check
28 |
--------------------------------------------------------------------------------
/docs/source/_static/theme.css:
--------------------------------------------------------------------------------
1 | /* index */
2 | table.indextable tr.cap {
3 | background-color: var(--pst-color-on-background) !important;
4 | }
5 |
6 | /* demo */
7 | #demo-sidebar {
8 | margin: 0;
9 | }
10 |
11 | #demo-sidebar .demo-app {
12 | display: inline;
13 | display: flex;
14 | flex-direction: row;
15 | align-items: baseline;
16 | flex-wrap: wrap;
17 | margin: 0.75rem 0.25rem 0 0.25rem;
18 | }
19 |
20 | .demo-app > * {
21 | flex: 1 auto;
22 | white-space: nowrap;
23 | }
24 |
25 | #demo-sidebar .admonition-title::after {
26 | display: none;
27 | }
28 |
29 | #demo-sidebar .admonition-title {
30 | padding-left: 0.75rem;
31 | }
32 |
--------------------------------------------------------------------------------
/examples/web2/webpack.config.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 | var webpack = require('webpack');
3 |
4 | module.exports = {
5 | mode: 'development',
6 | devtool: 'source-map',
7 | entry: './index.js',
8 | output: {
9 | filename: 'index.built.js',
10 | path: path.resolve(__dirname, 'built'),
11 | },
12 | module: {
13 | rules: [
14 | { test: /\.css$/i, use: ['style-loader', 'css-loader'] },
15 | { test: /\.py$/i, type: 'asset/source' },
16 | // required to load font-awesome
17 | { test: /\.(woff|woff2|eot|ttf|otf)$/i, type: 'asset/resource' },
18 | { test: /\.svg$/i, type: 'asset' },
19 | ],
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/python/ipywidgets/ipywidgets/widgets/widget_style.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) Jupyter Development Team.
2 | # Distributed under the terms of the Modified BSD License.
3 |
4 | """Contains the Style class"""
5 |
6 | from traitlets import Unicode
7 | from .widget import Widget
8 | from .._version import __jupyter_widgets_base_version__
9 |
10 | class Style(Widget):
11 | """Style specification"""
12 |
13 | _model_name = Unicode('StyleModel').tag(sync=True)
14 | _view_name = Unicode('StyleView').tag(sync=True)
15 | _view_module = Unicode('@jupyter-widgets/base').tag(sync=True)
16 | _view_module_version = Unicode(__jupyter_widgets_base_version__).tag(sync=True)
17 |
--------------------------------------------------------------------------------
/packages/output/src/output.ts:
--------------------------------------------------------------------------------
1 | import { DOMWidgetModel, DOMWidgetView } from '@jupyter-widgets/base';
2 |
3 | export const OUTPUT_WIDGET_VERSION = '1.0.0';
4 |
5 | export class OutputModel extends DOMWidgetModel {
6 | defaults(): Backbone.ObjectHash {
7 | return {
8 | ...super.defaults(),
9 | _model_name: 'OutputModel',
10 | _view_name: 'OutputView',
11 | _model_module: '@jupyter-widgets/output',
12 | _view_module: '@jupyter-widgets/output',
13 | _model_module_version: OUTPUT_WIDGET_VERSION,
14 | _view_module_version: OUTPUT_WIDGET_VERSION,
15 | };
16 | }
17 | }
18 |
19 | export class OutputView extends DOMWidgetView {}
20 |
--------------------------------------------------------------------------------
/packages/base/test/webpack.conf.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 |
3 | module.exports = {
4 | entry: './test/build/index.js',
5 | output: {
6 | path: __dirname + '/build',
7 | filename: 'bundle.js',
8 | },
9 | bail: true,
10 | module: {
11 | rules: [
12 | { test: /\.css$/, use: ['style-loader', 'css-loader'] },
13 | { test: /\.md$/, type: 'asset/source' },
14 | {
15 | test: /\.html$/,
16 | type: 'asset/resource',
17 | generator: { filename: '[name].[ext]' },
18 | },
19 | { test: /\.ipynb$/, type: 'json' },
20 | ],
21 | },
22 | mode: 'development',
23 | resolve: { fallback: { util: false } },
24 | };
25 |
--------------------------------------------------------------------------------
/packages/schema/v2/view.schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/draft-07/schema#",
3 | "description": "Jupyter Interactive Widget View JSON schema.",
4 | "type": "object",
5 | "properties": {
6 | "version_major": {
7 | "description": "Format version (major)",
8 | "type": "number",
9 | "minimum": 2,
10 | "maximum": 2
11 | },
12 | "version_minor": {
13 | "description": "Format version (minor)",
14 | "type": "number"
15 | },
16 | "model_id": {
17 | "description": "Unique identifier of the widget model to be displayed",
18 | "type": "string"
19 | }
20 | },
21 | "required": ["model_id"]
22 | }
23 |
--------------------------------------------------------------------------------
/packages/controls/test/webpack.conf.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 |
3 | module.exports = {
4 | entry: './test/build/index.js',
5 | output: {
6 | path: __dirname + '/build',
7 | filename: 'bundle.js',
8 | },
9 | bail: true,
10 | module: {
11 | rules: [
12 | { test: /\.css$/, use: ['style-loader', 'css-loader'] },
13 | { test: /\.md$/, type: 'asset/source' },
14 | {
15 | test: /\.html$/,
16 | type: 'asset/resource',
17 | generator: { filename: '[name].[ext]' },
18 | },
19 | { test: /\.ipynb$/, type: 'json' },
20 | ],
21 | },
22 | mode: 'development',
23 | resolve: { fallback: { util: false } },
24 | };
25 |
--------------------------------------------------------------------------------
/packages/base-manager/test/webpack.conf.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 |
3 | module.exports = {
4 | entry: './test/build/index.js',
5 | output: {
6 | path: __dirname + '/build',
7 | filename: 'bundle.js',
8 | },
9 | bail: true,
10 | module: {
11 | rules: [
12 | { test: /\.css$/, use: ['style-loader', 'css-loader'] },
13 | { test: /\.md$/, type: 'asset/source' },
14 | {
15 | test: /\.html$/,
16 | type: 'asset/resource',
17 | generator: { filename: '[name].[ext]' },
18 | },
19 | { test: /\.ipynb$/, type: 'json' },
20 | ],
21 | },
22 | mode: 'development',
23 | resolve: { fallback: { util: false } },
24 | };
25 |
--------------------------------------------------------------------------------
/packages/base/test/karma-cov.conf.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 |
3 | module.exports = function (config) {
4 | config.set({
5 | basePath: '..',
6 | browsers: ['Firefox'],
7 | frameworks: ['mocha'],
8 | reporters: ['mocha', 'coverage'],
9 | files: ['test/build/coverage.js'],
10 | coverageReporter: {
11 | reporters: [
12 | { type: 'text' },
13 | { type: 'lcov', dir: 'test/coverage' },
14 | { type: 'html', dir: 'test/coverage' },
15 | ],
16 | },
17 | mochaReporter: {
18 | showDiff: true,
19 | },
20 | port: 9876,
21 | colors: true,
22 | singleRun: true,
23 | logLevel: config.LOG_INFO,
24 | });
25 | };
26 |
--------------------------------------------------------------------------------
/packages/html-manager/amd-public-path.js:
--------------------------------------------------------------------------------
1 | // In an AMD module, we set the public path using the magic requirejs 'module' dependency
2 | // See https://github.com/requirejs/requirejs/wiki/Differences-between-the-simplified-CommonJS-wrapper-and-standard-AMD-define#module
3 | // Since 'module' is a requirejs magic module, we must include 'module' in the webpack externals configuration.
4 | var module = require('module');
5 | var url = new URL(module.uri, document.location);
6 | // Using lastIndexOf('/')+1 gives us the empty string if there is no '/', so pathname becomes '/'
7 | url.pathname = url.pathname.slice(0, url.pathname.lastIndexOf('/') + 1);
8 | __webpack_public_path__ = `${url.origin}${url.pathname}`;
9 |
--------------------------------------------------------------------------------
/python/widgetsnbextension/amd-public-path.js:
--------------------------------------------------------------------------------
1 | // In an AMD module, we set the public path using the magic requirejs 'module' dependency
2 | // See https://github.com/requirejs/requirejs/wiki/Differences-between-the-simplified-CommonJS-wrapper-and-standard-AMD-define#module
3 | // Since 'module' is a requirejs magic module, we must include 'module' in the webpack externals configuration.
4 | var module = require('module');
5 | var url = new URL(module.uri, document.location);
6 | // Using lastIndexOf('/')+1 gives us the empty string if there is no '/', so pathname becomes '/'
7 | url.pathname = url.pathname.slice(0, url.pathname.lastIndexOf('/') + 1);
8 | __webpack_public_path__ = `${url.origin}${url.pathname}`;
9 |
--------------------------------------------------------------------------------
/scripts/release_template.txt:
--------------------------------------------------------------------------------
1 | ### [v{{ version }}](https://github.com/jupyter-widgets/ipywidgets/releases/tag/v{{ version }}) ({{ close_date }})
2 |
3 | See the [ipywidgets
4 | {{ version }}](https://github.com/jupyter-widgets/ipywidgets/milestone/XXXX?closed=1)
5 | milestone on GitHub for the full list of pull requests and issues closed.
6 |
7 | {% for pr in pull_requests -%}
8 | * {{ pr['title'] | capitalize }} ([#{{ pr['number'] }}]({{pr['html_url']}})
9 | {%- if pr['loghub_related_issues']|length %}
10 | {%- for pri in pr['loghub_related_issues'] -%}
11 | , [#{{ pri['text'] }}]({{ pri['url'] }})
12 | {%- endfor -%}
13 | {%- endif %})
14 | {% endfor %}
15 |
--------------------------------------------------------------------------------
/python/ipywidgets/ipywidgets/_version.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) Jupyter Development Team.
2 | # Distributed under the terms of the Modified BSD License.
3 |
4 | __version__ = '8.1.8'
5 |
6 | __protocol_version__ = '2.1.0'
7 | __control_protocol_version__ = '1.0.0'
8 |
9 | # These are *protocol* versions for each package, *not* npm versions. To check, look at each package's src/version.ts file for the protocol version the package implements.
10 | __jupyter_widgets_base_version__ = '2.0.0'
11 | __jupyter_widgets_output_version__ = '1.0.0'
12 | __jupyter_widgets_controls_version__ = '2.0.0'
13 |
14 | # A compatible @jupyter-widgets/html-manager npm package semver range
15 | __html_manager_version__ = '^1.0.1'
16 |
--------------------------------------------------------------------------------
/python/widgetsnbextension/pyproject.toml:
--------------------------------------------------------------------------------
1 | [build-system]
2 | # These are the assumed default build requirements from pip:
3 | # https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support
4 | requires = ["jupyter_packaging~=0.10,<2"]
5 |
6 | [tool.jupyter-packaging.options]
7 | skip-if-exists = ["widgetnbextension/static/extension.js"]
8 | ensured-targets = ["widgetnbextension/static/extension.js"]
9 |
10 | [tool.jupyter-packaging.builder]
11 | factory = "jupyter_packaging.npm_builder"
12 |
13 | [tool.jupyter-packaging.build-args]
14 | build_cmd = "build"
15 | npm = ["yarn"]
16 |
17 | [tool.check-manifest]
18 | ignore = ["widgetnbextension/static/**", "yarn.lock", ".*", "package-lock.json"]
19 |
--------------------------------------------------------------------------------
/docs/source/_templates/sidebar-nav-bs-index.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
25 |
--------------------------------------------------------------------------------
/packages/schema/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@jupyter-widgets/schema",
3 | "version": "0.5.6",
4 | "description": "Schemas for the Jupyter interactive Widgets",
5 | "keywords": [
6 | "jupyter",
7 | "schemas",
8 | "notebook"
9 | ],
10 | "homepage": "https://github.com/jupyter-widgets/ipywidgets#readme",
11 | "bugs": {
12 | "url": "https://github.com/jupyter-widgets/ipywidgets/issues"
13 | },
14 | "repository": {
15 | "type": "git",
16 | "url": "git+https://github.com/jupyter-widgets/ipywidgets.git"
17 | },
18 | "license": "BSD-3-Clause",
19 | "author": "Project Jupyter",
20 | "main": "index.js",
21 | "scripts": {
22 | "test": "node index.js"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/packages/schema/v1/view.schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/draft-04/schema#",
3 | "description": "Jupyter Interactive Widget View JSON schema.",
4 | "type": "object",
5 | "properties": {
6 | "version_major": {
7 | "description": "Format version (major)",
8 | "type": "number",
9 | "minimum": 1,
10 | "maximum": 1
11 | },
12 | "version_minor": {
13 | "description": "Format version (minor)",
14 | "type": "number"
15 | },
16 | "model_id": {
17 | "description": "Unique identifier of the widget model to be displayed",
18 | "type": "string"
19 | }
20 | },
21 | "required": ["model_id"],
22 | "additionalProperties": false
23 | }
24 |
--------------------------------------------------------------------------------
/python/ipywidgets/ipywidgets/view.schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/draft-07/schema#",
3 | "description": "Jupyter Interactive Widget View JSON schema.",
4 | "type": "object",
5 | "properties": {
6 | "version_major": {
7 | "description": "Format version (major)",
8 | "type": "number",
9 | "minimum": 1,
10 | "maximum": 1
11 | },
12 | "version_minor": {
13 | "description": "Format version (minor)",
14 | "type": "number"
15 | },
16 | "model_id": {
17 | "description": "Unique identifier of the widget model to be displayed",
18 | "type": "string"
19 | },
20 | "required": ["model_id"]
21 | },
22 | "additionalProperties": false
23 | }
24 |
--------------------------------------------------------------------------------
/python/ipywidgets/ipywidgets/widgets/widget_core.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) Jupyter Development Team.
2 | # Distributed under the terms of the Modified BSD License.
3 |
4 | """Base widget class for widgets provided in Core"""
5 |
6 | from .widget import Widget
7 | from .._version import __jupyter_widgets_controls_version__
8 |
9 | from traitlets import Unicode
10 |
11 | class CoreWidget(Widget):
12 |
13 | _model_module = Unicode('@jupyter-widgets/controls').tag(sync=True)
14 | _model_module_version = Unicode(__jupyter_widgets_controls_version__).tag(sync=True)
15 | _view_module = Unicode('@jupyter-widgets/controls').tag(sync=True)
16 | _view_module_version = Unicode(__jupyter_widgets_controls_version__).tag(sync=True)
17 |
--------------------------------------------------------------------------------
/python/jupyterlab_widgets/jupyterlab_widgets/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) Jupyter Development Team.
2 | # Distributed under the terms of the Modified BSD License.
3 |
4 | from ._version import __version__
5 |
6 |
7 | def _jupyter_labextension_paths():
8 | import sys
9 | from pathlib import Path
10 |
11 | labext_name = '@jupyter-widgets/jupyterlab-manager'
12 | here = Path(__file__).parent.resolve()
13 | src_prefix = here.parent / 'labextension'
14 |
15 | if not src_prefix.exists():
16 | src_prefix = Path(sys.prefix) / f'share/jupyter/labextensions/{labext_name}'
17 |
18 | return [{'src': str(src_prefix), 'dest': labext_name}]
19 |
20 | __all__ = ['_jupyter_labextension_paths', '__version__']
21 |
--------------------------------------------------------------------------------
/python/ipywidgets/ipywidgets/widgets/docutils.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) Jupyter Development Team.
2 | # Distributed under the terms of the Modified BSD License.
3 |
4 | def doc_subst(snippets):
5 | """ Substitute format strings in class or function docstring """
6 | def decorator(cls):
7 | # Running python with -OO will discard docstrings (__doc__ is None).
8 | if cls.__doc__ is not None:
9 | # Strip the snippets to avoid trailing new lines and whitespace
10 | stripped_snippets = {
11 | key: snippet.strip() for (key, snippet) in snippets.items()
12 | }
13 | cls.__doc__ = cls.__doc__.format(**stripped_snippets)
14 | return cls
15 | return decorator
16 |
--------------------------------------------------------------------------------
/python/ipywidgets/ipywidgets/widgets/tests/test_widget_float.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) Jupyter Development Team.
2 | # Distributed under the terms of the Modified BSD License.
3 |
4 | from unittest import TestCase
5 |
6 | from traitlets import TraitError
7 |
8 | from ipywidgets import FloatSlider
9 |
10 |
11 | class TestFloatSlider(TestCase):
12 |
13 | def test_construction(self):
14 | FloatSlider()
15 |
16 | def test_construction_readout_format(self):
17 | slider = FloatSlider(readout_format='$.1f')
18 | assert slider.get_state()['readout_format'] == '$.1f'
19 |
20 | def test_construction_invalid_readout_format(self):
21 | with self.assertRaises(TraitError):
22 | FloatSlider(readout_format='broken')
23 |
--------------------------------------------------------------------------------
/examples/web4/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@jupyter-widgets/example-web4",
3 | "version": "8.0.14",
4 | "private": true,
5 | "description": "Project that tests the ability to npm install jupyter-js-widgets within an npm project.",
6 | "license": "BSD-3-Clause",
7 | "author": "IPython",
8 | "main": "index.js",
9 | "scripts": {
10 | "build": "webpack",
11 | "clean": "rimraf built",
12 | "test": "npm run test:default",
13 | "test:default": "echo \"No test specified\""
14 | },
15 | "dependencies": {
16 | "@jupyter-widgets/html-manager": "^1.0.14",
17 | "font-awesome": "^4.7.0"
18 | },
19 | "devDependencies": {
20 | "css-loader": "^6.5.1",
21 | "style-loader": "^3.3.1",
22 | "webpack": "^5.65.0"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/tsconfigbase.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/tsconfig",
3 | "compilerOptions": {
4 | "allowSyntheticDefaultImports": true,
5 | "composite": true,
6 | "declaration": true,
7 | "declarationMap": true,
8 | "esModuleInterop": true,
9 | "incremental": true,
10 | "jsx": "react",
11 | "module": "esnext",
12 | "moduleResolution": "node",
13 | "noEmitOnError": true,
14 | "noImplicitAny": true,
15 | "noImplicitThis": false,
16 | "noUnusedLocals": true,
17 | "preserveWatchOutput": true,
18 | "resolveJsonModule": true,
19 | "skipLibCheck": true,
20 | "sourceMap": true,
21 | "strict": true,
22 | "strictPropertyInitialization": false,
23 | "target": "es2017"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/custom_widget_issue.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Custom Widget
3 | about: Issues or questions related to developing a custom widget
4 | labels: 'Custom Widget'
5 | ---
6 |
7 |
16 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5 |
6 | version: 2
7 | # PR limit is set to zero to get only security updates
8 | # Ref https://github.com/dependabot/dependabot-core/issues/2521#issuecomment-863261500
9 | updates:
10 | - package-ecosystem: npm
11 | directory: '/'
12 | schedule:
13 | interval: 'daily'
14 | open-pull-requests-limit: 0 # in case you don't want to enable version updates
15 | allow:
16 | - dependency-type: 'production'
17 |
--------------------------------------------------------------------------------
/docs/source/ipywidgets_docs_utils.py:
--------------------------------------------------------------------------------
1 | import subprocess
2 |
3 | def jupyterlab_markdown_heading(heading_text):
4 | """Use JupyterLab-style anchors for a consistent authoring/viewing experience.
5 |
6 | This _must_ be defined in an external file as local functions can't be asssigned
7 | to config values, as they can't be pickled.
8 | """
9 | return heading_text.replace(" ", "-")
10 |
11 | def run_if_needed(args, cwd, skip_if=None):
12 | print(f"in {cwd}...")
13 | if skip_if:
14 | print("... skipping if found:", "\n".join(list(map(str, skip_if))))
15 | if all(s.exists() for s in skip_if):
16 | print("...skipping")
17 | return
18 | print(">>>", " ".join(args))
19 | subprocess.check_call(args, cwd=str(cwd))
20 |
--------------------------------------------------------------------------------
/python/widgetsnbextension/webpack.config.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 | module.exports = {
3 | entry: ['./amd-public-path.js', './src/extension.js'],
4 | output: {
5 | filename: 'extension.js',
6 | path: path.resolve(__dirname, 'widgetsnbextension', 'static'),
7 | libraryTarget: 'amd',
8 | publicPath: '', // Set in amd-public-path.js
9 | },
10 | devtool: 'source-map',
11 | module: {
12 | rules: [
13 | { test: /\.css$/, use: ['style-loader', 'css-loader'] },
14 | // required to load font-awesome
15 | { test: /\.(woff|woff2|eot|ttf|otf)$/i, type: 'asset/resource' },
16 | { test: /\.svg$/i, type: 'asset' },
17 | ],
18 | },
19 | // 'module' is the magic requirejs dependency used to set the publicPath
20 | externals: ['module'],
21 | };
22 |
--------------------------------------------------------------------------------
/docs/source/reference/jupyter-widgets.md:
--------------------------------------------------------------------------------
1 | # `@jupyter-widgets`
2 |
3 | ## Packages
4 |
5 | -
@jupyter-widgets/base
6 | - @jupyter-widgets/base-manager
7 | - @jupyter-widgets/controls
8 | - @jupyter-widgets/html-manager
9 | - @jupyter-widgets/jupyterlab-manager
10 | - @jupyter-widgets/output
11 |
--------------------------------------------------------------------------------
/tsconfig.typedoc.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/tsconfig",
3 | "compilerOptions": {
4 | "lib": ["ES2019", "WebWorker", "ScriptHost", "DOM", "DOM.Iterable"],
5 | "paths": {
6 | "@jupyter-widgets/*": [
7 | "./packages/*/src",
8 | "./python/jupyterlab_widgets/src"
9 | ]
10 | }
11 | },
12 | "extends": "./tsconfigbase",
13 | "references": [
14 | {
15 | "path": "./packages/base"
16 | },
17 | {
18 | "path": "./packages/base-manager"
19 | },
20 | {
21 | "path": "./packages/controls"
22 | },
23 | {
24 | "path": "./packages/html-manager"
25 | },
26 | {
27 | "path": "./packages/output"
28 | },
29 | {
30 | "path": "./python/jupyterlab_widgets"
31 | }
32 | ]
33 | }
34 |
--------------------------------------------------------------------------------
/docs/Readme.md:
--------------------------------------------------------------------------------
1 | # Building ipywidgets documentation
2 |
3 | To build the ipywidgets documentation:
4 |
5 | 1. Install the development version of ipywidgets with the `dev-install.sh` script in the repo root directory.
6 | 2. Install the Python packages for building documentation with either mamba or conda:
7 |
8 | ```sh
9 | conda env update --file docs/environment.yml
10 | ```
11 |
12 | or with `pip`:
13 |
14 | ```sh
15 | python -m pip install -r docs/requirements.txt
16 | # Also install pandoc separately
17 | ```
18 |
19 | 3. Build the HTML docs with sphinx:
20 |
21 | ```sh
22 | cd docs/source
23 | python -m sphinx -T -E -b html -d ../build/doctrees -D language=en . ../build/html
24 | ```
25 |
26 | 4. Open the documentation from the build directory: `docs/build/html`
27 |
--------------------------------------------------------------------------------
/examples/web3/webpack.config.js:
--------------------------------------------------------------------------------
1 | const postcss = require('postcss');
2 | var path = require('path');
3 | const webpack = require('webpack');
4 |
5 | module.exports = {
6 | mode: 'development',
7 | devtool: 'source-map',
8 | entry: './lib/index.js',
9 | output: {
10 | filename: 'index.built.js',
11 | path: path.resolve(__dirname, 'built'),
12 | },
13 | module: {
14 | rules: [
15 | { test: /\.css$/i, use: ['style-loader', 'css-loader'] },
16 | // required to load font-awesome
17 | { test: /\.(woff|woff2|eot|ttf|otf)$/i, type: 'asset/resource' },
18 | { test: /\.svg$/i, type: 'asset' },
19 | ],
20 | },
21 | plugins: [
22 | new webpack.DefinePlugin({
23 | process: {
24 | cwd: () => '/',
25 | env: {},
26 | },
27 | }),
28 | ],
29 | };
30 |
--------------------------------------------------------------------------------
/ui-tests/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@jupyter-widgets/ui-tests",
3 | "private": true,
4 | "version": "0.1.0",
5 | "description": "ipywidgets UI Tests",
6 | "scripts": {
7 | "start": "jupyter lab --config ./jupyter_server_config.py",
8 | "start:detached": "jlpm start&",
9 | "test": "npx playwright test",
10 | "test:debug": "PWDEBUG=1 npx playwright test",
11 | "test:report": "http-server ./playwright-report -a localhost -o",
12 | "test:update": "npx playwright test --update-snapshots",
13 | "deduplicate": "jlpm && yarn-deduplicate -s fewer --fail"
14 | },
15 | "author": "Project Jupyter",
16 | "license": "BSD-3-Clause",
17 | "devDependencies": {
18 | "@jupyterlab/galata": "^5.3.4",
19 | "@playwright/test": "^1.32.0",
20 | "yarn-deduplicate": "^6.0.1"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/python/ipywidgets/ipywidgets/widgets/tests/test_docutils.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) Jupyter Development Team.
2 | # Distributed under the terms of the Modified BSD License.
3 |
4 | from unittest import TestCase
5 |
6 | from ipywidgets.widgets.docutils import doc_subst
7 |
8 |
9 | class TestDocSubst(TestCase):
10 |
11 | def test_substitution(self):
12 | snippets = {'key': '62'}
13 |
14 | @doc_subst(snippets)
15 | def f():
16 | """ Docstring with value {key} """
17 |
18 | assert "Docstring with value 62" in f.__doc__
19 |
20 | def test_unused_keys(self):
21 | snippets = {'key': '62', 'other-key': 'unused'}
22 |
23 | @doc_subst(snippets)
24 | def f():
25 | """ Docstring with value {key} """
26 |
27 | assert "Docstring with value 62" in f.__doc__
28 |
--------------------------------------------------------------------------------
/docs/environment.yml:
--------------------------------------------------------------------------------
1 | name: ipywidgets_docs
2 | channels:
3 | - conda-forge
4 | - nodefaults
5 | dependencies:
6 | - python >=3.11,<3.12
7 | # build
8 | - python-build
9 | - pip
10 | - packaging
11 | - jupyter-packaging
12 | - jupyterlab >=4,<5
13 | - nodejs >=18,<19
14 | # dependencies
15 | - jupyter_client
16 | # docs
17 | - docutils >=0.19
18 | - jupyterlab-myst
19 | - myst-nb >=0.17,<0.18
20 | - pandoc
21 | - pydata-sphinx-theme
22 | - sphinx >=5,<6
23 | - sphinx-autobuild
24 | - sphinx-autodoc-typehints
25 | - sphinx-copybutton
26 | - sphinxext-rediraffe
27 | # demo
28 | - bqplot
29 | - ipykernel
30 | - ipyleaflet
31 | - jupyterlite-core >=0.3.0,<0.4.0
32 | - jupyterlite-pyodide-kernel
33 | - matplotlib-base
34 | - numpy
35 | - scikit-image
36 | - scikit-learn
37 | - sympy
38 |
--------------------------------------------------------------------------------
/packages/base/test/webpack-cov.conf.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 |
3 | module.exports = {
4 | entry: './test/build/index.js',
5 | output: {
6 | path: __dirname + '/build',
7 | filename: 'coverage.js',
8 | },
9 | bail: true,
10 | module: {
11 | loaders: [
12 | { test: /\.css$/, use: ['style-loader', 'css-loader'] },
13 | { test: /\.md$/, type: 'asset/source' },
14 | {
15 | test: /\.html$/,
16 | type: 'asset/resource',
17 | generator: { filename: '[name].[ext]' },
18 | },
19 | { test: /\.ipynb$/, type: 'json' },
20 | ],
21 | preLoaders: [
22 | // instrument only testing sources with Istanbul
23 | {
24 | test: /\.js$/,
25 | include: path.resolve('lib/'),
26 | loader: 'istanbul-instrumenter',
27 | },
28 | ],
29 | },
30 | };
31 |
--------------------------------------------------------------------------------
/packages/base-manager/test/webpack-cov.conf.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 |
3 | module.exports = {
4 | entry: './test/build/index.js',
5 | output: {
6 | path: __dirname + '/build',
7 | filename: 'coverage.js',
8 | },
9 | bail: true,
10 | module: {
11 | loaders: [
12 | { test: /\.css$/, use: ['style-loader', 'css-loader'] },
13 | { test: /\.md$/, type: 'asset/source' },
14 | {
15 | test: /\.html$/,
16 | type: 'asset/resource',
17 | generator: { filename: '[name].[ext]' },
18 | },
19 | { test: /\.ipynb$/, type: 'json' },
20 | ],
21 | preLoaders: [
22 | // instrument only testing sources with Istanbul
23 | {
24 | test: /\.js$/,
25 | include: path.resolve('lib/'),
26 | loader: 'istanbul-instrumenter',
27 | },
28 | ],
29 | },
30 | };
31 |
--------------------------------------------------------------------------------
/packages/controls/test/webpack-cov.conf.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 |
3 | module.exports = {
4 | entry: './test/build/index.js',
5 | output: {
6 | path: __dirname + '/build',
7 | filename: 'coverage.js',
8 | },
9 | bail: true,
10 | module: {
11 | loaders: [
12 | { test: /\.css$/, use: ['style-loader', 'css-loader'] },
13 | { test: /\.md$/, type: 'asset/source' },
14 | {
15 | test: /\.html$/,
16 | type: 'asset/resource',
17 | generator: { filename: '[name].[ext]' },
18 | },
19 | { test: /\.ipynb$/, type: 'json' },
20 | ],
21 | preLoaders: [
22 | // instrument only testing sources with Istanbul
23 | {
24 | test: /\.js$/,
25 | include: path.resolve('lib/'),
26 | loader: 'istanbul-instrumenter',
27 | },
28 | ],
29 | },
30 | };
31 |
--------------------------------------------------------------------------------
/docs/source/how-to/index.md:
--------------------------------------------------------------------------------
1 | # How-to Guides
2 |
3 | ```{toctree}
4 | :caption: Using Widgets
5 | :maxdepth: 1
6 | ../examples
7 | ../user_install
8 | ../examples/Widget Basics
9 | ../examples/Widget List
10 | ../examples/Output Widget
11 | ../examples/Widget Events
12 | ../examples/Widget Styling
13 | ../examples/Widget Layout
14 | ../examples/Layout Templates
15 | ../examples/Using Interact
16 | ../examples/Widget Asynchronous
17 | ```
18 |
19 | ```{toctree}
20 | :caption: Upgrading
21 | :maxdepth: 1
22 | ../user_migration_guides
23 | ../migration_guides
24 | ```
25 |
26 | ```{toctree}
27 | :caption: Publishing Content with Widgets
28 | :maxdepth: 1
29 | ../embedding
30 | ```
31 |
32 | ```{toctree}
33 | :caption: Contributing to Jupyter Widgets
34 | :maxdepth: 1
35 | ../dev_install
36 | ../dev_testing
37 | ../dev_docs
38 | ../contributing
39 | ../dev_release
40 | ```
41 |
--------------------------------------------------------------------------------
/examples/web2/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@jupyter-widgets/example-web2",
3 | "version": "8.0.13",
4 | "private": true,
5 | "description": "Project that tests the ability to npm install jupyter-js-widgets within an npm project.",
6 | "license": "BSD-3-Clause",
7 | "author": "IPython",
8 | "main": "index.js",
9 | "scripts": {
10 | "build": "webpack",
11 | "clean": "rimraf built",
12 | "test": "npm run test:default",
13 | "test:default": "echo \"No test specified\""
14 | },
15 | "dependencies": {
16 | "@jupyter-widgets/base": "^6.0.11",
17 | "@jupyter-widgets/base-manager": "^1.0.12",
18 | "@jupyter-widgets/controls": "^5.0.12",
19 | "codemirror": "^5.48.0",
20 | "font-awesome": "^4.7.0"
21 | },
22 | "devDependencies": {
23 | "css-loader": "^6.5.1",
24 | "style-loader": "^3.3.1",
25 | "webpack": "^5.65.0"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | MANIFEST
2 | build
3 | dist
4 | _build
5 | docs/man/*.gz
6 | docs/source/api/generated
7 | docs/source/.cache
8 | *.doit.db
9 | _contents
10 | node_modules
11 | *.py[co]
12 | __pycache__
13 | *.egg-info
14 | *~
15 | *.bak
16 | .ipynb_checkpoints
17 | .tox
18 | .DS_Store
19 | \#*#
20 | .#*
21 | .coverage
22 | .xunit.xml
23 | .tern-project
24 | npm-debug.log
25 | .pytest_cache
26 | .vscode/*
27 | !.vscode/extensions.json
28 |
29 | # Generated files
30 | python/widgetsnbextension/widgetsnbextension/static
31 | python/jupyterlab_widgets/labextension/
32 | packages/controls/css/nouislider.css
33 |
34 | index.built.js
35 | index.built.js.map
36 | **/es5/
37 |
38 | **/built
39 | **/lib/
40 |
41 | temp/*
42 |
43 | *.tsbuildinfo
44 |
45 | ui-tests/test-results
46 | ui-tests/playwright-report
47 |
48 | **/lite/_output/
49 | **/lite/.cache
50 | **/*.doit.*
51 | **/docs/typedoc/
52 |
53 | .yarn
54 |
--------------------------------------------------------------------------------
/python/ipywidgets/ipywidgets/widgets/tests/test_send_state.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) Jupyter Development Team.
2 | # Distributed under the terms of the Modified BSD License.
3 |
4 | from traitlets import Bool, Tuple, List
5 |
6 | from .utils import setup
7 |
8 | from ..widget import Widget
9 |
10 | from ..._version import __control_protocol_version__
11 |
12 | # A widget with simple traits
13 | class SimpleWidget(Widget):
14 | a = Bool().tag(sync=True)
15 | b = Tuple(Bool(), Bool(), Bool(), default_value=(False, False, False)).tag(
16 | sync=True
17 | )
18 | c = List(Bool()).tag(sync=True)
19 |
20 |
21 | def test_empty_send_state():
22 | w = SimpleWidget()
23 | w.send_state([])
24 | assert w.comm.messages == []
25 |
26 |
27 | def test_empty_hold_sync():
28 | w = SimpleWidget()
29 | with w.hold_sync():
30 | pass
31 | assert w.comm.messages == []
32 |
--------------------------------------------------------------------------------
/.github/workflows/answered.yml:
--------------------------------------------------------------------------------
1 | # This action automatically schedules issues to be closed that have been
2 | # labeled as answered if there is no activity on them for 30 days. This takes
3 | # care of the common usecase of an issue being answered to the best of our
4 | # ability and no other follow-up from the submitter.
5 | name: 'Close answered issues'
6 | on:
7 | schedule:
8 | - cron: '30 1 * * *'
9 |
10 | permissions:
11 | issues: write
12 |
13 | jobs:
14 | stale:
15 | runs-on: ubuntu-latest
16 | steps:
17 | - uses: actions/stale@v3
18 | with:
19 | days-before-pr-stale: -1
20 | days-before-pr-close: -1
21 | skip-stale-issue-message: true
22 | days-before-issue-stale: 30
23 | days-before-issue-close: 7
24 | stale-issue-label: 'closing as answered'
25 | stale-issue-message: '.'
26 | only-issue-labels: 'answered'
27 |
--------------------------------------------------------------------------------
/python/widgetsnbextension/widgetsnbextension/__init__.py:
--------------------------------------------------------------------------------
1 | """Interactive widgets for the Jupyter notebook.
2 |
3 | Provide simple interactive controls in the notebook.
4 | Each widget corresponds to an object in Python and Javascript,
5 | with controls on the page.
6 |
7 | You can display widgets with IPython's display machinery::
8 |
9 | from ipywidgets import IntSlider
10 | from IPython.display import display
11 | slider = IntSlider(min=1, max=10)
12 | display(slider)
13 |
14 | Moving the slider will change the value. Most widgets have a current value,
15 | accessible as a `value` attribute.
16 | """
17 | from ._version import __version__
18 | from warnings import warn
19 |
20 | def _jupyter_nbextension_paths():
21 | return [{
22 | 'section': 'notebook',
23 | 'src': 'static',
24 | 'dest': 'jupyter-js-widgets',
25 | 'require': 'jupyter-js-widgets/extension'
26 | }]
27 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/documentation.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Documentation improvement
3 | about: Create a report to help us improve the documentation
4 | labels: docs
5 | ---
6 |
7 |
8 |
9 |
10 | ### Problem
11 |
12 |
19 |
20 | ### Suggested Improvement
21 |
22 |
29 |
--------------------------------------------------------------------------------
/.yarnrc.yml:
--------------------------------------------------------------------------------
1 | nodeLinker: node-modules
2 | enableImmutableInstalls: false
3 |
4 | # prettier-ignore
5 | packageExtensions:
6 | "@nrwl/devkit@^15":
7 | dependencies:
8 | nx: ^15
9 | postcss-cssnext@^3.1.0:
10 | dependencies:
11 | caniuse-lite: ^1
12 | source-map-loader@^4:
13 | dependencies:
14 | webpack: ^5
15 |
16 | enableTelemetry: false
17 |
18 | httpTimeout: 60000
19 |
20 | # these messages provide no actionable information, and make non-TTY output
21 | # almost unreadable, masking real dependency-related information
22 | # see: https://yarnpkg.com/advanced/error-codes
23 | logFilters:
24 | - code: YN0006 # SOFT_LINK_BUILD
25 | level: discard
26 | - code: YN0007 # MUST_BUILD
27 | level: discard
28 | - code: YN0008 # MUST_REBUILD
29 | level: discard
30 | - code: YN0013 # FETCH_NOT_CACHED
31 | level: discard
32 | - code: YN0019 # UNUSED_CACHE_ENTRY
33 | level: discard
34 |
--------------------------------------------------------------------------------
/python/ipywidgets/ipywidgets/comm.py:
--------------------------------------------------------------------------------
1 | # compatibility shim for ipykernel < 6.18
2 | import sys
3 | from IPython import get_ipython
4 | import comm
5 |
6 |
7 | def requires_ipykernel_shim():
8 | if "ipykernel" in sys.modules:
9 | import ipykernel
10 |
11 | version = ipykernel.version_info
12 | return version < (6, 18)
13 | else:
14 | return False
15 |
16 |
17 | def get_comm_manager():
18 | if requires_ipykernel_shim():
19 | ip = get_ipython()
20 |
21 | if ip is not None and getattr(ip, "kernel", None) is not None:
22 | return get_ipython().kernel.comm_manager
23 | else:
24 | return comm.get_comm_manager()
25 |
26 |
27 | def create_comm(*args, **kwargs):
28 | if requires_ipykernel_shim():
29 | from ipykernel.comm import Comm
30 |
31 | return Comm(*args, **kwargs)
32 | else:
33 | return comm.create_comm(*args, **kwargs)
34 |
--------------------------------------------------------------------------------
/python/ipywidgets/ipywidgets/widgets/widget_color.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) Jupyter Development Team.
2 | # Distributed under the terms of the Modified BSD License.
3 |
4 | """Color class.
5 |
6 | Represents an HTML Color .
7 | """
8 |
9 | from .widget_description import DescriptionWidget
10 | from .valuewidget import ValueWidget
11 | from .widget import register
12 | from .widget_core import CoreWidget
13 | from .trait_types import Color
14 | from traitlets import Unicode, Bool
15 |
16 |
17 | @register
18 | class ColorPicker(DescriptionWidget, ValueWidget, CoreWidget):
19 | value = Color('black', help="The color value.").tag(sync=True)
20 | concise = Bool(help="Display short version with just a color selector.").tag(sync=True)
21 | disabled = Bool(False, help="Enable or disable user changes.").tag(sync=True)
22 |
23 | _view_name = Unicode('ColorPickerView').tag(sync=True)
24 | _model_name = Unicode('ColorPickerModel').tag(sync=True)
25 |
--------------------------------------------------------------------------------
/examples/embed-amd/README.md:
--------------------------------------------------------------------------------
1 | # Using the HTML widget manager as a RequireJS AMD module
2 |
3 | ## Description
4 |
5 | This is an example project showing how to embed widgets in an HTML document using a RequireJS AMD module.
6 |
7 | In order to test the current development repo, make a symbolic link from the `packages/html-manager` directory to this directory and uncomment the `html-manager` paths config in `index.html`.
8 |
9 | The widget data in this example was generated from the following code:
10 |
11 | ```python
12 | from ipywidgets import VBox, jsdlink, IntSlider, Button
13 |
14 | s1, s2 = IntSlider(max=200, value=100), IntSlider(value=40)
15 | b = Button(icon='legal')
16 | jsdlink((s1, 'value'), (s2, 'max'))
17 | VBox([s1, s2, b])
18 | ```
19 |
20 | ## Try it
21 |
22 | 1. Start with a repository checkout, and run `yarn install` in the root directory.
23 | 2. Run `yarn build:examples` in the root directory.
24 | 3. Open the `index.html` file in this directory.
25 |
--------------------------------------------------------------------------------
/python/ipywidgets/ipywidgets/widgets/valuewidget.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) Jupyter Development Team.
2 | # Distributed under the terms of the Modified BSD License.
3 |
4 | """Contains the ValueWidget class"""
5 |
6 | from .widget import Widget
7 | from traitlets import Any
8 |
9 |
10 | class ValueWidget(Widget):
11 | """Widget that can be used for the input of an interactive function"""
12 |
13 | value = Any(help="The value of the widget.")
14 |
15 | def get_interact_value(self):
16 | """Return the value for this widget which should be passed to
17 | interactive functions. Custom widgets can change this method
18 | to process the raw value ``self.value``.
19 | """
20 | return self.value
21 |
22 | def _repr_keys(self):
23 | # Ensure value key comes first, and is always present
24 | yield 'value'
25 | for key in super()._repr_keys():
26 | if key != 'value':
27 | yield key
28 |
--------------------------------------------------------------------------------
/python/ipywidgets/README.md:
--------------------------------------------------------------------------------
1 | # ipywidgets: Interactive HTML Widgets
2 |
3 | **ipywidgets**, also known as jupyter-widgets or simply widgets, are
4 | [interactive HTML widgets](https://github.com/jupyter-widgets/ipywidgets/blob/main/docs/source/examples/Index.ipynb)
5 | for Jupyter notebooks and the IPython kernel.
6 |
7 | This package contains the python implementation of the core interactive widgets bundled in ipywidgets.
8 |
9 | ## Core Interactive Widgets
10 |
11 | The fundamental widgets provided by this library are called core interactive
12 | widgets. A [demonstration notebook](https://github.com/jupyter-widgets/ipywidgets/blob/main/docs/source/examples/Index.ipynb)
13 | provides an overview of the core interactive widgets, including:
14 |
15 | - sliders
16 | - progress bars
17 | - text boxes
18 | - toggle buttons and checkboxes
19 | - display areas
20 | - and more
21 |
22 | For more information, see the main [documentation](https://github.com/jupyter-widgets/ipywidgets#readme).
23 |
--------------------------------------------------------------------------------
/packages/controls/src/index.ts:
--------------------------------------------------------------------------------
1 | // Copyright (c) Jupyter Development Team.
2 | // Distributed under the terms of the Modified BSD License.
3 |
4 | export * from './utils';
5 | export * from './version';
6 | export * from './widget_link';
7 | export * from './widget_bool';
8 | export * from './widget_button';
9 | export * from './widget_box';
10 | export * from './widget_image';
11 | export * from './widget_video';
12 | export * from './widget_audio';
13 | export * from './widget_color';
14 | export * from './widget_date';
15 | export * from './widget_datetime';
16 | export * from './widget_time';
17 | export * from './widget_int';
18 | export * from './widget_float';
19 | export * from './widget_controller';
20 | export * from './widget_selection';
21 | export * from './widget_selectioncontainer';
22 | export * from './widget_tagsinput';
23 | export * from './widget_string';
24 | export * from './widget_description';
25 | export * from './widget_upload';
26 |
27 | export const version = (require('../package.json') as any).version;
28 |
--------------------------------------------------------------------------------
/python/widgetsnbextension/setup.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | # Copyright (c) IPython Development Team.
4 | # Copyright (c) Jupyter Development Team.
5 | # Distributed under the terms of the Modified BSD License.
6 |
7 | from jupyter_packaging import (
8 | wrap_installers,
9 | npm_builder,
10 | get_data_files
11 | )
12 | from pathlib import Path
13 | from setuptools import setup
14 |
15 | HERE = Path(__file__).parent.resolve()
16 | IS_REPO = (HERE.parent / '.git').exists()
17 | JS_DIR = HERE / 'src'
18 |
19 | data_files_spec = [(
20 | 'share/jupyter/nbextensions/jupyter-js-widgets', 'widgetsnbextension/static', 'extension.js*'),
21 | ('etc/jupyter/nbconfig/notebook.d' , '.', 'widgetsnbextension.json')
22 | ]
23 |
24 | post_develop = npm_builder(
25 | build_cmd="yarn", source_dir="src", build_dir=JS_DIR
26 | )
27 |
28 | cmdclass = wrap_installers(post_develop=post_develop)
29 |
30 | if __name__ == '__main__':
31 | setup(
32 | cmdclass=cmdclass,
33 | data_files=get_data_files(data_files_spec),
34 | )
35 |
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "extends": [
4 | "eslint:recommended",
5 | "plugin:@typescript-eslint/eslint-recommended",
6 | "plugin:@typescript-eslint/recommended",
7 | "prettier"
8 | ],
9 | "rules": {
10 | "@typescript-eslint/naming-convention": [
11 | "error",
12 | {
13 | "selector": "interface",
14 | "format": ["PascalCase"],
15 | "custom": {
16 | "regex": "^I[A-Z]",
17 | "match": true
18 | }
19 | }
20 | ],
21 | "@typescript-eslint/no-unused-vars": ["warn", { "args": "none" }],
22 | "@typescript-eslint/no-use-before-define": "off",
23 | "@typescript-eslint/no-explicit-any": "off",
24 | "@typescript-eslint/no-non-null-assertion": "off",
25 | "@typescript-eslint/no-namespace": "off",
26 | "@typescript-eslint/no-var-requires": "off",
27 | "@typescript-eslint/ban-types": "off",
28 | "@typescript-eslint/camelcase": "off"
29 | },
30 | "parser": "@typescript-eslint/parser",
31 | "plugins": ["@typescript-eslint"]
32 | }
33 |
--------------------------------------------------------------------------------
/packages/output/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@jupyter-widgets/output",
3 | "version": "6.0.11",
4 | "description": "Jupyter widget wrapping cell output",
5 | "bugs": {
6 | "url": "https://github.com/jupyter-widgets/ipywidgets/issues"
7 | },
8 | "repository": {
9 | "type": "git",
10 | "url": "https://github.com/jupyter-widgets/ipywidgets.git"
11 | },
12 | "license": "BSD-3-Clause",
13 | "author": "Project Jupyter",
14 | "main": "lib/index.js",
15 | "typings": "lib/index.d.ts",
16 | "files": [
17 | "lib/**/*.map",
18 | "lib/**/*.d.ts",
19 | "lib/**/*.js",
20 | "src"
21 | ],
22 | "scripts": {
23 | "build": "npm run build:src",
24 | "build:src": "tsc --build",
25 | "clean": "rimraf lib && rimraf tsconfig.tsbuildinfo",
26 | "prepublish": "npm run clean && npm run build",
27 | "test": "echo \"Error: no test specified\" && exit 1"
28 | },
29 | "dependencies": {
30 | "@jupyter-widgets/base": "^6.0.11"
31 | },
32 | "devDependencies": {
33 | "rimraf": "^3.0.2",
34 | "typescript": "~4.9.4"
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/packages/html-manager/scripts/concat-amd-build.js:
--------------------------------------------------------------------------------
1 | // Copyright (c) Jupyter Development Team.
2 | // Distributed under the terms of the Modified BSD License.
3 |
4 | var fs = require('fs');
5 |
6 | // Make a script file that defines all of the relevant AMD modules
7 | var files = [
8 | 'base.js',
9 | 'controls.js',
10 | 'base7.js',
11 | 'controls7.js',
12 | 'index.js',
13 | 'libembed-amd.js',
14 | ];
15 | var output = files
16 | .map((f) => {
17 | return fs.readFileSync('./dist/amd/' + f).toString();
18 | })
19 | .join(';\n\n');
20 | fs.writeFileSync('./dist/libembed-amd.js', output);
21 |
22 | // Make a script that has all of the above AMD modules and runs a function which
23 | // renders all of the widgets on page load automatically.
24 | files = [
25 | 'base.js',
26 | 'controls.js',
27 | 'base7.js',
28 | 'controls7.js',
29 | 'index.js',
30 | 'libembed-amd.js',
31 | 'embed-amd-render.js',
32 | ];
33 | var output = files
34 | .map((f) => {
35 | return fs.readFileSync('./dist/amd/' + f).toString();
36 | })
37 | .join(';\n\n');
38 | fs.writeFileSync('./dist/embed-amd.js', output);
39 |
--------------------------------------------------------------------------------
/examples/web3/README.md:
--------------------------------------------------------------------------------
1 | # Using jupyter-js-widgets in non-notebook, web context
2 |
3 | ## Description
4 |
5 | This directory is an example project that shows how to use Jupyter widgets
6 | in a web context other than the notebook.
7 |
8 | This example requires a Jupyter notebook server to be running. The user is
9 | prompted with a dialog to provide the URL with a running notebook server.
10 |
11 | This example also displays read-only text area containing the code
12 | provided in the `widget_code.json`, which we used to generate the widget state.
13 |
14 | ## Try it
15 |
16 | 1. Start with a repository checkout, and run `yarn install` in the root directory.
17 | 2. Run `yarn build:examples` in the root directory.
18 | 3. Change to this directory
19 | 4. Run `yarn host`
20 | 5. In a new terminal run `python -m notebook --no-browser --NotebookApp.allow_origin="*" --NotebookApp.disable_check_xsrf=True --NotebookApp.token=''`. **WARNING: This starts an insecure Jupyter notebook server. Do not do this in production.**
21 | 6. In a web browser, navigate to `http://localhost:8080/` (or the address specified by the `yarn host` command)
22 |
--------------------------------------------------------------------------------
/python/ipywidgets/ipywidgets/widgets/tests/test_link.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) Jupyter Development Team.
2 | # Distributed under the terms of the Modified BSD License.
3 |
4 | import pytest
5 |
6 | from .. import jslink, jsdlink, ToggleButton
7 |
8 | def test_jslink_args():
9 | with pytest.raises(TypeError):
10 | jslink()
11 | w1 = ToggleButton()
12 | with pytest.raises(TypeError):
13 | jslink((w1, 'value'))
14 |
15 | w2 = ToggleButton()
16 | jslink((w1, 'value'), (w2, 'value'))
17 |
18 | with pytest.raises(TypeError):
19 | jslink((w1, 'value'), (w2, 'nosuchtrait'))
20 |
21 | with pytest.raises(TypeError):
22 | jslink((w1, 'value'), (w2, 'traits'))
23 |
24 | def test_jsdlink_args():
25 | with pytest.raises(TypeError):
26 | jsdlink()
27 | w1 = ToggleButton()
28 | with pytest.raises(TypeError):
29 | jsdlink((w1, 'value'))
30 |
31 | w2 = ToggleButton()
32 | jsdlink((w1, 'value'), (w2, 'value'))
33 |
34 | with pytest.raises(TypeError):
35 | jsdlink((w1, 'value'), (w2, 'nosuchtrait'))
36 |
37 | with pytest.raises(TypeError):
38 | jsdlink((w1, 'value'), (w2, 'traits'))
39 |
--------------------------------------------------------------------------------
/python/ipywidgets/ipywidgets/widgets/tests/test_widget_box.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) Jupyter Development Team.
2 | # Distributed under the terms of the Modified BSD License.
3 |
4 | from unittest import TestCase
5 |
6 | from traitlets import TraitError
7 |
8 | import ipywidgets as widgets
9 |
10 |
11 | class TestBox(TestCase):
12 |
13 | def test_construction(self):
14 | box = widgets.Box()
15 | assert box.get_state()['children'] == []
16 |
17 | def test_construction_with_children(self):
18 | html = widgets.HTML('some html')
19 | slider = widgets.IntSlider()
20 | box = widgets.Box([html, slider])
21 | children_state = box.get_state()['children']
22 | assert children_state == [
23 | widgets.widget._widget_to_json(html, None),
24 | widgets.widget._widget_to_json(slider, None),
25 | ]
26 |
27 | def test_construction_style(self):
28 | box = widgets.Box(box_style='warning')
29 | assert box.get_state()['box_style'] == 'warning'
30 |
31 | def test_construction_invalid_style(self):
32 | with self.assertRaises(TraitError):
33 | widgets.Box(box_style='invalid')
34 |
--------------------------------------------------------------------------------
/packages/base/css/index.css:
--------------------------------------------------------------------------------
1 | /* Copyright (c) Jupyter Development Team.
2 | * Distributed under the terms of the Modified BSD License.
3 | */
4 |
5 | .jupyter-widgets-disconnected::before {
6 | content: '\f127'; /* chain-broken */
7 | display: inline-block;
8 | font: normal normal 900 14px/1 'Font Awesome 5 Free', 'FontAwesome';
9 | text-rendering: auto;
10 | -webkit-font-smoothing: antialiased;
11 | -moz-osx-font-smoothing: grayscale;
12 | color: #d9534f;
13 | padding: 3px;
14 | align-self: flex-start;
15 | }
16 |
17 | .jupyter-widgets-error-widget {
18 | display: flex;
19 | flex-direction: column;
20 | justify-content: center;
21 | height: 100%;
22 | border: solid 1px red;
23 | margin: 0 auto;
24 | }
25 |
26 | .jupyter-widgets-error-widget.icon-error {
27 | min-width: var(--jp-widgets-inline-width-short);
28 | }
29 | .jupyter-widgets-error-widget.text-error {
30 | min-width: calc(2 * var(--jp-widgets-inline-width));
31 | min-height: calc(3 * var(--jp-widgets-inline-height));
32 | }
33 |
34 | .jupyter-widgets-error-widget p {
35 | text-align: center;
36 | }
37 |
38 | .jupyter-widgets-error-widget.text-error pre::first-line {
39 | font-weight: bold;
40 | }
41 |
--------------------------------------------------------------------------------
/examples/web2/index.js:
--------------------------------------------------------------------------------
1 | var CodeMirror = require('codemirror');
2 | require('codemirror/lib/codemirror.css');
3 | require('codemirror/mode/python/python');
4 | var WidgetManager = require('./manager').WidgetManager;
5 |
6 | require('@jupyter-widgets/controls/css/widgets.css');
7 | require('font-awesome/css/font-awesome.css');
8 |
9 | document.addEventListener('DOMContentLoaded', function (event) {
10 | var code = require('./widget_code.py');
11 | var inputarea = document.getElementsByClassName('inputarea')[0];
12 | new CodeMirror(inputarea, {
13 | value: code,
14 | mode: 'python',
15 | tabSize: 4,
16 | showCursorWhenSelecting: true,
17 | viewportMargin: Infinity,
18 | readOnly: true,
19 | });
20 |
21 | var state = require('./widget_state.json');
22 | var widgetarea = document.getElementsByClassName('widgetarea')[0];
23 | var manager = new WidgetManager(widgetarea);
24 | manager
25 | .set_state(state)
26 | .then((models) =>
27 | manager.create_view(
28 | models.find(
29 | (element) => element.model_id == '8621699ecc804983a612f09b7dfe806b'
30 | )
31 | )
32 | )
33 | .then((view) => manager.display_view(view));
34 | });
35 |
--------------------------------------------------------------------------------
/.github/workflows/devinstall.yml:
--------------------------------------------------------------------------------
1 | name: Run the dev-install script
2 |
3 | on:
4 | push:
5 | branches: main
6 | pull_request:
7 | branches: '*'
8 |
9 | jobs:
10 | devinstall:
11 | runs-on: ubuntu-latest
12 | steps:
13 | - name: Checkout
14 | uses: actions/checkout@v4
15 | - name: Install Python
16 | uses: actions/setup-python@v4
17 | with:
18 | python-version: '3.13'
19 | architecture: 'x64'
20 | - name: Cache pip on Linux
21 | uses: actions/cache@v3
22 | if: startsWith(runner.os, 'Linux')
23 | with:
24 | path: ~/.cache/pip
25 | key: ${{ runner.os }}-pip-${{ matrix.python }}-${{ hashFiles('**/requirements.txt') }}
26 | restore-keys: |
27 | ${{ runner.os }}-pip-${{ matrix.python }}
28 |
29 | - name: Install dependencies
30 | run: |
31 | python -m pip install notebook jupyterlab notebook~=6.0 jupyter_packaging~=0.10
32 | - name: Run the dev-install script
33 | run: |
34 | ./dev-install.sh
35 | jupyter nbextension list
36 | jupyter labextension list
37 |
38 | python -m jupyterlab.browser_check
39 |
--------------------------------------------------------------------------------
/docs/source/examples/images/flex-container.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
20 |
--------------------------------------------------------------------------------
/examples/web1/test/index.js:
--------------------------------------------------------------------------------
1 | const widgetsRendered = new Promise((resolve, reject) => {
2 | setTimeout(
3 | () => reject(Error('timeout waiting for widgets to render')),
4 | 5000
5 | ); // 5s timeout
6 |
7 | const listener = () => {
8 | resolve();
9 | document.removeEventListener('widgetsRendered', listener);
10 | };
11 | document.addEventListener('widgetsRendered', listener);
12 | });
13 |
14 | describe('index.html', function () {
15 | this.timeout(10000);
16 |
17 | beforeEach(() => {
18 | return widgetsRendered;
19 | });
20 |
21 | describe('textArea', () => {
22 | it('exists', () => {
23 | expect(document.querySelector('textarea')).to.be.ok;
24 | });
25 | it('correct value', () => {
26 | expect(document.querySelector('textarea').value).to.equal(
27 | 'test text'
28 | );
29 | });
30 | });
31 | describe('html', () => {
32 | it('exists', () => {
33 | expect(document.querySelector('div.widget-html')).to.be.ok;
34 | });
35 | it('correct value', () => {
36 | expect(
37 | document.querySelector('div.widget-html-content').innerHTML
38 | ).to.equal('test text');
39 | });
40 | });
41 | });
42 |
--------------------------------------------------------------------------------
/python/jupyterlab_widgets/src/semvercache.ts:
--------------------------------------------------------------------------------
1 | // Copyright (c) Jupyter Development Team.
2 | // Distributed under the terms of the Modified BSD License.
3 |
4 | import { maxSatisfying } from 'semver';
5 |
6 | /**
7 | * A cache using semver ranges to retrieve values.
8 | */
9 | export class SemVerCacheTroubleshoot Output
43 |
44 | Paste the output from running `jupyter troubleshoot` from the command line here.
45 | You may want to sanitize the paths in the output.
46 |
47 | Command Line Output
50 |
51 | Paste the output from your command line running `jupyter lab` (or `jupyter notebook` if you use notebook) here, use `--debug` if possible.
52 |
53 | Browser Output
56 |
57 | Paste the output from your browser Javascript console here.
58 |
59 | Installed Labextensions
66 |
67 | Paste the output from your command line running `jupyter labextension list`.
68 |
69 |