tomwanzek / d3-ng2-service

A D3 service for use with Angular.
MIT License
205 stars 42 forks source link

d3.json support? #104

Closed stephen-cchangelabs closed 6 years ago

stephen-cchangelabs commented 6 years ago

Hi

Apologies if this a bit noobish as I'm new to D3 and Angular in general. I'm trying to load JSON files into my graph but it seems that the "json" function doesn't exist through this service.

I think it might be because it doesn't have the d3-fetch or d3-request modules. What would be the best way to integrate that into d3-ng2-service? This may or may not be an issue so I wasn't sure if I should post it here or not, if not, let me know and I will remove it.

Stephen

tomwanzek commented 6 years ago

In essence, it's a conscious design decision. When using D3 in an Angular app, I consider it preferable (if not best practice) to use Angular for http communication. It's simply a separation of concerns choice, rather than a comment on d3-request.

So my recommendation would be to go with Angular httpClient.

Note that, I left d3-dsv in scope for this package to support parsing/formatting of data post/pre-http communication. 😄