Skip to main content

Altair plugin for H2O Nitro

This plugin lets you use Altair visualizations in Nitro apps.

Demo

View source.

Demo

Install

pip install h2o-nitro-altair

Usage

  1. Import altair_plugin and altair_box from h2o_nitro_altair.
  2. Add altair_plugin() to your Nitro app.
  3. Use altair_box(chart) to render Altair charts.
import altair as alt
from vega_datasets import data

from h2o_nitro import View, web_directory
from h2o_nitro_altair import altair_plugin, altair_box


def main(view: View):
    view(altair_box(make_plot()))


nitro = View(
    main,
    title='Nitro + Altair',
    caption='A minimal example',
    plugins=[altair_plugin()],  # Include the Altair plugin
)

def make_plot():
  return alt.Chart(data.cars()).mark_point().encode(
      x='Horsepower',
      y='Miles_per_Gallon',
      color='Origin',
  ).interactive()

Advanced Usage

You can pass Vega Embed Options to altair_box() for more control.

Example:

altair_box(chart, options=dict(renderer='svg', scaleFactor=2))

Metadata

Release files for h2o-nitro-altair 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for h2o-nitro-altair 0.1.1
File Interpreter ABI Platform
h2o_nitro_altair-0.1.1-py3-none-any.whl Python 3 none any Details

Release files / h2o_nitro_altair-0.1.1-py3-none-any.whl

Download URL h2o_nitro_altair-0.1.1-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d5c3c0dbee68cb08659f27946eb60b4acb45b989c4de716e930038754198559e
BLAKE2b-256 checksum
How to use checksums
7cc88bec2bfb36096f5bf432ce0e3f8915976fbc016fc53bf02f0a73596be828
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page