-
Notifications
You must be signed in to change notification settings - Fork 607
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
docs(examples): Add example showing how to set the zorder via a conditional order encoding #9136
Conversation
}, | ||
"order": { | ||
"value": 0, | ||
"condition": {"param": "param_122", "value": 1, "empty": false} |
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.
For consisistency with size and to make it reads like if-then-else, better put condition
above value
.
@@ -413,7 +413,7 @@ The key channel can enable object constancy for transitions over dynamic data. W | |||
|
|||
## Order Channel | |||
|
|||
`order` channel can define a data field (or a ordered list of data fields) that are used to sorts stacking order for stacked charts (see [an example in the `stack` page](stack.html#order)) and the order of data points in line marks for connected scatterplots (see [an example in the `line` page](line.html#connected-scatter-plot)). | |||
`order` channel can define a data field (or a ordered list of data fields) that are used to sorts stacking order for stacked charts (see [an example in the `stack` page](stack.html#order)), the order of data points in line marks for connected scatterplots (see [an example in the `line` page](line.html#connected-scatter-plot)), and which data points are plotted on top in a chart (the "zorder", see [an example in the gallery]({{ site.baseurl }}/examples/selection_type_point_zorder.html)). |
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.
(the "zorder", see [an example in the gallery]({{ site.baseurl }}/examples/selection_type_point_zorder.html)) --> I think this URL probably doesn't work unless you add it to examples.json
.
I think you can add this example to the end of the following block in examples.json
. :)
"Interactive": {
"Interactive Charts": [
Thanks for adding the example! :) |
Thanks for the quick review @kanitw ! I believe I have addressed your comment in my last couple of commits, so please have another look. |
This adds an example of how to make a point appear on top when it is hovered over, instead of it being covered by other points based on the initial plotting order. This was discussed in #4864 and #1684, but I couldn't find an example that demonstrates this behavior. I would presume that setting the zorder like this is more performant than having a second layer that responds to a filter transform linked to to the selection, which is what I have used myself in the past.
Open the Chart in the Vega Editor