occlusionY = (options) =>
Plot.initializer(
options,
(
data,
facets,
{ y: { value: Y }, text: { value: T } },
{ y: sy },
dimensions,
context
) => {
let RADIUS = 5.5;
for (const index of facets) {
const nodes = Array.from(index, (i) => ({
y: sy(Y[i]),
i
}));
nodes.sort((a, b) => a.y - b.y);
const positions = g(
nodes.map((d) => d.y),
RADIUS
);
positions.forEach((p, i) => {
Y[nodes[i].i] = p;
});
}
return { data, facets, channels: { y: { value: Y } } };
}
)