adding DrugsChartView

This commit is contained in:
Frank Knoll
2024-07-27 22:57:02 +02:00
parent 4a837ed175
commit 1374d4a73f
1042 changed files with 2186 additions and 12 deletions

View File

@@ -0,0 +1,21 @@
class PageInitializer {
static initializePage({ pathologySelectElement, drugsChartViewElement }) {
PageInitializer.#configurePathologySelect(pathologySelectElement, drugsChartViewElement);
}
static #configurePathologySelect(pathologySelectElement, drugsChartViewElement) {
const drugsChartView = new DrugsChartView(drugsChartViewElement);
Select2.initializeSelectElement(
{
selectElement: pathologySelectElement,
minimumInputLength: 0,
textOfOption2Select: null,
onSelectOptionHavingValueAndText: (id, text) => {
fetch(`data/DrugDescriptionsForPathologies/${id}.json`)
.then(response => response.json())
.then(drugDescr => drugsChartView.displayChart(drugDescr));
}
});
}
}