Public
Edited
Feb 2, 2023
2 forks
Insert cell
Insert cell
Insert cell

Plot.plot({
marks: [
Plot.cell(selected_fam.deps, { // a cell is a rectangle
x: "downstream_asn", // for each item_a there will be an x position
y: "upstream_asn", // for each item_b there will be a y position
fill: "dependency_pct", // the fill color will correspond to the count
sort: { y: "fill", x: "fill", reverse: true, limit: 20 }
}),
// Add a textual annotation to each cell
/* Plot.text(selected_fam.deps, colorContrast({ // colorContrast is a transform that changes the text color for accessibility
x: "downstream_asn",
y: "upstream_asn",
text: "dependency_pct",
fill: "dependency_pct",
pointerEvents: "none", // make the text ignore the mouse pointer (so the cell tooltip works)
})) */
],
color: { scheme: "blues", legend: true }, // change the color scheme and show a legend
grid: true,
marginLeft: 300,
marginBottom: 400,
x: { tickRotate: 90},
})
Insert cell
familyHegemony = FileAttachment("family-hegemony@4.json").json()
Insert cell
import { colorContrast } from "@observablehq/plot-colorcontrast-custom-transform"
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more