adding a few filters (no doing anything yet)
This commit is contained in:
63
pdb-js/src/app/plot.service.ts
Normal file
63
pdb-js/src/app/plot.service.ts
Normal 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user