Skip to content

Commit

Permalink
Merge branch 'ui_stability' into lts2_client
Browse files Browse the repository at this point in the history
  • Loading branch information
thebracket committed Oct 17, 2024
2 parents f0fa04c + d91b192 commit 26584d8
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ class AllTreeSankeyGraph extends GenericRingBuffer {
// Now go through the links and average the values, recalculating the color
for (let i=0; i<links.length; i++) {
links[i].value /= links[i].n;
let percent = Math.min(100, (links[i].value / links[i].maxBytes) * 100);
links[i].lineStyle.color = lerpGreenToRedViaOrange(100 - percent, 100);
let bytesAsMegabits = links[i].value / 1000000;
let percent = Math.min(100, (bytesAsMegabits / links[i].maxBytes) * 100);
let capacityColor = lerpGreenToRedViaOrange(100 - percent, 100);
links[i].lineStyle.color = capacityColor;
}

// Update the graph
Expand Down

0 comments on commit 26584d8

Please sign in to comment.