Skip to main content

A Tree Widget using jsTree

Project description

ipyselect2

Usage

from ipyselect2 import Select2
import ipywidgets as widgets

s1 = Select2(options=['a', 'b'], width='200px')
s2 = Select2(options=['x', 'y'], width='200px', multiple='multiple', lazy=True)
s2.layout.height = '60px'
def values_change(change):
  with output:
    print(change)
s1.observe(values_change, 'value')
s2.observe(values_change, 'values')
output = widgets.Output()
tab = widgets.Tab()
tab.children = [s1, s2]
def tab_change(x):
  if x['new']: s2.lazy = False
tab.observe(tab_change, 'selected_index')
tab.set_title(0, 'single select')
tab.set_title(1, 'multiple select')
display(tab, output)

Installation

A jupyter widget using select2

With pip:

pip install ipyselect2

To make it work for Jupyter lab:

jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install ipyselect2

If you have notebook 5.2 or below, you also need to execute:

jupyter nbextension enable --py --sys-prefix ipyselect2

For a development installation (requires npm),

cd /opt
git clone https://github.com/opentradesolutions/ipyselect2.git
cd ipyselect2
pip install -e .
jupyter nbextension install --py --symlink --sys-prefix ipyselect2
jupyter nbextension enable --py --sys-prefix ipyselect2
jupyter labextension link js

For Jupyter lab development, you may want to start Jupyter lab with jupyter lab –watch so it instantly picks up changes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipyselect2-0.2.1.tar.gz (444.3 kB view details)

Uploaded Source

Built Distribution

ipyselect2-0.2.1-py2.py3-none-any.whl (892.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ipyselect2-0.2.1.tar.gz.

File metadata

  • Download URL: ipyselect2-0.2.1.tar.gz
  • Upload date:
  • Size: 444.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.46.0 CPython/3.6.9

File hashes

Hashes for ipyselect2-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b3bf6567059972b5e95955c68dfffe7dcd26979e9852eccfd822abcee2dc32e9
MD5 86a6371b4c6356b142c1b43c502bf854
BLAKE2b-256 c559d47ecc69d578efbad4e0a3302e302677cc5988650e7b81d42e28e8d6e689

See more details on using hashes here.

File details

Details for the file ipyselect2-0.2.1-py2.py3-none-any.whl.

File metadata

  • Download URL: ipyselect2-0.2.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 892.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.46.0 CPython/3.6.9

File hashes

Hashes for ipyselect2-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 dc439211f78e794baedb26f45a94c19091cada99371d9c8c3ece8cc02017b018
MD5 0cfdec8b0352479a764dcf72c51c1e68
BLAKE2b-256 5116ed2c338c0448b1b36e067b733326a914a22f2a0d2ae5252cdb175e2afda8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page