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 2022/09/18 08:43:25 UTC

[incubator-streampipes] branch dev updated (26da95851 -> ef4a30695)

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

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


    from 26da95851 [hotfix] Improve resize behaviour of data explorer widgets
     new 3181e3332 [hotfix] Properly unsubscribe from data explorer subscriptions
     new 16fad1327 [hotfix] Show loading spinner in widget toolbar
     new d51a6909e [hotfix] Minor code improvement
     new ef4a30695 [hotfix] Improve slide mode appearance in data explorer

The 4 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:
 .../data-explorer-dashboard-overview.component.ts  | 15 ++++--
 .../data-explorer-dashboard-panel.component.ts     | 16 ++++--
 ...ta-explorer-dashboard-slide-view.component.html | 58 ++++++++++++----------
 ...ta-explorer-dashboard-slide-view.component.scss | 23 +++++----
 .../data-explorer-dashboard-widget.component.html  |  2 +
 .../data-explorer-dashboard-widget.component.ts    | 35 ++++++++++---
 .../correlation-chart-widget.component.html        | 11 ++--
 .../correlation-chart-widget.component.ts          | 14 +-----
 .../distribution-chart-widget.component.html       | 10 ++--
 .../widgets/heatmap/heatmap-widget.component.html  | 12 +++--
 .../widgets/image/image-widget.component.html      |  2 -
 .../indicator-chart-widget.component.html          | 10 ++--
 .../widgets/map/map-widget.component.html          |  9 ++--
 .../widgets/table/table-widget.component.html      | 11 ++--
 .../time-series-chart-widget.component.html        | 11 ++--
 .../time-series-chart-widget.component.ts          | 17 +------
 .../components/widgets/utils/color-utils.ts        | 31 +++++-------
 .../no-data/no-data-in-date-range.component.html   |  6 +--
 .../too-much-data/too-much-data.component.html     |  8 +--
 19 files changed, 171 insertions(+), 130 deletions(-)
 copy streampipes-data-explorer/src/main/java/org/apache/streampipes/dataexplorer/query/DeleteDataQuery.java => ui/src/app/data-explorer/components/widgets/utils/color-utils.ts (56%)


[incubator-streampipes] 02/04: [hotfix] Show loading spinner in widget toolbar

Posted by ri...@apache.org.
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 16fad1327138ca1182b56bf46652b8ce75d48f67
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Sat Sep 17 22:32:22 2022 +0200

    [hotfix] Show loading spinner in widget toolbar
---
 .../components/widget/data-explorer-dashboard-widget.component.html     | 2 ++
 .../widgets/correlation-chart/correlation-chart-widget.component.html   | 2 --
 .../widgets/distribution-chart/distribution-chart-widget.component.html | 2 --
 .../components/widgets/heatmap/heatmap-widget.component.html            | 2 --
 .../data-explorer/components/widgets/image/image-widget.component.html  | 2 --
 .../components/widgets/indicator/indicator-chart-widget.component.html  | 2 --
 .../app/data-explorer/components/widgets/map/map-widget.component.html  | 2 --
 .../data-explorer/components/widgets/table/table-widget.component.html  | 2 --
 .../widgets/time-series-chart/time-series-chart-widget.component.html   | 2 --
 9 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.html b/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.html
index 629d0af80..ff7bb1f16 100644
--- a/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.html
+++ b/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.html
@@ -28,6 +28,8 @@
                 {{ configuredWidget.baseAppearanceConfig.widgetTitle }}
             </div>
             <div fxFlex="100" fxLayout="row" fxLayoutAlign="end center">
+                <mat-spinner [diameter]="20" color="primary" class="mr-10" *ngIf="timerActive">
+                </mat-spinner>
                 <div class="time-counter"
                      *ngIf="editMode"
                      [ngStyle]="{background: configuredWidget.baseAppearanceConfig.textColor, color: configuredWidget.baseAppearanceConfig.backgroundColor}">
diff --git a/ui/src/app/data-explorer/components/widgets/correlation-chart/correlation-chart-widget.component.html b/ui/src/app/data-explorer/components/widgets/correlation-chart/correlation-chart-widget.component.html
index cd0e477b1..4a4b3e47a 100644
--- a/ui/src/app/data-explorer/components/widgets/correlation-chart/correlation-chart-widget.component.html
+++ b/ui/src/app/data-explorer/components/widgets/correlation-chart/correlation-chart-widget.component.html
@@ -19,8 +19,6 @@
 <div fxLayout="column" fxFlex="100"
      [ngStyle]="{background: dataExplorerWidget.baseAppearanceConfig.backgroundColor, color: dataExplorerWidget.baseAppearanceConfig.textColor}">
 
-    <sp-load-data-spinner *ngIf="showIsLoadingData" class="h-100"></sp-load-data-spinner>
-
     <sp-no-data-in-date-range *ngIf="showNoDataInDateRange" [viewDateRange]="timeSettings"></sp-no-data-in-date-range>
 
     <sp-too-much-data
diff --git a/ui/src/app/data-explorer/components/widgets/distribution-chart/distribution-chart-widget.component.html b/ui/src/app/data-explorer/components/widgets/distribution-chart/distribution-chart-widget.component.html
index ce9d36e83..ac4c84d01 100644
--- a/ui/src/app/data-explorer/components/widgets/distribution-chart/distribution-chart-widget.component.html
+++ b/ui/src/app/data-explorer/components/widgets/distribution-chart/distribution-chart-widget.component.html
@@ -19,8 +19,6 @@
 <div fxLayout="column" fxFlex="100"
      [ngStyle]="{background: dataExplorerWidget.baseAppearanceConfig.backgroundColor, color: dataExplorerWidget.baseAppearanceConfig.textColor}">
 
-    <sp-load-data-spinner *ngIf="showIsLoadingData" class="h-100"></sp-load-data-spinner>
-
     <sp-no-data-in-date-range *ngIf="showNoDataInDateRange" [viewDateRange]="timeSettings"></sp-no-data-in-date-range>
 
     <sp-too-much-data
diff --git a/ui/src/app/data-explorer/components/widgets/heatmap/heatmap-widget.component.html b/ui/src/app/data-explorer/components/widgets/heatmap/heatmap-widget.component.html
index 24a404a50..122c67f4f 100644
--- a/ui/src/app/data-explorer/components/widgets/heatmap/heatmap-widget.component.html
+++ b/ui/src/app/data-explorer/components/widgets/heatmap/heatmap-widget.component.html
@@ -18,8 +18,6 @@
 
   <div fxFlex="100" fxLayoutAlign="center center" fxLayout="column" class="main-panel">
 
-    <sp-load-data-spinner *ngIf="showIsLoadingData" class="h-100"></sp-load-data-spinner>
-
     <sp-no-data-in-date-range *ngIf="showNoDataInDateRange" [viewDateRange]="timeSettings"></sp-no-data-in-date-range>
 
     <sp-too-much-data
diff --git a/ui/src/app/data-explorer/components/widgets/image/image-widget.component.html b/ui/src/app/data-explorer/components/widgets/image/image-widget.component.html
index 15772772b..a2bd9ec19 100644
--- a/ui/src/app/data-explorer/components/widgets/image/image-widget.component.html
+++ b/ui/src/app/data-explorer/components/widgets/image/image-widget.component.html
@@ -19,8 +19,6 @@
 
 <div fxFlex="100" fxLayoutAlign="center center" fxLayout="column" class="main-panel">
 
-    <sp-load-data-spinner *ngIf="showIsLoadingData" class="h-100"></sp-load-data-spinner>
-
     <sp-no-data-in-date-range *ngIf="showNoDataInDateRange" [viewDateRange]="timeSettings"></sp-no-data-in-date-range>
 
 
diff --git a/ui/src/app/data-explorer/components/widgets/indicator/indicator-chart-widget.component.html b/ui/src/app/data-explorer/components/widgets/indicator/indicator-chart-widget.component.html
index 074d1fad1..f3e2e6330 100644
--- a/ui/src/app/data-explorer/components/widgets/indicator/indicator-chart-widget.component.html
+++ b/ui/src/app/data-explorer/components/widgets/indicator/indicator-chart-widget.component.html
@@ -19,8 +19,6 @@
 <div fxLayout="column" fxFlex="100"
      [ngStyle]="{background: dataExplorerWidget.baseAppearanceConfig.backgroundColor, color: dataExplorerWidget.baseAppearanceConfig.textColor}">
 
-    <sp-load-data-spinner *ngIf="showIsLoadingData" class="h-100"></sp-load-data-spinner>
-
     <sp-no-data-in-date-range *ngIf="showNoDataInDateRange" [viewDateRange]="timeSettings"></sp-no-data-in-date-range>
 
     <sp-too-much-data
diff --git a/ui/src/app/data-explorer/components/widgets/map/map-widget.component.html b/ui/src/app/data-explorer/components/widgets/map/map-widget.component.html
index fdacf072e..024ec8bf1 100644
--- a/ui/src/app/data-explorer/components/widgets/map/map-widget.component.html
+++ b/ui/src/app/data-explorer/components/widgets/map/map-widget.component.html
@@ -18,8 +18,6 @@
 
 <div fxFlex="100" fxLayoutAlign="center center" fxLayout="column" class="main-panel">
 
-    <sp-load-data-spinner *ngIf="showIsLoadingData" class="h-100"></sp-load-data-spinner>
-
     <sp-no-data-in-date-range *ngIf="showNoDataInDateRange" [viewDateRange]="timeSettings"></sp-no-data-in-date-range>
 
     <sp-too-much-data
diff --git a/ui/src/app/data-explorer/components/widgets/table/table-widget.component.html b/ui/src/app/data-explorer/components/widgets/table/table-widget.component.html
index 5102e530e..3332f9c24 100644
--- a/ui/src/app/data-explorer/components/widgets/table/table-widget.component.html
+++ b/ui/src/app/data-explorer/components/widgets/table/table-widget.component.html
@@ -19,8 +19,6 @@
 <div fxLayout="column" fxFlex="100"
      [ngStyle]="{background: dataExplorerWidget.baseAppearanceConfig.backgroundColor, color: dataExplorerWidget.baseAppearanceConfig.textColor}">
 
-    <sp-load-data-spinner *ngIf="showIsLoadingData" class="h-100"></sp-load-data-spinner>
-
     <sp-no-data-in-date-range *ngIf="showNoDataInDateRange" [viewDateRange]="timeSettings"></sp-no-data-in-date-range>
 
     <sp-too-much-data
diff --git a/ui/src/app/data-explorer/components/widgets/time-series-chart/time-series-chart-widget.component.html b/ui/src/app/data-explorer/components/widgets/time-series-chart/time-series-chart-widget.component.html
index 7a5a7e96d..a65e6277e 100644
--- a/ui/src/app/data-explorer/components/widgets/time-series-chart/time-series-chart-widget.component.html
+++ b/ui/src/app/data-explorer/components/widgets/time-series-chart/time-series-chart-widget.component.html
@@ -18,8 +18,6 @@
 
 <div fxLayout="column" fxFlex="100" [ngStyle]="{background: dataExplorerWidget.baseAppearanceConfig.backgroundColor, color: dataExplorerWidget.baseAppearanceConfig.textColor}">
 
-        <sp-load-data-spinner *ngIf="showIsLoadingData" class="h-100"></sp-load-data-spinner>
-
         <sp-no-data-in-date-range *ngIf="showNoDataInDateRange" [viewDateRange]="timeSettings"></sp-no-data-in-date-range>
 
         <sp-too-much-data


[incubator-streampipes] 03/04: [hotfix] Minor code improvement

Posted by ri...@apache.org.
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 d51a6909e85ee6bd580dcdf3292769a862889daa
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Sat Sep 17 22:50:20 2022 +0200

    [hotfix] Minor code improvement
---
 .../correlation-chart-widget.component.ts          | 14 ++-------
 .../time-series-chart-widget.component.ts          | 17 ++---------
 .../components/widgets/utils/color-utils.ts        | 35 ++++++++++++++++++++++
 3 files changed, 39 insertions(+), 27 deletions(-)

diff --git a/ui/src/app/data-explorer/components/widgets/correlation-chart/correlation-chart-widget.component.ts b/ui/src/app/data-explorer/components/widgets/correlation-chart/correlation-chart-widget.component.ts
index 475367ec9..3de451fff 100644
--- a/ui/src/app/data-explorer/components/widgets/correlation-chart/correlation-chart-widget.component.ts
+++ b/ui/src/app/data-explorer/components/widgets/correlation-chart/correlation-chart-widget.component.ts
@@ -20,6 +20,7 @@ import { Component, OnInit } from '@angular/core';
 import { BaseDataExplorerWidgetDirective } from '../base/base-data-explorer-widget.directive';
 import { CorrelationChartWidgetModel } from './model/correlation-chart-widget.model';
 import { DataExplorerField, SpQueryResult } from '@streampipes/platform-services';
+import { ColorUtils } from '../utils/color-utils';
 
 @Component({
   selector: 'sp-data-explorer-correlation-chart-widget',
@@ -72,17 +73,6 @@ export class CorrelationChartWidgetComponent extends BaseDataExplorerWidgetDirec
     this.updateAppearance();
   }
 
-  lightenColor(color: string, percent: number) {
-    const num = parseInt(color.replace('#', ''), 16);
-    const amt = Math.round(2.55 * percent);
-    const R = (num >> 16) + amt;
-    const B = (num >> 8 & 0x00FF) + amt;
-    const G = (num & 0x0000FF) + amt;
-    const result = '#' + (0x1000000 + (R < 255 ? R < 1 ? 0 : R : 255) * 0x10000 +
-                  (B < 255 ? B < 1 ? 0 : B : 255) * 0x100 + (G < 255 ? G < 1 ? 0 : G : 255)).toString(16).slice(1);
-    return result;
-  }
-
   prepareData(result: SpQueryResult[]) {
 
     const xIndex = this.getColumnIndex(this.dataExplorerWidget.visualizationConfig.firstField, result[0]);
@@ -180,7 +170,7 @@ export class CorrelationChartWidgetComponent extends BaseDataExplorerWidgetDirec
          colCount += 1;
        }
 
-       colorVal = this.lightenColor(colorVal, 11.);
+       colorVal = ColorUtils.lightenColor(colorVal, 11.);
 
     });
   }
diff --git a/ui/src/app/data-explorer/components/widgets/time-series-chart/time-series-chart-widget.component.ts b/ui/src/app/data-explorer/components/widgets/time-series-chart/time-series-chart-widget.component.ts
index eed53c4de..63a073c59 100644
--- a/ui/src/app/data-explorer/components/widgets/time-series-chart/time-series-chart-widget.component.ts
+++ b/ui/src/app/data-explorer/components/widgets/time-series-chart/time-series-chart-widget.component.ts
@@ -20,6 +20,7 @@ import { Component, OnInit } from '@angular/core';
 import { BaseDataExplorerWidgetDirective } from '../base/base-data-explorer-widget.directive';
 import { TimeSeriesChartWidgetModel } from './model/time-series-chart-widget.model';
 import { DataExplorerField, SpQueryResult } from '@streampipes/platform-services';
+import { ColorUtils } from '../utils/color-utils';
 
 @Component({
   selector: 'sp-data-explorer-time-series-chart-widget',
@@ -209,20 +210,6 @@ export class TimeSeriesChartWidgetComponent extends BaseDataExplorerWidgetDirect
     return Object.values(tmpLineChartTraces);
   }
 
-  lightenColor(color: string, percent: number) {
-    const num = parseInt(color.replace('#', ''), 16);
-    const amt = Math.round(2.55 * percent);
-    // tslint:disable-next-line:no-bitwise
-    const R = (num >> 16) + amt;
-    // tslint:disable-next-line:no-bitwise
-    const B = (num >> 8 & 0x00FF) + amt;
-    // tslint:disable-next-line:no-bitwise
-    const G = (num & 0x0000FF) + amt;
-    const result = '#' + (0x1000000 + (R < 255 ? R < 1 ? 0 : R : 255) * 0x10000 +
-      (B < 255 ? B < 1 ? 0 : B : 255) * 0x100 + (G < 255 ? G < 1 ? 0 : G : 255)).toString(16).slice(1);
-    return result;
-  }
-
   setStartX(startX: string) {
     this.selectedStartX = startX;
   }
@@ -335,7 +322,7 @@ export class TimeSeriesChartWidgetComponent extends BaseDataExplorerWidgetDirect
               if (visualizationTypePosition === (visualizationOptions.length - 1)) {
                 dashType = visualizationOptions[0];
                 dashTypeKeeper[name] = dashType;
-                color = this.lightenColor(colorKeeper[name], 11.0);
+                color = ColorUtils.lightenColor(colorKeeper[name], 11.0);
                 colorKeeper[name] = color;
               } else {
                 dashType = visualizationOptions[visualizationTypePosition + 1];
diff --git a/ui/src/app/data-explorer/components/widgets/utils/color-utils.ts b/ui/src/app/data-explorer/components/widgets/utils/color-utils.ts
new file mode 100644
index 000000000..30d39def2
--- /dev/null
+++ b/ui/src/app/data-explorer/components/widgets/utils/color-utils.ts
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+export class ColorUtils {
+
+  static lightenColor(color: string,
+                      percent: number): string {
+    const num = parseInt(color.replace('#', ''), 16);
+    const amt = Math.round(2.55 * percent);
+    // tslint:disable-next-line:no-bitwise
+    const R = (num >> 16) + amt;
+    // tslint:disable-next-line:no-bitwise
+    const B = (num >> 8 & 0x00FF) + amt;
+    // tslint:disable-next-line:no-bitwise
+    const G = (num & 0x0000FF) + amt;
+    const result = '#' + (0x1000000 + (R < 255 ? R < 1 ? 0 : R : 255) * 0x10000 +
+      (B < 255 ? B < 1 ? 0 : B : 255) * 0x100 + (G < 255 ? G < 1 ? 0 : G : 255)).toString(16).slice(1);
+    return result;
+  }
+}


[incubator-streampipes] 04/04: [hotfix] Improve slide mode appearance in data explorer

Posted by ri...@apache.org.
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 ef4a306953cc541096d40989b989d2853c51c32e
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Sun Sep 18 10:43:12 2022 +0200

    [hotfix] Improve slide mode appearance in data explorer
---
 ...ta-explorer-dashboard-slide-view.component.html | 58 ++++++++++++----------
 ...ta-explorer-dashboard-slide-view.component.scss | 23 +++++----
 .../correlation-chart-widget.component.html        |  9 +++-
 .../distribution-chart-widget.component.html       |  8 ++-
 .../widgets/heatmap/heatmap-widget.component.html  | 10 +++-
 .../indicator-chart-widget.component.html          |  8 ++-
 .../widgets/map/map-widget.component.html          |  7 ++-
 .../widgets/table/table-widget.component.html      |  9 +++-
 .../time-series-chart-widget.component.html        |  9 +++-
 .../no-data/no-data-in-date-range.component.html   |  6 +--
 .../too-much-data/too-much-data.component.html     |  8 +--
 11 files changed, 99 insertions(+), 56 deletions(-)

diff --git a/ui/src/app/data-explorer/components/widget-view/slide-view/data-explorer-dashboard-slide-view.component.html b/ui/src/app/data-explorer/components/widget-view/slide-view/data-explorer-dashboard-slide-view.component.html
index 25dc91a63..3fefb758d 100644
--- a/ui/src/app/data-explorer/components/widget-view/slide-view/data-explorer-dashboard-slide-view.component.html
+++ b/ui/src/app/data-explorer/components/widget-view/slide-view/data-explorer-dashboard-slide-view.component.html
@@ -16,32 +16,40 @@
   ~
   -->
 
-<div class="h-100 dashboard-grid" fxLayout="column">
-    <div fxFlex="100px" fxLayout="row" class="selection-box" *ngIf="widgetsAvailable && currentWidget">
-        <div *ngFor="let item of dashboard.widgets; let i = index"
-             [ngClass]="item.id === currentWidget._id ? 'viz-preview viz-preview-selected' : 'viz-preview'"
-             fxLayoutAlign="center center" (click)="selectWidget(i, item.id)">
-            <div fxFlex="100"
-                 fxLayoutAlign="center center">
-                <h5 *ngIf="widgetsVisible">{{configuredWidgets.get(item.id).baseAppearanceConfig.widgetTitle}}</h5>
-            </div>
+<div fxFlex="100" fxLayout="column" style="overflow-y:hidden">
+  <div class="h-100" fxLayout="row" fxFlex="100">
+    <div fxFlex="200px"
+         fxLayout="column"
+         class="selection-box" *ngIf="widgetsAvailable && currentWidget">
+      <div *ngFor="let item of dashboard.widgets; let i = index"
+           [ngClass]="item.id === currentWidget._id ? 'viz-preview viz-preview-selected' : 'viz-preview'"
+           fxLayoutAlign="center center"
+           (click)="selectWidget(i, item.id)">
+        <div fxFlex="100"
+             fxLayout="column"
+             fxLayoutAlign="center center">
+          <span class="slide-view-title" *ngIf="widgetsVisible">{{configuredWidgets.get(item.id).baseAppearanceConfig.widgetTitle}}</span>
         </div>
+      </div>
     </div>
-    <div class="h-100 dashboard-grid" fxLayout="column" id="slideViewOuter" fxFlex="100">
-        <sp-data-explorer-dashboard-widget
-                [ngStyle]="{height: gridsterItemComponent.height -15 + 'px'}"
-                [timeSettings]="timeSettings"
-                (updateCallback)="propagateItemUpdate($event)"
-                (deleteCallback)="propagateItemRemoval($event)"
-                (configureWidgetCallback)="propagateWidgetSelection($event)"
-                (startEditModeEmitter)="startEditMode($event)"
-                [dashboardItem]="currentDashboardItem"
-                [configuredWidget]="currentWidget"
-                [dataLakeMeasure]="currentMeasure"
-                [currentlyConfiguredWidgetId]="currentlyConfiguredWidgetId"
-                [editMode]="editMode"
-                [gridMode]="false"
-                [gridsterItemComponent]="gridsterItemComponent"
-                *ngIf="widgetsAvailable && displayWidget && currentWidget && widgetsVisible"></sp-data-explorer-dashboard-widget>
+    <div fxFlex="100">
+      <div class="h-100 w-100" id="slideViewOuter" fxFlex="100">
+                <sp-data-explorer-dashboard-widget
+                        [ngStyle]="{height: gridsterItemComponent.height -15 + 'px'}"
+                        [timeSettings]="timeSettings"
+                        (updateCallback)="propagateItemUpdate($event)"
+                        (deleteCallback)="propagateItemRemoval($event)"
+                        (configureWidgetCallback)="propagateWidgetSelection($event)"
+                        (startEditModeEmitter)="startEditMode($event)"
+                        [dashboardItem]="currentDashboardItem"
+                        [configuredWidget]="currentWidget"
+                        [dataLakeMeasure]="currentMeasure"
+                        [currentlyConfiguredWidgetId]="currentlyConfiguredWidgetId"
+                        [editMode]="editMode"
+                        [gridMode]="false"
+                        [gridsterItemComponent]="gridsterItemComponent"
+                        *ngIf="widgetsAvailable && displayWidget && currentWidget && widgetsVisible"></sp-data-explorer-dashboard-widget>
+      </div>
     </div>
+  </div>
 </div>
diff --git a/ui/src/app/data-explorer/components/widget-view/slide-view/data-explorer-dashboard-slide-view.component.scss b/ui/src/app/data-explorer/components/widget-view/slide-view/data-explorer-dashboard-slide-view.component.scss
index 5466c053d..3fc10a6c1 100644
--- a/ui/src/app/data-explorer/components/widget-view/slide-view/data-explorer-dashboard-slide-view.component.scss
+++ b/ui/src/app/data-explorer/components/widget-view/slide-view/data-explorer-dashboard-slide-view.component.scss
@@ -16,17 +16,13 @@
  *
  */
 
-.dashboard-grid {
-  display:flex;
-  flex-direction: column;
-  flex: 1 1 100%;
-}
-
 .viz-preview {
-  max-height: 100px;
-  width: 200px;
+  height: 100px;
+  min-height: 100px;
   border: 1px solid var(--color-bg-2);
   cursor: pointer;
+  margin: 5px 10px;
+  padding: 5px;
 }
 
 .viz-preview-selected {
@@ -34,7 +30,14 @@
 }
 
 .selection-box {
-  border: 1px solid var(--color-accent);
-  overflow-x: auto;
+  overflow-y: auto;
+  overflow-x: hidden;
   margin-bottom: 5px;
+  height: calc(100vh - 147px);
+  max-width: 100%;
+}
+
+.slide-view-title {
+  text-align: center;
+  font-size: 10pt;
 }
diff --git a/ui/src/app/data-explorer/components/widgets/correlation-chart/correlation-chart-widget.component.html b/ui/src/app/data-explorer/components/widgets/correlation-chart/correlation-chart-widget.component.html
index 4a4b3e47a..1f7c8ae03 100644
--- a/ui/src/app/data-explorer/components/widgets/correlation-chart/correlation-chart-widget.component.html
+++ b/ui/src/app/data-explorer/components/widgets/correlation-chart/correlation-chart-widget.component.html
@@ -19,12 +19,17 @@
 <div fxLayout="column" fxFlex="100"
      [ngStyle]="{background: dataExplorerWidget.baseAppearanceConfig.backgroundColor, color: dataExplorerWidget.baseAppearanceConfig.textColor}">
 
-    <sp-no-data-in-date-range *ngIf="showNoDataInDateRange" [viewDateRange]="timeSettings"></sp-no-data-in-date-range>
+    <sp-no-data-in-date-range
+        *ngIf="showNoDataInDateRange"
+        [viewDateRange]="timeSettings"
+        class="h-100">
+    </sp-no-data-in-date-range>
 
     <sp-too-much-data
             [amountOfEvents]="amountOfTooMuchEvents"
             (loadDataWithTooManyEventsEmitter)="loadDataWithTooManyEvents()"
-            *ngIf="showTooMuchData"></sp-too-much-data>
+            *ngIf="showTooMuchData" class="h-100">
+    </sp-too-much-data>
 
 
     <plotly-plot *ngIf="showData"
diff --git a/ui/src/app/data-explorer/components/widgets/distribution-chart/distribution-chart-widget.component.html b/ui/src/app/data-explorer/components/widgets/distribution-chart/distribution-chart-widget.component.html
index ac4c84d01..df75b8c0c 100644
--- a/ui/src/app/data-explorer/components/widgets/distribution-chart/distribution-chart-widget.component.html
+++ b/ui/src/app/data-explorer/components/widgets/distribution-chart/distribution-chart-widget.component.html
@@ -19,12 +19,16 @@
 <div fxLayout="column" fxFlex="100"
      [ngStyle]="{background: dataExplorerWidget.baseAppearanceConfig.backgroundColor, color: dataExplorerWidget.baseAppearanceConfig.textColor}">
 
-    <sp-no-data-in-date-range *ngIf="showNoDataInDateRange" [viewDateRange]="timeSettings"></sp-no-data-in-date-range>
+    <sp-no-data-in-date-range
+        *ngIf="showNoDataInDateRange"
+        [viewDateRange]="timeSettings"
+        class="h-100">
+    </sp-no-data-in-date-range>
 
     <sp-too-much-data
             [amountOfEvents]="amountOfTooMuchEvents"
             (loadDataWithTooManyEventsEmitter)="loadDataWithTooManyEvents()"
-            *ngIf="showTooMuchData"></sp-too-much-data>
+            *ngIf="showTooMuchData" class="h-100"></sp-too-much-data>
 
     <plotly-plot *ngIf="showData && !(dataExplorerWidget.visualizationConfig.displayType === 'heatmap')"
                  [divId]="dataExplorerWidget._id"
diff --git a/ui/src/app/data-explorer/components/widgets/heatmap/heatmap-widget.component.html b/ui/src/app/data-explorer/components/widgets/heatmap/heatmap-widget.component.html
index 122c67f4f..e95354219 100644
--- a/ui/src/app/data-explorer/components/widgets/heatmap/heatmap-widget.component.html
+++ b/ui/src/app/data-explorer/components/widgets/heatmap/heatmap-widget.component.html
@@ -18,12 +18,18 @@
 
   <div fxFlex="100" fxLayoutAlign="center center" fxLayout="column" class="main-panel">
 
-    <sp-no-data-in-date-range *ngIf="showNoDataInDateRange" [viewDateRange]="timeSettings"></sp-no-data-in-date-range>
+    <sp-no-data-in-date-range
+        *ngIf="showNoDataInDateRange"
+        [viewDateRange]="timeSettings"
+        class="h-100">
+    </sp-no-data-in-date-range>
 
     <sp-too-much-data
             [amountOfEvents]="amountOfTooMuchEvents"
             (loadDataWithTooManyEventsEmitter)="loadDataWithTooManyEvents()"
-            *ngIf="showTooMuchData"></sp-too-much-data>
+            *ngIf="showTooMuchData"
+            class="h-100">
+    </sp-too-much-data>
 
     <div class="value-panel">
       <div echarts [options]="option"
diff --git a/ui/src/app/data-explorer/components/widgets/indicator/indicator-chart-widget.component.html b/ui/src/app/data-explorer/components/widgets/indicator/indicator-chart-widget.component.html
index f3e2e6330..1dbe8da19 100644
--- a/ui/src/app/data-explorer/components/widgets/indicator/indicator-chart-widget.component.html
+++ b/ui/src/app/data-explorer/components/widgets/indicator/indicator-chart-widget.component.html
@@ -19,12 +19,16 @@
 <div fxLayout="column" fxFlex="100"
      [ngStyle]="{background: dataExplorerWidget.baseAppearanceConfig.backgroundColor, color: dataExplorerWidget.baseAppearanceConfig.textColor}">
 
-    <sp-no-data-in-date-range *ngIf="showNoDataInDateRange" [viewDateRange]="timeSettings"></sp-no-data-in-date-range>
+    <sp-no-data-in-date-range
+        *ngIf="showNoDataInDateRange"
+        [viewDateRange]="timeSettings"
+        class="h-100">
+    </sp-no-data-in-date-range>
 
     <sp-too-much-data
             [amountOfEvents]="amountOfTooMuchEvents"
             (loadDataWithTooManyEventsEmitter)="loadDataWithTooManyEvents()"
-            *ngIf="showTooMuchData"></sp-too-much-data>
+            *ngIf="showTooMuchData" class="h-100"></sp-too-much-data>
 
     <plotly-plot *ngIf="showData"
                  [divId]="dataExplorerWidget._id"
diff --git a/ui/src/app/data-explorer/components/widgets/map/map-widget.component.html b/ui/src/app/data-explorer/components/widgets/map/map-widget.component.html
index 024ec8bf1..38fd24aad 100644
--- a/ui/src/app/data-explorer/components/widgets/map/map-widget.component.html
+++ b/ui/src/app/data-explorer/components/widgets/map/map-widget.component.html
@@ -18,12 +18,15 @@
 
 <div fxFlex="100" fxLayoutAlign="center center" fxLayout="column" class="main-panel">
 
-    <sp-no-data-in-date-range *ngIf="showNoDataInDateRange" [viewDateRange]="timeSettings"></sp-no-data-in-date-range>
+    <sp-no-data-in-date-range
+        *ngIf="showNoDataInDateRange"
+        [viewDateRange]="timeSettings" class="h-100">
+    </sp-no-data-in-date-range>
 
     <sp-too-much-data
             [amountOfEvents]="amountOfTooMuchEvents"
             (loadDataWithTooManyEventsEmitter)="loadDataWithTooManyEvents()"
-            *ngIf="showTooMuchData"></sp-too-much-data>
+            *ngIf="showTooMuchData" class="h-100"></sp-too-much-data>
 
     <div *ngIf="showData">
         <div [ngStyle]="{'width': mapWidth + 'px', 'height': mapHeight + 'px'}"
diff --git a/ui/src/app/data-explorer/components/widgets/table/table-widget.component.html b/ui/src/app/data-explorer/components/widgets/table/table-widget.component.html
index 3332f9c24..a1b2a9e00 100644
--- a/ui/src/app/data-explorer/components/widgets/table/table-widget.component.html
+++ b/ui/src/app/data-explorer/components/widgets/table/table-widget.component.html
@@ -19,13 +19,18 @@
 <div fxLayout="column" fxFlex="100"
      [ngStyle]="{background: dataExplorerWidget.baseAppearanceConfig.backgroundColor, color: dataExplorerWidget.baseAppearanceConfig.textColor}">
 
-    <sp-no-data-in-date-range *ngIf="showNoDataInDateRange" [viewDateRange]="timeSettings"></sp-no-data-in-date-range>
+    <sp-no-data-in-date-range
+        *ngIf="showNoDataInDateRange"
+        [viewDateRange]="timeSettings"
+        class="h-100">
+    </sp-no-data-in-date-range>
 
     <sp-too-much-data
             [amountOfEvents]="amountOfTooMuchEvents"
             (loadDataWithTooManyEventsEmitter)="loadDataWithTooManyEvents()"
             *ngIf="showTooMuchData"
-            ></sp-too-much-data>
+            class="h-100">
+    </sp-too-much-data>
 
     <div class="table-container">
         <table
diff --git a/ui/src/app/data-explorer/components/widgets/time-series-chart/time-series-chart-widget.component.html b/ui/src/app/data-explorer/components/widgets/time-series-chart/time-series-chart-widget.component.html
index a65e6277e..ac729ca40 100644
--- a/ui/src/app/data-explorer/components/widgets/time-series-chart/time-series-chart-widget.component.html
+++ b/ui/src/app/data-explorer/components/widgets/time-series-chart/time-series-chart-widget.component.html
@@ -18,12 +18,17 @@
 
 <div fxLayout="column" fxFlex="100" [ngStyle]="{background: dataExplorerWidget.baseAppearanceConfig.backgroundColor, color: dataExplorerWidget.baseAppearanceConfig.textColor}">
 
-        <sp-no-data-in-date-range *ngIf="showNoDataInDateRange" [viewDateRange]="timeSettings"></sp-no-data-in-date-range>
+        <sp-no-data-in-date-range
+            *ngIf="showNoDataInDateRange"
+            [viewDateRange]="timeSettings"
+            class="h-100">
+        </sp-no-data-in-date-range>
 
         <sp-too-much-data
                 [amountOfEvents]="amountOfTooMuchEvents"
                 (loadDataWithTooManyEventsEmitter)="loadDataWithTooManyEvents()"
-                *ngIf="showTooMuchData"></sp-too-much-data>
+                *ngIf="showTooMuchData" class="h-100">
+        </sp-too-much-data>
 
         <plotly-plot *ngIf="showData"
                      [divId]="dataExplorerWidget._id"
diff --git a/ui/src/app/data-explorer/components/widgets/utils/no-data/no-data-in-date-range.component.html b/ui/src/app/data-explorer/components/widgets/utils/no-data/no-data-in-date-range.component.html
index c409e7ea3..6e31fd505 100644
--- a/ui/src/app/data-explorer/components/widgets/utils/no-data/no-data-in-date-range.component.html
+++ b/ui/src/app/data-explorer/components/widgets/utils/no-data/no-data-in-date-range.component.html
@@ -16,12 +16,12 @@
   ~
   -->
 
-<div fxLayout="column" fxLayoutAlign="space-around center" >
+<div fxLayout="column" fxLayoutAlign="center center" fxFlex="100">
 
-    <div  fxLayout="row" fxLayoutAlign="center center" style="margin-top: 30px">
+    <div  fxLayout="row" fxLayoutAlign="center center">
         <!-- TODO Icon -->
     </div>
-    <div fxLayout="column" fxLayoutAlign="center center" style="margin-top: 30px">
+    <div fxLayout="column" fxLayoutAlign="center center" style="margin-top: 10px">
         <div class="default-text">Found no data in selected time range</div>
         <div class="default-text date-range-text">{{viewDateRange.startTime | date:'MM/dd/yyyy HH:mm'}} - {{viewDateRange.endTime | date:'MM/dd/yyyy HH:mm'}}</div>
 
diff --git a/ui/src/app/data-explorer/components/widgets/utils/too-much-data/too-much-data.component.html b/ui/src/app/data-explorer/components/widgets/utils/too-much-data/too-much-data.component.html
index 9a9a43ad8..a30ba996d 100644
--- a/ui/src/app/data-explorer/components/widgets/utils/too-much-data/too-much-data.component.html
+++ b/ui/src/app/data-explorer/components/widgets/utils/too-much-data/too-much-data.component.html
@@ -15,13 +15,13 @@
   ~ limitations under the License.
   ~
   -->
-<div fxLayout="column" fxLayoutAlign="space-around center" >
+<div fxLayout="column" fxLayoutAlign="center center" fxFlex="100">
 
-    <div  fxLayout="row" fxLayoutAlign="center center" style="margin-top: 30px">
+    <div  fxLayout="row" fxLayoutAlign="center center">
         <i class="material-icons" style="margin-top: 8px">warning</i>
-        <h2>Warning</h2>
+        <h2>&nbsp;Warning</h2>
     </div>
-    <div fxLayout="column" fxLayoutAlign="center center" style="margin-top: 30px">
+    <div fxLayout="column" fxLayoutAlign="center center" style="margin-top: 10px">
         <div class="default-text">This widget tries to load too much data (#Events: {{amountOfEvents}})</div>
         <div class="default-text date-range-text">Please change the widget settings or decrease the time range</div>
 


[incubator-streampipes] 01/04: [hotfix] Properly unsubscribe from data explorer subscriptions

Posted by ri...@apache.org.
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 3181e333241ca3a48278d22f7871e16ff9b26935
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Sat Sep 17 22:10:09 2022 +0200

    [hotfix] Properly unsubscribe from data explorer subscriptions
---
 .../data-explorer-dashboard-overview.component.ts  | 15 ++++++++--
 .../data-explorer-dashboard-panel.component.ts     | 16 +++++++---
 .../data-explorer-dashboard-widget.component.ts    | 35 ++++++++++++++++++----
 3 files changed, 53 insertions(+), 13 deletions(-)

diff --git a/ui/src/app/data-explorer/components/overview/data-explorer-dashboard-overview.component.ts b/ui/src/app/data-explorer/components/overview/data-explorer-dashboard-overview.component.ts
index 9bf188cd8..1e645d97a 100644
--- a/ui/src/app/data-explorer/components/overview/data-explorer-dashboard-overview.component.ts
+++ b/ui/src/app/data-explorer/components/overview/data-explorer-dashboard-overview.component.ts
@@ -16,7 +16,7 @@
  *
  */
 
-import { Component, OnInit } from '@angular/core';
+import { Component, OnDestroy, OnInit } from '@angular/core';
 import { MatTableDataSource } from '@angular/material/table';
 import { DataExplorerEditDataViewDialogComponent } from '../../dialogs/edit-dashboard/data-explorer-edit-data-view-dialog.component';
 import { Dashboard, DataViewDataExplorerService } from '@streampipes/platform-services';
@@ -27,13 +27,14 @@ import { AuthService } from '../../../services/auth.service';
 import { UserPrivilege } from '../../../_enums/user-privilege.enum';
 import { Router } from '@angular/router';
 import { SpDataExplorerRoutes } from '../../data-explorer.routes';
+import { Subscription } from 'rxjs';
 
 @Component({
   selector: 'sp-data-explorer-dashboard-overview',
   templateUrl: './data-explorer-dashboard-overview.component.html',
   styleUrls: ['./data-explorer-dashboard-overview.component.scss']
 })
-export class DataExplorerDashboardOverviewComponent implements OnInit {
+export class DataExplorerDashboardOverviewComponent implements OnInit, OnDestroy {
 
 
   dataSource = new MatTableDataSource<Dashboard>();
@@ -45,6 +46,8 @@ export class DataExplorerDashboardOverviewComponent implements OnInit {
   hasDataExplorerWritePrivileges = false;
   hasDataExplorerDeletePrivileges = false;
 
+  authSubscription: Subscription;
+
   constructor(private dataViewService: DataViewDataExplorerService,
               private dashboardService: DataViewDataExplorerService,
               public dialogService: DialogService,
@@ -56,7 +59,7 @@ export class DataExplorerDashboardOverviewComponent implements OnInit {
 
   ngOnInit(): void {
     this.breadcrumbService.updateBreadcrumb(this.breadcrumbService.getRootLink(SpDataExplorerRoutes.BASE));
-    this.authService.user$.subscribe(user => {
+    this.authSubscription = this.authService.user$.subscribe(user => {
       this.hasDataExplorerWritePrivileges = this.authService.hasRole(UserPrivilege.PRIVILEGE_WRITE_DATA_EXPLORER_VIEW);
       this.hasDataExplorerDeletePrivileges = this.authService.hasRole(UserPrivilege.PRIVILEGE_DELETE_DATA_EXPLORER_VIEW);
       this.isAdmin = user.roles.indexOf(UserRole.ROLE_ADMIN) > -1;
@@ -66,6 +69,12 @@ export class DataExplorerDashboardOverviewComponent implements OnInit {
     this.getDashboards();
   }
 
+  ngOnDestroy() {
+    if (this.authSubscription) {
+      this.authSubscription.unsubscribe();
+    }
+  }
+
   getDashboards() {
     this.dataViewService.getDataViews().subscribe(data => {
       this.dashboards = data.sort((a, b) => a.name.localeCompare(b.name));
diff --git a/ui/src/app/data-explorer/components/panel/data-explorer-dashboard-panel.component.ts b/ui/src/app/data-explorer/components/panel/data-explorer-dashboard-panel.component.ts
index 815bc8e37..f03b006e6 100644
--- a/ui/src/app/data-explorer/components/panel/data-explorer-dashboard-panel.component.ts
+++ b/ui/src/app/data-explorer/components/panel/data-explorer-dashboard-panel.component.ts
@@ -16,8 +16,8 @@
  *
  */
 
-import { Component, EventEmitter, OnInit, Output, ViewChild, } from '@angular/core';
-import { Observable, of, zip } from 'rxjs';
+import { Component, EventEmitter, OnDestroy, OnInit, Output, ViewChild, } from '@angular/core';
+import { Observable, of, Subscription, zip } from 'rxjs';
 import { DataExplorerDashboardGridComponent } from '../widget-view/grid-view/data-explorer-dashboard-grid.component';
 import { MatDrawer } from '@angular/material/sidenav';
 import { Tuple2 } from '../../../core-model/base/Tuple2';
@@ -45,7 +45,7 @@ import { SpDataExplorerRoutes } from '../../data-explorer.routes';
   templateUrl: './data-explorer-dashboard-panel.component.html',
   styleUrls: ['./data-explorer-dashboard-panel.component.css'],
 })
-export class DataExplorerDashboardPanelComponent implements OnInit {
+export class DataExplorerDashboardPanelComponent implements OnInit, OnDestroy {
   dashboardLoaded = false;
   dashboard: Dashboard;
 
@@ -89,6 +89,8 @@ export class DataExplorerDashboardPanelComponent implements OnInit {
   showDesignerPanel = false;
   showEditingHelpInfo = false;
 
+  authSubscription: Subscription;
+
   constructor(
     private dataViewDataExplorerService: DataViewDataExplorerService,
     private dialog: MatDialog,
@@ -112,7 +114,7 @@ export class DataExplorerDashboardPanelComponent implements OnInit {
     this.getDashboard(params.id, startTime, endTime);
 
 
-    this.authService.user$.subscribe(user => {
+    this.authSubscription = this.authService.user$.subscribe(user => {
       this.hasDataExplorerWritePrivileges = this.authService.hasRole(
         UserPrivilege.PRIVILEGE_WRITE_DATA_EXPLORER_VIEW
       );
@@ -125,6 +127,12 @@ export class DataExplorerDashboardPanelComponent implements OnInit {
     });
   }
 
+  ngOnDestroy() {
+    if (this.authSubscription) {
+      this.authSubscription.unsubscribe();
+    }
+  }
+
   triggerResize() {
     window.dispatchEvent(new Event('resize'));
   }
diff --git a/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.ts b/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.ts
index 186e9d6d2..4b25aa970 100644
--- a/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.ts
+++ b/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.ts
@@ -16,7 +16,16 @@
  *
  */
 
-import { Component, ComponentFactoryResolver, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
+import {
+  Component,
+  ComponentFactoryResolver,
+  EventEmitter,
+  Input,
+  OnDestroy,
+  OnInit,
+  Output,
+  ViewChild
+} from '@angular/core';
 import { GridsterItemComponent } from 'angular-gridster2';
 import {
   DashboardItem, DataExplorerDataConfig,
@@ -27,7 +36,7 @@ import {
   TimeSettings
 } from '@streampipes/platform-services';
 import { DataDownloadDialogComponent } from '../../../core-ui/data-download-dialog/data-download-dialog.component';
-import { interval } from 'rxjs';
+import { interval, Subscription } from 'rxjs';
 import { takeWhile } from 'rxjs/operators';
 import { DataExplorerWidgetRegistry } from '../../registry/data-explorer-widget-registry';
 import { WidgetDirective } from './widget.directive';
@@ -42,7 +51,7 @@ import { DialogService, PanelType } from '@streampipes/shared-ui';
   templateUrl: './data-explorer-dashboard-widget.component.html',
   styleUrls: ['./data-explorer-dashboard-widget.component.scss']
 })
-export class DataExplorerDashboardWidgetComponent implements OnInit {
+export class DataExplorerDashboardWidgetComponent implements OnInit, OnDestroy {
 
   @Input()
   dashboardItem: DashboardItem;
@@ -90,6 +99,10 @@ export class DataExplorerDashboardWidgetComponent implements OnInit {
   hasDataExplorerWritePrivileges = false;
   hasDataExplorerDeletePrivileges = false;
 
+  authSubscription: Subscription;
+  widgetTypeChangedSubscription: Subscription;
+  intervalSubscription: Subscription;
+
   @ViewChild(WidgetDirective, {static: true}) widgetHost!: WidgetDirective;
 
   constructor(private dataViewDataExplorerService: DataViewDataExplorerService,
@@ -100,13 +113,13 @@ export class DataExplorerDashboardWidgetComponent implements OnInit {
   }
 
   ngOnInit(): void {
-    this.authService.user$.subscribe(user => {
+    this.authSubscription = this.authService.user$.subscribe(user => {
       this.hasDataExplorerWritePrivileges = this.authService.hasRole(UserPrivilege.PRIVILEGE_WRITE_DATA_EXPLORER_VIEW);
       this.hasDataExplorerDeletePrivileges = this.authService.hasRole(UserPrivilege.PRIVILEGE_DELETE_DATA_EXPLORER_VIEW);
     });
     this.widgetLoaded = true;
     this.title = this.dataLakeMeasure.measureName;
-    this.widgetTypeService.widgetTypeChangeSubject.subscribe(typeChange => {
+    this.widgetTypeChangedSubscription = this.widgetTypeService.widgetTypeChangeSubject.subscribe(typeChange => {
       if (typeChange.widgetId === this.configuredWidget._id) {
         this.chooseWidget(typeChange.newWidgetTypeId);
       }
@@ -114,6 +127,15 @@ export class DataExplorerDashboardWidgetComponent implements OnInit {
     this.chooseWidget(this.configuredWidget.widgetType);
   }
 
+  ngOnDestroy() {
+    if (this.authSubscription) {
+      this.authSubscription.unsubscribe();
+    }
+    if (this.widgetTypeChangedSubscription) {
+      this.widgetTypeChangedSubscription.unsubscribe();
+    }
+  }
+
   chooseWidget(widgetTypeId: string) {
     const widgets = DataExplorerWidgetRegistry.getAvailableWidgetTemplates();
     const widgetToDisplay = widgets.find(widget => widget.id === widgetTypeId);
@@ -175,7 +197,7 @@ export class DataExplorerDashboardWidgetComponent implements OnInit {
 
   startLoadingTimer() {
     this.timerActive = true;
-    interval( 10 )
+    this.intervalSubscription = interval( 10 )
         .pipe(takeWhile(() => this.timerActive))
         .subscribe(value => {
       this.loadingTime = (value * 10 / 1000);
@@ -184,6 +206,7 @@ export class DataExplorerDashboardWidgetComponent implements OnInit {
 
   stopLoadingTimer() {
     this.timerActive = false;
+    this.intervalSubscription.unsubscribe();
   }
 
   handleTimer(start: boolean) {