@mui/x-charts
Version:
The community edition of the Charts components (MUI X).
17 lines • 522 B
JavaScript
import { scaleLog, scalePow, scaleSqrt, scaleTime, scaleUtc, scaleLinear } from '@mui/x-charts-vendor/d3-scale';
export function getScale(scaleType, domain, range) {
switch (scaleType) {
case 'log':
return scaleLog(domain, range);
case 'pow':
return scalePow(domain, range);
case 'sqrt':
return scaleSqrt(domain, range);
case 'time':
return scaleTime(domain, range);
case 'utc':
return scaleUtc(domain, range);
default:
return scaleLinear(domain, range);
}
}