-
Notifications
You must be signed in to change notification settings - Fork 796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error persists when trying to concat facetted charts although it is fixed in VegaLite #2742
Comments
Hi @joelostblom, Yes, I can confirm that I get the same JavaScript error (and that the produced json does work in the Vega editor. (Also, the |
vega/vega-lite#7639 was "officially" released in VL5.4 (but first appeared in VL5.3-next-4). Altair schema validation & rendering still uses VL5.2 (since altair_viewer is still on VL5.2). But since the schema validation with VL5.2 works with Altair it can be rendered succefully with vl-convert using VL5.3 (and higher, currently only up to VL5.5, not VL5.6): import altair as alt
import pandas as pd
import vl_convert as vlc
from IPython import display
df = pd.DataFrame({
'type': ['coke', 'coke', 'coke', 'pepsi', 'pepsi', 'pepsi'],
'taste':[90,75,95,85,80,75],
'sugar':[2,5,1,2,5,1],
})
plot_a = alt.Chart(df).mark_point().encode(
x = 'sugar',
y = 'taste',
).facet('type')
vl_spec = (plot_a & plot_a).to_json()
png = vlc.vegalite_to_png(vl_spec, vl_version='v5.3')
display.display(display.Image(data=png)) Proof that rendering with VL version png = vlc.vegalite_to_png(vl_spec, vl_version='v5.2') ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Input In [65], in <cell line: 1>()
----> 1 png = vlc.vegalite_to_png(vl_spec, vl_version='v5.2')
ValueError: Vega to SVG conversion failed:
Error: Undefined data set name: "scale_concat_1_child_main" Question is, why it works in the Vega-Editor. It seems that the Vega-Editor validates uses VL5.2 but renders with a higher version? Not the latest either, since features from VL5.6 won't render correctly (axis still go to zero). I cannot understand anymore what did release at which moment with all these autogenerated next-releases at the VL-repo. Good you opened this: vega/vega-lite#8522. |
Thank you for that thorough investigation! The fact that the vega editor is labeled as version 5.2 but allows for some functionality from later releases to work is indeed confusing. Maybe I'll open an issue there about that too. |
Here is the response I got in vega/vega-lite#8581
|
I ran into this today and confirming that with the upgrade to VL 5.6 in #2871 this indeed works now. |
When I try to concatenate facetted charts with the latest Altair version from master, I am still seeing
Javascript Error: Undefined data set name: "scale_concat_1_child_main"
although this was fixed in vega/vega-lite#7639. Exporting the spec to json and pasting it in the Vega editor also seems to work fine although the VegaLite version is 5.2.0 in both cases Open the Chart in the Vega Editor@ChristopherDavisUCI Are you seeing this as well?
Example spec:
The text was updated successfully, but these errors were encountered: