refactoring
This commit is contained in:
@@ -7,12 +7,9 @@ class HistogramView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
displayHistogramsForBatchcode(batchcode) {
|
displayHistogramsForBatchcode(batchcode) {
|
||||||
const loadingText = document.createTextNode('Loading...');
|
this
|
||||||
this.#uiContainer.appendChild(loadingText);
|
.#loadHistoDescrsForBatchcode(batchcode)
|
||||||
fetch(`data/histograms/${batchcode}.json`)
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(histoDescrs => {
|
.then(histoDescrs => {
|
||||||
loadingText.remove();
|
|
||||||
for (const histoDescr of histoDescrs.histograms) {
|
for (const histoDescr of histoDescrs.histograms) {
|
||||||
const canvas = document.createElement("canvas");
|
const canvas = document.createElement("canvas");
|
||||||
this.#uiContainer.appendChild(canvas);
|
this.#uiContainer.appendChild(canvas);
|
||||||
@@ -21,6 +18,16 @@ class HistogramView {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#loadHistoDescrsForBatchcode(batchcode) {
|
||||||
|
const loadingText = document.createTextNode('Loading...');
|
||||||
|
this.#uiContainer.appendChild(loadingText);
|
||||||
|
return fetch(`data/histograms/${batchcode}.json`)
|
||||||
|
.then(response => {
|
||||||
|
loadingText.remove();
|
||||||
|
return response.json();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
#displayHistogram(histoDescr, canvas) {
|
#displayHistogram(histoDescr, canvas) {
|
||||||
// FK-TODO: brauchen Slider wie bei intensivstationen
|
// FK-TODO: brauchen Slider wie bei intensivstationen
|
||||||
new Chart(
|
new Chart(
|
||||||
|
|||||||
Reference in New Issue
Block a user