refactoring
This commit is contained in:
@@ -118,12 +118,18 @@ class BatchCodeTableInitializer {
|
||||
|
||||
#displayBatchcodeByCountryBarChart(batchcode, barChartDescriptions, uiContainer) {
|
||||
if (batchcode in barChartDescriptions.barChartDescriptions) {
|
||||
const barChartDescription = barChartDescriptions.barChartDescriptions[batchcode];
|
||||
barChartDescription['batchcode'] = batchcode;
|
||||
new BatchcodeByCountryBarChartView(uiContainer).displayBatchcodeByCountryBarChart(barChartDescription);
|
||||
new BatchcodeByCountryBarChartView(uiContainer)
|
||||
.displayBatchcodeByCountryBarChart(this.#getBarChartDescription(barChartDescriptions, batchcode));
|
||||
}
|
||||
}
|
||||
|
||||
#getBarChartDescription(barChartDescriptions, batchcode) {
|
||||
const barChartDescription = barChartDescriptions.barChartDescriptions[batchcode];
|
||||
barChartDescription.batchcode = batchcode;
|
||||
barChartDescription.dateRange = barChartDescriptions.dateRange;
|
||||
return barChartDescription;
|
||||
}
|
||||
|
||||
#setVisibilityOfCountriesColumn(batchCodeTable, showCountriesColumn) {
|
||||
batchCodeTable
|
||||
.column(this.#getColumnIndex('Countries'))
|
||||
|
||||
@@ -35,13 +35,17 @@ class BatchcodeByCountryBarChart {
|
||||
data: barChartDescription["frequencies before deletion"]
|
||||
},
|
||||
{
|
||||
label: "frequencies guessed", // FK-TODO: daterange einfügen
|
||||
label: `frequencies guessed ${this.#dateRange2str(barChartDescription.dateRange)}`,
|
||||
data: barChartDescription["frequencies guessed"]
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
#dateRange2str(dateRange) {
|
||||
return `${dateRange.start} - ${dateRange.end}`;
|
||||
}
|
||||
|
||||
#getOptions() {
|
||||
return {
|
||||
plugins: {
|
||||
|
||||
Reference in New Issue
Block a user