Public
Edited
Aug 6, 2023
Insert cell
Insert cell
data = loadData()
Insert cell
data
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
data
X
angle
Y
extent
Color
year
Size
Facet X
Facet Y
Mark
dot
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
async function loadData() {
const data = await FileAttachment("S_seaice_extent_daily_v3@3.0.csv").csv({
typed: true
});

const daysPerYear = 365.256363;
const oneDayInMillis = 1000 * 60 * 60 * 24;
const start = new Date(1978, 0, 0);
const twoPi = 2 * Math.PI;

const extentAverage = data.map((row) => row.Extent).reduce((x, y) => x + y, 0) / data.length;
return data.map((row) => {
const now = new Date(`${row.Year}-${row.Month}-${row.Day}`);
const day = (now - start) / oneDayInMillis;

// https://physics.stackexchange.com/questions/177949
const angle = twoPi * (day - 4) / daysPerYear % twoPi;
const distance = 1 - 0.01672 * Math.cos(angle);

const year = row.Year;
const extent = row.Extent - (extentAverage - 8 * Math.cos(angle - 0.8));

return { now, year, day, extent, angle, distance };
});
}
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