Skip to content

Commit

Permalink
change drift categories and p-value name and tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
FelipeAdachi committed May 20, 2022
1 parent 0988a30 commit 77b5e48
Showing 1 changed file with 18 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -777,11 +777,11 @@
<div class="wl-table-head table-border-none reference-table-head">Reference</div>
</div>
<div class="wl-table-head wl-sub-table-head text-align-center" id="diff-from-ref">
Diff from ref.
p-value
<div class="tooltip-full-number">
<span class="question-mark">?</span>
<span class="tooltiptext">
<div class="mb-1">Distance between the reference and target profiles</div>
<div class="mb-1">p-values are calculated with K-S test for numerical features and Chi-squared for categorical features. </div>
</span>
</div>
</div>
Expand Down Expand Up @@ -1006,34 +1006,30 @@ <h1 class="no-responsive__title">Hold on! :)</h1>
const drifts = {
severe: {
count: 0,
range: "with severe drift (0.00 - 0.05)",
range: "with detected drift (0.00 - 0.05)",
},
moderate: {
count: 0,
range: "with moderate drift (0.05 - 0.3)",
range: "with possible drift (0.05 - 0.15)",
},
mild: {
count: 0,
range: "with mild drift (0.3 - 0.6)",
},
minimal: {
count: 0,
range: "with minimal drift (0.6 - 1.0)",
range: "with no evidence of drift (0.15 - 1.0)",
}
};

const countOfDrifts = (driftNumber, dividedNumber) => {
const divide = 1 / dividedNumber;
for(let i = 1; i <= dividedNumber; i++){
if(driftNumber >= 0 && driftNumber <= 0.05) {
Object.values(drifts)[0].count++
return 0
} else if(driftNumber <= divide*i) {
const {severe, ...otherValues} = drifts
Object.values(otherValues)[i-1].count++
return i
}
}
const countOfDrifts = (driftNumber) => {
if(driftNumber >= 0 && driftNumber <= 0.05) {
Object.values(drifts)[0].count++
return 0
} else if(driftNumber > 0.05 && driftNumber <= 0.15) {
Object.values(drifts)[1].count++
return 1
} else if(driftNumber > 0.15) {
Object.values(drifts)[2].count++
return 2
}

}

abbreviate_number = function(value, fixed = 0) {
Expand Down Expand Up @@ -1135,7 +1131,7 @@ <h1 class="no-responsive__title">Hold on! :)</h1>
if (cheqValueTypeNumber(referenceProfile, drift_from_ref)) {
driftCount++
const driftFromRefNumber = drift_from_ref.toPrecision(2)
const circleColor = Object.values(drifts)[countOfDrifts(driftFromRefNumber, 3)].colorClass
const circleColor = Object.values(drifts)[countOfDrifts(driftFromRefNumber)].colorClass

$(document).ready(() => {
$(".drift-count").html(driftCount)
Expand Down

0 comments on commit 77b5e48

Please sign in to comment.