D3 reusable chart example with Angular