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