swimlane / ngx-charts

:bar_chart: Declarative Charting Framework for Angular

Home Page:https://swimlane.github.io/ngx-charts/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please, migrate (or provide as an alternative) standalone APIs for both components and providers.

tomastrajan opened this issue · comments

Is your feature request related to a problem? Please describe.
Angular now supports standalone components (and APIs, eg provideX()) since version 14.

Now with the Angular 17 out, we could easily lazy load (often heavy) chart components but this is not currently possible because the NgxChartsModule registers many providers (some of them private) and importing this module in one of the components in consumer application which are marked as standalone: true will NOT add these providers to the injector)

A quick enabling workaroudn would be to export ALL providers so that consumers can register them in standalone way by themselves, but eventually it would be best if the library provided something like provideNgxCharts() which would register all the providers (1/22 of what the NgxChartsModule does.

I have written an article about this topic and the approaches and concerns are applicable for this case.