Skip to content

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

Merged
merged 5 commits into from
Oct 6, 2022

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Sep 22, 2022

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.

@archmoj archmoj added bug something broken status: reviewable labels Sep 22, 2022
fill: fillRGB,
'fill-opacity': fillAlpha,
stroke: strokeRGB,
'stroke-opacity': strokeAlpha,
Copy link
Collaborator

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);

violinLineAttrs = {
stroke: strokeRGB,
'stroke-opacity': strokeAlpha
};
Copy link
Collaborator

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.

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃

@archmoj archmoj merged commit 3ae9c77 into master Oct 6, 2022
@archmoj archmoj deleted the more-drawing-rgba-colors branch October 6, 2022 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants