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
Dual-licensed. The core library is LGPL-3.0-or-later; commercial terms are available — see
https://canvasxpress.org/license.html.
Metadata
Release files for canvasxpress-anywidget 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| canvasxpress_anywidget-0.1.0.tar.gz | 3.8 kB | Without provenance | Details for canvasxpress_anywidget-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| canvasxpress_anywidget-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for canvasxpress_anywidget-0.1.0-py3-none-any.whl |
Total release size: 8.5 kB
Release files / canvasxpress_anywidget-0.1.0.tar.gz
| Download URL | canvasxpress_anywidget-0.1.0.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
35f363af598b94e8dcba204d518e52a8f948549f303d91622157655d87231fe4
|
|
BLAKE2b-256 checksum How to use checksums |
0713a25db8d5333c1756fd8ec67f023a83cfda98b5149ec441bd12f7b80e0ee5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / canvasxpress_anywidget-0.1.0-py3-none-any.whl
| Download URL | canvasxpress_anywidget-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
29be48b69c67f5c2f8ec2455e9ac1b11fe945bd1109aeb1e742ad7721aff3910
|
|
BLAKE2b-256 checksum How to use checksums |
a58198f96dc7e4d29ade40e707bc8d27e03c19b6111086ff16588352f69c232f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Security for canvasxpress-anywidget 0.1.0
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.