-
Notifications
You must be signed in to change notification settings - Fork 612
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
fix: remove incorrect stack transform from charts with one linear Q-axis one non-linear Q-axis. #8871
Merged
Merged
fix: remove incorrect stack transform from charts with one linear Q-axis one non-linear Q-axis. #8871
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
895a853
doc(examples): add problematic example
kanitw 50088fd
chore: update examples [CI]
0de5218
fix: don't apply stack for QxQ charts with non-linear scales
kanitw 7bf5975
chore: update examples [CI]
e1528f3
fix: don't show can't stack warning if stack is not explicitly defined
kanitw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
{ | ||
"$schema": "https://vega.github.io/schema/vega/v5.json", | ||
"background": "white", | ||
"padding": 5, | ||
"width": 200, | ||
"height": 200, | ||
"style": "cell", | ||
"data": [ | ||
{ | ||
"name": "source_0", | ||
"values": [ | ||
{"a": 3000, "b": 55}, | ||
{"a": 3500, "b": 28}, | ||
{"a": 4000, "b": 55} | ||
] | ||
}, | ||
{ | ||
"name": "data_0", | ||
"source": "source_0", | ||
"transform": [ | ||
{ | ||
"type": "filter", | ||
"expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" | ||
} | ||
] | ||
} | ||
], | ||
"marks": [ | ||
{ | ||
"name": "marks", | ||
"type": "rect", | ||
"style": ["bar"], | ||
"from": {"data": "data_0"}, | ||
"encode": { | ||
"update": { | ||
"fill": {"value": "#4c78a8"}, | ||
"ariaRoleDescription": {"value": "bar"}, | ||
"description": { | ||
"signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" | ||
}, | ||
"xc": {"scale": "x", "field": "a"}, | ||
"width": {"value": 5}, | ||
"y": {"scale": "y", "field": "b"}, | ||
"y2": {"scale": "y", "value": 0} | ||
} | ||
} | ||
} | ||
], | ||
"scales": [ | ||
{ | ||
"name": "x", | ||
"type": "linear", | ||
"domain": {"data": "data_0", "field": "a"}, | ||
"range": [0, {"signal": "width"}], | ||
"nice": true, | ||
"zero": false, | ||
"padding": 5 | ||
}, | ||
{ | ||
"name": "y", | ||
"type": "pow", | ||
"domain": {"data": "data_0", "field": "b"}, | ||
"range": [{"signal": "height"}, 0], | ||
"nice": true, | ||
"zero": true | ||
} | ||
], | ||
"axes": [ | ||
{ | ||
"scale": "x", | ||
"orient": "bottom", | ||
"gridScale": "y", | ||
"grid": true, | ||
"tickCount": {"signal": "ceil(width/40)"}, | ||
"domain": false, | ||
"labels": false, | ||
"aria": false, | ||
"maxExtent": 0, | ||
"minExtent": 0, | ||
"ticks": false, | ||
"zindex": 0 | ||
}, | ||
{ | ||
"scale": "y", | ||
"orient": "left", | ||
"gridScale": "x", | ||
"grid": true, | ||
"tickCount": {"signal": "ceil(height/40)"}, | ||
"domain": false, | ||
"labels": false, | ||
"aria": false, | ||
"maxExtent": 0, | ||
"minExtent": 0, | ||
"ticks": false, | ||
"zindex": 0 | ||
}, | ||
{ | ||
"scale": "x", | ||
"orient": "bottom", | ||
"grid": false, | ||
"title": "a", | ||
"labelFlush": true, | ||
"labelOverlap": true, | ||
"tickCount": {"signal": "ceil(width/40)"}, | ||
"zindex": 0 | ||
}, | ||
{ | ||
"scale": "y", | ||
"orient": "left", | ||
"grid": false, | ||
"title": "b", | ||
"labelOverlap": true, | ||
"tickCount": {"signal": "ceil(height/40)"}, | ||
"zindex": 0 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"$schema": "https://vega.github.io/schema/vega-lite/v5.json", | ||
"data": { | ||
"values": [ | ||
{"a": 3000, "b": 55}, | ||
{"a": 3500, "b": 28}, | ||
{"a": 4000, "b": 55} | ||
] | ||
}, | ||
"mark": "bar", | ||
"encoding": { | ||
"x": {"field": "a", "type": "quantitative"}, | ||
"y": {"field": "b", "type": "quantitative", "scale": {"type": "pow"}} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic was just wrong. Instead, we should rely on the orient logic below.