11import { createSymlogScale } from '../src'
22
33it ( `should be able to build a symlog scale for x axis` , ( ) => {
4- const scale = createSymlogScale ( { type : 'symlog' } , { all : [ ] , min : 0 , max : 1 } , 100 , 'x' )
4+ const scale = createSymlogScale (
5+ { type : 'symlog' , round : true } ,
6+ { all : [ ] , min : 0 , max : 1 } ,
7+ 100 ,
8+ 'x'
9+ )
510
611 expect ( scale ( 0 ) ) . toBe ( 0 )
712 expect ( scale ( 0.5 ) ) . toBe ( 58 )
813 expect ( scale ( 1 ) ) . toBe ( 100 )
914} )
1015
1116it ( `should be able to build a symlog scale for y axis` , ( ) => {
12- const scale = createSymlogScale ( { type : 'symlog' } , { all : [ ] , min : 0 , max : 1 } , 100 , 'y' )
17+ const scale = createSymlogScale (
18+ { type : 'symlog' , round : true } ,
19+ { all : [ ] , min : 0 , max : 1 } ,
20+ 100 ,
21+ 'y'
22+ )
1323
1424 expect ( scale ( 0 ) ) . toBe ( 100 )
1525 expect ( scale ( 0.5 ) ) . toBe ( 42 )
@@ -18,7 +28,7 @@ it(`should be able to build a symlog scale for y axis`, () => {
1828
1929it ( `should allow to define min value for x axis` , ( ) => {
2030 const scale = createSymlogScale (
21- { type : 'symlog' , min : 0.5 } ,
31+ { type : 'symlog' , min : 0.5 , round : true } ,
2232 { all : [ ] , min : 0 , max : 1 } ,
2333 100 ,
2434 'x'
@@ -32,7 +42,7 @@ it(`should allow to define min value for x axis`, () => {
3242
3343it ( `should allow to define min value for y axis` , ( ) => {
3444 const scale = createSymlogScale (
35- { type : 'symlog' , min : 0.5 } ,
45+ { type : 'symlog' , min : 0.5 , round : true } ,
3646 { all : [ ] , min : 0 , max : 1 } ,
3747 100 ,
3848 'y'
@@ -46,7 +56,7 @@ it(`should allow to define min value for y axis`, () => {
4656
4757it ( `should allow to define max value for x axis` , ( ) => {
4858 const scale = createSymlogScale (
49- { type : 'symlog' , max : 2 } ,
59+ { type : 'symlog' , max : 2 , round : true } ,
5060 { all : [ ] , min : 0 , max : 1 } ,
5161 100 ,
5262 'x'
@@ -60,7 +70,7 @@ it(`should allow to define max value for x axis`, () => {
6070
6171it ( `should allow to define max value for y axis` , ( ) => {
6272 const scale = createSymlogScale (
63- { type : 'symlog' , max : 2 } ,
73+ { type : 'symlog' , max : 2 , round : true } ,
6474 { all : [ ] , min : 0 , max : 1 } ,
6575 100 ,
6676 'y'
@@ -74,7 +84,7 @@ it(`should allow to define max value for y axis`, () => {
7484
7585it ( `should allow to reverse domain` , ( ) => {
7686 const scale = createSymlogScale (
77- { type : 'symlog' , reverse : true } ,
87+ { type : 'symlog' , reverse : true , round : true } ,
7888 { all : [ ] , min : 0 , max : 1 } ,
7989 100 ,
8090 'y'
@@ -87,7 +97,7 @@ it(`should allow to reverse domain`, () => {
8797
8898it ( `should allow to adjust the constant` , ( ) => {
8999 const scale = createSymlogScale (
90- { type : 'symlog' , constant : 0.1 } ,
100+ { type : 'symlog' , constant : 0.1 , round : true } ,
91101 { all : [ ] , min : 0 , max : 1 } ,
92102 100 ,
93103 'x'
@@ -100,7 +110,7 @@ it(`should allow to adjust the constant`, () => {
100110
101111it ( `should allow to toggle rounding` , ( ) => {
102112 const roundedScale = createSymlogScale (
103- { type : 'symlog' } ,
113+ { type : 'symlog' , round : true } ,
104114 { all : [ ] , min : 0 , max : 1 } ,
105115 100 ,
106116 'x'
0 commit comments