@mui/x-charts
Version:
The community edition of the Charts components (MUI X).
39 lines • 838 B
JavaScript
import { curveCatmullRom, curveLinear, curveMonotoneX, curveMonotoneY, curveNatural, curveStep, curveStepAfter, curveStepBefore } from '@mui/x-charts-vendor/d3-shape';
export default function getCurveFactory(curveType) {
switch (curveType) {
case 'catmullRom':
{
return curveCatmullRom.alpha(0.5);
}
case 'linear':
{
return curveLinear;
}
case 'monotoneX':
{
return curveMonotoneX;
}
case 'monotoneY':
{
return curveMonotoneY;
}
case 'natural':
{
return curveNatural;
}
case 'step':
{
return curveStep;
}
case 'stepBefore':
{
return curveStepBefore;
}
case 'stepAfter':
{
return curveStepAfter;
}
default:
return curveMonotoneX;
}
}