@@ -25,6 +25,7 @@ var linkTraces = require('../scatter/link_traces');
25
25
var createScatter = require ( 'regl-scatter2d' ) ;
26
26
var createLine = require ( 'regl-line2d' ) ;
27
27
var createError = require ( 'regl-error2d' ) ;
28
+ var rgba = require ( 'color-normalize' ) ;
28
29
var svgSdf = require ( 'svg-path-sdf' ) ;
29
30
var createRegl = require ( 'regl' ) ;
30
31
var fillHoverText = require ( '../scatter/fill_hover_text' ) ;
@@ -405,6 +406,7 @@ ScatterGl.sceneOptions = function sceneOptions(container, subplot, trace, positi
405
406
if ( ! multiMarker ) {
406
407
isOpen = / - o p e n / . test ( markerOpts . symbol ) ;
407
408
}
409
+
408
410
// prepare colors
409
411
if ( multiMarker || Array . isArray ( markerOpts . color ) || Array . isArray ( markerOpts . line . color ) || Array . isArray ( markerOpts . line ) || Array . isArray ( markerOpts . opacity ) ) {
410
412
markerOptions . colors = new Array ( count ) ;
@@ -445,15 +447,17 @@ ScatterGl.sceneOptions = function sceneOptions(container, subplot, trace, positi
445
447
markerOptions . opacity = trace . opacity ;
446
448
}
447
449
else {
448
- markerOptions . color = markerOpts . color ;
449
- markerOptions . borderColor = markerOpts . line . color ;
450
- markerOptions . opacity = trace . opacity * markerOpts . opacity ;
451
-
452
450
if ( isOpen ) {
453
- markerOptions . borderColor = markerOptions . color . slice ( ) ;
454
- markerOptions . color = markerOptions . color . slice ( ) ;
451
+ markerOptions . color = rgba ( markerOpts . color , 'uint8' ) ;
455
452
markerOptions . color [ 3 ] = 0 ;
453
+ markerOptions . borderColor = rgba ( markerOpts . color , 'uint8' ) ;
456
454
}
455
+ else {
456
+ markerOptions . color = rgba ( markerOpts . color , 'uint8' ) ;
457
+ markerOptions . borderColor = rgba ( markerOpts . line . color , 'uint8' ) ;
458
+ }
459
+
460
+ markerOptions . opacity = trace . opacity * markerOpts . opacity ;
457
461
}
458
462
459
463
// prepare markers
0 commit comments