refactoring

This commit is contained in:
frankknoll
2023-01-30 23:45:56 +01:00
parent cd2b6a2d80
commit af3b61b69a
2 changed files with 5 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
class BatchcodeCombinationSelection {
getSelectBatchcodeCombination({ histograms, onSelect }) {
static getSelectBatchcodeCombination({ histograms, onSelect }) {
const selectBatchcodeCombination = UIUtils.instantiateTemplate('template-selectBatchcodeCombination');
const batchcodesSelect = selectBatchcodeCombination.querySelector('#batchcodesSelect');
this.#addBatchcodeCombinationOptions(batchcodesSelect, histograms);
@@ -13,15 +13,15 @@ class BatchcodeCombinationSelection {
return selectBatchcodeCombination;
}
#addBatchcodeCombinationOptions(batchcodesSelect, histograms) {
static #addBatchcodeCombinationOptions(batchcodesSelect, histograms) {
this.#getBatchcodeCombinationOptions(histograms).forEach(option => batchcodesSelect.add(option));
}
#getBatchcodeCombinationOptions(histograms) {
static #getBatchcodeCombinationOptions(histograms) {
return histograms.map(this.#getBatchcodeCombinationOption);
}
#getBatchcodeCombinationOption(histoDescr, index) {
static #getBatchcodeCombinationOption(histoDescr, index) {
const option = document.createElement("option");
option.text = histoDescr.batchcodes.join(', ');
option.value = index;

View File

@@ -36,7 +36,7 @@ class HistogramView {
#displaySelectBatchcodeCombination(histograms, histogramChartView, chartWithSlider) {
const selectBatchcodeCombination =
new BatchcodeCombinationSelection().getSelectBatchcodeCombination(
BatchcodeCombinationSelection.getSelectBatchcodeCombination(
{
histograms: histograms,
onSelect: histoDescr => this.#displayHistogram(histoDescr, histogramChartView, chartWithSlider)