From 7d2f90155716d3b96d2fdd353e0cf891589556c6 Mon Sep 17 00:00:00 2001 From: Violet Voronetzky Date: Mon, 11 Nov 2019 11:02:23 +0200 Subject: [PATCH] Expose methods for integration (temp for debug) --- src/common/kustoChartHelper.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/common/kustoChartHelper.ts b/src/common/kustoChartHelper.ts index c1b2089..1e06fa4 100644 --- a/src/common/kustoChartHelper.ts +++ b/src/common/kustoChartHelper.ts @@ -14,6 +14,14 @@ export interface ITransformedQueryResultData { } export class KustoChartHelper implements IChartHelper { + + //#region Public members + + public transformedQueryResultData: IQueryResultData; + public isResolveAsSeries: boolean = false; + + //#endregion Public members + //#region Private members private static readonly maxDefaultYAxesSelection: number = 4; @@ -26,9 +34,7 @@ export class KustoChartHelper implements IChartHelper { aggregationType: AggregationType.Sum } - private readonly seriesVisualize: SeriesVisualize; private queryResultData: IQueryResultData; - private transformedQueryResultData?: IQueryResultData; //#endregion Private members @@ -96,7 +102,7 @@ export class KustoChartHelper implements IChartHelper { * @param chartOptions * @returns transformed data if the transformation succeeded. Otherwise - returns null */ - public transformQueryResultData(queryResultData: IQueryResultData, chartOptions: IChartOptions): ITransformedQueryResultData { + public transformQueryResultData(queryResultData: IQueryResultData, chartOptions: IChartOptions): ITransformedQueryResultData { // Update the chart options with defaults for optional values that weren't provided chartOptions = this.updateDefaultChartOptions(chartOptions); const chartColumns: IColumn[] = []; @@ -150,9 +156,11 @@ export class KustoChartHelper implements IChartHelper { this.transformedQueryResultData = queryResultData; // Tries to resolve the results as series - const updatedQueryResultData: IQueryResultData = this.seriesVisualize.tryResolveResultsAsSeries(queryResultData); + const seriesVisualize = SeriesVisualize.getInstance(); + const updatedQueryResultData: IQueryResultData = seriesVisualize.tryResolveResultsAsSeries(queryResultData); if (updatedQueryResultData) { + this.isResolveAsSeries = true; this.transformedQueryResultData = updatedQueryResultData; } }