-
Notifications
You must be signed in to change notification settings - Fork 592
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
Merge parse and identical transforms at forks + allow sorting x/y-scale for layered plots #2177
Comments
|
|
In #2964 the two nodes are actually equivalent. We should definitely handle that case as it is trivial. |
Given that there a few issues dealing with sorting in layered plots, some of them closed, I am bit confused regarding the status: is sorting x/y scale for layered plots work in progress ? |
@g3o2 I think it's working. Do you have an example where it doesn't work? |
@domoritz maybe I'm doing something wrong ... {
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"description": "A simple bar chart with embedded data.",
"data": {
"values": [
{"a": "A","b": 28},
{"a": "B","b": 55},
{"a": "C","b": 43}
]
},
"layer": [{
"mark": "bar",
"encoding": {
"y": {
"field": "a", "type": "ordinal",
"sort": {"field": "b", "op": "mean", "order": "descending" }
},
"x": {"field": "b", "type": "quantitative"}
}
}, {
"mark": {
"type": "text",
"align": "left",
"baseline": "middle",
"dx": 3
},
"encoding": {
"y": {
"field": "a", "type": "ordinal",
"sort": {"field": "b", "op": "mean", "order": "descending" }
},
"x": {"field": "b", "type": "quantitative"},
"text": {"field": "b", "type": "quantitative"}
}
}]
} |
@g3o2 As noted in #2964 (comment), it is not possible to union a scale domain with an aggregation other than count. However, in your case the data is coming from the same domain so the easy fix is to just use the one. However, layer creates a forked dataflow and we are currently not merging common subtrees (that's what this issue is about) and so Vega-Lite has no way of knowing that the two domains are actually the same (one may be filtered or otherwise transformed). You can sort with count aggregation or some other sort order but the spec above doesn't work yet. The fix will come! |
@domoritz thank you for clarifying! |
#3797 also needs this. |
This is mostly addressed in #3959 except for merging identical transforms at forks |
@kanitw we're still seeing this issue when layering charts (in Altair 5.2.0) with |
Started in https://github.com/vega/vega-lite/tree/dom/parse-merge but it's still not correct.
The text was updated successfully, but these errors were encountered: