=FileAttachment("../data/penguins.csv").csv({typed: true}) data
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: [
.dot(data, {x: "bill_length_mm", y: "bill_depth_mm", fill: "species"})
Plot,
]color: {legend: true}
})
Code
// Create plot with specification
.plot(penguinChart); Plot
// Create Olli adapters
.ObservablePlotAdapter(penguinChart).then((olliVisSpec) => {
OlliAdaptersdocument
.getElementById("fig-penguin-plot")
.append(olli(olliVisSpec));
})