Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
saanobhaai committed May 2, 2024
2 parents 23e7fc6 + 09dc625 commit 69b8a54
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/components/MermaidDash.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,25 +407,29 @@ 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 benthicBQCHardCoral =
quadrat_benthic_percent && quadrat_benthic_percent.percent_hard_avg_avg

if (benthicLITCover || benthicPITCover || benthicPQTCover) {
if (benthicLITCover || benthicPITCover || benthicPQTCover || benthicBQCHardCoral) {
const benthicLITHardCoral = benthicLITCover && benthicLITCover['Hard coral']
const benthicPITHardCoral = benthicPITCover && benthicPITCover['Hard coral']
const benthicPQTHardCoral = benthicPQTCover && benthicPQTCover['Hard coral']

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
}
Expand Down

0 comments on commit 69b8a54

Please sign in to comment.