File: README.md

package info (click to toggle)
ipywidgets 8.1.5-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,520 kB
  • sloc: python: 7,041; javascript: 1,764; sh: 62; makefile: 36
file content (24 lines) | stat: -rw-r--r-- 1,185 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Ad hoc widget manager reading a file with the `application/vnd.jupyter.widget-state+json` mime type.

## Description

This directory is an example project that shows how to use the
Jupyter widgets library in a pure JavaScript context.

This example implements a simple widget manager
by extending the base widget manager from the `@jupyter-widgets/base` library. This custom widget manager reads the state of the widget manager in the
`widget_state.json` file, which respects the standardized JSON schema for the
`application/vnd.jupyter.widget-state+json` mime type. Such a `widget_state.json` file can be generated from rendered widgets in the
classic Jupyter Notebook with the _Download widget state_ action.

This example also displays a read-only text area containing the code
provided in the `widget_code.json`, which we used to generate the widget state.

This example does not implement the communication with a Python backend. For
such an example, check out the `web3` example.

## Try it

1. Start with a repository checkout, and run `yarn install` in the root directory.
2. Run `yarn build:examples` in the root directory.
3. Open the `index.html` file in this directory.