Public
Edited
Jul 15, 2023
3 forks
7 stars
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
style: "overflow: visible;",
insetTop: 30,
marginTop: 30,
marginRight: 100,
marks: [
Plot.tickY(global_temps, {x: "name", y: "value", sort: {x: "y"}, stroke: "value", title: "name", r: "value", opacity: 1, title: d=>d.yeardate + "\n" + d.value, opacity: 0.6, strokeWidth: 3,
filter: d=>d.year <= yearin
}),
Plot.axisY({ tickSize: 0, fontSize: 25, label: "Global surface temperatures", anchor: "right", labelAnchor: "center", ticks: 10, fill: "gray"}),
Plot.axisX({ tickSize: 0, fontSize: 25, label: "", anchor: "bottom", labelAnchor: "center", fill: "gray"}),
Plot.text([`Global Surface\nTemperatures`], {y:1.3, dx: -390, frameAnchor: "middle", fontSize:60, lineWidth: 25, textAnchor: "start", lineHeight: 1.2, clip: false, fill: "gray", opacity: 0.4}),
Plot.text(global_temps, {y:1, dx: -390, frameAnchor: "middle", fontSize: 100, text: "yearc", lineWidth: 25, textAnchor: "start", lineHeight: 1.2, clip: false, fill: "value", opacity: 2, filter: d=>d.year === yearin}),
Plot.text([`Data Source: TidyTuesday | Design: Deepsha Menghani | threads: IandLoveandDate`], {y:-0.6, dx: -100, dy:70, frameAnchor: "middle", fontSize: 14, fontStyle: "oblique", lineWidth: 70, textAnchor: "start", lineHeight: 1.2, clip: false, fill: "gray", opacity: 1}),
],
//r: { range: [1, 25]},
color: {scheme: "BuRd"},
height: 1000,
width: 1000,
marginBottom: 100,
marginLeft: 75
})
Insert cell
global_nh_sh_temps.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
global_nh_sh_temps
select *, REPLACE(CAST(year as varchar(10)), '.0', '') as yearc
from global_nh_sh_temps
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