function domainY(data, { x, y, transform, reverse = true, top } = {}) {
if (transform) transform(data, [d3.range(data.length)]);
const X = x.transform ? x.transform() : x;
const Y = y.transform ? y.transform() : y;
const I = d3.range(X.length);
let Z = d3.sort(I, (i) => Y[i]).map((i) => X[i]);
if (reverse) Z.reverse();
if (top) Z = Z.slice(0, top);
return Z;
}