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.2.tar.gz (107.3 kB view details)

Uploaded Source

Built Distributions

avenger-0.0.2-cp38-abi3-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.8+ Windows x86-64

avenger-0.0.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB view details)

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

avenger-0.0.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.7 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARM64

avenger-0.0.2-cp38-abi3-macosx_11_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

avenger-0.0.2-cp38-abi3-macosx_10_12_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: avenger-0.0.2.tar.gz
  • Upload date:
  • Size: 107.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for avenger-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d344d8cbd83200737ccbff934f868bdd17659f9bb3163e690e6143058dc4d8ca
MD5 6d182f1e64fe3331f37fc9d07e831a33
BLAKE2b-256 b27edcbe0ab0d6408858d14f6fa043303697ef8f017df10ce5c3aea710c551ed

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for avenger-0.0.2-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ecf85d1f1ca24024c859e4ea52d9f7f2de7003ae93f75556b33fb8f77f4a4f6a
MD5 e424e69a2c18e38a64702fe0b0115670
BLAKE2b-256 c6e44a5155e9300dfe6754f3238fb4e42f8e152db4d54d4cef0f0a37277aa21b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for avenger-0.0.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f9d97ebfd0891be2a2f29339a57ee99bcaec3912adba4e183b4396aee147dccf
MD5 e064070a22b0b1382f15c6da941a62c3
BLAKE2b-256 64609894e9390ee4cc2846b2bdb36b7ad0a0008e785af565beaccce0b4190aa8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for avenger-0.0.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8c4d61fdaf6217c4e08f4764b4b322457251eb976bb25f8d41de120898aefde9
MD5 a35b9e8ab78a58ccd3faa2b2fe93d8be
BLAKE2b-256 8c166c2600a1133fce4fd3200458c7438df613f0e8411be6e6943dfdf010199b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for avenger-0.0.2-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cff40cfb4dc48ab0b7f03997bb625d4916d12f08251d7044b7ac61ed5e92eeb7
MD5 281a9a4f2d245860c05b20eb3fe23dce
BLAKE2b-256 eb0f9ffa46f810cd0c1474db8368ac5b048692b8ef71d458d4264f6aa9c1c171

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for avenger-0.0.2-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 445793ab302bd26caecc390857be3f09c4d005df863fcea44bad15be409e0607
MD5 ccb7385a0c3b7b28b427447fe3a4a579
BLAKE2b-256 b5f339c0c572ff15fdf1613cb3e35659f3be02c6e0be030a0f7f8840d6073ab8

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