Skip to content

Instantly share code, notes, and snippets.

@AlexPikalov
Created August 21, 2017 20:45
Show Gist options
  • Save AlexPikalov/2b1e6fd67bb6042cbf0caf95da546693 to your computer and use it in GitHub Desktop.
Save AlexPikalov/2b1e6fd67bb6042cbf0caf95da546693 to your computer and use it in GitHub Desktop.
d3-old-way.ts
@Component({
selector: 'chart',
template: '<svg></svg>'
})
class ChartComponent implements OnInit {
constructor(private el: ElementRef) {}
ngOnInit() {
const svg = d3.select(this.el.nativeElement)
.attr('width', '480px')
.attr('height', '480px');
// update svg, add new elements etc.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment