refactoring

This commit is contained in:
frankknoll
2023-11-09 12:00:39 +01:00
parent be62c55b2d
commit 6f20261d23
2 changed files with 16 additions and 8 deletions

View File

@@ -13835,12 +13835,12 @@
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<div class="x_panel"> <div class="x_panel">
<div class="x_title"> <div class="x_title">
<h3>Comparison of the PRRs of two Symptoms</h3> <h3>Comparison of PRRs of two Symptoms</h3>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<div class="x_content"> <div class="x_content">
<div style="margin-bottom: 20px;"> <div style="margin-bottom: 20px;">
<label>Select Symptom for X axis:</label> <label>Symptom for X axis:</label>
<select id="symptomSelectX" name="symptom"> <select id="symptomSelectX" name="symptom">
<option disabled="" hidden="" selected="" value="">Select Symptom</option> <option disabled="" hidden="" selected="" value="">Select Symptom</option>
<option value="17-hydroxyprogesterone">17-hydroxyprogesterone</option> <option value="17-hydroxyprogesterone">17-hydroxyprogesterone</option>
@@ -27015,7 +27015,7 @@
</select> </select>
</div> </div>
<div style="margin-bottom: 20px;"> <div style="margin-bottom: 20px;">
<label>Select Symptom for Y axis:</label> <label>Symptom for Y axis:</label>
<select id="symptomSelectY" name="symptom"> <select id="symptomSelectY" name="symptom">
<option disabled="" hidden="" selected="" value="">Select Symptom</option> <option disabled="" hidden="" selected="" value="">Select Symptom</option>
<option value="17-hydroxyprogesterone">17-hydroxyprogesterone</option> <option value="17-hydroxyprogesterone">17-hydroxyprogesterone</option>

View File

@@ -1,8 +1,8 @@
class PageInitializer { class PageInitializer {
static #symptomVsSymptomChartView; static #symptomVsSymptomChartView;
static #symptomX = 'Immunosuppression'; static #symptomX = null;
static #symptomY = 'Immunoglobulin therapy'; static #symptomY = null;
static initializePage({ symptom, vaccine, symptomVsSymptomChart }) { static initializePage({ symptom, vaccine, symptomVsSymptomChart }) {
PageInitializer.#configureSymptom(symptom); PageInitializer.#configureSymptom(symptom);
@@ -37,7 +37,7 @@ class PageInitializer {
selectElement: symptomSelectXElement, selectElement: symptomSelectXElement,
onValueSelected: symptomX => { onValueSelected: symptomX => {
PageInitializer.#symptomX = symptomX; PageInitializer.#symptomX = symptomX;
PageInitializer.#symptomVsSymptomChartView.loadAndDisplayChart(PageInitializer.#symptomX, PageInitializer.#symptomY); PageInitializer.#loadAndDisplayChart();
}, },
minimumInputLength: 4 minimumInputLength: 4
}); });
@@ -46,11 +46,11 @@ class PageInitializer {
selectElement: symptomSelectYElement, selectElement: symptomSelectYElement,
onValueSelected: symptomY => { onValueSelected: symptomY => {
PageInitializer.#symptomY = symptomY; PageInitializer.#symptomY = symptomY;
PageInitializer.#symptomVsSymptomChartView.loadAndDisplayChart(PageInitializer.#symptomX, PageInitializer.#symptomY); PageInitializer.#loadAndDisplayChart();
}, },
minimumInputLength: 4 minimumInputLength: 4
}); });
PageInitializer.#symptomVsSymptomChartView.loadAndDisplayChart(PageInitializer.#symptomX, PageInitializer.#symptomY); PageInitializer.#loadAndDisplayChart();
} }
static #initializeSelectElement({ selectElement, onValueSelected, minimumInputLength }) { static #initializeSelectElement({ selectElement, onValueSelected, minimumInputLength }) {
@@ -62,4 +62,12 @@ class PageInitializer {
onValueSelected(value); onValueSelected(value);
}); });
} }
static #loadAndDisplayChart() {
if (PageInitializer.#symptomX != null && PageInitializer.#symptomY != null) {
PageInitializer.#symptomVsSymptomChartView.loadAndDisplayChart(
PageInitializer.#symptomX,
PageInitializer.#symptomY);
}
}
} }