file size experiments; possible 36% savings
authorDan Vanderkam <danvdk@gmail.com>
Tue, 23 Jul 2013 00:24:42 +0000 (20:24 -0400)
committerDan Vanderkam <danvdk@gmail.com>
Tue, 23 Jul 2013 00:24:42 +0000 (20:24 -0400)
closure-todo.txt
dygraph-exports.js
generate-combined.sh
tests/demo.html
tests/demo.js [new file with mode: 0644]

index 10dcead..ddc3a1d 100644 (file)
@@ -38,3 +38,4 @@ As each file is closurized, it can be added as a "--js" parameter.
 
 NOTES
 - Should add .getNumericOption() and .getStringOption() which are aliases for .getOption() but returns number/string, not *.
+- plugin-free code is 52778 compiled; for uglifyjs it's 83031 (36% savings)
index 3bcf8d5..f542c45 100644 (file)
@@ -1,3 +1,44 @@
 goog.exportSymbol('Dygraph', Dygraph);
-goog.exportSymbol('Dygraph.prototype.updateOptions', Dygraph.prototype.updateOptions);
+
+goog.exportSymbol('Dygraph.prototype.adjustRoll', Dygraph.prototype.adjustRoll);
+goog.exportSymbol('Dygraph.prototype.annotations', Dygraph.prototype.annotations);
+goog.exportSymbol('Dygraph.prototype.clearSelection', Dygraph.prototype.clearSelection);
 goog.exportSymbol('Dygraph.prototype.destroy', Dygraph.prototype.destroy);
+goog.exportSymbol('Dygraph.prototype.eventToDomCoords', Dygraph.prototype.eventToDomCoords);
+goog.exportSymbol('Dygraph.prototype.getArea', Dygraph.prototype.getArea);
+goog.exportSymbol('Dygraph.prototype.getColors', Dygraph.prototype.getColors);
+goog.exportSymbol('Dygraph.prototype.getHighlightSeries', Dygraph.prototype.getHighlightSeries);
+goog.exportSymbol('Dygraph.prototype.getLabels', Dygraph.prototype.getLabels);
+goog.exportSymbol('Dygraph.prototype.getOption', Dygraph.prototype.getOption);
+goog.exportSymbol('Dygraph.prototype.getPropertiesForSeries', Dygraph.prototype.getPropertiesForSeries);
+goog.exportSymbol('Dygraph.prototype.getSelection', Dygraph.prototype.getSelection);
+goog.exportSymbol('Dygraph.prototype.getValue', Dygraph.prototype.getValue);
+goog.exportSymbol('Dygraph.prototype.indexFromSetName', Dygraph.prototype.indexFromSetName);
+goog.exportSymbol('Dygraph.prototype.isSeriesLocked', Dygraph.prototype.isSeriesLocked);
+goog.exportSymbol('Dygraph.prototype.isZoomed', Dygraph.prototype.isZoomed);
+goog.exportSymbol('Dygraph.prototype.numAxes', Dygraph.prototype.numAxes);
+goog.exportSymbol('Dygraph.prototype.numColumns', Dygraph.prototype.numColumns);
+goog.exportSymbol('Dygraph.prototype.numRows', Dygraph.prototype.numRows);
+goog.exportSymbol('Dygraph.prototype.resetZoom', Dygraph.prototype.resetZoom);
+goog.exportSymbol('Dygraph.prototype.resize', Dygraph.prototype.resize);
+goog.exportSymbol('Dygraph.prototype.rollPeriod', Dygraph.prototype.rollPeriod);
+goog.exportSymbol('Dygraph.prototype.setAnnotations', Dygraph.prototype.setAnnotations);
+goog.exportSymbol('Dygraph.prototype.setSelection', Dygraph.prototype.setSelection);
+goog.exportSymbol('Dygraph.prototype.setVisibility', Dygraph.prototype.setVisibility);
+goog.exportSymbol('Dygraph.prototype.toDataCoords', Dygraph.prototype.toDataCoords);
+goog.exportSymbol('Dygraph.prototype.toDataXCoord', Dygraph.prototype.toDataXCoord);
+goog.exportSymbol('Dygraph.prototype.toDataYCoord', Dygraph.prototype.toDataYCoord);
+goog.exportSymbol('Dygraph.prototype.toDomCoords', Dygraph.prototype.toDomCoords);
+goog.exportSymbol('Dygraph.prototype.toDomXCoord', Dygraph.prototype.toDomXCoord);
+goog.exportSymbol('Dygraph.prototype.toDomYCoord', Dygraph.prototype.toDomYCoord);
+goog.exportSymbol('Dygraph.prototype.toPercentXCoord', Dygraph.prototype.toPercentXCoord);
+goog.exportSymbol('Dygraph.prototype.toPercentYCoord', Dygraph.prototype.toPercentYCoord);
+goog.exportSymbol('Dygraph.prototype.toString', Dygraph.prototype.toString);
+goog.exportSymbol('Dygraph.prototype.updateOptions', Dygraph.prototype.updateOptions);
+goog.exportSymbol('Dygraph.prototype.visibility', Dygraph.prototype.visibility);
+goog.exportSymbol('Dygraph.prototype.xAxisExtremes', Dygraph.prototype.xAxisExtremes);
+goog.exportSymbol('Dygraph.prototype.xAxisRange', Dygraph.prototype.xAxisRange);
+goog.exportSymbol('Dygraph.prototype.yAxisRange', Dygraph.prototype.yAxisRange);
+goog.exportSymbol('Dygraph.prototype.yAxisRanges', Dygraph.prototype.yAxisRanges);
+
+goog.exportSymbol('Dygraph.Plotters', Dygraph.Plotters);
index c4a40f2..f1a7260 100755 (executable)
@@ -14,13 +14,13 @@ GetSources () {
     dygraph-gviz.js \
     dygraph-interaction-model.js \
     dygraph-tickers.js \
-    dygraph-plugin-base.js \
-    plugins/*.js \
-    dygraph-plugin-install.js
+    dygraph-plugin-base.js
   do
       echo "$F"
   done
 }
+#   plugins/*.js \
+#   dygraph-plugin-install.js
 
 # Pack all the JS together.
 CatSources () {
@@ -36,7 +36,9 @@ Copyright () {
 CatMinified () {
   Copyright
   CatSources \
-  | uglifyjs - -c 'warnings=false' -m
+  | java -jar ../../closure-compiler-read-only/build/compiler.jar --js ../../closure-library-read-only/closure/goog/base.js --js - --compilation_level ADVANCED_OPTIMIZATIONS --warning_level VERBOSE --externs dygraph-externs.js --externs gviz-api.js --output_wrapper='(function() {%output%})();'
+    
+  #| uglifyjs - -c 'warnings=false' -m
   # | java -jar yuicompressor-2.4.2.jar --type js
 }
 
index 9184f4c..8fa6fde 100644 (file)
@@ -6,7 +6,10 @@
     <!--[if IE]>
     <script type="text/javascript" src="../excanvas.js"></script>
     <![endif]-->
+    <!--
     <script type="text/javascript" src="../dygraph-dev.js"></script>
+    -->
+    <script type="text/javascript" src="/tmp/out.js"></script>
   </head>
   <body>
     <h2>Demo</h2>
diff --git a/tests/demo.js b/tests/demo.js
new file mode 100644 (file)
index 0000000..e69de29