Skip to main content

anyupset

Interactive UpSet plots as an anywidget, for marimo and Jupyter.

An UpSet plot shows how items are distributed across combinations of sets. The point of this one is seeing the actual items: hover any bar and its members appear in the side panel; click to pin the selection and pull it back into Python.

anyupset in action

[!WARNING] Early days. This is a 0.1 release. The API may still change, and the widget has seen little use beyond its own test suite and demos — pin an exact version if you build on it, and please report anything that breaks.

Written with AI assistance. Nearly all of this project — the widget, the tests, the demos and the CI — was written by Claude in a pair-programming session, then reviewed and directed by a human. It is tested, but it has not had the scrutiny of a codebase grown by hand over time. Read the source before you depend on it.

Install

uv add anyupset

Use

from anyupset import UpSet

upset = UpSet({
    "drama":   {"Titanic", "Casablanca", "Whiplash"},
    "romance": {"Titanic", "Casablanca", "Notting Hill"},
    "comedy":  {"Notting Hill"},
})
upset

Columns are exclusive intersections: each item belongs to exactly one column, the one matching the full set of sets it is in.

Data often arrives the other way round — one row per item, listing what it belongs to. from_memberships flips it for you, and builds the same plot:

upset = UpSet.from_memberships({
    "Titanic":      ["drama", "romance"],
    "Casablanca":   ["drama", "romance"],
    "Whiplash":     ["drama"],
    "Notting Hill": ["romance", "comedy"],
})

Reading the selection

upset.selected_sets      # ['drama', 'romance']
upset.selected_members   # ['Casablanca', 'Titanic'] — original Python objects
upset.selected_values    # the same, reduced to JSON-safe scalars

In marimo, wrap it so downstream cells re-run on interaction:

upset = mo.ui.anywidget(UpSet(...))
upset.value["selected_sets"]     # ['drama', 'romance']
upset.value["selected_values"]   # ['Casablanca', 'Titanic']

.value carries only synced traits. selected_members is deliberately not synced — it holds the original objects, uncapped, and never crosses the wire — but the wrapper proxies attribute access, so upset.selected_members still works. Use .value for reactivity, the attribute when you need fidelity.

Examples

Both demos build the same plot from the same 156-film dataset.

# marimo — reactive: clicking a bar re-runs the cells below it
uv run --group dev marimo edit examples/marimo_demo.py

# Jupyter — re-run the reading cell yourself after clicking
uv run --group jupyter jupyter lab examples/jupyter_demo.ipynb

Download files

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

Source Distribution

anyupset-0.1.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

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

anyupset-0.1.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file anyupset-0.1.0.tar.gz.

File metadata

  • Download URL: anyupset-0.1.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for anyupset-0.1.0.tar.gz
Algorithm Hash digest
SHA256 006977577431ef30bfbe5e8211cffe6ad681c464f4f7b7e975e8177da7355b79
MD5 25a06c1a59bfd944669426c233596be9
BLAKE2b-256 fbc8590a84faad3ee7fe521a6ad833907b725a3a29b27a4ae9c46f38ad96f83c

See more details on using hashes here.

File details

Details for the file anyupset-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: anyupset-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for anyupset-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00b50ba267cd181350c6bbf11824c85d38828eb4a424a35f8cea7c461bf3013c
MD5 9f828f8a0581cd2beda1018c3fb87f74
BLAKE2b-256 4f4f97f3ac4b5505bad96e195db19919a71eccdba61def545c39da38408037f5

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

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