Plot.plot({
width:width,
x:{
axis:null
},
y:{
tickFormat:i => "SMTWTFS"[i],
tickSize:0
},
facet: {
data: data,
y: d => d.date.getUTCFullYear(),
},
marks: [
Plot.text(data,{
x: d => d3.utcWeek.count(d3.utcYear(d.date), d.date),
y: d => d.date.getUTCDay(),
text: (d) => {
const emoji = { "rain": "🌧", "drizzle": "🌦", "fog": "🌫", "sun": "☀️", "snow": "❄️"}
return emoji[d.weather]
},
fontSize:12
})
]
})