How would you approach building a GitHub contribution chart?

I have been trying to figure out how one would approach build a contribution chart/heatmap in Glide.

You could probably use Glide AI for the visual part but when it comes to how best structure a database around this I am a bit stumped. Especially when looking at multiple users.

My thinking so far is that you would need the following tables:

  • Calendar table: for every day of the year
  • Activity table: activity, userid, date, rel to cal table

Any ideas would be great.

1 Like

Yea I think you’ve nailed the data part of solution, using a calendar with dynamic dates that pulls in the past 13 months (so you get current month last year) and then relating it to an activity table.

The calendar table should probably also do a rollup for Activity count to generate the heatmap value.

Guaranteed the hardest part is going to be getting the AI component to properly handle the date values and display a heatmap that aligns with the dates. Could be wrong, but I’ve had some real problems with the AI component and dates.

2 Likes

I agree with this. I think JSON is the way to go for this one for input, but it’s gonna be a problem getting it to work with AI Component.

Maybe JS to convert it to HTML is a better way.

2 Likes