Mercurial > hg > ugly-duckling
changeset 477:e3cbf4c53e5e
Rename type and make it an abstract class to stop angular-cli complaining (I still don't understand this).
author | Lucas Thompson <dev@lucas.im> |
---|---|
date | Fri, 30 Jun 2017 16:25:58 +0100 |
parents | eacf505f7e1f |
children | 6d26e3d74713 |
files | src/app/visualisations/FeatureUtilities.ts src/app/visualisations/grid/grid.component.ts |
diffstat | 2 files changed, 11 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- 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[]> {}
--- 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<AugmentedMatrixFeature> { +export class GridComponent extends VerticallyBinnedWavesComponent<Grid> { - @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;