Skip to content

Commit d54cd5e

Browse files
committed
feat: grouping nodes in graph
1 parent 8694539 commit d54cd5e

10 files changed

Lines changed: 276 additions & 65 deletions

File tree

backend/.forensic/config.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
{
22
"scopes": [
3+
"src/app/domains/ticketing/feature-booking",
4+
"src/app/domains/checkin/data",
5+
"src/app/domains/checkin/feature-manage",
6+
"src/app/domains/ticketing/data",
7+
"src/app/domains/ticketing/feature-my-tickets",
8+
"src/app/domains/ticketing/feature-next-flight",
9+
"src/app/domains/ticketing/ui-common",
10+
"src/app/shared/util-logger",
11+
"src/app/shared/util-common",
12+
"src/app/shared/util-auth"
13+
],
14+
"groups": [
315
"src/app/domains/checkin",
416
"src/app/domains/ticketing",
5-
"src/app/shared"
17+
"src/app/domains",
18+
"src/app/shared",
19+
"src/app",
20+
"src"
621
]
722
}

backend/src/infrastructure/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Config } from "../model/config";
44
import { Options } from "../options/options";
55
import fs from "fs";
66

7-
export function loadConfig(options: Options) {
7+
export function loadConfig(options: Options): Config {
88
const configPath = path.join(cwd(), options.config);
99
const config = JSON.parse(fs.readFileSync(configPath, "utf-8")) as Config;
1010
return config;

backend/src/model/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export type Config = {
22
scopes: string[];
3+
groups: string[];
34
};

backend/src/services/coupling.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { toPercent } from "../utils/round";
88

99
// TODO: Restructure fileCount and cohesion into dimensions node
1010
export type CouplingResult = {
11+
groups: string[];
1112
dimensions: string[];
1213
fileCount: number[];
1314
cohesion: number[];
@@ -43,6 +44,7 @@ export function calcCoupling(options: Options): CouplingResult {
4344
const cohesion = calcCohesion(moduleInfo, matrix);
4445

4546
return {
47+
groups: config.groups,
4648
dimensions: config.scopes,
4749
fileCount: moduleInfo.fileCount,
4850
cohesion,

frontend/src/app/coupling/chord/chord.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
44
import { CouplingService } from '../coupling.service';
55
import { EventService } from '../../event.service';
66
import { MatListModule } from '@angular/material/list';
7-
import { ModuleService } from '../module.service';
87

98
type NodeDetails = {
109
title: string;

frontend/src/app/coupling/coupling-result.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ export type CouplingResult = {
33
fileCount: number[];
44
cohesion: number[];
55
matrix: number[][];
6+
groups: string[];
67
};

frontend/src/app/coupling/graph/graph.component.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ svg {
1313
height: 100%;
1414
}
1515

16+
.qtip-bootstrap {
17+
max-width: 700px;
18+
}
1619

1720
.tooltip {
1821
position: absolute;
@@ -24,6 +27,8 @@ svg {
2427
border-radius: 8px;
2528
pointer-events: none;
2629
opacity: 0;
30+
width: auto;
31+
max-width: 700px;
2732
}
2833

2934
#network {

frontend/src/app/coupling/graph/graph.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<mat-checkbox [(ngModel)]="groupByFolder" (change)="groupByFolderChanged($event)">Group by folder</mat-checkbox>
12

23

34
<div id="network"></div>

0 commit comments

Comments
 (0)