-
Notifications
You must be signed in to change notification settings - Fork 623
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
Vega-Lite 4.1.1: some layered specs are invalid #5854
Comments
Digging-in a bit more: the common feature in every failure is that they specify a width or height within a layer. Here's a minimal failure case: import jsonschema
import json
import urllib.request
with urllib.request.urlopen('https://vega.github.io/schema/vega-lite/v4.1.1.json') as f:
schema = json.load(f)
spec = {
"data": {"values": []},
"layer": [
{"mark": "point", "width": 100}
]
}
jsonschema.validate(spec, schema) Removing |
This was actually intentional, because the layers do share width and thus specifying width inside means that the width could be conflicting. That being said, I'm happy to revert if you disagree. |
I see, that makes sense. This is a fairly large-impact API breakage on Altair's side, though it may be that we could handle it with some changes on the Python side. For example, we could change the layering code such that when a user passes a chart with a What do you think? |
That makes sense. I'm happy to figure a different way to fix to avoid major breaking changes on the Altair side. |
OK, I'll give that a shot tonight and see if it works. |
Were there any other changes to allowed entries in unit specs? |
Just This was the PR for this change: #5797. |
It's probably best to revert and show a warning if users specify conflicting properties. We could change what we allow at the unit spec level in the next major version. |
Just to be clear, will this be reverted, or should I start adapting Altair with this behavior in mind? Altair is now 2 releases behind Vega-Lite because of this bug. |
I'll revert it right now. We are making another release this week. |
Fixed in #5891 |
Thanks! |
Sure, you're welcome :) |
Several dozen of Altair's examples are invalid under the Vega-Lite 4.1.1 schema; the common feature seems to be that they contain layered specs. An example is the Bar and Tick Chart (view in vega editor).
Here is how I checked the validity under the schema; it results in a validation error under the v4.1.1 schema, but is fine under the v4.0.2 schema.
Full Traceback
The text was updated successfully, but these errors were encountered: