charted.core.interpolators library

A collection of interpolator generators and easing functions.

Interpolators provide intermediate state when transitioning from one frame to another in an animation.

Easing functions indicate progress of an animation to interpolators.

Currently provides interpolator for various types, including basic types like numbers, colors, strings, transforms and for iterables.

Constants

EASE_MODE_IN → const String
'in'
EASE_MODE_IN_OUT → const String
'in-out'
EASE_MODE_OUT → const String
'out'
EASE_MODE_OUT_IN → const String
'out-in'
EASE_TYPE_BACK → const String
'back'
EASE_TYPE_BOUNCE → const String
'bounce'
EASE_TYPE_CIRCLE → const String
'circle'
EASE_TYPE_CUBIC → const String
'cubic'
EASE_TYPE_ELASTIC → const String
'elastic'
EASE_TYPE_EXP → const String
'exp'
EASE_TYPE_LINEAR → const String
'linear'
EASE_TYPE_POLY → const String
'poly'
EASE_TYPE_QUAD → const String
'quad'
EASE_TYPE_SIN → const String
'sin'

Functions

clampEasingFn(EasingFunction f) EasingFunction
Clamps transition progress to stay between 0.0 and 1.0
createHslColorInterpolator(Color a, Color b) Interpolator<String>
Generate an interpolator using HSL color system converted to Hex string.
createInterpolatorByType(dynamic a, dynamic b) Interpolator
Creates an interpolator based on the type of a and b. [...]
createInterpolatorFromRegistry(dynamic a, dynamic b) Interpolator
Returns a default interpolator between values a and b. Unless more interpolators are added, one of the internal implementations are selected by the type of a and b.
createListInterpolator(List a, List b) Interpolator<List>
Generates an interpolator to interpolate each element between lists a and b using registered interpolators.
createMapInterpolator(Map a, Map b) Interpolator<Map>
Generates an interpolator to interpolate each value on a to b using registered interpolators.
createNumberInterpolator(num a, num b) Interpolator<num>
Generate a numeric interpolator between numbers a and b
createRgbColorInterpolator(Color a, Color b) Interpolator<String>
Generate an interpolator for RGB values.
createRoundedNumberInterpolator(num a, num b) Interpolator<num>
Generate a rounded number interpolator between numbers a and b
createStringInterpolator(String a, String b) Interpolator<String>
Generate an interpolator between two strings a and b. [...]
createTransformInterpolator(String a, String b) Interpolator<String>
Returns the interpolator that interpolators two transform strings a and b by their translate, rotate, scale and skewX parts.
createZoomInterpolator(List a, List b) Interpolator<List<num>>
Returns the interpolator that interpolators zoom list a to b. Zoom lists are described by triple elements ux0, uy0, w0 and ux1, uy1, w1.
easeBack([num s = 1.70158 ]) EasingFunction
easeBounce() EasingFunction
easeCircle() EasingFunction
easeCubic() EasingFunction
easeCubicInOut() EasingFunction
easeElastic([num a = 1, num p = 0.45 ]) EasingFunction
easeExp() EasingFunction
easePoly([num e = 1 ]) EasingFunction
easeQuad() EasingFunction
easeSin() EasingFunction
reflectEasingFn(EasingFunction f) EasingFunction
reflectReverseEasingFn(EasingFunction f) EasingFunction
reverseEasingFn(EasingFunction f) EasingFunction
uninterpolateClamp(num a, num b) Interpolator<num>
Reverse interpolator for a clamped number.
uninterpolateNumber(num a, num b) Interpolator<num>
Reverse interpolator for a number.

Typedefs

EasingFunction(num t) num
EasingFunction manipulates progression of an animation. The returned value is passed to an Interpolator to generate intermediate state.
EasingModeFunction(EasingFunction fn) EasingFunction
Alters behavior of the EasingFunction. Takes fn and returns an altered EasingFunction.
Interpolator<S>(num t) → S
Interpolator accepts t, such that 0.0 < t < 1.0 and returns a value in a pre-defined range.
InterpolatorGenerator<T, S>(T a, T b) Interpolator<S>
InterpolatorGenerator accepts two parameters a, b and returns an Interpolator for transitioning from a to b