@iapps/d2-dashboard
v1.0.13
Published
This library was generated with [Nx](https://nx.dev). DHIS2 Dashboard is angular library that support dashboard visualization both using default dashboard APIs or custom dashboard managed from datastore. It is intended to get incorporated in any DHIS2 ang
Downloads
192
Maintainers
Keywords
Readme
DHIS2 Dashboard library
This library was generated with Nx. DHIS2 Dashboard is angular library that support dashboard visualization both using default dashboard APIs or custom dashboard managed from datastore. It is intended to get incorporated in any DHIS2 angular application where dashboard is to be one of application page
Installation
npm install @iapps/d2-dashboard
Usage
Import dashboard module in the root module of your application
import { D2DashboardModule } from '@iapps/d2-dashboard';
...
...
@NgModule({
declarations: [AppComponent],
imports: [
...
...
D2DashboardModule.forRoot({
useDataStore: true,
dataStoreNamespace: 'datastore-dashboard',
rootUrl: 'dashboard',
selectionConfig: {
allowSelectionOnStartUp: false,
startUpPeriodType: 'Monthly',
periodConfig: { openFuturePeriods: 1, allowDateRangeSelection: false },
},
}),
...
],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}
Then, you can use dashboard module as a lazy loaded route
{
path: 'dashboard',
loadChildren: () =>
import('@iapps/d2-dashboard').then((m) => m.D2DashboardModule),
}