hedron-charts
First-party charts, deterministic exports, and optional plotting-library adapters for Hedron.
Beginner LineChart / BarChart / AreaChart / ScatterChart, Matplotlib static
SVG/PNG, Plotly interactive JSON, and Altair/Vega-Lite specifications.
Package maturity: Stable · Package line: 1.0.x · requires
hedron-core>=1.0.0,<2.0
Interactive Plotly/Vega full browser runtimes remain experimental: Hedron
ships host shims that fail closed when window.Plotly / window.vegaEmbed are
missing. Applications may supply pinned local runtimes; first-party offline
runtime pins exist for Experimental interactive hosts and are not Supported
production Auto defaults.
Phase 0.38 first-party charts
Phase 0.38 ships hedron-charts 0.2.0 with schema-driven ChartSpec / ChartPlan, an
ABI-conforming hedron-chart Web Component, semantic server fallbacks, SVG by default, Canvas for
dense series, core inspect/focus/select/reset events, deterministic server exports, and bounded
payloads. The current host has dedicated paint behavior for line, area, bar, and point; broader
schema acceptance does not imply a specialized painter. Matplotlib remains Supported;
Plotly/Altair stay Experimental. See
RFC-0069
and the
phase 0.38 acceptance packet.
Install
# flagship extra:
pip install "hedron[charts]>=1.0.0"
# independent satellite:
pip install "hedron-charts>=1.0.0,<2.0"
# Add a backend when needed:
pip install "hedron-charts[matplotlib]>=1.0.0,<2.0"
For applications, keep the flagship extra on the 1.0.x train; direct package consumers may
use the Stable hedron-charts>=1.0.0,<2.0 SemVer range.
Optional backends
| Extra | Backend |
|---|---|
matplotlib |
Matplotlib static SVG/PNG |
plotly |
Plotly figure JSON |
altair |
Altair / Vega-Lite (+ vl-convert) |
pydeck / folium |
Map layers |
graphviz / networkx |
Graph layouts |
bokeh / holoviews / pygal / datashader / great_tables |
Additional adapters |
all |
Union of the above |
Backend extras are optional and should be installed only for the adapter in use.
Choose an entry point
| Need | Use | Runtime |
|---|---|---|
| A line, area, bar, or scatter chart from row mappings | LineChart, AreaChart, BarChart, ScatterChart |
First-party hedron-chart; useful server fallback without JavaScript |
| A validated declarative specification | Chart + ChartSpec |
First-party hedron-chart |
| A server-rendered Matplotlib figure | MatplotlibChart |
Static SVG or PNG; no browser plotting runtime |
| An existing Plotly or Altair figure | PlotlyChart / AltairChart |
Vendored browser runtime; Experimental explicit opt-in |
The beginner components do not select Matplotlib automatically. They compile to the first-party
ChartSpec / ChartPlan path.
Quick start
from hedron_charts import LineChart
chart = LineChart(
[{"month": "Jan", "revenue": 10}, {"month": "Feb", "revenue": 14}],
x="month",
y="revenue",
title="Monthly revenue",
description="Revenue increased during the period.",
)
The response contains a semantic figure, summary, and bounded table fallback. The local
hedron-chart module progressively enhances it to SVG or Canvas and remounts after HTMX swaps.
For an explicit Matplotlib figure:
import matplotlib.pyplot as plt
from hedron_charts import MatplotlibChart
fig, ax = plt.subplots()
ax.plot([1, 2, 3], [1, 4, 9])
chart = MatplotlibChart(fig, alt="y = x squared", description="Quadratic growth")
Advanced specification and export
from hedron_charts import Chart, compile_chart, export_csv, parse_chart_spec
spec = parse_chart_spec(
{
"data": {
"rows": [
{"month": "Jan", "revenue": 10},
{"month": "Feb", "revenue": 14},
]
},
"marks": [
{
"type": "line",
"encodings": {
"x": {"field": "month", "type": "string"},
"y": {"field": "revenue", "type": "number"},
},
}
],
"accessibility": {
"title": "Monthly revenue",
"description": "Revenue increased from January to February.",
},
}
)
chart = Chart(spec)
plan = compile_chart(spec)
csv_text = export_csv(plan, authorized=user_can_export)
Unknown schema fields, mark types, encoding channels, scales, and transform operators fail closed
with HED-CHART-* diagnostics. Perform export authorization in application code; the default
authorized=True argument is intended for already-authorized internal calls.
The compiler also accepts advanced mark families, guide metadata, and interaction flags that the
0.2.0 browser host does not yet paint or operate with dedicated behavior. Review the
runtime coverage matrix
before choosing the first-party host for advanced visualizations.
Links
- Package docs
- Chart API
- Chart components
- Charts and HTMX
- What’s ready
- Changelog
- Source
- Issues
hedron-core·hedron
License
MIT. See the repository license.
Release files for hedron-charts 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hedron_charts-1.0.3.tar.gz | 2.9 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hedron_charts-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.9 MB
Release files / hedron_charts-1.0.3.tar.gz
| Download URL | hedron_charts-1.0.3.tar.gz |
|---|---|
| Size | 2.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
47abda711e356f378deb8147d1dc278d8670845fb647ed86899868cc8d081325
|
|
BLAKE2b-256 checksum How to use checksums |
19244979c3a3352f5f12f7d3c37114ac7649c4a216df04c2f82081d92e5db892
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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}
|
Release files / hedron_charts-1.0.3-py3-none-any.whl
| Download URL | hedron_charts-1.0.3-py3-none-any.whl |
|---|---|
| Size | 2.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4f5a48b82e3664875844c3e9d178c0c644a8a888ea669e85e32cb4a08107db59
|
|
BLAKE2b-256 checksum How to use checksums |
6d0764bfacad10b91ec60bb52bfb0f90a2f68e92209fad5fe27af3911276823f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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}
|