This library converts the https://github.com/catalogicsoftware/Angular-2-Dashboard-Framework to a library.
The main difference between here and there are
- library instead of app.
- removed all the gadgets.
- change the directive prefix app- to dashboard-
- upgrade to angular 10.
This library still working in process. items I would like to improve on
- provides an option to use localstorage or backend to store the dashboard configuration.
- emit dashboard events. so the app can listen to the events.
- permissions. This is going to be a big part of the dashboard feature. with permissions, it can display the gadget based on permissions.
- code base cleanup.
- Currently the code base has a lot of type
any. it would be nice to add some types.
- tighten up what modules should be exported and what should not exported. This is important in the future when libraries continue to evolve.
- the build system need some love.
- Currently the code base has a lot of type
- remove the semantic-ui external dependency. I think this is a high priority.
NGX Dynamic Dashboard Framework
you can refer to https://github.com/MHL3060/dashboard-entry the sample project for the latest usage.
- add "ngx-dynamic-dashboard": "^0.0.32" as a dependency in package.json
- add the following modules to your module.ts (eg. app.module.ts)imports:,providers:
- Create a GadgetRegistery.ts to register your GadgetComponent. The following code just register NewGadgetComponent.
- in your component template. add the dashboard directive.
Sample Board 1
Add Board and Gadget
How to use this library.
I have created a simple app called dashboard-entry https://github.com/MHL3060/dashboard-entry This app describes the usage of this library.
jquerydependency. (Will try to remove both of them in the future).
create a GadgetRegistry.ts to registered Gadget lookup.
- import the ngx-dynamic-dashboard module into your app's module.ts. registered GadgetRegistry.
- add Gadget to your library.
The following JSON document describes gadget library. currently this need to live in your app's assets/api folder
and the file name need to be
Example JSON document
The following JSON document describes a single board along with its layout, gadgets and their properites.
Sample Realtime Web Socket Based Gadget
Sample Board 2
Drag and Drop
Note: This project is under heavy construction and is not intended for general production use yet. As such, we are not accepting bugs at the moment and documentation is quite lacking.
This is an angular (ngx) based dashboard framework that is inspired by JIRA's dashboard implementation and https://github.com/angular-dashboard-framework/angular-dashboard-framework
The primary projects leveraged:
- Angular - https://angularjs.org/
- ngx-charts (angular based d3 charts) - https://github.com/swimlane/ngx-charts
- Semantic-UI - https://semantic-ui.com/
- ng2-dnd drag and drop - https://github.com/akserg/ng2-dnd
- AI Natural Language Processing - The board includes two options for AI, Wit.Ai and IBM Watson.
- Wit.ai - Natural Language Processing site has been integrated via JSONP
- IBM Watson - IBM Watson does not support JSONP so the code relies on a backend implementation of the IBM Watson SDK. I offer sample backend code based on Spring Boot within the comments of the Runtime Service
- Leverages Angular's dynamic data driven forms approach for gadget property pages and properties - https://angular.io/guide/dynamic-form
- Dynamic component strategy for creating gadget instances during runtime - https://angular.io/guide/dynamic-component-loader
- Faceted gadget search approach leveraging tags
- Support multiple board creation
- Drag and Drop support
- Multiple Data Source/Endpoint management
- Web Socket support
- Completely customizable and configurable
Getting Started Developing a Gadget
The code includes a very simple Todo gadget that can be used as an example for getting started developing your own gadget. The following steps uses that Todo Gadget as a reference. You focus on defining the gadget and the rest of the framework will deal with making it available to the Add Gadget Modal, drag and drop, instance creation, tracking, persistence and cleanup, etc.
Define the Gadget Component, Service and View
- Todo Component todo-gadget.component.ts
- Todo View view.html
- Todo Service service.ts
- Sample mock service data todo-model.json
Define the gadget's model
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 Todo entry. Add an entry for the gadget in the library model array gadget-library-model.json
Add the gadget entry to the gadget factory class
Add an entry for your gadget in the factory gadget class gadget-factory.ts
Define an image/icon for your gadget todo.png
Gadget Module References
- Import the gadget's component into the board module board.module.ts
- Import the gadget's service into the grid module grid.module.ts
- Import the gadget's component and service into the gadget module gadget.module.ts
This project was generated with Angular CLI version 7.x.
Clone this repository then 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.
ng build to build the project. The build artifacts will be stored in the
dist/ directory. Use the
--aot --prod flag for ahead of time compilation and production mode.
The title of that issue suggests an issue with AOT but in my testing
--prod seems to be the problem.
Running unit tests
ng test to execute the unit tests via Karma.
Running end-to-end tests
ng e2e to execute the end-to-end tests via Protractor.
Before running the tests make sure you are serving the app via
Source Code Documentation
This project uses the compodoc project : https://github.com/compodoc/compodoc
npm install -g @compodoc/compodoc to install compodoc globally
compodoc -p tsconfig.json -n 'NGX Dynamic Dashboard Framework' to generate the documentation. It will be placed in the documentation folder
compodoc -s to serve up the documentation site at http://localhost:8080
Spring Boot Backend Project
There is an accompanying java based backend project that serves up some of the endpoints used by the board.
It is a maven based project so you will need to do the following:
- Install and configure Maven.
- Copy the dist directory produced from this project's build into the
staticfolder of the microservice project.
- Build the microservice project using
<directory path to maven bin folder>/mvn installfrom within the project's root directory.
- Launch the microservice over the default port:
java -jar <path to the microservice root folder>/target/ngxdd-x.y.z.jar
To get more help on the Angular CLI use
ng help or go check out the Angular CLI README.