Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'master' of git://github.com/bgirard/eideticker

  • Loading branch information...
commit 302cd690ffb6f3c8b85dd5e1f129de91fea51e24 2 parents bf3a5e8 + 6fac8a6
William Lachance authored August 23, 2012
45  src/dashboard/js/index.js
@@ -62,10 +62,12 @@ function updateGraph(rawdata, measure) {
62 62
 
63 63
     // line graph (aggregate average per day)
64 64
     var series2 = {
  65
+      hoverLabel: "Average per day for " + type,
65 66
       lines: { show: true },
66 67
       color: color,
67 68
       data: [],
68  
-      clickable: false
  69
+      clickable: false,
  70
+      hoverable: false
69 71
     };
70 72
     Object.keys(rawdata[type]).forEach(function(datestr) {
71 73
       var numSamples = 0;
@@ -116,6 +118,47 @@ function updateGraph(rawdata, measure) {
116 118
         plot.zoomOut();
117 119
   });
118 120
 
  121
+  function showTooltip(x, y, contents) {
  122
+      $('<div id="tooltip">' + contents + '</div>').css( {
  123
+          position: 'absolute',
  124
+          display: 'none',
  125
+          top: y + 5,
  126
+          left: x + 5,
  127
+          border: '1px solid #fdd',
  128
+          padding: '2px',
  129
+          'background-color': '#fee',
  130
+          opacity: 0.80
  131
+      }).appendTo("body").fadeIn(200);
  132
+  }
  133
+
  134
+  // Plot Hover tooltip
  135
+  var previousPoint = null;
  136
+  $("#graph-container").bind("plothover", function (event, pos, item) {
  137
+    if (item) {
  138
+      if (previousPoint != item.dataIndex) {
  139
+        var toolTip;
  140
+        var x = item.datapoint[0].toFixed(2),
  141
+            y = item.datapoint[1].toFixed(2);
  142
+
  143
+        if (metadataHash[item.seriesIndex] && metadataHash[item.seriesIndex][item.dataIndex]) {
  144
+          var metadata = metadataHash[item.seriesIndex][item.dataIndex];
  145
+          toolTip = (item.series.label || item.series.hoverLabel) + " of " + (metadata.appDate || "'Unknown Date'") + " = " + y;
  146
+        } else {
  147
+          console.log(JSON.stringify(item.series));
  148
+          toolTip = (item.series.label || item.series.hoverLabel) + " = " + y;
  149
+        }
  150
+
  151
+        previousPoint = item.dataIndex;
  152
+
  153
+        $("#tooltip").remove();
  154
+        showTooltip(item.pageX, item.pageY, toolTip);
  155
+      }
  156
+    } else {
  157
+      $("#tooltip").remove();
  158
+      previousPoint = null;
  159
+    }
  160
+  });
  161
+
119 162
   $("#graph-container").bind("plotclick", function (event, pos, item) {
120 163
     plot.unhighlight();
121 164
     if (item) {
10  src/dashboard/js/jquery.flot.navigate.js
@@ -92,17 +92,17 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
92 92
 
93 93
 
94 94
 /* jquery.mousewheel.min.js
95  
- * Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
96  
- * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
97  
- * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
  95
+ * Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
  96
+ * Licensed under the MIT License (LICENSE.txt).
98 97
  * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
99 98
  * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
  99
+ * Thanks to: Seamus Leahy for adding deltaX and deltaY
100 100
  *
101  
- * Version: 3.0.2
  101
+ * Version: 3.0.6
102 102
  * 
103 103
  * Requires: 1.2.2+
104 104
  */
105  
-(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery);
  105
+(function(d){function e(a){var b=a||window.event,c=[].slice.call(arguments,1),f=0,e=0,g=0,a=d.event.fix(b);a.type="mousewheel";b.wheelDelta&&(f=b.wheelDelta/120);b.detail&&(f=-b.detail/3);g=f;void 0!==b.axis&&b.axis===b.HORIZONTAL_AXIS&&(g=0,e=-1*f);void 0!==b.wheelDeltaY&&(g=b.wheelDeltaY/120);void 0!==b.wheelDeltaX&&(e=-1*b.wheelDeltaX/120);c.unshift(a,f,e,g);return(d.event.dispatch||d.event.handle).apply(this,c)}var c=["DOMMouseScroll","mousewheel"];if(d.event.fixHooks)for(var h=c.length;h;)d.event.fixHooks[c[--h]]=d.event.mouseHooks;d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],e,!1);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],e,!1);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
106 106
 
107 107
 
108 108
 
4  src/eideticker/eideticker/device.py
@@ -65,9 +65,9 @@ def _shellCheckOutput(self, args):
65 65
         retval = self.shell(args, buf)
66 66
         output = str(buf.getvalue()[0:-1]).rstrip()
67 67
         if retval == None:
68  
-            raise Exception("Did not successfully run command %s (output: '%s')" % (args, output))
  68
+            raise Exception("Did not successfully run command %s (output: '%s', retval: 'None')" % (args, output))
69 69
         if retval != 0:
70  
-            raise Exception("Non-zero return code for command: %s (output: '%s')" % (args, output))
  70
+            raise Exception("Non-zero return code for command: %s (output: '%s', retval: '%i')" % (args, output, retval))
71 71
         return output
72 72
 
73 73
     def _executeScript(self, events, executeCallback=None):

0 notes on commit 302cd69

Please sign in to comment.
Something went wrong with that request. Please try again.