Mercurial > hg > ugly-duckling
diff src/app/visualisations/vertical-binned.component.ts @ 473:de23ea6bcd0d
Add vertical binned scale for matrix shapes. Requires waves-ui-piper
update
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Fri, 30 Jun 2017 12:08:50 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/app/visualisations/vertical-binned.component.ts Fri Jun 30 12:08:50 2017 +0100 @@ -0,0 +1,33 @@ +/** + * Created by lucas on 01/06/2017. + */ +import {VerticalBinNameRenderer} from './waves-base.component'; +import { + ChangeDetectionStrategy, + Component, + ContentChildren, + QueryList, + AfterViewInit +} from '@angular/core'; + +@Component({ + selector: 'ugly-vertical-binned', + template: '<ng-content></ng-content>', + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class VerticalBinnedComponent implements AfterViewInit { + + @ContentChildren( + VerticalBinNameRenderer + ) bounded: QueryList<VerticalBinNameRenderer>; + protected cachedBinNames: string[]; + + ngAfterViewInit(): void { + this.bounded.forEach(component => { + this.cachedBinNames = component.binNames; + if (this.cachedBinNames) { + component.renderNames(this.cachedBinNames); + } + }); + } +}