All files / app/codeCharta/ui/attributeSideBar/metricDeltaSelected metricDeltaSelected.component.ts

100% Statements 10/10
100% Branches 0/0
100% Functions 2/2
100% Lines 9/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 305x 5x       5x 5x 5x                 5x           29x     29x 29x      
import { Component, Input, OnInit } from "@angular/core"
import { Store } from "@ngrx/store"
import { Observable } from "rxjs"
 
import { CcState, CodeMapNode, MapColors } from "../../../codeCharta.model"
import { selectedNodeSelector } from "../../../state/selectors/selectedNode.selector"
import { mapColorsSelector } from "../../../state/store/appSettings/mapColors/mapColors.selector"
import { AsyncPipe, DecimalPipe } from "@angular/common"
 
@Component({
    selector: "cc-metric-delta-selected",
    templateUrl: "./metricDeltaSelected.component.html",
    styleUrls: ["./metricDeltaSelected.component.scss"],
    standalone: true,
    imports: [AsyncPipe, DecimalPipe]
})
export class MetricDeltaSelectedComponent implements OnInit {
    @Input() metricName: string
 
    selectedNode$: Observable<CodeMapNode>
    mapColors$: Observable<MapColors>
 
    constructor(private store: Store<CcState>) {}
 
    ngOnInit(): void {
        this.selectedNode$ = this.store.select(selectedNodeSelector)
        this.mapColors$ = this.store.select(mapColorsSelector)
    }
}