Skip to content

Commit

Permalink
more colors to matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatandrei committed Dec 26, 2024
1 parent 978f5f2 commit c51742c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@{
var projects = Model.AlphabeticOrderedProjects;
ProjectData[] projects2 = new List<ProjectData>(projects).ToArray();
var maxRef = Model.MaxMatrixRef();
}
@{
<table border="1" title="image matrix projects">
Expand Down Expand Up @@ -38,7 +39,15 @@
int found = prj.FindReferenceRec(prj2);
if (found==1){
style = "style='text-align:center;background-color: yellow;color: red;'";
}
}
if (found == maxRef)
{
style = "style='text-align:center;background-color: red;color: blue;'";
}
if (found == maxRef-1)
{
style = "style='text-align:center;background-color: tomato;color: blue;'";
}
<td @style>@(found==0?"&nbsp;":found)</td>
}
}
Expand Down
16 changes: 16 additions & 0 deletions src/NetPackageAnalyzer/NetPackageAnalyzerObjects/ProjectsDict.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ public partial class ProjectsDict : Dictionary<string, ProjectData>
public ProjectsDict(Dictionary<string, ProjectData> data) : base(data)
{

}
public int MaxMatrixRef()
{
var ret = 0;
var projects = AlphabeticOrderedProjects;
ProjectData[] projects2 = new List<ProjectData>(projects).ToArray();
foreach (var prj in projects)
{
foreach (var prj2 in projects2)
{
if (prj2 == prj) continue;
int found = prj.FindReferenceRec(prj2);
if (ret < found) ret = found;
}
}
return ret;
}
public int NrLicenses()
{
Expand Down

0 comments on commit c51742c

Please sign in to comment.