Parcourir la source

tooltips on reserves, fix armory, improve load times

master
peter il y a 5 ans
Parent
révision
6383201e56
100 fichiers modifiés avec 5 ajouts et 6800 suppressions
  1. 3
    12
      src/frontend/src/app/@core/core.module.ts
  2. 0
    32
      src/frontend/src/app/@core/utils/analytics.service.ts
  3. 0
    4
      src/frontend/src/app/@core/utils/index.ts
  4. 0
    66
      src/frontend/src/app/@core/utils/player.service.ts
  5. 1
    4
      src/frontend/src/app/app.component.ts
  6. 1
    1
      src/frontend/src/app/app.module.ts
  7. 0
    85
      src/frontend/src/app/demo_pages/charts/chartjs/chartjs-bar-horizontal.component.ts
  8. 0
    73
      src/frontend/src/app/demo_pages/charts/chartjs/chartjs-bar.component.ts
  9. 0
    81
      src/frontend/src/app/demo_pages/charts/chartjs/chartjs-line.component.ts
  10. 0
    117
      src/frontend/src/app/demo_pages/charts/chartjs/chartjs-multiple-xaxis.component.ts
  11. 0
    56
      src/frontend/src/app/demo_pages/charts/chartjs/chartjs-pie.component.ts
  12. 0
    64
      src/frontend/src/app/demo_pages/charts/chartjs/chartjs-radar.component.ts
  13. 0
    50
      src/frontend/src/app/demo_pages/charts/chartjs/chartjs.component.html
  14. 0
    20
      src/frontend/src/app/demo_pages/charts/chartjs/chartjs.component.scss
  15. 0
    8
      src/frontend/src/app/demo_pages/charts/chartjs/chartjs.component.ts
  16. 0
    35
      src/frontend/src/app/demo_pages/charts/charts-routing.module.ts
  17. 0
    10
      src/frontend/src/app/demo_pages/charts/charts.component.ts
  18. 0
    63
      src/frontend/src/app/demo_pages/charts/charts.module.ts
  19. 0
    43
      src/frontend/src/app/demo_pages/charts/d3/d3-advanced-pie.component.ts
  20. 0
    73
      src/frontend/src/app/demo_pages/charts/d3/d3-area-stack.component.ts
  21. 0
    45
      src/frontend/src/app/demo_pages/charts/d3/d3-bar.component.ts
  22. 0
    84
      src/frontend/src/app/demo_pages/charts/d3/d3-line.component.ts
  23. 0
    38
      src/frontend/src/app/demo_pages/charts/d3/d3-pie.component.ts
  24. 0
    98
      src/frontend/src/app/demo_pages/charts/d3/d3-polar.component.ts
  25. 0
    42
      src/frontend/src/app/demo_pages/charts/d3/d3.component.html
  26. 0
    46
      src/frontend/src/app/demo_pages/charts/d3/d3.component.scss
  27. 0
    8
      src/frontend/src/app/demo_pages/charts/d3/d3.component.ts
  28. 0
    140
      src/frontend/src/app/demo_pages/charts/echarts/echarts-area-stack.component.ts
  29. 0
    103
      src/frontend/src/app/demo_pages/charts/echarts/echarts-bar-animation.component.ts
  30. 0
    92
      src/frontend/src/app/demo_pages/charts/echarts/echarts-bar.component.ts
  31. 0
    106
      src/frontend/src/app/demo_pages/charts/echarts/echarts-line.component.ts
  32. 0
    166
      src/frontend/src/app/demo_pages/charts/echarts/echarts-multiple-xaxis.component.ts
  33. 0
    81
      src/frontend/src/app/demo_pages/charts/echarts/echarts-pie.component.ts
  34. 0
    76
      src/frontend/src/app/demo_pages/charts/echarts/echarts-radar.component.ts
  35. 0
    58
      src/frontend/src/app/demo_pages/charts/echarts/echarts.component.html
  36. 0
    20
      src/frontend/src/app/demo_pages/charts/echarts/echarts.component.scss
  37. 0
    8
      src/frontend/src/app/demo_pages/charts/echarts/echarts.component.ts
  38. 0
    23
      src/frontend/src/app/demo_pages/dashboard/contacts/contacts.component.html
  39. 0
    34
      src/frontend/src/app/demo_pages/dashboard/contacts/contacts.component.scss
  40. 0
    34
      src/frontend/src/app/demo_pages/dashboard/contacts/contacts.component.ts
  41. 0
    42
      src/frontend/src/app/demo_pages/dashboard/dashboard.component.html
  42. 0
    16
      src/frontend/src/app/demo_pages/dashboard/dashboard.component.scss
  43. 0
    99
      src/frontend/src/app/demo_pages/dashboard/dashboard.component.ts
  44. 0
    69
      src/frontend/src/app/demo_pages/dashboard/dashboard.module.ts
  45. 0
    14
      src/frontend/src/app/demo_pages/dashboard/electricity/electricity-chart/electricity-chart.component.scss
  46. 0
    197
      src/frontend/src/app/demo_pages/dashboard/electricity/electricity-chart/electricity-chart.component.ts
  47. 0
    47
      src/frontend/src/app/demo_pages/dashboard/electricity/electricity.component.html
  48. 0
    90
      src/frontend/src/app/demo_pages/dashboard/electricity/electricity.component.scss
  49. 0
    48
      src/frontend/src/app/demo_pages/dashboard/electricity/electricity.component.ts
  50. 0
    25
      src/frontend/src/app/demo_pages/dashboard/kitten/kitten.component.html
  51. 0
    39
      src/frontend/src/app/demo_pages/dashboard/kitten/kitten.component.scss
  52. 0
    23
      src/frontend/src/app/demo_pages/dashboard/kitten/kitten.component.ts
  53. 0
    59
      src/frontend/src/app/demo_pages/dashboard/rooms/player/player.component.html
  54. 0
    283
      src/frontend/src/app/demo_pages/dashboard/rooms/player/player.component.scss
  55. 0
    100
      src/frontend/src/app/demo_pages/dashboard/rooms/player/player.component.ts
  56. 0
    90
      src/frontend/src/app/demo_pages/dashboard/rooms/room-selector/room-selector.component.html
  57. 0
    76
      src/frontend/src/app/demo_pages/dashboard/rooms/room-selector/room-selector.component.scss
  58. 0
    122
      src/frontend/src/app/demo_pages/dashboard/rooms/room-selector/room-selector.component.ts
  59. 0
    67
      src/frontend/src/app/demo_pages/dashboard/rooms/rooms.component.scss
  60. 0
    77
      src/frontend/src/app/demo_pages/dashboard/rooms/rooms.component.ts
  61. 0
    61
      src/frontend/src/app/demo_pages/dashboard/security-cameras/security-cameras.component.html
  62. 0
    114
      src/frontend/src/app/demo_pages/dashboard/security-cameras/security-cameras.component.scss
  63. 0
    53
      src/frontend/src/app/demo_pages/dashboard/security-cameras/security-cameras.component.ts
  64. 0
    30
      src/frontend/src/app/demo_pages/dashboard/solar/solar.component.scss
  65. 0
    186
      src/frontend/src/app/demo_pages/dashboard/solar/solar.component.ts
  66. 0
    79
      src/frontend/src/app/demo_pages/dashboard/status-card/status-card.component.scss
  67. 0
    26
      src/frontend/src/app/demo_pages/dashboard/status-card/status-card.component.ts
  68. 0
    47
      src/frontend/src/app/demo_pages/dashboard/temperature/temperature-dragger/temperature-dragger.component.html
  69. 0
    63
      src/frontend/src/app/demo_pages/dashboard/temperature/temperature-dragger/temperature-dragger.component.scss
  70. 0
    380
      src/frontend/src/app/demo_pages/dashboard/temperature/temperature-dragger/temperature-dragger.component.ts
  71. 0
    69
      src/frontend/src/app/demo_pages/dashboard/temperature/temperature.component.html
  72. 0
    121
      src/frontend/src/app/demo_pages/dashboard/temperature/temperature.component.scss
  73. 0
    53
      src/frontend/src/app/demo_pages/dashboard/temperature/temperature.component.ts
  74. 0
    174
      src/frontend/src/app/demo_pages/dashboard/traffic/traffic-chart.component.ts
  75. 0
    35
      src/frontend/src/app/demo_pages/dashboard/traffic/traffic.component.scss
  76. 0
    51
      src/frontend/src/app/demo_pages/dashboard/traffic/traffic.component.ts
  77. 0
    53
      src/frontend/src/app/demo_pages/dashboard/weather/weather.component.html
  78. 0
    76
      src/frontend/src/app/demo_pages/dashboard/weather/weather.component.scss
  79. 0
    10
      src/frontend/src/app/demo_pages/dashboard/weather/weather.component.ts
  80. 0
    7
      src/frontend/src/app/demo_pages/e-commerce/charts-panel/chart-panel-header/chart-panel-header.component.html
  81. 0
    25
      src/frontend/src/app/demo_pages/e-commerce/charts-panel/chart-panel-header/chart-panel-header.component.scss
  82. 0
    69
      src/frontend/src/app/demo_pages/e-commerce/charts-panel/chart-panel-header/chart-panel-header.component.ts
  83. 0
    15
      src/frontend/src/app/demo_pages/e-commerce/charts-panel/chart-panel-summary/chart-panel-summary.component.scss
  84. 0
    18
      src/frontend/src/app/demo_pages/e-commerce/charts-panel/chart-panel-summary/chart-panel-summary.component.ts
  85. 0
    22
      src/frontend/src/app/demo_pages/e-commerce/charts-panel/charts-panel.component.html
  86. 0
    41
      src/frontend/src/app/demo_pages/e-commerce/charts-panel/charts-panel.component.scss
  87. 0
    74
      src/frontend/src/app/demo_pages/e-commerce/charts-panel/charts-panel.component.ts
  88. 0
    11
      src/frontend/src/app/demo_pages/e-commerce/charts-panel/charts/charts-common.component.scss
  89. 0
    307
      src/frontend/src/app/demo_pages/e-commerce/charts-panel/charts/orders-chart.component.ts
  90. 0
    200
      src/frontend/src/app/demo_pages/e-commerce/charts-panel/charts/profit-chart.component.ts
  91. 0
    23
      src/frontend/src/app/demo_pages/e-commerce/country-orders/chart/country-orders-chart.component.scss
  92. 0
    181
      src/frontend/src/app/demo_pages/e-commerce/country-orders/chart/country-orders-chart.component.ts
  93. 0
    18
      src/frontend/src/app/demo_pages/e-commerce/country-orders/country-orders.component.scss
  94. 0
    64
      src/frontend/src/app/demo_pages/e-commerce/country-orders/country-orders.component.ts
  95. 0
    57
      src/frontend/src/app/demo_pages/e-commerce/country-orders/map/country-orders-map.component.scss
  96. 0
    144
      src/frontend/src/app/demo_pages/e-commerce/country-orders/map/country-orders-map.component.ts
  97. 0
    15
      src/frontend/src/app/demo_pages/e-commerce/country-orders/map/country-orders-map.service.ts
  98. 0
    38
      src/frontend/src/app/demo_pages/e-commerce/e-commerce.component.html
  99. 0
    8
      src/frontend/src/app/demo_pages/e-commerce/e-commerce.component.ts
  100. 0
    0
      src/frontend/src/app/demo_pages/e-commerce/e-commerce.module.ts

+ 3
- 12
src/frontend/src/app/@core/core.module.ts Voir le fichier

@@ -1,15 +1,10 @@
1 1
 import { ModuleWithProviders, NgModule, Optional, SkipSelf, APP_INITIALIZER } from '@angular/core';
2 2
 import { CommonModule } from '@angular/common';
3 3
 import { throwIfAlreadyLoaded } from './module-import-guard';
4
-import { CookieService } from 'ngx-cookie-service';
5 4
 
6
-import {
7
-  AnalyticsService,
8
-  LayoutService,
9
-  PlayerService,
10
-  StateService,
11
-} from './utils';
12 5
 import { ApiService, initializeLoginSvc } from '../frontcraft/services/login-api';
6
+import { CookieService } from 'ngx-cookie-service';
7
+import { LayoutService } from './utils';
13 8
 
14 9
 const DATA_SERVICES = [  
15 10
   {provide: ApiService, useClass: ApiService},
@@ -24,12 +19,8 @@ const DATA_SERVICES = [
24 19
 
25 20
 export const NB_CORE_PROVIDERS = [
26 21
   ...DATA_SERVICES,
27
-
28
-  AnalyticsService,
29
-  LayoutService,
30
-  PlayerService,
31
-  StateService,
32 22
   CookieService,
23
+  LayoutService
33 24
 ];
34 25
 
35 26
 @NgModule({

+ 0
- 32
src/frontend/src/app/@core/utils/analytics.service.ts Voir le fichier

@@ -1,32 +0,0 @@
1
-import { Injectable } from '@angular/core';
2
-import { NavigationEnd, Router } from '@angular/router';
3
-import { Location } from '@angular/common';
4
-import { filter } from 'rxjs/operators';
5
-
6
-declare const ga: any;
7
-
8
-@Injectable()
9
-export class AnalyticsService {
10
-  private enabled: boolean;
11
-
12
-  constructor(private location: Location, private router: Router) {
13
-    this.enabled = false;
14
-  }
15
-
16
-  trackPageViews() {
17
-    if (this.enabled) {
18
-      this.router.events.pipe(
19
-        filter((event) => event instanceof NavigationEnd),
20
-      )
21
-        .subscribe(() => {
22
-          ga('send', {hitType: 'pageview', page: this.location.path()});
23
-        });
24
-    }
25
-  }
26
-
27
-  trackEvent(eventName: string) {
28
-    if (this.enabled) {
29
-      ga('send', 'event', eventName);
30
-    }
31
-  }
32
-}

+ 0
- 4
src/frontend/src/app/@core/utils/index.ts Voir le fichier

@@ -1,11 +1,7 @@
1 1
 import { LayoutService } from './layout.service';
2
-import { AnalyticsService } from './analytics.service';
3
-import { PlayerService } from './player.service';
4 2
 import { StateService } from './state.service';
5 3
 
6 4
 export {
7 5
   LayoutService,
8
-  AnalyticsService,
9
-  PlayerService,
10 6
   StateService,
11 7
 };

+ 0
- 66
src/frontend/src/app/@core/utils/player.service.ts Voir le fichier

@@ -1,66 +0,0 @@
1
-import { Injectable } from '@angular/core';
2
-
3
-export class Track {
4
-  name: string;
5
-  artist: string;
6
-  url: string;
7
-  cover: string;
8
-}
9
-
10
-@Injectable()
11
-export class PlayerService {
12
-  current: number;
13
-  playlist: Track[] = [
14
-    {
15
-      name: 'Don\'t Wanna Fight',
16
-      artist: 'Alabama Shakes',
17
-      url: 'https://p.scdn.co/mp3-preview/6156cdbca425a894972c02fca9d76c0b70e001af',
18
-      cover: 'assets/images/cover1.jpg',
19
-    },
20
-    {
21
-      name: 'Harder',
22
-      artist: 'Daft Punk',
23
-      url: 'https://p.scdn.co/mp3-preview/92a04c7c0e96bf93a1b1b1cae7dfff1921969a7b',
24
-      cover: 'assets/images/cover2.jpg',
25
-    },
26
-    {
27
-      name: 'Come Together',
28
-      artist: 'Beatles',
29
-      url: 'https://p.scdn.co/mp3-preview/83090a4db6899eaca689ae35f69126dbe65d94c9',
30
-      cover: 'assets/images/cover3.jpg',
31
-    },
32
-  ];
33
-
34
-  random(): Track {
35
-    this.current = Math.floor(Math.random() * this.playlist.length);
36
-    return this.playlist[this.current];
37
-  }
38
-
39
-  next(): Track {
40
-    return this.getNextTrack();
41
-  }
42
-
43
-  prev() {
44
-    return this.getPrevTrack();
45
-  }
46
-
47
-  private getNextTrack(): Track {
48
-    if (this.current === this.playlist.length - 1) {
49
-      this.current = 0;
50
-    } else {
51
-      this.current++;
52
-    }
53
-
54
-    return this.playlist[this.current];
55
-  }
56
-
57
-  private getPrevTrack(): Track {
58
-    if (this.current === 0) {
59
-      this.current = this.playlist.length - 1;
60
-    } else {
61
-      this.current--;
62
-    }
63
-
64
-    return this.playlist[this.current];
65
-  }
66
-}

+ 1
- 4
src/frontend/src/app/app.component.ts Voir le fichier

@@ -4,7 +4,6 @@
4 4
  * Licensed under the MIT License. See License.txt in the project root for license information.
5 5
  */
6 6
 import { Component, OnInit } from '@angular/core';
7
-import { AnalyticsService } from './@core/utils/analytics.service';
8 7
 import { ApiService } from './frontcraft/services/login-api';
9 8
 
10 9
 @Component({
@@ -13,13 +12,11 @@ import { ApiService } from './frontcraft/services/login-api';
13 12
 })
14 13
 export class AppComponent implements OnInit {
15 14
 
16
-  constructor(private loginSvc: ApiService, private analytics: AnalyticsService) {
15
+  constructor(private loginSvc: ApiService) {
17 16
     
18 17
   }
19 18
 
20 19
   ngOnInit(): void {
21
-    this.analytics.trackPageViews();
22
- 
23 20
     window['s'] = this.loginSvc
24 21
   }
25 22
 }

+ 1
- 1
src/frontend/src/app/app.module.ts Voir le fichier

@@ -7,7 +7,6 @@ import { BrowserModule } from '@angular/platform-browser';
7 7
 import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
8 8
 import { NgModule, APP_INITIALIZER } from '@angular/core';
9 9
 import { HttpClientModule } from '@angular/common/http';
10
-import { CoreModule } from './@core/core.module';
11 10
 import { ThemeModule } from './@theme/theme.module';
12 11
 import { AppComponent } from './app.component';
13 12
 import { AppRoutingModule } from './app-routing.module';
@@ -22,6 +21,7 @@ import {
22 21
 } from '@nebular/theme';
23 22
 import { ApiService, initializeLoginSvc } from './frontcraft/services/login-api';
24 23
 import { CookieService } from 'ngx-cookie-service';
24
+import { CoreModule } from './@core/core.module';
25 25
 
26 26
 @NgModule({
27 27
   declarations: [AppComponent],

+ 0
- 85
src/frontend/src/app/demo_pages/charts/chartjs/chartjs-bar-horizontal.component.ts Voir le fichier

@@ -1,85 +0,0 @@
1
-import { Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-
4
-@Component({
5
-  selector: 'ngx-chartjs-bar-horizontal',
6
-  template: `
7
-    <chart type="horizontalBar" [data]="data" [options]="options"></chart>
8
-  `,
9
-})
10
-export class ChartjsBarHorizontalComponent implements OnDestroy {
11
-  data: any;
12
-  options: any;
13
-  themeSubscription: any;
14
-
15
-  constructor(private theme: NbThemeService) {
16
-    this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
17
-
18
-      const colors: any = config.variables;
19
-      const chartjs: any = config.variables.chartjs;
20
-
21
-      this.data = {
22
-        labels: ['January', 'February', 'March', 'April', 'May', 'June'],
23
-        datasets: [{
24
-            label: 'Dataset 1',
25
-            backgroundColor: colors.infoLight,
26
-            borderWidth: 1,
27
-            data: [this.random(), this.random(), this.random(), this.random(), this.random(), this.random()],
28
-          }, {
29
-            label: 'Dataset 2',
30
-            backgroundColor: colors.successLight,
31
-            data: [this.random(), this.random(), this.random(), this.random(), this.random(), this.random()],
32
-          },
33
-        ],
34
-      };
35
-
36
-      this.options = {
37
-        responsive: true,
38
-        maintainAspectRatio: false,
39
-        elements: {
40
-          rectangle: {
41
-            borderWidth: 2,
42
-          },
43
-        },
44
-        scales: {
45
-          xAxes: [
46
-            {
47
-              gridLines: {
48
-                display: true,
49
-                color: chartjs.axisLineColor,
50
-              },
51
-              ticks: {
52
-                fontColor: chartjs.textColor,
53
-              },
54
-            },
55
-          ],
56
-          yAxes: [
57
-            {
58
-              gridLines: {
59
-                display: false,
60
-                color: chartjs.axisLineColor,
61
-              },
62
-              ticks: {
63
-                fontColor: chartjs.textColor,
64
-              },
65
-            },
66
-          ],
67
-        },
68
-        legend: {
69
-          position: 'right',
70
-          labels: {
71
-            fontColor: chartjs.textColor,
72
-          },
73
-        },
74
-      };
75
-    });
76
-  }
77
-
78
-  ngOnDestroy(): void {
79
-    this.themeSubscription.unsubscribe();
80
-  }
81
-
82
-  private random() {
83
-    return Math.round(Math.random() * 100);
84
-  }
85
-}

+ 0
- 73
src/frontend/src/app/demo_pages/charts/chartjs/chartjs-bar.component.ts Voir le fichier

@@ -1,73 +0,0 @@
1
-import { Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService, NbColorHelper } from '@nebular/theme';
3
-
4
-@Component({
5
-  selector: 'ngx-chartjs-bar',
6
-  template: `
7
-    <chart type="bar" [data]="data" [options]="options"></chart>
8
-  `,
9
-})
10
-export class ChartjsBarComponent implements OnDestroy {
11
-  data: any;
12
-  options: any;
13
-  themeSubscription: any;
14
-
15
-  constructor(private theme: NbThemeService) {
16
-    this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
17
-
18
-      const colors: any = config.variables;
19
-      const chartjs: any = config.variables.chartjs;
20
-
21
-      this.data = {
22
-        labels: ['2006', '2007', '2008', '2009', '2010', '2011', '2012'],
23
-        datasets: [{
24
-          data: [65, 59, 80, 81, 56, 55, 40],
25
-          label: 'Series A',
26
-          backgroundColor: NbColorHelper.hexToRgbA(colors.primaryLight, 0.8),
27
-        }, {
28
-          data: [28, 48, 40, 19, 86, 27, 90],
29
-          label: 'Series B',
30
-          backgroundColor: NbColorHelper.hexToRgbA(colors.infoLight, 0.8),
31
-        }],
32
-      };
33
-
34
-      this.options = {
35
-        maintainAspectRatio: false,
36
-        responsive: true,
37
-        legend: {
38
-          labels: {
39
-            fontColor: chartjs.textColor,
40
-          },
41
-        },
42
-        scales: {
43
-          xAxes: [
44
-            {
45
-              gridLines: {
46
-                display: false,
47
-                color: chartjs.axisLineColor,
48
-              },
49
-              ticks: {
50
-                fontColor: chartjs.textColor,
51
-              },
52
-            },
53
-          ],
54
-          yAxes: [
55
-            {
56
-              gridLines: {
57
-                display: true,
58
-                color: chartjs.axisLineColor,
59
-              },
60
-              ticks: {
61
-                fontColor: chartjs.textColor,
62
-              },
63
-            },
64
-          ],
65
-        },
66
-      };
67
-    });
68
-  }
69
-
70
-  ngOnDestroy(): void {
71
-    this.themeSubscription.unsubscribe();
72
-  }
73
-}

+ 0
- 81
src/frontend/src/app/demo_pages/charts/chartjs/chartjs-line.component.ts Voir le fichier

@@ -1,81 +0,0 @@
1
-import { Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService, NbColorHelper } from '@nebular/theme';
3
-
4
-@Component({
5
-  selector: 'ngx-chartjs-line',
6
-  template: `
7
-    <chart type="line" [data]="data" [options]="options"></chart>
8
-  `,
9
-})
10
-export class ChartjsLineComponent implements OnDestroy {
11
-  data: any;
12
-  options: any;
13
-  themeSubscription: any;
14
-
15
-  constructor(private theme: NbThemeService) {
16
-    this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
17
-
18
-      const colors: any = config.variables;
19
-      const chartjs: any = config.variables.chartjs;
20
-
21
-      this.data = {
22
-        labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
23
-        datasets: [{
24
-          data: [65, 59, 80, 81, 56, 55, 40],
25
-          label: 'Series A',
26
-          backgroundColor: NbColorHelper.hexToRgbA(colors.primary, 0.3),
27
-          borderColor: colors.primary,
28
-        }, {
29
-          data: [28, 48, 40, 19, 86, 27, 90],
30
-          label: 'Series B',
31
-          backgroundColor: NbColorHelper.hexToRgbA(colors.danger, 0.3),
32
-          borderColor: colors.danger,
33
-        }, {
34
-          data: [18, 48, 77, 9, 100, 27, 40],
35
-          label: 'Series C',
36
-          backgroundColor: NbColorHelper.hexToRgbA(colors.info, 0.3),
37
-          borderColor: colors.info,
38
-        },
39
-        ],
40
-      };
41
-
42
-      this.options = {
43
-        responsive: true,
44
-        maintainAspectRatio: false,
45
-        scales: {
46
-          xAxes: [
47
-            {
48
-              gridLines: {
49
-                display: true,
50
-                color: chartjs.axisLineColor,
51
-              },
52
-              ticks: {
53
-                fontColor: chartjs.textColor,
54
-              },
55
-            },
56
-          ],
57
-          yAxes: [
58
-            {
59
-              gridLines: {
60
-                display: true,
61
-                color: chartjs.axisLineColor,
62
-              },
63
-              ticks: {
64
-                fontColor: chartjs.textColor,
65
-              },
66
-            },
67
-          ],
68
-        },
69
-        legend: {
70
-          labels: {
71
-            fontColor: chartjs.textColor,
72
-          },
73
-        },
74
-      };
75
-    });
76
-  }
77
-
78
-  ngOnDestroy(): void {
79
-    this.themeSubscription.unsubscribe();
80
-  }
81
-}

+ 0
- 117
src/frontend/src/app/demo_pages/charts/chartjs/chartjs-multiple-xaxis.component.ts Voir le fichier

@@ -1,117 +0,0 @@
1
-import { Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-
4
-@Component({
5
-  selector: 'ngx-chartjs-multiple-xaxis',
6
-  template: `
7
-    <chart type="line" [data]="data" [options]="options"></chart>
8
-  `,
9
-})
10
-export class ChartjsMultipleXaxisComponent implements OnDestroy {
11
-  data: {};
12
-  options: any;
13
-  themeSubscription: any;
14
-
15
-  constructor(private theme: NbThemeService) {
16
-    this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
17
-
18
-      const colors: any = config.variables;
19
-      const chartjs: any = config.variables.chartjs;
20
-
21
-      this.data = {
22
-        labels: ['January', 'February', 'March', 'April', 'May', 'June'],
23
-        datasets: [{
24
-          label: 'dataset - big points',
25
-          data: [this.random(), this.random(), this.random(), this.random(), this.random(), this.random()],
26
-          borderColor: colors.primary,
27
-          backgroundColor: colors.primary,
28
-          fill: false,
29
-          borderDash: [5, 5],
30
-          pointRadius: 8,
31
-          pointHoverRadius: 10,
32
-        }, {
33
-          label: 'dataset - individual point sizes',
34
-          data: [this.random(), this.random(), this.random(), this.random(), this.random(), this.random()],
35
-          borderColor: colors.dangerLight,
36
-          backgroundColor: colors.dangerLight,
37
-          fill: false,
38
-          borderDash: [5, 5],
39
-          pointRadius: 8,
40
-          pointHoverRadius: 10,
41
-        }, {
42
-          label: 'dataset - large pointHoverRadius',
43
-          data: [this.random(), this.random(), this.random(), this.random(), this.random(), this.random()],
44
-          borderColor: colors.info,
45
-          backgroundColor: colors.info,
46
-          fill: false,
47
-          pointRadius: 8,
48
-          pointHoverRadius: 10,
49
-        }, {
50
-          label: 'dataset - large pointHitRadius',
51
-          data: [this.random(), this.random(), this.random(), this.random(), this.random(), this.random()],
52
-          borderColor: colors.success,
53
-          backgroundColor: colors.success,
54
-          fill: false,
55
-          pointRadius: 8,
56
-          pointHoverRadius: 10,
57
-        }],
58
-      };
59
-
60
-      this.options = {
61
-        responsive: true,
62
-        maintainAspectRatio: false,
63
-        legend: {
64
-          position: 'bottom',
65
-          labels: {
66
-            fontColor: chartjs.textColor,
67
-          },
68
-        },
69
-        hover: {
70
-          mode: 'index',
71
-        },
72
-        scales: {
73
-          xAxes: [
74
-            {
75
-              display: true,
76
-              scaleLabel: {
77
-                display: true,
78
-                labelString: 'Month',
79
-              },
80
-              gridLines: {
81
-                display: true,
82
-                color: chartjs.axisLineColor,
83
-              },
84
-              ticks: {
85
-                fontColor: chartjs.textColor,
86
-              },
87
-            },
88
-          ],
89
-          yAxes: [
90
-            {
91
-              display: true,
92
-              scaleLabel: {
93
-                display: true,
94
-                labelString: 'Value',
95
-              },
96
-              gridLines: {
97
-                display: true,
98
-                color: chartjs.axisLineColor,
99
-              },
100
-              ticks: {
101
-                fontColor: chartjs.textColor,
102
-              },
103
-            },
104
-          ],
105
-        },
106
-      };
107
-    });
108
-  }
109
-
110
-  ngOnDestroy(): void {
111
-    this.themeSubscription.unsubscribe();
112
-  }
113
-
114
-  private random() {
115
-    return Math.round(Math.random() * 100);
116
-  }
117
-}

+ 0
- 56
src/frontend/src/app/demo_pages/charts/chartjs/chartjs-pie.component.ts Voir le fichier

@@ -1,56 +0,0 @@
1
-import { Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-
4
-@Component({
5
-  selector: 'ngx-chartjs-pie',
6
-  template: `
7
-    <chart type="pie" [data]="data" [options]="options"></chart>
8
-  `,
9
-})
10
-export class ChartjsPieComponent implements OnDestroy {
11
-  data: any;
12
-  options: any;
13
-  themeSubscription: any;
14
-
15
-  constructor(private theme: NbThemeService) {
16
-    this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
17
-
18
-      const colors: any = config.variables;
19
-      const chartjs: any = config.variables.chartjs;
20
-
21
-      this.data = {
22
-        labels: ['Download Sales', 'In-Store Sales', 'Mail Sales'],
23
-        datasets: [{
24
-          data: [300, 500, 100],
25
-          backgroundColor: [colors.primaryLight, colors.infoLight, colors.successLight],
26
-        }],
27
-      };
28
-
29
-      this.options = {
30
-        maintainAspectRatio: false,
31
-        responsive: true,
32
-        scales: {
33
-          xAxes: [
34
-            {
35
-              display: false,
36
-            },
37
-          ],
38
-          yAxes: [
39
-            {
40
-              display: false,
41
-            },
42
-          ],
43
-        },
44
-        legend: {
45
-          labels: {
46
-            fontColor: chartjs.textColor,
47
-          },
48
-        },
49
-      };
50
-    });
51
-  }
52
-
53
-  ngOnDestroy(): void {
54
-    this.themeSubscription.unsubscribe();
55
-  }
56
-}

+ 0
- 64
src/frontend/src/app/demo_pages/charts/chartjs/chartjs-radar.component.ts Voir le fichier

@@ -1,64 +0,0 @@
1
-import { Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService, NbColorHelper } from '@nebular/theme';
3
-
4
-@Component({
5
-  selector: 'ngx-chartjs-radar',
6
-  template: `
7
-    <chart type="radar" [data]="data" [options]="options"></chart>
8
-  `,
9
-})
10
-export class ChartjsRadarComponent implements OnDestroy {
11
-  options: any;
12
-  data: {};
13
-  themeSubscription: any;
14
-
15
-  constructor(private theme: NbThemeService) {
16
-    this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
17
-
18
-      const colors: any = config.variables;
19
-      const chartjs: any = config.variables.chartjs;
20
-
21
-      this.data = {
22
-        labels: ['Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running'],
23
-        datasets: [{
24
-          data: [65, 59, 90, 81, 56, 55, 40],
25
-          label: 'Series A',
26
-          borderColor: colors.danger,
27
-          backgroundColor: NbColorHelper.hexToRgbA(colors.dangerLight, 0.5),
28
-        }, {
29
-          data: [28, 48, 40, 19, 96, 27, 100],
30
-          label: 'Series B',
31
-          borderColor: colors.warning,
32
-          backgroundColor: NbColorHelper.hexToRgbA(colors.warningLight, 0.5),
33
-        }],
34
-      };
35
-
36
-      this.options = {
37
-        responsive: true,
38
-        maintainAspectRatio: false,
39
-        scaleFontColor: 'white',
40
-        legend: {
41
-          labels: {
42
-            fontColor: chartjs.textColor,
43
-          },
44
-        },
45
-        scale: {
46
-          pointLabels: {
47
-            fontSize: 14,
48
-            fontColor: chartjs.textColor,
49
-          },
50
-          gridLines: {
51
-            color: chartjs.axisLineColor,
52
-          },
53
-          angleLines: {
54
-            color: chartjs.axisLineColor,
55
-          },
56
-        },
57
-      };
58
-    });
59
-  }
60
-
61
-  ngOnDestroy(): void {
62
-    this.themeSubscription.unsubscribe();
63
-  }
64
-}

+ 0
- 50
src/frontend/src/app/demo_pages/charts/chartjs/chartjs.component.html Voir le fichier

@@ -1,50 +0,0 @@
1
-<div class="row">
2
-  <div class="col-lg-6">
3
-    <nb-card>
4
-      <nb-card-header>Pie</nb-card-header>
5
-      <nb-card-body>
6
-        <ngx-chartjs-pie></ngx-chartjs-pie>
7
-      </nb-card-body>
8
-    </nb-card>
9
-  </div>
10
-  <div class="col-lg-6">
11
-    <nb-card>
12
-      <nb-card-header>Bar</nb-card-header>
13
-      <nb-card-body>
14
-        <ngx-chartjs-bar></ngx-chartjs-bar>
15
-      </nb-card-body>
16
-    </nb-card>
17
-  </div>
18
-  <div class="col-lg-6">
19
-    <nb-card>
20
-      <nb-card-header>Line</nb-card-header>
21
-      <nb-card-body>
22
-        <ngx-chartjs-line></ngx-chartjs-line>
23
-      </nb-card-body>
24
-    </nb-card>
25
-  </div>
26
-  <div class="col-lg-6">
27
-    <nb-card>
28
-      <nb-card-header>Multiple x-axis</nb-card-header>
29
-      <nb-card-body>
30
-        <ngx-chartjs-multiple-xaxis></ngx-chartjs-multiple-xaxis>
31
-      </nb-card-body>
32
-    </nb-card>
33
-  </div>
34
-  <div class="col-lg-6">
35
-    <nb-card>
36
-      <nb-card-header>Bar Horizontal</nb-card-header>
37
-      <nb-card-body>
38
-        <ngx-chartjs-bar-horizontal></ngx-chartjs-bar-horizontal>
39
-      </nb-card-body>
40
-    </nb-card>
41
-  </div>
42
-  <div class="col-lg-6">
43
-    <nb-card>
44
-      <nb-card-header>Radar</nb-card-header>
45
-      <nb-card-body>
46
-        <ngx-chartjs-radar></ngx-chartjs-radar>
47
-      </nb-card-body>
48
-    </nb-card>
49
-  </div>
50
-</div>

+ 0
- 20
src/frontend/src/app/demo_pages/charts/chartjs/chartjs.component.scss Voir le fichier

@@ -1,20 +0,0 @@
1
-@import '../../../@theme/styles/themes';
2
-
3
-@include nb-install-component() {
4
-  ngx-chartjs-pie,
5
-  ngx-chartjs-bar,
6
-  ngx-chartjs-line,
7
-  ngx-chartjs-multiple-xaxis,
8
-  ngx-chartjs-bar-horizontal,
9
-  ngx-chartjs-radar {
10
-    display: block;
11
-    height: nb-theme(card-height-medium);
12
-    width: 100%;
13
-
14
-    ::ng-deep chart {
15
-      display: block;
16
-      height: 100%;
17
-      width: 100%;
18
-    }
19
-  }
20
-}

+ 0
- 8
src/frontend/src/app/demo_pages/charts/chartjs/chartjs.component.ts Voir le fichier

@@ -1,8 +0,0 @@
1
-import { Component } from '@angular/core';
2
-
3
-@Component({
4
-  selector: 'ngx-chartjs',
5
-  styleUrls: ['./chartjs.component.scss'],
6
-  templateUrl: './chartjs.component.html',
7
-})
8
-export class ChartjsComponent {}

+ 0
- 35
src/frontend/src/app/demo_pages/charts/charts-routing.module.ts Voir le fichier

@@ -1,35 +0,0 @@
1
-import { NgModule } from '@angular/core';
2
-import { Routes, RouterModule } from '@angular/router';
3
-
4
-import { ChartsComponent } from './charts.component';
5
-import { EchartsComponent } from './echarts/echarts.component';
6
-import { D3Component } from './d3/d3.component';
7
-import { ChartjsComponent } from './chartjs/chartjs.component';
8
-
9
-const routes: Routes = [{
10
-  path: '',
11
-  component: ChartsComponent,
12
-  children: [{
13
-    path: 'echarts',
14
-    component: EchartsComponent,
15
-  }, {
16
-    path: 'd3',
17
-    component: D3Component,
18
-  }, {
19
-    path: 'chartjs',
20
-    component: ChartjsComponent,
21
-  }],
22
-}];
23
-
24
-@NgModule({
25
-  imports: [RouterModule.forChild(routes)],
26
-  exports: [RouterModule],
27
-})
28
-export class ChartsRoutingModule { }
29
-
30
-export const routedComponents = [
31
-  ChartsComponent,
32
-  EchartsComponent,
33
-  D3Component,
34
-  ChartjsComponent,
35
-];

+ 0
- 10
src/frontend/src/app/demo_pages/charts/charts.component.ts Voir le fichier

@@ -1,10 +0,0 @@
1
-import { Component } from '@angular/core';
2
-
3
-@Component({
4
-  selector: 'ngx-charts',
5
-  template: `
6
-    <router-outlet></router-outlet>
7
-  `,
8
-})
9
-export class ChartsComponent {
10
-}

+ 0
- 63
src/frontend/src/app/demo_pages/charts/charts.module.ts Voir le fichier

@@ -1,63 +0,0 @@
1
-import { NgModule } from '@angular/core';
2
-import { NgxEchartsModule } from 'ngx-echarts';
3
-import { NgxChartsModule } from '@swimlane/ngx-charts';
4
-import { ChartModule } from 'angular2-chartjs';
5
-import { NbCardModule } from '@nebular/theme';
6
-
7
-import { ThemeModule } from '../../@theme/theme.module';
8
-
9
-import { ChartsRoutingModule, routedComponents } from './charts-routing.module';
10
-import { ChartjsBarComponent } from './chartjs/chartjs-bar.component';
11
-import { ChartjsLineComponent } from './chartjs/chartjs-line.component';
12
-import { ChartjsPieComponent } from './chartjs/chartjs-pie.component';
13
-import { ChartjsMultipleXaxisComponent } from './chartjs/chartjs-multiple-xaxis.component';
14
-import { ChartjsBarHorizontalComponent } from './chartjs/chartjs-bar-horizontal.component';
15
-import { ChartjsRadarComponent } from './chartjs/chartjs-radar.component';
16
-import { D3BarComponent } from './d3/d3-bar.component';
17
-import { D3LineComponent } from './d3/d3-line.component';
18
-import { D3PieComponent } from './d3/d3-pie.component';
19
-import { D3AreaStackComponent } from './d3/d3-area-stack.component';
20
-import { D3PolarComponent } from './d3/d3-polar.component';
21
-import { D3AdvancedPieComponent } from './d3/d3-advanced-pie.component';
22
-import { EchartsLineComponent } from './echarts/echarts-line.component';
23
-import { EchartsPieComponent } from './echarts/echarts-pie.component';
24
-import { EchartsBarComponent } from './echarts/echarts-bar.component';
25
-import { EchartsMultipleXaxisComponent } from './echarts/echarts-multiple-xaxis.component';
26
-import { EchartsAreaStackComponent } from './echarts/echarts-area-stack.component';
27
-import { EchartsBarAnimationComponent } from './echarts/echarts-bar-animation.component';
28
-import { EchartsRadarComponent } from './echarts/echarts-radar.component';
29
-
30
-const components = [
31
-  ChartjsBarComponent,
32
-  ChartjsLineComponent,
33
-  ChartjsPieComponent,
34
-  ChartjsMultipleXaxisComponent,
35
-  ChartjsBarHorizontalComponent,
36
-  ChartjsRadarComponent,
37
-  D3BarComponent,
38
-  D3LineComponent,
39
-  D3PieComponent,
40
-  D3AreaStackComponent,
41
-  D3PolarComponent,
42
-  D3AdvancedPieComponent,
43
-  EchartsLineComponent,
44
-  EchartsPieComponent,
45
-  EchartsBarComponent,
46
-  EchartsMultipleXaxisComponent,
47
-  EchartsAreaStackComponent,
48
-  EchartsBarAnimationComponent,
49
-  EchartsRadarComponent,
50
-];
51
-
52
-@NgModule({
53
-  imports: [
54
-    ThemeModule,
55
-    ChartsRoutingModule,
56
-    NgxEchartsModule,
57
-    NgxChartsModule,
58
-    ChartModule,
59
-    NbCardModule,
60
-  ],
61
-  declarations: [...routedComponents, ...components],
62
-})
63
-export class ChartsModule {}

+ 0
- 43
src/frontend/src/app/demo_pages/charts/d3/d3-advanced-pie.component.ts Voir le fichier

@@ -1,43 +0,0 @@
1
-import { Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-
4
-@Component({
5
-  selector: 'ngx-d3-advanced-pie',
6
-  template: `
7
-    <ngx-charts-advanced-pie-chart
8
-      [scheme]="colorScheme"
9
-      [results]="single">
10
-    </ngx-charts-advanced-pie-chart>
11
-  `,
12
-})
13
-export class D3AdvancedPieComponent implements OnDestroy {
14
-  single = [
15
-    {
16
-      name: 'Germany',
17
-      value: 8940000,
18
-    },
19
-    {
20
-      name: 'USA',
21
-      value: 5000000,
22
-    },
23
-    {
24
-      name: 'France',
25
-      value: 7200000,
26
-    },
27
-  ];
28
-  colorScheme: any;
29
-  themeSubscription: any;
30
-
31
-  constructor(private theme: NbThemeService) {
32
-    this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
33
-      const colors: any = config.variables;
34
-      this.colorScheme = {
35
-        domain: [colors.primaryLight, colors.infoLight, colors.successLight, colors.warningLight, colors.dangerLight],
36
-      };
37
-    });
38
-  }
39
-
40
-  ngOnDestroy(): void {
41
-    this.themeSubscription.unsubscribe();
42
-  }
43
-}

+ 0
- 73
src/frontend/src/app/demo_pages/charts/d3/d3-area-stack.component.ts Voir le fichier

@@ -1,73 +0,0 @@
1
-import { Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-
4
-@Component({
5
-  selector: 'ngx-d3-area-stack',
6
-  template: `
7
-    <ngx-charts-area-chart
8
-      [scheme]="colorScheme"
9
-      [results]="multi"
10
-      [xAxis]="showXAxis"
11
-      [yAxis]="showYAxis"
12
-      [legend]="showLegend"
13
-      [showXAxisLabel]="showXAxisLabel"
14
-      [showYAxisLabel]="showYAxisLabel"
15
-      [xAxisLabel]="xAxisLabel"
16
-      [yAxisLabel]="yAxisLabel"
17
-      [autoScale]="autoScale">
18
-    </ngx-charts-area-chart>
19
-  `,
20
-})
21
-export class D3AreaStackComponent implements OnDestroy {
22
-  multi = [{
23
-    name: 'Germany',
24
-    series: [{
25
-        name: '2010',
26
-        value: 7300000,
27
-      }, {
28
-        name: '2011',
29
-        value: 8940000,
30
-      }],
31
-  }, {
32
-    name: 'USA',
33
-    series: [{
34
-        name: '2010',
35
-        value: 7870000,
36
-      }, {
37
-        name: '2011',
38
-        value: 8270000,
39
-      }],
40
-  }, {
41
-    name: 'France',
42
-    series: [{
43
-        name: '2010',
44
-        value: 5000002,
45
-      }, {
46
-        name: '2011',
47
-        value: 5800000,
48
-      }],
49
-  }];
50
-  showLegend = true;
51
-  autoScale = true;
52
-  showXAxis = true;
53
-  showYAxis = true;
54
-  showXAxisLabel = true;
55
-  showYAxisLabel = true;
56
-  xAxisLabel = 'Country';
57
-  yAxisLabel = 'Population';
58
-  colorScheme: any;
59
-  themeSubscription: any;
60
-
61
-  constructor(private theme: NbThemeService) {
62
-    this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
63
-      const colors: any = config.variables;
64
-      this.colorScheme = {
65
-        domain: [colors.primaryLight, colors.infoLight, colors.successLight, colors.warningLight, colors.dangerLight],
66
-      };
67
-    });
68
-  }
69
-
70
-  ngOnDestroy(): void {
71
-    this.themeSubscription.unsubscribe();
72
-  }
73
-}

+ 0
- 45
src/frontend/src/app/demo_pages/charts/d3/d3-bar.component.ts Voir le fichier

@@ -1,45 +0,0 @@
1
-import { Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-
4
-@Component({
5
-  selector: 'ngx-d3-bar',
6
-  template: `
7
-    <ngx-charts-bar-vertical
8
-      [scheme]="colorScheme"
9
-      [results]="results"
10
-      [xAxis]="showXAxis"
11
-      [yAxis]="showYAxis"
12
-      [legend]="showLegend"
13
-      [xAxisLabel]="xAxisLabel"
14
-      [yAxisLabel]="yAxisLabel">
15
-    </ngx-charts-bar-vertical>
16
-  `,
17
-})
18
-export class D3BarComponent implements OnDestroy {
19
-
20
-  results = [
21
-    { name: 'Germany', value: 8940 },
22
-    { name: 'USA', value: 5000 },
23
-    { name: 'France', value: 7200 },
24
-  ];
25
-  showLegend = true;
26
-  showXAxis = true;
27
-  showYAxis = true;
28
-  xAxisLabel = 'Country';
29
-  yAxisLabel = 'Population';
30
-  colorScheme: any;
31
-  themeSubscription: any;
32
-
33
-  constructor(private theme: NbThemeService) {
34
-    this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
35
-      const colors: any = config.variables;
36
-      this.colorScheme = {
37
-        domain: [colors.primaryLight, colors.infoLight, colors.successLight, colors.warningLight, colors.dangerLight],
38
-      };
39
-    });
40
-  }
41
-
42
-  ngOnDestroy(): void {
43
-    this.themeSubscription.unsubscribe();
44
-  }
45
-}

+ 0
- 84
src/frontend/src/app/demo_pages/charts/d3/d3-line.component.ts Voir le fichier

@@ -1,84 +0,0 @@
1
-import { Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-
4
-@Component({
5
-  selector: 'ngx-d3-line',
6
-  template: `
7
-    <ngx-charts-line-chart
8
-      [scheme]="colorScheme"
9
-      [results]="multi"
10
-      [xAxis]="showXAxis"
11
-      [yAxis]="showYAxis"
12
-      [legend]="showLegend"
13
-      [showXAxisLabel]="showXAxisLabel"
14
-      [showYAxisLabel]="showYAxisLabel"
15
-      [xAxisLabel]="xAxisLabel"
16
-      [yAxisLabel]="yAxisLabel">
17
-    </ngx-charts-line-chart>
18
-  `,
19
-})
20
-export class D3LineComponent implements OnDestroy {
21
-  multi = [
22
-    {
23
-      name: 'Germany',
24
-      series: [
25
-        {
26
-          name: '2010',
27
-          value: 7300,
28
-        },
29
-        {
30
-          name: '2011',
31
-          value: 8940,
32
-        },
33
-      ],
34
-    },
35
-    {
36
-      name: 'USA',
37
-      series: [
38
-        {
39
-          name: '2010',
40
-          value: 7870,
41
-        },
42
-        {
43
-          name: '2011',
44
-          value: 8270,
45
-        },
46
-      ],
47
-    },
48
-    {
49
-      name: 'France',
50
-      series: [
51
-        {
52
-          name: '2010',
53
-          value: 5002,
54
-        },
55
-        {
56
-          name: '2011',
57
-          value: 5800,
58
-        },
59
-      ],
60
-    },
61
-  ];
62
-  showLegend = true;
63
-  showXAxis = true;
64
-  showYAxis = true;
65
-  showXAxisLabel = true;
66
-  xAxisLabel = 'Country';
67
-  showYAxisLabel = true;
68
-  yAxisLabel = 'Population';
69
-  colorScheme: any;
70
-  themeSubscription: any;
71
-
72
-  constructor(private theme: NbThemeService) {
73
-    this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
74
-      const colors: any = config.variables;
75
-      this.colorScheme = {
76
-        domain: [colors.primaryLight, colors.infoLight, colors.successLight, colors.warningLight, colors.dangerLight],
77
-      };
78
-    });
79
-  }
80
-
81
-  ngOnDestroy(): void {
82
-    this.themeSubscription.unsubscribe();
83
-  }
84
-}

+ 0
- 38
src/frontend/src/app/demo_pages/charts/d3/d3-pie.component.ts Voir le fichier

@@ -1,38 +0,0 @@
1
-import { Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-
4
-@Component({
5
-  selector: 'ngx-d3-pie',
6
-  template: `
7
-    <ngx-charts-pie-chart
8
-      [scheme]="colorScheme"
9
-      [results]="results"
10
-      [legend]="showLegend"
11
-      [labels]="showLabels">
12
-    </ngx-charts-pie-chart>
13
-  `,
14
-})
15
-export class D3PieComponent implements OnDestroy {
16
-  results = [
17
-    { name: 'Germany', value: 8940 },
18
-    { name: 'USA', value: 5000 },
19
-    { name: 'France', value: 7200 },
20
-  ];
21
-  showLegend = true;
22
-  showLabels = true;
23
-  colorScheme: any;
24
-  themeSubscription: any;
25
-
26
-  constructor(private theme: NbThemeService) {
27
-    this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
28
-      const colors: any = config.variables;
29
-      this.colorScheme = {
30
-        domain: [colors.primaryLight, colors.infoLight, colors.successLight, colors.warningLight, colors.dangerLight],
31
-      };
32
-    });
33
-  }
34
-
35
-  ngOnDestroy(): void {
36
-    this.themeSubscription.unsubscribe();
37
-  }
38
-}

+ 0
- 98
src/frontend/src/app/demo_pages/charts/d3/d3-polar.component.ts Voir le fichier

@@ -1,98 +0,0 @@
1
-import { Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-
4
-@Component({
5
-  selector: 'ngx-d3-polar',
6
-  template: `
7
-    <ngx-charts-polar-chart
8
-      [scheme]="colorScheme"
9
-      [results]="multi"
10
-      [xAxis]="showXAxis"
11
-      [yAxis]="showYAxis"
12
-      [legend]="showLegend"
13
-      [showXAxisLabel]="showXAxisLabel"
14
-      [showYAxisLabel]="showYAxisLabel"
15
-      [xAxisLabel]="xAxisLabel"
16
-      [yAxisLabel]="yAxisLabel"
17
-      [autoScale]="autoScale">
18
-    </ngx-charts-polar-chart>
19
-  `,
20
-})
21
-export class D3PolarComponent implements OnDestroy {
22
-  multi = [
23
-    {
24
-      name: 'Germany',
25
-      series: [
26
-        {
27
-          name: '1990',
28
-          value: 31476,
29
-        },
30
-        {
31
-          name: '2000',
32
-          value: 36953,
33
-        },
34
-        {
35
-          name: '2010',
36
-          value: 40632,
37
-        },
38
-      ],
39
-    },
40
-    {
41
-      name: 'USA',
42
-      series: [
43
-        {
44
-          name: '1990',
45
-          value: 37060,
46
-        },
47
-        {
48
-          name: '2000',
49
-          value: 45986,
50
-        },
51
-        {
52
-          name: '2010',
53
-          value: 49737,
54
-        },
55
-      ],
56
-    },
57
-    {
58
-      name: 'France',
59
-      series: [
60
-        {
61
-          name: '1990',
62
-          value: 29476,
63
-        },
64
-        {
65
-          name: '2000',
66
-          value: 34774,
67
-        },
68
-        {
69
-          name: '2010',
70
-          value: 36240,
71
-        },
72
-      ],
73
-    },
74
-  ];
75
-  showLegend = true;
76
-  autoScale = true;
77
-  showXAxis = true;
78
-  showYAxis = true;
79
-  showXAxisLabel = true;
80
-  showYAxisLabel = true;
81
-  xAxisLabel = 'Country';
82
-  yAxisLabel = 'Population';
83
-  colorScheme: any;
84
-  themeSubscription: any;
85
-
86
-  constructor(private theme: NbThemeService) {
87
-    this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
88
-      const colors: any = config.variables;
89
-      this.colorScheme = {
90
-        domain: [colors.primaryLight, colors.infoLight, colors.successLight, colors.warningLight, colors.dangerLight],
91
-      };
92
-    });
93
-  }
94
-
95
-  ngOnDestroy(): void {
96
-    this.themeSubscription.unsubscribe();
97
-  }
98
-}

+ 0
- 42
src/frontend/src/app/demo_pages/charts/d3/d3.component.html Voir le fichier

@@ -1,42 +0,0 @@
1
-<div class="row">
2
-  <div class="col-lg-6">
3
-    <nb-card>
4
-      <nb-card-header>Pie</nb-card-header>
5
-      <nb-card-body>
6
-        <ngx-d3-pie></ngx-d3-pie>
7
-      </nb-card-body>
8
-    </nb-card>
9
-  </div>
10
-  <div class="col-lg-6">
11
-    <nb-card>
12
-      <nb-card-header>Bar</nb-card-header>
13
-      <nb-card-body>
14
-        <ngx-d3-bar></ngx-d3-bar>
15
-      </nb-card-body>
16
-    </nb-card>
17
-  </div>
18
-  <div class="col-lg-6">
19
-    <nb-card>
20
-      <nb-card-header>Line</nb-card-header>
21
-      <nb-card-body>
22
-        <ngx-d3-line></ngx-d3-line>
23
-      </nb-card-body>
24
-    </nb-card>
25
-  </div>
26
-  <div class="col-lg-6">
27
-    <nb-card>
28
-      <nb-card-header>Advanced Pie</nb-card-header>
29
-      <nb-card-body>
30
-        <ngx-d3-advanced-pie></ngx-d3-advanced-pie>
31
-      </nb-card-body>
32
-    </nb-card>
33
-  </div>
34
-  <div class="col-lg-6">
35
-    <nb-card>
36
-      <nb-card-header>Area Chart</nb-card-header>
37
-      <nb-card-body>
38
-        <ngx-d3-area-stack></ngx-d3-area-stack>
39
-      </nb-card-body>
40
-    </nb-card>
41
-  </div>
42
-</div>

+ 0
- 46
src/frontend/src/app/demo_pages/charts/d3/d3.component.scss Voir le fichier

@@ -1,46 +0,0 @@
1
-@import '../../../@theme/styles/themes';
2
-
3
-@include nb-install-component() {
4
-  ngx-d3-bar,
5
-  ngx-d3-pie,
6
-  ngx-d3-advanced-pie,
7
-  ngx-d3-area-stack,
8
-  ngx-d3-line,
9
-  ngx-d3-polar {
10
-    display: block;
11
-    width: 100%;
12
-    height: nb-theme(card-height-medium);
13
-
14
-    ::ng-deep {
15
-      .pie-label {
16
-        fill: nb-theme(text-basic-color);
17
-      }
18
-
19
-      text {
20
-        fill: nb-theme(text-hint-color);
21
-      }
22
-
23
-      .chart-legend {
24
-        .legend-labels {
25
-          background: nb-theme(background-basic-color-2);
26
-        }
27
-        .legend-label {
28
-          color: nb-theme(text-hint-color);
29
-          .active .legend-label-text {
30
-            color: nb-theme(text-basic-color);
31
-          }
32
-        }
33
-      }
34
-
35
-      .total-value,
36
-      .item-value,
37
-      .item-percent {
38
-        line-height: 1.25;
39
-      }
40
-
41
-      .legend-items {
42
-        overflow-y: hidden;
43
-      }
44
-    }
45
-  }
46
-}

+ 0
- 8
src/frontend/src/app/demo_pages/charts/d3/d3.component.ts Voir le fichier

@@ -1,8 +0,0 @@
1
-import { Component } from '@angular/core';
2
-
3
-@Component({
4
-  selector: 'ngx-d3',
5
-  styleUrls: ['./d3.component.scss'],
6
-  templateUrl: './d3.component.html',
7
-})
8
-export class D3Component {}

+ 0
- 140
src/frontend/src/app/demo_pages/charts/echarts/echarts-area-stack.component.ts Voir le fichier

@@ -1,140 +0,0 @@
1
-import { AfterViewInit, Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-
4
-@Component({
5
-  selector: 'ngx-echarts-area-stack',
6
-  template: `
7
-    <div echarts [options]="options" class="echart"></div>
8
-  `,
9
-})
10
-export class EchartsAreaStackComponent implements AfterViewInit, OnDestroy {
11
-  options: any = {};
12
-  themeSubscription: any;
13
-
14
-  constructor(private theme: NbThemeService) {
15
-  }
16
-
17
-  ngAfterViewInit() {
18
-    this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
19
-
20
-      const colors: any = config.variables;
21
-      const echarts: any = config.variables.echarts;
22
-
23
-      this.options = {
24
-        backgroundColor: echarts.bg,
25
-        color: [colors.warningLight, colors.infoLight, colors.dangerLight, colors.successLight, colors.primaryLight],
26
-        tooltip: {
27
-          trigger: 'axis',
28
-          axisPointer: {
29
-            type: 'cross',
30
-            label: {
31
-              backgroundColor: echarts.tooltipBackgroundColor,
32
-            },
33
-          },
34
-        },
35
-        legend: {
36
-          data: ['Mail marketing', 'Affiliate advertising', 'Video ad', 'Direct interview', 'Search engine'],
37
-          textStyle: {
38
-            color: echarts.textColor,
39
-          },
40
-        },
41
-        grid: {
42
-          left: '3%',
43
-          right: '4%',
44
-          bottom: '3%',
45
-          containLabel: true,
46
-        },
47
-        xAxis: [
48
-          {
49
-            type: 'category',
50
-            boundaryGap: false,
51
-            data: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
52
-            axisTick: {
53
-              alignWithLabel: true,
54
-            },
55
-            axisLine: {
56
-              lineStyle: {
57
-                color: echarts.axisLineColor,
58
-              },
59
-            },
60
-            axisLabel: {
61
-              textStyle: {
62
-                color: echarts.textColor,
63
-              },
64
-            },
65
-          },
66
-        ],
67
-        yAxis: [
68
-          {
69
-            type: 'value',
70
-            axisLine: {
71
-              lineStyle: {
72
-                color: echarts.axisLineColor,
73
-              },
74
-            },
75
-            splitLine: {
76
-              lineStyle: {
77
-                color: echarts.splitLineColor,
78
-              },
79
-            },
80
-            axisLabel: {
81
-              textStyle: {
82
-                color: echarts.textColor,
83
-              },
84
-            },
85
-          },
86
-        ],
87
-        series: [
88
-          {
89
-            name: 'Mail marketing',
90
-            type: 'line',
91
-            stack: 'Total amount',
92
-            areaStyle: { normal: { opacity: echarts.areaOpacity } },
93
-            data: [120, 132, 101, 134, 90, 230, 210],
94
-          },
95
-          {
96
-            name: 'Affiliate advertising',
97
-            type: 'line',
98
-            stack: 'Total amount',
99
-            areaStyle: { normal: { opacity: echarts.areaOpacity } },
100
-            data: [220, 182, 191, 234, 290, 330, 310],
101
-          },
102
-          {
103
-            name: 'Video ad',
104
-            type: 'line',
105
-            stack: 'Total amount',
106
-            areaStyle: { normal: { opacity: echarts.areaOpacity } },
107
-            data: [150, 232, 201, 154, 190, 330, 410],
108
-          },
109
-          {
110
-            name: 'Direct interview',
111
-            type: 'line',
112
-            stack: 'Total amount',
113
-            areaStyle: { normal: { opacity: echarts.areaOpacity } },
114
-            data: [320, 332, 301, 334, 390, 330, 320],
115
-          },
116
-          {
117
-            name: 'Search engine',
118
-            type: 'line',
119
-            stack: 'Total amount',
120
-            label: {
121
-              normal: {
122
-                show: true,
123
-                position: 'top',
124
-                textStyle: {
125
-                  color: echarts.textColor,
126
-                },
127
-              },
128
-            },
129
-            areaStyle: { normal: { opacity: echarts.areaOpacity } },
130
-            data: [820, 932, 901, 934, 1290, 1330, 1320],
131
-          },
132
-        ],
133
-      };
134
-    });
135
-  }
136
-
137
-  ngOnDestroy(): void {
138
-    this.themeSubscription.unsubscribe();
139
-  }
140
-}

+ 0
- 103
src/frontend/src/app/demo_pages/charts/echarts/echarts-bar-animation.component.ts Voir le fichier

@@ -1,103 +0,0 @@
1
-import { AfterViewInit, Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-
4
-@Component({
5
-  selector: 'ngx-echarts-bar-animation',
6
-  template: `
7
-    <div echarts [options]="options" class="echart"></div>
8
-  `,
9
-})
10
-export class EchartsBarAnimationComponent implements AfterViewInit, OnDestroy {
11
-  options: any = {};
12
-  themeSubscription: any;
13
-
14
-  constructor(private theme: NbThemeService) {
15
-  }
16
-
17
-  ngAfterViewInit() {
18
-    this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
19
-      const xAxisData = [];
20
-      const data1 = [];
21
-      const data2 = [];
22
-
23
-      const colors: any = config.variables;
24
-      const echarts: any = config.variables.echarts;
25
-
26
-      this.options = {
27
-        backgroundColor: echarts.bg,
28
-        color: [colors.primaryLight, colors.infoLight],
29
-        legend: {
30
-          data: ['bar', 'bar2'],
31
-          align: 'left',
32
-          textStyle: {
33
-            color: echarts.textColor,
34
-          },
35
-        },
36
-        xAxis: [
37
-          {
38
-            data: xAxisData,
39
-            silent: false,
40
-            axisTick: {
41
-              alignWithLabel: true,
42
-            },
43
-            axisLine: {
44
-              lineStyle: {
45
-                color: echarts.axisLineColor,
46
-              },
47
-            },
48
-            axisLabel: {
49
-              textStyle: {
50
-                color: echarts.textColor,
51
-              },
52
-            },
53
-          },
54
-        ],
55
-        yAxis: [
56
-          {
57
-            axisLine: {
58
-              lineStyle: {
59
-                color: echarts.axisLineColor,
60
-              },
61
-            },
62
-            splitLine: {
63
-              lineStyle: {
64
-                color: echarts.splitLineColor,
65
-              },
66
-            },
67
-            axisLabel: {
68
-              textStyle: {
69
-                color: echarts.textColor,
70
-              },
71
-            },
72
-          },
73
-        ],
74
-        series: [
75
-          {
76
-            name: 'bar',
77
-            type: 'bar',
78
-            data: data1,
79
-            animationDelay: idx => idx * 10,
80
-          },
81
-          {
82
-            name: 'bar2',
83
-            type: 'bar',
84
-            data: data2,
85
-            animationDelay: idx => idx * 10 + 100,
86
-          },
87
-        ],
88
-        animationEasing: 'elasticOut',
89
-        animationDelayUpdate: idx => idx * 5,
90
-      };
91
-
92
-      for (let i = 0; i < 100; i++) {
93
-        xAxisData.push('Category ' + i);
94
-        data1.push((Math.sin(i / 5) * (i / 5 - 10) + i / 6) * 5);
95
-        data2.push((Math.cos(i / 5) * (i / 5 - 10) + i / 6) * 5);
96
-      }
97
-    });
98
-  }
99
-
100
-  ngOnDestroy(): void {
101
-    this.themeSubscription.unsubscribe();
102
-  }
103
-}

+ 0
- 92
src/frontend/src/app/demo_pages/charts/echarts/echarts-bar.component.ts Voir le fichier

@@ -1,92 +0,0 @@
1
-import { AfterViewInit, Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-
4
-@Component({
5
-  selector: 'ngx-echarts-bar',
6
-  template: `
7
-    <div echarts [options]="options" class="echart"></div>
8
-  `,
9
-})
10
-export class EchartsBarComponent implements AfterViewInit, OnDestroy {
11
-  options: any = {};
12
-  themeSubscription: any;
13
-
14
-  constructor(private theme: NbThemeService) {
15
-  }
16
-
17
-  ngAfterViewInit() {
18
-    this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
19
-
20
-      const colors: any = config.variables;
21
-      const echarts: any = config.variables.echarts;
22
-
23
-      this.options = {
24
-        backgroundColor: echarts.bg,
25
-        color: [colors.primaryLight],
26
-        tooltip: {
27
-          trigger: 'axis',
28
-          axisPointer: {
29
-            type: 'shadow',
30
-          },
31
-        },
32
-        grid: {
33
-          left: '3%',
34
-          right: '4%',
35
-          bottom: '3%',
36
-          containLabel: true,
37
-        },
38
-        xAxis: [
39
-          {
40
-            type: 'category',
41
-            data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
42
-            axisTick: {
43
-              alignWithLabel: true,
44
-            },
45
-            axisLine: {
46
-              lineStyle: {
47
-                color: echarts.axisLineColor,
48
-              },
49
-            },
50
-            axisLabel: {
51
-              textStyle: {
52
-                color: echarts.textColor,
53
-              },
54
-            },
55
-          },
56
-        ],
57
-        yAxis: [
58
-          {
59
-            type: 'value',
60
-            axisLine: {
61
-              lineStyle: {
62
-                color: echarts.axisLineColor,
63
-              },
64
-            },
65
-            splitLine: {
66
-              lineStyle: {
67
-                color: echarts.splitLineColor,
68
-              },
69
-            },
70
-            axisLabel: {
71
-              textStyle: {
72
-                color: echarts.textColor,
73
-              },
74
-            },
75
-          },
76
-        ],
77
-        series: [
78
-          {
79
-            name: 'Score',
80
-            type: 'bar',
81
-            barWidth: '60%',
82
-            data: [10, 52, 200, 334, 390, 330, 220],
83
-          },
84
-        ],
85
-      };
86
-    });
87
-  }
88
-
89
-  ngOnDestroy(): void {
90
-    this.themeSubscription.unsubscribe();
91
-  }
92
-}

+ 0
- 106
src/frontend/src/app/demo_pages/charts/echarts/echarts-line.component.ts Voir le fichier

@@ -1,106 +0,0 @@
1
-import { AfterViewInit, Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-
4
-@Component({
5
-  selector: 'ngx-echarts-line',
6
-  template: `
7
-    <div echarts [options]="options" class="echart"></div>
8
-  `,
9
-})
10
-export class EchartsLineComponent implements AfterViewInit, OnDestroy {
11
-  options: any = {};
12
-  themeSubscription: any;
13
-
14
-  constructor(private theme: NbThemeService) {
15
-  }
16
-
17
-  ngAfterViewInit() {
18
-    this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
19
-
20
-      const colors: any = config.variables;
21
-      const echarts: any = config.variables.echarts;
22
-
23
-      this.options = {
24
-        backgroundColor: echarts.bg,
25
-        color: [colors.danger, colors.primary, colors.info],
26
-        tooltip: {
27
-          trigger: 'item',
28
-          formatter: '{a} <br/>{b} : {c}',
29
-        },
30
-        legend: {
31
-          left: 'left',
32
-          data: ['Line 1', 'Line 2', 'Line 3'],
33
-          textStyle: {
34
-            color: echarts.textColor,
35
-          },
36
-        },
37
-        xAxis: [
38
-          {
39
-            type: 'category',
40
-            data: ['1', '2', '3', '4', '5', '6', '7', '8', '9'],
41
-            axisTick: {
42
-              alignWithLabel: true,
43
-            },
44
-            axisLine: {
45
-              lineStyle: {
46
-                color: echarts.axisLineColor,
47
-              },
48
-            },
49
-            axisLabel: {
50
-              textStyle: {
51
-                color: echarts.textColor,
52
-              },
53
-            },
54
-          },
55
-        ],
56
-        yAxis: [
57
-          {
58
-            type: 'log',
59
-            axisLine: {
60
-              lineStyle: {
61
-                color: echarts.axisLineColor,
62
-              },
63
-            },
64
-            splitLine: {
65
-              lineStyle: {
66
-                color: echarts.splitLineColor,
67
-              },
68
-            },
69
-            axisLabel: {
70
-              textStyle: {
71
-                color: echarts.textColor,
72
-              },
73
-            },
74
-          },
75
-        ],
76
-        grid: {
77
-          left: '3%',
78
-          right: '4%',
79
-          bottom: '3%',
80
-          containLabel: true,
81
-        },
82
-        series: [
83
-          {
84
-            name: 'Line 1',
85
-            type: 'line',
86
-            data: [1, 3, 9, 27, 81, 247, 741, 2223, 6669],
87
-          },
88
-          {
89
-            name: 'Line 2',
90
-            type: 'line',
91
-            data: [1, 2, 4, 8, 16, 32, 64, 128, 256],
92
-          },
93
-          {
94
-            name: 'Line 3',
95
-            type: 'line',
96
-            data: [1 / 2, 1 / 4, 1 / 8, 1 / 16, 1 / 32, 1 / 64, 1 / 128, 1 / 256, 1 / 512],
97
-          },
98
-        ],
99
-      };
100
-    });
101
-  }
102
-
103
-  ngOnDestroy(): void {
104
-    this.themeSubscription.unsubscribe();
105
-  }
106
-}

+ 0
- 166
src/frontend/src/app/demo_pages/charts/echarts/echarts-multiple-xaxis.component.ts Voir le fichier

@@ -1,166 +0,0 @@
1
-import { Component, AfterViewInit, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-
4
-@Component({
5
-  selector: 'ngx-echarts-multiple-xaxis',
6
-  template: `
7
-    <div echarts [options]="options" class="echart"></div>
8
-  `,
9
-})
10
-export class EchartsMultipleXaxisComponent implements AfterViewInit, OnDestroy {
11
-  options: any = {};
12
-  themeSubscription: any;
13
-
14
-  constructor(private theme: NbThemeService) {
15
-  }
16
-
17
-  ngAfterViewInit() {
18
-    this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
19
-
20
-      const colors: any = config.variables;
21
-      const echarts: any = config.variables.echarts;
22
-
23
-      this.options = {
24
-        backgroundColor: echarts.bg,
25
-        color: [colors.success, colors.info],
26
-        tooltip: {
27
-          trigger: 'none',
28
-          axisPointer: {
29
-            type: 'cross',
30
-          },
31
-        },
32
-        legend: {
33
-          data: ['2015 Precipitation', '2016 Precipitation'],
34
-          textStyle: {
35
-            color: echarts.textColor,
36
-          },
37
-        },
38
-        grid: {
39
-          top: 70,
40
-          bottom: 50,
41
-        },
42
-        xAxis: [
43
-          {
44
-            type: 'category',
45
-            axisTick: {
46
-              alignWithLabel: true,
47
-            },
48
-            axisLine: {
49
-              onZero: false,
50
-              lineStyle: {
51
-                color: colors.info,
52
-              },
53
-            },
54
-            axisLabel: {
55
-              textStyle: {
56
-                color: echarts.textColor,
57
-              },
58
-            },
59
-            axisPointer: {
60
-              label: {
61
-                formatter: params => {
62
-                  return (
63
-                    'Precipitation  ' + params.value + (params.seriesData.length ? ':' + params.seriesData[0].data : '')
64
-                  );
65
-                },
66
-              },
67
-            },
68
-            data: [
69
-              '2016-1',
70
-              '2016-2',
71
-              '2016-3',
72
-              '2016-4',
73
-              '2016-5',
74
-              '2016-6',
75
-              '2016-7',
76
-              '2016-8',
77
-              '2016-9',
78
-              '2016-10',
79
-              '2016-11',
80
-              '2016-12',
81
-            ],
82
-          },
83
-          {
84
-            type: 'category',
85
-            axisTick: {
86
-              alignWithLabel: true,
87
-            },
88
-            axisLine: {
89
-              onZero: false,
90
-              lineStyle: {
91
-                color: colors.success,
92
-              },
93
-            },
94
-            axisLabel: {
95
-              textStyle: {
96
-                color: echarts.textColor,
97
-              },
98
-            },
99
-            axisPointer: {
100
-              label: {
101
-                formatter: params => {
102
-                  return (
103
-                    'Precipitation  ' + params.value + (params.seriesData.length ? ':' + params.seriesData[0].data : '')
104
-                  );
105
-                },
106
-              },
107
-            },
108
-            data: [
109
-              '2015-1',
110
-              '2015-2',
111
-              '2015-3',
112
-              '2015-4',
113
-              '2015-5',
114
-              '2015-6',
115
-              '2015-7',
116
-              '2015-8',
117
-              '2015-9',
118
-              '2015-10',
119
-              '2015-11',
120
-              '2015-12',
121
-            ],
122
-          },
123
-        ],
124
-        yAxis: [
125
-          {
126
-            type: 'value',
127
-            axisLine: {
128
-              lineStyle: {
129
-                color: echarts.axisLineColor,
130
-              },
131
-            },
132
-            splitLine: {
133
-              lineStyle: {
134
-                color: echarts.splitLineColor,
135
-              },
136
-            },
137
-            axisLabel: {
138
-              textStyle: {
139
-                color: echarts.textColor,
140
-              },
141
-            },
142
-          },
143
-        ],
144
-        series: [
145
-          {
146
-            name: '2015 Precipitation',
147
-            type: 'line',
148
-            xAxisIndex: 1,
149
-            smooth: true,
150
-            data: [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],
151
-          },
152
-          {
153
-            name: '2016 Precipitation',
154
-            type: 'line',
155
-            smooth: true,
156
-            data: [3.9, 5.9, 11.1, 18.7, 48.3, 69.2, 231.6, 46.6, 55.4, 18.4, 10.3, 0.7],
157
-          },
158
-        ],
159
-      };
160
-    });
161
-  }
162
-
163
-  ngOnDestroy(): void {
164
-    this.themeSubscription.unsubscribe();
165
-  }
166
-}

+ 0
- 81
src/frontend/src/app/demo_pages/charts/echarts/echarts-pie.component.ts Voir le fichier

@@ -1,81 +0,0 @@
1
-import { AfterViewInit, Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-
4
-@Component({
5
-  selector: 'ngx-echarts-pie',
6
-  template: `
7
-    <div echarts [options]="options" class="echart"></div>
8
-  `,
9
-})
10
-export class EchartsPieComponent implements AfterViewInit, OnDestroy {
11
-  options: any = {};
12
-  themeSubscription: any;
13
-
14
-  constructor(private theme: NbThemeService) {
15
-  }
16
-
17
-  ngAfterViewInit() {
18
-    this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
19
-
20
-      const colors = config.variables;
21
-      const echarts: any = config.variables.echarts;
22
-
23
-      this.options = {
24
-        backgroundColor: echarts.bg,
25
-        color: [colors.warningLight, colors.infoLight, colors.dangerLight, colors.successLight, colors.primaryLight],
26
-        tooltip: {
27
-          trigger: 'item',
28
-          formatter: '{a} <br/>{b} : {c} ({d}%)',
29
-        },
30
-        legend: {
31
-          orient: 'vertical',
32
-          left: 'left',
33
-          data: ['USA', 'Germany', 'France', 'Canada', 'Russia'],
34
-          textStyle: {
35
-            color: echarts.textColor,
36
-          },
37
-        },
38
-        series: [
39
-          {
40
-            name: 'Countries',
41
-            type: 'pie',
42
-            radius: '80%',
43
-            center: ['50%', '50%'],
44
-            data: [
45
-              { value: 335, name: 'Germany' },
46
-              { value: 310, name: 'France' },
47
-              { value: 234, name: 'Canada' },
48
-              { value: 135, name: 'Russia' },
49
-              { value: 1548, name: 'USA' },
50
-            ],
51
-            itemStyle: {
52
-              emphasis: {
53
-                shadowBlur: 10,
54
-                shadowOffsetX: 0,
55
-                shadowColor: echarts.itemHoverShadowColor,
56
-              },
57
-            },
58
-            label: {
59
-              normal: {
60
-                textStyle: {
61
-                  color: echarts.textColor,
62
-                },
63
-              },
64
-            },
65
-            labelLine: {
66
-              normal: {
67
-                lineStyle: {
68
-                  color: echarts.axisLineColor,
69
-                },
70
-              },
71
-            },
72
-          },
73
-        ],
74
-      };
75
-    });
76
-  }
77
-
78
-  ngOnDestroy(): void {
79
-    this.themeSubscription.unsubscribe();
80
-  }
81
-}

+ 0
- 76
src/frontend/src/app/demo_pages/charts/echarts/echarts-radar.component.ts Voir le fichier

@@ -1,76 +0,0 @@
1
-import { AfterViewInit, Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-
4
-@Component({
5
-  selector: 'ngx-echarts-radar',
6
-  template: `
7
-    <div echarts [options]="options" class="echart"></div>
8
-  `,
9
-})
10
-export class EchartsRadarComponent implements AfterViewInit, OnDestroy {
11
-  options: any = {};
12
-  themeSubscription: any;
13
-
14
-  constructor(private theme: NbThemeService) {
15
-  }
16
-
17
-  ngAfterViewInit() {
18
-    this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
19
-
20
-      const colors: any = config.variables;
21
-      const echarts: any = config.variables.echarts;
22
-
23
-      this.options = {
24
-        backgroundColor: echarts.bg,
25
-        color: [colors.danger, colors.warning],
26
-        tooltip: {},
27
-        legend: {
28
-          data: ['Allocated Budget', 'Actual Spending'],
29
-          textStyle: {
30
-            color: echarts.textColor,
31
-          },
32
-        },
33
-        radar: {
34
-          name: {
35
-            textStyle: {
36
-              color: echarts.textColor,
37
-            },
38
-          },
39
-          indicator: [
40
-            { name: 'Sales', max: 6500 },
41
-            { name: 'Administration', max: 16000 },
42
-            { name: 'Information Techology', max: 30000 },
43
-            { name: 'Customer Support', max: 38000 },
44
-            { name: 'Development', max: 52000 },
45
-            { name: 'Marketing', max: 25000 },
46
-          ],
47
-          splitArea: {
48
-            areaStyle: {
49
-              color: 'transparent',
50
-            },
51
-          },
52
-        },
53
-        series: [
54
-          {
55
-            name: 'Budget vs Spending',
56
-            type: 'radar',
57
-            data: [
58
-              {
59
-                value: [4300, 10000, 28000, 35000, 50000, 19000],
60
-                name: 'Allocated Budget',
61
-              },
62
-              {
63
-                value: [5000, 14000, 28000, 31000, 42000, 21000],
64
-                name: 'Actual Spending',
65
-              },
66
-            ],
67
-          },
68
-        ],
69
-      };
70
-    });
71
-  }
72
-
73
-  ngOnDestroy(): void {
74
-    this.themeSubscription.unsubscribe();
75
-  }
76
-}

+ 0
- 58
src/frontend/src/app/demo_pages/charts/echarts/echarts.component.html Voir le fichier

@@ -1,58 +0,0 @@
1
-<div class="row">
2
-  <div class="col-lg-6">
3
-    <nb-card>
4
-      <nb-card-header>Pie</nb-card-header>
5
-      <nb-card-body>
6
-        <ngx-echarts-pie></ngx-echarts-pie>
7
-      </nb-card-body>
8
-    </nb-card>
9
-  </div>
10
-  <div class="col-lg-6">
11
-    <nb-card>
12
-      <nb-card-header>Bar</nb-card-header>
13
-      <nb-card-body>
14
-        <ngx-echarts-bar></ngx-echarts-bar>
15
-      </nb-card-body>
16
-    </nb-card>
17
-  </div>
18
-  <div class="col-lg-6">
19
-    <nb-card>
20
-      <nb-card-header>Line</nb-card-header>
21
-      <nb-card-body>
22
-        <ngx-echarts-line></ngx-echarts-line>
23
-      </nb-card-body>
24
-    </nb-card>
25
-  </div>
26
-  <div class="col-lg-6">
27
-    <nb-card>
28
-      <nb-card-header>Multiple x-axis</nb-card-header>
29
-      <nb-card-body>
30
-        <ngx-echarts-multiple-xaxis></ngx-echarts-multiple-xaxis>
31
-      </nb-card-body>
32
-    </nb-card>
33
-  </div>
34
-  <div class="col-lg-6">
35
-    <nb-card>
36
-      <nb-card-header>Area Stack</nb-card-header>
37
-      <nb-card-body>
38
-        <ngx-echarts-area-stack></ngx-echarts-area-stack>
39
-      </nb-card-body>
40
-    </nb-card>
41
-  </div>
42
-  <div class="col-lg-6">
43
-    <nb-card>
44
-      <nb-card-header>Bar Animation</nb-card-header>
45
-      <nb-card-body>
46
-        <ngx-echarts-bar-animation></ngx-echarts-bar-animation>
47
-      </nb-card-body>
48
-    </nb-card>
49
-  </div>
50
-  <div class="col-lg-6">
51
-    <nb-card>
52
-      <nb-card-header>Radar</nb-card-header>
53
-      <nb-card-body>
54
-        <ngx-echarts-radar></ngx-echarts-radar>
55
-      </nb-card-body>
56
-    </nb-card>
57
-  </div>
58
-</div>

+ 0
- 20
src/frontend/src/app/demo_pages/charts/echarts/echarts.component.scss Voir le fichier

@@ -1,20 +0,0 @@
1
-@import '../../../@theme/styles/themes';
2
-
3
-@include nb-install-component() {
4
-  ngx-echarts-pie,
5
-  ngx-echarts-bar,
6
-  ngx-echarts-line,
7
-  ngx-echarts-multiple-xaxis,
8
-  ngx-echarts-area-stack,
9
-  ngx-echarts-bar-animation,
10
-  ngx-echarts-radar {
11
-    display: block;
12
-    height: nb-theme(card-height-medium);
13
-    width: 100%;
14
-  }
15
-
16
-  ::ng-deep .echart {
17
-    height: 100%;
18
-    width: 100%;
19
-  }
20
-}

+ 0
- 8
src/frontend/src/app/demo_pages/charts/echarts/echarts.component.ts Voir le fichier

@@ -1,8 +0,0 @@
1
-import { Component } from '@angular/core';
2
-
3
-@Component({
4
-  selector: 'ngx-echarts',
5
-  styleUrls: ['./echarts.component.scss'],
6
-  templateUrl: './echarts.component.html',
7
-})
8
-export class EchartsComponent {}

+ 0
- 23
src/frontend/src/app/demo_pages/dashboard/contacts/contacts.component.html Voir le fichier

@@ -1,23 +0,0 @@
1
-<nb-card size="giant">
2
-  <nb-tabset fullWidth>
3
-
4
-    <nb-tab tabTitle="Contacts">
5
-      <nb-list>
6
-        <nb-list-item class="contact" *ngFor="let c of contacts">
7
-          <nb-user [picture]="c.user.picture" [name]="c.user.name" [title]="c.type" size="large"></nb-user>
8
-          <nb-icon icon="phone-outline" pack="eva"></nb-icon>
9
-        </nb-list-item>
10
-      </nb-list>
11
-    </nb-tab>
12
-
13
-    <nb-tab tabTitle="Recent">
14
-      <nb-list>
15
-        <nb-list-item class="contact" *ngFor="let c of recent">
16
-          <nb-user [picture]="c.user.picture" [name]="c.user.name" [title]="c.type" size="large"></nb-user>
17
-          <span class="caption">{{ c.time | date: 'shortTime' }}</span>
18
-        </nb-list-item>
19
-      </nb-list>
20
-    </nb-tab>
21
-
22
-  </nb-tabset>
23
-</nb-card>

+ 0
- 34
src/frontend/src/app/demo_pages/dashboard/contacts/contacts.component.scss Voir le fichier

@@ -1,34 +0,0 @@
1
-@import '../../../@theme/styles/themes';
2
-
3
-@include nb-install-component() {
4
-  nb-card {
5
-    overflow: hidden;
6
-  }
7
-
8
-  nb-tabset {
9
-    display: flex;
10
-    flex-direction: column;
11
-
12
-    ::ng-deep ul {
13
-      // make same size as card header
14
-      padding-bottom: 1px;
15
-      ::ng-deep .tab-link {
16
-        padding: 1.25rem 2rem;
17
-      }
18
-    }
19
-  }
20
-
21
-  nb-tab {
22
-    padding: 0;
23
-  }
24
-
25
-  .contact {
26
-    display: flex;
27
-    align-items: center;
28
-    justify-content: space-between;
29
-
30
-    &:first-child {
31
-      border-top: none;
32
-    }
33
-  }
34
-}

+ 0
- 34
src/frontend/src/app/demo_pages/dashboard/contacts/contacts.component.ts Voir le fichier

@@ -1,34 +0,0 @@
1
-import { Component, OnDestroy } from '@angular/core';
2
-import { takeWhile } from 'rxjs/operators';
3
-import { forkJoin } from 'rxjs';
4
-
5
-import { Contacts, RecentUsers, UserData } from '../../../@core/data/users';
6
-
7
-@Component({
8
-  selector: 'ngx-contacts',
9
-  styleUrls: ['./contacts.component.scss'],
10
-  templateUrl: './contacts.component.html',
11
-})
12
-export class ContactsComponent implements OnDestroy {
13
-
14
-  private alive = true;
15
-
16
-  contacts: any[];
17
-  recent: any[];
18
-
19
-  constructor(private userService: UserData) {
20
-    forkJoin(
21
-      this.userService.getContacts(),
22
-      this.userService.getRecentUsers(),
23
-    )
24
-      .pipe(takeWhile(() => this.alive))
25
-      .subscribe(([contacts, recent]: [Contacts[], RecentUsers[]]) => {
26
-        this.contacts = contacts;
27
-        this.recent = recent;
28
-      });
29
-  }
30
-
31
-  ngOnDestroy() {
32
-    this.alive = false;
33
-  }
34
-}

+ 0
- 42
src/frontend/src/app/demo_pages/dashboard/dashboard.component.html Voir le fichier

@@ -1,42 +0,0 @@
1
-<div class="row">
2
-  <div class="col-xxxl-3 col-md-6" *ngFor="let statusCard of statusCards">
3
-    <ngx-status-card [title]="statusCard.title" [type]="statusCard.type">
4
-      <i [ngClass]="statusCard.iconClass"></i>
5
-    </ngx-status-card>
6
-  </div>
7
-</div>
8
-
9
-<div class="row">
10
-  <div class="col-xxxl-3 col-xxl-4 col-lg-5 col-md-6">
11
-    <ngx-temperature></ngx-temperature>
12
-  </div>
13
-
14
-  <div class="col-xxxl-9 col-xxl-8 col-lg-7 col-md-6">
15
-    <ngx-electricity></ngx-electricity>
16
-  </div>
17
-</div>
18
-
19
-<div class="row">
20
-  <div class="col-xxxl-9 col-xl-12">
21
-    <ngx-rooms></ngx-rooms>
22
-  </div>
23
-
24
-  <div class="col-xxxl-3 col-xxl-4 col-lg-7 col-md-6">
25
-    <ngx-contacts></ngx-contacts>
26
-  </div>
27
-
28
-  <div class="col-xxxl-3 col-xxl-4 col-lg-5 col-md-6">
29
-    <ngx-solar [chartValue]="solarValue"></ngx-solar>
30
-
31
-    <ngx-kitten></ngx-kitten>
32
-  </div>
33
-
34
-  <div class="col-xxxl-3 col-xxl-4 col-md-5">
35
-    <ngx-traffic></ngx-traffic>
36
-    <ngx-weather></ngx-weather>
37
-  </div>
38
-
39
-  <div class="col-xxxl-6 col-xxl-12 col-md-7">
40
-    <ngx-security-cameras></ngx-security-cameras>
41
-  </div>
42
-</div>

+ 0
- 16
src/frontend/src/app/demo_pages/dashboard/dashboard.component.scss Voir le fichier

@@ -1,16 +0,0 @@
1
-@import '../../@theme/styles/themes';
2
-@import '~bootstrap/scss/mixins/breakpoints';
3
-@import '~@nebular/theme/styles/global/breakpoints';
4
-
5
-@include nb-install-component() {
6
-  .solar-card nb-card-header {
7
-    border: none;
8
-    padding-bottom: 0;
9
-  }
10
-
11
-  @include media-breakpoint-down(sm) {
12
-    ngx-traffic {
13
-      display: none;
14
-    }
15
-  }
16
-}

+ 0
- 99
src/frontend/src/app/demo_pages/dashboard/dashboard.component.ts Voir le fichier

@@ -1,99 +0,0 @@
1
-import {Component, OnDestroy} from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-import { takeWhile } from 'rxjs/operators' ;
4
-import { SolarData } from '../../@core/data/solar';
5
-
6
-interface CardSettings {
7
-  title: string;
8
-  iconClass: string;
9
-  type: string;
10
-}
11
-
12
-@Component({
13
-  selector: 'ngx-dashboard',
14
-  styleUrls: ['./dashboard.component.scss'],
15
-  templateUrl: './dashboard.component.html',
16
-})
17
-export class DashboardComponent implements OnDestroy {
18
-
19
-  private alive = true;
20
-
21
-  solarValue: number;
22
-  lightCard: CardSettings = {
23
-    title: 'Light',
24
-    iconClass: 'nb-lightbulb',
25
-    type: 'primary',
26
-  };
27
-  rollerShadesCard: CardSettings = {
28
-    title: 'Roller Shades',
29
-    iconClass: 'nb-roller-shades',
30
-    type: 'success',
31
-  };
32
-  wirelessAudioCard: CardSettings = {
33
-    title: 'Wireless Audio',
34
-    iconClass: 'nb-audio',
35
-    type: 'info',
36
-  };
37
-  coffeeMakerCard: CardSettings = {
38
-    title: 'Coffee Maker',
39
-    iconClass: 'nb-coffee-maker',
40
-    type: 'warning',
41
-  };
42
-
43
-  statusCards: string;
44
-
45
-  commonStatusCardsSet: CardSettings[] = [
46
-    this.lightCard,
47
-    this.rollerShadesCard,
48
-    this.wirelessAudioCard,
49
-    this.coffeeMakerCard,
50
-  ];
51
-
52
-  statusCardsByThemes: {
53
-    default: CardSettings[];
54
-    cosmic: CardSettings[];
55
-    corporate: CardSettings[];
56
-    dark: CardSettings[];
57
-  } = {
58
-    default: this.commonStatusCardsSet,
59
-    cosmic: this.commonStatusCardsSet,
60
-    corporate: [
61
-      {
62
-        ...this.lightCard,
63
-        type: 'warning',
64
-      },
65
-      {
66
-        ...this.rollerShadesCard,
67
-        type: 'primary',
68
-      },
69
-      {
70
-        ...this.wirelessAudioCard,
71
-        type: 'danger',
72
-      },
73
-      {
74
-        ...this.coffeeMakerCard,
75
-        type: 'info',
76
-      },
77
-    ],
78
-    dark: this.commonStatusCardsSet,
79
-  };
80
-
81
-  constructor(private themeService: NbThemeService,
82
-              private solarService: SolarData) {
83
-    this.themeService.getJsTheme()
84
-      .pipe(takeWhile(() => this.alive))
85
-      .subscribe(theme => {
86
-        this.statusCards = this.statusCardsByThemes[theme.name];
87
-    });
88
-
89
-    this.solarService.getSolarData()
90
-      .pipe(takeWhile(() => this.alive))
91
-      .subscribe((data) => {
92
-        this.solarValue = data;
93
-      });
94
-  }
95
-
96
-  ngOnDestroy() {
97
-    this.alive = false;
98
-  }
99
-}

+ 0
- 69
src/frontend/src/app/demo_pages/dashboard/dashboard.module.ts Voir le fichier

@@ -1,69 +0,0 @@
1
-import { NgModule } from '@angular/core';
2
-import {
3
-  NbActionsModule,
4
-  NbButtonModule,
5
-  NbCardModule,
6
-  NbTabsetModule,
7
-  NbUserModule,
8
-  NbRadioModule,
9
-  NbSelectModule,
10
-  NbListModule,
11
-  NbIconModule,
12
-} from '@nebular/theme';
13
-import { NgxEchartsModule } from 'ngx-echarts';
14
-
15
-import { ThemeModule } from '../../@theme/theme.module';
16
-import { DashboardComponent } from './dashboard.component';
17
-import { StatusCardComponent } from './status-card/status-card.component';
18
-import { ContactsComponent } from './contacts/contacts.component';
19
-import { RoomsComponent } from './rooms/rooms.component';
20
-import { RoomSelectorComponent } from './rooms/room-selector/room-selector.component';
21
-import { TemperatureComponent } from './temperature/temperature.component';
22
-import { TemperatureDraggerComponent } from './temperature/temperature-dragger/temperature-dragger.component';
23
-import { KittenComponent } from './kitten/kitten.component';
24
-import { SecurityCamerasComponent } from './security-cameras/security-cameras.component';
25
-import { ElectricityComponent } from './electricity/electricity.component';
26
-import { ElectricityChartComponent } from './electricity/electricity-chart/electricity-chart.component';
27
-import { WeatherComponent } from './weather/weather.component';
28
-import { SolarComponent } from './solar/solar.component';
29
-import { PlayerComponent } from './rooms/player/player.component';
30
-import { TrafficComponent } from './traffic/traffic.component';
31
-import { TrafficChartComponent } from './traffic/traffic-chart.component';
32
-import { FormsModule } from '@angular/forms';
33
-
34
-@NgModule({
35
-  imports: [
36
-    FormsModule,
37
-    ThemeModule,
38
-    NbCardModule,
39
-    NbUserModule,
40
-    NbButtonModule,
41
-    NbTabsetModule,
42
-    NbActionsModule,
43
-    NbRadioModule,
44
-    NbSelectModule,
45
-    NbListModule,
46
-    NbIconModule,
47
-    NbButtonModule,
48
-    NgxEchartsModule,
49
-  ],
50
-  declarations: [
51
-    DashboardComponent,
52
-    StatusCardComponent,
53
-    TemperatureDraggerComponent,
54
-    ContactsComponent,
55
-    RoomSelectorComponent,
56
-    TemperatureComponent,
57
-    RoomsComponent,
58
-    KittenComponent,
59
-    SecurityCamerasComponent,
60
-    ElectricityComponent,
61
-    ElectricityChartComponent,
62
-    WeatherComponent,
63
-    PlayerComponent,
64
-    SolarComponent,
65
-    TrafficComponent,
66
-    TrafficChartComponent,
67
-  ],
68
-})
69
-export class DashboardModule { }

+ 0
- 14
src/frontend/src/app/demo_pages/dashboard/electricity/electricity-chart/electricity-chart.component.scss Voir le fichier

@@ -1,14 +0,0 @@
1
-@import '../../../../@theme/styles/themes';
2
-
3
-@include nb-install-component() {
4
-
5
-  display: block;
6
-  flex: 1;
7
-  position: relative;
8
-
9
-  .echart {
10
-    position: absolute;
11
-    width: 100%;
12
-    height: 100%;
13
-  }
14
-}

+ 0
- 197
src/frontend/src/app/demo_pages/dashboard/electricity/electricity-chart/electricity-chart.component.ts Voir le fichier

@@ -1,197 +0,0 @@
1
-import { delay, takeWhile } from 'rxjs/operators';
2
-import { AfterViewInit, Component, Input, OnDestroy } from '@angular/core';
3
-import { NbThemeService } from '@nebular/theme';
4
-import { LayoutService } from '../../../../@core/utils';
5
-import { ElectricityChart } from '../../../../@core/data/electricity';
6
-
7
-@Component({
8
-  selector: 'ngx-electricity-chart',
9
-  styleUrls: ['./electricity-chart.component.scss'],
10
-  template: `
11
-    <div echarts
12
-         [options]="option"
13
-         class="echart"
14
-         (chartInit)="onChartInit($event)">
15
-    </div>
16
-  `,
17
-})
18
-export class ElectricityChartComponent implements AfterViewInit, OnDestroy {
19
-
20
-  private alive = true;
21
-
22
-  @Input() data: ElectricityChart[];
23
-
24
-  option: any;
25
-  echartsIntance: any;
26
-
27
-  constructor(private theme: NbThemeService,
28
-              private layoutService: LayoutService) {
29
-    this.layoutService.onChangeLayoutSize()
30
-      .pipe(
31
-        takeWhile(() => this.alive),
32
-      )
33
-      .subscribe(() => this.resizeChart());
34
-  }
35
-
36
-  ngAfterViewInit(): void {
37
-    this.theme.getJsTheme()
38
-      .pipe(
39
-        takeWhile(() => this.alive),
40
-        delay(1),
41
-      )
42
-      .subscribe(config => {
43
-        const eTheme: any = config.variables.electricity;
44
-
45
-        this.option = {
46
-          grid: {
47
-            left: 0,
48
-            top: 0,
49
-            right: 0,
50
-            bottom: 80,
51
-          },
52
-          tooltip: {
53
-            trigger: 'axis',
54
-            axisPointer: {
55
-              type: 'line',
56
-              lineStyle: {
57
-                color: eTheme.tooltipLineColor,
58
-                width: eTheme.tooltipLineWidth,
59
-              },
60
-            },
61
-            textStyle: {
62
-              color: eTheme.tooltipTextColor,
63
-              fontSize: 20,
64
-              fontWeight: eTheme.tooltipFontWeight,
65
-            },
66
-            position: 'top',
67
-            backgroundColor: eTheme.tooltipBg,
68
-            borderColor: eTheme.tooltipBorderColor,
69
-            borderWidth: 1,
70
-            formatter: '{c0} kWh',
71
-            extraCssText: eTheme.tooltipExtraCss,
72
-          },
73
-          xAxis: {
74
-            type: 'category',
75
-            boundaryGap: false,
76
-            offset: 25,
77
-            data: this.data.map(i => i.label),
78
-            axisTick: {
79
-              show: false,
80
-            },
81
-            axisLabel: {
82
-              color: eTheme.xAxisTextColor,
83
-              fontSize: 18,
84
-            },
85
-            axisLine: {
86
-              lineStyle: {
87
-                color: eTheme.axisLineColor,
88
-                width: '2',
89
-              },
90
-            },
91
-          },
92
-          yAxis: {
93
-            boundaryGap: [0, '5%'],
94
-            axisLine: {
95
-              show: false,
96
-            },
97
-            axisLabel: {
98
-              show: false,
99
-            },
100
-            axisTick: {
101
-              show: false,
102
-            },
103
-            splitLine: {
104
-              show: true,
105
-              lineStyle: {
106
-                color: eTheme.yAxisSplitLine,
107
-                width: '1',
108
-              },
109
-            },
110
-          },
111
-          series: [
112
-            {
113
-              type: 'line',
114
-              smooth: true,
115
-              symbolSize: 20,
116
-              itemStyle: {
117
-                normal: {
118
-                  opacity: 0,
119
-                },
120
-                emphasis: {
121
-                  color: '#ffffff',
122
-                  borderColor: eTheme.itemBorderColor,
123
-                  borderWidth: 2,
124
-                  opacity: 1,
125
-                },
126
-              },
127
-              lineStyle: {
128
-                normal: {
129
-                  width: eTheme.lineWidth,
130
-                  type: eTheme.lineStyle,
131
-                  color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
132
-                    offset: 0,
133
-                    color: eTheme.lineGradFrom,
134
-                  }, {
135
-                    offset: 1,
136
-                    color: eTheme.lineGradTo,
137
-                  }]),
138
-                  shadowColor: eTheme.lineShadow,
139
-                  shadowBlur: 6,
140
-                  shadowOffsetY: 12,
141
-                },
142
-              },
143
-              areaStyle: {
144
-                normal: {
145
-                  color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
146
-                    offset: 0,
147
-                    color: eTheme.areaGradFrom,
148
-                  }, {
149
-                    offset: 1,
150
-                    color: eTheme.areaGradTo,
151
-                  }]),
152
-                },
153
-              },
154
-              data: this.data.map(i => i.value),
155
-            },
156
-
157
-            {
158
-              type: 'line',
159
-              smooth: true,
160
-              symbol: 'none',
161
-              lineStyle: {
162
-                normal: {
163
-                  width: eTheme.lineWidth,
164
-                  type: eTheme.lineStyle,
165
-                  color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
166
-                    offset: 0,
167
-                    color: eTheme.lineGradFrom,
168
-                  }, {
169
-                    offset: 1,
170
-                    color: eTheme.lineGradTo,
171
-                  }]),
172
-                  shadowColor: eTheme.shadowLineDarkBg,
173
-                  shadowBlur: 14,
174
-                  opacity: 1,
175
-                },
176
-              },
177
-              data: this.data.map(i => i.value),
178
-            },
179
-          ],
180
-        };
181
-    });
182
-  }
183
-
184
-  onChartInit(echarts) {
185
-    this.echartsIntance = echarts;
186
-  }
187
-
188
-  resizeChart() {
189
-    if (this.echartsIntance) {
190
-      this.echartsIntance.resize();
191
-    }
192
-  }
193
-
194
-  ngOnDestroy() {
195
-    this.alive = false;
196
-  }
197
-}

+ 0
- 47
src/frontend/src/app/demo_pages/dashboard/electricity/electricity.component.html Voir le fichier

@@ -1,47 +0,0 @@
1
-<nb-card class="cards-container">
2
-  <nb-card size="large" class="table-card">
3
-    <nb-card-header>
4
-      Electricity Consumption
5
-    </nb-card-header>
6
-
7
-    <nb-tabset fullWidth>
8
-      <nb-tab *ngFor="let year of listData" [tabTitle]="year.title" [active]="year.active">
9
-        <nb-list>
10
-          <nb-list-item *ngFor="let month of year.months">
11
-            <span class="month">{{ month.month }}</span>
12
-            <span>
13
-              <nb-icon
14
-                [class.down]="month.down"
15
-                [class.up]="!month.down"
16
-                [icon]="month.down ? 'arrow-down' : 'arrow-up'" pack="eva">
17
-              </nb-icon>
18
-              {{ month.delta }}
19
-            </span>
20
-            <span class="results">
21
-              {{ month.kWatts }} <span class="caption">kWh</span> / {{ month.cost }} <span class="caption">USD</span>
22
-            </span>
23
-          </nb-list-item>
24
-        </nb-list>
25
-      </nb-tab>
26
-    </nb-tabset>
27
-  </nb-card>
28
-
29
-  <nb-card size="large" class="chart-card">
30
-    <nb-card-header>
31
-      <span class="stats">
32
-        <span class="caption">Consumed</span>
33
-        <span>816 <span class="caption">kWh</span></span>
34
-      </span>
35
-      <span class="stats">
36
-        <span class="caption">Spent</span>
37
-        <span>291 <span class="caption">USD</span></span>
38
-      </span>
39
-
40
-      <nb-select [(selected)]="type" class="type-select">
41
-        <nb-option *ngFor="let t of types" [value]="t">{{ t }}</nb-option>
42
-      </nb-select>
43
-    </nb-card-header>
44
-
45
-    <ngx-electricity-chart [data]="chartData"></ngx-electricity-chart>
46
-  </nb-card>
47
-</nb-card>

+ 0
- 90
src/frontend/src/app/demo_pages/dashboard/electricity/electricity.component.scss Voir le fichier

@@ -1,90 +0,0 @@
1
-@import '../../../@theme/styles/themes';
2
-@import '~bootstrap/scss/mixins/breakpoints';
3
-@import '~@nebular/theme/styles/global/breakpoints';
4
-
5
-@include nb-install-component() {
6
-
7
-  .cards-container {
8
-    display: flex;
9
-    flex-direction: row;
10
-    overflow: hidden;
11
-  }
12
-
13
-  .table-card,
14
-  .chart-card {
15
-    box-shadow: none;
16
-    margin-bottom: 0;
17
-    border-width: 0;
18
-  }
19
-
20
-  .table-card {
21
-    flex: 0 0 auto;
22
-  }
23
-
24
-  .chart-card {
25
-    flex: 1 0 auto;
26
-  }
27
-
28
-  .chart-card nb-card-header {
29
-    display: flex;
30
-    align-items: center;
31
-    padding-top: nb-theme(card-header-with-select-padding-top);
32
-    padding-bottom: nb-theme(card-header-with-select-padding-bottom);
33
-
34
-    // prevents double border from chart yAxisSplitLine
35
-    margin-bottom: -1px;
36
-  }
37
-
38
-  .type-select {
39
-    margin-left: auto;
40
-  }
41
-
42
-  .stats {
43
-    margin-right: 1rem;
44
-
45
-    > .caption {
46
-      display: block;
47
-    }
48
-  }
49
-
50
-  nb-tabset {
51
-    display: flex;
52
-    flex-direction: column;
53
-    overflow: hidden;
54
-  }
55
-
56
-  nb-tab {
57
-    padding: 0;
58
-  }
59
-
60
-  nb-list-item {
61
-    display: flex;
62
-    align-items: baseline;
63
-
64
-    &:first-child {
65
-      border-top: none;
66
-    }
67
-  }
68
-
69
-  .month {
70
-    width: 2rem;
71
-  }
72
-
73
-  nb-icon.down {
74
-    color: nb-theme(color-danger-default);
75
-  }
76
-
77
-  nb-icon.up {
78
-    color: nb-theme(color-success-default);
79
-  }
80
-
81
-  .results {
82
-    margin-left: auto;
83
-  }
84
-
85
-  @include media-breakpoint-down(xl) {
86
-    .table-card {
87
-      display: none;
88
-    }
89
-  }
90
-}

+ 0
- 48
src/frontend/src/app/demo_pages/dashboard/electricity/electricity.component.ts Voir le fichier

@@ -1,48 +0,0 @@
1
-import { Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-
4
-import { Electricity, ElectricityChart, ElectricityData } from '../../../@core/data/electricity';
5
-import { takeWhile } from 'rxjs/operators';
6
-import { forkJoin } from 'rxjs';
7
-
8
-@Component({
9
-  selector: 'ngx-electricity',
10
-  styleUrls: ['./electricity.component.scss'],
11
-  templateUrl: './electricity.component.html',
12
-})
13
-export class ElectricityComponent implements OnDestroy {
14
-
15
-  private alive = true;
16
-
17
-  listData: Electricity[];
18
-  chartData: ElectricityChart[];
19
-
20
-  type = 'week';
21
-  types = ['week', 'month', 'year'];
22
-
23
-  currentTheme: string;
24
-  themeSubscription: any;
25
-
26
-  constructor(private electricityService: ElectricityData,
27
-              private themeService: NbThemeService) {
28
-    this.themeService.getJsTheme()
29
-      .pipe(takeWhile(() => this.alive))
30
-      .subscribe(theme => {
31
-        this.currentTheme = theme.name;
32
-    });
33
-
34
-    forkJoin(
35
-      this.electricityService.getListData(),
36
-      this.electricityService.getChartData(),
37
-    )
38
-      .pipe(takeWhile(() => this.alive))
39
-      .subscribe(([listData, chartData]: [Electricity[], ElectricityChart[]] ) => {
40
-        this.listData = listData;
41
-        this.chartData = chartData;
42
-      });
43
-  }
44
-
45
-  ngOnDestroy() {
46
-    this.alive = false;
47
-  }
48
-}

+ 0
- 25
src/frontend/src/app/demo_pages/dashboard/kitten/kitten.component.html Voir le fichier

@@ -1,25 +0,0 @@
1
-<nb-card size="medium">
2
-  <div class="picture" style.background-image="url('assets/images/kitten-{{currentTheme}}.png')"></div>
3
-
4
-  <div class="details">
5
-    <div class="h4">UI Kitten</div>
6
-    <div class="description">
7
-      UI Kitten is a framework that contains a set of commonly used UI components styled in a similar way. The most awesome thing: you can change themes on the fly by just passing a different set of variables. 100% native. Give our kitten a try!
8
-    </div>
9
-  </div>
10
-
11
-  <nb-card-footer>
12
-    <a href="https://akveo.github.io/react-native-ui-kitten" target="_blank">
13
-      <nb-icon icon="globe" pack="eva"></nb-icon>
14
-    </a>
15
-    <a href="https://itunes.apple.com/us/app/kitten-tricks/id1246143230" target="_blank">
16
-      <i class="link-icon ion-social-apple"></i>
17
-    </a>
18
-    <a href="https://play.google.com/store/apps/details?id=com.akveo.kittenTricks" target="_blank">
19
-      <i class="link-icon ion-social-android"></i>
20
-    </a>
21
-    <a href="https://github.com/akveo/react-native-ui-kitten" target="_blank">
22
-      <nb-icon icon="github" pack="eva"></nb-icon>
23
-    </a>
24
-  </nb-card-footer>
25
-</nb-card>

+ 0
- 39
src/frontend/src/app/demo_pages/dashboard/kitten/kitten.component.scss Voir le fichier

@@ -1,39 +0,0 @@
1
-@import '../../../@theme/styles/themes';
2
-
3
-@include nb-install-component() {
4
-
5
-  .picture {
6
-    background-position: center;
7
-    background-size: cover;
8
-    position: relative;
9
-    border-top-left-radius: nb-theme(card-border-radius);
10
-    border-top-right-radius: nb-theme(card-border-radius);
11
-    flex: 1;
12
-  }
13
-
14
-  .details {
15
-    padding: nb-theme(card-padding);
16
-  }
17
-
18
-  .description {
19
-    text-align: justify;
20
-  }
21
-
22
-  nb-card-footer {
23
-    display: flex;
24
-    justify-content: space-around;
25
-    align-items: center;
26
-  }
27
-
28
-  .link-icon {
29
-    font-size: 1.75rem;
30
-  }
31
-
32
-  nb-icon {
33
-    font-size: 1.55rem;
34
-
35
-    ::ng-deep svg {
36
-      vertical-align: top;
37
-    }
38
-  }
39
-}

+ 0
- 23
src/frontend/src/app/demo_pages/dashboard/kitten/kitten.component.ts Voir le fichier

@@ -1,23 +0,0 @@
1
-import { Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-
4
-@Component({
5
-  selector: 'ngx-kitten',
6
-  styleUrls: ['./kitten.component.scss'],
7
-  templateUrl: './kitten.component.html',
8
-})
9
-export class KittenComponent implements OnDestroy {
10
-
11
-  currentTheme: string;
12
-  themeSubscription: any;
13
-
14
-  constructor(private themeService: NbThemeService) {
15
-    this.themeSubscription = this.themeService.getJsTheme().subscribe(theme => {
16
-      this.currentTheme = theme.name;
17
-    });
18
-  }
19
-
20
-  ngOnDestroy() {
21
-    this.themeSubscription.unsubscribe();
22
-  }
23
-}

+ 0
- 59
src/frontend/src/app/demo_pages/dashboard/rooms/player/player.component.html Voir le fichier

@@ -1,59 +0,0 @@
1
-<nb-card>
2
-  <nb-card-header class="header">My Playlist</nb-card-header>
3
-
4
-  <nb-card-body class="body">
5
-    <div class="track-info">
6
-      <div class="cover" style.background-image="url('{{track.cover}}')"></div>
7
-      <div class="details">
8
-        <h4 [class.subtitle]="collapsed">{{ track.name }}</h4>
9
-        <span>{{ track.artist }}</span>
10
-      </div>
11
-    </div>
12
-
13
-    <div class="progress-wrap">
14
-      <input dir="ltr" type="range" class="progress" [value]="getProgress()" min="0" max="100" step="0.01"
15
-             (input)="setProgress(duration.value)" #duration>
16
-      <div class="progress-foreground" [style.width.%]="getProgress()"></div>
17
-    </div>
18
-
19
-    <div class="timing">
20
-      <small class="current">{{ player.currentTime | timing }}</small>
21
-      <small class="remaining">- {{ player.duration - player.currentTime | timing }}</small>
22
-    </div>
23
-
24
-    <div class="controls">
25
-      <button class="control-button" nbButton ghost size="tiny" (click)="toggleShuffle()" [class.on]="shuffle">
26
-        <nb-icon icon="shuffle-2-outline" pack="eva"></nb-icon>
27
-      </button>
28
-      <button class="control-button" nbButton ghost size="medium" (click)="prev()">
29
-        <nb-icon class="skip" icon="skip-back-outline" pack="eva"></nb-icon>
30
-      </button>
31
-      <button class="control-button play-button" nbButton ghost size="medium" (click)="playPause()">
32
-        <nb-icon class="play" [icon]="player.paused ? 'play-circle-outline' : 'pause-circle-outline'" pack="eva">
33
-        </nb-icon>
34
-      </button>
35
-      <button class="control-button skip-forward-button" nbButton ghost size="medium" (click)="next()">
36
-        <nb-icon class="skip" icon="skip-forward-outline" pack="eva"></nb-icon>
37
-      </button>
38
-      <button class="control-button" nbButton ghost size="tiny" (click)="toggleLoop()" [class.on]="player.loop">
39
-        <nb-icon icon="repeat-outline" pack="eva"></nb-icon>
40
-      </button>
41
-    </div>
42
-  </nb-card-body>
43
-
44
-  <nb-card-footer class="footer">
45
-    <div class="volume">
46
-      <button nbButton ghost size="small" (click)="setVolume(0)">
47
-        <nb-icon class="volume-icon" icon="volume-down-outline" pack="eva"></nb-icon>
48
-      </button>
49
-      <div class="progress-wrap">
50
-        <input type="range" class="progress" [value]="getVolume()" max="100"
51
-               (input)="setVolume(volume.value)" #volume>
52
-        <div class="progress-foreground" [style.width.%]="getVolume()"></div>
53
-      </div>
54
-      <button nbButton ghost size="small" (click)="setVolume(100)">
55
-        <nb-icon class="volume-icon" icon="volume-up-outline" pack="eva"></nb-icon>
56
-      </button>
57
-    </div>
58
-  </nb-card-footer>
59
-</nb-card>

+ 0
- 283
src/frontend/src/app/demo_pages/dashboard/rooms/player/player.component.scss Voir le fichier

@@ -1,283 +0,0 @@
1
-@import '../../../../@theme/styles/themes';
2
-@import '~bootstrap/scss/mixins/breakpoints';
3
-@import '~@nebular/theme/styles/global/breakpoints';
4
-
5
-@include nb-install-component() {
6
-  height: 100%;
7
-
8
-  nb-card {
9
-    box-shadow: none;
10
-    border-width: 0;
11
-    margin: 0;
12
-    height: 100%;
13
-  }
14
-
15
-  .body {
16
-    display: flex;
17
-    flex-direction: column;
18
-    padding: 0;
19
-  }
20
-
21
-  .track-info {
22
-    display: flex;
23
-    align-items: center;
24
-    justify-content: center;
25
-    flex-direction: column;
26
-    flex: 1;
27
-    padding: nb-theme(card-padding);
28
-  }
29
-
30
-  .cover {
31
-    border-radius: nb-theme(card-border-radius);
32
-    background-size: cover;
33
-    background-position: center;
34
-    background-repeat: no-repeat;
35
-    width: 10rem;
36
-    height: 10rem;
37
-  }
38
-
39
-  .details {
40
-    text-align: center;
41
-    padding-top: 1.5rem;
42
-
43
-    span {
44
-      color: nb-theme(text-hint-color);
45
-    }
46
-  }
47
-
48
-  .progress-wrap {
49
-    position: relative;
50
-    height: 1rem;
51
-  }
52
-
53
-  .progress-foreground {
54
-    background-color: nb-theme(color-primary-default);
55
-    height: 2px;
56
-    position: absolute;
57
-    left: 0;
58
-    margin-top: calc(0.75rem - 1px);
59
-    width: 100px;
60
-  }
61
-
62
-  .progress {
63
-    appearance: none;
64
-    width: 100%;
65
-    background: transparent;
66
-    height: 1.5rem;
67
-    outline: none;
68
-    position: absolute;
69
-
70
-    @include install-thumb() {
71
-      width: 1rem;
72
-      height: 1rem;
73
-      border-radius: 50%;
74
-      background: nb-theme(color-primary-default);
75
-      cursor: pointer;
76
-      margin-top: calc(-0.5rem + 1px);
77
-      border: none;
78
-    }
79
-
80
-    @include install-track() {
81
-      width: 100%;
82
-      height: 2px;
83
-      cursor: pointer;
84
-      background: nb-theme(border-basic-color-3);
85
-    }
86
-  }
87
-
88
-  .timing {
89
-    padding-top: 0.5rem;
90
-    margin: 0 0.5rem;
91
-    display: flex;
92
-    justify-content: space-between;
93
-    color: nb-theme(text-hint-color);
94
-
95
-    .current {
96
-      @include nb-ltr(order, 0);
97
-      @include nb-rtl(order, 1);
98
-    }
99
-    .remaining {
100
-      @include nb-ltr(order, 1);
101
-      @include nb-rtl(order, 0);
102
-    }
103
-  }
104
-
105
-  .controls {
106
-    display: flex;
107
-    justify-content: space-between;
108
-    align-items: center;
109
-    @include nb-rtl(flex-direction, row-reverse);
110
-    padding: 1rem;
111
-    max-width: 400px;
112
-    width: 100%;
113
-    margin: 0 auto;
114
-  }
115
-
116
-  .control-button {
117
-    color: nb-theme(text-hint-color);
118
-
119
-    &.on {
120
-      color: nb-theme(color-primary-default);
121
-    }
122
-
123
-    nb-icon {
124
-      font-size: 1.5em;
125
-    }
126
-  }
127
-
128
-  .volume {
129
-    display: flex;
130
-    justify-content: space-between;
131
-    align-items: center;
132
-    margin: 0 auto;
133
-    position: relative;
134
-    max-width: 400px;
135
-
136
-    .progress-wrap {
137
-      height: 2.25rem;
138
-      margin: 0;
139
-      width: 80%;
140
-
141
-      .progress-foreground {
142
-        left: auto;
143
-        margin-top: calc(1rem + 1px);
144
-        z-index: 0;
145
-        max-width: 99.5%;
146
-      }
147
-
148
-      .progress {
149
-        height: 2.25rem;
150
-        overflow: visible;
151
-
152
-        @include install-thumb() {
153
-          width: 1.5rem;
154
-          height: 1.5rem;
155
-          background-color: nb-theme(background-basic-color-1);
156
-          box-shadow: 0 0.125rem 0.5rem 0 nb-theme(border-basic-color-3);
157
-          border: 1px solid nb-theme(border-basic-color-3);
158
-          margin-top: -0.75rem;
159
-          position: relative;
160
-          z-index: 10;
161
-        }
162
-      }
163
-    }
164
-  }
165
-
166
-  .volume-icon {
167
-    font-size: 1em;
168
-    color: nb-theme(text-hint-color);
169
-  }
170
-
171
-  &.collapsed {
172
-    $player-height: 4.5rem;
173
-
174
-    border: none;
175
-    height: $player-height;
176
-
177
-    .header {
178
-      display: none;
179
-    }
180
-
181
-    .body {
182
-      display: flex;
183
-      flex-direction: row;
184
-      justify-content: space-between;
185
-      align-items: center;
186
-      padding: 0;
187
-      overflow: visible;
188
-    }
189
-
190
-    .footer {
191
-      display: none;
192
-    }
193
-
194
-    .track-info {
195
-      height: $player-height;
196
-      flex-direction: row;
197
-      padding: 0;
198
-      flex: none;
199
-
200
-      .cover {
201
-        height: $player-height;
202
-        width: $player-height;
203
-        flex: none;
204
-      }
205
-
206
-      .details {
207
-        margin-left: 0.875rem;
208
-        text-align: left;
209
-        padding: 0;
210
-
211
-        h4 {
212
-          margin-bottom: 0.125rem;
213
-        }
214
-      }
215
-    }
216
-
217
-    .progress-wrap {
218
-      width: calc(100% - 6rem);
219
-      align-self: flex-start;
220
-      position: absolute;
221
-      left: 0;
222
-      margin-top: calc(-0.75rem + 1px);
223
-      margin-left: calc(#{$player-height} + 0.75rem);
224
-    }
225
-
226
-    .timing {
227
-      display: none;
228
-    }
229
-
230
-    .controls {
231
-      padding: 0 1rem 0 0;
232
-      max-width: inherit;
233
-      width: inherit;
234
-      margin: 0;
235
-
236
-      button {
237
-        display: none;
238
-      }
239
-      .play-button,
240
-      .skip-forward-button {
241
-        display: block;
242
-        font-size: 1.3rem;
243
-      }
244
-
245
-      @include media-breakpoint-down(is) {
246
-        .play-button,
247
-        .skip-forward-button {
248
-          padding: 0.5rem;
249
-        }
250
-      }
251
-
252
-      @include media-breakpoint-down(xs) {
253
-        .skip-forward-button {
254
-          display: none;
255
-        }
256
-      }
257
-    }
258
-
259
-    .volume {
260
-      display: none;
261
-    }
262
-
263
-    .track-info .details {
264
-      @include media-breakpoint-down(is) {
265
-        span {
266
-          display: inline-block;
267
-          overflow: hidden;
268
-          text-overflow: ellipsis;
269
-        }
270
-      }
271
-    }
272
-  }
273
-
274
-  @include media-breakpoint-between(lg, lg) {
275
-    .controls {
276
-      padding: 0.5rem;
277
-    }
278
-
279
-    .control-button.size-medium {
280
-      padding: nb-theme(button-ghost-small-padding);
281
-    }
282
-  }
283
-}

+ 0
- 100
src/frontend/src/app/demo_pages/dashboard/rooms/player/player.component.ts Voir le fichier

@@ -1,100 +0,0 @@
1
-import { Component, HostBinding, Input, OnDestroy } from '@angular/core';
2
-import { PlayerService, Track } from '../../../../@core/utils/player.service';
3
-
4
-@Component({
5
-  selector: 'ngx-player',
6
-  styleUrls: ['./player.component.scss'],
7
-  templateUrl: './player.component.html',
8
-})
9
-export class PlayerComponent implements OnDestroy {
10
-  @Input()
11
-  @HostBinding('class.collapsed')
12
-  collapsed: boolean;
13
-
14
-  track: Track;
15
-  player: HTMLAudioElement;
16
-  shuffle: boolean;
17
-
18
-  constructor(private playerService: PlayerService) {
19
-    this.track = this.playerService.random();
20
-    this.createPlayer();
21
-  }
22
-
23
-  ngOnDestroy() {
24
-    this.player.pause();
25
-    this.player.src = '';
26
-    this.player.load();
27
-  }
28
-
29
-  prev() {
30
-    if (!this.player.loop) {
31
-      if (this.shuffle) {
32
-        this.track = this.playerService.random();
33
-      } else {
34
-        this.track = this.playerService.prev();
35
-      }
36
-    }
37
-
38
-    this.reload();
39
-  }
40
-
41
-  next() {
42
-    if (!this.player.loop) {
43
-      if (this.shuffle) {
44
-        this.track = this.playerService.random();
45
-      } else {
46
-        this.track = this.playerService.next();
47
-      }
48
-    }
49
-
50
-    this.reload();
51
-  }
52
-
53
-  playPause() {
54
-    if (this.player.paused) {
55
-      this.player.play();
56
-    } else {
57
-      this.player.pause();
58
-    }
59
-  }
60
-
61
-  toggleShuffle() {
62
-    this.shuffle = !this.shuffle;
63
-  }
64
-
65
-  toggleLoop() {
66
-    this.player.loop = !this.player.loop;
67
-  }
68
-
69
-  setVolume(volume: number) {
70
-    this.player.volume = volume / 100;
71
-  }
72
-
73
-  getVolume(): number {
74
-    return this.player.volume * 100;
75
-  }
76
-
77
-  setProgress(duration: number) {
78
-    this.player.currentTime = this.player.duration * duration / 100;
79
-  }
80
-
81
-  getProgress(): number {
82
-    return this.player.currentTime / this.player.duration * 100 || 0;
83
-  }
84
-
85
-  private createPlayer() {
86
-    this.player = new Audio();
87
-    this.player.onended = () => this.next();
88
-    this.setTrack();
89
-  }
90
-
91
-  private reload() {
92
-    this.setTrack();
93
-    this.player.play();
94
-  }
95
-
96
-  private setTrack() {
97
-    this.player.src = this.track.url;
98
-    this.player.load();
99
-  }
100
-}

+ 0
- 90
src/frontend/src/app/demo_pages/dashboard/rooms/room-selector/room-selector.component.html Voir le fichier

@@ -1,90 +0,0 @@
1
-<nb-card>
2
-  <nb-card-header>Room Management</nb-card-header>
3
-  <div class="room-selector">
4
-    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
5
-         [attr.viewBox]="viewBox" preserveAspectRatio="xMidYMid">
6
-      <defs>
7
-
8
-        <filter id="f2" x="-50%" y="-50%" width="200%" height="200%">
9
-          <feGaussianBlur result="blurOut" in="StrokePaint" stdDeviation="3"/>
10
-        </filter>
11
-
12
-        <pattern id="New_Pattern_Swatch_1" data-name="New Pattern Swatch 1" width="60" height="60"
13
-                 patternUnits="userSpaceOnUse" viewBox="0 0 60 60">
14
-          <line class="stroke-pattern" x1="-113.26" y1="123.26" x2="3.26" y2="6.74"/>
15
-          <line class="stroke-pattern" x1="-103.26" y1="133.26" x2="13.26" y2="16.74"/>
16
-          <line class="stroke-pattern" x1="-93.26" y1="143.26" x2="23.26" y2="26.74"/>
17
-          <line class="stroke-pattern" x1="-83.26" y1="153.26" x2="33.26" y2="36.74"/>
18
-          <line class="stroke-pattern" x1="-73.26" y1="163.26" x2="43.26" y2="46.74"/>
19
-          <line class="stroke-pattern" x1="-63.26" y1="173.26" x2="53.26" y2="56.74"/>
20
-          <line class="stroke-pattern" x1="-53.26" y1="123.26" x2="63.26" y2="6.74"/>
21
-          <line class="stroke-pattern" x1="-43.26" y1="133.26" x2="73.26" y2="16.74"/>
22
-          <line class="stroke-pattern" x1="-33.26" y1="143.26" x2="83.26" y2="26.74"/>
23
-          <line class="stroke-pattern" x1="-23.26" y1="153.26" x2="93.26" y2="36.74"/>
24
-          <line class="stroke-pattern" x1="-13.26" y1="163.26" x2="103.26" y2="46.74"/>
25
-          <line class="stroke-pattern" x1="-3.26" y1="173.26" x2="113.26" y2="56.74"/>
26
-          <line class="stroke-pattern" x1="6.74" y1="123.26" x2="123.26" y2="6.74"/>
27
-          <line class="stroke-pattern" x1="16.74" y1="133.26" x2="133.26" y2="16.74"/>
28
-          <line class="stroke-pattern" x1="26.74" y1="143.26" x2="143.26" y2="26.74"/>
29
-          <line class="stroke-pattern" x1="36.74" y1="153.26" x2="153.26" y2="36.74"/>
30
-          <line class="stroke-pattern" x1="46.74" y1="163.26" x2="163.26" y2="46.74"/>
31
-          <line class="stroke-pattern" x1="56.74" y1="173.26" x2="173.26" y2="56.74"/>
32
-          <line class="stroke-pattern" x1="-113.26" y1="63.26" x2="3.26" y2="-53.26"/>
33
-          <line class="stroke-pattern" x1="-103.26" y1="73.26" x2="13.26" y2="-43.26"/>
34
-          <line class="stroke-pattern" x1="-93.26" y1="83.26" x2="23.26" y2="-33.26"/>
35
-          <line class="stroke-pattern" x1="-83.26" y1="93.26" x2="33.26" y2="-23.26"/>
36
-          <line class="stroke-pattern" x1="-73.26" y1="103.26" x2="43.26" y2="-13.26"/>
37
-          <line class="stroke-pattern" x1="-63.26" y1="113.26" x2="53.26" y2="-3.26"/>
38
-          <line class="stroke-pattern" x1="-53.26" y1="63.26" x2="63.26" y2="-53.26"/>
39
-          <line class="stroke-pattern" x1="-43.26" y1="73.26" x2="73.26" y2="-43.26"/>
40
-          <line class="stroke-pattern" x1="-33.26" y1="83.26" x2="83.26" y2="-33.26"/>
41
-          <line class="stroke-pattern" x1="-23.26" y1="93.26" x2="93.26" y2="-23.26"/>
42
-          <line class="stroke-pattern" x1="-13.26" y1="103.26" x2="103.26" y2="-13.26"/>
43
-          <line class="stroke-pattern" x1="-3.26" y1="113.26" x2="113.26" y2="-3.26"/>
44
-          <line class="stroke-pattern" x1="6.74" y1="63.26" x2="123.26" y2="-53.26"/>
45
-          <line class="stroke-pattern" x1="16.74" y1="73.26" x2="133.26" y2="-43.26"/>
46
-          <line class="stroke-pattern" x1="26.74" y1="83.26" x2="143.26" y2="-33.26"/>
47
-          <line class="stroke-pattern" x1="36.74" y1="93.26" x2="153.26" y2="-23.26"/>
48
-          <line class="stroke-pattern" x1="46.74" y1="103.26" x2="163.26" y2="-13.26"/>
49
-          <line class="stroke-pattern" x1="56.74" y1="113.26" x2="173.26" y2="-3.26"/>
50
-          <line class="stroke-pattern" x1="-113.26" y1="3.26" x2="3.26" y2="-113.26"/>
51
-          <line class="stroke-pattern" x1="-103.26" y1="13.26" x2="13.26" y2="-103.26"/>
52
-          <line class="stroke-pattern" x1="-93.26" y1="23.26" x2="23.26" y2="-93.26"/>
53
-          <line class="stroke-pattern" x1="-83.26" y1="33.26" x2="33.26" y2="-83.26"/>
54
-          <line class="stroke-pattern" x1="-73.26" y1="43.26" x2="43.26" y2="-73.26"/>
55
-          <line class="stroke-pattern" x1="-63.26" y1="53.26" x2="53.26" y2="-63.26"/>
56
-          <line class="stroke-pattern" x1="-53.26" y1="3.26" x2="63.26" y2="-113.26"/>
57
-          <line class="stroke-pattern" x1="-43.26" y1="13.26" x2="73.26" y2="-103.26"/>
58
-          <line class="stroke-pattern" x1="-33.26" y1="23.26" x2="83.26" y2="-93.26"/>
59
-          <line class="stroke-pattern" x1="-23.26" y1="33.26" x2="93.26" y2="-83.26"/>
60
-          <line class="stroke-pattern" x1="-13.26" y1="43.26" x2="103.26" y2="-73.26"/>
61
-          <line class="stroke-pattern" x1="-3.26" y1="53.26" x2="113.26" y2="-63.26"/>
62
-          <line class="stroke-pattern" x1="6.74" y1="3.26" x2="123.26" y2="-113.26"/>
63
-          <line class="stroke-pattern" x1="16.74" y1="13.26" x2="133.26" y2="-103.26"/>
64
-          <line class="stroke-pattern" x1="26.74" y1="23.26" x2="143.26" y2="-93.26"/>
65
-          <line class="stroke-pattern" x1="36.74" y1="33.26" x2="153.26" y2="-83.26"/>
66
-          <line class="stroke-pattern" x1="46.74" y1="43.26" x2="163.26" y2="-73.26"/>
67
-          <line class="stroke-pattern" x1="56.74" y1="53.26" x2="173.26" y2="-63.26"/>
68
-        </pattern>
69
-      </defs>
70
-
71
-      <g>
72
-        <path class="room-border" [attr.d]="border.d" *ngFor="let border of roomSvg.borders" />
73
-      </g>
74
-
75
-      <g>
76
-        <path class="stroked-element"
77
-              [attr.fill]="getUrlPath('#New_Pattern_Swatch_1')"
78
-              [attr.d]="strokedArea.d" *ngFor="let strokedArea of roomSvg.stokedAreas"/>
79
-      </g>
80
-
81
-      <g [attr.id]="room.id" [class.selected-room]="selectedRoom == room.id" *ngFor="let room of sortedRooms">
82
-        <path class="room-bg" (click)="selectRoom(room.id)" [attr.d]="room.area.d" [style.filter]="isIE || isFirefox ? 'inherit': ''" />
83
-        <path class="room-border" [attr.d]="room.border.d" />
84
-        <path class="room-border room-border-glow" [attr.d]="room.border.d" [style.filter]="isIE || isFirefox ? 'inherit': ''" />
85
-        <text class="room-text" (click)="selectRoom(room.id)" text-anchor="middle"
86
-              [attr.x]="room.name.x" [attr.y]="room.name.y">{{room.name.text}}</text>
87
-      </g>
88
-    </svg>
89
-  </div>
90
-</nb-card>

+ 0
- 76
src/frontend/src/app/demo_pages/dashboard/rooms/room-selector/room-selector.component.scss Voir le fichier

@@ -1,76 +0,0 @@
1
-@import '../../../../@theme/styles/themes';
2
-
3
-@include nb-install-component() {
4
-
5
-  nb-card {
6
-    background-color: transparent;
7
-    border-width: 0;
8
-    box-shadow: none;
9
-    margin: 0;
10
-  }
11
-
12
-  nb-card-header {
13
-    border-color: transparent;
14
-  }
15
-
16
-  svg {
17
-    width: 100%;
18
-  }
19
-
20
-  .stroke-pattern {
21
-    fill: none;
22
-    stroke: #bdc4cd;
23
-    stroke-miterlimit: 10;
24
-    opacity: 0.1;
25
-    stroke-width: 1px;
26
-  }
27
-
28
-  .stroked-element {
29
-    stroke-width: 4px;
30
-    stroke: #bdc4cd;
31
-    stroke-miterlimit: 10;
32
-  }
33
-
34
-  .room-border {
35
-    stroke-width: 4px;
36
-    stroke: #bdc4cd;
37
-    stroke-miterlimit: 10;
38
-    fill: none;
39
-  }
40
-
41
-  .room-bg {
42
-    fill: nb-theme(card-background-color);
43
-    stroke: transparent;
44
-    cursor: pointer;
45
-    stroke-width: 4px;
46
-  }
47
-
48
-  .room-bg-border-grad {
49
-    fill: none;
50
-    stroke: none;
51
-    stroke-width: 4px;
52
-  }
53
-
54
-  .room-text {
55
-    cursor: pointer;
56
-    user-select: none;
57
-    pointer-events: none;
58
-    fill: nb-theme(text-hint-color);
59
-  }
60
-
61
-  .selected-room {
62
-    z-index: 40;
63
-
64
-    .room-text {
65
-      fill: nb-theme(text-basic-color);
66
-    }
67
-    .room-border {
68
-      stroke: nb-theme(color-primary-default);
69
-    }
70
-  }
71
-
72
-  .header {
73
-    border-bottom: none;
74
-    padding-bottom: 0;
75
-  }
76
-}

+ 0
- 122
src/frontend/src/app/demo_pages/dashboard/rooms/room-selector/room-selector.component.ts Voir le fichier

@@ -1,122 +0,0 @@
1
-import { Component, EventEmitter, HostBinding, OnDestroy, OnInit, Output } from '@angular/core';
2
-import { Location, LocationStrategy } from '@angular/common';
3
-import { NbThemeService } from '@nebular/theme';
4
-import { map, takeUntil } from 'rxjs/operators';
5
-import { Subject } from 'rxjs';
6
-
7
-@Component({
8
-  selector: 'ngx-room-selector',
9
-  templateUrl: './room-selector.component.html',
10
-  styleUrls: ['./room-selector.component.scss'],
11
-})
12
-export class RoomSelectorComponent implements OnInit, OnDestroy {
13
-
14
-  private destroy$ = new Subject<void>();
15
-  private hideGrid: boolean;
16
-
17
-  @Output() select: EventEmitter<number> = new EventEmitter();
18
-
19
-  selectedRoom = null;
20
-  sortedRooms = [];
21
-  viewBox = '-20 -20 618.88 407.99';
22
-  isIE = !!(navigator.userAgent.match(/Trident/)
23
-            || navigator.userAgent.match(/MSIE/)
24
-            || navigator.userAgent.match(/Edge/));
25
-  isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') >= 0;
26
-  roomSvg = {
27
-    borders: [{
28
-      d: 'M186.21,130.05H216.37V160H186.21Z',
29
-    }],
30
-    stokedAreas: [
31
-      { d: 'M562.71,225V354h-290V319H418.37a6.09,6.09,0,0,0,6.09-6.09V225Z' },
32
-      { d: 'M8.09,130V347.91A6.09,6.09,0,0,0,14.18,354h54V130Z' },
33
-      { d: 'M216.37,49.82H358.8V92.5H216.37Z' },
34
-    ],
35
-    rooms: [
36
-      {
37
-        id: '0',
38
-        name: { text: 'Kitchen', x: 142, y: 240.8 },
39
-        area: { d: 'M68.18,130V359.9A6.09,6.09,0,0,0,74.27,366h136a6.09,6.09,0,0,0,6.09-6.09V160H186.21V130Z' },
40
-        border: { d: 'M96,130H68.18V359.9A6.09,6.09,0,0,0,74.27,366h136a6.09,6.09,0,0,0,6.09-6.09V225 M152.71,' +
41
-          '130H186.21V160H218.5' },
42
-      },
43
-      {
44
-        id: '1',
45
-        name: { text: 'Bedroom', x: 109, y: 66 },
46
-        area: { d: 'M152.71,130h63.66V8.09A6.09,6.09,0,0,0,210.27,2H8.09A6.09,6.09,0,0,0,2,8.09V123.95A6.09,' +
47
-          '6.09,0,0,0,8.09,130H96Z' },
48
-        border: { d: 'M152.71,130h63.66V8.09A6.09,6.09,0,0,0,210.27,2H8.09A6.09,6.09,0,0,0,2,8.09V123.95A6.09' +
49
-          ',6.09,0,0,0,8.09,130H96' },
50
-      },
51
-      {
52
-        id: '2',
53
-        name: { text: 'Living Room', x: 468, y: 134 },
54
-        area: { d: 'M358.8,160V49.82a6.09,6.09,0,0,1,6.09-6.09H570.78a6.09,6.09,0,0,1,6.09,6.09V218.9a6.09' +
55
-          ',6.09,0,0,1-6.09,6.09h-212Z' },
56
-        border: { d: 'M358.8,160V49.82a6.09,6.09,0,0,1,6.09-6.09H570.78a6.09,6.09,0,0,1,6.09,6.09V218.9a6.09' +
57
-          ',6.09,0,0,1-6.09,6.09h-212' },
58
-      },
59
-      {
60
-        id: '3',
61
-        name: { text: 'Hallway', x: 320, y: 273 },
62
-        area: { d: 'M216.37,354V92.5H358.8V225H424.39V319H272.71V354Z' },
63
-        border: { d: 'M216.37,225V356 M216.21,162V92.5H358.8V160 M358.8,225H424.39V312.91a6.09,' +
64
-          '6.09,0,0,1,-6.09,6.09H272.71V356' },
65
-      },
66
-    ],
67
-  };
68
-
69
-  @HostBinding('style.background')
70
-  get background(): 'none' | null {
71
-    return this.hideGrid ? 'none' : null;
72
-  }
73
-
74
-  constructor(
75
-    private location: Location,
76
-    private locationStrategy: LocationStrategy,
77
-    private themeService: NbThemeService,
78
-  ) {
79
-    this.selectRoom('2');
80
-  }
81
-
82
-  ngOnInit() {
83
-    this.hideGrid = this.themeService.currentTheme === 'corporate';
84
-
85
-    this.themeService.onThemeChange()
86
-      .pipe(
87
-        map(({ name }) => name === 'corporate'),
88
-        takeUntil(this.destroy$),
89
-      )
90
-      .subscribe((hideGrid: boolean) => this.hideGrid = hideGrid);
91
-  }
92
-
93
-  ngOnDestroy() {
94
-    this.destroy$.next();
95
-    this.destroy$.complete();
96
-  }
97
-
98
-  private sortRooms() {
99
-    this.sortedRooms = this.roomSvg.rooms.slice(0).sort((a, b) => {
100
-      if (a.id === this.selectedRoom) {
101
-        return 1;
102
-      }
103
-      if (b.id === this.selectedRoom) {
104
-        return -1;
105
-      }
106
-      return 0;
107
-    });
108
-  }
109
-
110
-  selectRoom(roomNumber) {
111
-    this.select.emit(roomNumber);
112
-    this.selectedRoom = roomNumber;
113
-    this.sortRooms();
114
-  }
115
-
116
-  getUrlPath(id: string) {
117
-    const baseHref = this.locationStrategy.getBaseHref().replace(/\/$/, '');
118
-    const path = this.location.path().replace(/\/$/, '');
119
-
120
-    return `url(${baseHref}${path}${id})`;
121
-  }
122
-}

+ 0
- 67
src/frontend/src/app/demo_pages/dashboard/rooms/rooms.component.scss Voir le fichier

@@ -1,67 +0,0 @@
1
-@import '../../../@theme/styles/themes';
2
-@import '~bootstrap/scss/mixins/breakpoints';
3
-@import '~@nebular/theme/styles/global/breakpoints';
4
-
5
-@include nb-install-component() {
6
-  ngx-room-selector {
7
-    width: 70%;
8
-    border-right: nb-theme(divider-width) nb-theme(divider-style) nb-theme(divider-color);
9
-    background: url('../../../../assets/images/square_pattern.svg') repeat;
10
-    background-size: 75px;
11
-
12
-    &.dark-background {
13
-      background-image: url('../../../../assets/images/square_pattern_cosmic.svg');
14
-    }
15
-  }
16
-
17
-  ngx-player {
18
-    width: 30%;
19
-  }
20
-
21
-  nb-card {
22
-    display: flex;
23
-    flex-direction: row;
24
-  }
25
-
26
-  ngx-room-selector {
27
-    display: flex;
28
-    flex-direction: column;
29
-    flex: 1;
30
-
31
-    ::ng-deep .room-selector {
32
-      display: flex;
33
-      align-items: center;
34
-      justify-items: center;
35
-      flex: 1;
36
-      margin: 0 auto;
37
-      width: 90%;
38
-      max-width: 650px;
39
-      padding-bottom: 1rem;
40
-    }
41
-  }
42
-
43
-  @include media-breakpoint-down(md) {
44
-    &.expanded ngx-room-selector {
45
-      display: none;
46
-    }
47
-
48
-    ngx-room-selector, ngx-player {
49
-      width: 100%;
50
-      border: none;
51
-    }
52
-
53
-    nb-card {
54
-      flex-direction: column;
55
-      justify-content: space-between;
56
-
57
-      .collapse {
58
-        display: inline-block;
59
-        position: absolute;
60
-        top: 0.7rem;
61
-        left: 50%;
62
-        transform: translateX(-50%);
63
-        font-size: 2rem;
64
-      }
65
-    }
66
-  }
67
-}

+ 0
- 77
src/frontend/src/app/demo_pages/dashboard/rooms/rooms.component.ts Voir le fichier

@@ -1,77 +0,0 @@
1
-import { Component, HostBinding, OnDestroy } from '@angular/core';
2
-import { NbThemeService, NbMediaBreakpoint, NbMediaBreakpointsService } from '@nebular/theme';
3
-import { map } from 'rxjs/operators';
4
-
5
-@Component({
6
-  selector: 'ngx-rooms',
7
-  styleUrls: ['./rooms.component.scss'],
8
-  template: `
9
-    <nb-card [size]="breakpoint.width >= breakpoints.sm ? 'giant' : ''">
10
-      <nb-icon icon="arrow-ios-downward" pack="eva"
11
-               (click)="collapse()"
12
-               class="collapse"
13
-               [hidden]="isCollapsed()">
14
-      </nb-icon>
15
-      <ngx-room-selector [class.dark-background]="isDarkTheme" (select)="select($event)"></ngx-room-selector>
16
-      <ngx-player [collapsed]="isCollapsed() && breakpoint.width <= breakpoints.md"></ngx-player>
17
-    </nb-card>
18
-  `,
19
-})
20
-export class RoomsComponent implements OnDestroy {
21
-
22
-  @HostBinding('class.expanded')
23
-  private expanded: boolean;
24
-  private selected: number;
25
-
26
-  isDarkTheme: boolean;
27
-
28
-  breakpoint: NbMediaBreakpoint;
29
-  breakpoints: any;
30
-  themeSubscription: any;
31
-  themeChangeSubscription: any;
32
-
33
-  constructor(private themeService: NbThemeService,
34
-              private breakpointService: NbMediaBreakpointsService) {
35
-
36
-    this.breakpoints = this.breakpointService.getBreakpointsMap();
37
-    this.themeSubscription = this.themeService.onMediaQueryChange()
38
-      .subscribe(([, newValue]) => {
39
-        this.breakpoint = newValue;
40
-      });
41
-
42
-    this.themeChangeSubscription = this.themeService.onThemeChange()
43
-      .pipe(map(({ name }) => name === 'cosmic' || name === 'dark'))
44
-      .subscribe((isDark: boolean) => this.isDarkTheme = isDark);
45
-  }
46
-
47
-  select(roomNumber) {
48
-    if (this.isSelected(roomNumber)) {
49
-      this.expand();
50
-    } else {
51
-      this.collapse();
52
-    }
53
-
54
-    this.selected = roomNumber;
55
-  }
56
-
57
-  expand() {
58
-    this.expanded = true;
59
-  }
60
-
61
-  collapse() {
62
-    this.expanded = false;
63
-  }
64
-
65
-  isCollapsed() {
66
-    return !this.expanded;
67
-  }
68
-
69
-  private isSelected(roomNumber): boolean {
70
-    return this.selected === roomNumber;
71
-  }
72
-
73
-  ngOnDestroy() {
74
-    this.themeSubscription.unsubscribe();
75
-    this.themeChangeSubscription.unsubscribe();
76
-  }
77
-}

+ 0
- 61
src/frontend/src/app/demo_pages/dashboard/security-cameras/security-cameras.component.html Voir le fichier

@@ -1,61 +0,0 @@
1
-<nb-card size="giant">
2
-
3
-  <nb-card-header>
4
-    Security Cameras
5
-
6
-    <button class="single-view-button"
7
-            nbButton
8
-            size="small"
9
-            [appearance]="isSingleView ? 'filled' : 'outline'"
10
-            (click)="isSingleView = true">
11
-      <i class="nb-square"></i>
12
-    </button>
13
-    <button class="grid-view-button"
14
-            nbButton
15
-            size="small"
16
-            [appearance]="isSingleView ? 'outline' : 'filled'"
17
-            (click)="isSingleView = false">
18
-      <nb-icon icon="grid" pack="eva"></nb-icon>
19
-    </button>
20
-  </nb-card-header>
21
-
22
-  <div class="grid-container">
23
-
24
-    <div class="single-view" *ngIf="isSingleView">
25
-      <div class="camera" [style.background-image]="'url(' + selectedCamera.source + ')'">
26
-        <span class="camera-name">{{ selectedCamera.title }}</span>
27
-      </div>
28
-    </div>
29
-
30
-    <div class="grid-view" *ngIf="!isSingleView">
31
-      <div class="camera"
32
-           *ngFor="let camera of cameras"
33
-           [style.background-image]="'url(' + camera.source + ')'"
34
-           (click)="selectCamera(camera)">
35
-        <span class="camera-name">{{ camera.title }}</span>
36
-      </div>
37
-    </div>
38
-
39
-  </div>
40
-
41
-  <nb-card-footer>
42
-    <nb-actions [size]="actionSize" fullWidth>
43
-      <nb-action>
44
-        <nb-icon icon="pause-circle-outline" pack="eva"></nb-icon>
45
-        Pause
46
-      </nb-action>
47
-      <nb-action>
48
-        <nb-icon icon="list-outline" pack="eva"></nb-icon>
49
-        Logs
50
-      </nb-action>
51
-      <nb-action>
52
-        <nb-icon icon="search-outline" pack="eva"></nb-icon>
53
-        Search
54
-      </nb-action>
55
-      <nb-action>
56
-        <nb-icon icon="settings-2-outline" pack="eva"></nb-icon>
57
-        Setup
58
-      </nb-action>
59
-    </nb-actions>
60
-  </nb-card-footer>
61
-</nb-card>

+ 0
- 114
src/frontend/src/app/demo_pages/dashboard/security-cameras/security-cameras.component.scss Voir le fichier

@@ -1,114 +0,0 @@
1
-@import '../../../@theme/styles/themes';
2
-@import '~@nebular/theme/styles/global/breakpoints';
3
-@import '~bootstrap/scss/mixins/breakpoints';
4
-
5
-@include nb-install-component() {
6
-
7
-  nb-card-header {
8
-    display: flex;
9
-    align-items: center;
10
-    padding-top: 0.625rem;
11
-    padding-bottom: 0.625rem;
12
-  }
13
-
14
-  .single-view-button {
15
-    .nb-square {
16
-      font-size: 1.25rem;
17
-    }
18
-
19
-    @include nb-ltr {
20
-      margin-left: auto;
21
-      border-top-right-radius: 0;
22
-      border-bottom-right-radius: 0;
23
-    }
24
-    @include nb-rtl {
25
-      margin-right: auto;
26
-      border-top-left-radius: 0;
27
-      border-bottom-left-radius: 0;
28
-    }
29
-  }
30
-
31
-  .grid-view-button {
32
-    ::ng-deep svg {
33
-      vertical-align: top;
34
-    }
35
-
36
-    @include nb-ltr {
37
-      border-top-left-radius: 0;
38
-      border-bottom-left-radius: 0;
39
-    }
40
-    @include nb-rtl {
41
-      border-top-right-radius: 0;
42
-      border-bottom-right-radius: 0;
43
-    }
44
-  }
45
-
46
-  .grid-container {
47
-    height: 100%;
48
-    display: flex;
49
-  }
50
-
51
-  .single-view,
52
-  .grid-view {
53
-    flex: 1 0 100%;
54
-  }
55
-
56
-  .grid-view {
57
-    display: flex;
58
-    flex-wrap: wrap;
59
-
60
-    .camera {
61
-      flex: 1 0 50%;
62
-    }
63
-  }
64
-
65
-  .single-view .camera {
66
-    width: 100%;
67
-    height: 100%;
68
-  }
69
-
70
-  .camera {
71
-    background-position: center;
72
-    background-size: cover;
73
-    position: relative;
74
-
75
-    &::before {
76
-      background-color: rgba(255, 255, 255, 0.1);
77
-      content: '';
78
-      position: absolute;
79
-      width: 100%;
80
-      height: 100%;
81
-      opacity: 1;
82
-    }
83
-
84
-    &:hover::before {
85
-      opacity: 0;
86
-    }
87
-  }
88
-
89
-  .camera-name {
90
-    position: absolute;
91
-    bottom: 0;
92
-    width: 100%;
93
-    color: white;
94
-    background: nb-theme(overlay-backdrop-background-color);
95
-    padding: 0.5rem 1rem;
96
-  }
97
-
98
-  nb-action {
99
-    nb-icon {
100
-      @include nb-ltr(margin-right, 0.5rem);
101
-      @include nb-rtl(margin-left, 0.5rem);
102
-    }
103
-
104
-    ::ng-deep svg {
105
-      vertical-align: top;
106
-    }
107
-  }
108
-
109
-  @include media-breakpoint-down(xl) {
110
-    nb-action {
111
-      padding: 0;
112
-    }
113
-  }
114
-}

+ 0
- 53
src/frontend/src/app/demo_pages/dashboard/security-cameras/security-cameras.component.ts Voir le fichier

@@ -1,53 +0,0 @@
1
-import { Component, OnDestroy, OnInit } from '@angular/core';
2
-import { map, takeUntil } from 'rxjs/operators';
3
-import { Subject } from 'rxjs';
4
-import { NbComponentSize, NbMediaBreakpointsService, NbThemeService } from '@nebular/theme';
5
-
6
-import { Camera, SecurityCamerasData } from '../../../@core/data/security-cameras';
7
-
8
-@Component({
9
-  selector: 'ngx-security-cameras',
10
-  styleUrls: ['./security-cameras.component.scss'],
11
-  templateUrl: './security-cameras.component.html',
12
-})
13
-export class SecurityCamerasComponent implements OnInit, OnDestroy {
14
-
15
-  private destroy$ = new Subject<void>();
16
-
17
-  cameras: Camera[];
18
-  selectedCamera: Camera;
19
-  isSingleView = false;
20
-  actionSize: NbComponentSize = 'medium';
21
-
22
-  constructor(
23
-    private themeService: NbThemeService,
24
-    private breakpointService: NbMediaBreakpointsService,
25
-    private securityCamerasService: SecurityCamerasData,
26
-  ) {}
27
-
28
-  ngOnInit() {
29
-    this.securityCamerasService.getCamerasData()
30
-      .pipe(takeUntil(this.destroy$))
31
-      .subscribe((cameras: Camera[]) => {
32
-        this.cameras = cameras;
33
-        this.selectedCamera = this.cameras[0];
34
-      });
35
-
36
-    const breakpoints = this.breakpointService.getBreakpointsMap();
37
-    this.themeService.onMediaQueryChange()
38
-      .pipe(map(([, breakpoint]) => breakpoint.width))
39
-      .subscribe((width: number) => {
40
-        this.actionSize = width > breakpoints.md ? 'medium' : 'small';
41
-      });
42
-  }
43
-
44
-  ngOnDestroy() {
45
-    this.destroy$.next();
46
-    this.destroy$.complete();
47
-  }
48
-
49
-  selectCamera(camera: any) {
50
-    this.selectedCamera = camera;
51
-    this.isSingleView = true;
52
-  }
53
-}

+ 0
- 30
src/frontend/src/app/demo_pages/dashboard/solar/solar.component.scss Voir le fichier

@@ -1,30 +0,0 @@
1
-@import '../../../@theme/styles/themes';
2
-@import '~@nebular/theme/styles/global/breakpoints';
3
-@import '~bootstrap/scss/mixins/breakpoints';
4
-
5
-@include nb-install-component() {
6
-
7
-  nb-card-body {
8
-    overflow: hidden;
9
-  }
10
-
11
-  .echart {
12
-    position: absolute;
13
-    left: 1em;
14
-    height: calc(100% - 2 * 1rem);
15
-    width: 40%;
16
-  }
17
-
18
-  .info {
19
-    margin-left: 45%;
20
-    padding-top: 1rem;
21
-  }
22
-
23
-  .value {
24
-    margin: 0;
25
-  }
26
-
27
-  .details {
28
-    color: nb-theme(text-hint-color);
29
-  }
30
-}

+ 0
- 186
src/frontend/src/app/demo_pages/dashboard/solar/solar.component.ts Voir le fichier

@@ -1,186 +0,0 @@
1
-import { delay } from 'rxjs/operators';
2
-import { AfterViewInit, Component, Input, OnDestroy } from '@angular/core';
3
-import { NbThemeService } from '@nebular/theme';
4
-
5
-declare const echarts: any;
6
-
7
-@Component({
8
-  selector: 'ngx-solar',
9
-  styleUrls: ['./solar.component.scss'],
10
-  template: `
11
-    <nb-card size="tiny" class="solar-card">
12
-      <nb-card-header>Solar Energy Consumption</nb-card-header>
13
-      <nb-card-body>
14
-        <div echarts [options]="option" class="echart">
15
-        </div>
16
-        <div class="info">
17
-          <div class="h4 value">6.421 kWh</div>
18
-          <div class="details subtitle-2"><span>out of</span> 8.421 kWh</div>
19
-        </div>
20
-      </nb-card-body>
21
-    </nb-card>
22
-  `,
23
-})
24
-export class SolarComponent implements AfterViewInit, OnDestroy {
25
-
26
-  private value = 0;
27
-
28
-  @Input('chartValue')
29
-  set chartValue(value: number) {
30
-    this.value = value;
31
-
32
-    if (this.option.series) {
33
-      this.option.series[0].data[0].value = value;
34
-      this.option.series[0].data[1].value = 100 - value;
35
-      this.option.series[1].data[0].value = value;
36
-    }
37
-  }
38
-
39
-  option: any = {};
40
-  themeSubscription: any;
41
-
42
-  constructor(private theme: NbThemeService) {
43
-  }
44
-
45
-  ngAfterViewInit() {
46
-    this.themeSubscription = this.theme.getJsTheme().pipe(delay(1)).subscribe(config => {
47
-
48
-      const solarTheme: any = config.variables.solar;
49
-
50
-      this.option = Object.assign({}, {
51
-        tooltip: {
52
-          trigger: 'item',
53
-          formatter: '{a} <br/>{b} : {c} ({d}%)',
54
-        },
55
-        series: [
56
-          {
57
-            name: ' ',
58
-            clockWise: true,
59
-            hoverAnimation: false,
60
-            type: 'pie',
61
-            center: ['45%', '50%'],
62
-            radius: solarTheme.radius,
63
-            data: [
64
-              {
65
-                value: this.value,
66
-                name: ' ',
67
-                label: {
68
-                  normal: {
69
-                    position: 'center',
70
-                    formatter: '{d}%',
71
-                    textStyle: {
72
-                      fontSize: '22',
73
-                      fontFamily: config.variables.fontSecondary,
74
-                      fontWeight: '600',
75
-                      color: config.variables.fgHeading,
76
-                    },
77
-                  },
78
-                },
79
-                tooltip: {
80
-                  show: false,
81
-                },
82
-                itemStyle: {
83
-                  normal: {
84
-                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
85
-                      {
86
-                        offset: 0,
87
-                        color: solarTheme.gradientLeft,
88
-                      },
89
-                      {
90
-                        offset: 1,
91
-                        color: solarTheme.gradientRight,
92
-                      },
93
-                    ]),
94
-                    shadowColor: solarTheme.shadowColor,
95
-                    shadowBlur: 0,
96
-                    shadowOffsetX: 0,
97
-                    shadowOffsetY: 3,
98
-                  },
99
-                },
100
-                hoverAnimation: false,
101
-              },
102
-              {
103
-                value: 100 - this.value,
104
-                name: ' ',
105
-                tooltip: {
106
-                  show: false,
107
-                },
108
-                label: {
109
-                  normal: {
110
-                    position: 'inner',
111
-                  },
112
-                },
113
-                itemStyle: {
114
-                  normal: {
115
-                    color: solarTheme.secondSeriesFill,
116
-                  },
117
-                },
118
-              },
119
-            ],
120
-          },
121
-          {
122
-            name: ' ',
123
-            clockWise: true,
124
-            hoverAnimation: false,
125
-            type: 'pie',
126
-            center: ['45%', '50%'],
127
-            radius: solarTheme.radius,
128
-            data: [
129
-              {
130
-                value: this.value,
131
-                name: ' ',
132
-                label: {
133
-                  normal: {
134
-                    position: 'inner',
135
-                    show: false,
136
-                  },
137
-                },
138
-                tooltip: {
139
-                  show: false,
140
-                },
141
-                itemStyle: {
142
-                  normal: {
143
-                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
144
-                      {
145
-                        offset: 0,
146
-                        color: solarTheme.gradientLeft,
147
-                      },
148
-                      {
149
-                        offset: 1,
150
-                        color: solarTheme.gradientRight,
151
-                      },
152
-                    ]),
153
-                    shadowColor: solarTheme.shadowColor,
154
-                    shadowBlur: 7,
155
-                  },
156
-                },
157
-                hoverAnimation: false,
158
-              },
159
-              {
160
-                value: 28,
161
-                name: ' ',
162
-                tooltip: {
163
-                  show: false,
164
-                },
165
-                label: {
166
-                  normal: {
167
-                    position: 'inner',
168
-                  },
169
-                },
170
-                itemStyle: {
171
-                  normal: {
172
-                    color: 'none',
173
-                  },
174
-                },
175
-              },
176
-            ],
177
-          },
178
-        ],
179
-      });
180
-    });
181
-  }
182
-
183
-  ngOnDestroy() {
184
-    this.themeSubscription.unsubscribe();
185
-  }
186
-}

+ 0
- 79
src/frontend/src/app/demo_pages/dashboard/status-card/status-card.component.scss Voir le fichier

@@ -1,79 +0,0 @@
1
-@import '../../../@theme/styles/themes';
2
-
3
-@include nb-install-component() {
4
-  nb-card {
5
-    flex-direction: row;
6
-    align-items: center;
7
-    height: 6rem;
8
-    overflow: visible;
9
-
10
-    .icon-container {
11
-      height: 100%;
12
-      padding: 0.625rem;
13
-    }
14
-
15
-    .icon {
16
-      display: flex;
17
-      align-items: center;
18
-      justify-content: center;
19
-      width: 5.75rem;
20
-      height: 4.75rem;
21
-      font-size: 3.75rem;
22
-      border-radius: nb-theme(card-border-radius);
23
-      transition: width 0.4s ease;
24
-      transform: translate3d(0, 0, 0);
25
-      -webkit-transform-style: preserve-3d;
26
-      -webkit-backface-visibility: hidden;
27
-      color: nb-theme(text-control-color);
28
-
29
-      @each $status in nb-get-statuses() {
30
-        &.status-#{$status} {
31
-          $left-color: nb-theme(button-hero-#{$status}-left-background-color);
32
-          $right-color: nb-theme(button-hero-#{$status}-right-background-color);
33
-          background-image: linear-gradient(to right, $left-color, $right-color);
34
-
35
-          &:hover {
36
-            $left-hover-color: nb-theme(button-hero-#{$status}-hover-left-background-color);
37
-            $right-hover-color: nb-theme(button-hero-#{$status}-hover-right-background-color);
38
-            background-image: linear-gradient(to right, $left-hover-color, $right-hover-color);
39
-          }
40
-        }
41
-      }
42
-    }
43
-
44
-    &.off {
45
-      color: nb-theme(text-hint-color);
46
-
47
-      .status,
48
-      .title,
49
-      .icon {
50
-        color: nb-theme(text-hint-color);
51
-      }
52
-
53
-      @each $status in nb-get-statuses() {
54
-        .icon.status-#{$status} {
55
-          box-shadow: none;
56
-          background-image: linear-gradient(to right, transparent, transparent);
57
-        }
58
-      }
59
-    }
60
-
61
-    .details {
62
-      display: flex;
63
-      flex-direction: column;
64
-      justify-content: center;
65
-      height: 100%;
66
-      @include nb-ltr(padding, 0 0.5rem 0 0.75rem);
67
-      @include nb-rtl(padding, 0 0.75rem 0 0.5rem);
68
-      border-left: 1px solid transparent;
69
-    }
70
-
71
-    .title {
72
-      margin: 0;
73
-    }
74
-
75
-    .status {
76
-      text-transform: uppercase;
77
-    }
78
-  }
79
-}

+ 0
- 26
src/frontend/src/app/demo_pages/dashboard/status-card/status-card.component.ts Voir le fichier

@@ -1,26 +0,0 @@
1
-import { Component, Input } from '@angular/core';
2
-
3
-@Component({
4
-  selector: 'ngx-status-card',
5
-  styleUrls: ['./status-card.component.scss'],
6
-  template: `
7
-    <nb-card (click)="on = !on" [ngClass]="{'off': !on}">
8
-      <div class="icon-container">
9
-        <div class="icon status-{{ type }}">
10
-          <ng-content></ng-content>
11
-        </div>
12
-      </div>
13
-
14
-      <div class="details">
15
-        <div class="title h5">{{ title }}</div>
16
-        <div class="status paragraph-2">{{ on ? 'ON' : 'OFF' }}</div>
17
-      </div>
18
-    </nb-card>
19
-  `,
20
-})
21
-export class StatusCardComponent {
22
-
23
-  @Input() title: string;
24
-  @Input() type: string;
25
-  @Input() on = true;
26
-}

+ 0
- 47
src/frontend/src/app/demo_pages/dashboard/temperature/temperature-dragger/temperature-dragger.component.html Voir le fichier

@@ -1,47 +0,0 @@
1
-<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsAQMAAABDsxw2AAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAACJJREFUaN7twTEBAAAAwiD7pzbFPmAAAAAAAAAAAAAAAGQOLbQAAU3zwM4AAAAASUVORK5CYII=">
2
-
3
-<div class="svg-container">
4
-  <svg #svgRoot xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
5
-       [attr.viewBox]="styles.viewBox" preserveAspectRatio="xMinYMin meet" (mousedown)="mouseDown($event)">
6
-    <defs>
7
-
8
-      <filter [attr.id]="'blurFilter' + svgControlId" x="0" y="0" width="100%" height="100%">
9
-        <feGaussianBlur in="SourceGraphic" [attr.stdDeviation]="styles.blurRadius" />
10
-        <feComponentTransfer>
11
-          <feFuncA type="discrete" tableValues="1 1"/>
12
-        </feComponentTransfer>
13
-      </filter>
14
-
15
-      <clipPath [attr.id]="'sliderClip' + svgControlId">
16
-        <path [attr.d]="styles.clipPathStr" stroke="black"></path>
17
-      </clipPath>
18
-
19
-    </defs>
20
-    <g [attr.transform]="styles.arcTranslateStr">
21
-
22
-      <g class="toClip" [attr.clip-path]="getUrlPath('#sliderClip')">
23
-        <g class="toFilter" [attr.filter]="getUrlPath('#blurFilter')">
24
-          <path [attr.d]="arc.d" [attr.fill]="off ? styles.nonSelectedArc.color : arc.color" *ngFor="let arc of styles.gradArcs"></path>
25
-        </g>
26
-        <!-- ngFor is a quirk fix for webkit rendering issues -->
27
-        <path [attr.d]="styles.nonSelectedArc.d" [attr.fill]="styles.nonSelectedArc.color" *ngFor="let number of [0,1,2,3,4,5]"></path>
28
-      </g>
29
-
30
-      <circle [attr.cx]="styles.thumbPosition.x"
31
-              [attr.cy]="styles.thumbPosition.y"
32
-              [attr.r]="pinRadius"
33
-              [attr.stroke-width]="thumbBorder / scaleFactor"
34
-              [attr.fill]="off ? 'none' : thumbBg"
35
-              [attr.stroke]="off ? 'none' : thumbBorderColor">
36
-      </circle>
37
-    </g>
38
-  </svg>
39
-</div>
40
-
41
-<div class="temperature-bg">
42
-  <ng-content></ng-content>
43
-</div>
44
-
45
-<button nbButton appearance="ghost" class="power-bg" [class.on]="!off" (click)="switchPower()">
46
-  <nb-icon class="power-icon" icon="power-outline" pack="eva"></nb-icon>
47
-</button>

+ 0
- 63
src/frontend/src/app/demo_pages/dashboard/temperature/temperature-dragger/temperature-dragger.component.scss Voir le fichier

@@ -1,63 +0,0 @@
1
-@import '../../../../@theme/styles/themes';
2
-
3
-@include nb-install-component() {
4
-  position: relative;
5
-
6
-  img {
7
-    width: 100%;
8
-    height: auto;
9
-    visibility: hidden;
10
-  }
11
-
12
-  .svg-container {
13
-    position: absolute;
14
-    left: 0;
15
-    top: 0;
16
-    width: 100%;
17
-    height: 100%;
18
-    z-index: 2;
19
-  }
20
-
21
-  .temperature-bg {
22
-    position: absolute;
23
-    width: 88%;
24
-    height: 88%;
25
-    top: 13%;
26
-    left: 6%;
27
-    border-radius: 50%;
28
-    z-index: 1;
29
-
30
-    display: flex;
31
-    flex-direction: column;
32
-    align-items: center;
33
-    justify-content: center;
34
-
35
-    border: nb-theme(divider-width) nb-theme(divider-style) nb-theme(divider-color);
36
-  }
37
-
38
-  .power-bg {
39
-    position: absolute;
40
-    width: 5.25rem;
41
-    height: 5.25rem;
42
-    background-color: nb-theme(card-background-color);
43
-    border-radius: 50%;
44
-    bottom: 2%;
45
-    left: 50%;
46
-    transform: translate(-50%, 50%);
47
-    z-index: 2;
48
-
49
-    display: flex;
50
-    align-items: center;
51
-    justify-content: center;
52
-    cursor: pointer;
53
-    border: nb-theme(divider-width) nb-theme(divider-style) nb-theme(divider-color);
54
-
55
-    &.on {
56
-      color: nb-theme(text-hint-color);
57
-    }
58
-  }
59
-
60
-  .power-icon {
61
-    font-size: 3rem;
62
-  }
63
-}

+ 0
- 380
src/frontend/src/app/demo_pages/dashboard/temperature/temperature-dragger/temperature-dragger.component.ts Voir le fichier

@@ -1,380 +0,0 @@
1
-import {
2
-  Component,
3
-  HostListener,
4
-  ViewChild,
5
-  ElementRef,
6
-  Input,
7
-  Output,
8
-  EventEmitter,
9
-  AfterViewInit,
10
-  OnChanges,
11
-} from '@angular/core';
12
-import { Location, LocationStrategy } from '@angular/common';
13
-
14
-let uniqueId = 0;
15
-const VIEW_BOX_SIZE = 300;
16
-
17
-@Component({
18
-  selector: 'ngx-temperature-dragger',
19
-  templateUrl: './temperature-dragger.component.html',
20
-  styleUrls: ['./temperature-dragger.component.scss'],
21
-})
22
-export class TemperatureDraggerComponent implements AfterViewInit, OnChanges {
23
-
24
-  @ViewChild('svgRoot', { static: true }) svgRoot: ElementRef;
25
-
26
-  @Input() fillColors: string|string[];
27
-  @Input() disableArcColor;
28
-  @Input() bottomAngle = 90;
29
-  @Input() arcThickness = 18; // CSS pixels
30
-  @Input() thumbRadius = 16; // CSS pixels
31
-  @Input() thumbBorder = 3;
32
-  @Input() thumbBg;
33
-  @Input() thumbBorderColor;
34
-  @Input() maxLeap = 0.4;
35
-
36
-  value = 50;
37
-  @Output() valueChange = new EventEmitter<Number>();
38
-  @Input('value') set setValue(value) {
39
-    this.value = value;
40
-  }
41
-
42
-  @Input() min = 0; // min output value
43
-  @Input() max = 100; // max output value
44
-  @Input() step = 0.1;
45
-
46
-  @Output() power = new EventEmitter<boolean>();
47
-
48
-  @HostListener('window:mouseup', ['$event'])
49
-  onMouseUp(event) {
50
-    this.recalculateValue(event);
51
-    this.isMouseDown = false;
52
-  }
53
-
54
-  @HostListener('window:mousemove', ['$event'])
55
-  onMouseMove(event: MouseEvent) {
56
-    this.recalculateValue(event);
57
-  }
58
-
59
-  @HostListener('window:resize', ['$event'])
60
-  onResize(event) {
61
-    this.invalidate();
62
-  }
63
-
64
-  off = false;
65
-  oldValue: number;
66
-
67
-  svgControlId = uniqueId++;
68
-  scaleFactor = 1;
69
-  bottomAngleRad = 0;
70
-  radius = 100;
71
-  translateXValue = 0;
72
-  translateYValue = 0;
73
-  thickness = 6;
74
-  pinRadius = 10;
75
-  colors: any = [];
76
-
77
-  styles = {
78
-    viewBox: '0 0 300 300',
79
-    arcTranslateStr: 'translate(0, 0)',
80
-    clipPathStr: '',
81
-    gradArcs: [],
82
-    nonSelectedArc: {},
83
-    thumbPosition: { x: 0, y: 0 },
84
-    blurRadius: 15,
85
-  };
86
-
87
-  private isMouseDown = false;
88
-  private init = false;
89
-
90
-  constructor(
91
-    private location: Location,
92
-    private locationStrategy: LocationStrategy,
93
-  ) {
94
-    this.oldValue = this.value;
95
-  }
96
-
97
-  ngAfterViewInit(): void {
98
-    // IE fix
99
-    setTimeout(() => {
100
-      this.invalidate();
101
-      this.init = true;
102
-    });
103
-  }
104
-
105
-  ngOnChanges(): void {
106
-    if (this.init) {
107
-      this.invalidate();
108
-    }
109
-  }
110
-
111
-  mouseDown(event) {
112
-    this.isMouseDown = true;
113
-    if (!this.off) {
114
-      this.recalculateValue(event, true);
115
-    }
116
-  }
117
-
118
-  switchPower() {
119
-    this.off = !this.off;
120
-    this.power.emit(!this.off);
121
-
122
-    if (this.off) {
123
-      this.oldValue = this.value;
124
-      this.value = this.min;
125
-    } else {
126
-      this.value = this.oldValue;
127
-    }
128
-
129
-    this.invalidatePinPosition();
130
-  }
131
-
132
-  getUrlPath(id: string) {
133
-    const baseHref = this.locationStrategy.getBaseHref().replace(/\/$/, '');
134
-    const path = this.location.path().replace(/\/$/, '');
135
-
136
-    return `url(${baseHref}${path}${id}${this.svgControlId})`;
137
-  }
138
-
139
-  private invalidate(): void {
140
-    this.bottomAngleRad = TemperatureDraggerComponent.toRad(this.bottomAngle);
141
-    this.calculateVars();
142
-
143
-    this.invalidateClipPathStr();
144
-    this.invalidatePinPosition();
145
-
146
-    // Chrome fix, temporary solution
147
-    // TODO: review set data to styles object
148
-    setTimeout(() => {
149
-      this.invalidateGradientArcs();
150
-    });
151
-  }
152
-
153
-  private calculateVars() {
154
-    this.bottomAngleRad = TemperatureDraggerComponent.toRad(this.bottomAngle);
155
-    this.colors = (typeof this.fillColors === 'string') ? [this.fillColors] : this.fillColors;
156
-
157
-    const halfAngle = this.bottomAngleRad / 2;
158
-
159
-    const svgBoundingRect = this.svgRoot.nativeElement.getBoundingClientRect();
160
-    const svgAreaFactor = svgBoundingRect.height && svgBoundingRect.width / svgBoundingRect.height || 1;
161
-    const svgHeight = VIEW_BOX_SIZE / svgAreaFactor;
162
-    const thumbMaxRadius = this.thumbRadius + this.thumbBorder;
163
-    const thumbMargin = 2 * thumbMaxRadius > this.arcThickness
164
-      ? (thumbMaxRadius - this.arcThickness / 2) / this.scaleFactor
165
-      : 0;
166
-
167
-    this.scaleFactor = svgBoundingRect.width / VIEW_BOX_SIZE || 1;
168
-    this.styles.viewBox = `0 0 ${VIEW_BOX_SIZE} ${svgHeight}`;
169
-
170
-
171
-    const circleFactor = this.bottomAngleRad <= Math.PI
172
-      ? ( 2 / (1 + Math.cos(halfAngle)) )
173
-      : ( 2 * Math.sin(halfAngle) / (1 + Math.cos(halfAngle)) );
174
-    if (circleFactor > svgAreaFactor) {
175
-      if (this.bottomAngleRad > Math.PI) {
176
-        this.radius = (VIEW_BOX_SIZE - 2 * thumbMargin) / (2 * Math.sin(halfAngle));
177
-      } else {
178
-        this.radius = VIEW_BOX_SIZE / 2 - thumbMargin;
179
-      }
180
-    } else {
181
-      this.radius = (svgHeight - 2 * thumbMargin) / (1 + Math.cos(halfAngle));
182
-    }
183
-
184
-    this.translateXValue = VIEW_BOX_SIZE / 2 - this.radius;
185
-    this.translateYValue = (svgHeight) / 2 - this.radius * (1 + Math.cos(halfAngle)) / 2;
186
-
187
-    this.styles.arcTranslateStr = `translate(${this.translateXValue}, ${this.translateYValue})`;
188
-
189
-    this.thickness = this.arcThickness / this.scaleFactor;
190
-    this.pinRadius = this.thumbRadius / this.scaleFactor;
191
-  }
192
-
193
-  private calculateClipPathSettings() {
194
-    const halfAngle = this.bottomAngleRad / 2;
195
-    const innerRadius = this.radius - this.thickness;
196
-
197
-    const xStartMultiplier = 1 - Math.sin(halfAngle);
198
-    const yMultiplier = 1 + Math.cos(halfAngle);
199
-    const xEndMultiplier = 1 + Math.sin(halfAngle);
200
-
201
-    return {
202
-      outer: {
203
-        start: {
204
-          x: xStartMultiplier * this.radius,
205
-          y: yMultiplier * this.radius,
206
-        },
207
-        end: {
208
-          x: xEndMultiplier * this.radius,
209
-          y: yMultiplier * this.radius,
210
-        },
211
-        radius: this.radius,
212
-      },
213
-      inner: {
214
-        start: {
215
-          x: xStartMultiplier * innerRadius + this.thickness,
216
-          y: yMultiplier * innerRadius + this.thickness,
217
-        },
218
-        end: {
219
-          x: xEndMultiplier * innerRadius + this.thickness,
220
-          y: yMultiplier * innerRadius + this.thickness,
221
-        },
222
-        radius: innerRadius,
223
-      },
224
-      thickness: this.thickness,
225
-      big: this.bottomAngleRad < Math.PI ? '1' : '0',
226
-    };
227
-
228
-  }
229
-
230
-  private invalidateClipPathStr() {
231
-    const s = this.calculateClipPathSettings();
232
-
233
-    let path = `M ${s.outer.start.x},${s.outer.start.y}`; // Start at startangle top
234
-
235
-    // Outer arc
236
-    // Draw an arc of radius 'radius'
237
-    // Arc details...
238
-    path += ` A ${s.outer.radius},${s.outer.radius}
239
-       0 ${s.big} 1
240
-       ${s.outer.end.x},${s.outer.end.y}`; // Arc goes to top end angle coordinate
241
-
242
-    // Outer to inner connector
243
-    path += ` A ${s.thickness / 2},${s.thickness / 2}
244
-       0 1 1
245
-       ${s.inner.end.x},${s.inner.end.y}`;
246
-
247
-    // Inner arc
248
-    path += ` A ${s.inner.radius},${s.inner.radius}
249
-       1 ${s.big} 0
250
-       ${s.inner.start.x},${s.inner.start.y}`;
251
-
252
-    // Outer to inner connector
253
-    path += ` A ${s.thickness / 2},${s.thickness / 2}
254
-       0 1 1
255
-       ${s.outer.start.x},${s.outer.start.y}`;
256
-
257
-    // Close path
258
-    path += ' Z';
259
-    this.styles.clipPathStr = path;
260
-  }
261
-
262
-  private calculateGradientConePaths(angleStep) {
263
-    const radius = this.radius;
264
-
265
-    function calcX(angle) {
266
-      return radius * (1 - 2 * Math.sin(angle));
267
-    }
268
-
269
-    function calcY(angle) {
270
-      return radius * (1 + 2 * Math.cos(angle));
271
-    }
272
-
273
-    const gradArray = [];
274
-
275
-    for (let i = 0, currentAngle = this.bottomAngleRad / 2; i < this.colors.length; i++, currentAngle += angleStep) {
276
-      gradArray.push({
277
-        start: { x: calcX(currentAngle), y: calcY(currentAngle) },
278
-        end: { x: calcX(currentAngle + angleStep), y: calcY(currentAngle + angleStep) },
279
-        big: Math.PI <= angleStep ? 1 : 0,
280
-      });
281
-    }
282
-    return gradArray;
283
-  }
284
-
285
-  private invalidateGradientArcs() {
286
-    const radius = this.radius;
287
-
288
-    function getArc(des) {
289
-      return `M ${radius},${radius}
290
-         L ${des.start.x},${des.start.y}
291
-         A ${2 * radius},${2 * radius}
292
-         0 ${des.big} 1
293
-         ${des.end.x},${des.end.y}
294
-         Z`;
295
-    }
296
-
297
-    const angleStep = (2 * Math.PI - this.bottomAngleRad) / this.colors.length;
298
-    const s = this.calculateGradientConePaths(angleStep);
299
-
300
-    this.styles.gradArcs = [];
301
-    for (let i = 0; i < s.length; i++) {
302
-      const si = s[i];
303
-      const arcValue = getArc(si);
304
-      this.styles.gradArcs.push({
305
-        color: this.colors[i],
306
-        d: arcValue,
307
-      });
308
-    }
309
-
310
-    this.styles.blurRadius = 2 * radius * Math.sin(angleStep / 6);
311
-  }
312
-
313
-  private invalidateNonSelectedArc() {
314
-    const angle = this.bottomAngleRad / 2 + (1 - this.getValuePercentage()) * (2 * Math.PI - this.bottomAngleRad);
315
-    this.styles.nonSelectedArc = {
316
-      color: this.disableArcColor,
317
-      d: `M ${this.radius},${this.radius}
318
-       L ${this.radius},${3 * this.radius}
319
-       A ${2 * this.radius},${2 * this.radius}
320
-       1 ${angle > Math.PI ? '1' : '0'} 0
321
-       ${this.radius + this.radius * 2 * Math.sin(angle)},${this.radius + this.radius * 2 * Math.cos(angle)}
322
-       Z`,
323
-    };
324
-  }
325
-
326
-  private invalidatePinPosition() {
327
-    const radiusOffset = this.thickness / 2;
328
-    const curveRadius = this.radius - radiusOffset;
329
-    const actualAngle = (2 * Math.PI - this.bottomAngleRad) * this.getValuePercentage() + this.bottomAngleRad / 2;
330
-    this.styles.thumbPosition = {
331
-      x: curveRadius * (1 - Math.sin(actualAngle)) + radiusOffset,
332
-      y: curveRadius * (1 + Math.cos(actualAngle)) + radiusOffset,
333
-    };
334
-    this.invalidateNonSelectedArc();
335
-  }
336
-
337
-  private recalculateValue(event, allowJumping = false) {
338
-    if (this.isMouseDown && !this.off) {
339
-      const rect = this.svgRoot.nativeElement.getBoundingClientRect();
340
-      const center = {
341
-        x: rect.left + VIEW_BOX_SIZE * this.scaleFactor / 2,
342
-        y: rect.top + (this.translateYValue + this.radius) * this.scaleFactor,
343
-      };
344
-      let actualAngle = Math.atan2(center.x - event.clientX, event.clientY - center.y);
345
-      if (actualAngle < 0) {
346
-        actualAngle = actualAngle + 2 * Math.PI;
347
-      }
348
-
349
-      const previousRelativeValue = this.getValuePercentage();
350
-      let relativeValue = 0;
351
-      if (actualAngle < this.bottomAngleRad / 2) {
352
-        relativeValue = 0;
353
-      } else if (actualAngle > 2 * Math.PI - this.bottomAngleRad / 2) {
354
-        relativeValue = 1;
355
-      } else {
356
-        relativeValue = (actualAngle - this.bottomAngleRad / 2) / (2 * Math.PI - this.bottomAngleRad);
357
-      }
358
-
359
-      const value = this.toValueNumber(relativeValue);
360
-
361
-      if (this.value !== value && (allowJumping || Math.abs(relativeValue - previousRelativeValue) < this.maxLeap)) {
362
-        this.value = value;
363
-        this.valueChange.emit(this.value);
364
-        this.invalidatePinPosition();
365
-      }
366
-    }
367
-  }
368
-
369
-  private getValuePercentage() {
370
-    return (this.value - this.min) / (this.max - this.min);
371
-  }
372
-
373
-  private toValueNumber(factor) {
374
-    return Math.round(factor * (this.max - this.min) / this.step) * this.step + this.min;
375
-  }
376
-
377
-  private static toRad(angle) {
378
-    return Math.PI * angle / 180;
379
-  }
380
-}

+ 0
- 69
src/frontend/src/app/demo_pages/dashboard/temperature/temperature.component.html Voir le fichier

@@ -1,69 +0,0 @@
1
-<nb-card size="large">
2
-  <nb-tabset fullWidth>
3
-
4
-    <nb-tab tabTitle="Temperature">
5
-
6
-      <div class="slider-container">
7
-        <ngx-temperature-dragger [(value)]="temperature" (power)="temperatureOff = !$event"
8
-                                 [min]="temperatureData.min" [max]="temperatureData.max" [disableArcColor]="theme.arcEmpty"
9
-                                 [fillColors]="theme.arcFill" [thumbBg]="theme.thumbBg" [thumbBorderColor]="theme.thumbBorder">
10
-
11
-          <div class="slider-value-container"  [ngClass]="{ 'off': temperatureOff }">
12
-            <div class="value temperature h1">
13
-              {{ temperatureOff ? '--' : (temperature | ngxRound) }}
14
-            </div>
15
-            <div class="desc">
16
-              Celsius
17
-            </div>
18
-          </div>
19
-        </ngx-temperature-dragger>
20
-      </div>
21
-
22
-      <nb-radio-group [(ngModel)]="temperatureMode" name="temperature-mode">
23
-        <nb-radio value="cool">
24
-          <i class="nb-snowy-circled"></i>
25
-        </nb-radio>
26
-        <nb-radio value="warm">
27
-          <i class="nb-sunny-circled"></i>
28
-        </nb-radio>
29
-        <nb-radio value="heat">
30
-          <i class="nb-flame-circled"></i>
31
-        </nb-radio>
32
-        <nb-radio value="fan">
33
-          <i class="nb-loop-circled"></i>
34
-        </nb-radio>
35
-      </nb-radio-group>
36
-    </nb-tab>
37
-
38
-    <nb-tab tabTitle="Humidity">
39
-
40
-      <div class="slider-container">
41
-        <ngx-temperature-dragger [(value)]="humidity" (power)="humidityOff = !$event"
42
-                                 [min]="humidityData.min" [max]="humidityData.max" [disableArcColor]="theme.arcEmpty"
43
-                                 [fillColors]="theme.arcFill" [thumbBg]="theme.thumbBg" [thumbBorderColor]="theme.thumbBorder">
44
-
45
-          <div class="slider-value-container"  [ngClass]="{ 'off': humidityOff }">
46
-            <div class="value humidity h1">
47
-              {{ humidityOff ? '--' : (humidity | ngxRound) }}
48
-            </div>
49
-          </div>
50
-        </ngx-temperature-dragger>
51
-      </div>
52
-
53
-      <nb-radio-group [(ngModel)]="humidityMode" name="humidity-mode">
54
-        <nb-radio value="cool">
55
-          <i class="nb-snowy-circled"></i>
56
-        </nb-radio>
57
-        <nb-radio value="warm">
58
-          <i class="nb-sunny-circled"></i>
59
-        </nb-radio>
60
-        <nb-radio value="heat">
61
-          <i class="nb-flame-circled"></i>
62
-        </nb-radio>
63
-        <nb-radio value="fan">
64
-          <i class="nb-loop-circled"></i>
65
-        </nb-radio>
66
-      </nb-radio-group>
67
-    </nb-tab>
68
-  </nb-tabset>
69
-</nb-card>

+ 0
- 121
src/frontend/src/app/demo_pages/dashboard/temperature/temperature.component.scss Voir le fichier

@@ -1,121 +0,0 @@
1
-@import '../../../@theme/styles/themes';
2
-@import '~bootstrap/scss/mixins/breakpoints';
3
-@import '~@nebular/theme/styles/global/breakpoints';
4
-
5
-@include nb-install-component() {
6
-
7
-  nb-tabset {
8
-    display: flex;
9
-    flex-direction: column;
10
-    height: 100%;
11
-
12
-    ::ng-deep ul {
13
-      // make same size as card header
14
-      border-color: transparent;
15
-      padding-bottom: 1px;
16
-      .tab-link {
17
-        padding: 1.25rem 2rem;
18
-      }
19
-    }
20
-  }
21
-
22
-  nb-tab.content-active {
23
-    display: flex;
24
-    flex-direction: column;
25
-    justify-content: space-between;
26
-    position: relative;
27
-    height: 100%;
28
-  }
29
-
30
-  .slider-container {
31
-    display: flex;
32
-    flex: 1;
33
-    -ms-flex: 1 1 auto;
34
-    justify-content: center;
35
-    align-items: center;
36
-  }
37
-
38
-  ngx-temperature-dragger {
39
-    margin-top: -1.5rem;
40
-    width: 100%;
41
-    max-width: 300px;
42
-  }
43
-
44
-  .slider-value-container {
45
-    display: flex;
46
-    flex-direction: column;
47
-    align-items: center;
48
-
49
-    .value {
50
-      position: relative;
51
-      margin: 0;
52
-
53
-      &.temperature::before {
54
-        position: absolute;
55
-        content: '°';
56
-        top: 0;
57
-        right: -0.85rem;
58
-      }
59
-
60
-      &.humidity::before {
61
-        position: absolute;
62
-        content: '%';
63
-        top: 3px;
64
-        right: -1.6rem;
65
-        font-size: 0.7em;
66
-      }
67
-    }
68
-
69
-    &.off {
70
-      .value {
71
-        color: nb-theme(text-hint-color);
72
-        letter-spacing: 0.25rem;
73
-        padding-left: 0.5rem;
74
-
75
-        &::before {
76
-          display: none;
77
-        }
78
-      }
79
-
80
-      .desc {
81
-        display: none;
82
-      }
83
-    }
84
-  }
85
-
86
-  nb-radio-group {
87
-    display: flex;
88
-    justify-content: space-between;
89
-  }
90
-
91
-  nb-radio {
92
-    flex: 0 0 auto;
93
-    width: calc(3.5rem + 2px);
94
-    height: calc(3.5rem + 2px);
95
-
96
-    ::ng-deep {
97
-      .outer-circle,
98
-      .inner-circle {
99
-        display: none;
100
-      }
101
-
102
-      label {
103
-        padding: 0;
104
-      }
105
-
106
-      .text {
107
-        border: 1px solid transparent;
108
-        font-size: 2.5rem;
109
-        padding: 0.5rem;
110
-        margin: 0;
111
-        color: nb-theme(text-hint-color);
112
-      }
113
-
114
-      input:checked ~ .text {
115
-        border-color: nb-theme(color-primary-default);
116
-        border-radius: nb-theme(card-border-radius);
117
-        color: nb-theme(text-primary-color);
118
-      }
119
-    }
120
-  }
121
-}

+ 0
- 53
src/frontend/src/app/demo_pages/dashboard/temperature/temperature.component.ts Voir le fichier

@@ -1,53 +0,0 @@
1
-import { Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-import { Temperature, TemperatureHumidityData } from '../../../@core/data/temperature-humidity';
4
-import { takeWhile } from 'rxjs/operators';
5
-import { forkJoin } from 'rxjs';
6
-
7
-@Component({
8
-  selector: 'ngx-temperature',
9
-  styleUrls: ['./temperature.component.scss'],
10
-  templateUrl: './temperature.component.html',
11
-})
12
-export class TemperatureComponent implements OnDestroy {
13
-
14
-  private alive = true;
15
-
16
-  temperatureData: Temperature;
17
-  temperature: number;
18
-  temperatureOff = false;
19
-  temperatureMode = 'cool';
20
-
21
-  humidityData: Temperature;
22
-  humidity: number;
23
-  humidityOff = false;
24
-  humidityMode = 'heat';
25
-
26
-  theme: any;
27
-  themeSubscription: any;
28
-
29
-  constructor(private themeService: NbThemeService,
30
-              private temperatureHumidityService: TemperatureHumidityData) {
31
-    this.themeService.getJsTheme()
32
-      .pipe(takeWhile(() => this.alive))
33
-      .subscribe(config => {
34
-      this.theme = config.variables.temperature;
35
-    });
36
-
37
-    forkJoin(
38
-      this.temperatureHumidityService.getTemperatureData(),
39
-      this.temperatureHumidityService.getHumidityData(),
40
-    )
41
-      .subscribe(([temperatureData, humidityData]: [Temperature, Temperature]) => {
42
-        this.temperatureData = temperatureData;
43
-        this.temperature = this.temperatureData.value;
44
-
45
-        this.humidityData = humidityData;
46
-        this.humidity = this.humidityData.value;
47
-      });
48
-  }
49
-
50
-  ngOnDestroy() {
51
-    this.alive = false;
52
-  }
53
-}

+ 0
- 174
src/frontend/src/app/demo_pages/dashboard/traffic/traffic-chart.component.ts Voir le fichier

@@ -1,174 +0,0 @@
1
-import { delay, takeWhile } from 'rxjs/operators';
2
-import { AfterViewInit, Component, Input, OnDestroy } from '@angular/core';
3
-import { NbThemeService } from '@nebular/theme';
4
-import { LayoutService } from '../../../@core/utils';
5
-
6
-@Component({
7
-  selector: 'ngx-traffic-chart',
8
-  template: `
9
-    <div echarts
10
-         [options]="option"
11
-         class="echart"
12
-         (chartInit)="onChartInit($event)">
13
-    </div>
14
-  `,
15
-})
16
-export class TrafficChartComponent implements AfterViewInit, OnDestroy {
17
-
18
-  private alive = true;
19
-
20
-  @Input() points: number[];
21
-
22
-  type = 'month';
23
-  types = ['week', 'month', 'year'];
24
-  option: any = {};
25
-  echartsIntance: any;
26
-
27
-  constructor(private theme: NbThemeService,
28
-              private layoutService: LayoutService) {
29
-    this.layoutService.onChangeLayoutSize()
30
-      .pipe(
31
-        takeWhile(() => this.alive),
32
-      )
33
-      .subscribe(() => this.resizeChart());
34
-  }
35
-
36
-  ngAfterViewInit() {
37
-    this.theme.getJsTheme()
38
-      .pipe(
39
-        delay(1),
40
-        takeWhile(() => this.alive),
41
-      )
42
-      .subscribe(config => {
43
-        const trafficTheme: any = config.variables.traffic;
44
-
45
-        this.option = Object.assign({}, {
46
-          grid: {
47
-            left: 0,
48
-            top: 0,
49
-            right: 0,
50
-            bottom: 0,
51
-          },
52
-          xAxis: {
53
-            type: 'category',
54
-            boundaryGap: false,
55
-            data: this.points,
56
-          },
57
-          yAxis: {
58
-            boundaryGap: [0, '5%'],
59
-            axisLine: {
60
-              show: false,
61
-            },
62
-            axisLabel: {
63
-              show: false,
64
-            },
65
-            axisTick: {
66
-              show: false,
67
-            },
68
-            splitLine: {
69
-              show: true,
70
-              lineStyle: {
71
-                color: trafficTheme.yAxisSplitLine,
72
-                width: '1',
73
-              },
74
-            },
75
-          },
76
-          tooltip: {
77
-            axisPointer: {
78
-              type: 'shadow',
79
-            },
80
-            textStyle: {
81
-              color: trafficTheme.tooltipTextColor,
82
-              fontWeight: trafficTheme.tooltipFontWeight,
83
-              fontSize: 16,
84
-            },
85
-            position: 'top',
86
-            backgroundColor: trafficTheme.tooltipBg,
87
-            borderColor: trafficTheme.tooltipBorderColor,
88
-            borderWidth: 1,
89
-            formatter: '{c0} MB',
90
-            extraCssText: trafficTheme.tooltipExtraCss,
91
-          },
92
-          series: [
93
-            {
94
-              type: 'line',
95
-              symbol: 'circle',
96
-              symbolSize: 8,
97
-              sampling: 'average',
98
-              silent: true,
99
-              itemStyle: {
100
-                normal: {
101
-                  color: trafficTheme.shadowLineDarkBg,
102
-                },
103
-                emphasis: {
104
-                  color: 'rgba(0,0,0,0)',
105
-                  borderColor: 'rgba(0,0,0,0)',
106
-                  borderWidth: 0,
107
-                },
108
-              },
109
-              lineStyle: {
110
-                normal: {
111
-                  width: 2,
112
-                  color: trafficTheme.shadowLineDarkBg,
113
-                },
114
-              },
115
-              data: this.points.map(p => p - 15),
116
-            },
117
-            {
118
-              type: 'line',
119
-              symbol: 'circle',
120
-              symbolSize: 6,
121
-              sampling: 'average',
122
-              itemStyle: {
123
-                normal: {
124
-                  color: trafficTheme.itemColor,
125
-                  borderColor: trafficTheme.itemBorderColor,
126
-                  borderWidth: 2,
127
-                },
128
-                emphasis: {
129
-                  color: 'white',
130
-                  borderColor: trafficTheme.itemEmphasisBorderColor,
131
-                  borderWidth: 2,
132
-                },
133
-              },
134
-              lineStyle: {
135
-                normal: {
136
-                  width: 2,
137
-                  color: trafficTheme.lineBg,
138
-                  shadowColor: trafficTheme.lineBg,
139
-                  shadowBlur: trafficTheme.lineShadowBlur,
140
-                },
141
-              },
142
-              areaStyle: {
143
-                normal: {
144
-                  color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
145
-                    offset: 0,
146
-                    color: trafficTheme.gradFrom,
147
-                  }, {
148
-                    offset: 1,
149
-                    color: trafficTheme.gradTo,
150
-                  }]),
151
-                  opacity: 1,
152
-                },
153
-              },
154
-              data: this.points,
155
-            },
156
-          ],
157
-        });
158
-    });
159
-  }
160
-
161
-  onChartInit(echarts) {
162
-    this.echartsIntance = echarts;
163
-  }
164
-
165
-  resizeChart() {
166
-    if (this.echartsIntance) {
167
-      this.echartsIntance.resize();
168
-    }
169
-  }
170
-
171
-  ngOnDestroy() {
172
-    this.alive = false;
173
-  }
174
-}

+ 0
- 35
src/frontend/src/app/demo_pages/dashboard/traffic/traffic.component.scss Voir le fichier

@@ -1,35 +0,0 @@
1
-@import '../../../@theme/styles/themes';
2
-
3
-@include nb-install-component() {
4
-
5
-  nb-card {
6
-    position: relative;
7
-    overflow: hidden;
8
-  }
9
-
10
-  nb-card-header {
11
-    display: flex;
12
-    align-items: center;
13
-    justify-content: space-between;
14
-    padding-top: nb-theme(card-header-with-select-padding-top);
15
-    padding-bottom: nb-theme(card-header-with-select-padding-bottom);
16
-    margin-bottom: -1px;
17
-  }
18
-
19
-  ngx-traffic-chart {
20
-    flex: 1;
21
-  }
22
-
23
-  ::ng-deep {
24
-    .echart {
25
-      display: block;
26
-      height: 100%;
27
-      width: 100%;
28
-    }
29
-
30
-    canvas {
31
-      border-bottom-left-radius: nb-theme(card-border-radius);
32
-      border-bottom-right-radius: nb-theme(card-border-radius);
33
-    }
34
-  }
35
-}

+ 0
- 51
src/frontend/src/app/demo_pages/dashboard/traffic/traffic.component.ts Voir le fichier

@@ -1,51 +0,0 @@
1
-import { Component, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-import { takeWhile } from 'rxjs/operators';
4
-
5
-import { TrafficChartData } from '../../../@core/data/traffic-chart';
6
-
7
-@Component({
8
-  selector: 'ngx-traffic',
9
-  styleUrls: ['./traffic.component.scss'],
10
-  template: `
11
-    <nb-card size="tiny">
12
-      <nb-card-header>
13
-        <span>Traffic Consumption</span>
14
-
15
-        <nb-select [(selected)]="type">
16
-          <nb-option *ngFor="let t of types" [value]="t">{{ t }}</nb-option>
17
-        </nb-select>
18
-      </nb-card-header>
19
-
20
-      <ngx-traffic-chart [points]="trafficChartPoints"></ngx-traffic-chart>
21
-    </nb-card>
22
-  `,
23
-})
24
-export class TrafficComponent implements OnDestroy {
25
-
26
-  private alive = true;
27
-
28
-  trafficChartPoints: number[];
29
-  type = 'month';
30
-  types = ['week', 'month', 'year'];
31
-  currentTheme: string;
32
-
33
-  constructor(private themeService: NbThemeService,
34
-              private trafficChartService: TrafficChartData) {
35
-    this.themeService.getJsTheme()
36
-      .pipe(takeWhile(() => this.alive))
37
-      .subscribe(theme => {
38
-      this.currentTheme = theme.name;
39
-    });
40
-
41
-    this.trafficChartService.getTrafficChartData()
42
-      .pipe(takeWhile(() => this.alive))
43
-      .subscribe((data) => {
44
-        this.trafficChartPoints = data;
45
-      });
46
-  }
47
-
48
-  ngOnDestroy() {
49
-    this.alive = false;
50
-  }
51
-}

+ 0
- 53
src/frontend/src/app/demo_pages/dashboard/weather/weather.component.html Voir le fichier

@@ -1,53 +0,0 @@
1
-<nb-card size="medium">
2
-  <nb-card-body>
3
-    <span class="h3 location">New York</span>
4
-    <span class="date">Mon 29 May</span>
5
-
6
-    <div class="today">
7
-      <span class="today-temperature h1">20&deg;</span>
8
-      <nb-icon icon="sun-outline" pack="eva" class="today-icon"></nb-icon>
9
-    </div>
10
-
11
-    <div class="today-details">
12
-      <div class="parameter">
13
-        <span class="caption parameter-name">max</span>
14
-        <span class="parameter-value">23&deg;</span>
15
-      </div>
16
-      <div class="parameter">
17
-        <span class="caption parameter-name">min</span>
18
-        <span class="parameter-value">19&deg;</span>
19
-      </div>
20
-      <div class="parameter">
21
-        <span class="caption parameter-name">wind</span>
22
-        <span class="parameter-value">4 km/h</span>
23
-      </div>
24
-      <div class="parameter">
25
-        <span class="caption parameter-name">hum</span>
26
-        <span class="parameter-value">87%</span>
27
-      </div>
28
-    </div>
29
-
30
-    <div class="weekly-forecast">
31
-      <div class="day">
32
-        <span class="caption">Sun</span>
33
-        <i class="weather-icon ion-ios-cloudy-outline"></i>
34
-        <span class="temperature">17&deg;</span>
35
-      </div>
36
-      <div class="day">
37
-        <span class="caption">Mon</span>
38
-        <i class="weather-icon ion-ios-sunny-outline"></i>
39
-        <span class="temperature">19&deg;</span>
40
-      </div>
41
-      <div class="day">
42
-        <span class="caption">Tue</span>
43
-        <i class="weather-icon ion-ios-rainy-outline"></i>
44
-        <span class="temperature">22&deg;</span>
45
-      </div>
46
-      <div class="day">
47
-        <span class="caption">Wed</span>
48
-        <i class="weather-icon ion-ios-partlysunny-outline"></i>
49
-        <span class="temperature">21&deg;</span>
50
-      </div>
51
-    </div>
52
-  </nb-card-body>
53
-</nb-card>

+ 0
- 76
src/frontend/src/app/demo_pages/dashboard/weather/weather.component.scss Voir le fichier

@@ -1,76 +0,0 @@
1
-@import '../../../@theme/styles/themes';
2
-
3
-@include nb-install-component() {
4
-
5
-  nb-card-body {
6
-    display: flex;
7
-    flex-direction: column;
8
-  }
9
-
10
-  .location,
11
-  .date {
12
-    display: block;
13
-  }
14
-
15
-  .location {
16
-    margin-bottom: 0.1rem;
17
-  }
18
-
19
-  .today {
20
-    display: flex;
21
-    justify-content: space-around;
22
-  }
23
-
24
-  .today-temperature {
25
-    display: flex;
26
-    flex-direction: column;
27
-    justify-content: center;
28
-    margin: 2rem 1.5rem;
29
-  }
30
-
31
-  .today-icon {
32
-    color: nb-theme(color-primary-default);
33
-    font-size: 10rem;
34
-    line-height: 1;
35
-    margin-top: -4rem;
36
-    margin-left: auto;
37
-    margin-right: 0.4rem;
38
-  }
39
-
40
-  .today-details {
41
-    display: flex;
42
-    justify-content: space-around;
43
-    margin-top: 2rem;
44
-  }
45
-
46
-  .parameter {
47
-    flex: 1 1 auto;
48
-    text-align: center;
49
-  }
50
-
51
-  .parameter-name,
52
-  .parameter-value {
53
-    display: block;
54
-  }
55
-
56
-  .caption {
57
-    text-transform: uppercase;
58
-  }
59
-
60
-  .weekly-forecast {
61
-    display: flex;
62
-    justify-content: space-around;
63
-    margin: auto 0;
64
-  }
65
-
66
-  .day {
67
-    display: flex;
68
-    flex-direction: column;
69
-    text-align: center;
70
-  }
71
-
72
-  .weather-icon {
73
-    font-size: 2.5rem;
74
-    line-height: 2.5rem;
75
-  }
76
-}

+ 0
- 10
src/frontend/src/app/demo_pages/dashboard/weather/weather.component.ts Voir le fichier

@@ -1,10 +0,0 @@
1
-import { Component } from '@angular/core';
2
-
3
-@Component({
4
-  selector: 'ngx-weather',
5
-  styleUrls: ['./weather.component.scss'],
6
-  templateUrl: './weather.component.html',
7
-})
8
-
9
-export class WeatherComponent {
10
-}

+ 0
- 7
src/frontend/src/app/demo_pages/e-commerce/charts-panel/chart-panel-header/chart-panel-header.component.html Voir le fichier

@@ -1,7 +0,0 @@
1
-<ngx-legend-chart [legendItems]="chartLegend"></ngx-legend-chart>
2
-
3
-<nb-select class="period-select" [selected]="type" (selectedChange)="changePeriod($event)">
4
-  <nb-option *ngFor="let period of types" [value]="period">
5
-    {{ period }}
6
-  </nb-option>
7
-</nb-select>

+ 0
- 25
src/frontend/src/app/demo_pages/e-commerce/charts-panel/chart-panel-header/chart-panel-header.component.scss Voir le fichier

@@ -1,25 +0,0 @@
1
-@import '../../../../@theme/styles/themes';
2
-@import '~bootstrap/scss/mixins/breakpoints';
3
-@import '~@nebular/theme/styles/global/breakpoints';
4
-
5
-@include nb-install-component() {
6
-  padding: 1.5rem 4.5rem;
7
-  display: flex;
8
-  flex-wrap: wrap;
9
-  align-items: center;
10
-  margin: -1rem;
11
-
12
-  ngx-legend-chart,
13
-  .period-select {
14
-    padding-top: 1rem;
15
-    @include nb-ltr(padding-left, 0.5rem);
16
-    @include nb-rtl(padding-right, 0.5rem);
17
-  }
18
-
19
-  @include media-breakpoint-up(md) {
20
-    .period-select {
21
-      @include nb-ltr(margin-left, auto);
22
-      @include nb-rtl(margin-right, auto);
23
-    }
24
-  }
25
-}

+ 0
- 69
src/frontend/src/app/demo_pages/e-commerce/charts-panel/chart-panel-header/chart-panel-header.component.ts Voir le fichier

@@ -1,69 +0,0 @@
1
-import { Component, EventEmitter, Input, OnDestroy, Output } from '@angular/core';
2
-import { NbMediaBreakpoint, NbMediaBreakpointsService, NbThemeService } from '@nebular/theme';
3
-import { takeWhile } from 'rxjs/operators';
4
-
5
-
6
-@Component({
7
-  selector: 'ngx-chart-panel-header',
8
-  styleUrls: ['./chart-panel-header.component.scss'],
9
-  templateUrl: './chart-panel-header.component.html',
10
-})
11
-export class ChartPanelHeaderComponent implements OnDestroy {
12
-
13
-  private alive = true;
14
-
15
-  @Output() periodChange = new EventEmitter<string>();
16
-
17
-  @Input() type: string = 'week';
18
-
19
-  types: string[] = ['week', 'month', 'year'];
20
-  chartLegend: {iconColor: string; title: string}[];
21
-  breakpoint: NbMediaBreakpoint = { name: '', width: 0 };
22
-  breakpoints: any;
23
-  currentTheme: string;
24
-
25
-  constructor(private themeService: NbThemeService,
26
-              private breakpointService: NbMediaBreakpointsService) {
27
-    this.themeService.getJsTheme()
28
-      .pipe(takeWhile(() => this.alive))
29
-      .subscribe(theme => {
30
-        const orderProfitLegend = theme.variables.orderProfitLegend;
31
-
32
-        this.currentTheme = theme.name;
33
-        this.setLegendItems(orderProfitLegend);
34
-      });
35
-
36
-      this.breakpoints = this.breakpointService.getBreakpointsMap();
37
-      this.themeService.onMediaQueryChange()
38
-        .pipe(takeWhile(() => this.alive))
39
-        .subscribe(([oldValue, newValue]) => {
40
-          this.breakpoint = newValue;
41
-        });
42
-  }
43
-
44
-  setLegendItems(orderProfitLegend) {
45
-    this.chartLegend = [
46
-      {
47
-        iconColor: orderProfitLegend.firstItem,
48
-        title: 'Payment',
49
-      },
50
-      {
51
-        iconColor: orderProfitLegend.secondItem,
52
-        title: 'Canceled',
53
-      },
54
-      {
55
-        iconColor: orderProfitLegend.thirdItem,
56
-        title: 'All orders',
57
-      },
58
-    ];
59
-  }
60
-
61
-  changePeriod(period: string): void {
62
-    this.type = period;
63
-    this.periodChange.emit(period);
64
-  }
65
-
66
-  ngOnDestroy() {
67
-    this.alive = false;
68
-  }
69
-}

+ 0
- 15
src/frontend/src/app/demo_pages/e-commerce/charts-panel/chart-panel-summary/chart-panel-summary.component.scss Voir le fichier

@@ -1,15 +0,0 @@
1
-@import '../../../../@theme/styles/themes';
2
-
3
-@include nb-install-component() {
4
-  .summary-container {
5
-    display: flex;
6
-    flex-wrap: wrap;
7
-    flex: 1;
8
-    background-color: nb-theme(background-basic-color-2);
9
-    justify-content: space-between;
10
-    padding: 1.5rem 4rem 1rem;
11
-    border: 1px solid nb-theme(border-basic-color-3);
12
-    border-left: none;
13
-    border-right: none;
14
-  }
15
-}

+ 0
- 18
src/frontend/src/app/demo_pages/e-commerce/charts-panel/chart-panel-summary/chart-panel-summary.component.ts Voir le fichier

@@ -1,18 +0,0 @@
1
-import { Component, Input } from '@angular/core';
2
-
3
-@Component({
4
-  selector: 'ngx-chart-panel-summary',
5
-  styleUrls: ['./chart-panel-summary.component.scss'],
6
-  template: `
7
-    <div class="summary-container">
8
-      <div *ngFor="let item of summary">
9
-        <div>{{ item.title }}</div>
10
-        <div class="h6">{{ item.value }}</div>
11
-      </div>
12
-    </div>
13
-  `,
14
-})
15
-export class ChartPanelSummaryComponent {
16
-  @Input() summary: {title: string; value: number}[];
17
-}
18
-

+ 0
- 22
src/frontend/src/app/demo_pages/e-commerce/charts-panel/charts-panel.component.html Voir le fichier

@@ -1,22 +0,0 @@
1
-<nb-card size="large">
2
-  <nb-tabset fullWidth (changeTab)="changeTab($event)">
3
-    <nb-tab tabTitle="Orders">
4
-      <div class="chart-container">
5
-        <ngx-chart-panel-summary [summary]="chartPanelSummary"></ngx-chart-panel-summary>
6
-        <ngx-chart-panel-header [type]="period"
7
-                                (periodChange)="setPeriodAndGetChartData($event)">
8
-        </ngx-chart-panel-header>
9
-        <ngx-orders-chart #ordersChart [ordersChartData]="ordersChartData"></ngx-orders-chart>
10
-      </div>
11
-    </nb-tab>
12
-    <nb-tab tabTitle="Profit" [lazyLoad]="true">
13
-      <div class="chart-container">
14
-        <ngx-chart-panel-summary [summary]="chartPanelSummary"></ngx-chart-panel-summary>
15
-        <ngx-chart-panel-header [type]="period"
16
-                                (periodChange)="setPeriodAndGetChartData($event)">
17
-        </ngx-chart-panel-header>
18
-        <ngx-profit-chart #profitChart [profitChartData]="profitChartData"></ngx-profit-chart>
19
-      </div>
20
-    </nb-tab>
21
-  </nb-tabset>
22
-</nb-card>

+ 0
- 41
src/frontend/src/app/demo_pages/e-commerce/charts-panel/charts-panel.component.scss Voir le fichier

@@ -1,41 +0,0 @@
1
-@import '../../../@theme/styles/themes';
2
-
3
-$legend-all-orders-color: #00977e;
4
-$legend-payment-color: #6935ca;
5
-$legend-canceled-color: #3f4fda;
6
-
7
-@include nb-install-component() {
8
-
9
-  nb-tabset {
10
-    display: flex;
11
-    flex-direction: column;
12
-    flex: 1;
13
-
14
-    ::ng-deep ul {
15
-      // make same size as card header
16
-      border-color: transparent;
17
-      padding-bottom: 1px;
18
-      .tab-link {
19
-        padding: 1.25rem 2rem;
20
-      }
21
-    }
22
-  }
23
-
24
-  nb-tab {
25
-    flex: 1;
26
-    padding: 0 0 1.25rem;
27
-  }
28
-
29
-  .chart-container {
30
-    flex: 1;
31
-    height: 100%;
32
-    display: flex;
33
-    flex-direction: column;
34
-    overflow: hidden;
35
-  }
36
-
37
-  ngx-profit-chart,
38
-  ngx-orders-chart {
39
-    padding: 0 1.25rem;
40
-  }
41
-}

+ 0
- 74
src/frontend/src/app/demo_pages/e-commerce/charts-panel/charts-panel.component.ts Voir le fichier

@@ -1,74 +0,0 @@
1
-import { Component, OnDestroy, ViewChild } from '@angular/core';
2
-import { takeWhile } from 'rxjs/operators';
3
-
4
-import { OrdersChartComponent } from './charts/orders-chart.component';
5
-import { ProfitChartComponent } from './charts/profit-chart.component';
6
-import { OrdersChart } from '../../../@core/data/orders-chart';
7
-import { ProfitChart } from '../../../@core/data/profit-chart';
8
-import { OrderProfitChartSummary, OrdersProfitChartData } from '../../../@core/data/orders-profit-chart';
9
-
10
-@Component({
11
-  selector: 'ngx-ecommerce-charts',
12
-  styleUrls: ['./charts-panel.component.scss'],
13
-  templateUrl: './charts-panel.component.html',
14
-})
15
-export class ECommerceChartsPanelComponent implements OnDestroy {
16
-
17
-  private alive = true;
18
-
19
-  chartPanelSummary: OrderProfitChartSummary[];
20
-  period: string = 'week';
21
-  ordersChartData: OrdersChart;
22
-  profitChartData: ProfitChart;
23
-
24
-  @ViewChild('ordersChart', { static: true }) ordersChart: OrdersChartComponent;
25
-  @ViewChild('profitChart', { static: true }) profitChart: ProfitChartComponent;
26
-
27
-  constructor(private ordersProfitChartService: OrdersProfitChartData) {
28
-    this.ordersProfitChartService.getOrderProfitChartSummary()
29
-      .pipe(takeWhile(() => this.alive))
30
-      .subscribe((summary) => {
31
-        this.chartPanelSummary = summary;
32
-      });
33
-
34
-    this.getOrdersChartData(this.period);
35
-    this.getProfitChartData(this.period);
36
-  }
37
-
38
-  setPeriodAndGetChartData(value: string): void {
39
-    if (this.period !== value) {
40
-      this.period = value;
41
-    }
42
-
43
-    this.getOrdersChartData(value);
44
-    this.getProfitChartData(value);
45
-  }
46
-
47
-  changeTab(selectedTab) {
48
-    if (selectedTab.tabTitle === 'Profit') {
49
-      this.profitChart.resizeChart();
50
-    } else {
51
-      this.ordersChart.resizeChart();
52
-    }
53
-  }
54
-
55
-  getOrdersChartData(period: string) {
56
-    this.ordersProfitChartService.getOrdersChartData(period)
57
-      .pipe(takeWhile(() => this.alive))
58
-      .subscribe(ordersChartData => {
59
-        this.ordersChartData = ordersChartData;
60
-      });
61
-  }
62
-
63
-  getProfitChartData(period: string) {
64
-    this.ordersProfitChartService.getProfitChartData(period)
65
-      .pipe(takeWhile(() => this.alive))
66
-      .subscribe(profitChartData => {
67
-        this.profitChartData = profitChartData;
68
-      });
69
-  }
70
-
71
-  ngOnDestroy() {
72
-    this.alive = false;
73
-  }
74
-}

+ 0
- 11
src/frontend/src/app/demo_pages/e-commerce/charts-panel/charts/charts-common.component.scss Voir le fichier

@@ -1,11 +0,0 @@
1
-@import '../../../../@theme/styles/themes';
2
-
3
-@include nb-install-component() {
4
-  flex: 1;
5
-
6
-  .echart {
7
-    display: block;
8
-    height: 100%;
9
-    width: 100%;
10
-  }
11
-}

+ 0
- 307
src/frontend/src/app/demo_pages/e-commerce/charts-panel/charts/orders-chart.component.ts Voir le fichier

@@ -1,307 +0,0 @@
1
-import { AfterViewInit, Component, Input, OnChanges, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-import { delay, takeWhile } from 'rxjs/operators';
4
-
5
-import { OrdersChart } from '../../../../@core/data/orders-chart';
6
-import { LayoutService } from '../../../../@core/utils/layout.service';
7
-
8
-@Component({
9
-  selector: 'ngx-orders-chart',
10
-  styleUrls: ['./charts-common.component.scss'],
11
-  template: `
12
-    <div echarts
13
-         [options]="option"
14
-         class="echart"
15
-         (chartInit)="onChartInit($event)">
16
-    </div>
17
-  `,
18
-})
19
-export class OrdersChartComponent implements AfterViewInit, OnDestroy, OnChanges {
20
-
21
-  @Input()
22
-  ordersChartData: OrdersChart;
23
-
24
-  private alive = true;
25
-
26
-  echartsIntance: any;
27
-  option: any;
28
-
29
-  ngOnChanges(): void {
30
-    if (this.option) {
31
-      this.updateOrdersChartOptions(this.ordersChartData);
32
-    }
33
-  }
34
-
35
-  constructor(private theme: NbThemeService,
36
-              private layoutService: LayoutService) {
37
-    this.layoutService.onChangeLayoutSize()
38
-      .pipe(
39
-        takeWhile(() => this.alive),
40
-      )
41
-      .subscribe(() => this.resizeChart());
42
-  }
43
-
44
-  ngAfterViewInit(): void {
45
-    this.theme.getJsTheme()
46
-      .pipe(
47
-        takeWhile(() => this.alive),
48
-        delay(1),
49
-      )
50
-      .subscribe(config => {
51
-        const eTheme: any = config.variables.orders;
52
-
53
-        this.setOptions(eTheme);
54
-        this.updateOrdersChartOptions(this.ordersChartData);
55
-      });
56
-  }
57
-
58
-  setOptions(eTheme) {
59
-    this.option = {
60
-      grid: {
61
-        left: 40,
62
-        top: 20,
63
-        right: 0,
64
-        bottom: 40,
65
-      },
66
-      tooltip: {
67
-        trigger: 'item',
68
-        axisPointer: {
69
-          type: 'line',
70
-          lineStyle: {
71
-            color: eTheme.tooltipLineColor,
72
-            width: eTheme.tooltipLineWidth,
73
-          },
74
-        },
75
-        textStyle: {
76
-          color: eTheme.tooltipTextColor,
77
-          fontSize: eTheme.tooltipFontSize,
78
-          fontWeight: eTheme.tooltipFontWeight,
79
-        },
80
-        position: 'top',
81
-        backgroundColor: eTheme.tooltipBg,
82
-        borderColor: eTheme.tooltipBorderColor,
83
-        borderWidth: 1,
84
-        formatter: (params) => {
85
-          return Math.round(parseInt(params.value, 10));
86
-        },
87
-        extraCssText: eTheme.tooltipExtraCss,
88
-      },
89
-      xAxis: {
90
-        type: 'category',
91
-        boundaryGap: false,
92
-        offset: 5,
93
-        data: [],
94
-        axisTick: {
95
-          show: false,
96
-        },
97
-        axisLabel: {
98
-          color: eTheme.axisTextColor,
99
-          fontSize: eTheme.axisFontSize,
100
-        },
101
-        axisLine: {
102
-          lineStyle: {
103
-            color: eTheme.axisLineColor,
104
-            width: '2',
105
-          },
106
-        },
107
-      },
108
-      yAxis: {
109
-        type: 'value',
110
-        boundaryGap: false,
111
-        axisLine: {
112
-          lineStyle: {
113
-            color: eTheme.axisLineColor,
114
-            width: '1',
115
-          },
116
-        },
117
-        axisLabel: {
118
-          color: eTheme.axisTextColor,
119
-          fontSize: eTheme.axisFontSize,
120
-        },
121
-        axisTick: {
122
-          show: false,
123
-        },
124
-        splitLine: {
125
-
126
-          lineStyle: {
127
-            color: eTheme.yAxisSplitLine,
128
-            width: '1',
129
-          },
130
-        },
131
-      },
132
-      series: [
133
-        this.getFirstLine(eTheme),
134
-        this.getSecondLine(eTheme),
135
-        this.getThirdLine(eTheme),
136
-      ],
137
-    };
138
-  }
139
-
140
-  getFirstLine(eTheme) {
141
-    return {
142
-      type: 'line',
143
-      smooth: true,
144
-      symbolSize: 20,
145
-      itemStyle: {
146
-        normal: {
147
-          opacity: 0,
148
-        },
149
-        emphasis: {
150
-          opacity: 0,
151
-        },
152
-      },
153
-      lineStyle: {
154
-        normal: {
155
-          width: 0,
156
-        },
157
-      },
158
-      areaStyle: {
159
-        normal: {
160
-          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
161
-            offset: 0,
162
-            color: eTheme.firstAreaGradFrom,
163
-          }, {
164
-            offset: 1,
165
-            color: eTheme.firstAreaGradTo,
166
-          }]),
167
-          opacity: 1,
168
-        },
169
-      },
170
-      data: [],
171
-    };
172
-  }
173
-
174
-  getSecondLine(eTheme) {
175
-    return         {
176
-      type: 'line',
177
-      smooth: true,
178
-      symbolSize: 20,
179
-      itemStyle: {
180
-        normal: {
181
-          opacity: 0,
182
-        },
183
-        emphasis: {
184
-          color: '#ffffff',
185
-          borderColor: eTheme.itemBorderColor,
186
-          borderWidth: 2,
187
-          opacity: 1,
188
-        },
189
-      },
190
-      lineStyle: {
191
-        normal: {
192
-          width: eTheme.lineWidth,
193
-          type: eTheme.lineStyle,
194
-          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
195
-            offset: 0,
196
-            color: eTheme.secondLineGradFrom,
197
-          }, {
198
-            offset: 1,
199
-            color: eTheme.secondLineGradTo,
200
-          }]),
201
-        },
202
-      },
203
-      areaStyle: {
204
-        normal: {
205
-          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
206
-            offset: 0,
207
-            color: eTheme.secondAreaGradFrom,
208
-          }, {
209
-            offset: 1,
210
-            color: eTheme.secondAreaGradTo,
211
-          }]),
212
-        },
213
-      },
214
-      data: [],
215
-    };
216
-  }
217
-
218
-  getThirdLine(eTheme) {
219
-    return {
220
-      type: 'line',
221
-      smooth: true,
222
-      symbolSize: 20,
223
-      itemStyle: {
224
-        normal: {
225
-          opacity: 0,
226
-        },
227
-        emphasis: {
228
-          color: '#ffffff',
229
-          borderColor: eTheme.itemBorderColor,
230
-          borderWidth: 2,
231
-          opacity: 1,
232
-        },
233
-      },
234
-      lineStyle: {
235
-        normal: {
236
-          width: eTheme.lineWidth,
237
-          type: eTheme.lineStyle,
238
-          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
239
-            offset: 0,
240
-            color: eTheme.thirdLineGradFrom,
241
-          }, {
242
-            offset: 1,
243
-            color: eTheme.thirdLineGradTo,
244
-          }]),
245
-        },
246
-      },
247
-      areaStyle: {
248
-        normal: {
249
-          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
250
-            offset: 0,
251
-            color: eTheme.thirdAreaGradFrom,
252
-          }, {
253
-            offset: 1,
254
-            color: eTheme.thirdAreaGradTo,
255
-          }]),
256
-        },
257
-      },
258
-      data: [],
259
-    };
260
-  }
261
-
262
-  updateOrdersChartOptions(ordersChartData: OrdersChart) {
263
-    const options = this.option;
264
-    const series = this.getNewSeries(options.series, ordersChartData.linesData);
265
-    const xAxis = this.getNewXAxis(options.xAxis, ordersChartData.chartLabel);
266
-
267
-    this.option = {
268
-      ...options,
269
-      xAxis,
270
-      series,
271
-    };
272
-  }
273
-
274
-  getNewSeries(series, linesData: number[][]) {
275
-    return series.map((line, index) => {
276
-      return {
277
-        ...line,
278
-        data: linesData[index],
279
-      };
280
-    });
281
-  }
282
-
283
-  getNewXAxis(xAxis, chartLabel: string[]) {
284
-    return {
285
-      ...xAxis,
286
-      data: chartLabel,
287
-    };
288
-  }
289
-
290
-  onChartInit(echarts) {
291
-    this.echartsIntance = echarts;
292
-  }
293
-
294
-  resizeChart() {
295
-    if (this.echartsIntance) {
296
-      // Fix recalculation chart size
297
-      // TODO: investigate more deeply
298
-      setTimeout(() => {
299
-        this.echartsIntance.resize();
300
-      }, 0);
301
-    }
302
-  }
303
-
304
-  ngOnDestroy() {
305
-    this.alive = false;
306
-  }
307
-}

+ 0
- 200
src/frontend/src/app/demo_pages/e-commerce/charts-panel/charts/profit-chart.component.ts Voir le fichier

@@ -1,200 +0,0 @@
1
-import { AfterViewInit, Component, Input, OnChanges, OnDestroy } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-import { takeWhile } from 'rxjs/operators';
4
-
5
-import { ProfitChart } from '../../../../@core/data/profit-chart';
6
-import { LayoutService } from '../../../../@core/utils/layout.service';
7
-
8
-@Component({
9
-  selector: 'ngx-profit-chart',
10
-  styleUrls: ['./charts-common.component.scss'],
11
-  template: `
12
-    <div echarts [options]="options" class="echart" (chartInit)="onChartInit($event)"></div>
13
-  `,
14
-})
15
-export class ProfitChartComponent implements AfterViewInit, OnDestroy, OnChanges {
16
-
17
-  @Input()
18
-  profitChartData: ProfitChart;
19
-
20
-  private alive = true;
21
-
22
-  echartsIntance: any;
23
-  options: any = {};
24
-
25
-  constructor(private theme: NbThemeService,
26
-              private layoutService: LayoutService) {
27
-    this.layoutService.onChangeLayoutSize()
28
-      .pipe(
29
-        takeWhile(() => this.alive),
30
-      )
31
-      .subscribe(() => this.resizeChart());
32
-  }
33
-
34
-  ngOnChanges(): void {
35
-    if (this.echartsIntance) {
36
-      this.updateProfitChartOptions(this.profitChartData);
37
-    }
38
-  }
39
-
40
-  ngAfterViewInit() {
41
-    this.theme.getJsTheme()
42
-      .pipe(takeWhile(() => this.alive))
43
-      .subscribe(config => {
44
-        const eTheme: any = config.variables.profit;
45
-
46
-        this.setOptions(eTheme);
47
-      });
48
-  }
49
-
50
-  setOptions(eTheme) {
51
-    this.options = {
52
-      backgroundColor: eTheme.bg,
53
-      tooltip: {
54
-        trigger: 'axis',
55
-        axisPointer: {
56
-          type: 'shadow',
57
-          shadowStyle: {
58
-            color: 'rgba(0, 0, 0, 0.3)',
59
-          },
60
-        },
61
-      },
62
-      grid: {
63
-        left: '3%',
64
-        right: '4%',
65
-        bottom: '3%',
66
-        containLabel: true,
67
-      },
68
-      xAxis: [
69
-        {
70
-          type: 'category',
71
-          data: this.profitChartData.chartLabel,
72
-          axisTick: {
73
-            alignWithLabel: true,
74
-          },
75
-          axisLine: {
76
-            lineStyle: {
77
-              color: eTheme.axisLineColor,
78
-            },
79
-          },
80
-          axisLabel: {
81
-            color: eTheme.axisTextColor,
82
-            fontSize: eTheme.axisFontSize,
83
-          },
84
-        },
85
-      ],
86
-      yAxis: [
87
-        {
88
-          type: 'value',
89
-          axisLine: {
90
-            lineStyle: {
91
-              color: eTheme.axisLineColor,
92
-            },
93
-          },
94
-          splitLine: {
95
-            lineStyle: {
96
-              color: eTheme.splitLineColor,
97
-            },
98
-          },
99
-          axisLabel: {
100
-            color: eTheme.axisTextColor,
101
-            fontSize: eTheme.axisFontSize,
102
-          },
103
-        },
104
-      ],
105
-      series: [
106
-        {
107
-          name: 'Canceled',
108
-          type: 'bar',
109
-          barGap: 0,
110
-          barWidth: '20%',
111
-          itemStyle: {
112
-            normal: {
113
-              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
114
-                offset: 0,
115
-                color: eTheme.firstLineGradFrom,
116
-              }, {
117
-                offset: 1,
118
-                color: eTheme.firstLineGradTo,
119
-              }]),
120
-            },
121
-          },
122
-          data: this.profitChartData.data[0],
123
-        },
124
-        {
125
-          name: 'Payment',
126
-          type: 'bar',
127
-          barWidth: '20%',
128
-          itemStyle: {
129
-            normal: {
130
-              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
131
-                offset: 0,
132
-                color: eTheme.secondLineGradFrom,
133
-              }, {
134
-                offset: 1,
135
-                color: eTheme.secondLineGradTo,
136
-              }]),
137
-            },
138
-          },
139
-          data: this.profitChartData.data[1],
140
-        },
141
-        {
142
-          name: 'All orders',
143
-          type: 'bar',
144
-          barWidth: '20%',
145
-          itemStyle: {
146
-            normal: {
147
-              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
148
-                offset: 0,
149
-                color: eTheme.thirdLineGradFrom,
150
-              }, {
151
-                offset: 1,
152
-                color: eTheme.thirdLineGradTo,
153
-              }]),
154
-            },
155
-          },
156
-          data: this.profitChartData.data[2],
157
-        },
158
-      ],
159
-    };
160
-  }
161
-
162
-  updateProfitChartOptions(profitChartData: ProfitChart) {
163
-    const options = this.options;
164
-    const series = this.getNewSeries(options.series, profitChartData.data);
165
-
166
-    this.echartsIntance.setOption({
167
-      series: series,
168
-      xAxis: {
169
-        data: this.profitChartData.chartLabel,
170
-      },
171
-    });
172
-  }
173
-
174
-  getNewSeries(series, data: number[][]) {
175
-    return series.map((line, index) => {
176
-      return {
177
-        ...line,
178
-        data: data[index],
179
-      };
180
-    });
181
-  }
182
-
183
-  onChartInit(echarts) {
184
-    this.echartsIntance = echarts;
185
-  }
186
-
187
-  resizeChart() {
188
-    if (this.echartsIntance) {
189
-      // Fix recalculation chart size
190
-      // TODO: investigate more deeply
191
-      setTimeout(() => {
192
-        this.echartsIntance.resize();
193
-      }, 0);
194
-    }
195
-  }
196
-
197
-  ngOnDestroy(): void {
198
-    this.alive = false;
199
-  }
200
-}

+ 0
- 23
src/frontend/src/app/demo_pages/e-commerce/country-orders/chart/country-orders-chart.component.scss Voir le fichier

@@ -1,23 +0,0 @@
1
-@import '../../../../@theme/styles/themes';
2
-@import '~bootstrap/scss/mixins/breakpoints';
3
-@import '~@nebular/theme/styles/global/breakpoints';
4
-
5
-@include nb-install-component() {
6
-  display: flex;
7
-  flex-direction: column;
8
-  height: 100%;
9
-  flex: 1;
10
-  padding: nb-theme(card-padding);
11
-
12
-  .header {
13
-    margin-left: 1rem;
14
-  }
15
-
16
-  .echart {
17
-    height: 75%;
18
-  }
19
-
20
-  @include media-breakpoint-down(sm) {
21
-    height: 50%;
22
-  }
23
-}

+ 0
- 181
src/frontend/src/app/demo_pages/e-commerce/country-orders/chart/country-orders-chart.component.ts Voir le fichier

@@ -1,181 +0,0 @@
1
-import { AfterViewInit, Component, Input, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
2
-import { NbThemeService } from '@nebular/theme';
3
-import { takeWhile } from 'rxjs/operators';
4
-import { LayoutService } from '../../../../@core/utils/layout.service';
5
-
6
-
7
-@Component({
8
-  selector: 'ngx-country-orders-chart',
9
-  styleUrls: ['./country-orders-chart.component.scss'],
10
-  template: `
11
-    <div class="header">
12
-      <span class="caption">Selected Country/Region</span>
13
-      <h2 class="h4">{{ countryName }}</h2>
14
-    </div>
15
-    <div echarts
16
-         [options]="option"
17
-         class="echart"
18
-         (chartInit)="onChartInit($event)">
19
-    </div>
20
-  `,
21
-})
22
-export class CountryOrdersChartComponent implements AfterViewInit, OnDestroy, OnChanges {
23
-
24
-  @Input() countryName: string;
25
-  @Input() data: number[];
26
-  @Input() maxValue: number;
27
-  @Input() labels: string[];
28
-
29
-  private alive = true;
30
-
31
-  option: any = {};
32
-  echartsInstance;
33
-
34
-  constructor(private theme: NbThemeService,
35
-              private layoutService: LayoutService) {
36
-    this.layoutService.onChangeLayoutSize()
37
-      .pipe(
38
-        takeWhile(() => this.alive),
39
-      )
40
-      .subscribe(() => this.resizeChart());
41
-  }
42
-
43
-  ngOnChanges(changes: SimpleChanges): void {
44
-    if (changes.data && !changes.data.isFirstChange()) {
45
-      this.echartsInstance.setOption({
46
-        series: [
47
-          {
48
-            data: this.data.map(v => this.maxValue),
49
-          },
50
-          {
51
-            data: this.data,
52
-          },
53
-          {
54
-            data: this.data,
55
-          },
56
-        ],
57
-      });
58
-    }
59
-  }
60
-
61
-  ngAfterViewInit() {
62
-    this.theme.getJsTheme()
63
-      .pipe(takeWhile(() => this.alive))
64
-      .subscribe(config => {
65
-        const countriesTheme: any = config.variables.countryOrders;
66
-
67
-        this.option = Object.assign({}, {
68
-          grid: {
69
-            left: '3%',
70
-            right: '3%',
71
-            bottom: '3%',
72
-            top: '3%',
73
-            containLabel: true,
74
-          },
75
-          xAxis: {
76
-            axisLabel: {
77
-              color: countriesTheme.chartAxisTextColor,
78
-              fontSize: countriesTheme.chartAxisFontSize,
79
-            },
80
-            axisLine: {
81
-              lineStyle: {
82
-                color: countriesTheme.chartAxisLineColor,
83
-                width: '2',
84
-              },
85
-            },
86
-            axisTick: {
87
-              show: false,
88
-            },
89
-            splitLine: {
90
-              lineStyle: {
91
-                color: countriesTheme.chartAxisSplitLine,
92
-                width: '1',
93
-              },
94
-            },
95
-          },
96
-          yAxis: {
97
-            data: this.labels,
98
-            axisLabel: {
99
-              color: countriesTheme.chartAxisTextColor,
100
-              fontSize: countriesTheme.chartAxisFontSize,
101
-            },
102
-            axisLine: {
103
-              lineStyle: {
104
-                color: countriesTheme.chartAxisLineColor,
105
-                width: '2',
106
-              },
107
-            },
108
-            axisTick: {
109
-              show: false,
110
-            },
111
-          },
112
-          series: [
113
-            { // For shadow
114
-              type: 'bar',
115
-              data: this.data.map(v => this.maxValue),
116
-              cursor: 'default',
117
-              itemStyle: {
118
-                normal: {
119
-                  color: countriesTheme.chartInnerLineColor,
120
-                },
121
-                opacity: 1,
122
-              },
123
-              barWidth: '40%',
124
-              barGap: '-100%',
125
-              barCategoryGap: '30%',
126
-              animation: false,
127
-              z: 1,
128
-            },
129
-            { // For bottom line
130
-              type: 'bar',
131
-              data: this.data,
132
-              cursor: 'default',
133
-              itemStyle: {
134
-                normal: {
135
-                  color: countriesTheme.chartLineBottomShadowColor,
136
-                },
137
-                opacity: 1,
138
-              },
139
-              barWidth: '40%',
140
-              barGap: '-100%',
141
-              barCategoryGap: '30%',
142
-              z: 2,
143
-            },
144
-            {
145
-              type: 'bar',
146
-              barWidth: '35%',
147
-              data: this.data,
148
-              cursor: 'default',
149
-              itemStyle: {
150
-                normal: {
151
-                  color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
152
-                    offset: 0,
153
-                    color: countriesTheme.chartGradientFrom,
154
-                  }, {
155
-                    offset: 1,
156
-                    color: countriesTheme.chartGradientTo,
157
-                  }]),
158
-                },
159
-              },
160
-              z: 3,
161
-            },
162
-          ],
163
-        });
164
-      });
165
-  }
166
-
167
-  onChartInit(ec) {
168
-    this.echartsInstance = ec;
169
-  }
170
-
171
-  resizeChart() {
172
-    if (this.echartsInstance) {
173
-      this.echartsInstance.resize();
174
-    }
175
-  }
176
-
177
-  ngOnDestroy() {
178
-    this.alive = false;
179
-  }
180
-
181
-}

+ 0
- 18
src/frontend/src/app/demo_pages/e-commerce/country-orders/country-orders.component.scss Voir le fichier

@@ -1,18 +0,0 @@
1
-@import '../../../@theme/styles/themes';
2
-@import '~bootstrap/scss/mixins/breakpoints';
3
-@import '~@nebular/theme/styles/global/breakpoints';
4
-
5
-@include nb-install-component() {
6
-
7
-  nb-card-body {
8
-    display: flex;
9
-    height: 100%;
10
-    padding: 0;
11
-  }
12
-
13
-  @include media-breakpoint-down(sm) {
14
-    nb-card-body {
15
-      flex-direction: column;
16
-    }
17
-  }
18
-}

+ 0
- 64
src/frontend/src/app/demo_pages/e-commerce/country-orders/country-orders.component.ts Voir le fichier

@@ -1,64 +0,0 @@
1
-import { Component, OnDestroy } from '@angular/core';
2
-import { NbMediaBreakpoint, NbMediaBreakpointsService, NbThemeService } from '@nebular/theme';
3
-import { takeWhile } from 'rxjs/operators';
4
-import { CountryOrderData } from '../../../@core/data/country-order';
5
-
6
-@Component({
7
-  selector: 'ngx-country-orders',
8
-  styleUrls: ['./country-orders.component.scss'],
9
-  template: `
10
-    <nb-card [size]="breakpoint.width >= breakpoints.md ? 'medium' : 'giant'">
11
-      <nb-card-header>Country Orders Statistics</nb-card-header>
12
-      <nb-card-body>
13
-        <ngx-country-orders-map (select)="selectCountryById($event)"
14
-                                countryId="USA">
15
-        </ngx-country-orders-map>
16
-        <ngx-country-orders-chart [countryName]="countryName"
17
-                                  [data]="countryData"
18
-                                  [labels]="countriesCategories"
19
-                                  maxValue="20">
20
-        </ngx-country-orders-chart>
21
-      </nb-card-body>
22
-    </nb-card>
23
-  `,
24
-})
25
-export class CountryOrdersComponent implements OnDestroy {
26
-
27
-  private alive = true;
28
-
29
-  countryName = '';
30
-  countryData: number[] = [];
31
-  countriesCategories: string[];
32
-  breakpoint: NbMediaBreakpoint = { name: '', width: 0 };
33
-  breakpoints: any;
34
-
35
-  constructor(private themeService: NbThemeService,
36
-              private breakpointService: NbMediaBreakpointsService,
37
-              private countryOrderService: CountryOrderData) {
38
-    this.breakpoints = this.breakpointService.getBreakpointsMap();
39
-    this.themeService.onMediaQueryChange()
40
-      .pipe(takeWhile(() => this.alive))
41
-      .subscribe(([oldValue, newValue]) => {
42
-        this.breakpoint = newValue;
43
-      });
44
-    this.countryOrderService.getCountriesCategories()
45
-      .pipe(takeWhile(() => this.alive))
46
-      .subscribe((countriesCategories) => {
47
-        this.countriesCategories = countriesCategories;
48
-      });
49
-  }
50
-
51
-  selectCountryById(countryName: string) {
52
-    this.countryName = countryName;
53
-
54
-    this.countryOrderService.getCountriesCategoriesData(countryName)
55
-      .pipe(takeWhile(() => this.alive))
56
-      .subscribe((countryData) => {
57
-        this.countryData = countryData;
58
-      });
59
-  }
60
-
61
-  ngOnDestroy() {
62
-    this.alive = false;
63
-  }
64
-}

+ 0
- 57
src/frontend/src/app/demo_pages/e-commerce/country-orders/map/country-orders-map.component.scss Voir le fichier

@@ -1,57 +0,0 @@
1
-@import '../../../../@theme/styles/themes';
2
-@import '~bootstrap/scss/mixins/breakpoints';
3
-@import '~@nebular/theme/styles/global/breakpoints';
4
-
5
-@include nb-install-component() {
6
-
7
-  display: block;
8
-  height: 100%;
9
-  width: 60%;
10
-
11
-  .leaflet-container {
12
-    height: 100%;
13
-    background-color: nb-theme(background-basic-color-2);
14
-  }
15
-
16
-  ::ng-deep .leaflet-top, ::ng-deep .leaflet-bottom {
17
-    z-index: 997;
18
-  }
19
-
20
-  ::ng-deep .leaflet-bar {
21
-    box-shadow: none;
22
-  }
23
-
24
-  ::ng-deep .leaflet-control-zoom {
25
-    border: none;
26
-
27
-    a {
28
-      background-color: nb-theme(color-primary-default);
29
-      color: nb-theme(text-alternate-color);
30
-      border-bottom: none;
31
-    }
32
-
33
-    .leaflet-disabled {
34
-      background-color: nb-theme(color-primary-disabled);
35
-    }
36
-
37
-    .leaflet-control-zoom-in {
38
-      border-top-left-radius: nb-theme(button-rectangle-border-radius);
39
-      border-top-right-radius: nb-theme(button-rectangle-border-radius);
40
-    }
41
-
42
-    .leaflet-control-zoom-out {
43
-      margin-top: 1px;
44
-      border-bottom-left-radius: nb-theme(button-rectangle-border-radius);
45
-      border-bottom-right-radius: nb-theme(button-rectangle-border-radius);
46
-    }
47
-  }
48
-
49
-  ::ng-deep .leaflet-control-attribution {
50
-    background: transparent;
51
-  }
52
-
53
-  @include media-breakpoint-down(sm) {
54
-    width: 100%;
55
-    height: 50%;
56
-  }
57
-}

+ 0
- 144
src/frontend/src/app/demo_pages/e-commerce/country-orders/map/country-orders-map.component.ts Voir le fichier

@@ -1,144 +0,0 @@
1
-import { Component, EventEmitter, Input, OnDestroy, Output } from '@angular/core';
2
-
3
-import * as L from 'leaflet';
4
-
5
-import { CountryOrdersMapService } from './country-orders-map.service';
6
-import { NbThemeService } from '@nebular/theme';
7
-import { combineLatest } from 'rxjs';
8
-import { takeWhile } from 'rxjs/operators';
9
-
10
-
11
-@Component({
12
-  selector: 'ngx-country-orders-map',
13
-  styleUrls: ['./country-orders-map.component.scss'],
14
-  template: `
15
-    <div leaflet [leafletOptions]="options" [leafletLayers]="layers" (leafletMapReady)="mapReady($event)"></div>
16
-  `,
17
-})
18
-export class CountryOrdersMapComponent implements OnDestroy {
19
-
20
-  @Input() countryId: string;
21
-
22
-  @Output() select: EventEmitter<any> = new EventEmitter();
23
-
24
-  layers = [];
25
-  currentTheme: any;
26
-  alive = true;
27
-  selectedCountry;
28
-
29
-  options = {
30
-    zoom: 2,
31
-    minZoom: 2,
32
-    maxZoom: 6,
33
-    zoomControl: false,
34
-    center: L.latLng({lat: 38.991709, lng: -76.886109}),
35
-    maxBounds: new L.LatLngBounds(
36
-      new L.LatLng(-89.98155760646617, -180),
37
-      new L.LatLng(89.99346179538875, 180),
38
-    ),
39
-    maxBoundsViscosity: 1.0,
40
-  };
41
-
42
-  constructor(private ecMapService: CountryOrdersMapService,
43
-              private theme: NbThemeService) {
44
-
45
-    combineLatest([
46
-      this.ecMapService.getCords(),
47
-      this.theme.getJsTheme(),
48
-    ])
49
-      .pipe(takeWhile(() => this.alive))
50
-      .subscribe(([cords, config]: [any, any]) => {
51
-        this.currentTheme = config.variables.countryOrders;
52
-        this.layers = [this.createGeoJsonLayer(cords)];
53
-        this.selectFeature(this.findFeatureLayerByCountryId(this.countryId));
54
-      });
55
-  }
56
-
57
-  mapReady(map: L.Map) {
58
-    map.addControl(L.control.zoom({position: 'bottomright'}));
59
-
60
-    // fix the map fully displaying, existing leaflet bag
61
-    setTimeout(() => {
62
-      map.invalidateSize();
63
-    }, 0);
64
-  }
65
-
66
-  private createGeoJsonLayer(cords) {
67
-    return L.geoJSON(
68
-      cords as any,
69
-      {
70
-        style: () => ({
71
-          weight: this.currentTheme.countryBorderWidth,
72
-          fillColor: this.currentTheme.countryFillColor,
73
-          fillOpacity: 1,
74
-          color: this.currentTheme.countryBorderColor,
75
-          opacity: 1,
76
-        }),
77
-        onEachFeature: (f, l) => {
78
-          this.onEachFeature(f, l);
79
-        },
80
-      });
81
-  }
82
-
83
-  private onEachFeature(feature, layer) {
84
-    layer.on({
85
-      mouseover: (e) => this.highlightFeature(e.target),
86
-      mouseout: (e) => this.moveout(e.target),
87
-      click: (e) => this.selectFeature(e.target),
88
-    });
89
-  }
90
-
91
-  private highlightFeature(featureLayer) {
92
-    if (featureLayer) {
93
-      featureLayer.setStyle({
94
-        weight: this.currentTheme.hoveredCountryBorderWidth,
95
-        fillColor: this.currentTheme.hoveredCountryFillColor,
96
-        color: this.currentTheme.hoveredCountryBorderColor,
97
-      });
98
-
99
-      if (!L.Browser.ie && !L.Browser.opera12 && !L.Browser.edge) {
100
-        featureLayer.bringToFront();
101
-      }
102
-    }
103
-  }
104
-
105
-  private moveout(featureLayer) {
106
-    if (featureLayer !== this.selectedCountry) {
107
-      this.resetHighlight(featureLayer);
108
-
109
-      // When countries have common border we should highlight selected country once again
110
-      this.highlightFeature(this.selectedCountry);
111
-    }
112
-  }
113
-
114
-  private resetHighlight(featureLayer) {
115
-    if (featureLayer) {
116
-      const geoJsonLayer = this.layers[0];
117
-
118
-      geoJsonLayer.resetStyle(featureLayer);
119
-    }
120
-  }
121
-
122
-  private selectFeature(featureLayer) {
123
-    if (featureLayer !== this.selectedCountry) {
124
-      this.resetHighlight(this.selectedCountry);
125
-      this.highlightFeature(featureLayer);
126
-      this.selectedCountry = featureLayer;
127
-      this.select.emit(featureLayer.feature.properties.name);
128
-    }
129
-  }
130
-
131
-  private findFeatureLayerByCountryId(id) {
132
-    const layers = this.layers[0].getLayers();
133
-    const featureLayer = layers.find(item => {
134
-      return item.feature.id === id;
135
-    });
136
-
137
-    return featureLayer ? featureLayer : null;
138
-  }
139
-
140
-  ngOnDestroy(): void {
141
-    this.alive = false;
142
-  }
143
-
144
-}

+ 0
- 15
src/frontend/src/app/demo_pages/e-commerce/country-orders/map/country-orders-map.service.ts Voir le fichier

@@ -1,15 +0,0 @@
1
-import { Injectable } from '@angular/core';
2
-import { HttpClient } from '@angular/common/http';
3
-import { Observable } from 'rxjs';
4
-
5
-
6
-@Injectable()
7
-export class CountryOrdersMapService {
8
-
9
-  constructor(private http: HttpClient) {}
10
-
11
-  getCords(): Observable<any> {
12
-    return this.http.get('assets/leaflet-countries/countries.geo.json');
13
-  }
14
-
15
-}

+ 0
- 38
src/frontend/src/app/demo_pages/e-commerce/e-commerce.component.html Voir le fichier

@@ -1,38 +0,0 @@
1
-<div class="row">
2
-  <div class="col-xxl-5">
3
-    <div class="row">
4
-      <div class="col-md-6">
5
-        <ngx-profit-card></ngx-profit-card>
6
-      </div>
7
-      <div class="col-md-6">
8
-        <ngx-earning-card></ngx-earning-card>
9
-      </div>
10
-    </div>
11
-
12
-    <ngx-traffic-reveal-card></ngx-traffic-reveal-card>
13
-  </div>
14
-
15
-  <div class="col-xxl-7">
16
-    <ngx-ecommerce-charts></ngx-ecommerce-charts>
17
-  </div>
18
-</div>
19
-
20
-<div class="row">
21
-  <div class="col-xxl-9">
22
-    <ngx-country-orders></ngx-country-orders>
23
-  </div>
24
-
25
-  <div class="col-xxl-3">
26
-    <ngx-progress-section></ngx-progress-section>
27
-  </div>
28
-</div>
29
-
30
-<div class="row">
31
-  <div class="col-xxl-9">
32
-    <ngx-ecommerce-visitors-analytics></ngx-ecommerce-visitors-analytics>
33
-  </div>
34
-
35
-  <div class="col-xxl-3">
36
-    <ngx-user-activity></ngx-user-activity>
37
-  </div>
38
-</div>

+ 0
- 8
src/frontend/src/app/demo_pages/e-commerce/e-commerce.component.ts Voir le fichier

@@ -1,8 +0,0 @@
1
-import { Component } from '@angular/core';
2
-
3
-@Component({
4
-  selector: 'ngx-ecommerce',
5
-  templateUrl: './e-commerce.component.html',
6
-})
7
-export class ECommerceComponent {
8
-}

+ 0
- 0
src/frontend/src/app/demo_pages/e-commerce/e-commerce.module.ts Voir le fichier


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff

Chargement…
Annuler
Enregistrer