displaying histograms for each country and batchcode

This commit is contained in:
frankknoll
2023-02-12 18:34:13 +01:00
parent 21118a4f35
commit baaac31f1c
4 changed files with 205 additions and 86 deletions

View File

@@ -1,7 +1,7 @@
class HistoDescrsProvider {
static getHistoDescrsForBatchcode(batchcode) {
return fetch(`data/histograms/global/${batchcode}.json`)
static getHistoDescrs(country, batchcode) {
return fetch(`data/histograms/${country}/${batchcode}.json`)
.then(response => response.json())
.then(histoDescrs => {
histoDescrs.histograms.sort((histoDescr1, histoDescr2) => histoDescr1.batchcodes.length - histoDescr2.batchcodes.length);