filterChart = function(f, title, color){
let data = d3.map(gamesByDay, (d) => ({
date: new Date(d[0]),
value: f(d)
}))
return TimeChart(
data,
{
interval,
start,
stop,
max: d3.max(gamesByDay, d => d[0].length),
title: title,
marginTop: -16,
bands: 3,
width: 928,
scheme: color,
mode: 'mirror'
})
}