Observable Penguins with Olli

data=FileAttachment("../data/penguins.csv").csv({typed: true})

If we want to use Olli with Observable, we need to separate the plot command from the plot specification:

penguinChart = ({
  marks: [
    Plot.dot(data, {x: "bill_length_mm", y: "bill_depth_mm", fill: "species"})
  ],
  color: {legend: true}
})
Code
// Create plot with specification
Plot.plot(penguinChart);
Figure 1: Bill length and depth in mm for three different species of penguins.
// Create Olli adapters
OlliAdapters.ObservablePlotAdapter(penguinChart).then((olliVisSpec) => {
document
.getElementById("fig-penguin-plot")
.append(olli(olliVisSpec));
})