@@ -37,8 +37,8 @@ function YearSelect({ setFilterVal }) {
3737}
3838
3939export default function RestaurantPermitMap ( ) {
40- const colors = [ "#eff3ff" , "#bdd7e7" , "#6baed6" , "#2171b5" ]
41-
40+ const communityAreaColors = [ "#eff3ff" , "#bdd7e7" , "#6baed6" , "#2171b5" ]
41+
4242 const [ currentYearData , setCurrentYearData ] = useState ( [ ] )
4343 const [ year , setYear ] = useState ( 2026 )
4444
@@ -55,22 +55,20 @@ export default function RestaurantPermitMap() {
5555 } , [ yearlyDataEndpoint ] )
5656
5757
58- function getColor ( pcntPermits ) {
59- if ( pcntPermits > .5 )
60- return colors [ 3 ]
61- else if ( pcntPermits > .2 )
62- return colors [ 2 ]
63- else if ( pcntPermits >= .01 )
64- return colors [ 1 ]
65- else
66- return colors [ 0 ]
58+ function getColor ( percentageOfPermits ) {
59+ /**
60+ * TODO: Use this function in setAreaInteraction to set a community
61+ * area's color using the communityAreaColors constant above
62+ */
6763 }
68-
64+
6965 function setAreaInteraction ( feature , layer ) {
7066 /**
71- * TODO: use the methods below to:
72- * 1) shade each area according to how many permits it had in a year
73- * 2) display a popup with area details during user interaction
67+ * TODO: Use the methods below to:
68+ * 1) Shade each community area according to what percentage of
69+ * permits were issued there in the selected year
70+ * 2) On hover, display a popup with the community area's raw
71+ * permit count for the year
7472 */
7573 layer . setStyle ( )
7674 layer . on ( "" , ( ) => {
0 commit comments