Public
Edited
Jun 17, 2024
2 stars
Insert cell
Insert cell
viewof f = Inputs.range([-8, 8], { label: "Frequency:", value: 1, step: 0.01 })
Insert cell
plot = Plot.plot({
width: 800,
height: 200,
y: { domain: [-1.2, 1.2] },
marks: [
Plot.line(d3.range(-3, 3, 0.01).map((x) => [x, Math.sin(f * x)])),
Plot.axisX({ y: 0 }),
Plot.ruleY([0]),
Plot.axisY({ x: 0 }),
Plot.ruleX([0])
]
})
Insert cell
table = {
let table = d3.create("table");
let header_row = table.append("tr");
penguins.columns.forEach(function (s) {
header_row.append("th").text(s);
});
penguins.slice(0, 20).forEach(function (r) {
let row = table.append("tr");
penguins.columns.forEach(function (s) {
let value =
s != "species" && s != "island" && s != "sex" && isNaN(r[s])
? ""
: r[s];
row.append("td").text(value);
});
});
return table.node();
}
Insert cell
penguins.columns
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more