Unlisted
Edited
Aug 21, 2023
Insert cell
Insert cell
A(plot_ad8600) // 👍 #1649 is correct
Insert cell
A(Plot) // 🌶 in main, facets are not reindexed, resuting in the wrong stacking of Biscoe exclude
Insert cell
A(plot_20eeb56ba) // 🌶 with the older version of #1649 facets are reindexed, but the island channel is truncated (resulting in Torgensen exclude being filtered out)
Insert cell
// A(plot_ec740d5) // 👍 #1662 is correct (now merged into #1649)
Insert cell
A = (Plot) => {
const island = Plot.valueof(penguins, "island");
return Plot.plot({
width: 830,
marginLeft: 74,
marginRight: 68,
height: 130,
x: { domain: [0, penguins.length], round: true },
y: { label: "facet option", axis: "right" },
facet: { data: penguins, y: island },
fy: { label: "facet value" },
marks: [
Plot.barX(penguins, {
facet: "exclude",
fill: island, // array channel to be reindexed
x: 1,
y: () => "exclude",
fillOpacity: 0.5,
insetRight: 0.5
}),
Plot.barX(penguins, {
facet: "include",
fill: island,
x: 1,
y: () => "include"
}),
Plot.frame()
]
});
}
Insert cell
plot_20eeb56ba = FileAttachment("plot.umd-20eeb56ba.js").url().then(require)
Insert cell
plot_ec740d5 = FileAttachment("plot.umd-ec740d5.js").url().then(require)
Insert cell
plot_ad8600 = import("ini@ad8600b617225de251dfc1eefe69cc002c4c23e6")
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