forked from danvk/dygraphs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from danvk/master
Get last version
- Loading branch information
Showing
14 changed files
with
157 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/*global Dygraph:false */ | ||
|
||
// Namespace for plugins. Load this before plugins/*.js files. | ||
Dygraph.Plugins = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,65 @@ | ||
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9"> | ||
<title>demo</title> | ||
<!--[if IE]> | ||
<script type="text/javascript" src="../excanvas.js"></script> | ||
<![endif]--> | ||
<script type="text/javascript" src="../dygraph-dev.js"></script> | ||
<style> | ||
html, body { | ||
/* | ||
max-width: 800px; | ||
height: 100%; | ||
margin-right: auto; | ||
*/ | ||
margin-left: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>Mouseovers should work as expected (dots should align with mouse)</p> | ||
<div id="demodiv"></div> | ||
|
||
<script type="text/javascript"> | ||
g = new Dygraph( | ||
document.getElementById("demodiv"), | ||
function() { | ||
var zp = function(x) { if (x < 10) return "0"+x; else return x; }; | ||
var r = "date,parabola,line,another line,sine wave\n"; | ||
for (var i=1; i<=31; i++) { | ||
r += "200610" + zp(i); | ||
r += "," + 10*(i*(31-i)); | ||
r += "," + 10*(8*i); | ||
r += "," + 10*(250 - 8*i); | ||
r += "," + 10*(125 + 125 * Math.sin(0.3*i)); | ||
r += "\n"; | ||
} | ||
return r; | ||
}, | ||
{ | ||
labelsKMB: true, | ||
legend: 'always' | ||
} | ||
); | ||
</script> | ||
</body> | ||
</html> |