File tree 3 files changed +48
-0
lines changed
3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -3802,6 +3802,7 @@ function makePlotFramework(gd) {
3802
3802
. classed ( 'gl-container' , true ) ;
3803
3803
3804
3804
fullLayout . _paperdiv . selectAll ( '.main-svg' ) . remove ( ) ;
3805
+ fullLayout . _paperdiv . select ( '.modebar-container' ) . remove ( ) ;
3805
3806
3806
3807
fullLayout . _paper = fullLayout . _paperdiv . insert ( 'svg' , ':first-child' )
3807
3808
. classed ( 'main-svg' , true ) ;
Original file line number Diff line number Diff line change @@ -3221,6 +3221,36 @@ describe('hovermode defaults to', function() {
3221
3221
} ) ;
3222
3222
} ) ;
3223
3223
3224
+ describe ( 'hover labels z-position' , function ( ) {
3225
+ var gd ;
3226
+
3227
+ beforeEach ( function ( ) {
3228
+ gd = createGraphDiv ( ) ;
3229
+ } ) ;
3230
+
3231
+ afterEach ( destroyGraphDiv ) ;
3232
+ var mock = require ( '@mocks/14.json' ) ;
3233
+
3234
+ it ( 'is above the modebar' , function ( done ) {
3235
+ Plotly . plot ( gd , mock ) . then ( function ( ) {
3236
+ var infolayer = document . getElementsByClassName ( 'infolayer' ) ;
3237
+ var modebar = document . getElementsByClassName ( 'modebar-container' ) ;
3238
+ var hoverlayer = document . getElementsByClassName ( 'hoverlayer' ) ;
3239
+
3240
+ expect ( infolayer . length ) . toBe ( 1 ) ;
3241
+ expect ( modebar . length ) . toBe ( 1 ) ;
3242
+ expect ( hoverlayer . length ) . toBe ( 1 ) ;
3243
+
3244
+ var compareMask = infolayer [ 0 ] . compareDocumentPosition ( modebar [ 0 ] ) ;
3245
+ expect ( compareMask ) . toBe ( Node . DOCUMENT_POSITION_FOLLOWING , '.modebar-container appears after the .infolayer' ) ;
3246
+
3247
+ compareMask = modebar [ 0 ] . compareDocumentPosition ( hoverlayer [ 0 ] ) ;
3248
+ expect ( compareMask ) . toBe ( Node . DOCUMENT_POSITION_FOLLOWING , '.hoverlayer appears after the .modebar' ) ;
3249
+ } )
3250
+ . catch ( failTest )
3251
+ . then ( done ) ;
3252
+ } ) ;
3253
+ } ) ;
3224
3254
3225
3255
describe ( 'touch devices' , function ( ) {
3226
3256
afterEach ( destroyGraphDiv ) ;
Original file line number Diff line number Diff line change @@ -2683,6 +2683,23 @@ describe('Test plot api', function() {
2683
2683
. catch ( failTest )
2684
2684
. then ( done ) ;
2685
2685
} ) ;
2686
+
2687
+ it ( 'should only have one modebar-container' , function ( done ) {
2688
+ var data = [ { y : [ 1 , 2 ] } ] ;
2689
+
2690
+ Plotly . plot ( gd , data ) . then ( function ( ) {
2691
+ var modebars = document . getElementsByClassName ( 'modebar-container' ) ;
2692
+ expect ( modebars . length ) . toBe ( 1 ) ;
2693
+
2694
+ return Plotly . newPlot ( gd , data ) ;
2695
+ } )
2696
+ . then ( function ( ) {
2697
+ var modebars = document . getElementsByClassName ( 'modebar-container' ) ;
2698
+ expect ( modebars . length ) . toBe ( 1 ) ;
2699
+ } )
2700
+ . catch ( failTest )
2701
+ . then ( done ) ;
2702
+ } ) ;
2686
2703
} ) ;
2687
2704
2688
2705
describe ( 'Plotly.update should' , function ( ) {
You can’t perform that action at this time.
0 commit comments