File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
app/src/components/domain/RiskSeasonalMap Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ function Filters(props: Props) {
122122 value = { value . normalizeByPopulation }
123123 onChange = { handleChange }
124124 />
125- { value . riskMetric ! == 'riskScore' && (
125+ { value . riskMetric = == 'riskScore' && (
126126 < Checkbox
127127 name = "includeCopingCapacity"
128128 label = { strings . riskCopingCapacity }
Original file line number Diff line number Diff line change @@ -528,16 +528,24 @@ function RiskSeasonalMap(props: Props) {
528528 ) ,
529529 ) . filter ( isDefined ) ;
530530
531+ /*
531532 const maxPopulation = maxSafe(
532533 populationListSafe.map(
533534 (item) => item.population_in_thousands,
534535 ),
535536 ) ?? 1;
537+ */
538+
539+ const totalPopulation = sumSafe (
540+ populationListSafe . map (
541+ ( item ) => item . population_in_thousands ,
542+ ) ,
543+ ) ?? 1 ;
536544
537545 const populationFactorMap = listToMap (
538546 populationListSafe ,
539547 ( result ) => result . iso3 ,
540- ( result ) => result . population_in_thousands / maxPopulation ,
548+ ( result ) => 1 - ( result . population_in_thousands / totalPopulation ) ** ( 1 / 4 ) ,
541549 ) ;
542550
543551 const populationMap = listToMap (
@@ -692,7 +700,7 @@ function RiskSeasonalMap(props: Props) {
692700 }
693701 }
694702
695- if ( filters . riskMetric ! == 'riskScore' && filters . includeCopingCapacity ) {
703+ if ( filters . riskMetric = == 'riskScore' && filters . includeCopingCapacity ) {
696704 const lccFactor = mappings ?. lccFactor [
697705 item . country_details . iso3
698706 ] ;
You can’t perform that action at this time.
0 commit comments