Avenger: A visualization engine and renderer
Avenger is an early stage prototype of a new foundational rendering library for information visualization (InfoVis) systems. Avenger defines a 2D scenegraph representation tailored to the needs of InfoVis systems. To start with, the initial application of Avenger is to serve as an alternative, GPU accelerated, rendering backend for Vega visualizations.
Try it out in Python with Vega-Altair
The avenger Python package provides a custom Altair renderer named avenger-png. This renderer relies on vl-convert to extract the vega scenegraph corresponding to a chart and then uses Avenger to render the chart to a static PNG image.
First, install altair, vega-datasets, avenger, and vl-convert-python
pip install -U altair vega_datasets avenger "vl-convert-python>=1.2.3"
Then import Altair and activate the avenger-png renderer
import altair as alt
alt.renderers.enable('avenger-png', scale=1)
Then create and display an Altair chart as usual:
import altair as alt
from vega_datasets import data
source = data.cars()
chart = alt.Chart(source).mark_circle(size=60).encode(
x='Horsepower',
y='Miles_per_Gallon',
color='Origin',
)
chart
Or, convert the chart to a PNG rendered by Avenger:
import avenger
png = avenger.altair_utils.chart_to_png(chart, scale=1)
with open("scatter.png", "wb") as f:
f.write(png)
Comparison to vl-convert
There aren't currently many advantages to using Avenger to render Altar charts to PNG as compared with vl-convert, which performs rendering using resvg. Performance is generally comparable, though Avenger can be a bit faster for charts with a large number of symbol instances.
One advantage is that Avenger's text rendering support is based on COSMIC Text, which supports emoji (unlike resvg's text handling). For example, here is the result of rendering the emoji example from https://altair-viz.github.io/gallery/isotype_emoji.html using Avenger:
Release files for avenger 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| avenger-0.0.8.tar.gz | 115.8 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| avenger-0.0.8-cp38-abi3-win_amd64.whl | CPython 3.8 | abi3 | Windows x86-64 | Details |
| avenger-0.0.8-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| avenger-0.0.8-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| avenger-0.0.8-cp38-abi3-macosx_11_0_arm64.whl | CPython 3.8 | abi3 | macOS 11.0+ ARM64 | Details |
| avenger-0.0.8-cp38-abi3-macosx_10_12_x86_64.whl | CPython 3.8 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 23.2 MB
Release files / avenger-0.0.8.tar.gz
| Download URL | avenger-0.0.8.tar.gz |
|---|---|
| Size | 115.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3e5805cacf75a280815c4842b65e9ed28b401e7a53f0e908158ebbda2ef9957d
|
|
BLAKE2b-256 checksum How to use checksums |
e2c35902924a49e3deea62c8bf83590d88a1512dcacf14d2c74e6c180fb41620
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / avenger-0.0.8-cp38-abi3-win_amd64.whl
| Download URL | avenger-0.0.8-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 4.8 MB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
fef62afd4da4e5c9d3ab34bee8ea0199ccb63e09fd1fe289226166e71746df26
|
|
BLAKE2b-256 checksum How to use checksums |
75ba15c3ac8daeca437d47d2b52bae46b5e0aafc43f3af569db9c77bcc833f74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / avenger-0.0.8-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | avenger-0.0.8-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.7 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
6b6ee9d33601d98983bfa112a902d0fb9419459be2a081fe09c8e676092e5707
|
|
BLAKE2b-256 checksum How to use checksums |
7ca5aad8dbcf2335e27b033053a70d919c3b96164f1c0a86110a8b7590eb568b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / avenger-0.0.8-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | avenger-0.0.8-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 6.3 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
11159033034fdb0043269eb715dfdd17834749b74dcd1980379b0d62f44abe50
|
|
BLAKE2b-256 checksum How to use checksums |
f38810116c87d5fceec54947691ee1f3873f0bf6e33122a3c54911e291f2aab6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / avenger-0.0.8-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | avenger-0.0.8-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.5 MB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d23825b35f8e8ac951872d41d2d7ab37e30ee5fae40c785a22cf1a035e2e0712
|
|
BLAKE2b-256 checksum How to use checksums |
fdb929df4f8b2ac8ff3c92ab69b48bf4302f9e39f9f7d927efd92e5da9e28e6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / avenger-0.0.8-cp38-abi3-macosx_10_12_x86_64.whl
| Download URL | avenger-0.0.8-cp38-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 3.7 MB |
| Tags | CPython 3.8 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
f9357bd729fc802720079e1334373192262df3af48cd4f0ee663f231d0596f32
|
|
BLAKE2b-256 checksum How to use checksums |
b64b86d6211f012eb1fd8b26d4348061b2d285a2d41aff90bc196a3f157588cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|