@@ -10,10 +10,12 @@ export default {
1010 title : 'Hooks/Advanced Ticks' ,
1111} as Meta ;
1212
13- const LARGE_RANGE = [ 0 , 600 ] ;
14- const SMALL_RANGE = [ 0 , 40 ] ;
15- const DOMAIN_LARGE = [ 0 , 100 ] ;
16- const DOMAIN_SMALL = [ 50 , 50.0001 ] ;
13+ type Domain = [ number , number ] ;
14+
15+ const LARGE_RANGE : Domain = [ 0 , 600 ] ;
16+ const SMALL_RANGE : Domain = [ 0 , 40 ] ;
17+ const DOMAIN_LARGE : Domain = [ 0 , 100 ] ;
18+ const DOMAIN_SMALL : Domain = [ 50 , 50.0001 ] ;
1719
1820export function AdvancedCustomTicks ( ) {
1921 const ref = useRef < SVGGElement > ( null ) ;
@@ -65,7 +67,7 @@ function computeLinearTicks(
6567 secondaryTickSize ?: number ;
6668 } = { } ,
6769) : AxisTick [ ] {
68- const viewport = xAccessor . domain ( ) ;
70+ const viewport = xAccessor . domain ( ) as Domain ;
6971 const ticks : AxisTick [ ] = [ ] ;
7072 const {
7173 noSecondaryTicks = false ,
@@ -113,7 +115,7 @@ function computeLinearTicks(
113115 ticks . push ( {
114116 value,
115117 position : xAccessor ( value ) ,
116- label : primaryTicks [ primaryTickIndex ] ?. label ?? null ,
118+ label : primaryTicks [ primaryTickIndex ] ?. label ?? '' ,
117119 size : n % nSubTicks === 0 ? primaryTickSize : secondaryTickSize ,
118120 } ) ;
119121 }
0 commit comments