Last active
October 9, 2016 18:30
-
-
Save AlexPikalov/0c21937350f25be2b7c39b4f94ff8f1c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, Input } from '@angular/core'; | |
import { d3 } from 'd3'; | |
@Component({ | |
selector: 'bar-chart', | |
template: `<svg [attr.width]="width" [attr.height]="height"></svg>` | |
}) | |
export class BarChartComponent { | |
@Input() frequencies: {[key:string]:number;}; | |
width: number; | |
height: number; | |
constructor() { | |
// let's keep size constant | |
this.width = 480; | |
this.height = 480; | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment