Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #10 from SoftwareAG/dev
Browse files Browse the repository at this point in the history
Add Microservice Support
  • Loading branch information
rahuldemocenter authored Jun 21, 2022
2 parents 9977479 + 914714b commit 12c3d81
Show file tree
Hide file tree
Showing 9 changed files with 345 additions and 140 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gp-smart-echart-widget",
"version": "1.2.4",
"version": "1.2.5",
"description": "This is an Angular 11 widget, which is designed to display the chart based on the REST data or Datahub.",
"author": "Neeru Arora - Software AG, Global Presales",
"license": "Apache 2.0",
Expand Down
2 changes: 1 addition & 1 deletion projects/gp-smart-echart-widget/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gp-smart-echart-widget",
"version": "1.2.4",
"version": "1.2.5",
"description": "This is an Angular 11 widget, which is designed to display the chart based on the REST data or Datahub.",
"author": "Neeru Arora - Software AG, Global Presales",
"license": "Apache 2.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<div (resized)="onResized($event)" style="height:99%;width:99%;">

<div echarts [options]="chartOption" class="demo-chart" #chartBox [style.height.px]="height"
Expand Down

Large diffs are not rendered by default.

83 changes: 42 additions & 41 deletions projects/gp-smart-echart-widget/src/lib/model/config.modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface ChartConfig {
export interface ChartConfig {
radius: string[];
tooltip?: Tooltip;
legend?: Legend;
Expand All @@ -30,7 +30,7 @@
yAxis?: string | '',
yAxisDimension: string | '',
apiUrl?: string | '',
sqlQuery?:string |'',
sqlQuery?: string | '',
smoothLine?: boolean,
area?: any | '',
stackList: Stack[],
Expand All @@ -39,52 +39,53 @@
aggrArr: AggregateData[],
roseType?: string | '',
showLabel?: boolean,
dateFormat?:string;
dateFormat?: string;
itemStyle?: ItemStyle,
emphasis?:Emphasis;
sliderZoom?:boolean|'';
boxZoom?:boolean;
pieSlicenName?:string | '';
pieSliceValue?:string | '';
radarShape?:string | '';
radarIndicator?:string | '';
radarDimensions?:string | '';
emphasis?: Emphasis;
sliderZoom?: boolean | '';
boxZoom?: boolean;
pieSlicenName?: string | '';
pieSliceValue?: string | '';
radarShape?: string | '';
radarIndicator?: string | '';
radarDimensions?: string | '';
showApiInput?: boolean;
showDatahubInput?:boolean;
showDatahubInput?: boolean;
showMicroserviceInput?: boolean;
addStack?: boolean,
listName:string|'';
groupBy?:string | '';
xAxisName?:string | '';
yAxisName?:string | '';
scatterSymbolSize?:string;
pieBorderWidth?:number|0;
pieBorderRadius?:number|0;
colors?:string | '';
listName: string | '';
groupBy?: string | '';
xAxisName?: string | '';
yAxisName?: string | '';
scatterSymbolSize?: string;
pieBorderWidth?: number | 0;
pieBorderRadius?: number | 0;
colors?: string | '';
areaOpacity?: string | '';
hasArea?: any | '';
radarChartRadius?:number|'';
polarChartRadius?:number|'';
fontSize?:number|'';
xAxisRotateLabels?:number;
yAxisRotateLabels?:number;
sqlLimit?:number;
datahubUrl?:string;
darkMode?:boolean;

radarChartRadius?: number | '';
polarChartRadius?: number | '';
fontSize?: number | '';
xAxisRotateLabels?: number;
yAxisRotateLabels?: number;
sqlLimit?: number;
datahubUrl?: string;
darkMode?: boolean;
microserviceUrl?: string;
}

export class Emphasis{
label?:Label;
export class Emphasis {
label?: Label;
}
export class Label{
show?:boolean;
export class Label {
show?: boolean;
}
export class ItemStyle{
borderRadius?:number;
export class ItemStyle {
borderRadius?: number;
}
export class YAxis{
export class YAxis {
ytype?: string;// 'value','category','time','log'
name?:string;// name of axis
name?: string;// name of axis
position?: string;// left or right
}
export class Tooltip {
Expand Down Expand Up @@ -114,14 +115,14 @@ export class Toolbox {
feature?: Feature;// 'plain' is default,'scroll' when many options are in legend
}

export class Stack{
export class Stack {
stackName: string;
stackValues:string;
stackValues: string;
}

export class AggregateData{
export class AggregateData {
aggrDimesnion: string;
aggrMethod:string;
aggrMethod: string;
}

export class Feature {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ <h4 translate>DataSource</h4>
<span>DataHub</span>
</label>
</div>
<div class="col-xs-2 col-md-2">
<label for="microservice" title="Microservice" class="c8y-radio radio-inline">
<input type="radio" id="microservice" name="dataSource" value="microservice"
(change)="dataSourceSelection($event.target.value)" [(ngModel)]="config.dataSource"
placeholder="Enter Relative URL">
<span></span>
<span>Microservice</span>
</label>
</div>
<div class="col-xs-2 col-md-2"></div>
<div class="col-xs-4 col-md-4 " *ngIf="config.showApiInput">
<label for="listname">List Name</label>
Expand Down Expand Up @@ -48,6 +57,12 @@ <h4 translate>DataSource</h4>
</div>

</ng-container>
<ng-container *ngIf="config.showMicroserviceInput">
<div class="col-xs-6 col-md-6">
<input class="form-control" type="text" placeholder="API URL" [(ngModel)]="config.microserviceUrl">
</div>
</ng-container>

</div>
</div>
<div class="configSection">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,12 +421,19 @@ export class SmartChartConfigComponent implements OnInit {
if (value === 'API') {
this.config.showApiInput = true;
this.config.showDatahubInput = false;
this.config.showMicroserviceInput = false;
} else if (value === 'datahub') {
this.config.showDatahubInput = true;
this.config.showApiInput = false;
this.config.showMicroserviceInput = false;
}else if (value === 'microservice') {
this.config.showMicroserviceInput = true;
this.config.showApiInput = false;
this.config.showDatahubInput = false;
} else {
this.config.showApiInput = false;
this.config.showDatahubInput = false;
this.config.showMicroserviceInput = false;
}
}
// This code is commented as it is needed for localhost testing.
Expand Down
2 changes: 1 addition & 1 deletion runtime/cumulocity.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"manifest": {
"noAppSwitcher": true,
"requiredPlatformVersion": ">=1011.0.0",
"version":"1.2.4",
"version":"1.2.5",
"author":"Software AG, Global Presales",
"description": "This is an Angular 11 widget, which is designed to display the chart based on the REST data or Datahub.",
"license": "Apache 2.0"
Expand Down
2 changes: 1 addition & 1 deletion runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"dist\\bundle-src\\custom-widget.js": "smart-echart-runtime-widget-CustomWidget",
"dist/bundle-src/custom-widget.js": "smart-echart-runtime-widget-CustomWidget"
},
"version": "1.2.4",
"version": "1.2.5",
"description": "Runtime package.json for library widget (written by Software AG Global Presales)",
"author": "Darpankumar Lalani - Software AG, Global Presales",
"license": "Apache 2.0"
Expand Down

0 comments on commit 12c3d81

Please sign in to comment.