Mercurial > hg > ugly-duckling
annotate src/app/visualisations/curve/curve.component.ts @ 372:bc2680f0736b
Move curve logic to a tracks component, and use that component to create a curve component.
author | Lucas Thompson <dev@lucas.im> |
---|---|
date | Wed, 31 May 2017 02:42:45 +0100 |
parents | 3fa0c8cab919 |
children | 2df7b3722eb9 |
rev | line source |
---|---|
dev@359 | 1 /** |
dev@359 | 2 * Created by lucas on 30/05/2017. |
dev@359 | 3 */ |
dev@366 | 4 import { |
dev@366 | 5 ChangeDetectionStrategy, |
dev@366 | 6 Component, |
dev@372 | 7 Input |
dev@366 | 8 } from "@angular/core"; |
dev@372 | 9 import {OnSeekHandler} from "../../playhead/PlayHeadHelpers"; |
dev@366 | 10 import {VectorFeature} from "piper/HigherLevelUtilities"; |
dev@359 | 11 |
dev@359 | 12 @Component({ |
dev@359 | 13 selector: 'ugly-curve', |
dev@372 | 14 template: `<ugly-tracks |
dev@372 | 15 [timeline]="timeline" |
dev@372 | 16 [trackIdPrefix]="id" |
dev@372 | 17 [width]="width" |
dev@372 | 18 [onSeek]="onSeek" |
dev@372 | 19 [colour]="colour" |
dev@372 | 20 [tracks]="[curve]" |
dev@372 | 21 ></ugly-tracks>`, |
dev@359 | 22 styleUrls: ['../waves-template.css'], |
dev@359 | 23 changeDetection: ChangeDetectionStrategy.OnPush |
dev@359 | 24 }) |
dev@372 | 25 export class CurveComponent { |
dev@372 | 26 @Input() id: string; // TODO refactor WaveComponents to have own Timeline, sharing a TimeContext |
dev@372 | 27 @Input() timeline: Timeline; // TODO as above |
dev@372 | 28 @Input() onSeek: OnSeekHandler; |
dev@372 | 29 @Input() width: number; |
dev@372 | 30 @Input() curve: VectorFeature; |
dev@368 | 31 @Input() colour: string; |
dev@359 | 32 } |