dependence on PlotKit.Canvas is severed
[dygraphs.git] / generate-combined.sh
1 #!/bin/bash
2 # Generates a single JS file that's easier to include.
3 # This packed JS includes a partial copy of MochiKit and PlotKit.
4 # It winds up being 146k uncompressed and 37k gzipped.
5
6 # Generate the packed version of the subset of PlotKit needed by dygraphs.
7 # This saves ~30k
8 cd plotkit_v091
9 ./scripts/pack.py Base > /tmp/plotkit-packed.js
10 cd ..
11
12 # Do the same for MochiKit. This save another 77k.
13 cd mochikit_v14
14 ./scripts/pack.py \
15 Base Iter DOM Style Color Signal \
16 > /tmp/mochikit-packed.js
17 cd ..
18
19 # Pack the dygraphs JS. This saves another 22k.
20 cat \
21 dygraph-canvas.js \
22 dygraph.js \
23 > /tmp/dygraph.js
24
25 java -jar plotkit_v091/scripts/custom_rhino.jar -c /tmp/dygraph.js \
26 > /tmp/dygraph-packed.js
27
28 cat \
29 /tmp/mochikit-packed.js \
30 /tmp/plotkit-packed.js \
31 strftime/strftime-min.js \
32 /tmp/dygraph-packed.js \
33 > dygraph-combined.js