Skip to content
Snippets Groups Projects
Commit b86441cb authored by francois.grand's avatar francois.grand
Browse files

modifs GraphTypeSelectComponent/ResultsGraphComponent suite au remaniement sur...

modifs GraphTypeSelectComponent/ResultsGraphComponent suite au remaniement sur GenericSelectComponent
parent aa5bbc37
No related branches found
No related tags found
No related merge requests found
......@@ -7,16 +7,15 @@ import { GenericSelectComponent } from '../generic-select/generic-select.compone
selector: "graph-type",
templateUrl: "../generic-select/generic-select.component.html"
})
export class GraphTypeSelectComponent extends GenericSelectComponent {
export class GraphTypeSelectComponent extends GenericSelectComponent<GraphType> {
private _entries: GraphType[] = [GraphType.Histogram, GraphType.Scatter];
private _entriesLabels: string[] = ["Histogramme", "XY"];
protected get entries(): any[] {
protected get entries(): GraphType[] {
return this._entries;
}
protected entryLabel(entry: any): string {
// return entry;
protected entryLabel(entry: GraphType): string {
const i = this._entries.indexOf(entry);
return this._entriesLabels[i];
}
......@@ -26,11 +25,9 @@ export class GraphTypeSelectComponent extends GenericSelectComponent {
selector: 'results-graph',
templateUrl: './results-graph.component.html'
})
export class ResultsGraphComponent { //implements AfterViewInit {
export class ResultsGraphComponent {
private _results: FixedVarResults;
private _currentGraphType: GraphType;
@ViewChild(GraphTypeSelectComponent)
private _graphTypeComponent: GraphTypeSelectComponent;
......@@ -56,12 +53,11 @@ export class ResultsGraphComponent { //implements AfterViewInit {
public set results(r: FixedVarResults) {
this._results = r;
this._currentGraphType = r.graphType;
this._graphTypeComponent.selectedValue = this._currentGraphType;
this._graphTypeComponent.selectedValue = r.graphType;
}
public updateView() {
switch (this._currentGraphType) {
switch (this._graphTypeComponent.selectedValue) {
case GraphType.Histogram:
this.graph_type = "bar";
this.generateBarGraph();
......@@ -80,7 +76,6 @@ export class ResultsGraphComponent { //implements AfterViewInit {
}
private onGraphTypeSelectChange(event) {
this._currentGraphType = event;
this.updateView();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment