Function alignById

Returns a function that attempts to align a series of data by its id. See also align for a version with no internal storage.

// Compare data based on x,y distance
const fn = (a, b) => {
return 1-Points.distance(a, b);
}
const aligner = Correlate.alignById(fn, opts);

const lastData = [
{ id:`1`, x:100, y:200 }
...
]
const aligned = aligner(lastData);