Published
Edited
Sep 19, 2019
1 fork
Importers
10 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function backIn(t) {
var s = 1.70158;
return t * t * ((s + 1) * t - s);
}
Insert cell
Insert cell
function backInOut(t) {
var s = 1.70158 * 1.525;
if ((t *= 2) < 1) return 0.5 * (t * t * ((s + 1) * t - s));
return 0.5 * ((t -= 2) * t * ((s + 1) * t + s) + 2);
}
Insert cell
Insert cell
function backOut(t) {
var s = 1.70158;
return --t * t * ((s + 1) * t + s) + 1;
}
Insert cell
Insert cell
function bounceIn(t) {
return 1.0 - bounceOut(1.0 - t);
}
Insert cell
Insert cell
function bounceInOut(t) {
return t < 0.5
? 0.5 * (1.0 - bounceOut(1.0 - t * 2.0))
: 0.5 * bounceOut(t * 2.0 - 1.0) + 0.5;
}
Insert cell
Insert cell
function bounceOut(t) {
var a = 4.0 / 11.0;
var b = 8.0 / 11.0;
var c = 9.0 / 10.0;

var ca = 4356.0 / 361.0;
var cb = 35442.0 / 1805.0;
var cc = 16061.0 / 1805.0;

var t2 = t * t;

return t < a
? 7.5625 * t2
: t < b
? 9.075 * t2 - 9.9 * t + 3.4
: t < c
? ca * t2 - cb * t + cc
: 10.8 * t * t - 20.52 * t + 10.72;
}
Insert cell
Insert cell
function circIn(t) {
return 1.0 - Math.sqrt(1.0 - t * t);
}
Insert cell
Insert cell
function circInOut(t) {
if ((t *= 2) < 1) return -0.5 * (Math.sqrt(1 - t * t) - 1);
return 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);
}
Insert cell
Insert cell
function circOut(t) {
return Math.sqrt(1 - --t * t);
}
Insert cell
Insert cell
function cubicIn(t) {
return t * t * t;
}
Insert cell
Insert cell
function cubicInOut(t) {
return t < 0.5 ? 4.0 * t * t * t : 0.5 * Math.pow(2.0 * t - 2.0, 3.0) + 1.0;
}
Insert cell
Insert cell
function cubicOut(t) {
var f = t - 1.0;
return f * f * f + 1.0;
}
Insert cell
Insert cell
function elasticIn(t) {
return Math.sin((13.0 * t * Math.PI) / 2) * Math.pow(2.0, 10.0 * (t - 1.0));
}
Insert cell
Insert cell
function elasticInOut(t) {
return t < 0.5
? 0.5 *
Math.sin(((+13.0 * Math.PI) / 2) * 2.0 * t) *
Math.pow(2.0, 10.0 * (2.0 * t - 1.0))
: 0.5 *
Math.sin(((-13.0 * Math.PI) / 2) * (2.0 * t - 1.0 + 1.0)) *
Math.pow(2.0, -10.0 * (2.0 * t - 1.0)) +
1.0;
}
Insert cell
Insert cell
function elasticOut(t) {
return (
Math.sin((-13.0 * (t + 1.0) * Math.PI) / 2) * Math.pow(2.0, -10.0 * t) + 1.0
);
}
Insert cell
Insert cell
function expoIn(t) {
return t === 0.0 ? t : Math.pow(2.0, 10.0 * (t - 1.0));
}
Insert cell
Insert cell
function expoInOut(t) {
return t === 0.0 || t === 1.0
? t
: t < 0.5
? +0.5 * Math.pow(2.0, 20.0 * t - 10.0)
: -0.5 * Math.pow(2.0, 10.0 - t * 20.0) + 1.0;
}
Insert cell
Insert cell
function expoOut(t) {
return t === 1.0 ? t : 1.0 - Math.pow(2.0, -10.0 * t);
}
Insert cell
Insert cell
function linear(t) {
return t;
}
Insert cell
Insert cell
function quadIn(t) {
return t * t;
}
Insert cell
Insert cell
function quadInOut(t) {
t /= 0.5;
if (t < 1) return 0.5 * t * t;
t--;
return -0.5 * (t * (t - 2) - 1);
}
Insert cell
Insert cell
function quadOut(t) {
return -t * (t - 2.0);
}
Insert cell
Insert cell
function quartIn(t) {
return Math.pow(t, 4.0);
}
Insert cell
Insert cell
function quartInOut(t) {
return t < 0.5
? +8.0 * Math.pow(t, 4.0)
: -8.0 * Math.pow(t - 1.0, 4.0) + 1.0;
}
Insert cell
Insert cell
function quartOut(t) {
return Math.pow(t - 1.0, 3.0) * (1.0 - t) + 1.0;
}
Insert cell
Insert cell
function quintIn(t) {
return t * t * t * t * t;
}
Insert cell
Insert cell
function quintInOut(t) {
if ((t *= 2) < 1) return 0.5 * t * t * t * t * t;
return 0.5 * ((t -= 2) * t * t * t * t + 2);
}
Insert cell
Insert cell
function quintOut(t) {
return --t * t * t * t * t + 1;
}
Insert cell
Insert cell
function sineIn(t) {
var v = Math.cos(t * Math.PI * 0.5);
if (Math.abs(v) < 1e-14) return 1;
else return 1 - v;
}
Insert cell
Insert cell
function sineInOut(t) {
return -0.5 * (Math.cos(Math.PI * t) - 1);
}
Insert cell
Insert cell
function sineOut(t) {
return Math.sin((t * Math.PI) / 2);
}
Insert cell
Insert cell
stdlib = require('https://unpkg.com/@stdlib/stdlib@0.0.85/dist/stdlib-flat.min.js')
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more