Ease¶
- detroit.ease_back(t: float) float¶
Symmetric anticipatory easing; scales
d3.ease_back_in\(\forall t \in [0, 0.5]\) andd3.ease_back_out\(\forall t \in [0.5, 1]\).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_back_in_out(0.2) -0.04967584000000001 >>> d3.ease_back_in_out.overshoot(1.5)(0.2) -0.04000000000000001
- detroit.ease_back_in(t: float) float¶
Anticipatory easing like a dancer bending her knees before jumping off the floor.
- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_back_in(0.2) -0.04645056000000002 >>> d3.ease_back_in.overshoot(1.5)(0.2) -0.040000000000000015
- detroit.ease_back_in_out(t: float) float¶
Symmetric anticipatory easing; scales
d3.ease_back_in\(\forall t \in [0, 0.5]\) andd3.ease_back_out\(\forall t \in [0.5, 1]\).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_back_in_out(0.2) -0.04967584000000001 >>> d3.ease_back_in_out.overshoot(1.5)(0.2) -0.04000000000000001
- detroit.ease_back_out(t: float) float¶
Reverse anticipatory easing; equivalent to
1 - d3.ease_back_in(1 - t).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_back_out(0.2) 0.7058022399999999 >>> d3.ease_back_out.overshoot(1.5)(0.2) 0.6799999999999999
- detroit.ease_bounce(t: float) float¶
Reverse bounce easing; equivalent to
1 - ease_bounce_in(1 - t).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_bounce_out(0.2) 0.30250000000000005
- detroit.ease_bounce_in(t: float) float¶
Bounce easing, like a rubber ball.
- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_bounce_in(0.2) 0.06000000000000005
- detroit.ease_bounce_in_out(t: float) float¶
Symmetric bounce easing; scales
d3.ease_bounce_in\(\forall t \in [0, 0.5]\) andd3.ease_bounce_out\(\forall t \in [0.5, 1]\).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_bounce_in_out(0.2) 0.11375000000000002
- detroit.ease_bounce_out(t: float) float¶
Reverse bounce easing; equivalent to
1 - ease_bounce_in(1 - t).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_bounce_out(0.2) 0.30250000000000005
- detroit.ease_circle(t: float) float¶
Symmetric circle easing; scales
d3.ease_circle_in\(\forall t \in [0, 0.5]\) andd3.ease_circle_out\(\forall t \in [0.5, 1]\).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_circle_in_out(0.2) 0.041742430504416006
- detroit.ease_circle_in(t: float) float¶
Circular easing.
- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_circle_in(0.2) 0.020204102886728803
- detroit.ease_circle_in_out(t: float) float¶
Symmetric circle easing; scales
d3.ease_circle_in\(\forall t \in [0, 0.5]\) andd3.ease_circle_out\(\forall t \in [0.5, 1]\).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_circle_in_out(0.2) 0.041742430504416006
- detroit.ease_circle_out(t: float) float¶
Reverse circular easing; equivalent to
1 - d3.ease_circle_out(1 - t).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_circle_out(0.2) 0.5999999999999999
- detroit.ease_cubic(t: float) float¶
Symmetric cubic easing; scales
d3.ease_cubic_in\(\forall t \in [0, 0.5]\) andd3.ease_cubic_out\(\forall t \in [0.5, 1]\). Also equivalent tod3.ease_poly.exponent(3).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_cubic_in_out(0.2) 0.03200000000000001
- detroit.ease_cubic_in(t: float) float¶
Cubic easing; equivalent to
d3.ease_poly_in.exponent(3).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_cubic_in(0.2) 0.008000000000000002
- detroit.ease_cubic_in_out(t: float) float¶
Symmetric cubic easing; scales
d3.ease_cubic_in\(\forall t \in [0, 0.5]\) andd3.ease_cubic_out\(\forall t \in [0.5, 1]\). Also equivalent tod3.ease_poly.exponent(3).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_cubic_in_out(0.2) 0.03200000000000001
- detroit.ease_cubic_out(t: float) float¶
Reverse cubic easing; equivalent to
1 - d3.ease_cubic_in(1 - t). Also equivalent tod3.ease_poly_out.exponent(3).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_cubic_out(0.2) 0.4879999999999999
- detroit.ease_elastic(t: float) float¶
Reverse elastic easing; equivalent to
1 - d3.elastic_in(1 - t).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_elastic_out(0.2) 1.1246334310850439 >>> d3.ease_elastic_out.amplitude(2)(0.2) 1.498533724340176 >>> d3.ease_elastic_out.period(0.5)(0.2) 1.2016611276301188 >>> d3.ease_elastic_out.amplitude(2).period(0.5)(0.2) 0.9478890359076215
- detroit.ease_elastic_in(t: float) float¶
Elastic easing, like a rubber band.
- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_elastic_in(0.2) -0.0014662756598240474 >>> d3.ease_elastic_in.amplitude(2)(0.2) -0.005865102639296188 >>> d3.ease_elastic_in.period(0.5)(0.2) -0.0023724838544719874 >>> d3.ease_elastic_in.amplitude(2).period(0.5)(0.2) -0.00535803787473666
- detroit.ease_elastic_in_out(t: float) float¶
Symmetric elastic easing; scales
d3.ease_elastic_in\(\forall t \in [0, 0.5]\) andd3.ease_elastic_out\(\forall t \in [0.5, 1]\).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_elastic_in_out(0.2) 0.007331378299120235 >>> d3.ease_elastic_in_out.amplitude(2)(0.2) 0.007331378299120243 >>> d3.ease_elastic_in_out.period(0.5)(0.2) 0.002265520486619852 >>> d3.ease_elastic_in_out.amplitude(2).period(0.5)(0.2) 0.014342340186712696
- detroit.ease_elastic_out(t: float) float¶
Reverse elastic easing; equivalent to
1 - d3.elastic_in(1 - t).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_elastic_out(0.2) 1.1246334310850439 >>> d3.ease_elastic_out.amplitude(2)(0.2) 1.498533724340176 >>> d3.ease_elastic_out.period(0.5)(0.2) 1.2016611276301188 >>> d3.ease_elastic_out.amplitude(2).period(0.5)(0.2) 0.9478890359076215
- detroit.ease_exp(t: float) float¶
Symmetric exponential easing; scales
d3.ease_exp_in\(\forall t \in [0, 0.5]\) andd3.ease_exp_out\(\forall t \in [0.5, 1]\). Also equivalent tod3.ease_poly.exponent(3).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_exp_in_out(0.2) 0.007331378299120235
- detroit.ease_exp_in(t: float) float¶
Exponential easing; raises 2 to the exponent \(10 \times (t - 1)\).
- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_exp_in(0.2) 0.002932551319648094
- detroit.ease_exp_in_out(t: float) float¶
Symmetric exponential easing; scales
d3.ease_exp_in\(\forall t \in [0, 0.5]\) andd3.ease_exp_out\(\forall t \in [0.5, 1]\). Also equivalent tod3.ease_poly.exponent(3).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_exp_in_out(0.2) 0.007331378299120235
- detroit.ease_exp_out(t: float) float¶
Reverse exponential easing; equivalent to
1 - d3.ease_exp_in(1 - t).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_exp_out(0.2) 0.750733137829912
- detroit.ease_linear(t: float) float¶
Linear easing; the identity function;
d3.ease_linear(t)returnst.- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_linear(0.2) 0.2
- detroit.ease_poly(t: float) float¶
Symmetric polynomial easing; scales
d3.ease_poly_in\(\forall t \in [0, 0.5]\) andd3.ease_poly_out\(\forall t \in [0.5, 1]\). If theexponentis not specified, it defaults to3, equivalent tod3.ease_cubic.- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_poly_in_out(0.2) 0.03200000000000001 >>> d3.ease_poly_in_out.exponent(5)(0.2) 0.005120000000000001
- detroit.ease_poly_in(t: float) float¶
Polynomial easing; raises t to the specified exponent. If the
exponentis not specified, it defaults to3, equivalent tod3.ease_cubic_in.- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_poly_in(0.2) 0.008000000000000002 >>> d3.ease_poly_in.exponent(5)(0.2) 0.0003200000000000001
- detroit.ease_poly_in_out(t: float) float¶
Symmetric polynomial easing; scales
d3.ease_poly_in\(\forall t \in [0, 0.5]\) andd3.ease_poly_out\(\forall t \in [0.5, 1]\). If theexponentis not specified, it defaults to3, equivalent tod3.ease_cubic.- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_poly_in_out(0.2) 0.03200000000000001 >>> d3.ease_poly_in_out.exponent(5)(0.2) 0.005120000000000001
- detroit.ease_poly_out(t: float) float¶
Reverse polynomial easing; equivalent to
1 - d3.ease_poly_in(1 - t). If theexponentis not specified, it defaults to3, equivalent tod3.ease_cubic_out.- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_poly_out(0.2) 0.4879999999999999 >>> d3.ease_poly_out.exponent(5)(0.2) 0.6723199999999999
- detroit.ease_quad(t: float) float¶
Symmetric quadratic easing; scales
d3.ease_quad_in\(\forall t \in [0, 0.5]\) andd3.ease_quad_out\(\forall t \in [0.5, 1]\). Also equivalent tod3.ease_poly.exponent(3).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_quad_in_out(0.2) 0.08000000000000002
- detroit.ease_quad_in(t: float) float¶
Quadratic easing; equivalent to
d3.ease_poly_in.exponent(2).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_quad_in(0.2) 0.04000000000000001
- detroit.ease_quad_in_out(t: float) float¶
Symmetric quadratic easing; scales
d3.ease_quad_in\(\forall t \in [0, 0.5]\) andd3.ease_quad_out\(\forall t \in [0.5, 1]\). Also equivalent tod3.ease_poly.exponent(3).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_quad_in_out(0.2) 0.08000000000000002
- detroit.ease_quad_out(t: float) float¶
Reverse quadratic easing; equivalent to
1 - d3.ease_quad_in(1 - t). Also equivalent tod3.ease_poly_out.exponent(2).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_quad_out(0.2) 0.36000000000000004
- detroit.ease_sin(t: float) float¶
Symmetric sinusoidal easing; scales
d3.ease_sin_in\(\forall t \in [0, 0.5]\) andd3.ease_sin_out\(\forall t \in [0.5, 1]\). Also equivalent tod3.ease_poly.exponent(3).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_sin_in_out(0.2) 0.09549150281252627
- detroit.ease_sin_in(t: float) float¶
Sinusoidal easing; returns
sin(t).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_sin_in(0.2) 0.04894348370484647
- detroit.ease_sin_in_out(t: float) float¶
Symmetric sinusoidal easing; scales
d3.ease_sin_in\(\forall t \in [0, 0.5]\) andd3.ease_sin_out\(\forall t \in [0.5, 1]\). Also equivalent tod3.ease_poly.exponent(3).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_sin_in_out(0.2) 0.09549150281252627
- detroit.ease_sin_out(t: float) float¶
Reverse sinusoidal easing; equivalent to
1 - d3.ease_sin_in(1 - t).- Parameters:
t (float) – \(t \in [0, 1]\)
- Returns:
Output value of the easing function
- Return type:
float
Examples
>>> d3.ease_sin_out(0.2) 0.3090169943749474