{
const selected = data.slice(selectIdx, selectIdx + 1);
return Plot.plot({
grid: true,
x: { nice: true },
y: { nice: true },
color: {
scheme: "Blues",
nice: true,
legend: true,
domain: [-1, d3.max(data, (d) => d.order) + 1]
},
marks: [
displayRaster
? Plot.raster(searchlightData, {
x: "x",
y: "y",
fill: "order",
blue: 5,
interpolate: "barycentric"
})
: undefined,
Plot.voronoi(data, {
x: "x",
y: "y",
stroke: "gray",
fill: displayRaster ? undefined : "order",
opacity: displayRaster ? 0.8 : 0.5
}),
Plot.dot(selected, {
x: "x",
y: "y",
r: 10,
strokeWidth: 2,
stroke: color
}),
Plot.dot(searchlightData, { x: "x", y: "y", fill: color, opacity: 0.5 }),
Plot.text(searchlightData, {
x: "x",
y: "y",
text: "order",
dy: -8,
dx: 8,
fill: color,
fontSize: 15,
opacity: 0.5
}),
Plot.frame()
]
});
}