view 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
line wrap: on
line source
/**
 * Created by lucas on 30/05/2017.
 */
import {
  ChangeDetectionStrategy,
  Component,
  Input
} from "@angular/core";
import {OnSeekHandler} from "../../playhead/PlayHeadHelpers";
import {VectorFeature} from "piper/HigherLevelUtilities";

@Component({
  selector: 'ugly-curve',
  template: `<ugly-tracks
    [timeline]="timeline"
    [trackIdPrefix]="id"
    [width]="width"
    [onSeek]="onSeek"
    [colour]="colour"
    [tracks]="[curve]"
  ></ugly-tracks>`,
  styleUrls: ['../waves-template.css'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class CurveComponent {
  @Input() id: string; // TODO refactor WaveComponents to have own Timeline, sharing a TimeContext
  @Input() timeline: Timeline; // TODO as above
  @Input() onSeek: OnSeekHandler;
  @Input() width: number;
  @Input() curve: VectorFeature;
  @Input() colour: string;
}