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 2021/10/22 21:26:49 UTC
[incubator-streampipes] branch dev updated: [hotfix] Change
SpQueryResult in datalake to array
This is an automated email from the ASF dual-hosted git repository.
zehnder 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 d1e43df [hotfix] Change SpQueryResult in datalake to array
d1e43df is described below
commit d1e43dff9ae8db6646762d30ef04f081d621ce10
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Fri Oct 22 23:25:55 2021 +0200
[hotfix] Change SpQueryResult in datalake to array
---
.../widgets/density/density-chart-widget.component.ts | 16 ++++++++--------
.../widgets/heatmap/heatmap-widget.component.ts | 17 ++++++++---------
.../histogram/histogram-chart-widget.component.ts | 8 ++++----
.../components/widgets/image/image-widget.component.ts | 2 +-
.../indicator/indicator-chart-widget.component.ts | 12 ++++++------
.../widgets/pie/pie-chart-widget.component.ts | 6 +++---
6 files changed, 30 insertions(+), 31 deletions(-)
diff --git a/ui/src/app/data-explorer/components/widgets/density/density-chart-widget.component.ts b/ui/src/app/data-explorer/components/widgets/density/density-chart-widget.component.ts
index 7fd2fd1..a0dc727 100644
--- a/ui/src/app/data-explorer/components/widgets/density/density-chart-widget.component.ts
+++ b/ui/src/app/data-explorer/components/widgets/density/density-chart-widget.component.ts
@@ -85,13 +85,13 @@ export class DensityChartWidgetComponent extends BaseDataExplorerWidget<DensityC
this.updateAppearance();
}
- prepareData(result: SpQueryResult) {
- const xIndex = this.getColumnIndex(this.dataExplorerWidget.visualizationConfig.firstField, result);
- const yIndex = this.getColumnIndex(this.dataExplorerWidget.visualizationConfig.secondField, result);
- this.data[0].x = this.transform(result.allDataSeries[0].rows, xIndex);
- this.data[1].x = this.transform(result.allDataSeries[0].rows, xIndex);
- this.data[0].y = this.transform(result.allDataSeries[0].rows, yIndex);
- this.data[1].y = this.transform(result.allDataSeries[0].rows, yIndex);
+ prepareData(result: SpQueryResult[]) {
+ const xIndex = this.getColumnIndex(this.dataExplorerWidget.visualizationConfig.firstField, result[0]);
+ const yIndex = this.getColumnIndex(this.dataExplorerWidget.visualizationConfig.secondField, result[0]);
+ this.data[0].x = this.transform(result[0].allDataSeries[0].rows, xIndex);
+ this.data[1].x = this.transform(result[0].allDataSeries[0].rows, xIndex);
+ this.data[0].y = this.transform(result[0].allDataSeries[0].rows, yIndex);
+ this.data[1].y = this.transform(result[0].allDataSeries[0].rows, yIndex);
}
transform(rows, index: number): any[] {
@@ -115,7 +115,7 @@ export class DensityChartWidgetComponent extends BaseDataExplorerWidget<DensityC
beforeDataFetched() {
}
- onDataReceived(spQueryResult: SpQueryResult) {
+ onDataReceived(spQueryResult: SpQueryResult[]) {
this.prepareData(spQueryResult);
this.updateAppearance();
}
diff --git a/ui/src/app/data-explorer/components/widgets/heatmap/heatmap-widget.component.ts b/ui/src/app/data-explorer/components/widgets/heatmap/heatmap-widget.component.ts
index 33cf630..d8f991e 100644
--- a/ui/src/app/data-explorer/components/widgets/heatmap/heatmap-widget.component.ts
+++ b/ui/src/app/data-explorer/components/widgets/heatmap/heatmap-widget.component.ts
@@ -27,7 +27,6 @@ import { EChartsOption } from 'echarts';
import { ECharts } from 'echarts/core';
-
@Component({
selector: 'sp-data-explorer-heatmap-widget',
templateUrl: './heatmap-widget.component.html',
@@ -57,15 +56,15 @@ export class HeatmapWidgetComponent extends BaseDataExplorerWidget<HeatmapWidget
}
handleUpdatedFields(addedFields: DataExplorerField[],
- removedFields: DataExplorerField[]) {
+ removedFields: DataExplorerField[]) {
}
beforeDataFetched() {
}
- onDataReceived(spQueryResult: SpQueryResult) {
+ onDataReceived(spQueryResult: SpQueryResult[]) {
const dataBundle = this.convertData(spQueryResult);
- if ( Object.keys(this.option).length > 0 ) {
+ if (Object.keys(this.option).length > 0) {
this.setOptions(dataBundle[0], dataBundle[1], dataBundle[2], dataBundle[3], dataBundle[4]);
}
}
@@ -78,18 +77,18 @@ export class HeatmapWidgetComponent extends BaseDataExplorerWidget<HeatmapWidget
applySize(width: number, height: number) {
if (this.eChartsInstance) {
- this.eChartsInstance.resize({width: width, height: height});
+ this.eChartsInstance.resize({ width: width, height: height });
}
}
- convertData(spQueryResult: SpQueryResult) {
+ convertData(spQueryResult: SpQueryResult[]) {
let min = 1000000;
let max = -100000;
- const result = spQueryResult.allDataSeries;
+ const result = spQueryResult[0].allDataSeries;
const xAxisData = this.transform(result[0].rows, 0); // always time.
- const heatIndex = this.getColumnIndex(this.dataExplorerWidget.visualizationConfig.selectedHeatProperty, spQueryResult);
+ const heatIndex = this.getColumnIndex(this.dataExplorerWidget.visualizationConfig.selectedHeatProperty, spQueryResult[0]);
const yAxisData = [];
const contentData = [];
@@ -98,7 +97,7 @@ export class HeatmapWidgetComponent extends BaseDataExplorerWidget<HeatmapWidget
let groupedVal = index.toString();
- if ( groupedList['tags'] != null) {
+ if (groupedList['tags'] != null) {
Object.entries(groupedList['tags']).forEach(
([key, value]) => {
groupedVal = value;
diff --git a/ui/src/app/data-explorer/components/widgets/histogram/histogram-chart-widget.component.ts b/ui/src/app/data-explorer/components/widgets/histogram/histogram-chart-widget.component.ts
index 472aef6..a0ba1a9 100644
--- a/ui/src/app/data-explorer/components/widgets/histogram/histogram-chart-widget.component.ts
+++ b/ui/src/app/data-explorer/components/widgets/histogram/histogram-chart-widget.component.ts
@@ -57,9 +57,9 @@ export class HistogramChartWidgetComponent extends BaseDataExplorerWidget<Histog
this.updateAppearance();
}
- prepareData(result: SpQueryResult) {
- const index = this.getColumnIndex(this.dataExplorerWidget.visualizationConfig.selectedProperty, result);
- const varX = this.transform(result.allDataSeries[0].rows, index);
+ prepareData(result: SpQueryResult[]) {
+ const index = this.getColumnIndex(this.dataExplorerWidget.visualizationConfig.selectedProperty, result[0]);
+ const varX = this.transform(result[0].allDataSeries[0].rows, index);
this.data = [{
x: varX,
@@ -86,7 +86,7 @@ export class HistogramChartWidgetComponent extends BaseDataExplorerWidget<Histog
beforeDataFetched() {
}
- onDataReceived(spQueryResult: SpQueryResult) {
+ onDataReceived(spQueryResult: SpQueryResult[]) {
this.prepareData(spQueryResult);
}
diff --git a/ui/src/app/data-explorer/components/widgets/image/image-widget.component.ts b/ui/src/app/data-explorer/components/widgets/image/image-widget.component.ts
index 93e134b..e1dcbde 100644
--- a/ui/src/app/data-explorer/components/widgets/image/image-widget.component.ts
+++ b/ui/src/app/data-explorer/components/widgets/image/image-widget.component.ts
@@ -94,7 +94,7 @@ export class ImageWidgetComponent extends BaseDataExplorerWidget<ImageWidgetMode
beforeDataFetched() {
}
- onDataReceived(spQueryResult: SpQueryResult) {
+ onDataReceived(spQueryResult: SpQueryResult[]) {
}
handleUpdatedFields(addedFields: DataExplorerField[], removedFields: DataExplorerField[]) {
diff --git a/ui/src/app/data-explorer/components/widgets/indicator/indicator-chart-widget.component.ts b/ui/src/app/data-explorer/components/widgets/indicator/indicator-chart-widget.component.ts
index 90d4302..68144c2 100644
--- a/ui/src/app/data-explorer/components/widgets/indicator/indicator-chart-widget.component.ts
+++ b/ui/src/app/data-explorer/components/widgets/indicator/indicator-chart-widget.component.ts
@@ -75,12 +75,12 @@ export class IndicatorChartWidgetComponent extends BaseDataExplorerWidget<Indica
this.updateAppearance();
}
- prepareData(numberResult: SpQueryResult, deltaResult?: SpQueryResult) {
- const valueIndex = this.getColumnIndex(this.dataExplorerWidget.visualizationConfig.valueField, numberResult);
- this.data[0].value = numberResult.total > 0 ? numberResult.allDataSeries[0].rows[0][valueIndex] : '-';
+ prepareData(numberResult: SpQueryResult[], deltaResult?: SpQueryResult) {
+ const valueIndex = this.getColumnIndex(this.dataExplorerWidget.visualizationConfig.valueField, numberResult[0]);
+ this.data[0].value = numberResult[0].total > 0 ? numberResult[0].allDataSeries[0].rows[0][valueIndex] : '-';
if (deltaResult) {
- const deltaIndex = this.getColumnIndex(this.dataExplorerWidget.visualizationConfig.deltaField, numberResult);
- this.data[0].delta.reference = numberResult.total > 0 ? deltaResult.allDataSeries[0].rows[0][deltaIndex] : '-';
+ const deltaIndex = this.getColumnIndex(this.dataExplorerWidget.visualizationConfig.deltaField, numberResult[0]);
+ this.data[0].delta.reference = numberResult[0].total > 0 ? deltaResult.allDataSeries[0].rows[0][deltaIndex] : '-';
}
}
@@ -100,7 +100,7 @@ export class IndicatorChartWidgetComponent extends BaseDataExplorerWidget<Indica
this.data[0].mode = this.dataExplorerWidget.visualizationConfig.showDelta ? 'number+delta' : 'number';
}
- onDataReceived(spQueryResult: SpQueryResult) {
+ onDataReceived(spQueryResult: SpQueryResult[]) {
this.prepareData(spQueryResult);
}
diff --git a/ui/src/app/data-explorer/components/widgets/pie/pie-chart-widget.component.ts b/ui/src/app/data-explorer/components/widgets/pie/pie-chart-widget.component.ts
index 139e365..fb63f38 100644
--- a/ui/src/app/data-explorer/components/widgets/pie/pie-chart-widget.component.ts
+++ b/ui/src/app/data-explorer/components/widgets/pie/pie-chart-widget.component.ts
@@ -59,8 +59,8 @@ export class PieChartWidgetComponent extends BaseDataExplorerWidget<PieChartWidg
this.updateAppearance();
}
- prepareData(spQueryResult: SpQueryResult) {
- const series = spQueryResult.allDataSeries[0];
+ prepareData(spQueryResult: SpQueryResult[]) {
+ const series = spQueryResult[0].allDataSeries[0];
const finalLabels: string[] = [];
const finalValues: number[] = [];
const values: Map<string, number> = new Map();
@@ -106,7 +106,7 @@ export class PieChartWidgetComponent extends BaseDataExplorerWidget<PieChartWidg
beforeDataFetched() {
}
- onDataReceived(spQueryResult: SpQueryResult) {
+ onDataReceived(spQueryResult: SpQueryResult[]) {
this.prepareData(spQueryResult);
}