starting command line stuff

This commit is contained in:
Peter Cottle 2012-08-13 14:09:55 -07:00
parent c4cc6cd57e
commit c12e0c6f2d
8 changed files with 380 additions and 184 deletions

38
src/constants.js Normal file
View file

@ -0,0 +1,38 @@
/**
* Constants....!!!
*/
var constants = {
clickDragMass: 20,
baseMass: 1,
};
var time = {
edgeAddInterval: 200,
breathePeriod: 0.3
};
/**
* Graphics style
*/
var graphics = {
// colors
edgeStroke: 'rgba(94%, 96%, 98%, 0.5)', // '#EFF5FB',
nodeEdge: 'rgba(94%, 96%, 98%, 0.9)', // '#EFF5FB',
nodeFill: '#0066cc',
// widths
nodeStrokeWidth: 15,
edgeWidth: 2,
};
function randomString(string_length) {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var randomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum,rnum+1);
}
return randomstring;
}