Public
Edited
Feb 17
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
calmonthlyFDCs = Array.from({ length: 12 }, (v, i) => {
return {
month: i+1,
flows: calmonthlyFdc_raw.map(l=>l[i+1]),
exceedance: calmonthlyFdc_raw.map(l=>l['']),
}
})
Insert cell
calmonthlyFdc_raw = (await d3.csv( baseFolder + "ngonye_monthly_fdc.csv?" + Math.floor(Math.random() * 1000),d3.autoType))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function interpolate(data, xs, ys , x) {
const sorted = data.toSorted((a, b) => a[xs] - b[xs])
const indx = d3.bisectLeft(sorted.map(v=>v[xs]), x)
if (indx==0 || x==sorted[indx][xs]) return sorted[indx][ys]
const a=sorted[indx-1]
const b=sorted[indx]
return a[ys] + ((b[ys] - a[ys])/(b[xs]-a[xs])*(x-a[xs]))
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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