altair-viz / altair-transform

Evaluation of Vega-Lite transforms in Python
MIT License
70 stars 8 forks source link

mark_errorbar silently fails #43

Open ValdarT opened 4 years ago

ValdarT commented 4 years ago
import pandas as pd
import altair as alt
from altair_transform import transform_chart

df = pd.read_json('https://vega.github.io/vega-datasets/data/iris.json')

error_bars = alt.Chart(df).mark_errorbar(extent='ci').encode(
  x=alt.X('petalLength:Q', scale=alt.Scale(zero=False)),
  y=alt.Y('species:N')
)

transform_chart(error_bars)

The transformation does not take place but NotImplementedError is also not raised (which would be expected based on the Limitations section in the README).

ValdarT commented 4 years ago

A general comment: I'd really like this and concatenated charts to be supported so that it would be easy to create charts like this on larger datasets with Altair: https://altair-viz.github.io/gallery/errorbars_with_ci.html

jakevdp commented 4 years ago

Thanks – your chart contains no direct data transforms, so the code lets it pass through unmodified. There are transforms implied by mark_errorbar, but altair-transform does not yet recognize those.

Concatenated charts have not yet been implemented, because nobody has yet chosen to contribute that.

If you would like to contribute either of these features, please feel welcome, and let me know if you have questions about how to proceed.