Trying to play with Angular 2 here... understood that it\'s still in alpha.
How do I access DOM elements from Component? Specifically, I would like to use other librarie
As other posters have mentioned: you can manipulate the DOM by injecting ElementRef
into the directive. However, consider carefully whether you really need to do this.
D3 is a DOM manipulation tool. It allows you to bind a data object to a DOM node, then add or remove child elements from that element in response to changing data values. This is pretty much exactly what Angular 2 does.
Of course, D3 does other things as well. You can generate angles for a pie chart, or a normal distribution for example, and you may wish to use D3 for this.
I know it's not the answer you're looking for. It's not the answer I was looking for, but... Consider carefully whether you need to use D3 for DOM manipulation and data binding. Angular 2 already has DOM manipulation and data binding.