From 2f9b27b87905efb01c4fd2d722af7eae8742cec5 Mon Sep 17 00:00:00 2001 From: frankknoll Date: Sat, 28 Jan 2023 22:57:18 +0100 Subject: [PATCH] refactoring --- docs/HistogramView.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/HistogramView.js b/docs/HistogramView.js index efe47133898..4d33bdd5706 100644 --- a/docs/HistogramView.js +++ b/docs/HistogramView.js @@ -9,13 +9,7 @@ class HistogramView { displayHistogramsForBatchcode(batchcode) { this .#loadHistoDescrsForBatchcode(batchcode) - .then(histoDescrs => { - for (const histoDescr of histoDescrs.histograms) { - const canvas = document.createElement("canvas"); - this.#uiContainer.appendChild(canvas); - this.#displayHistogram(histoDescr, canvas); - } - }); + .then(histoDescrs => this.#displayHistograms(histoDescrs)); } #loadHistoDescrsForBatchcode(batchcode) { @@ -28,6 +22,14 @@ class HistogramView { }) } + #displayHistograms(histoDescrs) { + for (const histoDescr of histoDescrs.histograms) { + const canvas = document.createElement("canvas"); + this.#uiContainer.appendChild(canvas); + this.#displayHistogram(histoDescr, canvas); + } + } + #displayHistogram(histoDescr, canvas) { // FK-TODO: brauchen Slider wie bei intensivstationen new Chart(