Enable "strict" mode -- and fix one missing "var" declaration.
[dygraphs.git] / dygraph-layout.js
index 915d235..7948686 100644 (file)
@@ -9,6 +9,8 @@
  * dygraphs.
  */
 
+"use strict";
+
 /**
  * Creates a new DygraphLayout object.
  *
  *
  * @constructor
  */
-DygraphLayout = function(dygraph) {
+var DygraphLayout = function(dygraph) {
   this.dygraph_ = dygraph;
   this.datasets = new Array();
   this.annotations = new Array();
   this.yAxes_ = null;
-  this.plotArea = this.computePlotArea_();
 
   // TODO(danvk): it's odd that xTicks_ and yTicks_ are inputs, but xticks and
   // yticks are outputs. Clean this up.
@@ -46,6 +47,10 @@ DygraphLayout.prototype.addDataset = function(setname, set_xy) {
   this.datasets[setname] = set_xy;
 };
 
+DygraphLayout.prototype.getPlotArea = function() {
+  return this.computePlotArea_();
+}
+
 // Compute the box which the chart should be drawn in. This is the canvas's
 // box, less space needed for axis and chart labels.
 DygraphLayout.prototype.computePlotArea_ = function() {