[openstreetmap/openstreetmap-website] Change heatmap color to linear from 0 to max changes (PR #5833)

Holger Jeromin notifications at github.com
Fri Mar 21 10:00:28 UTC 2025


@HolgerJeromin commented on this pull request.



> @@ -59,9 +60,10 @@ document.addEventListener("DOMContentLoaded", () => {
       },
       scale: {
         color: {
-          type: "threshold",
-          range: currentTheme === "dark" ? rangeColors : Array.from(rangeColors).reverse(),
-          domain: [10, 20, 30, 40]
+          type: "linear",
+          // reverse mutates the array. But with theme changes we must work on the original data.
+          range: currentTheme === "dark" ? rangeColors : Array.from(rangeColors).toReversed(),

I experimented with `toReversed` (from es2023) and failed to revert as I found that eslint had es2021 as min version.

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

Message ID: <openstreetmap/openstreetmap-website/pull/5833/review/2705366978 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250321/25277053/attachment.htm>


More information about the rails-dev mailing list