-
-
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
Changes from 3 commits
23569cd
e00cde4
6111dc0
200733a
a529f1b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
'use strict'; | ||
|
||
var tinycolor = require('tinycolor2'); | ||
|
||
var Color = require('../../components/color'); | ||
var Lib = require('../../lib'); | ||
var Axes = require('../../plots/cartesian/axes'); | ||
var boxHoverPoints = require('../box/hover'); | ||
|
@@ -75,7 +78,15 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) { | |
|
||
closeData.push(kdePointData); | ||
|
||
violinLineAttrs = {stroke: pointData.color}; | ||
var strokeC = pointData.color; | ||
var strokeColor = tinycolor(strokeC); | ||
var strokeAlpha = strokeColor.getAlpha(); | ||
var strokeRGB = Color.tinyRGB(strokeColor); | ||
|
||
violinLineAttrs = { | ||
stroke: strokeRGB, | ||
'stroke-opacity': strokeAlpha | ||
}; | ||
|
||
violinLineAttrs[pLetter + '1'] = Lib.constrain(paOffset + pOnPath[0], paOffset, paOffset + paLength); | ||
violinLineAttrs[pLetter + '2'] = Lib.constrain(paOffset + pOnPath[1], paOffset, paOffset + paLength); | ||
violinLineAttrs[vLetter + '1'] = violinLineAttrs[vLetter + '2'] = vAxis._offset + vValPx; | ||
|
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
andColor.fill
here and in selections/select.js - and that would also help address the presumably unintentional use ofattr
here whereas elsewhere we usestyle
for these.To be specific, you can either:
or: