Skip to content

Commit 3ab55e7

Browse files
committed
Merge branch 'master' into doc-updates
2 parents 9508dc8 + 4e9a7ca commit 3ab55e7

File tree

705 files changed

+130421
-157925
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

705 files changed

+130421
-157925
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,4 @@ node_modules
33
build/*
44
!build/README.md
55

6-
dist/*
7-
!dist/README.md
8-
96
npm-debug.log

.jshintrc

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
// environments
3+
"browser": true, // Define globals exposed by modern browsers.
4+
"jquery": false, // Define globals exposed by jQuery.
5+
"node": true, // Define globals exposed by Node.js.
6+
"jasmine": true, // Define globals exposed by jasmine
7+
8+
// enforcing (true means bug us about it)
9+
"camelcase": false, // Force all variable names to use either camelCase style or UPPER_CASE with underscores.
10+
"curly": false, // This option requires you to always put curly braces around blocks in loops and conditionals.
11+
"eqeqeq": true, // Prohibit use of == and != in favor of === and !==.
12+
"es3": true, // This option tells JSHint that your code needs to adhere to ECMAScript 3 spec (old browsers)
13+
"forin": false, // This option requires all for in loops to filter object's items.
14+
"freeze": true, // This options prohibits overwriting prototypes of native objects such as Array, Date and so on.
15+
"immed": true, // This option prohibits the use of immediate function invocations without wrapping them in parentheses.
16+
"indent": 4, // Enforce tab width of 4 spaces.
17+
"latedef": "nofunc", // Prohibit use of a variable before it is defined.
18+
"maxcomplexity": false, // This option lets you control cyclomatic complexity throughout your code.
19+
"maxdepth": 6, // This option lets you control how nested do you want your blocks to be
20+
"maxlen": 120, // Enforce line length to 120 characters
21+
"newcap": true, // Require capitalized names for constructor functions.
22+
"noarg": true, // This option prohibits the use of arguments.caller and arguments.callee.
23+
"noempty": true, // This option warns when you have an empty block in your code.
24+
"nonbsp": true, // This option warns about "non-breaking whitespace" characters.
25+
"nonew": true, // This option prohibits the use of constructor functions for side-effects.
26+
"plusplus": false, // This option prohibits the use of unary increment and decrement operators.
27+
"quotmark": "single", // Enforce use of single quotation marks for strings.
28+
"strict": true, // Enforce placing 'use strict' at the top function scope
29+
"trailing": true, // Prohibit trailing whitespace.
30+
"undef": true, // Prohibit use of explicitly undeclared variables.
31+
"unused": true, // Warn when variables are defined but never used.
32+
33+
// relaxing (true means DON'T bug us about it)
34+
"asi": false, // This option suppresses warnings about missing semicolons.
35+
"boss": false, // This option suppresses warnings about the use of assignments in cases where comparisons are expected.
36+
"debug": false, // This option suppresses warnings about the debugger statements in your code.
37+
"eqnull": true, // Suppress warnings about == null comparisons.
38+
"esnext": true, // This option tells JSHint that your code uses ECMAScript 6 specific syntax.
39+
"evil": false, // This option suppresses warnings about the use of eval.
40+
"expr": false, // This option suppresses warnings about the use of expressions where normally you would expect to see assignments or function calls.
41+
"funcscope": false, // This option suppresses warnings about declaring variables inside of control structures while accessing them later from the outside.
42+
"globalstrict": false, // This option suppresses warnings about the use of global strict mode.
43+
"iterator": false, // This option suppresses warnings about the __iterator__ property.
44+
"lastsemic": false, // This option suppresses warnings about missing semicolons
45+
"laxbreak": false, // This option suppresses most of the warnings about possibly unsafe line breakings in your code.
46+
"laxcomma": false, // This option suppresses warnings about comma-first coding style
47+
"loopfunc": false, // This option suppresses warnings about functions inside of loops.
48+
"maxerr": 500, // This options allows you to set the maximum amount of warnings JSHint will produce before giving up.
49+
"moz": false, // This options tells JSHint that your code uses Mozilla JavaScript extensions.
50+
"multistr": false, // This option suppresses warnings about multi-line strings.
51+
"notypeof": false, // This option suppresses warnings about invalid typeof operator values.
52+
"proto": false, // This option suppresses warnings about the __proto__ property.
53+
"scripturl": false, // This option suppresses warnings about the use of script-targeted URLs—such as javascript:...
54+
"shadow": false, // This option suppresses warnings about variable shadowing
55+
"sub": false, // This option suppresses warnings about using [] notation when it can be expressed in dot notation
56+
"supernew": false, // This option suppresses warnings about "weird" constructions like new function () { ... } and new Object;
57+
"validthis": false, // This option suppresses warnings about possible strict violations when the code is running in strict mode
58+
"noyield": false, // This option suppresses warnings about generator functions with no yield statement in them.
59+
60+
// global pre defined variables
61+
"predef": [
62+
"JSON",
63+
"Uint8Array",
64+
"Uint16Array",
65+
"Uint32Array",
66+
"Int8Array",
67+
"Int16Array",
68+
"Int32Array",
69+
"Float32Array",
70+
"Float64Array"
71+
]
72+
}

circle.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
general:
2+
artifacts:
3+
- "build/test_images/" # relative to the build directory
4+
- "build/test_images_diff/" # relative to the build directory
5+
6+
machine:
7+
node:
8+
version: 4.2.1
9+
services:
10+
- docker
11+
12+
13+
dependencies:
14+
pre:
15+
- docker pull plotly/imageserver:0.2.1
16+
post:
17+
- npm run cibuild
18+
- docker run -d --name myimageserver -v $PWD:/var/www/streambed/image_server/plotly.js -p 9010:9010 plotly/imageserver:0.2.1; sleep 20
19+
20+
test:
21+
override:
22+
- sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' myimageserver)" -- bash -c "cd /var/www/streambed/image_server/plotly.js && node test/image/compare_pixels_test.js"
23+
- npm run citest-jasmine

devtools/image_viewer/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<head>
33
</head>
44
<body>
5-
<div id="plot-list"></div>
5+
<div id="plot-list" style="overflow:auto; height:100px;"></div>
66
<div id="plot-images"></div>
77
<div id="plot-mock"></div>
88

devtools/image_viewer/server.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ var path = require('path');
44
var exec = require('child_process').exec;
55

66
var browserify = require('browserify');
7+
var brfs = require('brfs');
78
var ecstatic = require('ecstatic');
89
var _open = require('open');
910

@@ -15,23 +16,31 @@ var PORT = '9090';
1516

1617
console.log('Listening on :' + PORT + '\n');
1718

18-
var listName = 'list-of-incorrect-images.txt';
19+
var listPath = constants.pathToTestImagesDiffList;
20+
var listCMD = [
21+
'ls',
22+
constants.pathToTestImagesDiff,
23+
'>',
24+
listPath
25+
].join(' ');
1926

2027
// build image viewer bundle
2128
fs.unlink(constants.pathToImageViewerBundle, function() {
22-
exec('ls ../test-images-diffs/ > ' + listName, function() {
23-
var b = browserify(path.join(__dirname, './viewer.js'), { debug: true });
29+
exec(listCMD, function() {
30+
var b = browserify(path.join(__dirname, './viewer.js'), {
31+
debug: true,
32+
transform: [brfs]
33+
});
2434

25-
b.transform('brfs');
2635
b.bundle(function(err) {
2736
if(err) throw err;
2837

2938
_open('http://localhost:' + PORT + '/devtools/image_viewer');
3039
})
3140
.pipe(fs.createWriteStream(constants.pathToImageViewerBundle));
3241

33-
fs.readFile(listName, 'utf8', function(err, data) {
34-
console.log('In ' + listName + ':\n' + data);
42+
fs.readFile(listPath, 'utf8', function(err, data) {
43+
console.log('In ' + listPath + ':\n' + data);
3544
});
3645
});
3746
});

devtools/image_viewer/viewer.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
var fs = require('fs');
2+
23
var d3 = require('d3');
34

5+
var constants = require('../../tasks/util/constants');
6+
7+
48
var $plotlist = document.getElementById('plot-list'),
59
$images = document.getElementById('plot-images'),
610
$mock = document.getElementById('plot-mock');
711

8-
var dirBaseline = '../test-images-baseline/',
9-
dirTest = '../test-images/',
10-
dirDiff = '../test-images-diffs/',
11-
dirMocks = '../mocks/';
12+
var dirBaseline = constants.pathToTestImageBaselines,
13+
dirTest = constants.pathToTestImages,
14+
dirDiff = constants.pathToTestImagesDiff,
15+
dirMocks = constants.pathToTestImageMocks;
1216

17+
// N.B. brfs only understand hard-coded paths
1318
var imageNames = fs.readFileSync(
14-
__dirname + '/list-of-incorrect-images.txt', 'utf8'
19+
__dirname + '/../../build/list_of_incorrect_images.txt',
20+
'utf8'
1521
)
1622
.split('\n')
1723
.filter(function(x) { return x; })

devtools/test_dashboard/buttons.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function plotButtons(plots, figDir) {
109109
plotlist.appendChild(pummelButton);
110110

111111
var i = 0;
112-
var mock = require('./testplots-3d/marker-color.json');
112+
var mock = require('@mocks/gl3d_marker-color.json');
113113
var statusDiv = document.getElementById('status-info');
114114

115115
pummelButton.addEventListener('click', function () {

devtools/test_dashboard/index.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@
1111

1212
<script type="text/javascript" src="../../dist/extras/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
1313

14-
<script type="text/javascript" src="../../dist/plotly.js" charset="utf-8"></script>
15-
<script>PLOTLYENV = { TOPOJSON_URL: '../../src/assets/topojson/' };</script>
14+
<!-- use dev plotly.js build -->
15+
<script type="text/javascript" src="../../build/plotly.js" charset="utf-8"></script>
16+
17+
<!-- use local topojson files -->
18+
<script>Plotly.setPlotConfig({ topojsonURL: '../../dist/topojson/' });</script>
1619

1720
<script type="text/javascript" src="../../build/test_dashboard-bundle.js"></script>
1821

19-
<!-- helper functions to manipulate graph div -->
22+
<!-- helper functions to manipulate the graph div -->
2023
<script>
2124
var Tabs = {
2225
getGraph: function() {

devtools/test_dashboard/server.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ var PORT = '8080';
1717
var testFile;
1818
switch(process.argv[2]) {
1919
case 'geo':
20-
testFile = './test-geo';
20+
testFile = 'test_geo';
2121
break;
22-
case '2d':
23-
testFile = './test-2d';
22+
case 'gl3d':
23+
testFile = 'test_gl3d';
2424
break;
2525
default:
26-
testFile = './test-3d';
26+
testFile = 'test_gl2d';
2727
}
2828

2929
console.log('Using ' + testFile);

devtools/test_dashboard/test-2d.js

Lines changed: 0 additions & 74 deletions
This file was deleted.

0 commit comments

Comments
 (0)