[openstreetmap/openstreetmap-website] Add user profile heatmap visualization for contributions (PR #5402)

Emin Kocan notifications at github.com
Fri Jan 24 16:24:18 UTC 2025


@kcne commented on this pull request.



> +//= require popper
+//= require tooltip
+
+
+/* global CalHeatmap, CalendarLabel, Tooltip */
+document.addEventListener("DOMContentLoaded", () => {
+  const heatmapElement = document.querySelector("#cal-heatmap");
+
+  if (!heatmapElement) {
+    console.warn("Heatmap element not found in the DOM.");
+    return;
+  }
+
+  const heatmapData = heatmapElement.dataset.heatmap ? JSON.parse(heatmapElement.dataset.heatmap) : [];
+  const colorScheme = heatmapElement.dataset.siteColorScheme || "auto";
+  const locale = $("head").data().locale;

I noticed you opened #5538. Are the changes there related to the initialization concerns mentioned here?  

Regarding delaying the heatmap or using a turbo frame/collapsible section for performance, I’m not sure about the best metrics to determine what's acceptable in terms of load time/size or resource usage. Here's the network tab from Chrome when testing locally with the cache disabled: 

![Screenshot 2025-01-24 at 17 20 16](https://github.com/user-attachments/assets/df1b8c92-ec1c-4ac8-a88e-6a17c2050a5d)  

If there are specific metrics or scenarios you'd recommend testing to ensure this is performant and I18n is properly initialized, I’d be happy to try those out.

Thank you.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5402#discussion_r1928941127
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5402/review/2573085557 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250124/459e1343/attachment-0001.htm>


More information about the rails-dev mailing list