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