[FLAG-1457] Transition "Economic Impact of Forests" widgets in Dashboards to use GFW Data API instead of Carto#5187
Merged
willian-viana merged 2 commits intodevelopfrom Mar 23, 2026
Conversation
f547430 to
96b53fc
Compare
96b53fc to
66bdf9d
Compare
66bdf9d to
0cf9510
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
To support the removal of Carto as dependency of the Flagship site we need to change how the “Economic Impact of Forests” widget is sourced. You can see an example of this widget on the country Dashboard here: https://www.globalforestwatch.org/dashboards/country/JAM/?category=land-use
You can also see the embed of a widget here: https://www.globalforestwatch.org/embed/widget/economicImpact/country/JAM/
This widget makes the following API call to a public Carto table: https://wri-01.carto.com/api/v2/sql?q=SELECT fao.country as iso, fao.forempl as total_forest_employees, fao.femempl as female_forest_employees, fao.usdrev as revenue__usd, fao.usdexp as expenditure__usd, fao.gdpusd2012 as gdp_2012__usd, fao.totpop1000, fao.year FROM table_7_economics_livelihood as fao WHERE fao.year = 2000 or fao.year = 2005 or fao.year = 2010 or fao.year = 9999
Some relevant parts of the code seem to be:
https://github.com/wri/gfw/blob/develop/services/forest-data.js - data sourcing
https://github.com/wri/gfw/blob/develop/components/widgets/land-use/economic-impact/index.js - widget definition