mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-04 00:24:14 +01:00
20 lines
446 B
JavaScript
20 lines
446 B
JavaScript
import "interpolate";
|
|
|
|
d3.interpolateArray = d3_interpolateArray;
|
|
|
|
function d3_interpolateArray(a, b) {
|
|
var x = [],
|
|
c = [],
|
|
na = a.length,
|
|
nb = b.length,
|
|
n0 = Math.min(a.length, b.length),
|
|
i;
|
|
for (i = 0; i < n0; ++i) x.push(d3_interpolate(a[i], b[i]));
|
|
for (; i < na; ++i) c[i] = a[i];
|
|
for (; i < nb; ++i) c[i] = b[i];
|
|
return function(t) {
|
|
for (i = 0; i < n0; ++i) c[i] = x[i](t);
|
|
return c;
|
|
};
|
|
}
|