refactoring
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
class BatchcodeCombinationSelection {
|
class BatchcodeCombinationSelection {
|
||||||
|
|
||||||
getSelectBatchcodeCombination({ histograms, onSelect }) {
|
static getSelectBatchcodeCombination({ histograms, onSelect }) {
|
||||||
const selectBatchcodeCombination = UIUtils.instantiateTemplate('template-selectBatchcodeCombination');
|
const selectBatchcodeCombination = UIUtils.instantiateTemplate('template-selectBatchcodeCombination');
|
||||||
const batchcodesSelect = selectBatchcodeCombination.querySelector('#batchcodesSelect');
|
const batchcodesSelect = selectBatchcodeCombination.querySelector('#batchcodesSelect');
|
||||||
this.#addBatchcodeCombinationOptions(batchcodesSelect, histograms);
|
this.#addBatchcodeCombinationOptions(batchcodesSelect, histograms);
|
||||||
@@ -13,15 +13,15 @@ class BatchcodeCombinationSelection {
|
|||||||
return selectBatchcodeCombination;
|
return selectBatchcodeCombination;
|
||||||
}
|
}
|
||||||
|
|
||||||
#addBatchcodeCombinationOptions(batchcodesSelect, histograms) {
|
static #addBatchcodeCombinationOptions(batchcodesSelect, histograms) {
|
||||||
this.#getBatchcodeCombinationOptions(histograms).forEach(option => batchcodesSelect.add(option));
|
this.#getBatchcodeCombinationOptions(histograms).forEach(option => batchcodesSelect.add(option));
|
||||||
}
|
}
|
||||||
|
|
||||||
#getBatchcodeCombinationOptions(histograms) {
|
static #getBatchcodeCombinationOptions(histograms) {
|
||||||
return histograms.map(this.#getBatchcodeCombinationOption);
|
return histograms.map(this.#getBatchcodeCombinationOption);
|
||||||
}
|
}
|
||||||
|
|
||||||
#getBatchcodeCombinationOption(histoDescr, index) {
|
static #getBatchcodeCombinationOption(histoDescr, index) {
|
||||||
const option = document.createElement("option");
|
const option = document.createElement("option");
|
||||||
option.text = histoDescr.batchcodes.join(', ');
|
option.text = histoDescr.batchcodes.join(', ');
|
||||||
option.value = index;
|
option.value = index;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class HistogramView {
|
|||||||
|
|
||||||
#displaySelectBatchcodeCombination(histograms, histogramChartView, chartWithSlider) {
|
#displaySelectBatchcodeCombination(histograms, histogramChartView, chartWithSlider) {
|
||||||
const selectBatchcodeCombination =
|
const selectBatchcodeCombination =
|
||||||
new BatchcodeCombinationSelection().getSelectBatchcodeCombination(
|
BatchcodeCombinationSelection.getSelectBatchcodeCombination(
|
||||||
{
|
{
|
||||||
histograms: histograms,
|
histograms: histograms,
|
||||||
onSelect: histoDescr => this.#displayHistogram(histoDescr, histogramChartView, chartWithSlider)
|
onSelect: histoDescr => this.#displayHistogram(histoDescr, histogramChartView, chartWithSlider)
|
||||||
|
|||||||
Reference in New Issue
Block a user