From 464e9421573da45bceb795deac61eb74b12749f0 Mon Sep 17 00:00:00 2001
From: Dan Vanderkam <danvdk@gmail.com>
Date: Sun, 1 Sep 2013 12:53:08 -0400
Subject: [PATCH] demo chart renders correctly with combined; interaction
 broken

---
 dygraph.js                |  1 +
 generate-combined.sh      |  2 +-
 plugins/annotations.js    |  4 ++--
 plugins/axes.js           |  6 +++---
 plugins/chart-labels.js   |  4 ++--
 plugins/grid.js           |  2 +-
 plugins/legend.js         | 10 ++++++----
 plugins/range-selector.js |  6 +++---
 8 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/dygraph.js b/dygraph.js
index d9695a2..c413166 100644
--- a/dygraph.js
+++ b/dygraph.js
@@ -281,6 +281,7 @@ Dygraph.prototype.init_ = function(div, file, opt_attrs) {
       }
     }
   }
+  window.console.log(this.eventListeners_);
 
   this.createDragInterface_();
 
diff --git a/generate-combined.sh b/generate-combined.sh
index 54cfd9e..9839502 100755
--- a/generate-combined.sh
+++ b/generate-combined.sh
@@ -46,7 +46,7 @@ Copyright () {
 CatMinified () {
   Copyright
   (CatSources | grep -v '@license') \
-  | java -jar ../../closure-compiler-read-only/build/compiler.jar --js ../../closure-library-read-only/closure/goog/base.js --js - --js dygraph-exports.js --compilation_level ADVANCED_OPTIMIZATIONS --warning_level VERBOSE --externs dygraph-externs.js --externs gviz-api.js --output_wrapper='(function() {%output%})();'
+  | java -jar ../../closure-compiler-read-only/build/compiler.jar --js ../../closure-library-read-only/closure/goog/base.js --formatting PRETTY_PRINT --js - --js dygraph-exports.js --compilation_level ADVANCED_OPTIMIZATIONS --warning_level VERBOSE --externs dygraph-externs.js --externs gviz-api.js --output_wrapper='(function() {%output%})();'
   # Add this for debugging:
   #  --formatting PRETTY_PRINT 
 
diff --git a/plugins/annotations.js b/plugins/annotations.js
index e518fe3..f6fcb87 100644
--- a/plugins/annotations.js
+++ b/plugins/annotations.js
@@ -33,8 +33,8 @@ annotations.prototype.toString = function() {
 
 annotations.prototype.activate = function(g) {
   return {
-    clearChart: this.clearChart,
-    didDrawChart: this.didDrawChart
+    'clearChart': this.clearChart,
+    'didDrawChart': this.didDrawChart
   };
 };
 
diff --git a/plugins/axes.js b/plugins/axes.js
index d1fe9b9..2ff2400 100644
--- a/plugins/axes.js
+++ b/plugins/axes.js
@@ -43,9 +43,9 @@ axes.prototype.toString = function() {
 
 axes.prototype.activate = function(g) {
   return {
-    layout: this.layout,
-    clearChart: this.clearChart,
-    willDrawChart: this.willDrawChart
+    'layout': this.layout,
+    'clearChart': this.clearChart,
+    'willDrawChart': this.willDrawChart
   };
 };
 
diff --git a/plugins/chart-labels.js b/plugins/chart-labels.js
index da231d8..a3c8e11 100644
--- a/plugins/chart-labels.js
+++ b/plugins/chart-labels.js
@@ -25,9 +25,9 @@ chart_labels.prototype.toString = function() {
 
 chart_labels.prototype.activate = function(g) {
   return {
-    layout: this.layout,
+    'layout': this.layout,
     // clearChart: this.clearChart,
-    didDrawChart: this.didDrawChart
+    'didDrawChart': this.didDrawChart
   };
 };
 
diff --git a/plugins/grid.js b/plugins/grid.js
index 1fb34fc..392aec6 100644
--- a/plugins/grid.js
+++ b/plugins/grid.js
@@ -33,7 +33,7 @@ grid.prototype.toString = function() {
 
 grid.prototype.activate = function(g) {
   return {
-    willDrawChart: this.willDrawChart
+    'willDrawChart': this.willDrawChart
   };
 };
 
diff --git a/plugins/legend.js b/plugins/legend.js
index 6684641..2877987 100644
--- a/plugins/legend.js
+++ b/plugins/legend.js
@@ -102,11 +102,11 @@ legend.prototype.activate = function(g) {
   this.one_em_width_ = 10;  // just a guess, will be updated.
 
   return {
-    select: this.select,
-    deselect: this.deselect,
+    'select': this.select,
+    'deselect': this.deselect,
     // TODO(danvk): rethink the name "predraw" before we commit to it in any API.
-    predraw: this.predraw,
-    didDrawChart: this.didDrawChart
+    'predraw': this.predraw,
+    'didDrawChart': this.didDrawChart
   };
 };
 
@@ -138,6 +138,7 @@ legend.prototype.deselect = function(e) {
 };
 
 legend.prototype.didDrawChart = function(e) {
+  window.console.log('legend.didDrawChart');
   this.deselect(e);
 };
 
@@ -151,6 +152,7 @@ legend.prototype.didDrawChart = function(e) {
  * @private
  */
 legend.prototype.predraw = function(e) {
+  window.console.log('legend.predraw');
   // Don't touch a user-specified labelsDiv.
   if (!this.is_generated_div_) return;
 
diff --git a/plugins/range-selector.js b/plugins/range-selector.js
index 5c9df58..59bcca4 100644
--- a/plugins/range-selector.js
+++ b/plugins/range-selector.js
@@ -34,9 +34,9 @@ rangeSelector.prototype.activate = function(dygraph) {
     this.createInterface_();
   }
   return {
-    layout: this.reserveSpace_,
-    predraw: this.renderStaticLayer_,
-    didDrawChart: this.renderInteractiveLayer_
+    'layout': this.reserveSpace_,
+    'predraw': this.renderStaticLayer_,
+    'didDrawChart': this.renderInteractiveLayer_
   };
 };
 
-- 
2.7.4