Published
Edited
Oct 3, 2020
Insert cell
md`# SL Rivers`
Insert cell
d3 = require('d3')
Insert cell
async function getRiverData() {
return (await d3.csv(
'https://raw.githubusercontent.com/nuuuwan/misc-sl-data/master/geography.sl.rivers.csv'
)).map(function(d) {
const label = d.name;
const x = parseInt(d.length_km);
const xy = parseInt(d.catchment_area_km2);
const xyz = parseInt(d.precipitation_volume_Mm3);
return [x, xy, xyz];
return {
label: label,
xyz: [x, xy / x, xyz / xy]
};
});
}
Insert cell
getRiverData()
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