refactoring
This commit is contained in:
@@ -14,7 +14,6 @@ class BatchCodeDetailsView {
|
||||
}
|
||||
|
||||
#loadHistoDescrs(batchcode) {
|
||||
UIUtils.clear(this.#uiContainer);
|
||||
const loadingText = document.createTextNode('Loading...');
|
||||
this.#uiContainer.appendChild(loadingText);
|
||||
return HistoDescrsProvider
|
||||
@@ -68,13 +67,14 @@ class BatchCodeDetailsView {
|
||||
}
|
||||
|
||||
#displaySelectBatchcodeCombination(histograms, histogramChartView, chartWithSlider) {
|
||||
const selectBatchcodeCombination =
|
||||
BatchcodeCombinationSelection.getSelectBatchcodeCombination(
|
||||
{
|
||||
histograms: histograms,
|
||||
onSelect: histoDescr => this.#displayHistogram(histoDescr, histogramChartView, chartWithSlider)
|
||||
});
|
||||
this.#uiContainer.appendChild(selectBatchcodeCombination);
|
||||
const selectBatchcodeCombinationElement = this.#uiContainer.querySelector("#selectBatchcodeCombination");
|
||||
BatchcodeCombinationSelection.configureSelectBatchcodeCombinationElement(
|
||||
{
|
||||
selectBatchcodeCombinationElement: selectBatchcodeCombinationElement,
|
||||
histograms: histograms,
|
||||
onSelect: histoDescr => this.#displayHistogram(histoDescr, histogramChartView, chartWithSlider)
|
||||
});
|
||||
this.#uiContainer.appendChild(selectBatchcodeCombinationElement);
|
||||
}
|
||||
|
||||
#displayHistogram(histoDescr, histogramChartView, chartWithSlider) {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
class BatchcodeCombinationSelection {
|
||||
|
||||
static getSelectBatchcodeCombination({ histograms, onSelect }) {
|
||||
const selectBatchcodeCombination = UIUtils.instantiateTemplate('template-selectBatchcodeCombination');
|
||||
const batchcodesSelect = selectBatchcodeCombination.querySelector('#batchcodesSelect');
|
||||
static configureSelectBatchcodeCombinationElement({ selectBatchcodeCombinationElement, histograms, onSelect }) {
|
||||
const batchcodesSelect = selectBatchcodeCombinationElement.querySelector('#batchcodesSelect');
|
||||
this.#addBatchcodeCombinationOptions(batchcodesSelect, histograms);
|
||||
batchcodesSelect.addEventListener(
|
||||
'change',
|
||||
@@ -10,7 +9,6 @@ class BatchcodeCombinationSelection {
|
||||
const histoDescr = histograms[event.target.value];
|
||||
onSelect(histoDescr);
|
||||
});
|
||||
return selectBatchcodeCombination;
|
||||
}
|
||||
|
||||
static #addBatchcodeCombinationOptions(batchcodesSelect, histograms) {
|
||||
|
||||
@@ -49762,7 +49762,14 @@
|
||||
<option value="Ø94F21A">Ø94F21A</option>
|
||||
</select>
|
||||
</p>
|
||||
<div id="batchCodeDetails" style="width: 50%"></div>
|
||||
<div id="batchCodeDetails" style="width: 50%">
|
||||
<div id="selectBatchcodeCombination">
|
||||
<label>Select batchcode combination:
|
||||
<select id="batchcodesSelect" name="batchcodes">
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<p><b>Data Source:</b>
|
||||
<a href="https://vaers.hhs.gov/data/datasets.html" target="_blank">Vaccine Adverse Event Reporting System
|
||||
(VAERS)</a>
|
||||
@@ -49773,14 +49780,6 @@
|
||||
<template id="template-canvas">
|
||||
<canvas></canvas>
|
||||
</template>
|
||||
<template id="template-selectBatchcodeCombination">
|
||||
<div>
|
||||
<label>Select batchcode combination:
|
||||
<select id="batchcodesSelect" name="batchcodes">
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</template>
|
||||
<template id="template-chartWithSlider">
|
||||
<div class="chartWithSlider">
|
||||
<div class="chartContainer">
|
||||
|
||||
Reference in New Issue
Block a user