Skip to main content

Python bindings and notebook widget support for ruviz

Project description

ruviz for Python

ruviz for Python wraps the Rust plotting runtime with a fluent Python API, static export helpers, native desktop show(), and notebook widget support.

Install

pip install ruviz

If you want pandas or Polars dataframe inputs, install the optional dataframe extras:

pip install "ruviz[dataframes]"

Quick Start

import numpy as np
import ruviz

x = np.linspace(0.0, 4.0, 50)
y = x**2

(
    ruviz.plot()
    .line(x, y)
    .title("Quadratic")
    .xlabel("x")
    .ylabel("y = x^2")
    .save("quadratic.png")
)

Notebook and Desktop Usage

  • In Jupyter, plot.show() displays a static PNG in the cell output.
  • Use plot.widget() when you want the synced WASM-backed notebook widget.
  • plot.size_px(width, height) also controls the widget's displayed size and aspect ratio.
  • Without size_px(...), the widget uses the default PNG size (640x480) and shrinks proportionally if the notebook column is narrower.
  • Drag the widget's bottom-right handle to resize the display freely.
  • Hold Shift or Ctrl while dragging the handle to preserve the current aspect ratio.
  • In the widget, right click opens the export menu and right drag performs box zoom.
  • Outside notebooks, plot.show() opens the native interactive window.
  • The published Linux wheel focuses on static rendering and notebook widgets. Install from source on Linux if you need the native desktop plot.show() window.
  • plot.render_png() and plot.render_svg() return in-memory export data.

Reactive Notebook Data

Use ruviz.observable(...) for notebook-driven updates that keep widget state in sync:

import numpy as np
import ruviz

x = np.linspace(0.0, 6.0, 200)
y = ruviz.observable(np.sin(x))

plot = ruviz.plot().line(x, y).title("Live Sine Wave")
widget = plot.widget()

ObservableSeries supports elementwise arithmetic and NumPy ufuncs. Derived observables stay live until you write to them directly:

from copy import deepcopy
import numpy as np

scaled = np.sin(y * 2.0 + 0.25)
template = deepcopy(plot)

deepcopy(plot) creates an independent live copy with fresh observables, while plot.clone() remains a static snapshot copy.

Documentation

Contributor Workflow

cd python
uv sync
uv run maturin develop
uv run python scripts/generate_gallery.py
uv run mkdocs serve

Rebuild the bundled widget frontend from the repository root when you change the web SDK or packages/ruviz-web/src/python-widget.ts:

bun run build:python-widget

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

ruviz-0.4.13.tar.gz (4.6 MB view details)

Uploaded Source

Built Distributions

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

ruviz-0.4.13-cp310-abi3-win_amd64.whl (6.9 MB view details)

Uploaded CPython 3.10+Windows x86-64

ruviz-0.4.13-cp310-abi3-manylinux_2_28_x86_64.whl (6.8 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64

ruviz-0.4.13-cp310-abi3-macosx_11_0_arm64.whl (6.8 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

ruviz-0.4.13-cp310-abi3-macosx_10_12_x86_64.whl (7.1 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file ruviz-0.4.13.tar.gz.

File metadata

  • Download URL: ruviz-0.4.13.tar.gz
  • Upload date:
  • Size: 4.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ruviz-0.4.13.tar.gz
Algorithm Hash digest
SHA256 c5dcb056aa2cb700a1cc479542513c1225251643875809c16c34a08235ed3d40
MD5 40f41b15a1c75d63858d57629751dd2a
BLAKE2b-256 2516ff9f4097596065f7bed4a43bf2fb65ef34c2727263b03f9c7b83733d5168

See more details on using hashes here.

Provenance

The following attestation bundles were made for ruviz-0.4.13.tar.gz:

Publisher: release.yml on Ameyanagi/ruviz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ruviz-0.4.13-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: ruviz-0.4.13-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 6.9 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ruviz-0.4.13-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4b533ed0044f9ee0513bf8c03b0a747248ffb0434f9d78b21a429ab6134dbfed
MD5 6debec64dc57382b1939214deca4cc3f
BLAKE2b-256 ecccc9148171ac6b2e6d19415c803215a0ca4a185b67bc8cc91d65fbe5d368dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for ruviz-0.4.13-cp310-abi3-win_amd64.whl:

Publisher: release.yml on Ameyanagi/ruviz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ruviz-0.4.13-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ruviz-0.4.13-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 943e097234d956adbfc1f16435fd089a484ade87d0c6e6dc0760478f47383eba
MD5 3c9d293e2571e0f63d8fc29876aa4015
BLAKE2b-256 c7ecebdcec97d68d0a4589c83824679cb3a60b28e103da2b8758286589fd9028

See more details on using hashes here.

Provenance

The following attestation bundles were made for ruviz-0.4.13-cp310-abi3-manylinux_2_28_x86_64.whl:

Publisher: release.yml on Ameyanagi/ruviz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ruviz-0.4.13-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ruviz-0.4.13-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e1964f3766ab2d447f982201fd78422307f11d15b49d568e22aa396d738cb5cf
MD5 0165048652c40faeba97b813367920c4
BLAKE2b-256 1a841778ac0c77b540192aee4317b86c7b256365e29c367210b2ff9fb7fcb7e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for ruviz-0.4.13-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on Ameyanagi/ruviz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ruviz-0.4.13-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ruviz-0.4.13-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a8d5eabe24bc445dc631ab1ee1fc9f5ef6504a9ed47e1ba48bff4a8fe28182cd
MD5 7b93e2442b57efed39ad25046b88b876
BLAKE2b-256 3ec01528e6f70aec641e923318e83079b4f590545f17036e5b4df79c3261d885

See more details on using hashes here.

Provenance

The following attestation bundles were made for ruviz-0.4.13-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on Ameyanagi/ruviz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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