This project is based on the open source project https://github.com/catalogicsoftware/ngx-dynamic-dashboard-framework I created a few years ago.
The keys design aspects:
- Bar Chart Component bar-chart.component.ts
- Bar Chart View bar-chart.component.html
- Bar Chart Service - you would create a service to call a REST endpoint to get data for the component
- The model is used to dynamically create and render the gadget and its property page forms. This model is an entry into a model array used for all gadgets. You will simply add an entry to the model's array. See the BarChartComponent entry.
- Add an entry for the gadget in the library model array library.json
- Add an entry for your gadget in the gadget grid cell host class that serves as a gadget factory gadget-grid-cell-host.component.ts
- Define an image/icon for your gadget bar-chart.png
[
{...},
{
"componentType": "AreaChartComponent",
"title": "Area Chart Component Component Tool",
"subtitle": "Area chart tool subtitle",
"description": "Select this gadget .....",
"icon": "../../assets/images/trend.png",
"instanceId": -1,
"tags": [],
"propertyPages": [
{
"displayName": "Configuration",
...
"properties": [
{
"controlType": "textbox",
"key": "title",
"label": "Title",
"value": "Property Components",
"required": true,
"order": 1
},
{
"controlType": "textbox",
"key": "subtitle",
"label": "Subtitle",
"value": "Product component subtitle",
"required": false,
"order": 2
}
]
}
],
"actions": [
{
"name": "add"
}
]
}
]
This project was generated with Angular CLI version 13.1.1.
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.