Plot.plot({
facet: { data, y: d => d.date.getUTCFullYear() },
fy: { tickPadding: 0, reverse: true },
x: { label: 'Week of year' },
y: { tickFormat: Plot.formatWeekday() },
color: { scheme: 'gnbu', type: 'log' },
marks: [
Plot.cell(data, {
x: d => d3.utcWeek.count(d3.utcYear(d.date), d.date),
y: d => d3.utcDay.count(d3.utcWeek(d.date), d.date),
title: d => `${d.views} page views on ${d.date}`,
fill: 'views'
})
],
width,
marginTop: 0,
marginRight: 50,
marginBottom: 35,
style: { background: '#fff' }
})