page. For instance, instead of doing this:
```html
-<script type="text/javascript" src="dygraph-combined.js"></script>
+<script type="text/javascript" src="dygraph.min.js"></script>
```
do this:
```html
-<script type="text/javascript" src="dygraph-combined.dev.js"></script>
+<script type="text/javascript" src="dygraph.js"></script>
```
This makes error messages and debugging simpler. The jsfiddle does this automatically.
page. For instance, instead of doing this:
```html
-<script type="text/javascript" src="dygraph-combined.js"></script>
+<script type="text/javascript" src="dygraph.min.js"></script>
```
do this:
```html
-<script type="text/javascript" src="dygraph-combined.dev.js"></script>
+<script type="text/javascript" src="dygraph.js"></script>
```
This makes error messages and debugging simpler. The jsfiddle does this automatically.
```html
<html>
<head>
-<script type="text/javascript" src="dygraph-combined.js"></script>
+<script type="text/javascript" src="dygraph.js"></script>
+<link rel="stylesheet" href="dygraph.css" />
</head>
<body>
<div id="graphdiv"></div>
}
</style>
-<p>To use dygraphs, include the <code><a href="download.html">dygraph-combined-dev.js</a></code> JavaScript file and instantiate a <code>Dygraph</code> object.</p>
+<p>To use dygraphs, include the <code><a href="download.html">dygraph.js</a></code> JavaScript file
+and <code>dygraph.css</code> CSS file. Then instantiate a <code>Dygraph</code> object.</p>
<p>Here's a basic example to get things started:</p>
<html>
<head>
<script type="text/javascript"
- src="dygraph-combined-dev.js"></script>
+ src="dygraph.js"></script>
+<link rel="stylesheet" src="dygraph.css" />
</head>
<body>
<div id="graphdiv"></div>
<html>
<head>
<script type="text/javascript"
- src="dygraph-combined-dev.js"></script>
+ src="dygraph.js"></script>
+<link rel="stylesheet" src="dygraph.css" />
</head>
<body>
<div id="graphdiv2"
<html>
<head>
<script type="text/javascript"
- src="dygraph-combined-dev.js"></script>
+ src="dygraph.js"></script>
+<link rel="stylesheet" src="dygraph.css" />
</head>
<body>
<div id="graphdiv3"
<html>
<head>
<script type="text/javascript"
- src="combined.js"></script>
+ src="dygraph.js"></script>
+<link rel="stylesheet" src="dygraph.css" />
</head>
<body>
<div id="graphdiv4"
jsfs.html("<input type='submit' value='Edit in jsFiddle'/>\n" +
"<span style='display:none'>\n" +
- "<textarea name='resources'>http://dygraphs.com/dygraph-combined.js</textarea>\n" +
+ "<textarea name='resources'>http://dygraphs.com/dygraph.js</textarea>\n" +
"<input type='text' name='dtd' value='html 5'/></span>\n");
var javascript = demo.run.toString();
// Protected because the GWT compiler has to generate a subclass.
protected interface Resources extends ClientBundle {
- @Source("org/danvk/dygraph-combined.js")
+ @Source("org/danvk/dygraph.min.js")
TextResource dygraphs();
}
-o dist/dygraph.min.js \
dist/dygraph.tmp.js
-# Copy to the old location
-cp dist/dygraph.min.js dist/dygraph-combined.js
-
# Build GWT JAR
jar -cf dist/dygraph-gwt.jar -C gwt org
<p>There's a hosted version of dygraphs on <a href="https://cdnjs.com/libraries/dygraph">cdnjs.com</a>:</p>
-<pre><script src="//cdnjs.cloudflare.com/ajax/libs/dygraph/%(version)s/dygraph-combined.js"></script></pre>
+<pre><script src="//cdnjs.cloudflare.com/ajax/libs/dygraph/%(version)s/dygraph.min.js"></script>
+<link rel="stylesheet" src="//cdnjs.cloudflare.com/ajax/libs/dygraph/%(version)s/dygraph.min.css" />
+</pre>
-<p>You can install dygraphs using <a href="https://www.npmjs.org/package/dygraphs">NPM</a> or <a href="http://bower.io/search/?q=dygraphs">Bower</a>.</p>
+<p>You can also install dygraphs using <a href="https://www.npmjs.org/package/dygraphs">NPM</a>:</p>
-<p>To install using NPM:</p>
<pre>$ npm install dygraphs
-# dygraphs is now in node_modules/dygraphs/dygraph-combined.js</pre>
-
-<p>To install using bower:</p>
-<pre>$ bower install dygraphs
-# dygraphs is now in bower_components/dygraphs/dygraph-combined.js</pre>
+# dygraphs is now in node_modules/dygraphs/dygraph.js</pre>
-<p>Most distributions include a source map. For non-concatenated JS, see <a href="https://github.com/danvk/dygraphs/blob/master/dygraph-dev.js">dygraph-dev.js</a> on <a href="https://github.com/danvk/dygraphs/">github</a>.</a>
+<p>Most distributions include a source map to facilitate debugging.</p>
<p>To generate your own minified JS, run:</p>
<pre>git clone https://github.com/danvk/dygraphs.git
-./generate-combined.sh
+npm run build
</pre>
-<p>This will create a dygraph.min.js file in the dygraphs directory.</p>
+<p>This will create a dygraph.min.js file in the <code>dist</code> directory.</p>
<p>You may also download files for previously-released versions:</p>
#!/bin/bash
-# This script generates the combined JS file, pushes all content to a web site
-# and then reverts the combined file.
+# This script generates the bundled JS files and pushes all content to a web site using rsync.
if [ "$1" == "" ] ; then
echo "usage: $0 destination"
echo "generate-documentation.py failed"
fi
-# Revert changes to dygraph-combined.js and docs.
+# Revert changes to docs.
git checkout docs/download.html
rm docs/options.html
rm -rf $temp_dir
exit 1
fi
-grep "v$VERSION" bower.json
-if [ $? -ne 0 ]; then
- echo "Version in bower.json doesn't match command line argument." >&2
- exit 1
-fi
-
grep "$VERSION" releases.json
if [ $? -ne 0 ]; then
echo "Version $VERSION does not appear in releases.json." >&2
exit 1
fi
-rm dygraph-combined.js # changes to this will make the tests fail.
-make lint test test-combined
-if [ $? -ne 0 ]; then
- echo "Tests failed. Won't release!" >&2
- exit 1
-fi
-git reset --hard # make test-combined deletes the source map
+set -o errexit
+npm run build
+npm run test
+set +o errexit
# Push a permanent copy of documentation & generated files to a versioned copy
# of the site. This is where the downloadable files are generated.
exit 1
fi
-# Everything is good.
-# Switch to the "releases" branch, merge this change and tag it.
-echo "Switching branches to do the release."
-git checkout releases
-git merge --no-ff $branch
+set -o errexit
COMMIT=$(git rev-parse HEAD)
echo "Tagging commit $COMMIT as version $VERSION"
./push-to-web.sh dygraphs.com:dygraphs.com
echo "Success!\n"
-echo "Don't forget to merge changes on this branch back into master:"
-echo "git merge --no-ff $branch"
# Discourage users from working on the "releases" branch.
git checkout master
else
curl -O https://raw.githubusercontent.com/danvk/travis-weigh-in/master/weigh_in.py
- python weigh_in.py dist/dygraph-combined.js
+ python weigh_in.py dist/dygraph.min.js
gzip -c dist/dygraph.min.js > dist/dygraph.min.js.gz
python weigh_in.py dist/dygraph.min.js.gz