From 77ff3bdce0f59bee881c500a3334b359767bd5fa Mon Sep 17 00:00:00 2001 From: Sreeja Apparaju Date: Wed, 2 Aug 2023 19:24:35 +0300 Subject: [PATCH 1/5] resolved --- client/src/Users/UsersList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/Users/UsersList.js b/client/src/Users/UsersList.js index 88f19c3b..2bcea77c 100644 --- a/client/src/Users/UsersList.js +++ b/client/src/Users/UsersList.js @@ -539,7 +539,7 @@ function UsersList() { From 3ab329fde13da6008d328fc38b68c1016b2f3df4 Mon Sep 17 00:00:00 2001 From: Sreeja Apparaju Date: Wed, 2 Aug 2023 20:24:07 +0300 Subject: [PATCH 2/5] resolved --- client/src/Components/IntensityMap.js | 2 +- client/src/Users/UsersList.js | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/client/src/Components/IntensityMap.js b/client/src/Components/IntensityMap.js index 2991c43e..2e40aa7d 100644 --- a/client/src/Components/IntensityMap.js +++ b/client/src/Components/IntensityMap.js @@ -40,7 +40,7 @@ function IntensityMap({ .attr("stroke", "#f0f0f0") .attr("fill", (feature) => colorScale(data[feature.id] ?? 0)) .on("mouseover", (_, feature) => onMouseOver(feature)) - .on("mouseout", () => onMouseOver()); + .on("mouseout", () => onMouseOver(null)); } }, [data, map, width, height, minColor, maxColor, onMouseOver]); diff --git a/client/src/Users/UsersList.js b/client/src/Users/UsersList.js index 2bcea77c..4d95d368 100644 --- a/client/src/Users/UsersList.js +++ b/client/src/Users/UsersList.js @@ -152,7 +152,18 @@ function UsersList() { } function onMouseOverZip(feature) { - setSelectedFeature(feature); + if (resetTimeoutId) { + clearTimeout(resetTimeoutId); + } + setSelectedFeature(feature); + + + const newTimeoutId = setTimeout(() => { + setSelectedFeature(null); + }, 100); + + setResetTimeoutId(newTimeoutId); + } let totalUsers; From f5fd6216339676b86c45b55339ab4a96276ea305 Mon Sep 17 00:00:00 2001 From: Sreeja Apparaju Date: Wed, 2 Aug 2023 20:28:55 +0300 Subject: [PATCH 3/5] resolved --- client/src/Users/UsersList.js | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/Users/UsersList.js b/client/src/Users/UsersList.js index 4d95d368..3095df9f 100644 --- a/client/src/Users/UsersList.js +++ b/client/src/Users/UsersList.js @@ -40,6 +40,7 @@ function UsersList() { const [usersByZipActive, setUsersByZipActive] = useState(); const [usersByZipMedianSteps, setUsersByZipMedianSteps] = useState(); const [selectedFeature, setSelectedFeature] = useState(); + const [resetTimeoutId, setResetTimeoutId] = useState(false); useEffect(() => { let cancelled = false; From afcc6b8402e5138b9f1170f7eab8ca384bb96c13 Mon Sep 17 00:00:00 2001 From: Sreeja Apparaju Date: Wed, 2 Aug 2023 20:49:05 +0300 Subject: [PATCH 4/5] resolved --- client/src/Users/UsersList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/Users/UsersList.js b/client/src/Users/UsersList.js index 3095df9f..dade795b 100644 --- a/client/src/Users/UsersList.js +++ b/client/src/Users/UsersList.js @@ -40,7 +40,7 @@ function UsersList() { const [usersByZipActive, setUsersByZipActive] = useState(); const [usersByZipMedianSteps, setUsersByZipMedianSteps] = useState(); const [selectedFeature, setSelectedFeature] = useState(); - const [resetTimeoutId, setResetTimeoutId] = useState(false); + const [resetTimeoutId, setResetTimeoutId] = useState(null); useEffect(() => { let cancelled = false; From dde6ef931deb00ed0f2584a17813f04266498ed8 Mon Sep 17 00:00:00 2001 From: Sreeja Apparaju Date: Thu, 3 Aug 2023 01:05:03 +0300 Subject: [PATCH 5/5] SF --- client/src/Users/UsersList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/Users/UsersList.js b/client/src/Users/UsersList.js index dade795b..9b315512 100644 --- a/client/src/Users/UsersList.js +++ b/client/src/Users/UsersList.js @@ -274,7 +274,7 @@ function UsersList() {

- {!selectedFeature && "San Franciso"} + {!selectedFeature && "San Francisco"} {selectedFeature && `${selectedFeature.properties.neighborhood} (${selectedFeature.id})`}