@@ -206,6 +206,30 @@ suite.addBatch({
206206 "1e+10"
207207 ] ) ;
208208 } ,
209+ "generates ticks that cover the domain" : function ( d3 ) {
210+ var x = d3 . scale . log ( ) . domain ( [ .01 , 10000 ] ) ;
211+ assert . deepEqual ( x . ticks ( 20 ) . map ( x . tickFormat ( 20 ) ) , [
212+ "1e-2" , "2e-2" , "3e-2" , "" , "" , "" , "" , "" , "" ,
213+ "1e-1" , "2e-1" , "3e-1" , "" , "" , "" , "" , "" , "" ,
214+ "1e+0" , "2e+0" , "3e+0" , "" , "" , "" , "" , "" , "" ,
215+ "1e+1" , "2e+1" , "3e+1" , "" , "" , "" , "" , "" , "" ,
216+ "1e+2" , "2e+2" , "3e+2" , "" , "" , "" , "" , "" , "" ,
217+ "1e+3" , "2e+3" , "3e+3" , "" , "" , "" , "" , "" , "" ,
218+ "1e+4"
219+ ] ) ;
220+ } ,
221+ "generates ticks that cover the niced domain" : function ( d3 ) {
222+ var x = d3 . scale . log ( ) . domain ( [ .0124123 , 1230.4 ] ) . nice ( ) ;
223+ assert . deepEqual ( x . ticks ( 20 ) . map ( x . tickFormat ( 20 ) ) , [
224+ "1e-2" , "2e-2" , "3e-2" , "" , "" , "" , "" , "" , "" ,
225+ "1e-1" , "2e-1" , "3e-1" , "" , "" , "" , "" , "" , "" ,
226+ "1e+0" , "2e+0" , "3e+0" , "" , "" , "" , "" , "" , "" ,
227+ "1e+1" , "2e+1" , "3e+1" , "" , "" , "" , "" , "" , "" ,
228+ "1e+2" , "2e+2" , "3e+2" , "" , "" , "" , "" , "" , "" ,
229+ "1e+3" , "2e+3" , "3e+3" , "" , "" , "" , "" , "" , "" ,
230+ "1e+4"
231+ ] ) ;
232+ } ,
209233 "can override the tick format" : function ( d3 ) {
210234 var x = d3 . scale . log ( ) . domain ( [ 1000.1 , 1 ] ) ;
211235 assert . deepEqual ( x . ticks ( ) . map ( x . tickFormat ( 10 , d3 . format ( "+,d" ) ) ) , [
0 commit comments