fmidev / weather-app

FMI's official weather application for mobile devices
6 stars 2 forks source link

Fix missing value handling in graphs #535

Open geosaaga opened 3 months ago

geosaaga commented 3 months ago

Current code uses null for missing y-values. For example in

https://github.com/fmidev/weather-app/blob/17d748ec8da2741e4fa2021fe0a4f06048857dcf/src/components/weather/charts/VisCloudChart.tsx#L41

This causes TypeScript issue with current TypeScript version and typings, because null is not allowed value by the graph library. It also seems to be non-functional way to handle missing values according to discussions

https://github.com/FormidableLabs/victory/issues/1159 https://github.com/FormidableLabs/victory/issues/2571

Fix could be to use minDomain and maxDomain attributes.