adding a few filters (no doing anything yet)

This commit is contained in:
2019-10-09 19:02:34 +02:00
parent 1afcc7cf38
commit 2787b42c31
9 changed files with 154 additions and 7 deletions

View File

@@ -0,0 +1,63 @@
import { Injectable, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
@Injectable({
providedIn: 'root'
})
export class PlotService {
plotTypes: Array<PlotType>;
tagFields: Observable<TagField>;
constructor(private http: HttpClient) {
this.plotTypes = new Array<PlotType>();
this.plotTypes.push(new PlotType("Scatter"));
this.plotTypes.push(new PlotType("Cumulative Distribution"));
this.plotTypes.push(new PlotType("Parallel Requests"));
this.plotTypes.push(new PlotType("Parallel Requests"));
this.tagFields = new Array<TagField>();
}
ngOnInit() {
}
getPlotTypes(): Array<PlotType> {
return this.plotTypes;
}
getTagFields(): Observable<TagField> {
const that = this;
this.http.get('//localhost:8080/fields').subscribe(data => {
data.forEach(function(name) {
that.tagFields.push(new TagField(name));
});
});
return this.tagFields;
}
}
export class PlotType {
name: string;
constructor(name: string) {
this.name = name;
}
}
export class TagField {
name: string;
constructor(name: string) {
this.name = name;
}
}