@malkiii/d3-ease v3.1.4
d3-ease
This is a Typescript version from the original d3-ease.
Easing is a method of distorting time to control apparent motion in animation. It is most commonly used for slow-in, slow-out. By easing time, animated transitions are smoother and exhibit more plausible motion.
The easing types in this module implement the ease method, which takes a normalized time t and returns the corresponding “eased” time tʹ. Both the normalized time and the eased time are typically in the range 0,1, where 0 represents the start of the animation and 1 represents the end; some easing types, such as elastic, may return eased times slightly outside this range. A good easing type should return 0 if t = 0 and 1 if t = 1. See the easing explorer for a visual demonstration.
These easing types are largely based on work by Robert Penner.
Installing
using npm:
npm i @malkiii/d3-ease
using yarn:
yarn add @malkiii/d3-ease
Usage
import { easeCubic, easeQuad, easeExpInOut } from '@malkiii/d3-ease';
const e1 = easeCubic(1.25);
const e2 = easeCubic(0.83);
const e3 = easeQuad(0.5);
const e4 = easeQuad(1.47);
const e5 = easeExpInOut(5.11);