Mercurial > hg > ugly-duckling
comparison 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 |
comparison
equal
deleted
inserted
replaced
472:9251232b689e | 473:de23ea6bcd0d |
---|---|
1 /** | |
2 * Created by lucas on 01/06/2017. | |
3 */ | |
4 import {VerticalBinNameRenderer} from './waves-base.component'; | |
5 import { | |
6 ChangeDetectionStrategy, | |
7 Component, | |
8 ContentChildren, | |
9 QueryList, | |
10 AfterViewInit | |
11 } from '@angular/core'; | |
12 | |
13 @Component({ | |
14 selector: 'ugly-vertical-binned', | |
15 template: '<ng-content></ng-content>', | |
16 changeDetection: ChangeDetectionStrategy.OnPush | |
17 }) | |
18 export class VerticalBinnedComponent implements AfterViewInit { | |
19 | |
20 @ContentChildren( | |
21 VerticalBinNameRenderer | |
22 ) bounded: QueryList<VerticalBinNameRenderer>; | |
23 protected cachedBinNames: string[]; | |
24 | |
25 ngAfterViewInit(): void { | |
26 this.bounded.forEach(component => { | |
27 this.cachedBinNames = component.binNames; | |
28 if (this.cachedBinNames) { | |
29 component.renderNames(this.cachedBinNames); | |
30 } | |
31 }); | |
32 } | |
33 } |