A Visualization Engine and Renderer
Project description
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:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for avenger-0.0.8-cp38-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fef62afd4da4e5c9d3ab34bee8ea0199ccb63e09fd1fe289226166e71746df26 |
|
MD5 | d97f1b60c485d0aa6fe53ed331692e87 |
|
BLAKE2b-256 | 75ba15c3ac8daeca437d47d2b52bae46b5e0aafc43f3af569db9c77bcc833f74 |
Hashes for avenger-0.0.8-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b6ee9d33601d98983bfa112a902d0fb9419459be2a081fe09c8e676092e5707 |
|
MD5 | 6c5786ac6f9000d85e89df912949c866 |
|
BLAKE2b-256 | 7ca5aad8dbcf2335e27b033053a70d919c3b96164f1c0a86110a8b7590eb568b |
Hashes for avenger-0.0.8-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11159033034fdb0043269eb715dfdd17834749b74dcd1980379b0d62f44abe50 |
|
MD5 | 33beba747b67664d186d8005c3886611 |
|
BLAKE2b-256 | f38810116c87d5fceec54947691ee1f3873f0bf6e33122a3c54911e291f2aab6 |
Hashes for avenger-0.0.8-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d23825b35f8e8ac951872d41d2d7ab37e30ee5fae40c785a22cf1a035e2e0712 |
|
MD5 | 34eb521efdaac8dfa9201a2d79947661 |
|
BLAKE2b-256 | fdb929df4f8b2ac8ff3c92ab69b48bf4302f9e39f9f7d927efd92e5da9e28e6f |
Hashes for avenger-0.0.8-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9357bd729fc802720079e1334373192262df3af48cd4f0ee663f231d0596f32 |
|
MD5 | 9ba599c6386ea55826f1f39e10efd22d |
|
BLAKE2b-256 | b64b86d6211f012eb1fd8b26d4348061b2d285a2d41aff90bc196a3f157588cd |