import { ScaleConfig } from '../../common/types' ; import { ScaleType } from '../../common/constants' ; import { Size } from '../../../../utils/types' ; const X_TICK_DISTANCE_PX = 100 ; const Y_TICK_DISTANCE_PX = 30 ; const MIN_TICK_COUNT = 2 ; export const getTickCount = ( { width , height } , { yScaleType } ) : { xTickCount : number ; yTickCount : number ; } => { const xTickCount = Math . max ( Math . floor ( width / X_TICK_DISTANCE_PX ) , MIN_TICK_COUNT ) ; const yTickCount = Math . max ( Math . floor ( height / ( Y_TICK_DISTANCE_PX + ( yScaleType === ScaleType . Log ? 60 : 0 ) ) ) , MIN_TICK_COUNT ) ; return { xTickCount , yTickCount } ; } ;