@@ -31,7 +31,7 @@ var handleAxisPositionDefaults = require('../../plots/cartesian/position_default
31
31
var axisLayoutAttrs = require ( '../../plots/cartesian/layout_attributes' ) ;
32
32
33
33
var attributes = require ( './attributes' ) ;
34
-
34
+ var cn = require ( './constants' ) . cn ;
35
35
36
36
module . exports = function draw ( gd , id ) {
37
37
// opts: options object, containing everything from attributes
@@ -248,15 +248,16 @@ module.exports = function draw(gd, id) {
248
248
// now draw the elements
249
249
var container = fullLayout . _infolayer . selectAll ( 'g.' + id ) . data ( [ 0 ] ) ;
250
250
container . enter ( ) . append ( 'g' ) . classed ( id , true )
251
+ . classed ( cn . colorbar , true )
251
252
. each ( function ( ) {
252
253
var s = d3 . select ( this ) ;
253
- s . append ( 'rect' ) . classed ( ' cbbg' , true ) ;
254
- s . append ( 'g' ) . classed ( ' cbfills' , true ) ;
255
- s . append ( 'g' ) . classed ( ' cblines' , true ) ;
256
- s . append ( 'g' ) . classed ( ' cbaxis' , true ) . classed ( ' crisp' , true ) ;
257
- s . append ( 'g' ) . classed ( ' cbtitleunshift' , true )
258
- . append ( 'g' ) . classed ( ' cbtitle' , true ) ;
259
- s . append ( 'rect' ) . classed ( ' cboutline' , true ) ;
254
+ s . append ( 'rect' ) . classed ( cn . cbbg , true ) ;
255
+ s . append ( 'g' ) . classed ( cn . cbfills , true ) ;
256
+ s . append ( 'g' ) . classed ( cn . cblines , true ) ;
257
+ s . append ( 'g' ) . classed ( cn . cbaxis , true ) . classed ( cn . crisp , true ) ;
258
+ s . append ( 'g' ) . classed ( cn . cbtitleunshift , true )
259
+ . append ( 'g' ) . classed ( cn . cbtitle , true ) ;
260
+ s . append ( 'rect' ) . classed ( cn . cboutline , true ) ;
260
261
s . select ( '.cbtitle' ) . datum ( 0 ) ;
261
262
} ) ;
262
263
container . attr ( 'transform' , 'translate(' + Math . round ( gs . l ) +
@@ -315,7 +316,7 @@ module.exports = function draw(gd, id) {
315
316
}
316
317
}
317
318
else if ( titleText . node ( ) &&
318
- ! titleText . classed ( 'js-placeholder' ) ) {
319
+ ! titleText . classed ( cn . jsPlaceholder ) ) {
319
320
titleHeight = Drawing . bBox ( titleText . node ( ) ) . height ;
320
321
}
321
322
if ( titleHeight ) {
@@ -348,7 +349,7 @@ module.exports = function draw(gd, id) {
348
349
. selectAll ( 'rect.cbfill' )
349
350
. data ( filllevels ) ;
350
351
fills . enter ( ) . append ( 'rect' )
351
- . classed ( ' cbfill' , true )
352
+ . classed ( cn . cbfill , true )
352
353
. style ( 'stroke' , 'none' ) ;
353
354
fills . exit ( ) . remove ( ) ;
354
355
fills . each ( function ( d , i ) {
@@ -389,7 +390,7 @@ module.exports = function draw(gd, id) {
389
390
. data ( opts . line . color && opts . line . width ?
390
391
linelevels : [ ] ) ;
391
392
lines . enter ( ) . append ( 'path' )
392
- . classed ( ' cbline' , true ) ;
393
+ . classed ( cn . cbline , true ) ;
393
394
lines . exit ( ) . remove ( ) ;
394
395
lines . each ( function ( d ) {
395
396
d3 . select ( this )
@@ -479,7 +480,7 @@ module.exports = function draw(gd, id) {
479
480
var innerWidth = thickPx + opts . outlinewidth / 2 +
480
481
Drawing . bBox ( cbAxisOut . _axislayer . node ( ) ) . width ;
481
482
titleEl = titleCont . select ( 'text' ) ;
482
- if ( titleEl . node ( ) && ! titleEl . classed ( 'js-placeholder' ) ) {
483
+ if ( titleEl . node ( ) && ! titleEl . classed ( cn . jsPlaceholder ) ) {
483
484
var mathJaxNode = titleCont
484
485
. select ( '.h' + cbAxisOut . _id + 'title-math-group' )
485
486
. node ( ) ,
0 commit comments