Plot.plot({
color: { scheme: "blues" },
marks: [
Plot.dot(
penguins,
Plot.hexbin(
{ fill: "count" },
{ x: "culmen_depth_mm", y: "culmen_length_mm" }
)
),
Plot.tip(
penguins,
Plot.pointer(
Plot.hexbin(
{
"": (data) => Plot.valueof(data, "species").join(", "),
"🏝️": (data) => Plot.valueof(data, "island").map(islands).join(", ")
},
{
x: "culmen_depth_mm",
y: "culmen_length_mm",
lineHeight: 1.3,
textOverflow: "ellipsis-start"
}
)
)
)
]
})