You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2021/08/22 16:53:52 UTC

[incubator-streampipes] 02/02: [STREAMPIPES-410] Refactor line chart widget

This is an automated email from the ASF dual-hosted git repository.

riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git

commit 12000b8ea4e7ac0b59cce7fb62130fc500dc38ee
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Sun Aug 22 18:49:28 2021 +0200

    [STREAMPIPES-410] Refactor line chart widget
---
 .../widgets/line-chart/line-chart-widget.component.ts       | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/ui/src/app/data-explorer/components/widgets/line-chart/line-chart-widget.component.ts b/ui/src/app/data-explorer/components/widgets/line-chart/line-chart-widget.component.ts
index 36a0aec..8e10045 100644
--- a/ui/src/app/data-explorer/components/widgets/line-chart/line-chart-widget.component.ts
+++ b/ui/src/app/data-explorer/components/widgets/line-chart/line-chart-widget.component.ts
@@ -140,7 +140,6 @@ export class LineChartWidgetComponent extends BaseDataExplorerWidget<LineChartWi
     this.updateAppearance();
 
     super.ngOnInit();
-    this.updateData();
     this.resizeService.resizeSubject.subscribe(info => {
       if (info.gridsterItem.id === this.gridsterItem.id) {
         setTimeout(() => {
@@ -308,6 +307,8 @@ export class LineChartWidgetComponent extends BaseDataExplorerWidget<LineChartWi
   }
 
   transformData(data: DataResult, xKey: string): DataResult {
+    console.log(xKey);
+    console.log(data);
     const columnsContainingNumbers = [];
     const columnsContainingStrings = [];
 
@@ -323,8 +324,8 @@ export class LineChartWidgetComponent extends BaseDataExplorerWidget<LineChartWi
     });
 
     // Get key of timestamp column for x axis
-    const indexXkey = data.headers.findIndex(headerName => headerName === this.dataExplorerWidget.dataConfig.xKey);
-
+    //const indexXkey = data.headers.findIndex(headerName => headerName === this.dataExplorerWidget.dataConfig.xKey);
+    const indexXkey = 0;
 
     const tmpLineChartTraces: any[] = [];
 
@@ -687,14 +688,16 @@ export class LineChartWidgetComponent extends BaseDataExplorerWidget<LineChartWi
   buildQuery(): DatalakeQueryParameters {
     return DatalakeQueryParameterBuilder
         .create(this.timeSettings.startTime, this.timeSettings.endTime)
-        .withAutoAggregation('FIRST')
+        .withAutoAggregation('MEAN')
+        .withColumnFilter(this.dataExplorerWidget.dataConfig.selectedLineChartProperties.map(ep => ep.runtimeName))
         .build();
   }
 
   buildAggregationQuery(): DatalakeQueryParameters {
     return DatalakeQueryParameterBuilder
         .create(this.timeSettings.startTime, this.timeSettings.endTime)
-        .withPaging(1, 100)
+        .withPaging(1, 2000)
+        .withColumnFilter(this.dataExplorerWidget.dataConfig.selectedLineChartProperties.map(ep => ep.runtimeName))
         .withGrouping(undefined, undefined,
             this.dataExplorerWidget.dataConfig.aggregationTimeUnit, this.dataExplorerWidget.dataConfig.aggregationValue)
         .build();