d3#easeCubicOut TypeScript Examples
The following examples show how to use
d3#easeCubicOut.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Ease.ts From anichart.js with MIT License | 6 votes |
export function customInOut(
time: [number, number, number, number],
range: [number, number] = [0, 1],
interruption = [easeCubicOut, easeCubicOut]
) {
const scaleIn = scaleLinear([time[0], time[1]], range).interpolate(
easeInterpolate(interruption[0])
);
const scaleOut = scaleLinear([time[3], time[2]], range).interpolate(
easeInterpolate(interruption[1])
);
return (normalizedTime: number) => {
if (normalizedTime < time[0]) {
return range[0];
} else if (normalizedTime > time[3]) {
return range[0];
} else if (normalizedTime < time[1]) {
return scaleIn(normalizedTime);
} else if (normalizedTime > time[2]) {
return scaleOut(normalizedTime);
} else {
return range[1];
}
};
}
Example #2
Source File: Ease.d.ts From anichart.js with MIT License | 5 votes |
export declare function customInOut(time: [number, number, number, number], range?: [number, number], interruption?: (typeof easeCubicOut)[]): (normalizedTime: number) => number;