Skip to main content

canvasxpress-magic

A %%cxplot IPython / Jupyter magic for CanvasXpress — render an interactive chart straight from a notebook cell, no HTML or JavaScript. Works in Jupyter, JupyterLab and VS Code notebooks; the chart is a self-contained iframe that loads CanvasXpress from the CDN, so there is nothing to build.

Install

pip install canvasxpress-magic

Use

%load_ext canvasxpress_magic

Cell magic — the cell body is a JSON {"data", "config"} spec:

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

Line magic — render a spec held in a Python variable:

spec = {"data": {...}, "config": {"graphType": "Line"}}
%cxplot spec

Both accept sizing flags:

%%cxplot --width 800 --height 500
{ ... }

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

License

Dual-licensed. The core library is LGPL-3.0-or-later; commercial terms are available — see https://canvasxpress.org/license.html.

Download files

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

Source Distribution

canvasxpress_magic-0.1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

canvasxpress_magic-0.1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: canvasxpress_magic-0.1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for canvasxpress_magic-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f1c66f029f704dbebba10328d5ad0c0b44649230bd3ccff8bcd9f081cfbb0960
MD5 bf68acd897dd4d71a72199b730903c7f
BLAKE2b-256 fdbb0f592fb42b7df6d45ab6833d3f5e870c2bc2b0ed7c9412266c2e09f860ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for canvasxpress_magic-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6089f2dbcabc85a0d708c6980fe7fca7da3b75559507bf46805400d9742be23
MD5 78c190430a9dbb92052bac2775efd0c6
BLAKE2b-256 66ad6b98ffdc862e9acc5ee710d5ab73ddbda8ec31d163f3376b8399b2145442

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