diff options
author | Milo Casagrande <milo.casagrande@linaro.org> | 2015-02-27 10:01:41 +0100 |
---|---|---|
committer | Milo Casagrande <milo.casagrande@linaro.org> | 2015-02-27 10:01:41 +0100 |
commit | 2d99d5316bb14dcedda31ae298d19ca4658054e8 (patch) | |
tree | e6373388847dc108599a19e73db82e3e9d44e914 | |
parent | dd1f2a00c2adf58658614a5a5bb3b728fe48b29e (diff) |
Rework init function.
Change-Id: I5f95c0c9690042c1c4dca3649fc089de5368e548
-rw-r--r-- | app/dashboard/static/js/linaro-graphs-0.0.1.js | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/app/dashboard/static/js/linaro-graphs-0.0.1.js b/app/dashboard/static/js/linaro-graphs-0.0.1.js index bde9da9..dc44565 100644 --- a/app/dashboard/static/js/linaro-graphs-0.0.1.js +++ b/app/dashboard/static/js/linaro-graphs-0.0.1.js @@ -123,8 +123,6 @@ var KG = (function() { self.defs = null; self.clipPath = null; - self.hoverGroup = null; - self.failHoverGroup = null; self.yAxisGroup = null; self.xAxisGroup = null; @@ -168,14 +166,6 @@ var KG = (function() { .attr('class', 'x-axis axis') .attr('transform', sprintf(translateFmt, 0, self.paddedH)); - self.hoverGroup = self.svgGroup.append('g') - .attr('class', 'hover-group pass-hover-group pass') - .attr('pointer-events', 'visible'); - - self.failHoverGroup = self.svgGroup.append('g') - .attr('class', 'hover-group fail-hover-group fail') - .attr('pointer-events', 'none'); - return self; }; @@ -192,12 +182,29 @@ var KG = (function() { BootTimeGraph = function(elementId, w, h, margins) { var self = this; GenericGraph.call(self, elementId, w, h, margins); + self.hoverGroup = null; + self.timeGraphLine = null; return self; }; BootTimeGraph.prototype = Object.create(GenericGraph.prototype); BootTimeGraph.prototype.constructor = BootTimeGraph; + BootTimeGraph.prototype.init = function() { + var self = this; + GenericGraph.prototype.init.call(self); + self.hoverGroup = self.svgGroup.append('g') + .attr('class', 'hover-group') + .attr('pointer-events', 'visible'); + return self; + }; + + BootTimeGraph.prototype.bind = function(data) { + var self = this; + console.log(data); + return self; + }; + PassFailGraph = function(elementId, w, h, margins) { var self = this; GenericGraph.call(self, elementId, w, h, margins); @@ -205,6 +212,8 @@ var KG = (function() { self.passLineFunc = d3.svg.line(); self.failLineGroup = null; self.failLineFunc = d3.svg.line(); + self.hoverGroup = null; + self.failHoverGroup = null; // Prev index when hovering the mouse over the hoverGroup element. // This is used to provide show/hide of the elements. // Index will never be < 0. @@ -217,6 +226,21 @@ var KG = (function() { PassFailGraph.prototype = Object.create(GenericGraph.prototype); PassFailGraph.prototype.constructor = PassFailGraph; + PassFailGraph.prototype.init = function() { + var self = this; + GenericGraph.prototype.init.call(self); + + self.hoverGroup = self.svgGroup.append('g') + .attr('class', 'hover-group pass-hover-group pass') + .attr('pointer-events', 'visible'); + + self.failHoverGroup = self.svgGroup.append('g') + .attr('class', 'hover-group fail-hover-group fail') + .attr('pointer-events', 'none'); + + return self; + }; + PassFailGraph.prototype.bind = function(data, job) { var self = this; self.data = countKernelStatus(data); |