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/07/18 11:00:40 UTC

[incubator-streampipes] branch dev updated: [hotfix] Properly filter value heatmap for numeric fields

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


The following commit(s) were added to refs/heads/dev by this push:
     new 77d9d582a [hotfix] Properly filter value heatmap for numeric fields
77d9d582a is described below

commit 77d9d582a3caa646ff6465db7ad8562d645b06a6
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Mon Jul 18 13:00:32 2022 +0200

    [hotfix] Properly filter value heatmap for numeric fields
---
 .../config/distribution-chart-widget-config.component.html             | 2 +-
 .../config/distribution-chart-widget-config.component.ts               | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/ui/src/app/data-explorer/components/widgets/distribution-chart/config/distribution-chart-widget-config.component.html b/ui/src/app/data-explorer/components/widgets/distribution-chart/config/distribution-chart-widget-config.component.html
index b0d367d54..2f51faa24 100644
--- a/ui/src/app/data-explorer/components/widgets/distribution-chart/config/distribution-chart-widget-config.component.html
+++ b/ui/src/app/data-explorer/components/widgets/distribution-chart/config/distribution-chart-widget-config.component.html
@@ -31,7 +31,7 @@
   </mat-form-field>  
   
   <h5>Field</h5>
-    <sp-select-property [availableProperties]="fieldProvider.allFields"
+    <sp-select-property [availableProperties]="currentlyConfiguredWidget.visualizationConfig.displayType === 'heatmap' ? fieldProvider.numericFields : fieldProvider.allFields"
                         [selectedProperty]="currentlyConfiguredWidget.visualizationConfig.selectedProperty"
                         (changeSelectedProperty)="setSelectedProperty($event)">
     </sp-select-property>
diff --git a/ui/src/app/data-explorer/components/widgets/distribution-chart/config/distribution-chart-widget-config.component.ts b/ui/src/app/data-explorer/components/widgets/distribution-chart/config/distribution-chart-widget-config.component.ts
index 7e645c216..18f935a72 100644
--- a/ui/src/app/data-explorer/components/widgets/distribution-chart/config/distribution-chart-widget-config.component.ts
+++ b/ui/src/app/data-explorer/components/widgets/distribution-chart/config/distribution-chart-widget-config.component.ts
@@ -41,6 +41,9 @@ export class DistributionWidgetConfigComponent
 
   updateDisplayType(selectedType: string) {
     this.currentlyConfiguredWidget.visualizationConfig.displayType = selectedType;
+    if (this.fieldProvider.numericFields.find(field => field === this.currentlyConfiguredWidget.visualizationConfig.selectedProperty) === undefined) {
+      this.currentlyConfiguredWidget.visualizationConfig.selectedProperty = this.fieldProvider.numericFields[0];
+    }
     this.triggerDataRefresh();
   }