refactoring
This commit is contained in:
@@ -8,14 +8,18 @@ class SymptomVsSymptomChartView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
loadAndDisplayChart(symptomX, symptomY) {
|
loadAndDisplayChart(symptomX, symptomY) {
|
||||||
|
return this
|
||||||
|
.#loadChart(symptomX, symptomY)
|
||||||
|
.then(({ labels, data }) => {
|
||||||
|
this.#displayChart(symptomX, symptomY, labels, data);
|
||||||
|
return { labels, data };
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#loadChart(symptomX, symptomY) {
|
||||||
return Promise
|
return Promise
|
||||||
.all([symptomX, symptomY].map(symptom => PrrByVaccineProvider.getPrrByVaccine(symptom)))
|
.all([symptomX, symptomY].map(symptom => PrrByVaccineProvider.getPrrByVaccine(symptom)))
|
||||||
.then(
|
.then(([prrByLotX, prrByLotY]) => SymptomVsSymptomChartDataProvider.getChartData({ prrByLotX, prrByLotY }));
|
||||||
([prrByLotX, prrByLotY]) => {
|
|
||||||
const { labels, data } = SymptomVsSymptomChartDataProvider.getChartData({ prrByLotX, prrByLotY });
|
|
||||||
this.#displayChart(symptomX, symptomY, labels, data);
|
|
||||||
return { labels, data };
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#displayChart(symptomX, symptomY, labels, data) {
|
#displayChart(symptomX, symptomY, labels, data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user