@@ -856,6 +856,12 @@ describe('parcoords Lifecycle methods', function() {
856
856
} ] ,
857
857
line : { color : 'blue' }
858
858
} ] , {
859
+ margin : {
860
+ t : 0 ,
861
+ b : 0 ,
862
+ l : 0 ,
863
+ r : 0
864
+ } ,
859
865
width : 300 ,
860
866
height : 200
861
867
} )
@@ -888,6 +894,12 @@ describe('parcoords Lifecycle methods', function() {
888
894
} ] ,
889
895
line : { color : 'blue' }
890
896
} ] , {
897
+ margin : {
898
+ t : 0 ,
899
+ b : 0 ,
900
+ l : 0 ,
901
+ r : 0
902
+ } ,
891
903
width : 300 ,
892
904
height : 200
893
905
} )
@@ -910,6 +922,62 @@ describe('parcoords Lifecycle methods', function() {
910
922
. catch ( failTest )
911
923
. then ( done ) ;
912
924
} ) ;
925
+
926
+ it ( '@gl unselected.line.color `Plotly.restyle` should change context layer line.color' , function ( done ) {
927
+ var testLayer = '.gl-canvas-context' ;
928
+
929
+ var list1 = [ ] ;
930
+ var list2 = [ ] ;
931
+ for ( var i = 0 ; i <= 100 ; i ++ ) {
932
+ list1 [ i ] = i ;
933
+ list2 [ i ] = 100 - i ;
934
+ }
935
+
936
+ Plotly . plot ( gd , [ {
937
+ type : 'parcoords' ,
938
+ dimensions : [ {
939
+ constraintrange : [ 1 , 10 ] ,
940
+ values : list1
941
+ } , {
942
+ values : list2
943
+ } ] ,
944
+ line : { color : '#0F0' } ,
945
+ unselected : { line : { color : '#F00' } }
946
+ } ] , {
947
+ margin : {
948
+ t : 0 ,
949
+ b : 0 ,
950
+ l : 0 ,
951
+ r : 0
952
+ } ,
953
+ width : 300 ,
954
+ height : 200
955
+ } )
956
+ . then ( function ( ) {
957
+ var rgb = getAvgPixelByChannel ( testLayer ) ;
958
+ expect ( rgb [ 0 ] ) . not . toBe ( 0 , 'red' ) ;
959
+ expect ( rgb [ 1 ] ) . toBe ( 0 , 'no green' ) ;
960
+ expect ( rgb [ 2 ] ) . toBe ( 0 , 'no blue' ) ;
961
+
962
+ return Plotly . restyle ( gd , 'unselected.line.color' , '#00F' ) ;
963
+ } )
964
+ . then ( function ( ) {
965
+ var rgb = getAvgPixelByChannel ( testLayer ) ;
966
+ expect ( rgb [ 0 ] ) . toBe ( 0 , 'no red' ) ;
967
+ expect ( rgb [ 1 ] ) . toBe ( 0 , 'no green' ) ;
968
+ expect ( rgb [ 2 ] ) . not . toBe ( 0 , 'blue' ) ;
969
+
970
+ return Plotly . restyle ( gd , 'unselected.line.color' , 'rgba(0,0,0,0)' ) ;
971
+ } )
972
+ . then ( function ( ) {
973
+ var rgb = getAvgPixelByChannel ( testLayer ) ;
974
+ expect ( rgb [ 0 ] ) . toBe ( 0 , 'no red' ) ;
975
+ expect ( rgb [ 1 ] ) . toBe ( 0 , 'no green' ) ;
976
+ expect ( rgb [ 2 ] ) . toBe ( 0 , 'no blue' ) ;
977
+ } )
978
+ . catch ( failTest )
979
+ . then ( done ) ;
980
+ } ) ;
913
981
} ) ;
914
982
915
983
describe ( 'parcoords basic use' , function ( ) {
0 commit comments