refactoring

This commit is contained in:
frankknoll
2023-01-28 17:14:11 +01:00
parent be88823116
commit bdc6d087a0
2 changed files with 49 additions and 31 deletions

View File

@@ -1,14 +1,17 @@
class HistogramView {
constructor() {
#uiContainer;
constructor(uiContainer) {
this.#uiContainer = uiContainer
}
show(batchcode, uiContainer) {
displayHistogramsForBatchcode(batchcode) {
fetch(`data/histograms/${batchcode}.json`)
.then(response => response.json())
.then(histoDescr => {
const canvas = document.createElement("canvas");
uiContainer.appendChild(canvas);
this.#uiContainer.appendChild(canvas);
this.#displayChart(histoDescr, canvas);
});
}