@@ -105,7 +105,6 @@ describe('Funnelarea traces', function() {
105105 Plotly . newPlot ( gd , [ {
106106 values : [ 1 , 2 , 3 , 4 , 5 ] ,
107107 type : 'funnelarea' ,
108- sort : false ,
109108 marker : {
110109 line : { width : 3 , color : 'rgba(100,100,100,0.7)' } ,
111110 colors : [
@@ -206,17 +205,17 @@ describe('Funnelarea traces', function() {
206205
207206 it ( 'propagate explicit colors to the same labels in earlier OR later traces' , function ( done ) {
208207 var data1 = [
209- { type : 'funnelarea' , sort : true , values : [ 3 , 2 ] , marker : { colors : [ 'red' , 'black' ] } , domain : { x : [ 0.5 , 1 ] } } ,
210- { type : 'funnelarea' , sort : true , values : [ 2 , 5 ] , domain : { x : [ 0 , 0.5 ] } }
208+ { type : 'funnelarea' , values : [ 3 , 2 ] , marker : { colors : [ 'red' , 'black' ] } , domain : { x : [ 0.5 , 1 ] } } ,
209+ { type : 'funnelarea' , values : [ 2 , 5 ] , domain : { x : [ 0 , 0.5 ] } }
211210 ] ;
212211 var data2 = Lib . extendDeep ( [ ] , [ data1 [ 1 ] , data1 [ 0 ] ] ) ;
213212
214213 Plotly . newPlot ( gd , data1 )
215- . then ( _checkSliceColors ( [ '255,0,0' , '0,0,0' , '0 ,0,0' , '255 ,0,0' ] ) )
214+ . then ( _checkSliceColors ( [ '255,0,0' , '0,0,0' , '255 ,0,0' , '0 ,0,0' ] ) )
216215 . then ( function ( ) {
217216 return Plotly . newPlot ( gd , data2 ) ;
218217 } )
219- . then ( _checkSliceColors ( [ '0 ,0,0' , '255 ,0,0' , '255,0,0' , '0,0,0' ] ) )
218+ . then ( _checkSliceColors ( [ '255 ,0,0' , '0 ,0,0' , '255,0,0' , '0,0,0' ] ) )
220219 . catch ( failTest )
221220 . then ( done ) ;
222221 } ) ;
@@ -724,8 +723,8 @@ describe('funnelarea hovering', function() {
724723 unhoverData = data ;
725724 } ) ;
726725
727- mouseEvent ( 'mouseover' , width / 2 - 7 , height / 2 - 7 ) ;
728- mouseEvent ( 'mouseout' , width / 2 - 7 , height / 2 - 7 ) ;
726+ mouseEvent ( 'mouseover' , width / 2 - 7 , height / 2 + 50 ) ;
727+ mouseEvent ( 'mouseout' , width / 2 - 7 , height / 2 + 50 ) ;
729728
730729 expect ( hoverData . points . length ) . toEqual ( 1 ) ;
731730 expect ( unhoverData . points . length ) . toEqual ( 1 ) ;
@@ -822,29 +821,29 @@ describe('funnelarea hovering', function() {
822821 . then ( _hover )
823822 . then ( function ( ) {
824823 assertLabel (
825- [ '4 ' , '5' , '33.3%' ] . join ( '\n' ) ,
824+ [ '0 ' , '5' , '33.3%' ] . join ( '\n' ) ,
826825 [ 'rgb(31, 119, 180)' , 'rgb(255, 255, 255)' , 13 , 'Arial' , 'rgb(255, 255, 255)' ] ,
827826 'initial'
828827 ) ;
829828
830- return Plotly . restyle ( gd , 'text' , [ [ 'A ' , 'B ' , 'C' , 'D ' , 'E ' ] ] ) ;
829+ return Plotly . restyle ( gd , 'text' , [ [ 'E ' , 'D ' , 'C' , 'B ' , 'A ' ] ] ) ;
831830 } )
832831 . then ( _hover )
833832 . then ( function ( ) {
834833 assertLabel (
835- [ '4 ' , 'E' , '5' , '33.3%' ] . join ( '\n' ) ,
834+ [ '0 ' , 'E' , '5' , '33.3%' ] . join ( '\n' ) ,
836835 null ,
837836 'added text'
838837 ) ;
839838
840839 return Plotly . restyle ( gd , 'hovertext' , [ [
841- 'Apple ' , 'Banana ' , 'Clementine' , 'Dragon Fruit ' , 'Eggplant '
840+ 'Eggplant ' , 'Dragon Fruit ' , 'Clementine' , 'Banana ' , 'Apple '
842841 ] ] ) ;
843842 } )
844843 . then ( _hover )
845844 . then ( function ( ) {
846845 assertLabel (
847- [ '4 ' , 'Eggplant' , '5' , '33.3%' ] . join ( '\n' ) ,
846+ [ '0 ' , 'Eggplant' , '5' , '33.3%' ] . join ( '\n' ) ,
848847 null ,
849848 'added hovertext'
850849 ) ;
@@ -854,7 +853,7 @@ describe('funnelarea hovering', function() {
854853 . then ( _hover )
855854 . then ( function ( ) {
856855 assertLabel (
857- [ '4 ' , 'SUP' , '5' , '33.3%' ] . join ( '\n' ) ,
856+ [ '0 ' , 'SUP' , '5' , '33.3%' ] . join ( '\n' ) ,
858857 null ,
859858 'constant hovertext'
860859 ) ;
@@ -870,23 +869,23 @@ describe('funnelarea hovering', function() {
870869 . then ( _hover )
871870 . then ( function ( ) {
872871 assertLabel (
873- [ '4 ' , 'SUP' , '5' , '33.3%' ] . join ( '\n' ) ,
872+ [ '0 ' , 'SUP' , '5' , '33.3%' ] . join ( '\n' ) ,
874873 [ 'rgb(255, 0, 0)' , 'rgb(255, 255, 0)' , 15 , 'Roboto' , 'rgb(0, 0, 255)' ] ,
875874 'new styles'
876875 ) ;
877876
878- return Plotly . restyle ( gd , 'hoverinfo' , [ [ null , null , null , null , 'label+percent' ] ] ) ;
877+ return Plotly . restyle ( gd , 'hoverinfo' , [ [ 'label+percent' , null , null , null , null ] ] ) ;
879878 } )
880879 . then ( _hover )
881880 . then ( function ( ) {
882- assertLabel ( [ '4 ' , '33.3%' ] . join ( '\n' ) , null , 'new hoverinfo' ) ;
881+ assertLabel ( [ '0 ' , '33.3%' ] . join ( '\n' ) , null , 'new hoverinfo' ) ;
883882
884- return Plotly . restyle ( gd , 'hoverinfo' , [ [ null , null , null , null , 'dont+know+what+im-doing' ] ] ) ;
883+ return Plotly . restyle ( gd , 'hoverinfo' , [ [ 'dont+know+what+im-doing' , null , null , null , null ] ] ) ;
885884 } )
886885 . then ( _hover )
887886 . then ( function ( ) {
888887 assertLabel (
889- [ '4 ' , 'SUP' , '5' , '33.3%' ] . join ( '\n' ) ,
888+ [ '0 ' , 'SUP' , '5' , '33.3%' ] . join ( '\n' ) ,
890889 null ,
891890 'garbage hoverinfo'
892891 ) ;
@@ -935,7 +934,7 @@ describe('funnelarea hovering', function() {
935934 . then ( _hover )
936935 . then ( function ( ) {
937936 assertLabel (
938- [ '4 ' , '5' , '33.3%' ] . join ( '\n' ) ,
937+ [ '0 ' , '5' , '33.3%' ] . join ( '\n' ) ,
939938 [ 'rgb(31, 119, 180)' , 'rgb(255, 255, 255)' , 13 , 'Arial' , 'rgb(255, 255, 255)' ] ,
940939 'initial'
941940 ) ;
@@ -951,7 +950,7 @@ describe('funnelarea hovering', function() {
951950 ) ;
952951
953952 return Plotly . restyle ( gd , {
954- 'text' : [ [ 'A ' , 'B ' , 'C' , 'D ' , 'E ' ] ] ,
953+ 'text' : [ [ 'E ' , 'D ' , 'C' , 'B ' , 'A ' ] ] ,
955954 'hovertemplate' : '%{text}<extra></extra>'
956955 } ) ;
957956 } )
@@ -978,12 +977,12 @@ describe('funnelarea hovering', function() {
978977 . then ( _hover )
979978 . then ( function ( ) {
980979 assertLabel (
981- [ '4 ' ] . join ( '\n' ) ,
980+ [ '0 ' ] . join ( '\n' ) ,
982981 null ,
983982 'hovertemplate %{label}'
984983 ) ;
985984 } )
986- . then ( function ( ) { return Plotly . restyle ( gd , 'hovertemplate' , [ [ '' , '' , '' , '' , ' ht 5 %{percent:0.2%}<extra></extra>'] ] ) ; } )
985+ . then ( function ( ) { return Plotly . restyle ( gd , 'hovertemplate' , [ [ 'ht 5 %{percent:0.2%}<extra></extra>' , '' , '' , '' , ' '] ] ) ; } )
987986 . then ( _hover )
988987 . then ( function ( ) {
989988 assertLabel (
@@ -1003,12 +1002,12 @@ describe('funnelarea hovering', function() {
10031002 Plotly . plot ( gd , mockCopy . data , mockCopy . layout )
10041003 . then ( _hover )
10051004 . then ( function ( ) {
1006- assertHoverLabelContent ( { nums : '4 \n5\n33.3%' , name : 'looooooooooo...' } , 'base' ) ;
1005+ assertHoverLabelContent ( { nums : '0 \n5\n33.3%' , name : 'looooooooooo...' } , 'base' ) ;
10071006 } )
10081007 . then ( function ( ) { return Plotly . restyle ( gd , 'hoverlabel.namelength' , 2 ) ; } )
10091008 . then ( _hover )
10101009 . then ( function ( ) {
1011- assertHoverLabelContent ( { nums : '4 \n5\n33.3%' , name : 'lo' } , 'base' ) ;
1010+ assertHoverLabelContent ( { nums : '0 \n5\n33.3%' , name : 'lo' } , 'base' ) ;
10121011 } )
10131012 . catch ( failTest )
10141013 . then ( done ) ;
@@ -1050,15 +1049,15 @@ describe('Test event data of interactions on a funnelarea plot:', function() {
10501049 var point = data . points [ 0 ] ;
10511050
10521051 expect ( point . curveNumber ) . toBe ( 0 ) ;
1053- expect ( point . pointNumber ) . toBe ( 4 ) ;
1054- expect ( point . pointNumbers ) . toEqual ( [ 4 ] ) ;
1052+ expect ( point . pointNumber ) . toBe ( 0 ) ;
1053+ expect ( point . pointNumbers ) . toEqual ( [ 0 ] ) ;
10551054 expect ( point . data ) . toBe ( gd . data [ 0 ] ) ;
10561055 expect ( point . fullData ) . toBe ( gd . _fullData [ 0 ] ) ;
1057- expect ( point . label ) . toBe ( '4 ' ) ;
1056+ expect ( point . label ) . toBe ( '0 ' ) ;
10581057 expect ( point . value ) . toBe ( 5 ) ;
10591058 expect ( point . color ) . toBe ( '#1f77b4' ) ;
1060- expect ( point . id ) . toEqual ( [ 'maggie ' ] ) ;
1061- expect ( point . customdata ) . toEqual ( [ { 9 : 10 } ] ) ;
1059+ expect ( point . id ) . toEqual ( [ 'marge ' ] ) ;
1060+ expect ( point . customdata ) . toEqual ( [ { 1 : 2 } ] ) ;
10621061
10631062 // no need for backward compat i/v
10641063 expect ( 'i' in point ) . toBe ( false ) ;
@@ -1106,7 +1105,7 @@ describe('Test event data of interactions on a funnelarea plot:', function() {
11061105
11071106 expect ( futureData . points [ 0 ] . pointNumber ) . toBeUndefined ( ) ;
11081107 expect ( futureData . points [ 0 ] . i ) . toBeUndefined ( ) ;
1109- expect ( futureData . points [ 0 ] . pointNumbers ) . toEqual ( [ 4 , 9 ] ) ;
1108+ expect ( futureData . points [ 0 ] . pointNumbers ) . toEqual ( [ 0 , 5 ] ) ;
11101109 } ) ;
11111110 } ) ;
11121111
0 commit comments