-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
pkurochka
committed
Mar 11, 2018
1 parent
7f27941
commit 21376cb
Showing
48 changed files
with
20,922 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"projects": { | ||
"default": "smart-green-analytics" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"hosting": { | ||
"public": "dist", | ||
"ignore": [ | ||
"firebase.json", | ||
"**/.*", | ||
"**/node_modules/**" | ||
] | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<mat-chip-list> | ||
<mat-chip color="accent" [selected]="selected === 'en'" (click)="change.emit('en')">EN</mat-chip> | ||
<mat-chip color="accent" [selected]="selected === 'ar'" (click)="change.emit('ar')">AR</mat-chip> | ||
</mat-chip-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.lang:hover { | ||
color: rgba(0, 0, 0, 0.1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Component, OnInit, EventEmitter, Output, Input } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'sga-lang', | ||
templateUrl: './lang.component.html', | ||
styleUrls: ['./lang.component.scss'] | ||
}) | ||
export class LangComponent implements OnInit { | ||
@Input() selected: string; | ||
@Output() change: EventEmitter<string> = new EventEmitter(); | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<mat-toolbar color="primary"> | ||
<span>SmartGreen analytics</span> | ||
<ng-content></ng-content> | ||
</mat-toolbar> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
<sga-navbar></sga-navbar> | ||
<router-outlet></router-outlet> | ||
<sga-navbar> | ||
<span>SmartGreen analytics</span> | ||
<span class="space"></span> | ||
<sga-lang (change)="switchLang($event)" [selected]="currentLang"></sga-lang> | ||
</sga-navbar> | ||
<div class="component-container" [dir]="'dir' | translate" [class.rtl]="('dir' | translate) === 'rtl'"> | ||
<a mat-mini-fab color="warn" class="back-link" routerLink="../" [hidden]="router.routerState.snapshot.url === '/sites'"> | ||
<mat-icon>arrow_back</mat-icon> | ||
</a> | ||
<router-outlet></router-outlet> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
:host { | ||
height: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.space { | ||
flex: 1; | ||
} | ||
|
||
.component-container { | ||
position: relative; | ||
padding: 15px; | ||
flex: 1; | ||
} | ||
|
||
.back-link { | ||
position: absolute; | ||
top: 15px; | ||
right: 15px; | ||
z-index: 10; | ||
|
||
mat-icon { | ||
transition: all .5s ease; | ||
} | ||
|
||
&:hover mat-icon { | ||
transform: rotate(1turn); | ||
} | ||
} | ||
|
||
.rtl { | ||
.back-link { | ||
left: 15px; | ||
right: auto; | ||
mat-icon { | ||
transform: rotate(180deg); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,25 @@ | ||
import { Component } from '@angular/core'; | ||
import { Router } from '@angular/router'; | ||
import { TranslateService } from '@ngx-translate/core'; | ||
|
||
@Component({ | ||
selector: 'sga-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.scss'] | ||
}) | ||
export class AppComponent { | ||
// lineChart | ||
public lineChartData: Array<any> = [ | ||
{ data: [65, 59, 80, 81, 56, 55, 40], label: 'Series A' }, | ||
{ data: [28, 48, 40, 19, 86, 27, 90], label: 'Series B' }, | ||
{ data: [18, 48, 77, 9, 100, 27, 40], label: 'Series C' } | ||
]; | ||
public lineChartLabels: Array<any> = ['January', 'February', 'March', 'April', 'May', 'June', 'July']; | ||
public lineChartOptions: any = { | ||
responsive: true | ||
}; | ||
public lineChartColors: Array<any> = [ | ||
{ // grey | ||
backgroundColor: 'rgba(148,159,177,0.2)', | ||
borderColor: 'rgba(148,159,177,1)', | ||
pointBackgroundColor: 'rgba(148,159,177,1)', | ||
pointBorderColor: '#fff', | ||
pointHoverBackgroundColor: '#fff', | ||
pointHoverBorderColor: 'rgba(148,159,177,0.8)' | ||
}, | ||
{ // dark grey | ||
backgroundColor: 'rgba(77,83,96,0.2)', | ||
borderColor: 'rgba(77,83,96,1)', | ||
pointBackgroundColor: 'rgba(77,83,96,1)', | ||
pointBorderColor: '#fff', | ||
pointHoverBackgroundColor: '#fff', | ||
pointHoverBorderColor: 'rgba(77,83,96,1)' | ||
}, | ||
{ // grey | ||
backgroundColor: 'rgba(148,159,177,0.2)', | ||
borderColor: 'rgba(148,159,177,1)', | ||
pointBackgroundColor: 'rgba(148,159,177,1)', | ||
pointBorderColor: '#fff', | ||
pointHoverBackgroundColor: '#fff', | ||
pointHoverBorderColor: 'rgba(148,159,177,0.8)' | ||
} | ||
]; | ||
public lineChartLegend: boolean = true; | ||
public lineChartType: string = 'line'; | ||
currentLang: string = 'en'; | ||
|
||
public randomize(): void { | ||
const _lineChartData: Array<any> = new Array(this.lineChartData.length); | ||
for (let i = 0; i < this.lineChartData.length; i++) { | ||
_lineChartData[i] = { data: new Array(this.lineChartData[i].data.length), label: this.lineChartData[i].label }; | ||
for (let j = 0; j < this.lineChartData[i].data.length; j++) { | ||
_lineChartData[i].data[j] = Math.floor((Math.random() * 100) + 1); | ||
} | ||
} | ||
this.lineChartData = _lineChartData; | ||
constructor( | ||
public router: Router, | ||
private translate: TranslateService | ||
) { | ||
this.translate.addLangs(['en', 'fr']); | ||
translate.setDefaultLang(this.currentLang); | ||
} | ||
|
||
// events | ||
public chartClicked(e: any): void { | ||
console.log(e); | ||
} | ||
|
||
public chartHovered(e: any): void { | ||
console.log(e); | ||
switchLang(newLang: string) { | ||
this.currentLang = newLang; | ||
this.translate.use(this.currentLang); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.