From 51a5880c6b7f4c7d9176ce15fd23cd3849956116 Mon Sep 17 00:00:00 2001 From: James Stout Date: Tue, 2 Jan 2024 04:04:37 +0000 Subject: [PATCH 1/2] Fix threatened_branch() --- OZprivate/rawJS/OZTreeModule/src/factory/midnode.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OZprivate/rawJS/OZTreeModule/src/factory/midnode.js b/OZprivate/rawJS/OZTreeModule/src/factory/midnode.js index 5fe8b923..8ba9eb32 100755 --- a/OZprivate/rawJS/OZTreeModule/src/factory/midnode.js +++ b/OZprivate/rawJS/OZTreeModule/src/factory/midnode.js @@ -411,11 +411,13 @@ class Midnode { num_threatened += this.get_attribute("iucnVU"); num_threatened += this.get_attribute("iucnEN"); num_threatened += this.get_attribute("iucnCR"); + num_threatened += this.get_attribute("iucnEW"); } + let num_extant = this.richness_val - this.get_attribute("iucnEX"); if (this.detail_fetched) { - this._threatened_branch = (num_threatened > this.richness_val * 0.5); + this._threatened_branch = (num_threatened > num_extant * 0.5); } - return num_threatened > this.richness_val * 0.5; + return num_threatened > num_extant * 0.5; } get redlist() { if (this._redlist !== null) return this._redlist; From d101a784793c8b27b7a38eecad531a1c0011f736 Mon Sep 17 00:00:00 2001 From: James Stout Date: Tue, 2 Jan 2024 20:43:32 +0000 Subject: [PATCH 2/2] Adjusted threatened_branch to exclude EW. --- OZprivate/rawJS/OZTreeModule/src/factory/midnode.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OZprivate/rawJS/OZTreeModule/src/factory/midnode.js b/OZprivate/rawJS/OZTreeModule/src/factory/midnode.js index 8ba9eb32..e3c3acfc 100755 --- a/OZprivate/rawJS/OZTreeModule/src/factory/midnode.js +++ b/OZprivate/rawJS/OZTreeModule/src/factory/midnode.js @@ -411,9 +411,8 @@ class Midnode { num_threatened += this.get_attribute("iucnVU"); num_threatened += this.get_attribute("iucnEN"); num_threatened += this.get_attribute("iucnCR"); - num_threatened += this.get_attribute("iucnEW"); } - let num_extant = this.richness_val - this.get_attribute("iucnEX"); + let num_extant = this.richness_val - (this.get_attribute("iucnEX") + this.get_attribute("iucnEW")); if (this.detail_fetched) { this._threatened_branch = (num_threatened > num_extant * 0.5); }