Skip to content

Commit 0d54d1f

Browse files
committed
tmp commit with unfinished files
1 parent 5ab407f commit 0d54d1f

File tree

7 files changed

+66
-0
lines changed

7 files changed

+66
-0
lines changed

LICENSE

Whitespace-only changes.

tasks/bench.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// use https://github.com/JamieMason/karma-benchmark
2+
//
3+
// with a karma.conf.js in ./benchmark

tasks/citest.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// same as ./run_test.js but with ciconf file

tasks/postpublish.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// auto-update the cdn links

tasks/test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// npm test : run all test
2+
// npm test-unit : run the unit tests
3+
// npm test-image : run the image comparison tests
4+
// npm test-image {image-name} : run image comparison test for {image-name}
5+
//
6+
// npm test

tasks/util/set_watchify_output.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
var prettySize = require('prettysize');
2+
3+
4+
module.exports = function setWatchifyOutput(b) {
5+
var msgParts = [
6+
'',
7+
':',
8+
'',
9+
'written',
10+
'in',
11+
'',
12+
'sec'
13+
];
14+
15+
b.on('bytes', function(bytes) {
16+
msgParts[2] = prettySize(bytes, true);
17+
});
18+
19+
b.on('time', function(time) {
20+
msgParts[5] = time / 1000;
21+
});
22+
23+
b.on('log', function() {
24+
msgParts[0] = new Date();
25+
console.log(msgParts.join(' '));
26+
});
27+
}

tasks/watch.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
var fs = require('fs');
2+
var browserify = require('browserify');
3+
var watchify = require('watchify');
4+
5+
var compressAttributes = require('./util/compress_attributes');
6+
var setWatchifyOutput = require('./util/set_bundle_stdout');
7+
var constants = require('./util/constants');
8+
9+
10+
// Watchify plotly.js
11+
var b = browserify(constants.pathToPlotlySrc, {
12+
debug: true.
13+
standalone: 'Plotly',
14+
transform: [compressAttributes],
15+
cache: {},
16+
packageCache: {},
17+
plugin: [watchify]
18+
});
19+
20+
b.on('update', bundle);
21+
setWatchifyOutput(b);
22+
bundle();
23+
24+
function bundle() {
25+
b.bundle().pipe(
26+
fs.createWriteStream(constants.pathToPlotlyDist)
27+
);
28+
}

0 commit comments

Comments
 (0)