function tableData (transitions, weeksAgo) {
const flows = transitions[transitions.length - weeksAgo]?.transitions
const prevFlows = transitions[transitions.length - weeksAgo - 1]?.transitions
const res = Object.keys(flows).map((flow, i) => {
const total = flows[flow]
const prevTotal = prevFlows[flow]
const growthRate = Math.round(((total - prevTotal) / prevTotal) * 100)
return {flow, total, prevTotal, growthRate }
})
return res
}