data=FileAttachment("../data/penguins.csv").csv({typed: true})Observable Penguins with Olli
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);// Create Olli adapters
OlliAdapters.ObservablePlotAdapter(penguinChart).then((olliVisSpec) => {
document
.getElementById("fig-penguin-plot")
.append(olli(olliVisSpec));
})