File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 1010'use strict' ;
1111
1212var d3 = require ( 'd3' ) ;
13+ var tc = require ( 'tinycolor2' ) ;
1314
1415var Plotly = require ( '../../plotly' ) ;
1516var Plots = require ( '../../plots/plots' ) ;
@@ -356,13 +357,22 @@ module.exports = function draw(gd, id) {
356357 if ( i !== filllevels . length - 1 ) {
357358 z [ 1 ] += ( z [ 1 ] > z [ 0 ] ) ? 1 : - 1 ;
358359 }
360+
361+
362+ // Tinycolor can't handle exponents and
363+ // at this scale, removing it makes no difference.
364+ var colorString = fillcolormap ( d ) . replace ( 'e-' , '' ) ,
365+ opaqueColor = tc ( colorString ) . toHexString ( ) ;
366+
367+ // Colorbar cannot currently support opacities so we
368+ // use an opaque fill even when alpha channels present
359369 d3 . select ( this ) . attr ( {
360370 x : xLeft ,
361371 width : Math . max ( thickPx , 2 ) ,
362372 y : d3 . min ( z ) ,
363- height : Math . max ( d3 . max ( z ) - d3 . min ( z ) , 2 )
364- } )
365- . style ( 'fill' , fillcolormap ( d ) ) ;
373+ height : Math . max ( d3 . max ( z ) - d3 . min ( z ) , 2 ) ,
374+ fill : opaqueColor
375+ } ) ;
366376 } ) ;
367377
368378 var lines = container . select ( '.cblines' )
You can’t perform that action at this time.
0 commit comments