Mercurial > hg > ugly-duckling
changeset 370:3fa0c8cab919
Tracks. With slight modifications, ugly-curve is essentially ugly-tracks. Some refactoring is perhaps in order.
author | Lucas Thompson <dev@lucas.im> |
---|---|
date | Tue, 30 May 2017 23:01:12 +0100 |
parents | b77cd48d86a9 |
children | 44ed7a3916c8 |
files | src/app/analysis-item/analysis-item.component.html src/app/visualisations/curve/curve.component.ts |
diffstat | 2 files changed, 14 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/app/analysis-item/analysis-item.component.html Tue May 30 22:50:49 2017 +0100 +++ b/src/app/analysis-item/analysis-item.component.html Tue May 30 23:01:12 2017 +0100 @@ -37,8 +37,17 @@ [trackIdPrefix]="item.id" [width]="contentWidth" [onSeek]="onSeek" + [feature]="[item.collected]" + ></ugly-curve> + <ugly-curve + *ngSwitchCase="'tracks'" + [timeline]="timeline" + [trackIdPrefix]="item.id" + [width]="contentWidth" + [onSeek]="onSeek" [feature]="item.collected" ></ugly-curve> + <div *ngSwitchDefault>Feature cannot be visualised.</div> </div> </div>
--- a/src/app/visualisations/curve/curve.component.ts Tue May 30 22:50:49 2017 +0100 +++ b/src/app/visualisations/curve/curve.component.ts Tue May 30 23:01:12 2017 +0100 @@ -24,18 +24,18 @@ @ViewChild('track') trackDiv: ElementRef; - private mFeature: VectorFeature; + private mFeature: VectorFeature[]; private currentState: PlotLayerData[]; private height: number; // As it stands, height is fixed. Store once onInit. - @Input() set feature(input: VectorFeature) { + @Input() set feature(input: VectorFeature[]) { this.mFeature = input; - this.currentState = generatePlotData([input]); + this.currentState = generatePlotData(input); this.update(); } @Input() colour: string; - get feature(): VectorFeature { + get feature(): VectorFeature[] { return this.mFeature; } @@ -64,6 +64,7 @@ // them to determine which line to draw values from lineLayer.start = feature.startTime; lineLayer.duration = feature.duration; + lineLayer.update(); // TODO probably better to update after all added } } }