chart_spec = py`# start with a fake dependency on the libraries being installed:
# ${deps_installed}
# now the basic altair example:
import altair as alt
from vega_datasets import data
cars = data.cars.url
chart = alt.Chart(cars).mark_point().encode(
x='Horsepower:Q',
y='Miles_per_Gallon:Q',
color='Origin:N',
).interactive()
# this outputs Map, not Object:
# chart.to_dict()
# which, we could probably correct for directly
# for now, we'll take the hit of encoding and recoding it to JSON:
chart.to_json()`