Skip to main content

canvasxpress-anywidget

CanvasXpress interactive charts as notebook widgets, built on anywidget. One package renders in Jupyter, JupyterLab, Google Colab, VS Code notebooks and marimo — anywhere the anywidget protocol is supported.

The CanvasXpress library (CSS + JS) is loaded from the CanvasXpress CDN in the browser, so there is no JavaScript build step and nothing to bundle.

Install

pip install canvasxpress-anywidget

Use

from canvasxpress_anywidget import CanvasXpress

CanvasXpress(
    data={
        "y": {
            "vars": ["Revenue"],
            "smps": ["Q1", "Q2", "Q3", "Q4"],
            "data": [[10, 14, 9, 17]],
        }
    },
    config={"graphType": "Bar", "title": "Quarterly Revenue"},
)

data, config and events are exactly the arguments of new CanvasXpress({...}) in JavaScript, so any spec from the gallery, the R / Python packages, or the Quarto shortcode works unchanged.

From a shared spec file

The {"data", "config", "events"} JSON object used across CanvasXpress hosts loads directly:

import json
from canvasxpress_anywidget import CanvasXpress

spec = json.load(open("chart.json"))
CanvasXpress.from_spec(spec)

Update in place

Assigning to an attribute re-renders the chart without creating a new cell output:

w = CanvasXpress(data=..., config={"graphType": "Bar"})
w  # display it
w.config = {**w.config, "graphType": "Line"}   # morphs to a line chart

Parameters

Attribute Type Default Meaning
data dict {} CanvasXpress data object (y, x, z, …).
config dict {} CanvasXpress configuration (graphType, title, …).
events dict {} Optional event handlers.
width int 600 Canvas width in pixels.
height int 400 Canvas height in pixels.

License

This package is MIT-licensed. The CanvasXpress JavaScript library it loads is distributed separately under the CanvasXpress Community License (Attribution), free with a visible attribution mark and with commercial terms for mark removal — see https://www.canvasxpress.org/license.html. https://canvasxpress.org/license.html.

Metadata

Release files for canvasxpress-anywidget 0.1.1

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

Source distribution (sdist)

Source distribution for canvasxpress-anywidget 0.1.1
File Size Uploaded
canvasxpress_anywidget-0.1.1.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for canvasxpress-anywidget 0.1.1
File Interpreter ABI Platform
canvasxpress_anywidget-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.3 kB

Release files / canvasxpress_anywidget-0.1.1.tar.gz

Download URL canvasxpress_anywidget-0.1.1.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
469e8e2d16af0e75455d998074dce4eb9ee8ea2038ca76010f2beda5bc059cf0
BLAKE2b-256 checksum
How to use checksums
af0c30c64fe175550f2dca523c394ce05413b150d1c6381132d0e466801fa1e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release files / canvasxpress_anywidget-0.1.1-py3-none-any.whl

Download URL canvasxpress_anywidget-0.1.1-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
931b8c3ae8d71cb8ec808705ac4b16d6f56f1d50fe225a61a2e695fe78adf14d
BLAKE2b-256 checksum
How to use checksums
8ac1054a06a1632e1b643ab62507e2cc64aebb62f7f537babfa03ba2712d3be9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release 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