azavea / fb-gender-survey-dashboard

Interactive exploration of global results from the Facebook "Survey on Gender Equality At Home
https://gender-survey-dashboard.netlify.app/
Apache License 2.0
2 stars 2 forks source link

Add year selection #116

Closed TaiWilkin closed 3 years ago

TaiWilkin commented 3 years ago

Overview

Once the data has been updated to include the 2021 data, users will need to select which year to view out of all available years.

Which questions have data available will vary on a year-to-year basis, and as such, the year must be selected prior to selecting the questions to view. Following the pattern of the geography selector, a page has been added where users are able to select a year from the available years.

Based on the available years in the data, a list of years with radio buttons are rendered, allowing users to select a year to view.

In the future, we will enable a multi-year comparison view, and will enable users to select multiple years; when this occurs, the Radio and RadioGroup components from ChakraUI should be switched out for the Checkbox and CheckboxGroup components. To make this a drop-in replacement, the currentYear prop has been updated to an array of currentYears.

Connects #114

Demo

Screen Shot 2021-10-05 at 4 40 56 PM

Notes

Although year selections are being stored in an array, when we are reading out the questions we are only looking at the first item in the array. This is because later, multi-year selections will trigger comparison view for the charts; however, this isn't currently enabled. Any code added to handle multiple years in the charts reasonably now would later be overwritten when multi-year comparison view is implemented.

Currently, only one year of data is available; as such, only one year is available to select. As strange as this appears, it is correct per the current data available to us. 2021 data will be integrated before the changes go to production.

Testing Instructions

rajadain commented 3 years ago

Taking a look now

TaiWilkin commented 3 years ago

Thanks for reviewing! I've added a follow-up card addressing adding the year(s) to CSV and PNG downloads.