Published
Edited
Jan 19, 2022
4 stars
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.barY(alphabet, {
x: "letter",
y: "frequency",
fill: (d) => (d.letter === "T" ? "red" : "black") // ???
})
]
})
Insert cell
import {alphabet} from "@observablehq/plot-bar"
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.barY(alphabet, {
x: "letter",
y: "frequency",
fill: (d) => "AEIOU".includes(d.letter)
})
]
})
Insert cell
Insert cell
Plot.plot({
color: {type: "identity"}, // makes "red" come through as red for fill and stroke!
marks: [
Plot.barY(alphabet, {
x: "letter",
y: "frequency",
fill: (d) => (d.letter === "T" ? "red" : "black")
})
]
})
Insert cell
import {notice} from "@tophtucker/scrapbook"
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