@@ -16,13 +16,14 @@ import {
1616} from 'rxjs' ;
1717
1818import { CouplingService } from '../../data/coupling.service' ;
19+ import { LimitsStore } from '../../data/limits.store' ;
1920import { StatusStore } from '../../data/status.store' ;
2021import {
2122 CouplingResult ,
2223 initCouplingResult ,
2324} from '../../model/coupling-result' ;
2425import { GraphType } from '../../model/graph-type' ;
25- import { initLimits , Limits } from '../../model/limits' ;
26+ import { initLimits , Limits , LimitType } from '../../model/limits' ;
2627import { Graph , CouplingNodeDefinition } from '../../ui/graph/graph' ;
2728import { GraphComponent } from '../../ui/graph/graph.component' ;
2829import { LimitsComponent } from '../../ui/limits/limits.component' ;
@@ -54,6 +55,8 @@ const COUPLING_TIP =
5455 styleUrl : './coupling.component.css' ,
5556} )
5657export class CouplingComponent {
58+ private limitsStore = inject ( LimitsStore ) ;
59+
5760 private couplingService = inject ( CouplingService ) ;
5861 private eventService = inject ( EventService ) ;
5962 private statusStore = inject ( StatusStore ) ;
@@ -66,7 +69,8 @@ export class CouplingComponent {
6669
6770 totalCommits = this . statusStore . commits ;
6871 groupByFolder = signal ( false ) ;
69- limits = signal ( initLimits ) ;
72+
73+ limits = this . limitsStore . limits ;
7074 minConnections = signal ( 1 ) ;
7175
7276 couplingResult$ = combineLatest ( {
@@ -94,8 +98,12 @@ export class CouplingComponent {
9498 ) ;
9599 }
96100
101+ updateLimits ( limits : Limits ) : void {
102+ this . limitsStore . updateLimits ( limits ) ;
103+ }
104+
97105 toGraph ( result : CouplingResult ) : Graph {
98- result . matrix = this . clearSelfLinks ( result . matrix ) ;
106+ result . matrix = clearSelfLinks ( result . matrix ) ;
99107
100108 console . log ( 'result' , result ) ;
101109
@@ -116,11 +124,11 @@ export class CouplingComponent {
116124
117125 return graph ;
118126 }
127+ }
119128
120- private clearSelfLinks ( matrix : number [ ] [ ] ) : number [ ] [ ] {
121- for ( let i = 0 ; i < matrix . length ; i ++ ) {
122- matrix [ i ] [ i ] = 0 ;
123- }
124- return matrix ;
129+ function clearSelfLinks ( matrix : number [ ] [ ] ) : number [ ] [ ] {
130+ for ( let i = 0 ; i < matrix . length ; i ++ ) {
131+ matrix [ i ] [ i ] = 0 ;
125132 }
133+ return matrix ;
126134}
0 commit comments