Skip to content

Reorganization [part 1] #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 32 commits into from
Nov 13, 2015
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0d54d1f
tmp commit with unfinished files
etpinard Nov 7, 2015
0b51d05
add browserify transform modifying require path in jasmine tests
etpinard Nov 10, 2015
f4811f2
update karma configs
etpinard Nov 10, 2015
5b27e7f
mv jasmine test files to test/jasmine/tests/
etpinard Nov 10, 2015
6b68088
add jQuery as jasmine test asset
etpinard Nov 10, 2015
8dbcf9f
update contributors and add main field in package.json
etpinard Nov 10, 2015
99484a1
add .ackrc
etpinard Nov 10, 2015
768d24f
add mathjax/ to dist/extras/
etpinard Nov 10, 2015
e8d75fd
rm useless test_dashboard files
etpinard Nov 10, 2015
6bca872
rename testplots/ --> testplots-3d/
etpinard Nov 10, 2015
3a874e5
clean up test_dashboard index
etpinard Nov 10, 2015
94f9cd4
generalize shortcut paths browserify transform
etpinard Nov 10, 2015
c454258
use Chrome in local dev by default, Firefox on CI (for better coverage)
etpinard Nov 10, 2015
ef3053c
add typedarray.min.js to dist/extras/
etpinard Nov 10, 2015
a509445
build ploticon.js and plotcss.js in ./build/
etpinard Nov 10, 2015
1d6f218
modif watch script to watch_plotly,
etpinard Nov 10, 2015
09ca8a7
clean up in tasks/ scripts
etpinard Nov 10, 2015
c77b3b3
rename build.js --> bundle.js (build step include preprocess.js)
etpinard Nov 10, 2015
5a536d3
mv scss files to src/css/
etpinard Nov 10, 2015
953c259
rm plotcss.js and ploticon.js + require ignored files in build/
etpinard Nov 10, 2015
732efea
rn src/isnumeric, use 'fast-isnumeric' npm package
etpinard Nov 10, 2015
96b5c1c
add dev dependencies to package.json
etpinard Nov 10, 2015
22ee1fa
update scripts in package.json
etpinard Nov 10, 2015
eeb1b26
update test_dashboard server file (re-use watch_plotly.js!)
etpinard Nov 10, 2015
535cb8b
use @mocks shortcut to import geo_ test mocks
etpinard Nov 10, 2015
85e929b
require d3 into image_viewer bundle
etpinard Nov 10, 2015
5efe5af
update image_viewer server.js (more to come)
etpinard Nov 10, 2015
f3646da
add paths to test dashboard and image viewer build files to constants
etpinard Nov 10, 2015
8131509
split watch_plotly into module and run-script
etpinard Nov 12, 2015
d3b9f1f
rm un-finished scripts (for now)
etpinard Nov 12, 2015
e535fe9
add append version util, use it to add version in bundles
etpinard Nov 13, 2015
2abf31f
add dist/ to gitignore (dist/ commits will be -f)
etpinard Nov 13, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .ackrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--ignore-directory=is:dist
--ignore-directory=is:build
--ignore-directory=is:assets

--ignore-file=ext:svg
--ignore-file=ext:log
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
node_modules

build/*
!build/README.md
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd vote for ignoring dist/* as well and have us git add -f dist/ when we bump the version.

Thoughts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes lets do this - we can always turn it off if we don't like it


npm-debug.log
Empty file added LICENSE
Empty file.
1 change: 1 addition & 0 deletions build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Directory of non-distributed built files
3 changes: 1 addition & 2 deletions devtools/image_viewer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<div id="plot-images"></div>
<div id="plot-mock"></div>

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
<script type="text/javascript" src="test-images-viewer-bundle.js"></script>
<script type="text/javascript" src="../../build/image_viewer-bundle.js"></script>
</body>
</html>
47 changes: 28 additions & 19 deletions devtools/image_viewer/server.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,42 @@
'use strict';

var http = require('http');
var ecstatic = require('ecstatic');
var browserify = require('browserify');
var open = require('open');
var fs = require('fs');
var http = require('http');
var path = require('path');
var exec = require('child_process').exec;

var bundleName = 'test-images-viewer-bundle.js',
listName = 'list-of-incorrect-images.txt';
var browserify = require('browserify');
var ecstatic = require('ecstatic');
var _open = require('open');

var constants = require('../../tasks/util/constants');

fs.unlink(bundleName, function(err) {

// TODO make this an optional argument
var PORT = '9090';

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

var listName = 'list-of-incorrect-images.txt';

// build image viewer bundle
fs.unlink(constants.pathToImageViewerBundle, function() {
exec('ls ../test-images-diffs/ > ' + listName, function() {
var b = browserify('./viewer.js', {
debug: true,
verbose: true
});
var b = browserify(path.join(__dirname, './viewer.js'), { debug: true });

b.transform('brfs');
b.bundle().pipe(fs.createWriteStream(bundleName));
b.bundle(function(err) {
if(err) throw err;

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

fs.readFile(listName, 'utf8', function(err, data) {
console.log('In ' + listName + ':\n' + data);
});
});
});

// boot up server
http.createServer(
ecstatic({ root: '../.' })
).listen(9090);

console.log('Listening on :9090\n');
open('http://localhost:9090/test-images-viewer');
ecstatic({ root: constants.pathToRoot })
).listen(PORT);
5 changes: 1 addition & 4 deletions devtools/image_viewer/viewer.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
'use strict';

/* global d3:false */

var fs = require('fs');
var d3 = require('d3');

var $plotlist = document.getElementById('plot-list'),
$images = document.getElementById('plot-images'),
Expand Down
4 changes: 1 addition & 3 deletions devtools/test_dashboard/buttons.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

var plotlist = document.getElementById('plot-list');
var anchor = document.getElementById('embedded-graph');
var image = document.getElementById('embedded-image');
Expand Down Expand Up @@ -111,7 +109,7 @@ function plotButtons(plots, figDir) {
plotlist.appendChild(pummelButton);

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

pummelButton.addEventListener('click', function () {
Expand Down
96 changes: 0 additions & 96 deletions devtools/test_dashboard/generateImages.js

This file was deleted.

66 changes: 19 additions & 47 deletions devtools/test_dashboard/index.html
Original file line number Diff line number Diff line change
@@ -1,67 +1,39 @@
<!DOCTYPE html>
<head>

<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" />

<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" />
</head>

<body>

<div id="plot-list" style="overflow:auto; height: 100px;"></div>
<div id="status-info" style="display: block; position: absolute; top: 150px;"></div>
<div id="embedded-graph"></div>
<div id="embedded-image"style="
display: block;
position: absolute;
top: 800px;
">
</div>

<script type="text/javascript" src="./../shelly/shelly/static/js/plugins/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>

<script>
PLOTLYENV = {
TOPOJSON_URL: '../shelly/plotlyjs/static/plotlyjs/src/geo/topojson/'
};
</script>
<div id="plot-list" style="overflow:auto; height:100px;"></div>
<div id="status-info" style="display:block; position:absolute; top:150px;"></div>
<div id="embedded-graph"></div>
<div id="embedded-image" style="display:block; position:absolute; top:800px;"></div>

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

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

<script>
MathJax.Hub.Config({
messageStyle: 'none',
skipStartupTypeset: true,
displayAlign: "left",
tex2jax: {
inlineMath: [["$","$"],["\\(","\\)"]]
}
});
</script>
<script type="text/javascript" src="../../build/test_dashboard-bundle.js"></script>

<script>
<!-- helper functions to manipulate graph div -->
<script>
var Tabs = {
get: function() {
getGraph: function() {
return document.getElementById('embedded-graph').children[0];
},
fresh: function() {
var anchor = document.getElementById('embedded-graph'),
plotDiv = Tabs.get();
if(plotDiv) anchor.removeChild(plotDiv);
plotDiv = document.createElement('div');
anchor.appendChild(plotDiv);
return plotDiv;
}
};
graphDiv = Tabs.getGraph();

Tabs.getGraph = Tabs.get;
if(graphDiv) anchor.removeChild(graphDiv);
graphDiv = document.createElement('div');
anchor.appendChild(graphDiv);

var Themes = {
reTileLock: null
return graphDiv;
}
};
</script>

</script>

</body>
</html>
82 changes: 0 additions & 82 deletions devtools/test_dashboard/make-test-2d.js

This file was deleted.

17 changes: 0 additions & 17 deletions devtools/test_dashboard/package.json

This file was deleted.

Loading