- npm updates
- add legend-entry-component files - add DatasetOptions class
This commit is contained in:
parent
dbf8aa495e
commit
91cd763da0
15 changed files with 1043 additions and 534 deletions
|
@ -3,7 +3,8 @@ import { Component, OnInit } from '@angular/core';
|
|||
|
||||
import { DatasetService } from '../../services/dataset.service';
|
||||
import { AppRouterService } from '../../services/app-router.service';
|
||||
import { GeomonTimeseries, GeomonDataset } from '../../../shared/models/dataset';
|
||||
// import { GeomonTimeseries, GeomonDataset } from '../../../shared/models/dataset';
|
||||
import { DatasetOptions } from '../../../shared/models/options';
|
||||
|
||||
@Component({
|
||||
selector: 'app-bar',
|
||||
|
@ -16,7 +17,7 @@ export class DiagramViewComponent implements OnInit {
|
|||
|
||||
public selectedIds: string[] = [];
|
||||
|
||||
public datasetOptions: Map<string, GeomonTimeseries> = new Map();
|
||||
public datasetOptions: Map<string, DatasetOptions> = new Map();
|
||||
|
||||
public diagramLoading: boolean;
|
||||
public overviewLoading: boolean;
|
||||
|
@ -29,7 +30,7 @@ export class DiagramViewComponent implements OnInit {
|
|||
// };
|
||||
|
||||
constructor(
|
||||
public datasetService: DatasetService<GeomonTimeseries>,
|
||||
public datasetService: DatasetService<DatasetOptions>,
|
||||
public appRouter: AppRouterService,) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
|
@ -41,11 +42,7 @@ export class DiagramViewComponent implements OnInit {
|
|||
|
||||
private setDatasets() {
|
||||
this.datasetIds = this.datasetService.datasetIds;
|
||||
this.datasetOptions = this.datasetService.datasetService;
|
||||
}
|
||||
|
||||
public clearSelection() {
|
||||
this.selectedIds = [];
|
||||
this.datasetOptions = this.datasetService.datasetOptions;
|
||||
}
|
||||
|
||||
public removeAllTimeseries() {
|
||||
|
@ -56,6 +53,21 @@ export class DiagramViewComponent implements OnInit {
|
|||
this.datasetService.removeDataset(internalId);
|
||||
}
|
||||
|
||||
public onSelectDataset(selected: boolean, internalId: string) {
|
||||
if (selected) {
|
||||
this.selectedIds.push(internalId);
|
||||
} else {
|
||||
this.selectedIds.splice(this.selectedIds.findIndex(entry => entry === internalId), 1);
|
||||
}
|
||||
}
|
||||
|
||||
public clearSelection() {
|
||||
this.selectedIds = [];
|
||||
}
|
||||
|
||||
public onUpdateOptions(options: DatasetOptions, internalId: string) {
|
||||
this.datasetService.updateDatasetOptions(options, internalId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue