Vega-Altair Charts Integration

Vega-Altair Charts Integration#

PyBloqs also supports altair visualization. Vega-Altair is a Vega-Altair is a declarative visualisation library with a simple, friendly and consistent API, built on top of the powerful Vega-Lite grammar. You can find its user guide here

Similarly to the other interactive plots, this will be rendered in HTML and will rely on your browser’s CSS and JS capabilities to provide interactivity.

import numpy as np
import pandas as pd

x = np.random.uniform(-3, 3, size=40)
y = np.sin(x)
data = pd.DataFrame({"x": x, "y": y})
import altair as alt
from pybloqs.block.altair import VegaAltairBlock

chart = alt.Chart(data).mark_point().encode(x="x", y="y")

VegaAltairBlock(chart, title="Sine Wave")

Sine Wave