@hlfan 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(),
Array.toReversed() has only been available in browsers since mid-2023 and
wouldn't be needed in combination with Array.from().
I think the previous version was fine enough, `[...rangeColors].reverse()`
would also work.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5833#pullrequestreview-2705354645
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/5833/review/2705354...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev