Attempts to align prior data with new data, based on a provided similarity function.

See also alignById for a version which encloses parameters.

// Compare data based on x,y distance
const fn = (a, b) => {
return 1-Points.distance(a, b);
}
const lastData = [
{ id:`1`, x:100, y:200 }
...
]
const newData = [
{ id:`2`, x:101, y:200 }
]
const aligned = Correlate.align(fn, lastdata, newData, opts);

// Result:
[
{ id:`1`, x:101, y:200 }
]