MCPcopy
hub / github.com/jupyter-widgets/ipywidgets

github.com/jupyter-widgets/ipywidgets @8.1.8 sqlite

repository ↗ · DeepWiki ↗ · release 8.1.8 ↗
2,068 symbols 5,592 edges 197 files 606 documented · 29%
README

ipywidgets: Interactive HTML Widgets

Purpose Badges
Latest (main: future 8.0) Test Status Documentation Status: latest Binder:main
Stable Version Conda Version Documentation Status Binder:7.x
Communication Join the chat at https://gitter.im/ipython/ipywidgets Discourse

ipywidgets, also known as jupyter-widgets or simply widgets, are interactive HTML widgets for Jupyter notebooks and the IPython kernel.

Notebooks come alive when interactive widgets are used. Users gain control of their data and can visualize changes in the data.

Learning becomes an immersive, fun experience. Researchers can easily see how changing inputs to a model impact the results. We hope you will add ipywidgets to your notebooks, and we're here to help you get started.

The ipywidgets package is under the Jupyter-Widgets software subproject.

Core Interactive Widgets

The fundamental widgets provided by this library are called core interactive widgets. A demonstration notebook provides an overview of the core interactive widgets, including:

  • sliders
  • progress bars
  • text boxes
  • toggle buttons and checkboxes
  • display areas
  • and more

Jupyter Interactive Widgets as a Framework

Besides the widgets already provided with the library, the framework can be extended with the development of custom widget libraries. For detailed information, please refer to the ipywidgets documentation.

Cookiecutter template for custom widget development

A template project for building custom widgets is available as a cookiecutter. This cookiecutter project helps custom widget authors get started with the packaging and the distribution of their custom Jupyter interactive widgets. The cookiecutter produces a project for a Jupyter interactive widget library following the current best practices for using interactive widgets. An implementation for a placeholder "Hello World" widget is provided as an example.

Popular widget libraries such as bqplot, pythreejs and ipyleaflet follow exactly the same template and directory structure. They serve as more advanced examples of usage of the Jupyter widget infrastructure.

Popular custom widget examples

Examples of custom widget libraries built upon ipywidgets are

  • bqplot a 2d data visualization library enabling custom user interactions.
  • pythreejs a Jupyter - Three.js wrapper, bringing Three.js to the notebook.
  • ipyleaflet a leaflet widget for Jupyter.

Install

The stable version of ipywidgets can be installed with pip or conda.

With pip:

pip install ipywidgets

With conda:

conda install -c conda-forge ipywidgets

Developer install from source

Installing from source is more complicated and requires a developer install, see the detailed developer install instructions.

If you want to install ipywidgets from source, you will need the yarn package manager version 3 or later. To install the latest main version from the root directory of the source code, run dev-install.sh. To only build the Python package enter pip install -e ..

Usage

See the examples section of the documentation. The widgets are being used in a variety of ways; some uses can be seen in these notebooks: Demo notebook of interactive widgets

Change log

Change log

Version Compatibility with Front-End Clients

Refer to change log for more detail.

ipywidgets JupyterLab Classic Notebook nbclassic
main - TBD
7.6.3 0.2.6
Legacy
6.x -
5.x 4.2 -
4.1.x 4.1 -
4.0.x 4.0 -

Contributing to ipywidgets

Developer information

License

We use a shared copyright model that enables all contributors to maintain the copyright on their contributions.

See the LICENSE file in this repository for details.

Project Jupyter resources

Weekly Team Meetings

Developer Meetings take place on zoom, on Tuesdays at 9:30AM Pacific Time (your time).

Minutes are taken at Hackmd.io.

Extension points exported contracts — how you extend this code

IClassicComm (Interface)
(no doc) [5 implementers]
packages/base/src/services-shim.ts
IViewState (Interface)
(no doc)
packages/html-manager/src/libembed.ts
IState (Interface)
(no doc)
packages/base-manager/src/manager-base.ts
IConstructor (Interface)
(no doc)
packages/controls/test/src/utils.ts
IWidgetManager (Interface)
(no doc) [1 implementers]
packages/base/src/manager.ts
IManagerStateMap (Interface)
(no doc)
packages/base-manager/src/manager-base.ts
ISerializedDatetime (Interface)
(no doc)
packages/controls/src/widget_datetime.ts
ISerializeable (Interface)
(no doc) [1 implementers]
packages/base/src/utils.ts

Core symbols most depended-on inside this repo

get
called by 405
python/jupyterlab_widgets/src/semvercache.ts
add
called by 147
python/jupyterlab_widgets/src/output.ts
set
called by 111
packages/base/src/widget.ts
get_state
called by 63
python/ipywidgets/ipywidgets/widgets/widget.py
new_model
called by 40
packages/base/src/manager.ts
push
called by 38
python/jupyterlab_widgets/src/plugin.ts
touch
called by 34
packages/base/src/widget.ts
save_changes
called by 33
packages/base/src/widget.ts

Shape

Method 1,043
Class 572
Function 417
Interface 33
Route 3

Languages

TypeScript64%
Python36%

Modules by API surface

packages/controls/src/widget_selection.ts100 symbols
packages/controls/src/widget_int.ts94 symbols
packages/controls/src/widget_string.ts93 symbols
packages/base/src/widget.ts70 symbols
python/ipywidgets/ipywidgets/widgets/widget.py67 symbols
packages/controls/src/widget_tagsinput.ts63 symbols
python/ipywidgets/ipywidgets/widgets/tests/test_interaction.py59 symbols
packages/controls/src/widget_selectioncontainer.ts51 symbols
packages/controls/src/widget_float.ts51 symbols
packages/base/test/src/dummy-manager.ts45 symbols
packages/base-manager/test/src/dummy-manager.ts44 symbols
python/jupyterlab_widgets/src/manager.ts43 symbols

Dependencies from manifests, versioned

@fortawesome/fontawesome-free5.12.0 · 1×
@jupyter-widgets/base6.0.11 · 1×
@jupyter-widgets/base-manager1.0.12 · 1×
@jupyter-widgets/base7
@jupyter-widgets/controls5.0.12 · 1×
@jupyter-widgets/controls7
@jupyter-widgets/html-manager1.0.14 · 1×
@jupyter-widgets/output6.0.11 · 1×
@jupyter-widgets/schema0.5.6 · 1×
@jupyterlab/application3.0.0 || ^4.0.0 · 1×
@jupyterlab/apputils3.0.0 || ^4.0.0 · 1×
@jupyterlab/builder3.0.0 || ^4.0.0 · 1×

For agents

$ claude mcp add ipywidgets \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact