ratioData = function(series, nom, denom, off) {
const offLeft = Math.floor((off+1) / 2);
const offRight = off - offLeft;
return series
.map((d, indx, arr) => ({
date: d.date,
value: !chkbounds(arr.length, indx, offLeft, offRight)
? null
: [arr[indx + offLeft][nom], arr[indx - offRight][denom]]
}))
.map((d, indx, arr) => ({
date: d.date,
value: d.value ? ratio(d.value[0], d.value[1]) : null
}))
.filter(d => (d.value || d.value===0));
}