Recently I searched for GitHub's punch card feature which used to be part of the Graphs aka Insights tab. It seems it's no longer available from the user interface. Luckily the GitHub API still offers an endpoint which spits out the data used by the punch card.
xoff = 130
yoff = 80
g(font_size: 18, font_family: 'Helvetica', fill: '#555') do
%w[Sunday Monday Tuesday Wednesday Thursday Friday Saturday].each_with_index do |day, idx|
text(day, x: xoff, y: yoff + (idx * 40), 'text-anchor': 'end')
Render a circle:
circle(cx: 10, cy: 20, r: 10, fill: '#ccc')
The least trivial thing was to display tooltips containing the number of commits when hovering over a cell. It turns out you need to create a rect containing a title to do this. Since each circle has a different radius I decided to draw a transparent rect on top of each cell making the hit box for each tooltip as big as possible.