You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2020/03/07 17:15:27 UTC

[incubator-streampipes] branch STREAMPIPES-79 updated (cc48912 -> a3e1d51)

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

zehnder pushed a change to branch STREAMPIPES-79
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git.


    from cc48912  Create components for loading spinner and no data
     new a2addca  Working on line chart
     new a3e1d51  Add spinner and info text when no data to line chart

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../widgets/base/base-data-explorer-widget.ts      | 11 ++++--
 .../line-chart/line-chart-widget.component.html    | 39 ++++++++--------------
 .../line-chart/line-chart-widget.component.ts      | 11 ++++--
 .../widgets/table/table-widget.component.html      | 14 --------
 .../widgets/table/table-widget.component.ts        |  8 ++---
 5 files changed, 34 insertions(+), 49 deletions(-)


[incubator-streampipes] 01/02: Working on line chart

Posted by ze...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit a2addca88784f43f1c733db4f68b52f18f475067
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Sat Mar 7 15:51:38 2020 +0100

    Working on line chart
---
 .../line-chart/line-chart-widget.component.html    | 39 ++++++++--------------
 .../widgets/table/table-widget.component.html      | 14 --------
 2 files changed, 14 insertions(+), 39 deletions(-)

diff --git a/ui/src/app/data-explorer-v2/components/widgets/line-chart/line-chart-widget.component.html b/ui/src/app/data-explorer-v2/components/widgets/line-chart/line-chart-widget.component.html
index 226e0a2..a190c31 100644
--- a/ui/src/app/data-explorer-v2/components/widgets/line-chart/line-chart-widget.component.html
+++ b/ui/src/app/data-explorer-v2/components/widgets/line-chart/line-chart-widget.component.html
@@ -37,36 +37,25 @@
     <div style="width: 100%; height: 500px">
 
 
-    <div fxLayout="row">
-        <!--<div *ngIf="enablePaging" fxFlex="5">-->
-            <!--<button mat-icon-button (click)="clickPreviousPage()" class="paging-button" matTooltip="Going backwards in time">-->
-                <!--<mat-icon style="font-size: 30px;height: 30px; width: 30px">-->
-                    <!--chevron_left-->
-                <!--</mat-icon>-->
-            <!--</button>-->
-        <!--</div>-->
+        <div fxLayout="row">
+            <sp-load-data-spinner *ngIf="showIsLoadingData"></sp-load-data-spinner>
 
+            <sp-no-data-in-date-range *ngIf="showNoDataInDateRange" [viewDateRange]="viewDateRange"></sp-no-data-in-date-range>
 
-        <!-- Chart -->
-        <plotly-plot fxFlex
-                *ngIf="data !== undefined"
-                flex
-                [data]="data"
-                [layout]="graph.layout"
-                (relayout)="zoomIn($event)">
-        </plotly-plot>
 
-        <!--<div *ngIf="enablePaging" fxFlex="5">-->
-            <!--<button mat-icon-button (click)="clickNextPage()" class="paging-button" matTooltip="Going forwards in time">-->
-                <!--<mat-icon style="font-size: 30px;height: 30px; width: 30px">-->
-                    <!--chevron_right-->
-                <!--</mat-icon>-->
-            <!--</button>-->
-        <!--</div>-->
-    </div>
+            <!-- Chart -->
+            <plotly-plot fxFlex
+                         *ngIf="data !== undefined"
+                         flex
+                         [data]="data"
+                         [layout]="graph.layout"
+                         (relayout)="zoomIn($event)">
+            </plotly-plot>
 
+        </div>
 
-</div>
+
+    </div>
 
 
 </div>
diff --git a/ui/src/app/data-explorer-v2/components/widgets/table/table-widget.component.html b/ui/src/app/data-explorer-v2/components/widgets/table/table-widget.component.html
index 75ef366..ab1a7dc 100644
--- a/ui/src/app/data-explorer-v2/components/widgets/table/table-widget.component.html
+++ b/ui/src/app/data-explorer-v2/components/widgets/table/table-widget.component.html
@@ -34,20 +34,6 @@
             </button>
         </div>
     </div>
-    <!--<div *ngIf="enablePaging" fxLayout="row" fxLayoutAlign="space-between center">-->
-
-    <!--<div *ngIf="dataMode === 'group' && transformedData !== undefined">-->
-    <!--<mat-form-field style="margin-right: 1px;top: -3px;height: 1px" appearance="outline">-->
-    <!--<mat-label>Select Group</mat-label>-->
-    <!--<mat-select [ngModel]="this.selectedGroup" (selectionChange)="selectGroup($event.value)">-->
-    <!--<mat-option *ngFor="let key of getGroupKeys()" [value]="key" style="background-color: #FFFFFF">-->
-    <!--{{key}}-->
-    <!--</mat-option>-->
-    <!--</mat-select>-->
-    <!--</mat-form-field>-->
-    <!--</div>-->
-    <!--</div>-->
-
 
     <div style=" overflow-y: auto;" [style.max-height.px]="gridsterItem.rows * 100 - 40">
 


[incubator-streampipes] 02/02: Add spinner and info text when no data to line chart

Posted by ze...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit a3e1d5151d25a147435cf06d58e6214d5ce9d3c5
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Sat Mar 7 18:14:10 2020 +0100

    Add spinner and info text when no data to line chart
---
 .../components/widgets/base/base-data-explorer-widget.ts      | 11 +++++++++--
 .../widgets/line-chart/line-chart-widget.component.html       |  2 +-
 .../widgets/line-chart/line-chart-widget.component.ts         | 11 +++++++++--
 .../components/widgets/table/table-widget.component.ts        |  8 ++------
 4 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/ui/src/app/data-explorer-v2/components/widgets/base/base-data-explorer-widget.ts b/ui/src/app/data-explorer-v2/components/widgets/base/base-data-explorer-widget.ts
index 2107df3..9ff0f47 100644
--- a/ui/src/app/data-explorer-v2/components/widgets/base/base-data-explorer-widget.ts
+++ b/ui/src/app/data-explorer-v2/components/widgets/base/base-data-explorer-widget.ts
@@ -16,13 +16,13 @@
  *
  */
 
-import { EventEmitter, Input, Output } from '@angular/core';
+import { EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
 import { GridsterItem, GridsterItemComponent } from 'angular-gridster2';
 import { DataExplorerWidgetModel } from '../../../../core-model/datalake/DataExplorerWidgetModel';
 import { DateRange } from '../../../../core-model/datalake/DateRange';
 import { IDataViewDashboardItem } from '../../../models/dataview-dashboard.model';
 
-export abstract class BaseDataExplorerWidget {
+export abstract class BaseDataExplorerWidget implements OnChanges {
 
   protected constructor() {
   }
@@ -58,4 +58,11 @@ export abstract class BaseDataExplorerWidget {
       this.showIsLoadingData = showIsLoadingData;
   }
 
+  ngOnChanges(changes: SimpleChanges) {
+    this.viewDateRange = changes.viewDateRange.currentValue;
+    this.updateData();
+  }
+
+  public abstract updateData();
+
 }
diff --git a/ui/src/app/data-explorer-v2/components/widgets/line-chart/line-chart-widget.component.html b/ui/src/app/data-explorer-v2/components/widgets/line-chart/line-chart-widget.component.html
index a190c31..61e070e 100644
--- a/ui/src/app/data-explorer-v2/components/widgets/line-chart/line-chart-widget.component.html
+++ b/ui/src/app/data-explorer-v2/components/widgets/line-chart/line-chart-widget.component.html
@@ -45,7 +45,7 @@
 
             <!-- Chart -->
             <plotly-plot fxFlex
-                         *ngIf="data !== undefined"
+                         *ngIf="showData"
                          flex
                          [data]="data"
                          [layout]="graph.layout"
diff --git a/ui/src/app/data-explorer-v2/components/widgets/line-chart/line-chart-widget.component.ts b/ui/src/app/data-explorer-v2/components/widgets/line-chart/line-chart-widget.component.ts
index 8b82c14..2eab987 100644
--- a/ui/src/app/data-explorer-v2/components/widgets/line-chart/line-chart-widget.component.ts
+++ b/ui/src/app/data-explorer-v2/components/widgets/line-chart/line-chart-widget.component.ts
@@ -93,12 +93,19 @@ export class LineChartWidgetComponent extends BaseDataExplorerWidget implements
   }
 
   updateData() {
+
+    this.setShownComponents(false, false, true);
     this.dataLakeRestService.getDataAutoAggergation(
       this.dataExplorerWidget.measureName, this.viewDateRange.startDate.getTime(), this.viewDateRange.endDate.getTime()).subscribe(
       (res: DataResult) => {
-        const tmp = this.transformData(res, this.xKey);
+        if (res.total === 0) {
+          this.setShownComponents(true, false, false);
+        } else {
+          const tmp = this.transformData(res, this.xKey);
+          this.data = this.displayData(tmp, this.yKeys);
+          this.setShownComponents(false, true, false);
+        }
 
-        this.data = this.displayData(tmp, this.yKeys);
       }
     );
   }
diff --git a/ui/src/app/data-explorer-v2/components/widgets/table/table-widget.component.ts b/ui/src/app/data-explorer-v2/components/widgets/table/table-widget.component.ts
index 3a95308..d341b49 100644
--- a/ui/src/app/data-explorer-v2/components/widgets/table/table-widget.component.ts
+++ b/ui/src/app/data-explorer-v2/components/widgets/table/table-widget.component.ts
@@ -16,7 +16,7 @@
  *
  */
 
-import { Component, OnChanges, OnDestroy, OnInit, SimpleChanges, ViewChild } from '@angular/core';
+import { Component, OnChanges, OnDestroy, OnInit,  ViewChild } from '@angular/core';
 import { MatSort } from '@angular/material/sort';
 import { MatTableDataSource } from '@angular/material/table';
 import { DataResult } from '../../../../core-model/datalake/DataResult';
@@ -28,7 +28,7 @@ import { BaseDataExplorerWidget } from '../base/base-data-explorer-widget';
   templateUrl: './table-widget.component.html',
   styleUrls: ['./table-widget.component.css']
 })
-export class TableWidgetComponent extends BaseDataExplorerWidget implements OnInit, OnDestroy, OnChanges  {
+export class TableWidgetComponent extends BaseDataExplorerWidget implements OnInit, OnDestroy {
 
 
   @ViewChild(MatSort, {static: true}) sort: MatSort;
@@ -92,10 +92,6 @@ export class TableWidgetComponent extends BaseDataExplorerWidget implements OnIn
     this.dataSource.data = [];
   }
 
-  ngOnChanges(changes: SimpleChanges) {
-    this.viewDateRange = changes.viewDateRange.currentValue;
-    this.updateData();
-  }
 
 
 }