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

[FLAG-1018][EPIC] Tree cover gain 5y baseline year #4873

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from

Conversation

willian-viana
Copy link
Collaborator

@willian-viana willian-viana commented Oct 21, 2024

Overview

As a user, I can view gain data with baselines for every 5 years of data.

Acceptance criteria

Given that:

the user is viewing the “Global tree cover gain” widget on the dashboards, which is the version of this widget that appears when the globe is being viewed in the dashboards

the user is viewing the “Tree cover gain in [area] compared to other areas” widget on the dashboards, which is the version of this widget that appears when a country, region, or subregion is selected

the user is viewing the “Tree cover gain in [custom area name]” widget on the saved area dashboards, which is the version of this widget that appears for a saved custom area

the user is viewing the “Tree cover gain outside plantations in [area]” widget on the dashboards, which is available for the globe, countries, regions, and subregions

Global tree cover gain

We will add a “baseline year” dropdown option to the settings to this widget.
It will be below both the “forest type” and “land category” options.
It will have five options for a baseline: 2000 (default), 2005, 2010, 2015, and 2020.
The selected baseline year will be the [beginning year] in the new sentence below (see #2).

We will change the sentence from:

  • The current global sentence: ​
    • “From 2000 to 2020, [hectares] of tree cover was gained globally.“
  • The future sentence:
    • ”From [beginning year] to 2020, [hectares] of tree cover was gained globally.“

Tree cover gain in [area] compared to other areas

Just as we did for the global widget above, we will add a “baseline year” dropdown option to the settings to this widget.
It will be below both the “forest type” and “land category” options.
It will have five options for a baseline: 2000 (default), 2005, 2010, 2015, and 2020.
The selected baseline year will be the [beginning year] in the new sentence below (see #2).

We will change the sentence from:

  • The current global sentence: ​
    • ”From 2000 to 2020, [area] gained [hectares] of tree cover equal to [percent] of the global total.”
  • The future sentence:
    • ”From [beginning year] to 2020, [area] gained [hectares] of tree cover equal to [percent] of the global total in that time period.​”

Tree cover gain in [custom area name]

Just as we did for the global and subnational widgets above, we will add a “baseline year” dropdown option to the settings to this widget.

It will be below both the “forest type” and “land category” options.
It will have five options for a baseline: 2000 (default), 2005, 2010, 2015, and 2020.
The selected baseline year will be the [beginning year] in the new sentence below (see #2).

We will change the sentence from:

  • The current global sentence: ​
    • “From 2000 to 2020, [custom area name] gained [hectares] of tree cover equal to [percent] is its total extent.”
  • The future sentence:
    • ”From [beginning year] to 2020, [custom area name] gained [hectares] of tree cover equal to [percent] of its total extent in that time period.”

Tree cover gain outside plantations

We will add a “baseline year” dropdown option to the settings to this widget.

It will be below both the “forest type” and “land category” options.
It will have five options for a baseline: 2000 (default), 2005, 2010, 2015, and 2020.
The selected baseline year will be the [beginning year] in the new sentence below (see #2).

We will change the global sentence from:

  • Globally between 2000 and 2020, [percentage] of tree cover gain occurred outside of plantations. ​

  • Globally between [beginning year] and 2020, [percentage] of tree cover gain occurred outside of plantations. ​

  • We will change the national and subnational sentence from:

    • In [area] between 2000 and 2020, [percentage] of tree cover gain occurred outside of plantations. ​
    • In [area] between [beginning year] and 2020, [percentage] of tree cover gain occurred outside of plantations.

@willian-viana willian-viana requested a review from wri7tno October 21, 2024 23:24
@willian-viana willian-viana self-assigned this Oct 21, 2024
@willian-viana willian-viana marked this pull request as ready for review October 24, 2024 14:34
@@ -24,7 +24,7 @@ export default {
metaKey: 'umd_tree_cover_gain_from_height',
dataType: 'gain',
pendingKeys: ['threshold'],
refetchKeys: ['threshold'],
refetchKeys: ['threshold', 'baselineYear'],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I never understood this, what do we use refetchKeys for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sometimes we don't need to refetch because the first request get all info we need, so the only thing needed is filter the data displayed. However, for some widgets, every time the user changes the settings, we need to refetch passing a new value to the query. It should be always, but for some reason it's not.

"ANNUAL_ADM2_SUMMARY": "v20240404",
"ANNUAL_ADM2_WHITELIST": "v20240404",
"ANNUAL_ADM0_CHANGE": "v20240815",
"ANNUAL_ADM0_SUMMARY": "v20240815",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome, I will be able to use this version for my new widget as well 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This update is a cherry pick from #4869. It's the epic for your widget.

Copy link
Collaborator

@wri7tno wri7tno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@willian-viana willian-viana force-pushed the feat/tree-cover-gain-FLAG-1018 branch from 1244042 to 54aea59 Compare November 14, 2024 17:35
[FLAG-1016] Priority 1: Update gain layer with 5-year baselines
Now we can set each API separatedly, making it easier to test different environments at once
@willian-viana willian-viana changed the title [FLAG-1018] Tree cover gain [FLAG-1018] Tree cover gain 5y baseline year Nov 19, 2024
Change the way we compare baseline years to match the value in the Data API. e.g. ('2015-2020)
@willian-viana willian-viana force-pushed the feat/tree-cover-gain-FLAG-1018 branch from dc037cc to becc80c Compare November 27, 2024 11:18
When we use the parameter grouped as true, we set adm1 as the table instead of iso
@willian-viana willian-viana force-pushed the feat/tree-cover-gain-FLAG-1018 branch from deb33bf to aa68713 Compare December 5, 2024 16:54
@willian-viana willian-viana changed the title [FLAG-1018] Tree cover gain 5y baseline year [EPIC][FLAG-1018] Tree cover gain 5y baseline year Dec 10, 2024
@willian-viana willian-viana changed the title [EPIC][FLAG-1018] Tree cover gain 5y baseline year [FLAG-1018][EPIC] Tree cover gain 5y baseline year Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants