From 2354a0a3356dd2312f5f83155cb98858beb41572 Mon Sep 17 00:00:00 2001 From: BeritJanssen Date: Wed, 11 Oct 2023 11:22:17 +0200 Subject: [PATCH] fix ngram currentParameters initialization order --- .../visualization/ngram/ngram.component.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/frontend/src/app/visualization/ngram/ngram.component.ts b/frontend/src/app/visualization/ngram/ngram.component.ts index b7edb8741..5f0c432b9 100644 --- a/frontend/src/app/visualization/ngram/ngram.component.ts +++ b/frontend/src/app/visualization/ngram/ngram.component.ts @@ -63,6 +63,15 @@ export class NgramComponent extends ParamDirective implements OnChanges { paramService: ParamService ) { super(route, router, paramService); + this.currentParameters = new NgramParameters( + this.sizeOptions[0].value, + this.positionsOptions[0].value, + this.freqCompensationOptions[0].value, + 'none', + this.maxDocumentsOptions[0].value, + this.numberOfNgramsOptions[0].value, + 'date' + ); } initialize() {} @@ -81,15 +90,7 @@ export class NgramComponent extends ParamDirective implements OnChanges { this.resultsCache = {}; this.allDateFields = this.corpus.fields.filter(field => field.mappingType === 'date'); this.dateField = this.allDateFields[0]; - this.currentParameters = new NgramParameters( - this.sizeOptions[0].value, - this.positionsOptions[0].value, - this.freqCompensationOptions[0].value, - 'none', - this.maxDocumentsOptions[0].value, - this.numberOfNgramsOptions[0].value, - this.dateField.name - ); + this.currentParameters.dateField = this.dateField.name; if (this.visualizedField.multiFields) { this.analysisOptions = [{label: 'None', value: 'none'}] .concat(this.visualizedField.multiFields.map(subfield => {