From bbb70950812af5d338589421da380dcb1a5c7f4d Mon Sep 17 00:00:00 2001 From: Ewan Breakey Date: Wed, 12 Apr 2023 23:54:40 +1000 Subject: [PATCH] Update hue-map to v1.0 --- crabfit-frontend/package.json | 2 +- .../components/AvailabilityViewer/AvailabilityViewer.jsx | 4 ++-- crabfit-frontend/src/components/Legend/Legend.jsx | 4 ++-- crabfit-frontend/yarn.lock | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/crabfit-frontend/package.json b/crabfit-frontend/package.json index 6e59f62..a7482ba 100644 --- a/crabfit-frontend/package.json +++ b/crabfit-frontend/package.json @@ -14,7 +14,7 @@ "dayjs": "^1.11.5", "gapi-script": "^1.2.0", "goober": "^2.1.10", - "hue-map": "^0.1.1", + "hue-map": "^1.0.0", "i18next": "^21.9.0", "i18next-browser-languagedetector": "^6.1.5", "i18next-http-backend": "^1.4.1", diff --git a/crabfit-frontend/src/components/AvailabilityViewer/AvailabilityViewer.jsx b/crabfit-frontend/src/components/AvailabilityViewer/AvailabilityViewer.jsx index c863501..2458595 100644 --- a/crabfit-frontend/src/components/AvailabilityViewer/AvailabilityViewer.jsx +++ b/crabfit-frontend/src/components/AvailabilityViewer/AvailabilityViewer.jsx @@ -4,7 +4,7 @@ import dayjs from 'dayjs' import localeData from 'dayjs/plugin/localeData' import customParseFormat from 'dayjs/plugin/customParseFormat' import relativeTime from 'dayjs/plugin/relativeTime' -import createPalette from 'hue-map' +import { createPalette } from 'hue-map' import { useSettingsStore, useLocaleUpdateStore } from '/src/stores' @@ -72,7 +72,7 @@ const AvailabilityViewer = ({ useEffect(() => setPalette(createPalette({ map: colormap === 'crabfit' ? [[0, [247,158,0,0]], [1, [247,158,0,255]]] : colormap, steps: tempFocus !== null ? 2 : Math.min(max, filteredPeople.length)+1, - })), [tempFocus, filteredPeople, max, colormap]) + }).format()), [tempFocus, filteredPeople, max, colormap]) const heatmap = useMemo(() => ( diff --git a/crabfit-frontend/src/components/Legend/Legend.jsx b/crabfit-frontend/src/components/Legend/Legend.jsx index c124455..1178510 100644 --- a/crabfit-frontend/src/components/Legend/Legend.jsx +++ b/crabfit-frontend/src/components/Legend/Legend.jsx @@ -1,6 +1,6 @@ import { useState, useEffect } from 'react' import { useTranslation } from 'react-i18next' -import createPalette from 'hue-map' +import { createPalette } from 'hue-map' import { useSettingsStore } from '/src/stores' @@ -27,7 +27,7 @@ const Legend = ({ useEffect(() => setPalette(createPalette({ map: colormap === 'crabfit' ? [[0, [247,158,0,0]], [1, [247,158,0,255]]] : colormap, steps: max+1-min, - })), [min, max, colormap]) + }).format()), [min, max, colormap]) return ( diff --git a/crabfit-frontend/yarn.lock b/crabfit-frontend/yarn.lock index 86b20f5..ff00c63 100644 --- a/crabfit-frontend/yarn.lock +++ b/crabfit-frontend/yarn.lock @@ -2185,10 +2185,10 @@ html-parse-stringify@^3.0.1: dependencies: void-elements "3.1.0" -hue-map@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/hue-map/-/hue-map-0.1.1.tgz#d6b199f4121df56aaf1901222323545f0607a31d" - integrity sha512-aH3Maa39vHN+yTkWXdLcTN8M+ftGOX6NvGuMObl2puWxwoUZhm3gLlKA6SdpqJphF1RzQo0ntsm0Psg0uc7ouQ== +hue-map@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/hue-map/-/hue-map-1.0.0.tgz#16061043db2015c15dcfb9229390ca7c7fb27cd4" + integrity sha512-L7n6cfthm9ZTdYbqJF1yBflHvI4MaWRg+XMJ4Ifc35jWcOfQlCRBETZ4ntnHLPUyDOse7KeelcsbWxx14Aaa+w== i18next-browser-languagedetector@^6.1.5: version "6.1.5"