Skip to main content

Collection of Anywidget Widgets

Project description

wigglystuff

"A collection of creative AnyWidgets for Python notebook environments."

The project uses anywidget under the hood so our tools should work in Jupyter, Shiny for Python, VSCode, Colab, Solara and Marimo. Because of the anywidget integration you should also be able interact with ipywidgets natively.

Online demos

We've made some demos of the widgets and shared them on the Marimo gallery for easy exploration.

Matrix demo with PCA Tangle Widgets for exploration


Installation

Installation occurs via pip or uv.

python -m pip install wigglystuff
uv 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

If you want to get an intuition of linear algebra, the Matrix object might really help. It can generate a matrix for you that allows you to update all the values in it.

from wigglystuff import Matrix

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

TangleSlider

Sliders are neat, but maybe you'd prefer to have something more inline. For that use-case the TangleSlider can be just what you need.

from wigglystuff import TangleSlider

TangleChoice & TangleSelect

This is similar to the TangleSlider but for discrete choices.

from wigglystuff import TangleChoice

TangleSelect is just like TangleChoice but with a dropdown.

from wigglystuff import TangleSelect

CopyToClipboard

This is a simple button, but one that allows you to copy anything of interest to the clipboard. This can be very helpful for some interactive Marimo apps where the output needs to be copied into another app.

from wigglystuff import CopyToClipboard

CopyToClipboard("this can be copied")

Development

I am currently exploring how we might move some of these components to react, mainly in an attempt to keep things flexible in the future. There's no need to port everything just yet but I have ported the clipboard button. You should be able to develop it via:

npm run dev-copy-btn

This assumes that you ran npm install beforehand.

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

wigglystuff-0.1.11.tar.gz (283.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

wigglystuff-0.1.11-py3-none-any.whl (285.4 kB view details)

Uploaded Python 3

wigglystuff-0.1.11-py2.py3-none-any.whl (285.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file wigglystuff-0.1.11.tar.gz.

File metadata

  • Download URL: wigglystuff-0.1.11.tar.gz
  • Upload date:
  • Size: 283.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.7

File hashes

Hashes for wigglystuff-0.1.11.tar.gz
Algorithm Hash digest
SHA256 f901afe43a218472b5561185561f704ff3d4652204dc1bf33bdc679292ec1018
MD5 d51e5ac116146d925c5aebb07d96c993
BLAKE2b-256 25af8c0f6aeb5ea50d57b7910155d574c3d3ce57d97eeab9e849964bac377dd5

See more details on using hashes here.

File details

Details for the file wigglystuff-0.1.11-py3-none-any.whl.

File metadata

File hashes

Hashes for wigglystuff-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 b50480d9dd53fd69128e08fa50b4853c0a5bd157ed3a725c0f1661998df792ae
MD5 736f8cbb2dc3375fdd21fd950d2a2da4
BLAKE2b-256 381672fe61043d3724db4717eba302c023b63a5113f6104ee463f4d7bd316f0c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wigglystuff-0.1.11-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a9f1f46f15f9e2df3c94fe6fd9e7464e588a3cdc293a9870380b431bf8b7b888
MD5 9e68b392f2ab2e622ad63e8211993e8a
BLAKE2b-256 59972b9a398395e2b0f72e7f83b6168961cf13bedabee92e73b2abe52ec706b1

See more details on using hashes here.

Supported by

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