├── .DS_Store
├── .gitignore
├── API
├── backup.json
└── db.json
├── LICENSE
├── README.md
├── angular.json
├── demo.gif
├── e2e
├── protractor.conf.js
├── src
│ ├── app.e2e-spec.ts
│ └── app.po.ts
└── tsconfig.e2e.json
├── package-lock.json
├── package.json
├── src
├── app
│ ├── app.component.html
│ ├── app.component.ts
│ ├── app.module.ts
│ ├── app.routes.ts
│ ├── components
│ │ ├── doughnut-chart
│ │ │ ├── doughnut-chart.component.html
│ │ │ └── doughnut-chart.component.ts
│ │ ├── line-chart
│ │ │ ├── line-chart.component.html
│ │ │ └── line-chart.component.ts
│ │ ├── menu
│ │ │ ├── menu.component.css
│ │ │ ├── menu.component.html
│ │ │ └── menu.component.ts
│ │ ├── modal
│ │ │ ├── modal.component.html
│ │ │ └── modal.component.ts
│ │ └── radar-chart
│ │ │ ├── radar-chart.component.html
│ │ │ └── radar-chart.component.ts
│ ├── dashboard
│ │ ├── dashboard.component.html
│ │ └── dashboard.component.ts
│ └── services
│ │ └── dashboard.service.ts
├── assets
│ └── .gitkeep
├── browserslist
├── environments
│ ├── environment.prod.ts
│ └── environment.ts
├── favicon.ico
├── index.html
├── karma.conf.js
├── main.ts
├── models
│ └── dashboard.model.ts
├── polyfills.ts
├── styles.css
├── test.ts
├── tsconfig.app.json
├── tsconfig.spec.json
└── tslint.json
├── tsconfig.json
├── tslint.json
└── yarn.lock
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nathanagez/angular6-dynamic-dashboard/29c018d660fef92be892f91fe9a7fef310f531d8/.DS_Store
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Runtime data
9 | pids
10 | *.pid
11 | *.seed
12 | *.pid.lock
13 |
14 | # Directory for instrumented libs generated by jscoverage/JSCover
15 | lib-cov
16 |
17 | # Coverage directory used by tools like istanbul
18 | coverage
19 |
20 | # nyc test coverage
21 | .nyc_output
22 |
23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 | .grunt
25 |
26 | # Bower dependency directory (https://bower.io/)
27 | bower_components
28 |
29 | # node-waf configuration
30 | .lock-wscript
31 |
32 | # Compiled binary addons (https://nodejs.org/api/addons.html)
33 | build/Release
34 |
35 | # Dependency directories
36 | node_modules/
37 | jspm_packages/
38 |
39 | # TypeScript v1 declaration files
40 | typings/
41 |
42 | # Optional npm cache directory
43 | .npm
44 |
45 | # Optional eslint cache
46 | .eslintcache
47 |
48 | # Optional REPL history
49 | .node_repl_history
50 |
51 | # Output of 'npm pack'
52 | *.tgz
53 |
54 | # Yarn Integrity file
55 | .yarn-integrity
56 |
57 | # dotenv environment variables file
58 | .env
59 |
60 | # next.js build output
61 | .next
62 |
--------------------------------------------------------------------------------
/API/backup.json:
--------------------------------------------------------------------------------
1 | {
2 | "dashboards": [
3 | {
4 | "id": 1,
5 | "username": "Nathan",
6 | "dashboard": [
7 | { "cols": 5, "rows": 5, "y": 0, "x": 0, "component": "line_chart", "name": "Line Chart" },
8 | { "cols": 5, "rows": 5, "y": 0, "x": 0, "component": "doughnut_chart", "name": "Doghnut Chart" }
9 | ]
10 | },
11 | {
12 | "id": 2,
13 | "username": "John",
14 | "dashboard": [
15 | { "cols": 5, "rows": 5, "y": 0, "x": 0, "component": "radar_chart", "name": "Radar Chart" },
16 | { "cols": 5, "rows": 5, "y": 0, "x": 0, "component": "doughnut_chart", "name": "Doghnut Chart" }
17 | ]
18 | }
19 | ],
20 | "widgets": [
21 | {
22 | "name": "Radar Chart",
23 | "identifier": "radar_chart"
24 | },
25 | {
26 | "name": "Doughnut Chart",
27 | "identifier": "doughnut_chart"
28 | },
29 | {
30 | "name": "Line Chart",
31 | "identifier": "line_chart"
32 | }
33 | ]
34 | }
--------------------------------------------------------------------------------
/API/db.json:
--------------------------------------------------------------------------------
1 | {
2 | "dashboards": [
3 | {
4 | "id": 1,
5 | "username": "Nathan",
6 | "dashboard": [
7 | {
8 | "cols": 5,
9 | "rows": 5,
10 | "y": 0,
11 | "x": 0,
12 | "name": "Line Chart",
13 | "component": "Line Chart"
14 | },
15 | {
16 | "cols": 5,
17 | "rows": 5,
18 | "x": 5,
19 | "y": 0,
20 | "name": "Doughnut Chart",
21 | "component": "Doughnut Chart"
22 | }
23 | ]
24 | },
25 | {
26 | "id": 2,
27 | "username": "John",
28 | "dashboard": [
29 | {
30 | "cols": 5,
31 | "rows": 5,
32 | "x": 0,
33 | "y": 5,
34 | "name": "Doughnut Chart",
35 | "component": "Doughnut Chart"
36 | },
37 | {
38 | "cols": 5,
39 | "rows": 5,
40 | "x": 5,
41 | "y": 0,
42 | "name": "Line Chart",
43 | "component": "Line Chart"
44 | },
45 | {
46 | "cols": 5,
47 | "rows": 5,
48 | "x": 0,
49 | "y": 0,
50 | "name": "Radar Chart",
51 | "component": "Radar Chart"
52 | },
53 | {
54 | "cols": 5,
55 | "rows": 5,
56 | "x": 5,
57 | "y": 5,
58 | "name": "Line Chart",
59 | "component": "Line Chart"
60 | }
61 | ]
62 | }
63 | ],
64 | "widgets": [
65 | {
66 | "name": "Radar Chart",
67 | "identifier": "radar_chart"
68 | },
69 | {
70 | "name": "Doughnut Chart",
71 | "identifier": "doughnut_chart"
72 | },
73 | {
74 | "name": "Line Chart",
75 | "identifier": "line_chart"
76 | }
77 | ]
78 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Nathan Agez
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # angular6-dynamic-dashboard
2 |
3 |  
4 |
5 | Dynamic dashboard prototype using angular-gridster2 and ngx-dynamic-template
6 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.8.
7 |
8 | # Start json-server
9 | You need to install json server (Dashboards are generated and saved using a REST API)
10 | run `npm install -g json-server`
11 |
12 | run `json-server --watch ./API/db.json`
13 |
14 | ## Start Angular
15 | Install dependencies first by running `npm i`
16 | Run `ng serve -o` for a dev server.
17 | Navigate to `http://localhost:4200/`. The app will automatically redirect you to the first dashboard
18 |
19 | ## Demo
20 | Keep in mind that this is a prototype of a dynamic dashboard saved in a serialized JSON. Actually it communicate with a local REST API using json-server.
21 | This demo allow you to perform GET request for the moment, i'm implementing POST and PUT request to save dashboard state on the fly.
22 | Although JSON is serialized, I can parse it to make an instance of the component that was on the dashboard before serialization.
23 | 
24 |
--------------------------------------------------------------------------------
/angular.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "version": 1,
4 | "newProjectRoot": "projects",
5 | "projects": {
6 | "proto": {
7 | "root": "",
8 | "sourceRoot": "src",
9 | "projectType": "application",
10 | "prefix": "app",
11 | "schematics": {},
12 | "architect": {
13 | "build": {
14 | "builder": "@angular-devkit/build-angular:browser",
15 | "options": {
16 | "outputPath": "dist/proto",
17 | "index": "src/index.html",
18 | "main": "src/main.ts",
19 | "polyfills": "src/polyfills.ts",
20 | "tsConfig": "src/tsconfig.app.json",
21 | "assets": [
22 | "src/favicon.ico",
23 | "src/assets"
24 | ],
25 | "styles": [
26 | "node_modules/@clr/icons/clr-icons.min.css",
27 | "node_modules/@clr/ui/clr-ui.min.css",
28 | "src/styles.css"
29 | ],
30 | "scripts": [
31 | "node_modules/@webcomponents/custom-elements/custom-elements.min.js",
32 | "node_modules/chart.js/src/chart.js",
33 | "node_modules/@clr/icons/clr-icons.min.js",
34 | "node_modules/chart.js/dist/Chart.min.js"
35 | ]
36 | },
37 | "configurations": {
38 | "production": {
39 | "fileReplacements": [
40 | {
41 | "replace": "src/environments/environment.ts",
42 | "with": "src/environments/environment.prod.ts"
43 | }
44 | ],
45 | "optimization": true,
46 | "outputHashing": "all",
47 | "sourceMap": false,
48 | "extractCss": true,
49 | "namedChunks": false,
50 | "aot": true,
51 | "extractLicenses": true,
52 | "vendorChunk": false,
53 | "buildOptimizer": true
54 | }
55 | }
56 | },
57 | "serve": {
58 | "builder": "@angular-devkit/build-angular:dev-server",
59 | "options": {
60 | "browserTarget": "proto:build"
61 | },
62 | "configurations": {
63 | "production": {
64 | "browserTarget": "proto:build:production"
65 | }
66 | }
67 | },
68 | "extract-i18n": {
69 | "builder": "@angular-devkit/build-angular:extract-i18n",
70 | "options": {
71 | "browserTarget": "proto:build"
72 | }
73 | },
74 | "test": {
75 | "builder": "@angular-devkit/build-angular:karma",
76 | "options": {
77 | "main": "src/test.ts",
78 | "polyfills": "src/polyfills.ts",
79 | "tsConfig": "src/tsconfig.spec.json",
80 | "karmaConfig": "src/karma.conf.js",
81 | "styles": [
82 | "src/styles.css"
83 | ],
84 | "scripts": [],
85 | "assets": [
86 | "src/favicon.ico",
87 | "src/assets"
88 | ]
89 | }
90 | },
91 | "lint": {
92 | "builder": "@angular-devkit/build-angular:tslint",
93 | "options": {
94 | "tsConfig": [
95 | "src/tsconfig.app.json",
96 | "src/tsconfig.spec.json"
97 | ],
98 | "exclude": [
99 | "**/node_modules/**"
100 | ]
101 | }
102 | }
103 | }
104 | },
105 | "proto-e2e": {
106 | "root": "e2e/",
107 | "projectType": "application",
108 | "architect": {
109 | "e2e": {
110 | "builder": "@angular-devkit/build-angular:protractor",
111 | "options": {
112 | "protractorConfig": "e2e/protractor.conf.js",
113 | "devServerTarget": "proto:serve"
114 | },
115 | "configurations": {
116 | "production": {
117 | "devServerTarget": "proto:serve:production"
118 | }
119 | }
120 | },
121 | "lint": {
122 | "builder": "@angular-devkit/build-angular:tslint",
123 | "options": {
124 | "tsConfig": "e2e/tsconfig.e2e.json",
125 | "exclude": [
126 | "**/node_modules/**"
127 | ]
128 | }
129 | }
130 | }
131 | }
132 | },
133 | "defaultProject": "proto"
134 | }
--------------------------------------------------------------------------------
/demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nathanagez/angular6-dynamic-dashboard/29c018d660fef92be892f91fe9a7fef310f531d8/demo.gif
--------------------------------------------------------------------------------
/e2e/protractor.conf.js:
--------------------------------------------------------------------------------
1 | // Protractor configuration file, see link for more information
2 | // https://github.com/angular/protractor/blob/master/lib/config.ts
3 |
4 | const { SpecReporter } = require('jasmine-spec-reporter');
5 |
6 | exports.config = {
7 | allScriptsTimeout: 11000,
8 | specs: [
9 | './src/**/*.e2e-spec.ts'
10 | ],
11 | capabilities: {
12 | 'browserName': 'chrome'
13 | },
14 | directConnect: true,
15 | baseUrl: 'http://localhost:4200/',
16 | framework: 'jasmine',
17 | jasmineNodeOpts: {
18 | showColors: true,
19 | defaultTimeoutInterval: 30000,
20 | print: function() {}
21 | },
22 | onPrepare() {
23 | require('ts-node').register({
24 | project: require('path').join(__dirname, './tsconfig.e2e.json')
25 | });
26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27 | }
28 | };
--------------------------------------------------------------------------------
/e2e/src/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { AppPage } from './app.po';
2 |
3 | describe('workspace-project App', () => {
4 | let page: AppPage;
5 |
6 | beforeEach(() => {
7 | page = new AppPage();
8 | });
9 |
10 | it('should display welcome message', () => {
11 | page.navigateTo();
12 | expect(page.getParagraphText()).toEqual('Welcome to proto!');
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/e2e/src/app.po.ts:
--------------------------------------------------------------------------------
1 | import { browser, by, element } from 'protractor';
2 |
3 | export class AppPage {
4 | navigateTo() {
5 | return browser.get('/');
6 | }
7 |
8 | getParagraphText() {
9 | return element(by.css('app-root h1')).getText();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/e2e/tsconfig.e2e.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "module": "commonjs",
6 | "target": "es5",
7 | "types": [
8 | "jasmine",
9 | "jasminewd2",
10 | "node"
11 | ]
12 | }
13 | }
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "proto",
3 | "version": "0.0.0",
4 | "scripts": {
5 | "ng": "ng",
6 | "start": "ng serve",
7 | "build": "ng build",
8 | "test": "ng test",
9 | "lint": "ng lint",
10 | "e2e": "ng e2e"
11 | },
12 | "private": true,
13 | "dependencies": {
14 | "@angular/animations": "^6.0.3",
15 | "@angular/common": "^6.0.3",
16 | "@angular/compiler": "^6.0.3",
17 | "@angular/core": "^6.0.3",
18 | "@angular/forms": "^6.0.3",
19 | "@angular/http": "^6.0.3",
20 | "@angular/platform-browser": "^6.0.3",
21 | "@angular/platform-browser-dynamic": "^6.0.3",
22 | "@angular/router": "^6.0.3",
23 | "@clr/angular": "^0.12.7",
24 | "@fortawesome/angular-fontawesome": "^0.1.1",
25 | "@fortawesome/fontawesome-svg-core": "^1.2.2",
26 | "@fortawesome/free-solid-svg-icons": "^5.2.0",
27 | "add": "^2.0.6",
28 | "angular-gridster2": "^6.0.5",
29 | "chart.js": "^2.7.2",
30 | "core-js": "^2.5.4",
31 | "ng-dynamic-component": "^3.0.0",
32 | "ng2-charts": "^1.6.0",
33 | "rxjs": "^6.0.0",
34 | "yarn": "^1.22.0",
35 | "zone.js": "^0.8.26",
36 | "@clr/ui": "^0.12.7",
37 | "@clr/icons": "^0.12.7",
38 | "@webcomponents/custom-elements": "^1.0.0"
39 | },
40 | "devDependencies": {
41 | "@angular-devkit/build-angular": "~0.6.8",
42 | "@angular/cli": "~6.0.8",
43 | "@angular/compiler-cli": "^6.0.3",
44 | "@angular/language-service": "^6.0.3",
45 | "@types/jasmine": "~2.8.6",
46 | "@types/jasminewd2": "~2.0.3",
47 | "@types/node": "~8.9.4",
48 | "codelyzer": "~4.2.1",
49 | "jasmine-core": "~2.99.1",
50 | "jasmine-spec-reporter": "~4.2.1",
51 | "karma": "~1.7.1",
52 | "karma-chrome-launcher": "~2.2.0",
53 | "karma-coverage-istanbul-reporter": "~2.0.0",
54 | "karma-jasmine": "~1.1.1",
55 | "karma-jasmine-html-reporter": "^0.2.2",
56 | "protractor": "~5.3.0",
57 | "ts-node": "~5.0.1",
58 | "tslint": "~5.9.1",
59 | "typescript": "~2.7.2"
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-root',
5 | templateUrl: './app.component.html'
6 | })
7 | export class AppComponent {
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | // MODULES
2 | import { BrowserModule } from '@angular/platform-browser';
3 | import { NgModule } from '@angular/core';
4 | import { RouterModule } from '@angular/router';
5 | import { HttpClientModule } from '@angular/common/http';
6 | import { GridsterModule } from 'angular-gridster2';
7 | import { DynamicModule } from 'ng-dynamic-component';
8 | import { ChartsModule } from 'ng2-charts';
9 |
10 | // CSS FRAMEWORK ICONS
11 | import '@clr/icons';
12 | import '@clr/icons/shapes/all-shapes';
13 |
14 | // CONST
15 | import { ROUTES } from './app.routes';
16 |
17 | // COMPONENTS
18 | import { AppComponent } from './app.component';
19 | import { DashboardComponent } from './dashboard/dashboard.component';
20 | import { MenuComponent } from './components/menu/menu.component';
21 | import { LineChartComponent } from './components/line-chart/line-chart.component';
22 | import { DoughnutChartComponent } from './components/doughnut-chart/doughnut-chart.component';
23 | import { RadarChartComponent } from './components/radar-chart/radar-chart.component';
24 | import { ClarityModule } from '@clr/angular';
25 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
26 | import { ModalComponent } from './components/modal/modal.component';
27 |
28 | @NgModule({
29 | declarations: [
30 | AppComponent,
31 | DashboardComponent,
32 | MenuComponent,
33 | LineChartComponent,
34 | DoughnutChartComponent,
35 | RadarChartComponent,
36 | ModalComponent,
37 | ],
38 | imports: [
39 | BrowserModule,
40 | GridsterModule,
41 | HttpClientModule,
42 | ChartsModule,
43 | DynamicModule.withComponents([DoughnutChartComponent, RadarChartComponent, LineChartComponent]),
44 | RouterModule.forRoot(ROUTES),
45 | ClarityModule,
46 | BrowserAnimationsModule
47 | ],
48 | providers: [],
49 | bootstrap: [AppComponent]
50 | })
51 | export class AppModule { }
52 |
--------------------------------------------------------------------------------
/src/app/app.routes.ts:
--------------------------------------------------------------------------------
1 | import { DashboardComponent } from './dashboard/dashboard.component';
2 | import { Routes } from '@angular/router';
3 |
4 | export const ROUTES: Routes = [
5 | { path: '', pathMatch: 'full', redirectTo: 'dashboard/1' },
6 | { path: 'dashboard/:id', component: DashboardComponent },
7 | ]
--------------------------------------------------------------------------------
/src/app/components/doughnut-chart/doughnut-chart.component.html:
--------------------------------------------------------------------------------
1 |
2 |
4 |
--------------------------------------------------------------------------------
/src/app/components/doughnut-chart/doughnut-chart.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-doughnut-chart",
5 | templateUrl: "./doughnut-chart.component.html"
6 | })
7 | export class DoughnutChartComponent {
8 | public doughnutChartLabels: string[] = [
9 | "Download Sales",
10 | "In-Store Sales",
11 | "Mail-Order Sales"
12 | ];
13 | public doughnutChartData: number[] = [350, 450, 100];
14 | public doughnutChartType: string = "doughnut";
15 |
16 | // events
17 | public chartClicked(e: any): void {
18 | console.log(e);
19 | }
20 |
21 | public chartHovered(e: any): void {
22 | console.log(e);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/app/components/line-chart/line-chart.component.html:
--------------------------------------------------------------------------------
1 |
2 |
11 |
--------------------------------------------------------------------------------
/src/app/components/line-chart/line-chart.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-line-chart",
5 | templateUrl: "./line-chart.component.html"
6 | })
7 | export class LineChartComponent {
8 | // lineChart
9 | public lineChartData:Array = [
10 | {data: [65, 59, 80, 81, 56, 55, 40], label: 'Series A'},
11 | {data: [28, 48, 40, 19, 86, 27, 90], label: 'Series B'},
12 | {data: [18, 48, 77, 9, 100, 27, 40], label: 'Series C'}
13 | ];
14 | public lineChartLabels:Array = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];
15 | public lineChartOptions:any = {
16 | responsive: true
17 | };
18 | public lineChartColors:Array = [
19 | { // grey
20 | backgroundColor: 'rgba(148,159,177,0.2)',
21 | borderColor: 'rgba(148,159,177,1)',
22 | pointBackgroundColor: 'rgba(148,159,177,1)',
23 | pointBorderColor: '#fff',
24 | pointHoverBackgroundColor: '#fff',
25 | pointHoverBorderColor: 'rgba(148,159,177,0.8)'
26 | },
27 | { // dark grey
28 | backgroundColor: 'rgba(77,83,96,0.2)',
29 | borderColor: 'rgba(77,83,96,1)',
30 | pointBackgroundColor: 'rgba(77,83,96,1)',
31 | pointBorderColor: '#fff',
32 | pointHoverBackgroundColor: '#fff',
33 | pointHoverBorderColor: 'rgba(77,83,96,1)'
34 | },
35 | { // grey
36 | backgroundColor: 'rgba(148,159,177,0.2)',
37 | borderColor: 'rgba(148,159,177,1)',
38 | pointBackgroundColor: 'rgba(148,159,177,1)',
39 | pointBorderColor: '#fff',
40 | pointHoverBackgroundColor: '#fff',
41 | pointHoverBorderColor: 'rgba(148,159,177,0.8)'
42 | }
43 | ];
44 | public lineChartLegend:boolean = true;
45 | public lineChartType:string = 'line';
46 |
47 | public randomize():void {
48 | let _lineChartData:Array = new Array(this.lineChartData.length);
49 | for (let i = 0; i < this.lineChartData.length; i++) {
50 | _lineChartData[i] = {data: new Array(this.lineChartData[i].data.length), label: this.lineChartData[i].label};
51 | for (let j = 0; j < this.lineChartData[i].data.length; j++) {
52 | _lineChartData[i].data[j] = Math.floor((Math.random() * 100) + 1);
53 | }
54 | }
55 | this.lineChartData = _lineChartData;
56 | }
57 |
58 | // events
59 | public chartClicked(e:any):void {
60 | console.log(e);
61 | }
62 |
63 | public chartHovered(e:any):void {
64 | console.log(e);
65 | }
66 | }
--------------------------------------------------------------------------------
/src/app/components/menu/menu.component.css:
--------------------------------------------------------------------------------
1 | .content-container {
2 | min-height: 100vh;
3 | height: initial;
4 | }
--------------------------------------------------------------------------------
/src/app/components/menu/menu.component.html:
--------------------------------------------------------------------------------
1 |
21 |
22 |
43 |
44 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/src/app/components/menu/menu.component.ts:
--------------------------------------------------------------------------------
1 | import { DashboardService } from '../../services/dashboard.service';
2 | import { WidgetModel, DashboardModel } from "../../../models/dashboard.model";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-menu",
7 | templateUrl: "./menu.component.html",
8 | styleUrls: ["./menu.component.css"]
9 | })
10 | export class MenuComponent implements OnInit {
11 |
12 | constructor(private _ds: DashboardService) {};
13 |
14 | // Components variables
15 | protected toggle: boolean;
16 | protected modal: boolean;
17 | protected widgetCollection: WidgetModel[];
18 | protected dashboardCollection: DashboardModel[];
19 |
20 | // On component init we store Widget Marketplace in a WidgetModel array
21 | ngOnInit(): void {
22 | // We make a get request to get all widgets from our REST API
23 | this._ds.getWidgets().subscribe(widgets => {
24 | this.widgetCollection = widgets;
25 | });
26 |
27 | // We make get request to get all dashboards from our REST API
28 | this._ds.getDashboards().subscribe(dashboards => {
29 | this.dashboardCollection = dashboards;
30 | });
31 | }
32 |
33 | onDrag(event, identifier) {
34 | event.dataTransfer.setData('widgetIdentifier', identifier);
35 | }
36 | // Method call when toggle button is clicked in navbar
37 | toggleMenu(): void {
38 | this.toggle = !this.toggle;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/app/components/modal/modal.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Dashboard settings
4 |
30 |
35 |
--------------------------------------------------------------------------------
/src/app/components/modal/modal.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, Input, Output, EventEmitter } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-modal',
5 | templateUrl: './modal.component.html'
6 | })
7 | export class ModalComponent {
8 | /**
9 | * @Input & @Output decorators allow communication between Child and Parent component
10 | * @Input allow Parent component to send data
11 | * @Output allow Child component to emit an Event to Parent component
12 | */
13 |
14 | // Receive true or false from Parent component
15 | @Input() modal: boolean;
16 |
17 | // Tell to parent component that modal is close
18 | @Output() closeModal = new EventEmitter();
19 |
20 | toggle() {
21 | this.closeModal.emit();
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/app/components/radar-chart/radar-chart.component.html:
--------------------------------------------------------------------------------
1 |
2 |
4 |
--------------------------------------------------------------------------------
/src/app/components/radar-chart/radar-chart.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-radar-chart",
5 | templateUrl: "./radar-chart.component.html"
6 | })
7 | export class RadarChartComponent {
8 | // Radar
9 | public radarChartLabels: string[] = [
10 | "Eating",
11 | "Drinking",
12 | "Sleeping",
13 | "Designing",
14 | "Coding",
15 | "Cycling",
16 | "Running"
17 | ];
18 |
19 | public radarChartData: any = [
20 | { data: [65, 59, 90, 81, 56, 55, 40], label: "Series A" },
21 | { data: [28, 48, 40, 19, 96, 27, 100], label: "Series B" }
22 | ];
23 | public radarChartType: string = "radar";
24 |
25 | // events
26 | public chartClicked(e: any): void {
27 | console.log(e);
28 | }
29 |
30 | public chartHovered(e: any): void {
31 | console.log(e);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/app/dashboard/dashboard.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 |
13 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/app/dashboard/dashboard.component.ts:
--------------------------------------------------------------------------------
1 | // GRIDSTER & ANGULAR
2 | import { Component, OnInit } from "@angular/core";
3 | import { ActivatedRoute } from "@angular/router";
4 | import { GridsterConfig, GridsterItem, GridsterItemComponentInterface } from "angular-gridster2";
5 | import { DashboardService } from "../services/dashboard.service";
6 | import { DashboardModel, DashboardContentModel } from "../../models/dashboard.model";
7 |
8 | // COMPONENTS
9 | import { LineChartComponent } from "../components/line-chart/line-chart.component";
10 | import { RadarChartComponent } from "../components/radar-chart/radar-chart.component";
11 | import { DoughnutChartComponent } from "../components/doughnut-chart/doughnut-chart.component";
12 |
13 | @Component({
14 | selector: "app-dashboard",
15 | templateUrl: "./dashboard.component.html"
16 | })
17 | export class DashboardComponent implements OnInit {
18 | constructor(private _route: ActivatedRoute, private _ds: DashboardService) {}
19 |
20 | protected options: GridsterConfig;
21 | protected dashboardId: number;
22 | protected dashboardCollection: DashboardModel;
23 | protected dashboardArray: DashboardContentModel[];
24 | protected componentCollection = [
25 | { name: "Line Chart", componentInstance: LineChartComponent },
26 | { name: "Doughnut Chart", componentInstance: DoughnutChartComponent },
27 | { name: "Radar Chart", componentInstance: RadarChartComponent }
28 | ];
29 |
30 | ngOnInit() {
31 | // Grid options
32 | this.options = {
33 | gridType: "fit",
34 | enableEmptyCellDrop: true,
35 | emptyCellDropCallback: this.onDrop,
36 | pushItems: true,
37 | swap: true,
38 | pushDirections: { north: true, east: true, south: true, west: true },
39 | resizable: { enabled: true },
40 | itemChangeCallback: this.itemChange.bind(this),
41 | draggable: {
42 | enabled: true,
43 | ignoreContent: true,
44 | dropOverItems: true,
45 | dragHandleClass: "drag-handler",
46 | ignoreContentClass: "no-drag",
47 | },
48 | displayGrid: "always",
49 | minCols: 10,
50 | minRows: 10
51 | };
52 | this.getData();
53 | }
54 |
55 | getData() {
56 | // We get the id in get current router dashboard/:id
57 | this._route.params.subscribe(params => {
58 | // + is used to cast string to int
59 | this.dashboardId = +params["id"];
60 | // We make a get request with the dashboard id
61 | this._ds.getDashboard(this.dashboardId).subscribe(dashboard => {
62 | // We fill our dashboardCollection with returned Observable
63 | this.dashboardCollection = dashboard;
64 | // We parse serialized Json to generate components on the fly
65 | this.parseJson(this.dashboardCollection);
66 | // We copy array without reference
67 | this.dashboardArray = this.dashboardCollection.dashboard.slice();
68 |
69 | });
70 | });
71 | }
72 |
73 | // Super TOKENIZER 2.0 POWERED BY NATCHOIN
74 | parseJson(dashboardCollection: DashboardModel) {
75 | // We loop on our dashboardCollection
76 | dashboardCollection.dashboard.forEach(dashboard => {
77 | // We loop on our componentCollection
78 | this.componentCollection.forEach(component => {
79 | // We check if component key in our dashboardCollection
80 | // is equal to our component name key in our componentCollection
81 | if (dashboard.component === component.name) {
82 | // If it is, we replace our serialized key by our component instance
83 | dashboard.component = component.componentInstance;
84 | }
85 | });
86 | });
87 | }
88 |
89 | serialize(dashboardCollection) {
90 | // We loop on our dashboardCollection
91 | dashboardCollection.forEach(dashboard => {
92 | // We loop on our componentCollection
93 | this.componentCollection.forEach(component => {
94 | // We check if component key in our dashboardCollection
95 | // is equal to our component name key in our componentCollection
96 | if (dashboard.name === component.name) {
97 | dashboard.component = component.name;
98 | }
99 | });
100 | });
101 | }
102 |
103 | itemChange() {
104 | this.dashboardCollection.dashboard = this.dashboardArray;
105 | let tmp = JSON.stringify(this.dashboardCollection);
106 | let parsed: DashboardModel = JSON.parse(tmp);
107 | this.serialize(parsed.dashboard);
108 | console.log(this.dashboardArray);
109 | this._ds.updateDashboard(this.dashboardId, parsed).subscribe();
110 | }
111 |
112 | onDrop(ev) {
113 | const componentType = ev.dataTransfer.getData("widgetIdentifier");
114 | switch (componentType) {
115 | case "radar_chart":
116 | return this.dashboardArray.push({
117 | cols: 5,
118 | rows: 5,
119 | x: 0,
120 | y: 0,
121 | component: RadarChartComponent,
122 | name: "Radar Chart"
123 | });
124 | case "line_chart":
125 | return this.dashboardArray.push({
126 | cols: 5,
127 | rows: 5,
128 | x: 0,
129 | y: 0,
130 | component: LineChartComponent,
131 | name: "Line Chart"
132 | });
133 | case "doughnut_chart":
134 | return this.dashboardArray.push({
135 | cols: 5,
136 | rows: 5,
137 | x: 0,
138 | y: 0,
139 | component: DoughnutChartComponent,
140 | name: "Doughnut Chart"
141 | });
142 | }
143 | }
144 |
145 | changedOptions() {
146 | this.options.api.optionsChanged();
147 | }
148 |
149 | removeItem(item) {
150 | this.dashboardArray.splice(
151 | this.dashboardArray.indexOf(item),
152 | 1
153 | );
154 | this.itemChange();
155 | }
156 | }
157 |
--------------------------------------------------------------------------------
/src/app/services/dashboard.service.ts:
--------------------------------------------------------------------------------
1 | import { WidgetModel, DashboardModel } from '../../models/dashboard.model';
2 | import { Injectable } from "@angular/core";
3 | import { HttpClient, HttpHeaders } from "@angular/common/http";
4 | import { Observable } from 'rxjs';
5 |
6 | @Injectable({
7 | providedIn: "root"
8 | })
9 | export class DashboardService {
10 | constructor(private _http: HttpClient) {}
11 |
12 | // Return Array of WidgetModel
13 | getWidgets(): Observable> {
14 | return this._http.get>(`http://localhost:3000/widgets`);
15 | }
16 |
17 | // Return Array of DashboardModel
18 | getDashboards(): Observable> {
19 | return this._http.get>('http://localhost:3000/dashboards');
20 | }
21 |
22 | // Return an object
23 | getDashboard(id: number): Observable {
24 | return this._http.get(`http://localhost:3000/dashboards/${id}`);
25 | }
26 |
27 | // Update json
28 | updateDashboard(id: number, params): Observable {
29 | const httpOptions = {
30 | headers: new HttpHeaders({
31 | 'Content-Type': 'application/json'
32 | })
33 | };
34 | return this._http.put(`http://localhost:3000/dashboards/${id}`, params, httpOptions);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nathanagez/angular6-dynamic-dashboard/29c018d660fef92be892f91fe9a7fef310f531d8/src/assets/.gitkeep
--------------------------------------------------------------------------------
/src/browserslist:
--------------------------------------------------------------------------------
1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
2 | # For additional information regarding the format and rule options, please see:
3 | # https://github.com/browserslist/browserslist#queries
4 | # For IE 9-11 support, please uncomment the last line of the file and adjust as needed
5 | > 0.5%
6 | last 2 versions
7 | Firefox ESR
8 | not dead
9 | # IE 9-11
--------------------------------------------------------------------------------
/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // This file can be replaced during build by using the `fileReplacements` array.
2 | // `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`.
3 | // The list of file replacements can be found in `angular.json`.
4 |
5 | export const environment = {
6 | production: false
7 | };
8 |
9 | /*
10 | * In development mode, to ignore zone related error stack frames such as
11 | * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can
12 | * import the following file, but please comment it out in production mode
13 | * because it will have performance impact when throw error
14 | */
15 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI.
16 |
--------------------------------------------------------------------------------
/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nathanagez/angular6-dynamic-dashboard/29c018d660fef92be892f91fe9a7fef310f531d8/src/favicon.ico
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Proto
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/1.0/config/configuration-file.html
3 |
4 | module.exports = function (config) {
5 | config.set({
6 | basePath: '',
7 | frameworks: ['jasmine', '@angular-devkit/build-angular'],
8 | plugins: [
9 | require('karma-jasmine'),
10 | require('karma-chrome-launcher'),
11 | require('karma-jasmine-html-reporter'),
12 | require('karma-coverage-istanbul-reporter'),
13 | require('@angular-devkit/build-angular/plugins/karma')
14 | ],
15 | client: {
16 | clearContext: false // leave Jasmine Spec Runner output visible in browser
17 | },
18 | coverageIstanbulReporter: {
19 | dir: require('path').join(__dirname, '../coverage'),
20 | reports: ['html', 'lcovonly'],
21 | fixWebpackSourcePaths: true
22 | },
23 | reporters: ['progress', 'kjhtml'],
24 | port: 9876,
25 | colors: true,
26 | logLevel: config.LOG_INFO,
27 | autoWatch: true,
28 | browsers: ['Chrome'],
29 | singleRun: false
30 | });
31 | };
--------------------------------------------------------------------------------
/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 |
4 | import { AppModule } from './app/app.module';
5 | import { environment } from './environments/environment';
6 |
7 | if (environment.production) {
8 | enableProdMode();
9 | }
10 |
11 | platformBrowserDynamic().bootstrapModule(AppModule)
12 | .catch(err => console.log(err));
13 |
--------------------------------------------------------------------------------
/src/models/dashboard.model.ts:
--------------------------------------------------------------------------------
1 | export interface WidgetModel {
2 | name: string;
3 | identifier: string;
4 | }
5 |
6 | export interface DashboardContentModel {
7 | cols: number;
8 | rows: number;
9 | y: number;
10 | x: number;
11 | component?: any;
12 | name: string;
13 | }
14 |
15 | export interface DashboardModel {
16 | id: number;
17 | username: string;
18 | dashboard: Array;
19 | }
20 |
21 | export const WidgetsMock: WidgetModel[] = [
22 | {
23 | name: 'Radar Chart',
24 | identifier: 'radar_chart'
25 | },
26 | {
27 | name: 'Doughnut Chart',
28 | identifier: 'doughnut_chart'
29 | },
30 | {
31 | name: 'Line Chart',
32 | identifier: 'line_chart'
33 | }
34 | ]
--------------------------------------------------------------------------------
/src/polyfills.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * This file includes polyfills needed by Angular and is loaded before the app.
3 | * You can add your own extra polyfills to this file.
4 | *
5 | * This file is divided into 2 sections:
6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8 | * file.
9 | *
10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13 | *
14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
15 | */
16 |
17 | /***************************************************************************************************
18 | * BROWSER POLYFILLS
19 | */
20 |
21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/
22 | // import 'core-js/es6/symbol';
23 | // import 'core-js/es6/object';
24 | // import 'core-js/es6/function';
25 | // import 'core-js/es6/parse-int';
26 | // import 'core-js/es6/parse-float';
27 | // import 'core-js/es6/number';
28 | // import 'core-js/es6/math';
29 | // import 'core-js/es6/string';
30 | // import 'core-js/es6/date';
31 | // import 'core-js/es6/array';
32 | // import 'core-js/es6/regexp';
33 | // import 'core-js/es6/map';
34 | // import 'core-js/es6/weak-map';
35 | // import 'core-js/es6/set';
36 |
37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */
38 | // import 'classlist.js'; // Run `npm install --save classlist.js`.
39 |
40 | /** IE10 and IE11 requires the following for the Reflect API. */
41 | // import 'core-js/es6/reflect';
42 |
43 |
44 | /** Evergreen browsers require these. **/
45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
46 | import 'core-js/es7/reflect';
47 |
48 |
49 | /**
50 | * Web Animations `@angular/platform-browser/animations`
51 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
52 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
53 | **/
54 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
55 |
56 | /**
57 | * By default, zone.js will patch all possible macroTask and DomEvents
58 | * user can disable parts of macroTask/DomEvents patch by setting following flags
59 | */
60 |
61 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
62 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
63 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
64 |
65 | /*
66 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
67 | * with the following flag, it will bypass `zone.js` patch for IE/Edge
68 | */
69 | // (window as any).__Zone_enable_cross_context_check = true;
70 |
71 | /***************************************************************************************************
72 | * Zone JS is required by default for Angular itself.
73 | */
74 | import 'zone.js/dist/zone'; // Included with Angular CLI.
75 |
76 |
77 |
78 | /***************************************************************************************************
79 | * APPLICATION IMPORTS
80 | */
81 |
--------------------------------------------------------------------------------
/src/styles.css:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 |
--------------------------------------------------------------------------------
/src/test.ts:
--------------------------------------------------------------------------------
1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2 |
3 | import 'zone.js/dist/zone-testing';
4 | import { getTestBed } from '@angular/core/testing';
5 | import {
6 | BrowserDynamicTestingModule,
7 | platformBrowserDynamicTesting
8 | } from '@angular/platform-browser-dynamic/testing';
9 |
10 | declare const require: any;
11 |
12 | // First, initialize the Angular testing environment.
13 | getTestBed().initTestEnvironment(
14 | BrowserDynamicTestingModule,
15 | platformBrowserDynamicTesting()
16 | );
17 | // Then we find all the tests.
18 | const context = require.context('./', true, /\.spec\.ts$/);
19 | // And load the modules.
20 | context.keys().map(context);
21 |
--------------------------------------------------------------------------------
/src/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "module": "es2015",
6 | "types": []
7 | },
8 | "exclude": [
9 | "src/test.ts",
10 | "**/*.spec.ts"
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/src/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/spec",
5 | "module": "commonjs",
6 | "types": [
7 | "jasmine",
8 | "node"
9 | ]
10 | },
11 | "files": [
12 | "test.ts",
13 | "polyfills.ts"
14 | ],
15 | "include": [
16 | "**/*.spec.ts",
17 | "**/*.d.ts"
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/src/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tslint.json",
3 | "rules": {
4 | "directive-selector": [
5 | true,
6 | "attribute",
7 | "app",
8 | "camelCase"
9 | ],
10 | "component-selector": [
11 | true,
12 | "element",
13 | "app",
14 | "kebab-case"
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "outDir": "./dist/out-tsc",
6 | "sourceMap": true,
7 | "declaration": false,
8 | "moduleResolution": "node",
9 | "emitDecoratorMetadata": true,
10 | "experimentalDecorators": true,
11 | "target": "es5",
12 | "typeRoots": [
13 | "node_modules/@types"
14 | ],
15 | "lib": [
16 | "es2017",
17 | "dom"
18 | ]
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rulesDirectory": [
3 | "node_modules/codelyzer"
4 | ],
5 | "rules": {
6 | "arrow-return-shorthand": true,
7 | "callable-types": true,
8 | "class-name": true,
9 | "comment-format": [
10 | true,
11 | "check-space"
12 | ],
13 | "curly": true,
14 | "deprecation": {
15 | "severity": "warn"
16 | },
17 | "eofline": true,
18 | "forin": true,
19 | "import-blacklist": [
20 | true,
21 | "rxjs/Rx"
22 | ],
23 | "import-spacing": true,
24 | "indent": [
25 | true,
26 | "spaces"
27 | ],
28 | "interface-over-type-literal": true,
29 | "label-position": true,
30 | "max-line-length": [
31 | true,
32 | 140
33 | ],
34 | "member-access": false,
35 | "member-ordering": [
36 | true,
37 | {
38 | "order": [
39 | "static-field",
40 | "instance-field",
41 | "static-method",
42 | "instance-method"
43 | ]
44 | }
45 | ],
46 | "no-arg": true,
47 | "no-bitwise": true,
48 | "no-console": [
49 | true,
50 | "debug",
51 | "info",
52 | "time",
53 | "timeEnd",
54 | "trace"
55 | ],
56 | "no-construct": true,
57 | "no-debugger": true,
58 | "no-duplicate-super": true,
59 | "no-empty": false,
60 | "no-empty-interface": true,
61 | "no-eval": true,
62 | "no-inferrable-types": [
63 | true,
64 | "ignore-params"
65 | ],
66 | "no-misused-new": true,
67 | "no-non-null-assertion": true,
68 | "no-shadowed-variable": true,
69 | "no-string-literal": false,
70 | "no-string-throw": true,
71 | "no-switch-case-fall-through": true,
72 | "no-trailing-whitespace": true,
73 | "no-unnecessary-initializer": true,
74 | "no-unused-expression": true,
75 | "no-use-before-declare": true,
76 | "no-var-keyword": true,
77 | "object-literal-sort-keys": false,
78 | "one-line": [
79 | true,
80 | "check-open-brace",
81 | "check-catch",
82 | "check-else",
83 | "check-whitespace"
84 | ],
85 | "prefer-const": true,
86 | "quotemark": [
87 | true,
88 | "single"
89 | ],
90 | "radix": true,
91 | "semicolon": [
92 | true,
93 | "always"
94 | ],
95 | "triple-equals": [
96 | true,
97 | "allow-null-check"
98 | ],
99 | "typedef-whitespace": [
100 | true,
101 | {
102 | "call-signature": "nospace",
103 | "index-signature": "nospace",
104 | "parameter": "nospace",
105 | "property-declaration": "nospace",
106 | "variable-declaration": "nospace"
107 | }
108 | ],
109 | "unified-signatures": true,
110 | "variable-name": false,
111 | "whitespace": [
112 | true,
113 | "check-branch",
114 | "check-decl",
115 | "check-operator",
116 | "check-separator",
117 | "check-type"
118 | ],
119 | "no-output-on-prefix": true,
120 | "use-input-property-decorator": true,
121 | "use-output-property-decorator": true,
122 | "use-host-property-decorator": true,
123 | "no-input-rename": true,
124 | "no-output-rename": true,
125 | "use-life-cycle-interface": true,
126 | "use-pipe-transform-interface": true,
127 | "component-class-suffix": true,
128 | "directive-class-suffix": true
129 | }
130 | }
131 |
--------------------------------------------------------------------------------