From 39cb6973a7279c989f6aaf9dcf4de768a911ce84 Mon Sep 17 00:00:00 2001 From: Zoe Steinkamp Date: Wed, 5 May 2021 16:32:08 -0600 Subject: [PATCH] fix: this will fix the null > 0 change we found an issue when we upgraded multiple giraffe libraries. This resulted in our graphs intermittently coming back empty/blank. This was because we had originally believed the null values would return 0, as d3-scale did originally. But by upgrading this broke and we were receiving NaN values. These values made it so our graphs could not be displayed properly but only broke on graphs with undefined values. --- giraffe/src/utils/lineData.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/giraffe/src/utils/lineData.ts b/giraffe/src/utils/lineData.ts index 6b687db3..9030ecd8 100644 --- a/giraffe/src/utils/lineData.ts +++ b/giraffe/src/utils/lineData.ts @@ -41,8 +41,8 @@ export const simplifyLineData = ( for (const [k, {xs, ys, fill}] of Object.entries(lineData)) { const [simplifedXs, simplifiedYs] = simplify( - xs.map(x => xScale(x)), - ys.map(y => yScale(y)), + xs.map(x => xScale(x || 0)), + ys.map(y => yScale(y || 0)), 0.5 )