Skip to content

Commit

Permalink
Merge pull request #4897 from wri/develop
Browse files Browse the repository at this point in the history
PROD Deploy 2024-12-10 11:56am EST
  • Loading branch information
wri7tno authored Dec 10, 2024
2 parents 7cf117f + 9a1e47f commit d899164
Showing 1 changed file with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,21 @@ export const parseConfig = createSelector(
.reverse()
);

const forestryIndex = tooltip.findIndex(
(element) => element.key === 'class_Forestry'
);
const agricultureIndex = tooltip.findIndex(
(element) => element.key === 'class_Shifting agriculture'
);

const rearrengedTooltips = [...tooltip];

delete rearrengedTooltips[forestryIndex];
delete rearrengedTooltips[agricultureIndex];

rearrengedTooltips.splice(2, 0, tooltip[forestryIndex]);
rearrengedTooltips.splice(3, 0, tooltip[agricultureIndex]);

// Example on how to add columns & titles to the Chart Legend
// See: https://gfw.atlassian.net/browse/FLAG-1145
// const chartLegend = {
Expand All @@ -180,9 +195,11 @@ export const parseConfig = createSelector(
// ],
// };

const insertIndex = findIndex(tooltip, { key: 'class_Urbanization' });
const insertIndex = findIndex(rearrengedTooltips, {
key: 'class_Urbanization',
});
if (insertIndex > -1) {
tooltip.splice(insertIndex, 0, {
rearrengedTooltips.splice(insertIndex, 0, {
key: 'break',
label: 'Drivers of permanent deforestation:',
});
Expand All @@ -199,7 +216,7 @@ export const parseConfig = createSelector(
unitFormat: (value) =>
formatNumber({ num: value, specialSpecifier: '.2s', spaceUnit: true }),
unit: 'tCO2e',
tooltip,
tooltip: rearrengedTooltips,
// chartLegend,
};
}
Expand Down

0 comments on commit d899164

Please sign in to comment.