-
Notifications
You must be signed in to change notification settings - Fork 97
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
Feature/future carbon gains #3681
Conversation
I'm getting a "Network Error" on every request, maybe there is some CORS issues between the domains climate.globalforestwatch.org and www.globalforestwatch.org ? |
can you share an example request? |
Sure! This is one example. You can access it from the browser, and even the network tools are giving me 200s and 304s status codes, but I can't seem to get the data in the widget itself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! Nice tidy work. No significant comments but but review. 🌵 〽️
@@ -0,0 +1,50 @@ | |||
export default { | |||
widget: 'futurecarbongains', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we camelCase this like other widgets?
if (isEmpty(data)) return null; | ||
const years = {}; | ||
const selectedData = data[settings.unit]; | ||
Object.keys(selectedData).forEach(key => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could use a reduce here to make this simpler.
label: labels[k] ? labels[k] : k, | ||
color: colors.ramp && colors.ramp[i], | ||
unit: 't', | ||
unitFormat: num => formatNumber({ num, unit: '' }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ugly, but appreciated we dont have too many options right now. Going to make a note to improve this.
Overview - Future Carbon Gains widget
This one is a version of the Potential tree biomass gain widget for the climate tab. It features a stacked bar chart to show Potential tree biomass gain of Young Secondary Forests, Mid-Age Secondary Forests, Pasture Area, and Crops.