-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Apply trace opacity to 'mode: 'lines' legend items #1204
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
Conversation
@@ -30,7 +30,8 @@ | |||
9 | |||
], | |||
"mode": "lines", | |||
"type": "scatter" | |||
"type": "scatter", | |||
"opacity": 0.5 |
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.
Would be a better test to set the opacity on a lines+markers trace - which I don't think is handled correctly in this PR, trace opacity should get set on traceGroup
rather than independently to lines and markers (and fills!).
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.
First, see
trace opacity should get set on traceGroup
that would imply that the trace name (rendered in the <text class="legendtext">
node) would be semi-transparent whenever trace.opacity < 1
.
So, in d009798 a new <g>
is added grouping the fill, lines and symbols <g>
and applying trace.opacity
once.
👍 and then a test with lines+markers? Ideally with different line and marker colors? Do you know why 28.png changed the way it did? I don't think the new one looks wrong per se, but in addition to the slight transparency to the legend lines, it seems like the lines got a little bit shorter. And in some of the other cases the semitransparent lines got a little thinner. Any idea why? |
- to test trace vs marker opacity in legend
Hopefully somethint like 849782d is what you had in mind.
as it should, all traces in
I can't detect a difference to be honest, maybe I'm going blind 👓 |
Ok, don't worry about it. Probably just some different antialiasing algorithm when opacity is included.
Technically it does show what I wanted to see - it will fail if the marker and line get
And the legend matches the plot: |
"y": [1, 2, 3], | ||
"opacity": 0.2, | ||
"line": { "width": 10, "color": "red"}, | ||
"marker": { "size": 20, "color": "blue"} |
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.
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.
Beautiful, thanks :) 💃
Dropping from the |
Hi! I have a plot where I set per-marker opacity using a array. The legend takes the opacity of the more transparent points. How can I force the legend’s opacity to be 1? |
fixes #1174