# HG changeset patch # User Lucas Thompson # Date 1498836358 -3600 # Node ID e3cbf4c53e5ee2f3373342f80d887168cdf0c7b1 # Parent eacf505f7e1f06c2bedbe0967c1661dd519e7954 Rename type and make it an abstract class to stop angular-cli complaining (I still don't understand this). diff -r eacf505f7e1f -r e3cbf4c53e5e src/app/visualisations/FeatureUtilities.ts --- a/src/app/visualisations/FeatureUtilities.ts Fri Jun 30 16:25:21 2017 +0100 +++ b/src/app/visualisations/FeatureUtilities.ts Fri Jun 30 16:25:58 2017 +0100 @@ -5,7 +5,6 @@ import {FeatureList} from 'piper/Feature'; import {OutputDescriptor, toSeconds} from 'piper'; import { - MatrixFeature, SimpleResponse, TracksFeature, VectorFeature @@ -74,13 +73,16 @@ type ShapeDeducedFromList = 'instants' | 'notes'; export type HigherLevelFeatureShape = CollectedShape | ShapeDeducedFromList; -export interface AugmentedMatrixFeature extends MatrixFeature { +export abstract class Grid { binNames: string[]; + startTime: number; + stepDuration: number; + data: Float32Array[]; } export type ShapedFeatureData = VectorFeature - | AugmentedMatrixFeature + | Grid | TracksFeature | Note[] | Instant[]; @@ -93,7 +95,7 @@ } export class Vector extends ShapedFeature<'vector', VectorFeature> {} -export class Matrix extends ShapedFeature<'matrix', AugmentedMatrixFeature> {} +export class Matrix extends ShapedFeature<'matrix', Grid> {} export class Tracks extends ShapedFeature<'tracks', TracksFeature> {} export class Notes extends ShapedFeature<'notes', Note[]> {} export class Instants extends ShapedFeature<'instants', Instant[]> {} diff -r eacf505f7e1f -r e3cbf4c53e5e src/app/visualisations/grid/grid.component.ts --- a/src/app/visualisations/grid/grid.component.ts Fri Jun 30 16:25:21 2017 +0100 +++ b/src/app/visualisations/grid/grid.component.ts Fri Jun 30 16:25:58 2017 +0100 @@ -5,7 +5,6 @@ VerticallyBinned, VerticallyBinnedWavesComponent, VerticalBinNameRenderer, - VerticalValueInspectorRenderer, WavesComponent } from '../waves-base.component'; import { @@ -14,7 +13,7 @@ Input, } from '@angular/core'; import Waves from 'waves-ui-piper'; -import {AugmentedMatrixFeature} from '../FeatureUtilities'; +import {Grid} from '../FeatureUtilities'; import {iceMapper} from '../../spectrogram/ColourMap'; import {estimatePercentile} from '../../spectrogram/MatrixUtils'; @@ -30,9 +29,9 @@ ] }) -export class GridComponent extends VerticallyBinnedWavesComponent { +export class GridComponent extends VerticallyBinnedWavesComponent { - @Input() set grid(grid: AugmentedMatrixFeature) { + @Input() set grid(grid: Grid) { this.feature = grid; } @@ -65,13 +64,13 @@ ) ]; } - + get binNames(): string[] { if (!this.feature.binNames || this.feature.binNames.length === 0) { const binCount = (this.feature.data.length > 0 ? this.feature.data[0].length : 0); for (let i = 0; i < binCount; ++i) { - this.feature.binNames.push("" + (i + 1)); + this.feature.binNames.push(`${i + 1}`); } } return this.feature.binNames;