Altair plugin for H2O Nitro
Project description
Altair plugin for H2O Nitro
This plugin lets you use Altair visualizations in Nitro apps.
Demo
Install
pip install h2o-nitro-altair
Usage
- Import
altair_plugin
andaltair_box
fromh2o_nitro_altair
. - Add
altair_plugin()
to your Nitro app. - 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))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for h2o_nitro_altair-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f321dac3f25700a6c20a5146f4c7157d1945c9095652162bc4b3940c6a9e7b4f |
|
MD5 | 799e4c0a92859170df585f9504f491a4 |
|
BLAKE2b-256 | 468127e063e8a4c8ceebf4ba357d060fb83f8c423f3188e2b59380b0b1dbe564 |