x dygraph-options-reference.js
x dygraph-utils.js
x dashed-canvas.js
+- dygraph-plugin-base.js
+- dygraph-plugin-install.js
Plugins:
- plugins/annotations.js
- plugins/axes.js
-- plugins/base.js
- plugins/chart-labels.js
- plugins/grid.js
-- plugins/install.js
- plugins/legend.js
Here's a command that can be used to build dygraphs using the closure
"dygraph-gviz.js",
"dygraph-interaction-model.js",
"dygraph-tickers.js",
- "plugins/base.js",
+ "dygraph-plugin-base.js",
"plugins/annotations.js",
"plugins/axes.js",
"plugins/chart-labels.js",
"plugins/grid.js",
"plugins/legend.js",
"plugins/range-selector.js",
- "plugins/install.js",
+ "dygraph-plugin-install.js",
"dygraph-options-reference.js" // Shouldn't be included in generate-combined.sh
];
--- /dev/null
+/*global Dygraph:false */
+
+// Namespace for plugins. Load this before plugins/*.js files.
+Dygraph.Plugins = {};
--- /dev/null
+/*global Dygraph:false */
+
+// This file defines the ordering of the plugins.
+//
+// The ordering is from most-general to most-specific.
+// This means that, in an event cascade, plugins which have registered for that
+// event will be called in reverse order.
+//
+// This is most relevant for plugins which register a layout event, e.g.
+// Axes, Legend and ChartLabels.
+
+Dygraph.PLUGINS.push(
+ Dygraph.Plugins.Legend,
+ Dygraph.Plugins.Axes,
+ Dygraph.Plugins.RangeSelector, // Has to be before ChartLabels so that its callbacks are called after ChartLabels' callbacks.
+ Dygraph.Plugins.ChartLabels,
+ Dygraph.Plugins.Annotations,
+ Dygraph.Plugins.Grid
+);
rgbcolor/rgbcolor.js \
strftime/strftime-min.js \
dashed-canvas.js \
-plugins/base.js \
+dygraph-plugin-base.js \
plugins/annotations.js \
plugins/axes.js \
plugins/range-selector.js \
plugins/chart-labels.js \
plugins/grid.js \
plugins/legend.js \
-plugins/install.js \
+dygraph-plugin-install.js \
; do
base_size=$(cat $file | wc -c)
cat $file \
#!/bin/bash
# Generates a single JS file that's easier to include.
+GetSources () {
+ # This list needs to be kept in sync w/ the one in dygraph-dev.js
+ # and the one in jsTestDriver.conf. Order matters, except for the plugins.
+ for F in \
+ strftime/strftime-min.js \
+ rgbcolor/rgbcolor.js \
+ stacktrace.js \
+ dashed-canvas.js \
+ dygraph-options.js \
+ dygraph-layout.js \
+ dygraph-canvas.js \
+ dygraph.js \
+ dygraph-utils.js \
+ dygraph-gviz.js \
+ dygraph-interaction-model.js \
+ dygraph-tickers.js \
+ dygraph-plugin-base.js \
+ plugins/*.js \
+ dygraph-plugin-install.js
+ do
+ echo "$F"
+ done
+}
+
# Pack all the JS together.
+CatSources () {
+ GetSources \
+ | xargs cat \
+ | perl -ne 'print unless m,REMOVE_FOR_COMBINED,..m,/REMOVE_FOR_COMBINED,'
+}
-# This list needs to be kept in sync w/ the one in dygraph-dev.js
-# and the one in jsTestDriver.conf.
-cat \
-strftime/strftime-min.js \
-rgbcolor/rgbcolor.js \
-stacktrace.js \
-dashed-canvas.js \
-dygraph-options.js \
-dygraph-layout.js \
-dygraph-canvas.js \
-dygraph.js \
-dygraph-utils.js \
-dygraph-gviz.js \
-dygraph-interaction-model.js \
-dygraph-tickers.js \
-plugins/base.js \
-plugins/annotations.js \
-plugins/axes.js \
-plugins/chart-labels.js \
-plugins/grid.js \
-plugins/legend.js \
-plugins/range-selector.js \
-plugins/install.js \
-| perl -ne 'print unless m,REMOVE_FOR_COMBINED,..m,/REMOVE_FOR_COMBINED,' \
-> /tmp/dygraph.js
+Copyright () {
+ echo '/*! @license Copyright 2011 Dan Vanderkam (danvdk@gmail.com) MIT-licensed (http://opensource.org/licenses/MIT) */'
+}
-java -jar yuicompressor-2.4.2.jar /tmp/dygraph.js \
-> /tmp/dygraph-packed.js
+CatCompressed () {
+ Copyright
+ CatSources \
+ | java -jar yuicompressor-2.4.2.jar --type js
+}
-(
- echo '/*! @license Copyright 2011 Dan Vanderkam (danvdk@gmail.com) MIT-licensed (http://opensource.org/licenses/MIT) */'
- cat /tmp/dygraph-packed.js
-) > dygraph-combined.js
-chmod a+r dygraph-combined.js
+ACTION="${1:-update}"
+case "$ACTION" in
+ls)
+ GetSources
+ ;;
+cat)
+ Copyright
+ CatSources
+ ;;
+compress*|cat_compress*)
+ CatCompressed
+ ;;
+update)
+ CatCompressed > dygraph-combined.js
+ chmod a+r dygraph-combined.js
+ ;;
+*)
+ echo >&2 "Unknown action '$ACTION'"
+ exit 1
+ ;;
+esac
- dygraph-tickers.js
- dygraph-dev.js
- excanvas.js
- # NOTE: we can't do plugins/*.js because the order is important.
- - plugins/base.js
- - plugins/annotations.js
- - plugins/axes.js
- - plugins/range-selector.js
- - plugins/chart-labels.js
- - plugins/grid.js
- - plugins/legend.js
- - plugins/install.js
+ - dygraph-plugin-base.js
+ - plugins/*.js
+ - dygraph-plugin-install.js
- auto_tests/tests/*.js
+++ /dev/null
-/*global Dygraph:false */
-
-// Namespace for plugins.
-Dygraph.Plugins = {};
-
-// TODO(danvk): move this into the top-level directory. Only plugins here.
+++ /dev/null
-/*global Dygraph:false */
-
-// This file defines the ordering of the plugins.
-//
-// The ordering is from most-general to most-specific.
-// This means that, in an event cascade, plugins which have registered for that
-// event will be called in reverse order.
-//
-// This is most relevant for plugins which register a layout event, e.g.
-// Axes, Legend and ChartLabels.
-
-// TODO(danvk): move this into the top-level directory. Only plugins here.
-Dygraph.PLUGINS.push(
- Dygraph.Plugins.Legend,
- Dygraph.Plugins.Axes,
- Dygraph.Plugins.RangeSelector, // Has to be before ChartLabels so that its callbacks are called after ChartLabels' callbacks.
- Dygraph.Plugins.ChartLabels,
- Dygraph.Plugins.Annotations,
- Dygraph.Plugins.Grid
-);