@@ -14,6 +14,7 @@ var assertHoverLabelContent = customAssertions.assertHoverLabelContent;
1414
1515var mock = require ( '@mocks/gl3d_marker-arrays.json' ) ;
1616var mesh3dcoloringMock = require ( '@mocks/gl3d_mesh3d_coloring.json' ) ;
17+ var mesh3dcellIntensityMock = require ( '@mocks/gl3d_mesh3d_cell-intensity.json' ) ;
1718var multipleScatter3dMock = require ( '@mocks/gl3d_multiple-scatter3d-traces.json' ) ;
1819
1920// lines, markers, text, error bars and surfaces each
@@ -554,10 +555,10 @@ describe('Test gl3d trace click/hover:', function() {
554555 . then ( delay ( 20 ) )
555556 . then ( function ( ) {
556557 assertHoverText (
557- 'x: 1 ' ,
558- 'y: 0' ,
558+ 'x: 0.6666667 ' ,
559+ 'y: 0.3333333 ' ,
559560 'z: 1' ,
560- 'face color: #0F0 ' ,
561+ 'face color: #00F ' ,
561562 'face color'
562563 ) ;
563564 } )
@@ -566,8 +567,8 @@ describe('Test gl3d trace click/hover:', function() {
566567 . then ( function ( ) {
567568 assertHoverText (
568569 'x: 1' ,
569- 'y: 1 ' ,
570- 'z: 1 ' ,
570+ 'y: 0.3333333 ' ,
571+ 'z: 0.6666667 ' ,
571572 'face color: #0FF' ,
572573 'face color'
573574 ) ;
@@ -577,27 +578,58 @@ describe('Test gl3d trace click/hover:', function() {
577578 . then ( function ( ) {
578579 assertHoverText (
579580 'x: 1' ,
580- 'y: 1 ' ,
581- 'z: 0' ,
582- 'face color: #00F ' ,
581+ 'y: 0.6666667 ' ,
582+ 'z: 0.3333333 ' ,
583+ 'face color: #0FF ' ,
583584 'face color'
584585 ) ;
585586 } )
586587 . then ( function ( ) { mouseEvent ( 'mouseover' , 200 , 300 ) ; } )
587588 . then ( delay ( 20 ) )
588589 . then ( function ( ) {
589590 assertHoverText (
590- 'x: 0' ,
591+ 'x: 0.6666667 ' ,
591592 'y: 0' ,
592- 'z: 0' ,
593- 'face color: #000 ' ,
593+ 'z: 0.3333333 ' ,
594+ 'face color: #F00 ' ,
594595 'face color'
595596 ) ;
596597 } )
597598 . catch ( failTest )
598599 . then ( done ) ;
599600 } ) ;
600601
602+ it ( '@gl should display correct face intensities' , function ( done ) {
603+ var fig = mesh3dcellIntensityMock ;
604+
605+ Plotly . newPlot ( gd , fig )
606+ . then ( delay ( 20 ) )
607+ . then ( function ( ) { mouseEvent ( 'mouseover' , 200 , 200 ) ; } )
608+ . then ( delay ( 20 ) )
609+ . then ( function ( ) {
610+ assertHoverText (
611+ 'x: 0.4666667' ,
612+ 'y: 0.4333333' ,
613+ 'z: 0.01583333' ,
614+ 'cell intensity: 0.16' ,
615+ 'trace 0'
616+ ) ;
617+ } )
618+ . then ( function ( ) { mouseEvent ( 'mouseover' , 200 , 300 ) ; } )
619+ . then ( delay ( 20 ) )
620+ . then ( function ( ) {
621+ assertHoverText (
622+ 'x: 0.7666667' ,
623+ 'y: 0.1333333' ,
624+ 'z: −0.3305' ,
625+ 'cell intensity: 3.04' ,
626+ 'trace 0'
627+ ) ;
628+ } )
629+ . catch ( failTest )
630+ . then ( done ) ;
631+ } ) ;
632+
601633 it ( '@gl should pick latest & closest points on hover if two points overlap' , function ( done ) {
602634 var _mock = Lib . extendDeep ( { } , mock4 ) ;
603635
0 commit comments