From f87336030e4121a39143ffc120deb547475ce238 Mon Sep 17 00:00:00 2001 From: Claudio Proietti Mercuri <126577429+Cloddino95@users.noreply.github.com> Date: Thu, 22 May 2025 12:56:04 +0200 Subject: [PATCH] create a legend to better understand the sunburst chart in the label --- db.sqlite3 | Bin 352256 -> 352256 bytes static/js/main.js | 22 ++++++++-------- webapp/templates/dataset_label.html | 39 +++++++++++++++++++++++++++- 3 files changed, 49 insertions(+), 12 deletions(-) diff --git a/db.sqlite3 b/db.sqlite3 index a8f5cacc140674ba0dfe3712d0e45aecce161639..e9b397c539f297b3715df7ec2b690c807b8428eb 100644 GIT binary patch delta 344 zcmZoTAlh(1bb>S^|3n#QM*fWnMtLHpx<*C{h6Yx~MplMKdZxxErY0tvm*vG7vI+A# zG4MKV=2&3CtEs~5%V<X5k_+HcmwbzT3RpcqVdZbGdOU@@n&`^ObLQRAA@S zXi^ep^=%GzB;>xy6DJE#em8Z#cd4hbONLdFiIaJbxsQucu4Q;cQlW=)L1=kJW>IiS fS!roxZjfbIadu&HX>e7PnS^&qNt#MxKocMtLG8x(3Dyh6Yxq##V-AdM0KjX2u4am*vG7vIy~} zGi>HsV8J`NKtP>Eh1r*Jx?dHGLUZ@p?cHk`E1j5ycrQ<9|G=oa+0kG*FN++rBjfbI zY8I*XkAE3~m}&dRzs$l#Vys+l41BkFxA9Em&IU47dA0e}`N}stD(G-+cdKIA^%MZ< CcrB;^ diff --git a/static/js/main.js b/static/js/main.js index 5c3d8d1..f4c906f 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -67,23 +67,23 @@ function validateAndHighlightFieldsByIds(elementIds, changeMadeFromButton=false) function updateProgressBar(){ // Update progress bar - let assessmentForm = document.getElementById('assessment'); + let assessmentForm = document.getElementById('assessment'); // create a variable called assessmentForm and assign it the form with the id of "assessment" (the form we are working with). where we can get any information stored inside the assessment form. - let inputs = assessmentForm.querySelectorAll('select'); + let inputs = assessmentForm.querySelectorAll('select'); // “Inside the form I just got (assessmentForm), find all elements inside the form — one for each metric. - let filledCount = 0; // Counter for filled elements - let total = 0; - inputs.forEach(element => { + let filledCount = 0; // This is a counter. We’ll increase it for every filled dropdowns exist in total (so we can later calculate a percentage). + inputs.forEach(element => { // what is "forEach"? This is a JavaScript loop designed to go over every item in an array or NodeList. // Check if the element is filled - if (element.value && element.value.trim() !== '' && element.value.trim() !== '-') { - filledCount++; + if (element.value && element.value.trim() !== '' && element.value.trim() !== '-') { // Checks that the dropdown has some value selected and is not just a placeholder (like "-"). + filledCount++; // If the dropdown has a value, we increase the filledCount by 1. } - total++; + total++; // We increase the total count by 1 for every