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

ecoregion changes #943

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/containers/datasets/iucn-ecoregion/constants.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
export const COLORS = {
ce: '#EE4D5A',
en: '#F97B57',
vu: '#F3AD6A',
nt: '#ECDA9A',
vu: '#ECDA9A',
lc: '#B4DCAA',
dd: '#ECECEF',
ne: '#ECECEF',
Expand All @@ -12,7 +11,6 @@ export const LABELS = {
ce: 'Critically Endangered',
en: 'Endangered',
vu: 'Vulnerable',
nt: 'Near Threatened',
lc: 'Least Concern',
dd: 'Data Deficient',
};
16 changes: 8 additions & 8 deletions src/containers/datasets/iucn-ecoregion/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@ const REPORTS = [
{
name: 'RLE Mangroves of the Sunda Shelf (pdf)',

url: 'https://github.com/Vizzuality/mangrove-atlas/files/11983082/RLE.Mangroves.of.the.Sunda.Shelf.pdf',
url: 'https://ecoevorxiv.org/repository/view/5866/',
},
{
name: 'RLE Mangroves of the Western Coral Triangle (pdf)',

url: 'https://github.com/Vizzuality/mangrove-atlas/files/11983083/RLE.Mangroves.of.the.Western.Coral.Triangle.pdf',
url: 'https://ecoevorxiv.org/repository/view/5867/',
},
{
name: 'RLE Mangroves of the Andaman (pdf)',

url: 'https://github.com/Vizzuality/mangrove-atlas/files/11983084/RLE.Mangroves.of.the.Andaman.pdf',
url: 'https://ecoevorxiv.org/repository/view/5862/',
},
{
name: 'RLE Mangroves of the South China Sea (pdf)',

url: 'https://github.com/Vizzuality/mangrove-atlas/files/11983085/RLE.Mangroves.of.the.South.China.Sea.pdf',
url: 'https://ecoevorxiv.org/repository/view/5865/',
},
];

Expand Down Expand Up @@ -102,8 +102,9 @@ export function useMangroveEcoregions(

return useQuery(['iucn-ecoregion', params], fetchMangroveIUCNEcoregions, {
select: ({ data, metadata }) => {
const colorKeys = getColorKeys(data);
const dataWithColors = getChartData(data, colorKeys);
const dataFiltered = data?.filter((d) => d.category !== 'nt');
const colorKeys = getColorKeys(dataFiltered);
const dataWithColors = getChartData(dataFiltered, colorKeys);

return {
...metadata,
Expand Down Expand Up @@ -146,8 +147,7 @@ export function useSource(): SourceProps {
export function useLayers({ id }: { id: LayerProps['id'] }): LayerProps[] {
const OVERALL_ASSESMENT = {
CE: '#EE4D5A',
VU: '#F3AD6A',
NT: '#ECDA9A',
VU: '#ECDA9A',
LC: '#B4DCAA',
DD: '#ECECEF',
EN: '#F97B57',
Expand Down
4 changes: 2 additions & 2 deletions src/containers/datasets/iucn-ecoregion/widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const IUCNEcoregions = () => {
<div>
<p className={WIDGET_SENTENCE_STYLE}>
According to the IUCN evaluation, there are{' '}
<span className="font-bold"> {data.ecoregion_total}</span> marine ecoregions classified
<span className="font-bold"> {data.ecoregion_total}</span> marine provinces classified
under vulnerable status.
</p>
<p className={WIDGET_SENTENCE_STYLE}>Click on the map for more information.</p>
Expand All @@ -31,7 +31,7 @@ const IUCNEcoregions = () => {
<DialogContent className="scroll-y left-18 top-16 max-h-fit rounded-3xl">
<div className="no-scrollbar space-y-4 overflow-y-auto p-4">
<h2 className="font-sans text-2xl font-light text-black/85">
IUCN Ecoregion Assesment
IUCN Ecosystem Red List Assesment
</h2>
<h4 className="py-4 text-sm font-bold ">Associated reports</h4>
<ul className="text-light space-y-4 text-sm text-brand-800 underline">
Expand Down
2 changes: 1 addition & 1 deletion src/containers/map/iucn-ecoregion-popup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const IucnEcoregionPopup = ({ info }: { info: IUCNEcoregionPopUpInfo }) => (
rel="noopener noreferrer"
className="whitespace-nowrap text-sm text-brand-800 underline"
>
Ecoregional assesment (PDF)
Province Description (PDF)
</a>
</header>
<ul className="flex space-x-2 text-sm">
Expand Down
2 changes: 1 addition & 1 deletion src/containers/widgets/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ const widgets_prod = [
slug: 'mangrove_iucn_ecoregion',
locationType: ['worldwide'],
applicability: 'Global',
categoryIds: ['all_datasets', 'restoration_and_conservation'],
categoryIds: ['all_datasets', 'distribution_and_change'],
layersIds: ['ecoregion'],
}),
},
Expand Down
Loading