2020-03-17 22:39:06 -04:00
|
|
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
2020-03-16 15:13:49 -04:00
|
|
|
import { Folder } from '../../folder'
|
2020-03-16 13:53:07 -04:00
|
|
|
import { cardElevation } from '../../style'
|
2020-03-17 22:39:06 -04:00
|
|
|
import { FolderService } from 'src/app/folder.service';
|
|
|
|
|
import { SystemConfigService } from 'src/app/system-config.service';
|
|
|
|
|
import { DbStatusService } from 'src/app/db-status.service';
|
|
|
|
|
import { flatMap } from 'rxjs/operators';
|
|
|
|
|
import { DonutChartComponent } from '../donut-chart/donut-chart.component';
|
2020-03-16 12:11:27 -04:00
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-folder-chart',
|
|
|
|
|
templateUrl: './folder-chart.component.html',
|
|
|
|
|
styleUrls: ['./folder-chart.component.scss']
|
|
|
|
|
})
|
|
|
|
|
export class FolderChartComponent implements OnInit {
|
2020-03-17 22:39:06 -04:00
|
|
|
@ViewChild(DonutChartComponent) donutChart: DonutChartComponent;
|
2020-03-16 13:53:07 -04:00
|
|
|
chartID: string = 'foldersChart';
|
|
|
|
|
elevation: string = cardElevation;
|
2020-03-18 19:39:25 -04:00
|
|
|
|
2020-03-17 22:39:06 -04:00
|
|
|
constructor(
|
|
|
|
|
private systemConfigService: SystemConfigService,
|
|
|
|
|
private folderService: FolderService,
|
|
|
|
|
private dbStatusService: DbStatusService
|
|
|
|
|
) { }
|
2020-03-16 12:11:27 -04:00
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
|
|
}
|
2020-03-17 22:39:06 -04:00
|
|
|
|
2020-03-16 17:58:20 -04:00
|
|
|
ngAfterViewInit() {
|
2020-03-17 22:39:06 -04:00
|
|
|
// TODO: Find total number of folders
|
|
|
|
|
this.folderService.getAll().subscribe(
|
|
|
|
|
folder => {
|
|
|
|
|
// TODO: Clear existing data
|
2020-03-18 19:39:25 -04:00
|
|
|
this.donutChart.data([40]);
|
|
|
|
|
|
2020-03-17 22:39:06 -04:00
|
|
|
console.log("folder?", folder)
|
|
|
|
|
}
|
|
|
|
|
);
|
2020-03-16 12:11:27 -04:00
|
|
|
|
2020-03-16 17:58:20 -04:00
|
|
|
}
|
2020-03-16 12:11:27 -04:00
|
|
|
}
|