Public
Edited
Aug 25, 2023
Insert cell
Insert cell
data = FileAttachment("superconductivity-data.csv").csv({ typed: true })
Insert cell
notations = [
{
name: "0 degrees centigrate",
value: 273.15
},
{
name: "Liquid nitrogen",
value: 77.36
},
{
name: "Liquid Helium",
value: 4.15
},
{
name: "Liquid hydrogen",
value: 20.28
},
{
name: "Room temperature",
value: 293
}
]
Insert cell
data.columns
Insert cell
d3.extent(data.map((d) => d["Temp (K)"]))
Insert cell
d3.extent(data.map((d) => d["Pressure (GPa)"]))
Insert cell
new Set(data.map((d) => d["TYPE"]))
Insert cell
Plot.plot({
y: { grid: true, domain: [0, 300] },
x: { type: "log", domain: [0.0001, 1000] },
color: { legend: true },
marginRight: 100,
marks: [
Plot.ruleY([1]),
Plot.ruleY(
notations.map((d) => d.value),
{ strokeWidth: 1, strokeDasharray: "4 1" }
),
Plot.text(notations, {
x: 1000,
y: "value",
dx: 4,
text: "name",
textAnchor: "start"
}),
Plot.dot(data, {
x: "Pressure (GPa)",
y: "Temp (K)",
r: 4,
fill: "TYPE",
title: "YEAR"
})
]
})
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