import { scaleLinear } from 'd3-scale' ; import { Margins } from './' ; export type PlotValues = ReturnType < typeof getPlotValues > ; export function getPlotValues ( { width , xMin = 0 , xMax , height , margins , } ) { const xScale = scaleLinear ( ) . domain ( [ xMin , xMax ] ) . range ( [ margins . left , width - margins . right ] ) ; return { height , margins , tickValues : xScale . ticks ( 7 ) , width , xDomain : xScale . domain ( ) , xMax , xScale , } ; }