Skip to content

Commit ad6f080

Browse files
committed
Merge pull request #1 from plotly/reorg
Reorganization [part 1]
2 parents 33beb43 + 2abf31f commit ad6f080

File tree

553 files changed

+8066
-1137
lines changed

Some content is hidden

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

553 files changed

+8066
-1137
lines changed

.ackrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
--ignore-directory=is:dist
2+
--ignore-directory=is:build
3+
--ignore-directory=is:assets
4+
5+
--ignore-file=ext:svg
6+
--ignore-file=ext:log

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
11
node_modules
2+
3+
build/*
4+
!build/README.md
5+
6+
dist/*
7+
!dist/README.md
8+
9+
npm-debug.log

build/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Directory of non-distributed built files

devtools/image_viewer/index.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<div id="plot-images"></div>
77
<div id="plot-mock"></div>
88

9-
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
10-
<script type="text/javascript" src="test-images-viewer-bundle.js"></script>
9+
<script type="text/javascript" src="../../build/image_viewer-bundle.js"></script>
1110
</body>
1211
</html>

devtools/image_viewer/server.js

+28-19
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,42 @@
1-
'use strict';
2-
3-
var http = require('http');
4-
var ecstatic = require('ecstatic');
5-
var browserify = require('browserify');
6-
var open = require('open');
71
var fs = require('fs');
2+
var http = require('http');
3+
var path = require('path');
84
var exec = require('child_process').exec;
95

10-
var bundleName = 'test-images-viewer-bundle.js',
11-
listName = 'list-of-incorrect-images.txt';
6+
var browserify = require('browserify');
7+
var ecstatic = require('ecstatic');
8+
var _open = require('open');
9+
10+
var constants = require('../../tasks/util/constants');
1211

13-
fs.unlink(bundleName, function(err) {
12+
13+
// TODO make this an optional argument
14+
var PORT = '9090';
15+
16+
console.log('Listening on :' + PORT + '\n');
17+
18+
var listName = 'list-of-incorrect-images.txt';
19+
20+
// build image viewer bundle
21+
fs.unlink(constants.pathToImageViewerBundle, function() {
1422
exec('ls ../test-images-diffs/ > ' + listName, function() {
15-
var b = browserify('./viewer.js', {
16-
debug: true,
17-
verbose: true
18-
});
23+
var b = browserify(path.join(__dirname, './viewer.js'), { debug: true });
24+
1925
b.transform('brfs');
20-
b.bundle().pipe(fs.createWriteStream(bundleName));
26+
b.bundle(function(err) {
27+
if(err) throw err;
28+
29+
_open('http://localhost:' + PORT + '/devtools/image_viewer');
30+
})
31+
.pipe(fs.createWriteStream(constants.pathToImageViewerBundle));
2132

2233
fs.readFile(listName, 'utf8', function(err, data) {
2334
console.log('In ' + listName + ':\n' + data);
2435
});
2536
});
2637
});
2738

39+
// boot up server
2840
http.createServer(
29-
ecstatic({ root: '../.' })
30-
).listen(9090);
31-
32-
console.log('Listening on :9090\n');
33-
open('http://localhost:9090/test-images-viewer');
41+
ecstatic({ root: constants.pathToRoot })
42+
).listen(PORT);

devtools/image_viewer/viewer.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
'use strict';
2-
3-
/* global d3:false */
4-
51
var fs = require('fs');
2+
var d3 = require('d3');
63

74
var $plotlist = document.getElementById('plot-list'),
85
$images = document.getElementById('plot-images'),

devtools/test_dashboard/buttons.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
var plotlist = document.getElementById('plot-list');
42
var anchor = document.getElementById('embedded-graph');
53
var image = document.getElementById('embedded-image');
@@ -111,7 +109,7 @@ function plotButtons(plots, figDir) {
111109
plotlist.appendChild(pummelButton);
112110

113111
var i = 0;
114-
var mock = require('./testplots/marker-color.json');
112+
var mock = require('./testplots-3d/marker-color.json');
115113
var statusDiv = document.getElementById('status-info');
116114

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

devtools/test_dashboard/generateImages.js

-96
This file was deleted.

devtools/test_dashboard/index.html

+19-47
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,39 @@
11
<!DOCTYPE html>
22
<head>
3-
4-
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:600,400,300,200|Droid+Sans|PT+Sans+Narrow|Gravitas+One|Droid+Sans+Mono|Droid+Serif|Raleway|Old+Standard+TT" />
5-
3+
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:600,400,300,200|Droid+Sans|PT+Sans+Narrow|Gravitas+One|Droid+Sans+Mono|Droid+Serif|Raleway|Old+Standard+TT" />
64
</head>
7-
85
<body>
96

10-
<div id="plot-list" style="overflow:auto; height: 100px;"></div>
11-
<div id="status-info" style="display: block; position: absolute; top: 150px;"></div>
12-
<div id="embedded-graph"></div>
13-
<div id="embedded-image"style="
14-
display: block;
15-
position: absolute;
16-
top: 800px;
17-
">
18-
</div>
19-
20-
<script type="text/javascript" src="./../shelly/shelly/static/js/plugins/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
21-
22-
<script>
23-
PLOTLYENV = {
24-
TOPOJSON_URL: '../shelly/plotlyjs/static/plotlyjs/src/geo/topojson/'
25-
};
26-
</script>
7+
<div id="plot-list" style="overflow:auto; height:100px;"></div>
8+
<div id="status-info" style="display:block; position:absolute; top:150px;"></div>
9+
<div id="embedded-graph"></div>
10+
<div id="embedded-image" style="display:block; position:absolute; top:800px;"></div>
2711

28-
<script type="text/javascript" src="./../shelly/plotlyjs/static/plotlyjs/build/plotlyjs-bundle.js" charset="utf-8"></script>
12+
<script type="text/javascript" src="../../dist/extras/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
2913

30-
<script type="text/javascript" src="test-bundle.js"></script>
14+
<script type="text/javascript" src="../../dist/plotly.js" charset="utf-8"></script>
15+
<script>PLOTLYENV = { TOPOJSON_URL: '../../src/assets/topojson/' };</script>
3116

32-
<script>
33-
MathJax.Hub.Config({
34-
messageStyle: 'none',
35-
skipStartupTypeset: true,
36-
displayAlign: "left",
37-
tex2jax: {
38-
inlineMath: [["$","$"],["\\(","\\)"]]
39-
}
40-
});
41-
</script>
17+
<script type="text/javascript" src="../../build/test_dashboard-bundle.js"></script>
4218

43-
<script>
19+
<!-- helper functions to manipulate graph div -->
20+
<script>
4421
var Tabs = {
45-
get: function() {
22+
getGraph: function() {
4623
return document.getElementById('embedded-graph').children[0];
4724
},
4825
fresh: function() {
4926
var anchor = document.getElementById('embedded-graph'),
50-
plotDiv = Tabs.get();
51-
if(plotDiv) anchor.removeChild(plotDiv);
52-
plotDiv = document.createElement('div');
53-
anchor.appendChild(plotDiv);
54-
return plotDiv;
55-
}
56-
};
27+
graphDiv = Tabs.getGraph();
5728

58-
Tabs.getGraph = Tabs.get;
29+
if(graphDiv) anchor.removeChild(graphDiv);
30+
graphDiv = document.createElement('div');
31+
anchor.appendChild(graphDiv);
5932

60-
var Themes = {
61-
reTileLock: null
33+
return graphDiv;
34+
}
6235
};
63-
</script>
64-
36+
</script>
6537

6638
</body>
6739
</html>

devtools/test_dashboard/make-test-2d.js

-82
This file was deleted.

devtools/test_dashboard/package.json

-17
This file was deleted.

0 commit comments

Comments
 (0)