function qq({x: X, y: Y, ...options} = {}) {
const n = Math.min(X.length, Y.length);
function q(qi, i, Q) {
if (Q.length === n) return qi;
const j = i / (n - 1) * (Q.length - 1);
const j0 = Math.floor(j);
const t = j - j0;
return t ? Q[j0] * (1 - t) + Q[j0 + 1] * t : Q[j0];
}
X = d3.sort(X).map(q);
Y = d3.sort(Y).map(q);
const min = Math.min(X[0], Y[0]);
const max = Math.max(X[n - 1], Y[n - 1]);
return Plot.marks(
Plot.link({length: 1}, {x1: min, y1: min, x2: max, y2: max}),
Plot.dot({length: n}, {...options, x: X, y: Y})
);
}