Update hue-map to v1.0

This commit is contained in:
Ewan Breakey 2023-04-12 23:54:40 +10:00
parent 9d4e3c833a
commit bbb7095081
4 changed files with 9 additions and 9 deletions

View file

@ -14,7 +14,7 @@
"dayjs": "^1.11.5", "dayjs": "^1.11.5",
"gapi-script": "^1.2.0", "gapi-script": "^1.2.0",
"goober": "^2.1.10", "goober": "^2.1.10",
"hue-map": "^0.1.1", "hue-map": "^1.0.0",
"i18next": "^21.9.0", "i18next": "^21.9.0",
"i18next-browser-languagedetector": "^6.1.5", "i18next-browser-languagedetector": "^6.1.5",
"i18next-http-backend": "^1.4.1", "i18next-http-backend": "^1.4.1",

View file

@ -4,7 +4,7 @@ import dayjs from 'dayjs'
import localeData from 'dayjs/plugin/localeData' import localeData from 'dayjs/plugin/localeData'
import customParseFormat from 'dayjs/plugin/customParseFormat' import customParseFormat from 'dayjs/plugin/customParseFormat'
import relativeTime from 'dayjs/plugin/relativeTime' import relativeTime from 'dayjs/plugin/relativeTime'
import createPalette from 'hue-map' import { createPalette } from 'hue-map'
import { useSettingsStore, useLocaleUpdateStore } from '/src/stores' import { useSettingsStore, useLocaleUpdateStore } from '/src/stores'
@ -72,7 +72,7 @@ const AvailabilityViewer = ({
useEffect(() => setPalette(createPalette({ useEffect(() => setPalette(createPalette({
map: colormap === 'crabfit' ? [[0, [247,158,0,0]], [1, [247,158,0,255]]] : colormap, map: colormap === 'crabfit' ? [[0, [247,158,0,0]], [1, [247,158,0,255]]] : colormap,
steps: tempFocus !== null ? 2 : Math.min(max, filteredPeople.length)+1, steps: tempFocus !== null ? 2 : Math.min(max, filteredPeople.length)+1,
})), [tempFocus, filteredPeople, max, colormap]) }).format()), [tempFocus, filteredPeople, max, colormap])
const heatmap = useMemo(() => ( const heatmap = useMemo(() => (
<Container> <Container>

View file

@ -1,6 +1,6 @@
import { useState, useEffect } from 'react' import { useState, useEffect } from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import createPalette from 'hue-map' import { createPalette } from 'hue-map'
import { useSettingsStore } from '/src/stores' import { useSettingsStore } from '/src/stores'
@ -27,7 +27,7 @@ const Legend = ({
useEffect(() => setPalette(createPalette({ useEffect(() => setPalette(createPalette({
map: colormap === 'crabfit' ? [[0, [247,158,0,0]], [1, [247,158,0,255]]] : colormap, map: colormap === 'crabfit' ? [[0, [247,158,0,0]], [1, [247,158,0,255]]] : colormap,
steps: max+1-min, steps: max+1-min,
})), [min, max, colormap]) }).format()), [min, max, colormap])
return ( return (
<Wrapper> <Wrapper>

View file

@ -2185,10 +2185,10 @@ html-parse-stringify@^3.0.1:
dependencies: dependencies:
void-elements "3.1.0" void-elements "3.1.0"
hue-map@^0.1.1: hue-map@^1.0.0:
version "0.1.1" version "1.0.0"
resolved "https://registry.yarnpkg.com/hue-map/-/hue-map-0.1.1.tgz#d6b199f4121df56aaf1901222323545f0607a31d" resolved "https://registry.yarnpkg.com/hue-map/-/hue-map-1.0.0.tgz#16061043db2015c15dcfb9229390ca7c7fb27cd4"
integrity sha512-aH3Maa39vHN+yTkWXdLcTN8M+ftGOX6NvGuMObl2puWxwoUZhm3gLlKA6SdpqJphF1RzQo0ntsm0Psg0uc7ouQ== integrity sha512-L7n6cfthm9ZTdYbqJF1yBflHvI4MaWRg+XMJ4Ifc35jWcOfQlCRBETZ4ntnHLPUyDOse7KeelcsbWxx14Aaa+w==
i18next-browser-languagedetector@^6.1.5: i18next-browser-languagedetector@^6.1.5:
version "6.1.5" version "6.1.5"