Skip to content

Instantly share code, notes, and snippets.

@AlexPikalov
Last active October 9, 2016 18:30
Show Gist options
  • Save AlexPikalov/0c21937350f25be2b7c39b4f94ff8f1c to your computer and use it in GitHub Desktop.
Save AlexPikalov/0c21937350f25be2b7c39b4f94ff8f1c to your computer and use it in GitHub Desktop.
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