Merge pull request #577 from bbirand/patch-1
[dygraphs.git] / dygraph-dev.js
... / ...
CommitLineData
1/**
2 * @license
3 * Copyright 2011 Dan Vanderkam (danvdk@gmail.com)
4 * MIT-licensed (http://opensource.org/licenses/MIT)
5 */
6
7// A dygraph "auto-loader".
8
9// Check where this script was sourced from. If it was sourced from
10// '../dygraph-dev.js', then we should source all the other scripts with the
11// same relative path ('../dygraph.js', '../dygraph-canvas.js', ...)
12(function() {
13 var src=document.getElementsByTagName('script');
14 var script = src[src.length-1].getAttribute("src");
15
16 // This list needs to be kept in sync w/ the one in generate-combined.sh
17 // and the one in jsTestDriver.conf.
18 var source_files = [
19 "src/polyfills/console.js",
20 "src/polyfills/dashed-canvas.js",
21 "src/dygraph-options.js",
22 "src/dygraph-layout.js",
23 "src/dygraph-canvas.js",
24 "src/dygraph.js",
25 "src/dygraph-utils.js",
26 "src/dygraph-gviz.js",
27 "src/dygraph-interaction-model.js",
28 "src/dygraph-tickers.js",
29 "src/dygraph-plugin-base.js",
30 "src/plugins/annotations.js",
31 "src/plugins/axes.js",
32 "src/plugins/chart-labels.js",
33 "src/plugins/grid.js",
34 "src/plugins/legend.js",
35 "src/plugins/range-selector.js",
36 "src/dygraph-plugin-install.js",
37 "src/dygraph-options-reference.js", // Shouldn't be included in generate-combined.sh
38 "src/datahandler/datahandler.js",
39 "src/datahandler/default.js",
40 "src/datahandler/default-fractions.js",
41 "src/datahandler/bars.js",
42 "src/datahandler/bars-error.js",
43 "src/datahandler/bars-custom.js",
44 "src/datahandler/bars-fractions.js"
45 ];
46
47 for (var i = 0; i < source_files.length; i++) {
48 document.write('<script type="text/javascript" src="' + script.replace('dygraph-dev.js', source_files[i]) + '"></script>\n');
49 }
50})();