Skip to content

Instantly share code, notes, and snippets.

@AvocadoVenom
Last active February 3, 2019 16:41
Show Gist options
  • Save AvocadoVenom/d0f9ae78b118b37029899e47f1558f29 to your computer and use it in GitHub Desktop.
Save AvocadoVenom/d0f9ae78b118b37029899e47f1558f29 to your computer and use it in GitHub Desktop.
d3 responsive charts
ngOnInit() {
// ...
window.addEventListener('resize', this.resize.bind(this));
}
private resize() {
this.setSVGDimensions();
this.setAxisScales();
this.repaint();
}
private repaint() {
this.drawAxis();
this.drawBars();
}
ngOnInit() {
// ...
window.addEventListener('resize', this.resize.bind(this));
}
private resize() {
this.setSVGDimensions();
this.setArcs();
this.repaint();
}
private repaint() {
this.drawSlices();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment