@@ -139,7 +139,7 @@ describe('scattermapbox convert', function() {
139
139
Plots . doCalcdata ( gd , fullTrace ) ;
140
140
141
141
var calcTrace = gd . calcdata [ 0 ] ;
142
- return convert ( calcTrace ) ;
142
+ return convert ( calcTrace , { _fullLayout : { _d3locale : false } } ) ;
143
143
}
144
144
145
145
function assertVisibility ( opts , expectations ) {
@@ -478,6 +478,44 @@ describe('scattermapbox convert', function() {
478
478
expect ( actualText ) . toEqual ( [ 'A' , 'B' , 'C' , 'F' , undefined ] ) ;
479
479
} ) ;
480
480
481
+ it ( 'should generate correct output for texttemplate without text' , function ( ) {
482
+ var opts = _convert ( Lib . extendFlat ( { } , base , {
483
+ mode : 'lines+text' ,
484
+ connectgaps : true ,
485
+ textposition : 'outside' ,
486
+ texttemplate : [ 'A' , 'B' , 'C' , 'D' , 'E' , 'F' ]
487
+ } ) ) ;
488
+
489
+ var actualText = opts . symbol . geojson . features . map ( function ( f ) {
490
+ return f . properties . text ;
491
+ } ) ;
492
+
493
+ expect ( actualText ) . toEqual ( [ 'A' , 'B' , 'C' , 'F' , '' ] ) ;
494
+ } ) ;
495
+
496
+ it ( 'should generate correct output for texttemplate' , function ( ) {
497
+ var mock = {
498
+ 'type' : 'scattermapbox' ,
499
+ 'mode' : 'markers+text' ,
500
+ 'lon' : [ - 73.57 , - 79.24 , - 123.06 ] ,
501
+ 'lat' : [ 45.5 , 43.4 , 49.13 ] ,
502
+ 'text' : [ 'Montreal' , 'Toronto' , 'Vancouver' ] ,
503
+ 'texttemplate' : '%{text} (%{lonlat[0]}, %{lonlat[1]}): %{customdata:.2s}' ,
504
+ 'textposition' : 'top center' ,
505
+ 'customdata' : [ 1780000 , 2930000 , 675218 ]
506
+ } ;
507
+ var opts = _convert ( mock ) ;
508
+ var actualText = opts . symbol . geojson . features . map ( function ( f ) {
509
+ return f . properties . text ;
510
+ } ) ;
511
+
512
+ expect ( actualText ) . toEqual ( [
513
+ 'Montreal (-73.57, 45.5): 1.8M' ,
514
+ 'Toronto (-79.24, 43.4): 2.9M' ,
515
+ 'Vancouver (-123.06, 49.13): 680k'
516
+ ] ) ;
517
+ } ) ;
518
+
481
519
it ( 'should generate correct output for lines traces with trailing gaps' , function ( ) {
482
520
var opts = _convert ( Lib . extendFlat ( { } , base , {
483
521
mode : 'lines' ,
0 commit comments