-
Notifications
You must be signed in to change notification settings - Fork 608
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
Different structure for TopLevelRepeatSpec since v4.9 #7775
Comments
I'm no TypeScript user, but this line looks like to make it an export type RepeatSpec = NonLayerRepeatSpec | LayerRepeatSpec; Not sure if this is really necessary this way. It would be great if not. Altair context: import altair as alt
from vega_datasets import data
df = data.population_engineers_hurricanes()
chart = alt.Chart(df[0:20]).mark_bar().encode(
alt.Y('state:N'),
alt.X(alt.repeat('column'), type='quantitative'),
alt.Color('count()')
).properties(
width=50,
height=200
).repeat(
column=['population', 'engineers', 'hurricanes']
).resolve_scale(color='independent')
chart
When the Manually setting, will work though:
|
Thank you @mattijn for posting that link to the relevant portion of the typescript file; it helped me better understand the structure of TopLevelRepeatSpec. For whatever it's worth, I'm confident that a suitable work-around can eventually be found in the Altair side. (There is a workaround currently in what's written, but it's not a longterm solution.) I used to think there was a bug somewhere on the Vega-Lite side, but I'm no longer convinced of that. There is an inconsistency somewhere between the TopLevelRepeatSpec definition and what Altair expects, but I haven't been able to understand why this definition in particular is causing problems. (I see how TopLevelRepeatSpec is different from the other TopLevel... objects, but not how it's different from the other 400-ish definitions.) Anyway I just wanted to post something, because I think this issue was raised for my benefit. I will post an update if I get my issues resolved. Thanks! |
Sorry for the noise here; closing |
While reviewing https://github.com/ChristopherDavisUCI/altair/pull/1/files#diff-26bb768d345282c152ff21c1581804be0e84fdfaba9e8f530600d9ff068bd7d8L609 I thought one should not overrule the Vega-Lite schema, but upon closer inspection I cannot see why the
TopLevelRepeatSpec
follows a different structure since vega-lite 4.9 onwards?Observe:
Excluding
TopLevelSpec
, all otherTopLevel*Spec
's keep respecting the['additionalProperties', 'properties', 'required', 'type']
structure:The text was updated successfully, but these errors were encountered: