From ea355dac7ee7799fec1a30962b6908883a3e7ac9 Mon Sep 17 00:00:00 2001 From: Kim Fisher Date: Wed, 24 Apr 2024 16:52:40 -0400 Subject: [PATCH 1/2] add bleaching % hard cover to histogram totals --- src/components/MermaidDash.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/MermaidDash.js b/src/components/MermaidDash.js index 5049164..aea1630 100644 --- a/src/components/MermaidDash.js +++ b/src/components/MermaidDash.js @@ -407,25 +407,30 @@ class MermaidDash extends Component { } getSampleEventBenthicHardCoralAverages = sampleUnits => { - return sampleUnits.map(({ benthiclit, benthicpit, benthicpqt }) => { + return sampleUnits.map(({ benthiclit, benthicpit, benthicpqt, quadrat_benthic_percent }) => { const benthicLITCover = benthiclit && benthiclit.percent_cover_benthic_category_avg const benthicPITCover = benthicpit && benthicpit.percent_cover_benthic_category_avg const benthicPQTCover = benthicpqt && benthicpqt.percent_cover_benthic_category_avg + const bleachingBQCCover = + quadrat_benthic_percent && quadrat_benthic_percent.percent_hard_avg_avg - if (benthicLITCover || benthicPITCover || benthicPQTCover) { + if (benthicLITCover || benthicPITCover || benthicPQTCover || bleachingBQCCover) { const benthicLITHardCoral = benthicLITCover && benthicLITCover['Hard coral'] const benthicPITHardCoral = benthicPITCover && benthicPITCover['Hard coral'] const benthicPQTHardCoral = benthicPQTCover && benthicPQTCover['Hard coral'] + const benthicBQCHardCoral = bleachingBQCCover const numerator = (benthicLITHardCoral !== undefined ? benthicLITHardCoral : 0) + (benthicPITHardCoral !== undefined ? benthicPITHardCoral : 0) + - (benthicPQTHardCoral !== undefined ? benthicPQTHardCoral : 0) + (benthicPQTHardCoral !== undefined ? benthicPQTHardCoral : 0) + + (benthicBQCHardCoral !== undefined ? benthicBQCHardCoral : 0) const denominator = (benthicLITHardCoral !== undefined ? 1 : 0) + (benthicPITHardCoral !== undefined ? 1 : 0) + - (benthicPQTHardCoral !== undefined ? 1 : 0) + (benthicPQTHardCoral !== undefined ? 1 : 0) + + (benthicBQCHardCoral !== undefined ? 1 : 0) return numerator / denominator } From 382bf886f5137a318846baefeb1e0f7b00e845c8 Mon Sep 17 00:00:00 2001 From: Kim Fisher Date: Wed, 1 May 2024 18:58:32 -0400 Subject: [PATCH 2/2] resolve CR comments --- src/components/MermaidDash.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/MermaidDash.js b/src/components/MermaidDash.js index aea1630..632ea0c 100644 --- a/src/components/MermaidDash.js +++ b/src/components/MermaidDash.js @@ -411,14 +411,13 @@ class MermaidDash extends Component { const benthicLITCover = benthiclit && benthiclit.percent_cover_benthic_category_avg const benthicPITCover = benthicpit && benthicpit.percent_cover_benthic_category_avg const benthicPQTCover = benthicpqt && benthicpqt.percent_cover_benthic_category_avg - const bleachingBQCCover = + const benthicBQCHardCoral = quadrat_benthic_percent && quadrat_benthic_percent.percent_hard_avg_avg - if (benthicLITCover || benthicPITCover || benthicPQTCover || bleachingBQCCover) { + if (benthicLITCover || benthicPITCover || benthicPQTCover || benthicBQCHardCoral) { const benthicLITHardCoral = benthicLITCover && benthicLITCover['Hard coral'] const benthicPITHardCoral = benthicPITCover && benthicPITCover['Hard coral'] const benthicPQTHardCoral = benthicPQTCover && benthicPQTCover['Hard coral'] - const benthicBQCHardCoral = bleachingBQCCover const numerator = (benthicLITHardCoral !== undefined ? benthicLITHardCoral : 0) +