-
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
add new channel opacity #1336
add new channel opacity #1336
Conversation
It is ready for review |
@YuhanLu
|
Fix it. Now value works too. |
Can you add test and example for all these cases?
|
@@ -44,6 +45,7 @@ Mark properties channels map data fields directly to visual properties of the ma | |||
| :------------ |:-------------:| :------------- | | |||
| x, y | [ChannelDef](#def)| X and Y coordinates for `point`, `circle`, `square`, `line`, `text`, and `tick`. (or to width and height for `bar` and `area` marks). | | |||
| color | [ChannelDef](#def)| Color of the marks – either fill or stroke color based on mark type. (By default, fill color for `area`, `bar`, `tick`, `text`, `circle`, and `square` / stroke color for `line` and `point`.) (See [scale range](scale.html#range) for more detail about color palettes.) | | |||
| opacity | [ChannelDef](#def)| Opacity of the marks – either can be a value or in a range. (By default, range of opacity is `[0.3, 0.8]`.) | |
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.
Inconsistent default value style.
Fix docs. Tests and examples are added. |
} | ||
}, | ||
"config": { | ||
"mark": {"opacity": 0.6, "stacked" : "none"} |
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 file is not a stacked bar. Please correct the name.
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.
Maybe bar_layered_opacity
?
Please also update the description about to mention "fix #" |
… into zl/channel-opacity2
Renamed examples |
"mark": "bar", | ||
"config": { |
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 config is unused.
Just fix those examples (again). |
"type": "quantitative", | ||
"aggregate": "count" | ||
}, | ||
"color": { |
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.
why do you need to add color in this example, seems like a distraction.
@@ -0,0 +1,16 @@ | |||
{ | |||
"data": {"url": "data/unemployment-across-industries.json"}, |
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 file is too large, taking a while to load.
Fixed |
@@ -0,0 +1,9 @@ | |||
{ |
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.
why do we need two of these?
why not just one scatter_opacity
example?
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.
I use two to show opacity with different fields (from x and y) and scatter_opacity
is using value instead of scale.
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.
I see.
Let's pick one of these scatter_opacity
and remove scatter_opacity
because our unit test is covering this anyway.
My rationale: the purpose of visual test is so that we can skim the gallery and check if everything is still in good shape. If we add too many redundant examples, there would be too many things to look at anyway.
That said, please search through all existing examples specs. If we use config.mark.opacity
, let's use encoding.opacity.value
instead so it will cover the same test coverage.
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.
Duplicated examples are deleted.
I checked every existed examples with config.mark.opacity
and changed them to encoding.opacity.value
and they all work well.
Fix #1025
redo #1315
Add a new encoding channel opacity (with an example and doc).
Support stack for opacity.