|
|
@ -1,7 +1,7 @@ |
|
|
|
import { AfterViewInit, Component, ElementRef, Renderer2, ViewChild } from "@angular/core"; |
|
|
|
import { ApiService } from "@cdk/services"; |
|
|
|
import { format } from "date-fns"; |
|
|
|
import { Subject, finalize, interval, takeUntil } from "rxjs"; |
|
|
|
import { Subject, Subscription, finalize, interval, takeUntil } from "rxjs"; |
|
|
|
|
|
|
|
interface MenuDisplayItem { |
|
|
|
name: string; |
|
|
@ -138,7 +138,10 @@ export class DataVisComponent implements AfterViewInit { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
scrollSubs$?: Subscription; |
|
|
|
|
|
|
|
autoScroll(el: HTMLElement, scroll: string) { |
|
|
|
this.scrollSubs$?.unsubscribe(); |
|
|
|
const child = el.children[0]; |
|
|
|
if (!child) { |
|
|
|
return; |
|
|
@ -148,7 +151,7 @@ export class DataVisComponent implements AfterViewInit { |
|
|
|
if (childHeight <= elHeight) { |
|
|
|
return; |
|
|
|
} |
|
|
|
interval(60) |
|
|
|
this.scrollSubs$ = interval(60) |
|
|
|
.pipe(takeUntil(this.destroy$)) |
|
|
|
.subscribe(() => { |
|
|
|
this.scroll[scroll] = (this.scroll[scroll] ?? 0) + 1; |
|
|
|