-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix exporting transparent colors in rangeslider
& selections
#6323
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
src/components/rangeslider/draw.js
Outdated
fill: fillRGB, | ||
'fill-opacity': fillAlpha, | ||
stroke: strokeRGB, | ||
'stroke-opacity': strokeAlpha, |
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.
🌴 better to reuse Color.stroke
and Color.fill
here and in selections/select.js - and that would also help address the presumably unintentional use of attr
here whereas elsewhere we use style
for these.
To be specific, you can either:
bg.attr({...})
.call(Color.stroke, opts.bordercolor)
.call(Color.fill, opts.bgcolor);
or:
bg.attr({...});
Color.stroke(bg, opts.bordercolor);
Color.fill(bg, opts.bgcolor);
src/traces/violin/hover.js
Outdated
violinLineAttrs = { | ||
stroke: strokeRGB, | ||
'stroke-opacity': strokeAlpha | ||
}; |
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 one would take a little more work to convert to Color.stroke
- basically stashing strokeC
so it can be used below next to the call
violinLine.attr(violinLineAttrs);
But I still think it'd be a good idea, and again there's the attr/style switch. In principle both work but we should really be consistent, as there can be different behavior in relation to extra CSS on the page.
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.
💃
Similar to #6318 | @alexcjohnson
There are few more instances in
hover
that we could fix; but since we don't export hovers (yet), I thought we may want to skip for now.