summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--static/status-dnbd3.html18
1 files changed, 13 insertions, 5 deletions
diff --git a/static/status-dnbd3.html b/static/status-dnbd3.html
index 16bc17e..0a9556e 100644
--- a/static/status-dnbd3.html
+++ b/static/status-dnbd3.html
@@ -185,7 +185,7 @@ function myGraph(el) {
// Green colors between 0 - 1 MB/s
if( link.colorIntensity <= 1000 ) {
// Blending idle (blue) and active (green) color
- var factor = link.colorIntensity / 1000; //Math.log(link.colorIntensity+1) / Math.log(maxIntensity);
+ var factor = link.colorIntensity / 1000;
var cFactor = 1 - factor;
red = cFactor * idleColor.r + factor * activeColor.r;
@@ -194,7 +194,7 @@ function myGraph(el) {
} else { // Red over 1MB/s
// Blending active (green) and peak (red) color
- var factor = (link.colorIntensity - 1000)/ (maxIntensity - 1000); //Math.log(link.colorIntensity+1) / Math.log(maxIntensity);
+ var factor = (link.colorIntensity - 1000)/ (maxIntensity - 1000);
var cFactor = 1 - factor;
red = cFactor * activeColor.r + factor * peakColor.r;
@@ -278,7 +278,8 @@ function myGraph(el) {
update();
}
- var update = function () {
+
+ function update () {
var link = vis.selectAll("line.link")
.data(links, function(d) { return d.source.id + "-" + d.target.id; });
@@ -387,9 +388,16 @@ function myGraph(el) {
}
}
- update();
- $( window ).resize( update );
+
+ window.onresize = forceUpdate;
+
+ function forceUpdate () {
+ changed = true;
+ update();
+ }
+ forceUpdate();
}
+
graph = new myGraph("#graph");