Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Homepage Total US Pollution Chart with Projection to 0 by 2050 #17

Closed
derekeder opened this issue Mar 8, 2022 · 3 comments · Fixed by #43
Closed

Add Homepage Total US Pollution Chart with Projection to 0 by 2050 #17

derekeder opened this issue Mar 8, 2022 · 3 comments · Fixed by #43
Assignees

Comments

@derekeder
Copy link
Member

derekeder commented Mar 8, 2022

Using Recharts create a new Component chart that shows current US emissions and what we need to do to get to 0 by 2050:

Example spreadsheet and chart: https://docs.google.com/spreadsheets/d/1QIWu0BSWCW2AgrJilhcsPA20jTdDjxqNJGoMx9c8-Iw/edit#gid=0

Screen Shot 2022-03-08 at 4 46 55 PM

Steps

  1. Create a function to generate the projected emissions from a given year until 2050 to get to zero
  2. Create a new component based on SimpleAreaChart with 2 series (actual + projection) https://recharts.org/en-US/examples/SimpleAreaChart
  3. Add the component to the home page and pass in US total emissions
  4. Add the component to the state detail page and pass in that state's emissions
@hkier hkier self-assigned this Mar 19, 2022
@vkoves vkoves changed the title Total climate pollution chart & projection to 0 by 2050 Add Homepage Total US Pollution Chart with Projection to 0 by 2050 Mar 25, 2022
@hkier
Copy link
Collaborator

hkier commented Mar 27, 2022

As I expect the emissions data to lag behind the current year (current data ends 2018 and we are in 2022), how should the "missing data" be handled in the SimpleAreaChart. Do we want a gap? Do we project from the last year in which we have data? Something else?

@derekeder
Copy link
Member Author

@hkier the chart should show the projection based on the last year of data we have. It'll be on us to find data up to 2022 and handle that in a separate issue we already have open #10

@hkier
Copy link
Collaborator

hkier commented Mar 28, 2022

The way the component is currently written, the historical data ends in 2018. 2019-2021 have no data. The projection starts at 2022 using the historical data from the last year of historical data as a starting point. It is not obvious from the area graph there are years with missing data.

The code is written in such a way, it does not matter when the historical data ends. It is also written so we can add "estimated data" for the missing data or just ignore the gap.

I assume even though we might be missing data, we do not want the graph to show a gap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants