Skip to content

Commit a529f1b

Browse files
committed
revisit violin stroke style
1 parent 200733a commit a529f1b

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/traces/violin/hover.js

+2-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
'use strict';
22

3-
var tinycolor = require('tinycolor2');
4-
53
var Color = require('../../components/color');
64
var Lib = require('../../lib');
75
var Axes = require('../../plots/cartesian/axes');
@@ -78,15 +76,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) {
7876

7977
closeData.push(kdePointData);
8078

81-
var strokeC = pointData.color;
82-
var strokeColor = tinycolor(strokeC);
83-
var strokeAlpha = strokeColor.getAlpha();
84-
var strokeRGB = Color.tinyRGB(strokeColor);
85-
86-
violinLineAttrs = {
87-
stroke: strokeRGB,
88-
'stroke-opacity': strokeAlpha
89-
};
79+
violinLineAttrs = {};
9080
violinLineAttrs[pLetter + '1'] = Lib.constrain(paOffset + pOnPath[0], paOffset, paOffset + paLength);
9181
violinLineAttrs[pLetter + '2'] = Lib.constrain(paOffset + pOnPath[1], paOffset, paOffset + paLength);
9282
violinLineAttrs[vLetter + '1'] = violinLineAttrs[vLetter + '2'] = vAxis._offset + vValPx;
@@ -109,7 +99,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) {
10999
.classed('violinline-' + trace.uid, true)
110100
.attr('stroke-width', 1.5);
111101
violinLine.exit().remove();
112-
violinLine.attr(violinLineAttrs);
102+
violinLine.attr(violinLineAttrs).call(Color.stroke, pointData.color);
113103

114104
// same combine logic as box hoverPoints
115105
if(hovermode === 'closest') {

0 commit comments

Comments
 (0)