Skip to main content

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

cars_scatter

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:

isotype_emoji

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

avenger-0.0.7.tar.gz (115.7 kB view details)

Uploaded Source

Built Distributions

avenger-0.0.7-cp38-abi3-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.8+ Windows x86-64

avenger-0.0.7-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

avenger-0.0.7-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.0 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARM64

avenger-0.0.7-cp38-abi3-macosx_11_0_arm64.whl (3.4 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

avenger-0.0.7-cp38-abi3-macosx_10_12_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

File details

Details for the file avenger-0.0.7.tar.gz.

File metadata

  • Download URL: avenger-0.0.7.tar.gz
  • Upload date:
  • Size: 115.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for avenger-0.0.7.tar.gz
Algorithm Hash digest
SHA256 a78eaaebf9253a7918f7157834a4bc099aa001aa69dc778d5fa8b515189d1786
MD5 09e8c2b8c14a9bba231e5ba10f8e5eb8
BLAKE2b-256 2e0cac723158de7028244160fab1460870590ace5581f9b8b24f0761ae6276dc

See more details on using hashes here.

File details

Details for the file avenger-0.0.7-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: avenger-0.0.7-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 4.6 MB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for avenger-0.0.7-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 666ae354b6104a7b701b7cb73764d14c2b0256f706c638ea02e38ffc2ab05fb3
MD5 ad58dc93a421d789091559cb97920411
BLAKE2b-256 8dc62c2bec3f96f22cee8c1ac91cbb35b8045c900bda0f00ae3fa8256a536b38

See more details on using hashes here.

File details

Details for the file avenger-0.0.7-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for avenger-0.0.7-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c0383a8a1b4efbd8fc52ebadda39df18ccbcc0534ab0bbb0d6afc3ca28b5bf12
MD5 ca3e104af914795ce7e8900f590db53a
BLAKE2b-256 fc086b34d513953425361e735500d8869511838310b802e8a02debe89fdf907c

See more details on using hashes here.

File details

Details for the file avenger-0.0.7-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for avenger-0.0.7-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3df3c0b1a75605ab4be3227c32bb5e396742a4ea41f064995f617e2e656e434b
MD5 086bb1154b37249beea00493d802381c
BLAKE2b-256 34a44bcf20262a521012bee39a69a62b1ccc6609140d314312454158d84a36c1

See more details on using hashes here.

File details

Details for the file avenger-0.0.7-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for avenger-0.0.7-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 41c6638bbd8e29fd0112af4d552945b0f3bb010416a0c5bf6452290fd19f66f8
MD5 db9bfb13ba748ca96d9f140d35d34974
BLAKE2b-256 58035c17d7ea977331e0bdffe814dc6e1ddacbde3f26e7c0ea3b456b23697476

See more details on using hashes here.

File details

Details for the file avenger-0.0.7-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for avenger-0.0.7-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 525230c254caf8a973961a8b31c0a35c6d4e6ca8d5ed6967028dd67c96714e7e
MD5 eb0a422b99bfa9d590e18bba1f8f43d3
BLAKE2b-256 5d297be5b9a9431ae8d42ffebbb7b0b4ae00bdc0c1006477b21ca6196729bf79

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page