Skip to main content

brushable_widget

An anywidget that adds a brush to SVG plots.

Installation

pip install brushable_widget

or with uv:

uv add brushable_widget

Example

An example marimo script (available as example.py => run with uv run marimo edit example.py).

IMPORTANT: the SVG elements that should be brushable should:

  • have "brushable" in their class_
  • have an ID
import marimo as mo
from svg import SVG, Circle
import random
import brushable_widget

datapoints = []
for _i in range(20):
    datapoints.append({
        'x': random.randint(20,180),
        'y': random.randint(20,180),
        'z': random.randint(20,180),
        'id': _i
    })

circles = []
for datapoint in datapoints:
    circles.append(Circle(
        cx=datapoint['x'],
        cy=datapoint['y'],
        r=10,
        fill="steelblue",
        fill_opacity=0.5,
        stroke_width=1,
        stroke="white",
        class_="jfsi2 brushable",
        id=datapoint['id']
    ))

svg = SVG(
    class_="notebook",
    width=200,
    height=200,
    elements=[circles]
)

x = mo.ui.anywidget(brushable_widget.BrushableWidget(svg=svg.as_str(), selected_ids = []))

x

x.selected_ids

Development

We recommend using uv for development. It will automatically manage virtual environments and dependencies for you.

uv run jupyter lab example.ipynb

Metadata

Release files for brushable_widget 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for brushable_widget 0.1.8
File Size Uploaded Provenance
brushable_widget-0.1.8.tar.gz 25.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for brushable_widget 0.1.8
File Interpreter ABI Platform
brushable_widget-0.1.8-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 34.9 kB

Release files / brushable_widget-0.1.8.tar.gz

Download URL brushable_widget-0.1.8.tar.gz
Size 25.8 kB
Tags Source
SHA-256 checksum
How to use checksums
eb49408b26669c722152b68de608165779fe3036d8618e79d4d2b214595ec0ec
BLAKE2b-256 checksum
How to use checksums
4f12774181104b8df239a05d84db2a0dc2f31a42e11fcecebbe77b296a804fb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.13

Release files / brushable_widget-0.1.8-py2.py3-none-any.whl

Download URL brushable_widget-0.1.8-py2.py3-none-any.whl
Size 9.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
d69844e150af4eec17fae5cc5b451199041d98de303309983688cdead502cc93
BLAKE2b-256 checksum
How to use checksums
fbcf2b5a621c22c98ef12f94681078d8f33eb960bdf90403e9eee58c84ab8f30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.13

Security for brushable_widget 0.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page