# HG changeset patch # User Lucas Thompson # Date 1494605338 -3600 # Node ID e4e2169578039aa1e7670ac6331e75c14d3bfb8a # Parent e09bb9b25741853b479ee64bec617fa5b02c9e12# Parent a37fe99e1d9d7685207fc710586b25d026ae3a40 Merge branch 'dev/tracks-shape' of github.com:cannam/ugly-duckling into dev/tracks-shape diff -r e09bb9b25741 -r e4e216957803 src/app/waveform/waveform.component.ts --- a/src/app/waveform/waveform.component.ts Fri May 12 17:07:48 2017 +0100 +++ b/src/app/waveform/waveform.component.ts Fri May 12 17:08:58 2017 +0100 @@ -610,6 +610,7 @@ } private addLineLayers(features: VectorFeature[], + unit: string, colour: Colour) { // Winnow out empty features @@ -678,6 +679,7 @@ }); // And a single scale layer at left + //!!! todo: unit in scale layer const scaleLayer = new wavesUI.helpers.ScaleLayer({ tickColor: colour, textColor: colour, @@ -697,7 +699,8 @@ height: height, color: '#c33c54', labelOffset: 38, - yDomain: [ min, max ] + yDomain: [ min, max ], + unit }); this.addLayer( this.highlightLayer, @@ -726,18 +729,23 @@ const height = this.trackDiv.nativeElement.getBoundingClientRect().height; const waveTrack = this.timeline.getTrackById(`wave-${this.trackIdPrefix}`); + let unit = ""; + if (outputDescriptor.configured.hasOwnProperty('unit')) { + unit = outputDescriptor.configured.unit; + } + // TODO refactor all of this switch (features.shape) { case 'vector': { const collected = features.collected as VectorFeature; - this.addLineLayers([collected], colour); + this.addLineLayers([collected], unit, colour); break; } case 'tracks': { const collected = features.collected as TracksFeature; - this.addLineLayers(collected, colour); + this.addLineLayers(collected, unit, colour); break; }