|
@@ -9,6 +9,8 @@ import {SdmDihService} from '../../sdm-dih.service';
|
|
|
styleUrls: ['./factor-year-graph.component.scss'],
|
|
styleUrls: ['./factor-year-graph.component.scss'],
|
|
|
})
|
|
})
|
|
|
export class FactorYearGraphComponent implements OnInit {
|
|
export class FactorYearGraphComponent implements OnInit {
|
|
|
|
|
+ animationRunning = false;
|
|
|
|
|
+
|
|
|
constructor(
|
|
constructor(
|
|
|
public sdmDihService: SdmDihService,
|
|
public sdmDihService: SdmDihService,
|
|
|
public yearGraphService: FactorYearGraphService
|
|
public yearGraphService: FactorYearGraphService
|
|
@@ -24,6 +26,7 @@ export class FactorYearGraphComponent implements OnInit {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
animateGraphs() {
|
|
animateGraphs() {
|
|
|
|
|
+ this.animationRunning = true;
|
|
|
const MILLISECONDS_TO_ANIMATE = 100 as const;
|
|
const MILLISECONDS_TO_ANIMATE = 100 as const;
|
|
|
let i = 1;
|
|
let i = 1;
|
|
|
for (const year of this.sdmDihService.years) {
|
|
for (const year of this.sdmDihService.years) {
|
|
@@ -33,6 +36,9 @@ export class FactorYearGraphComponent implements OnInit {
|
|
|
}, MILLISECONDS_TO_ANIMATE * i);
|
|
}, MILLISECONDS_TO_ANIMATE * i);
|
|
|
i++;
|
|
i++;
|
|
|
}
|
|
}
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.animationRunning = false;
|
|
|
|
|
+ }, MILLISECONDS_TO_ANIMATE * this.sdmDihService.years.length);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
nextYear() {
|
|
nextYear() {
|