Skip to main content

Collection of Jupyter Widgets

Project description

wigglystuff

"A collection of expressive Jupyter widgets."

The project uses anywidget under the hood so our tools should work in Jupyter, VSCode, Colab and Marimo. That also means that you get a proper widget that can interact with ipywidgets natively.

Installation

Installation occurs via pip.

python -m pip install wigglystuff

Usage

Slider2D

from wigglystuff import Slider2D

widget = Slider2D()
widget

This widget allows you to grab the widget.x and widget.y properties to get the current position of the slider. But you can also use the widget.observe method to listen to changes in the widget.

Example of widget.observe
import ipywidgets
from wigglystuff import Slider2D

widget = Slider2D()
output = ipywidgets.Output()
state = [[0.0, 0.0]]

@output.capture(clear_output=True)
def on_change(change):
    if abs(widget.x - state[-1][0]) > 0.01:
        if abs(widget.y - state[-1][1]) > 0.01:
            state.append([widget.x, widget.y])
    for elem in state[-5:]:
        print(elem)

widget.observe(on_change)
on_change(None)
ipywidgets.HBox([widget, output])

Matrix

from wigglystuff import Matrix

arr = Matrix(rows=1, cols=2, triangular=True, step=0.1)
mat = Matrix(matrix=np.eye(2), triangular=True, step=0.1)

This widget allows you to grab the mat.matrix property after editing the matrix. This returns a list of lists which can easily be cast into a numpy array via np.array(mat.matrix).

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

wigglystuff-0.1.5-py2.py3-none-any.whl (6.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file wigglystuff-0.1.5-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for wigglystuff-0.1.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 123d6c4450ea5f03e94f43084a17107d6bf3578ab704145393357e74c509f78e
MD5 993460f64a4cc835dcba55ea91da19c1
BLAKE2b-256 92fa29c47976242c5a464a0b63485593f8e4befd23592eda549f00f9d457351e

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