diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/angular.html b/angular.html new file mode 100644 index 0000000..f04531c --- /dev/null +++ b/angular.html @@ -0,0 +1,31 @@ + + + + + +
+ + +current time {{time}} +
+ + + + + diff --git a/app.js b/app.js index a55e70a..7b6f85b 100644 --- a/app.js +++ b/app.js @@ -8,9 +8,42 @@ var formidable = require('formidable'); var session = require('express-session'); var routes = require('./routes/index'); +<<<<<<< Updated upstream var dimensionRouter = require('./routes/dimensions'); var measuresRouter = require('./routes/measures'); var namespaceRouter = require('./routes/logdata'); +======= + +var configRoute = require('./routes/config'); +var serviceConfigRoute = require('./routes/serviceConfig'); +var authenticate = require('./routes/authenticate')(passport); +var userAgent = require('./routes/nginx/userAgent'); +var logListing = require('./routes/nginx/logListing'); +var trafficRate = require('./routes/nginx/trafficRate'); + +//Wave 2 code +var packageRoutes = require('./routes/aptCache/packageCount'); +var graphRoutes = require('./routes/aptCache/logRateData'); +var dataRateData = require('./routes/aptCache/dataRateData'); +var packageAnalytics = require('./routes/aptCache/packageAnalytics'); +var repRoutes = require('./routes/aptCache/repository'); +var getInfo = require('./routes/aptCache/getInfo'); +//end wave 2 code + +//wave 3 routes starts +var getFilterData = require('./routes/gitLog/getFilterData'); +var newfilter = require('./routes/gitLog/newfilter'); +var plotTheGraph = require('./routes/gitLog/plot_the_graph'); +var getProfile = require('./routes/gitLog/getProfile'); +var getDashBoardJson = require('./routes/gitLog/getDashBoardJson'); +var onPageLoadDashBoard = require('./routes/gitLog/onPageLoadDashBoard'); +var gitDashboardConfigData = require('./routes/gitLog/gitDashboardConfigData'); +//wave 3 routes ends + +//wave 4 starts +var expressions=require('./routes/realTimeLogs/queryBuilder/expressions.js') +//wave 4 ends +>>>>>>> Stashed changes var app = express(); // view engine setup @@ -44,6 +77,11 @@ app.use('/dimensions', dimensionRouter); app.use('/measures', measuresRouter); app.use('/logdata', namespaceRouter); +//wave 4 code +app.use('/exp',expressions); + +// wave 4 code ends + // catch 404 and forward to error handler app.use(function(req, res, next) { var err = new Error('Not Found'); diff --git a/baskar/LogAggregator-4 b/baskar/LogAggregator-4 new file mode 160000 index 0000000..afa321b --- /dev/null +++ b/baskar/LogAggregator-4 @@ -0,0 +1 @@ +Subproject commit afa321b8c1cd9a10a8fb8413fc85f74a53ed72ca diff --git a/check.js b/check.js new file mode 100644 index 0000000..9482a1d --- /dev/null +++ b/check.js @@ -0,0 +1,67 @@ +var sift = require('sift'); +var _=require('highland') + +// eval= { +// val1: '140', +// val2: <%= val1%> +// } + +// console.log(eval.val2); +// // i=eval.val2; +// var fs = require('fs'); +// var output=fs.createWriteStream('output') +// var calls=0; +// var num=_(['1','2','3','4','5','6']).map(function(x) { +// ++calls; +// return x+1; +// }); +// var nums=num.batch(2); +// nums.pipe(output) +// var output=_(['some','texe']).intersperse('n'); +// // _(output).pipe(process.stdout); + +// var output=_(['somme','texmme']).splitBy('mm'); +// _(output).pipe(process.stdout); +// var output=_(['foo', 'bar']).invoke('toUpperCase', []) +// _(output).pipe(process.stdout); +// var output=_(['foo', 'bar']).map(toUpperCase); +// _(output).pipe(process.stdout) + +// var output=_([1]).reduce1(function(a,b) { +// return a+b; +// }); +// _(output).each(function(x) { +// console.log(x); +// }); +var ar=[] + +for (var i = 1; i <= 100; i++) { + ar.push(i); + +} + +var output=_(ar).batch(10).reduce1(function (a,b) { + // console.log(x); + a=parseInt(a); + b=parseInt(b) + return a+b; +}); + +_(output).each(function(x) { + console.log(x); +}) +// console.log(calls); +// var sift = require('sift'); +// +// +// eval= { +// val1: 5, +// val2: 5 +// } +// +// var sifter = sift({$where: function() { +// return this.val1 >= this.val2; +// }}); +// +// eval.highlight=sifter(eval) +// console.log(eval); diff --git a/check.txt b/check.txt new file mode 100644 index 0000000..e69de29 diff --git a/demo.js b/demo.js new file mode 100644 index 0000000..bdc1999 --- /dev/null +++ b/demo.js @@ -0,0 +1,7 @@ +var _ = require('highland'); +var sift = require('sift'); + + +var sifter=sift({index:{$gt:'0'}}); + +console.log(sifter({index:'-9'})); diff --git a/dest/routes/dimensions.js b/dest/routes/dimensions.js new file mode 100644 index 0000000..6f9e651 --- /dev/null +++ b/dest/routes/dimensions.js @@ -0,0 +1,56 @@ +var express = require('express'); +var dimensionRouter = express.Router(); +var mongoose = require('mongoose'); +var Namespace = require('../model/db').namespaceModel; + +/* GET Dimensions */ +dimensionRouter.get('/', function(req, res) { + if(req.session.oid!==null){ + Namespace.findNamespace(req.session.oid, function(err, namespace) { + if (namespace != null) { + res.send(namespace.dimensions); + } + }); +} +}); + +/* POST Dimension */ + +dimensionRouter.post('/addDimension', function(req, res) { + if (req.session.oid !== null) { + Namespace.findNamespace(req.session.oid, function(err, namespace) { + if (namespace != null) { + namespace.dimensions.push({ + displayName: req.body.displayname, + fieldName: req.body.fieldname + }); + + namespace.save(function(err, namespace) { + console.log('namespace saved:', namespace); + }); + } + }); +} + res.redirect('/'); +}); + +/*delete*/ +dimensionRouter.post('/:id', function(req, res) { + console.log("deleted value is", req.params.id); + // Namespace.findNamespace('test_namespace', function(err, namespace) { + // if (namespace != null) { + // var length = namespace.dimensions.length; + // for(var i =0 ;i=n) + { + var k=count%n; + arr1[k]=value; + var sum=0; + for(var h=0;h=n) + { + var k=count%n; + arr1[k]=value; + var min=99999999999; + for(var h=0;harr1[h]) + { + min=arr1[h]; + } + + } + count++; + return min; + } + + } + + this.max= function(value) + { + var length; + length=arr1.length; + if(count=n) + { + var k=count%n; + arr1[k]=value; + var max=-99999999999; + for(var h=0;h=n) + { + var k=count%n; + arr1[k]=value; + var sum=0; + for(var h=0;h=n) + { + var k=count%n; + arr1[k]=value; + var sum=0; + for(var h=0;h=0.2.11 <0.3.0', +414 silly cache add type: 'range' } +415 silly addNamed minimatch@>=0.2.11 <0.3.0 +416 verbose addNamed ">=0.2.11 <0.3.0" is a valid semver range for minimatch +417 silly addNameRange { name: 'minimatch', range: '>=0.2.11 <0.3.0', hasData: false } +418 silly mapToRegistry name minimatch +419 silly mapToRegistry using default registry +420 silly mapToRegistry registry http://172.23.238.253:4873/ +421 silly mapToRegistry uri http://172.23.238.253:4873/minimatch +422 verbose addNameRange registry:http://172.23.238.253:4873/minimatch not in flight; fetching +423 verbose get http://172.23.238.253:4873/minimatch not expired, no request +424 silly addNameRange number 2 { name: 'minimatch', range: '>=0.2.11 <0.3.0', hasData: true } +425 silly addNameRange versions [ 'minimatch', +425 silly addNameRange [ '0.0.1', +425 silly addNameRange '0.0.2', +425 silly addNameRange '0.0.4', +425 silly addNameRange '0.0.5', +425 silly addNameRange '0.1.1', +425 silly addNameRange '0.1.2', +425 silly addNameRange '0.1.3', +425 silly addNameRange '0.1.4', +425 silly addNameRange '0.1.5', +425 silly addNameRange '0.2.0', +425 silly addNameRange '0.2.2', +425 silly addNameRange '0.2.3', +425 silly addNameRange '0.2.4', +425 silly addNameRange '0.2.5', +425 silly addNameRange '0.2.6', +425 silly addNameRange '0.2.7', +425 silly addNameRange '0.2.8', +425 silly addNameRange '0.2.9', +425 silly addNameRange '0.2.10', +425 silly addNameRange '0.2.11', +425 silly addNameRange '0.2.12', +425 silly addNameRange '0.2.13', +425 silly addNameRange '0.2.14', +425 silly addNameRange '0.3.0', +425 silly addNameRange '0.4.0', +425 silly addNameRange '1.0.0', +425 silly addNameRange '2.0.0', +425 silly addNameRange '2.0.1', +425 silly addNameRange '2.0.2', +425 silly addNameRange '2.0.3', +425 silly addNameRange '2.0.4', +425 silly addNameRange '2.0.5', +425 silly addNameRange '2.0.6', +425 silly addNameRange '2.0.7', +425 silly addNameRange '2.0.8', +425 silly addNameRange '2.0.9', +425 silly addNameRange '2.0.10', +425 silly addNameRange '3.0.0' ] ] +426 silly addNamed minimatch@0.2.14 +427 verbose addNamed "0.2.14" is a plain semver version for minimatch +428 silly cache afterAdd minimatch@0.2.14 +429 verbose afterAdd /home/vagrant/.npm/minimatch/0.2.14/package/package.json not in flight; writing +430 verbose correctMkdir /home/vagrant/.npm correctMkdir not in flight; initializing +431 verbose afterAdd /home/vagrant/.npm/minimatch/0.2.14/package/package.json written +432 http 304 http://172.23.238.253:4873/graceful-fs +433 verbose headers { 'x-powered-by': 'Sinopia/1.4.0', +433 verbose headers etag: '"fe22221783b15d9ae0cf838d625b67b7"', +433 verbose headers 'x-status-cat': 'http://flic.kr/p/aXY3dH', +433 verbose headers date: 'Mon, 11 Apr 2016 06:13:45 GMT', +433 verbose headers connection: 'keep-alive' } +434 silly get cb [ 304, +434 silly get { 'x-powered-by': 'Sinopia/1.4.0', +434 silly get etag: '"fe22221783b15d9ae0cf838d625b67b7"', +434 silly get 'x-status-cat': 'http://flic.kr/p/aXY3dH', +434 silly get date: 'Mon, 11 Apr 2016 06:13:45 GMT', +434 silly get connection: 'keep-alive' } ] +435 verbose etag http://172.23.238.253:4873/graceful-fs from cache +436 verbose get saving graceful-fs to /home/vagrant/.npm/172.23.238.253_4873/graceful-fs/.cache.json +437 verbose correctMkdir /home/vagrant/.npm correctMkdir not in flight; initializing +438 silly resolveWithNewModule graceful-fs@2.0.3 checking installable status +439 silly cache add args [ 'graceful-fs@~2.0.0', null ] +440 verbose cache add spec graceful-fs@~2.0.0 +441 silly cache add parsed spec Result { +441 silly cache add raw: 'graceful-fs@~2.0.0', +441 silly cache add scope: null, +441 silly cache add name: 'graceful-fs', +441 silly cache add rawSpec: '~2.0.0', +441 silly cache add spec: '>=2.0.0 <2.1.0', +441 silly cache add type: 'range' } +442 silly addNamed graceful-fs@>=2.0.0 <2.1.0 +443 verbose addNamed ">=2.0.0 <2.1.0" is a valid semver range for graceful-fs +444 silly addNameRange { name: 'graceful-fs', range: '>=2.0.0 <2.1.0', hasData: false } +445 silly mapToRegistry name graceful-fs +446 silly mapToRegistry using default registry +447 silly mapToRegistry registry http://172.23.238.253:4873/ +448 silly mapToRegistry uri http://172.23.238.253:4873/graceful-fs +449 verbose addNameRange registry:http://172.23.238.253:4873/graceful-fs not in flight; fetching +450 verbose get http://172.23.238.253:4873/graceful-fs not expired, no request +451 silly addNameRange number 2 { name: 'graceful-fs', range: '>=2.0.0 <2.1.0', hasData: true } +452 silly addNameRange versions [ 'graceful-fs', +452 silly addNameRange [ '1.0.0', +452 silly addNameRange '1.0.1', +452 silly addNameRange '1.0.2', +452 silly addNameRange '1.1.0', +452 silly addNameRange '1.1.1', +452 silly addNameRange '1.1.2', +452 silly addNameRange '1.1.3', +452 silly addNameRange '1.1.4', +452 silly addNameRange '1.1.5', +452 silly addNameRange '1.1.6', +452 silly addNameRange '1.1.7', +452 silly addNameRange '1.1.8', +452 silly addNameRange '1.1.9', +452 silly addNameRange '1.1.10', +452 silly addNameRange '1.1.11', +452 silly addNameRange '1.1.12', +452 silly addNameRange '1.1.13', +452 silly addNameRange '1.1.14', +452 silly addNameRange '1.2.0', +452 silly addNameRange '1.2.1', +452 silly addNameRange '1.2.2', +452 silly addNameRange '1.2.3', +452 silly addNameRange '2.0.0', +452 silly addNameRange '2.0.1', +452 silly addNameRange '2.0.2', +452 silly addNameRange '2.0.3', +452 silly addNameRange '3.0.0', +452 silly addNameRange '3.0.1', +452 silly addNameRange '3.0.2', +452 silly addNameRange '3.0.3', +452 silly addNameRange '3.0.4', +452 silly addNameRange '3.0.5', +452 silly addNameRange '3.0.6', +452 silly addNameRange '3.0.7', +452 silly addNameRange '3.0.8', +452 silly addNameRange '4.1.0', +452 silly addNameRange '4.1.1', +452 silly addNameRange '4.1.2', +452 silly addNameRange '4.1.3' ] ] +453 silly addNamed graceful-fs@2.0.3 +454 verbose addNamed "2.0.3" is a plain semver version for graceful-fs +455 silly cache afterAdd graceful-fs@2.0.3 +456 verbose afterAdd /home/vagrant/.npm/graceful-fs/2.0.3/package/package.json not in flight; writing +457 verbose correctMkdir /home/vagrant/.npm correctMkdir not in flight; initializing +458 verbose afterAdd /home/vagrant/.npm/graceful-fs/2.0.3/package/package.json written +459 http 304 http://172.23.238.253:4873/inherits +460 verbose headers { 'x-powered-by': 'Sinopia/1.4.0', +460 verbose headers etag: '"ac8f8bd1f52554417a077dc746a562cd"', +460 verbose headers 'x-status-cat': 'http://flic.kr/p/aXY3dH', +460 verbose headers date: 'Mon, 11 Apr 2016 06:13:45 GMT', +460 verbose headers connection: 'keep-alive' } +461 silly get cb [ 304, +461 silly get { 'x-powered-by': 'Sinopia/1.4.0', +461 silly get etag: '"ac8f8bd1f52554417a077dc746a562cd"', +461 silly get 'x-status-cat': 'http://flic.kr/p/aXY3dH', +461 silly get date: 'Mon, 11 Apr 2016 06:13:45 GMT', +461 silly get connection: 'keep-alive' } ] +462 verbose etag http://172.23.238.253:4873/inherits from cache +463 verbose get saving inherits to /home/vagrant/.npm/172.23.238.253_4873/inherits/.cache.json +464 verbose correctMkdir /home/vagrant/.npm correctMkdir not in flight; initializing +465 silly resolveWithNewModule inherits@2.0.1 checking installable status +466 silly cache add args [ 'inherits@2', null ] +467 verbose cache add spec inherits@2 +468 silly cache add parsed spec Result { +468 silly cache add raw: 'inherits@2', +468 silly cache add scope: null, +468 silly cache add name: 'inherits', +468 silly cache add rawSpec: '2', +468 silly cache add spec: '>=2.0.0 <3.0.0', +468 silly cache add type: 'range' } +469 silly addNamed inherits@>=2.0.0 <3.0.0 +470 verbose addNamed ">=2.0.0 <3.0.0" is a valid semver range for inherits +471 silly addNameRange { name: 'inherits', range: '>=2.0.0 <3.0.0', hasData: false } +472 silly mapToRegistry name inherits +473 silly mapToRegistry using default registry +474 silly mapToRegistry registry http://172.23.238.253:4873/ +475 silly mapToRegistry uri http://172.23.238.253:4873/inherits +476 verbose addNameRange registry:http://172.23.238.253:4873/inherits not in flight; fetching +477 verbose get http://172.23.238.253:4873/inherits not expired, no request +478 silly addNameRange number 2 { name: 'inherits', range: '>=2.0.0 <3.0.0', hasData: true } +479 silly addNameRange versions [ 'inherits', [ '1.0.0', '2.0.0', '2.0.1', '1.0.1', '1.0.2' ] ] +480 silly addNamed inherits@2.0.1 +481 verbose addNamed "2.0.1" is a plain semver version for inherits +482 silly cache afterAdd inherits@2.0.1 +483 verbose afterAdd /home/vagrant/.npm/inherits/2.0.1/package/package.json not in flight; writing +484 verbose correctMkdir /home/vagrant/.npm correctMkdir not in flight; initializing +485 verbose afterAdd /home/vagrant/.npm/inherits/2.0.1/package/package.json written +486 silly fetchNamedPackageData lru-cache +487 silly mapToRegistry name lru-cache +488 silly mapToRegistry using default registry +489 silly mapToRegistry registry http://172.23.238.253:4873/ +490 silly mapToRegistry uri http://172.23.238.253:4873/lru-cache +491 silly fetchNamedPackageData sigmund +492 silly mapToRegistry name sigmund +493 silly mapToRegistry using default registry +494 silly mapToRegistry registry http://172.23.238.253:4873/ +495 silly mapToRegistry uri http://172.23.238.253:4873/sigmund +496 verbose request uri http://172.23.238.253:4873/lru-cache +497 verbose request no auth needed +498 info attempt registry request try #1 at 6:13:08 AM +499 verbose etag "268cd4eab5a69f21014610d3413f3780" +500 http request GET http://172.23.238.253:4873/lru-cache +501 verbose request uri http://172.23.238.253:4873/sigmund +502 verbose request no auth needed +503 info attempt registry request try #1 at 6:13:08 AM +504 verbose etag "7be52962cd7dde50bcd45287393ca9e1" +505 http request GET http://172.23.238.253:4873/sigmund +506 http 304 http://172.23.238.253:4873/lru-cache +507 verbose headers { 'x-powered-by': 'Sinopia/1.4.0', +507 verbose headers etag: '"268cd4eab5a69f21014610d3413f3780"', +507 verbose headers 'x-status-cat': 'http://flic.kr/p/aXY3dH', +507 verbose headers date: 'Mon, 11 Apr 2016 06:13:47 GMT', +507 verbose headers connection: 'keep-alive' } +508 silly get cb [ 304, +508 silly get { 'x-powered-by': 'Sinopia/1.4.0', +508 silly get etag: '"268cd4eab5a69f21014610d3413f3780"', +508 silly get 'x-status-cat': 'http://flic.kr/p/aXY3dH', +508 silly get date: 'Mon, 11 Apr 2016 06:13:47 GMT', +508 silly get connection: 'keep-alive' } ] +509 verbose etag http://172.23.238.253:4873/lru-cache from cache +510 verbose get saving lru-cache to /home/vagrant/.npm/172.23.238.253_4873/lru-cache/.cache.json +511 verbose correctMkdir /home/vagrant/.npm correctMkdir not in flight; initializing +512 silly resolveWithNewModule lru-cache@2.7.3 checking installable status +513 silly cache add args [ 'lru-cache@2', null ] +514 verbose cache add spec lru-cache@2 +515 silly cache add parsed spec Result { +515 silly cache add raw: 'lru-cache@2', +515 silly cache add scope: null, +515 silly cache add name: 'lru-cache', +515 silly cache add rawSpec: '2', +515 silly cache add spec: '>=2.0.0 <3.0.0', +515 silly cache add type: 'range' } +516 silly addNamed lru-cache@>=2.0.0 <3.0.0 +517 verbose addNamed ">=2.0.0 <3.0.0" is a valid semver range for lru-cache +518 silly addNameRange { name: 'lru-cache', range: '>=2.0.0 <3.0.0', hasData: false } +519 silly mapToRegistry name lru-cache +520 silly mapToRegistry using default registry +521 silly mapToRegistry registry http://172.23.238.253:4873/ +522 silly mapToRegistry uri http://172.23.238.253:4873/lru-cache +523 verbose addNameRange registry:http://172.23.238.253:4873/lru-cache not in flight; fetching +524 verbose get http://172.23.238.253:4873/lru-cache not expired, no request +525 silly addNameRange number 2 { name: 'lru-cache', range: '>=2.0.0 <3.0.0', hasData: true } +526 silly addNameRange versions [ 'lru-cache', +526 silly addNameRange [ '1.0.1', +526 silly addNameRange '1.0.2', +526 silly addNameRange '1.0.3', +526 silly addNameRange '1.0.4', +526 silly addNameRange '1.0.5', +526 silly addNameRange '1.0.6', +526 silly addNameRange '1.1.0', +526 silly addNameRange '1.1.1', +526 silly addNameRange '2.0.0', +526 silly addNameRange '2.0.1', +526 silly addNameRange '2.0.2', +526 silly addNameRange '2.0.3', +526 silly addNameRange '2.0.4', +526 silly addNameRange '2.1.0', +526 silly addNameRange '2.2.0', +526 silly addNameRange '2.2.1', +526 silly addNameRange '2.2.2', +526 silly addNameRange '2.2.4', +526 silly addNameRange '2.3.0', +526 silly addNameRange '2.3.1', +526 silly addNameRange '2.5.0', +526 silly addNameRange '2.5.1', +526 silly addNameRange '2.5.2', +526 silly addNameRange '2.6.0', +526 silly addNameRange '2.6.1', +526 silly addNameRange '2.6.2', +526 silly addNameRange '2.6.3', +526 silly addNameRange '2.6.4', +526 silly addNameRange '2.6.5', +526 silly addNameRange '2.7.0', +526 silly addNameRange '2.7.1', +526 silly addNameRange '2.7.2', +526 silly addNameRange '2.7.3', +526 silly addNameRange '3.0.0', +526 silly addNameRange '3.1.0', +526 silly addNameRange '3.1.1', +526 silly addNameRange '3.1.2', +526 silly addNameRange '3.2.0', +526 silly addNameRange '4.0.0', +526 silly addNameRange '4.0.1' ] ] +527 silly addNamed lru-cache@2.7.3 +528 verbose addNamed "2.7.3" is a plain semver version for lru-cache +529 silly cache afterAdd lru-cache@2.7.3 +530 verbose afterAdd /home/vagrant/.npm/lru-cache/2.7.3/package/package.json not in flight; writing +531 verbose correctMkdir /home/vagrant/.npm correctMkdir not in flight; initializing +532 verbose afterAdd /home/vagrant/.npm/lru-cache/2.7.3/package/package.json written +533 http 304 http://172.23.238.253:4873/sigmund +534 verbose headers { 'x-powered-by': 'Sinopia/1.4.0', +534 verbose headers etag: '"7be52962cd7dde50bcd45287393ca9e1"', +534 verbose headers 'x-status-cat': 'http://flic.kr/p/aXY3dH', +534 verbose headers date: 'Mon, 11 Apr 2016 06:13:48 GMT', +534 verbose headers connection: 'keep-alive' } +535 silly get cb [ 304, +535 silly get { 'x-powered-by': 'Sinopia/1.4.0', +535 silly get etag: '"7be52962cd7dde50bcd45287393ca9e1"', +535 silly get 'x-status-cat': 'http://flic.kr/p/aXY3dH', +535 silly get date: 'Mon, 11 Apr 2016 06:13:48 GMT', +535 silly get connection: 'keep-alive' } ] +536 verbose etag http://172.23.238.253:4873/sigmund from cache +537 verbose get saving sigmund to /home/vagrant/.npm/172.23.238.253_4873/sigmund/.cache.json +538 verbose correctMkdir /home/vagrant/.npm correctMkdir not in flight; initializing +539 silly resolveWithNewModule sigmund@1.0.1 checking installable status +540 silly cache add args [ 'sigmund@~1.0.0', null ] +541 verbose cache add spec sigmund@~1.0.0 +542 silly cache add parsed spec Result { +542 silly cache add raw: 'sigmund@~1.0.0', +542 silly cache add scope: null, +542 silly cache add name: 'sigmund', +542 silly cache add rawSpec: '~1.0.0', +542 silly cache add spec: '>=1.0.0 <1.1.0', +542 silly cache add type: 'range' } +543 silly addNamed sigmund@>=1.0.0 <1.1.0 +544 verbose addNamed ">=1.0.0 <1.1.0" is a valid semver range for sigmund +545 silly addNameRange { name: 'sigmund', range: '>=1.0.0 <1.1.0', hasData: false } +546 silly mapToRegistry name sigmund +547 silly mapToRegistry using default registry +548 silly mapToRegistry registry http://172.23.238.253:4873/ +549 silly mapToRegistry uri http://172.23.238.253:4873/sigmund +550 verbose addNameRange registry:http://172.23.238.253:4873/sigmund not in flight; fetching +551 verbose get http://172.23.238.253:4873/sigmund not expired, no request +552 silly addNameRange number 2 { name: 'sigmund', range: '>=1.0.0 <1.1.0', hasData: true } +553 silly addNameRange versions [ 'sigmund', [ '1.0.0', '1.0.1' ] ] +554 silly addNamed sigmund@1.0.1 +555 verbose addNamed "1.0.1" is a plain semver version for sigmund +556 silly cache afterAdd sigmund@1.0.1 +557 verbose afterAdd /home/vagrant/.npm/sigmund/1.0.1/package/package.json not in flight; writing +558 verbose correctMkdir /home/vagrant/.npm correctMkdir not in flight; initializing +559 verbose afterAdd /home/vagrant/.npm/sigmund/1.0.1/package/package.json written +560 silly fetchNamedPackageData commander +561 silly mapToRegistry name commander +562 silly mapToRegistry using default registry +563 silly mapToRegistry registry http://172.23.238.253:4873/ +564 silly mapToRegistry uri http://172.23.238.253:4873/commander +565 silly resolveWithNewModule commander@0.6.1 checking installable status +566 silly cache add args [ 'commander@0.6.1', null ] +567 verbose cache add spec commander@0.6.1 +568 silly fetchNamedPackageData mkdirp +569 silly mapToRegistry name mkdirp +570 silly mapToRegistry using default registry +571 silly mapToRegistry registry http://172.23.238.253:4873/ +572 silly mapToRegistry uri http://172.23.238.253:4873/mkdirp +573 silly resolveWithNewModule mkdirp@0.3.0 checking installable status +574 silly cache add args [ 'mkdirp@0.3.0', null ] +575 verbose cache add spec mkdirp@0.3.0 +576 silly cache add parsed spec Result { +576 silly cache add raw: 'commander@0.6.1', +576 silly cache add scope: null, +576 silly cache add name: 'commander', +576 silly cache add rawSpec: '0.6.1', +576 silly cache add spec: '0.6.1', +576 silly cache add type: 'version' } +577 silly addNamed commander@0.6.1 +578 verbose addNamed "0.6.1" is a plain semver version for commander +579 silly mapToRegistry name commander +580 silly mapToRegistry using default registry +581 silly mapToRegistry registry http://172.23.238.253:4873/ +582 silly mapToRegistry uri http://172.23.238.253:4873/commander +583 verbose addNameVersion registry:http://172.23.238.253:4873/commander not in flight; fetching +584 silly cache add parsed spec Result { +584 silly cache add raw: 'mkdirp@0.3.0', +584 silly cache add scope: null, +584 silly cache add name: 'mkdirp', +584 silly cache add rawSpec: '0.3.0', +584 silly cache add spec: '0.3.0', +584 silly cache add type: 'version' } +585 silly addNamed mkdirp@0.3.0 +586 verbose addNamed "0.3.0" is a plain semver version for mkdirp +587 silly mapToRegistry name mkdirp +588 silly mapToRegistry using default registry +589 silly mapToRegistry registry http://172.23.238.253:4873/ +590 silly mapToRegistry uri http://172.23.238.253:4873/mkdirp +591 verbose addNameVersion registry:http://172.23.238.253:4873/mkdirp not in flight; fetching +592 verbose request uri http://172.23.238.253:4873/commander +593 verbose request no auth needed +594 info attempt registry request try #1 at 6:13:11 AM +595 verbose etag "83ee45b6ed25bed8bd639237ee026731" +596 http request GET http://172.23.238.253:4873/commander +597 verbose request uri http://172.23.238.253:4873/mkdirp +598 verbose request no auth needed +599 info attempt registry request try #1 at 6:13:11 AM +600 verbose etag "60f7cf2672457488a3232df9b8f49298" +601 http request GET http://172.23.238.253:4873/mkdirp +602 http 304 http://172.23.238.253:4873/mkdirp +603 verbose headers { 'x-powered-by': 'Sinopia/1.4.0', +603 verbose headers etag: '"60f7cf2672457488a3232df9b8f49298"', +603 verbose headers 'x-status-cat': 'http://flic.kr/p/aXY3dH', +603 verbose headers date: 'Mon, 11 Apr 2016 06:13:48 GMT', +603 verbose headers connection: 'keep-alive' } +604 silly get cb [ 304, +604 silly get { 'x-powered-by': 'Sinopia/1.4.0', +604 silly get etag: '"60f7cf2672457488a3232df9b8f49298"', +604 silly get 'x-status-cat': 'http://flic.kr/p/aXY3dH', +604 silly get date: 'Mon, 11 Apr 2016 06:13:48 GMT', +604 silly get connection: 'keep-alive' } ] +605 verbose etag http://172.23.238.253:4873/mkdirp from cache +606 verbose get saving mkdirp to /home/vagrant/.npm/172.23.238.253_4873/mkdirp/.cache.json +607 verbose correctMkdir /home/vagrant/.npm correctMkdir not in flight; initializing +608 silly cache afterAdd mkdirp@0.3.0 +609 verbose afterAdd /home/vagrant/.npm/mkdirp/0.3.0/package/package.json not in flight; writing +610 verbose correctMkdir /home/vagrant/.npm correctMkdir not in flight; initializing +611 verbose afterAdd /home/vagrant/.npm/mkdirp/0.3.0/package/package.json written +612 http 304 http://172.23.238.253:4873/commander +613 verbose headers { 'x-powered-by': 'Sinopia/1.4.0', +613 verbose headers etag: '"83ee45b6ed25bed8bd639237ee026731"', +613 verbose headers 'x-status-cat': 'http://flic.kr/p/aXY3dH', +613 verbose headers date: 'Mon, 11 Apr 2016 06:13:50 GMT', +613 verbose headers connection: 'keep-alive' } +614 silly get cb [ 304, +614 silly get { 'x-powered-by': 'Sinopia/1.4.0', +614 silly get etag: '"83ee45b6ed25bed8bd639237ee026731"', +614 silly get 'x-status-cat': 'http://flic.kr/p/aXY3dH', +614 silly get date: 'Mon, 11 Apr 2016 06:13:50 GMT', +614 silly get connection: 'keep-alive' } ] +615 verbose etag http://172.23.238.253:4873/commander from cache +616 verbose get saving commander to /home/vagrant/.npm/172.23.238.253_4873/commander/.cache.json +617 verbose correctMkdir /home/vagrant/.npm correctMkdir not in flight; initializing +618 silly cache afterAdd commander@0.6.1 +619 verbose afterAdd /home/vagrant/.npm/commander/0.6.1/package/package.json not in flight; writing +620 verbose correctMkdir /home/vagrant/.npm correctMkdir not in flight; initializing +621 verbose afterAdd /home/vagrant/.npm/commander/0.6.1/package/package.json written +622 silly fetchNamedPackageData minimist +623 silly mapToRegistry name minimist +624 silly mapToRegistry using default registry +625 silly mapToRegistry registry http://172.23.238.253:4873/ +626 silly mapToRegistry uri http://172.23.238.253:4873/minimist +627 verbose request uri http://172.23.238.253:4873/minimist +628 verbose request no auth needed +629 info attempt registry request try #1 at 6:13:12 AM +630 verbose etag "e3f8e00333e08a64e20afcf8bdece438" +631 http request GET http://172.23.238.253:4873/minimist +632 http 304 http://172.23.238.253:4873/minimist +633 verbose headers { 'x-powered-by': 'Sinopia/1.4.0', +633 verbose headers etag: '"e3f8e00333e08a64e20afcf8bdece438"', +633 verbose headers 'x-status-cat': 'http://flic.kr/p/aXY3dH', +633 verbose headers date: 'Mon, 11 Apr 2016 06:13:51 GMT', +633 verbose headers connection: 'keep-alive' } +634 silly get cb [ 304, +634 silly get { 'x-powered-by': 'Sinopia/1.4.0', +634 silly get etag: '"e3f8e00333e08a64e20afcf8bdece438"', +634 silly get 'x-status-cat': 'http://flic.kr/p/aXY3dH', +634 silly get date: 'Mon, 11 Apr 2016 06:13:51 GMT', +634 silly get connection: 'keep-alive' } ] +635 verbose etag http://172.23.238.253:4873/minimist from cache +636 verbose get saving minimist to /home/vagrant/.npm/172.23.238.253_4873/minimist/.cache.json +637 verbose correctMkdir /home/vagrant/.npm correctMkdir not in flight; initializing +638 silly resolveWithNewModule minimist@0.0.8 checking installable status +639 silly cache add args [ 'minimist@0.0.8', null ] +640 verbose cache add spec minimist@0.0.8 +641 silly cache add parsed spec Result { +641 silly cache add raw: 'minimist@0.0.8', +641 silly cache add scope: null, +641 silly cache add name: 'minimist', +641 silly cache add rawSpec: '0.0.8', +641 silly cache add spec: '0.0.8', +641 silly cache add type: 'version' } +642 silly addNamed minimist@0.0.8 +643 verbose addNamed "0.0.8" is a plain semver version for minimist +644 silly mapToRegistry name minimist +645 silly mapToRegistry using default registry +646 silly mapToRegistry registry http://172.23.238.253:4873/ +647 silly mapToRegistry uri http://172.23.238.253:4873/minimist +648 verbose addNameVersion registry:http://172.23.238.253:4873/minimist not in flight; fetching +649 verbose get http://172.23.238.253:4873/minimist not expired, no request +650 silly cache afterAdd minimist@0.0.8 +651 verbose afterAdd /home/vagrant/.npm/minimist/0.0.8/package/package.json not in flight; writing +652 verbose correctMkdir /home/vagrant/.npm correctMkdir not in flight; initializing +653 verbose afterAdd /home/vagrant/.npm/minimist/0.0.8/package/package.json written +654 silly loadAllDepsIntoIdealTree Finishing +655 silly idealTree:prePrune lib +655 silly idealTree:prePrune └─┬ mocha@2.4.5 +655 silly idealTree:prePrune ├── commander@2.3.0 +655 silly idealTree:prePrune ├── debug@2.2.0 +655 silly idealTree:prePrune ├── diff@1.4.0 +655 silly idealTree:prePrune ├── escape-string-regexp@1.0.2 +655 silly idealTree:prePrune ├── glob@3.2.3 +655 silly idealTree:prePrune ├── graceful-fs@2.0.3 +655 silly idealTree:prePrune ├── growl@1.8.1 +655 silly idealTree:prePrune ├── inherits@2.0.1 +655 silly idealTree:prePrune ├─┬ jade@0.26.3 +655 silly idealTree:prePrune │ ├── commander@0.6.1 +655 silly idealTree:prePrune │ └── mkdirp@0.3.0 +655 silly idealTree:prePrune ├── lru-cache@2.7.3 +655 silly idealTree:prePrune ├── minimatch@0.2.14 +655 silly idealTree:prePrune ├── minimist@0.0.8 +655 silly idealTree:prePrune ├── mkdirp@0.5.1 +655 silly idealTree:prePrune ├── ms@0.7.1 +655 silly idealTree:prePrune ├── sigmund@1.0.1 +655 silly idealTree:prePrune └── supports-color@1.2.0 +656 silly loadIdealTree Finishing +657 silly currentTree lib +658 silly idealTree lib +658 silly idealTree └─┬ mocha@2.4.5 +658 silly idealTree ├── commander@2.3.0 +658 silly idealTree ├── debug@2.2.0 +658 silly idealTree ├── diff@1.4.0 +658 silly idealTree ├── escape-string-regexp@1.0.2 +658 silly idealTree ├── glob@3.2.3 +658 silly idealTree ├── graceful-fs@2.0.3 +658 silly idealTree ├── growl@1.8.1 +658 silly idealTree ├── inherits@2.0.1 +658 silly idealTree ├─┬ jade@0.26.3 +658 silly idealTree │ ├── commander@0.6.1 +658 silly idealTree │ └── mkdirp@0.3.0 +658 silly idealTree ├── lru-cache@2.7.3 +658 silly idealTree ├── minimatch@0.2.14 +658 silly idealTree ├── minimist@0.0.8 +658 silly idealTree ├── mkdirp@0.5.1 +658 silly idealTree ├── ms@0.7.1 +658 silly idealTree ├── sigmund@1.0.1 +658 silly idealTree └── supports-color@1.2.0 +659 silly generateActionsToTake Starting +660 silly install generateActionsToTake +661 warn checkPermissions Missing write access to /usr/lib/node_modules +662 silly rollbackFailedOptional Starting +663 silly rollbackFailedOptional Finishing +664 silly runTopLevelLifecycles Starting +665 silly runTopLevelLifecycles Finishing +666 silly install printInstalled +667 verbose stack Error: EACCES: permission denied, access '/usr/lib/node_modules' +667 verbose stack at Error (native) +668 verbose cwd /vagrant/LogAggregator-4 +669 error Linux 4.2.0-22-generic +670 error argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "mocha" "--no-bin-link" +671 error node v5.7.1 +672 error npm v3.6.0 +673 error path /usr/lib/node_modules +674 error code EACCES +675 error errno -13 +676 error syscall access +677 error Error: EACCES: permission denied, access '/usr/lib/node_modules' +677 error at Error (native) +677 error { [Error: EACCES: permission denied, access '/usr/lib/node_modules'] +677 error errno: -13, +677 error code: 'EACCES', +677 error syscall: 'access', +677 error path: '/usr/lib/node_modules' } +678 error Please try running this command again as root/Administrator. +679 verbose exit [ -13, true ] diff --git a/output b/output new file mode 100644 index 0000000..e69de29 diff --git a/package.json b/package.json index 6a36691..a31f3a5 100644 --- a/package.json +++ b/package.json @@ -13,10 +13,15 @@ "express": "~4.13.1", "express-session": "^1.13.0", "formidable": "^1.0.17", + "highland": "^2.7.2", "html": "0.0.10", "jade": "~1.11.0", "mongoose": "^4.4.7", "morgan": "~1.6.1", - "serve-favicon": "~2.3.0" + "serve-favicon": "~2.3.0", + "sift": "^3.2.1" + }, + "devDependencies": { + "should": "^8.3.0" } } diff --git a/public/angular.min.js b/public/angular.min.js new file mode 100644 index 0000000..b4f9b07 --- /dev/null +++ b/public/angular.min.js @@ -0,0 +1,295 @@ +/* + AngularJS v1.4.8 + (c) 2010-2015 Google, Inc. http://angularjs.org + License: MIT +*/ +(function(S,X,u){'use strict';function G(a){return function(){var b=arguments[0],d;d="["+(a?a+":":"")+b+"] http://errors.angularjs.org/1.4.8/"+(a?a+"/":"")+b;for(b=1;b").append(a).html();try{return a[0].nodeType===Na?F(d):d.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+F(b)})}catch(c){return F(d)}}function wc(a){try{return decodeURIComponent(a)}catch(b){}} +function xc(a){var b={};n((a||"").split("&"),function(a){var c,e,f;a&&(e=a=a.replace(/\+/g,"%20"),c=a.indexOf("="),-1!==c&&(e=a.substring(0,c),f=a.substring(c+1)),e=wc(e),y(e)&&(f=y(f)?wc(f):!0,qa.call(b,e)?I(b[e])?b[e].push(f):b[e]=[b[e],f]:b[e]=f))});return b}function Qb(a){var b=[];n(a,function(a,c){I(a)?n(a,function(a){b.push(ja(c,!0)+(!0===a?"":"="+ja(a,!0)))}):b.push(ja(c,!0)+(!0===a?"":"="+ja(a,!0)))});return b.length?b.join("&"):""}function ob(a){return ja(a,!0).replace(/%26/gi,"&").replace(/%3D/gi, +"=").replace(/%2B/gi,"+")}function ja(a,b){return encodeURIComponent(a).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,b?"%20":"+")}function Yd(a,b){var d,c,e=Oa.length;for(c=0;c/,">"));}b=b||[];b.unshift(["$provide",function(b){b.value("$rootElement",a)}]);d.debugInfoEnabled&&b.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]);b.unshift("ng");c=eb(b,d.strictDi);c.invoke(["$rootScope", +"$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;S&&e.test(S.name)&&(d.debugInfoEnabled=!0,S.name=S.name.replace(e,""));if(S&&!f.test(S.name))return c();S.name=S.name.replace(f,"");fa.resumeBootstrap=function(a){n(a,function(a){b.push(a)});return c()};z(fa.resumeDeferredBootstrap)&&fa.resumeDeferredBootstrap()}function $d(){S.name="NG_ENABLE_DEBUG_INFO!"+S.name;S.location.reload()} +function ae(a){a=fa.element(a).injector();if(!a)throw Aa("test");return a.get("$$testability")}function zc(a,b){b=b||"_";return a.replace(be,function(a,c){return(c?b:"")+a.toLowerCase()})}function ce(){var a;if(!Ac){var b=pb();(oa=q(b)?S.jQuery:b?S[b]:u)&&oa.fn.on?(B=oa,M(oa.fn,{scope:Pa.scope,isolateScope:Pa.isolateScope,controller:Pa.controller,injector:Pa.injector,inheritedData:Pa.inheritedData}),a=oa.cleanData,oa.cleanData=function(b){var c;if(Rb)Rb=!1;else for(var e=0,f;null!=(f=b[e]);e++)(c= +oa._data(f,"events"))&&c.$destroy&&oa(f).triggerHandler("$destroy");a(b)}):B=N;fa.element=B;Ac=!0}}function qb(a,b,d){if(!a)throw Aa("areq",b||"?",d||"required");return a}function Qa(a,b,d){d&&I(a)&&(a=a[a.length-1]);qb(z(a),b,"not a function, got "+(a&&"object"===typeof a?a.constructor.name||"Object":typeof a));return a}function Ra(a,b){if("hasOwnProperty"===a)throw Aa("badname",b);}function Bc(a,b,d){if(!b)return a;b=b.split(".");for(var c,e=a,f=b.length,g=0;g")+c[2];for(c=c[0];c--;)d=d.lastChild;f=cb(f,d.childNodes);d=e.firstChild;d.textContent=""}else f.push(b.createTextNode(a));e.textContent="";e.innerHTML="";n(f,function(a){e.appendChild(a)});return e}function N(a){if(a instanceof N)return a;var b;E(a)&&(a=U(a), +b=!0);if(!(this instanceof N)){if(b&&"<"!=a.charAt(0))throw Ub("nosel");return new N(a)}if(b){b=X;var d;a=(d=Ef.exec(a))?[b.createElement(d[1])]:(d=Lc(a,b))?d.childNodes:[]}Mc(this,a)}function Vb(a){return a.cloneNode(!0)}function ub(a,b){b||vb(a);if(a.querySelectorAll)for(var d=a.querySelectorAll("*"),c=0,e=d.length;cl&&this.remove(t.key);return b}},get:function(a){if(l").parent()[0])});var f=O(a,b,a,c,d,e);K.$$addScopeClass(a);var g=null;return function(b,c,d){qb(b,"scope");e&&e.needsNewScope&&(b=b.$parent.$new());d=d||{};var h=d.parentBoundTranscludeFn,k=d.transcludeControllers;d=d.futureParentElement;h&&h.$$boundTransclude&&(h=h.$$boundTransclude);g||(g=(d= +d&&d[0])?"foreignobject"!==ta(d)&&d.toString().match(/SVG/)?"svg":"html":"html");d="html"!==g?B(Yb(g,B("
").append(a).html())):c?Pa.clone.call(a):a;if(k)for(var l in k)d.data("$"+l+"Controller",k[l].instance);K.$$addScopeInfo(d,b);c&&c(d,b);f&&f(b,d,d,h);return d}}function O(a,b,c,d,e,f){function g(a,c,d,e){var f,k,l,m,t,w,D;if(p)for(D=Array(c.length),m=0;mq.priority)break;if(P=q.scope)q.templateUrl||(H(P)?(Ua("new/isolated scope",O||R,q,Z),O=q):Ua("new/isolated scope",O,q,Z)),R=R||q;x=q.name;!q.templateUrl&&q.controller&&(P=q.controller,T=T||$(),Ua("'"+x+"' controller",T[x],q,Z),T[x]=q);if(P=q.transclude)ga=!0,q.$$tlb||(Ua("transclusion",n,q,Z),n=q),"element"==P?(aa=!0,A=q.priority,P=Z,Z=d.$$element=B(X.createComment(" "+x+": "+d[x]+" ")),b=Z[0],Y(f,ra.call(P,0), +b),Ia=K(P,e,A,g&&g.name,{nonTlbTranscludeDirective:n})):(P=B(Vb(b)).contents(),Z.empty(),Ia=K(P,e,u,u,{needsNewScope:q.$$isolateScope||q.$$newScope}));if(q.template)if(L=!0,Ua("template",J,q,Z),J=q,P=z(q.template)?q.template(Z,d):q.template,P=ja(P),q.replace){g=q;P=Tb.test(P)?Xc(Yb(q.templateNamespace,U(P))):[];b=P[0];if(1!=P.length||1!==b.nodeType)throw ha("tplrt",x,"");Y(f,Z,b);P={$attr:{}};var Wc=V(b,[],P),W=a.splice(F+1,a.length-(F+1));(O||R)&&y(Wc,O,R);a=a.concat(Wc).concat(W);S(d,P);M=a.length}else Z.html(P); +if(q.templateUrl)L=!0,Ua("template",J,q,Z),J=q,q.replace&&(g=q),D=Of(a.splice(F,a.length-F),Z,d,f,ga&&Ia,h,l,{controllerDirectives:T,newScopeDirective:R!==q&&R,newIsolateScopeDirective:O,templateDirective:J,nonTlbTranscludeDirective:n}),M=a.length;else if(q.compile)try{G=q.compile(Z,d,Ia),z(G)?t(null,G,N,Q):G&&t(G.pre,G.post,N,Q)}catch(da){c(da,ua(Z))}q.terminal&&(D.terminal=!0,A=Math.max(A,q.priority))}D.scope=R&&!0===R.scope;D.transcludeOnThisElement=ga;D.templateOnThisElement=L;D.transclude=Ia; +m.hasElementTranscludeDirective=aa;return D}function y(a,b,c){for(var d=0,e=a.length;dm.priority)&&-1!=m.restrict.indexOf(f)&&(k&&(m=Ob(m,{$$start:k,$$end:l})),b.push(m),h=m)}catch(D){c(D)}}return h}function G(b){if(e.hasOwnProperty(b))for(var c=a.get(b+"Directive"),d=0,f=c.length;d"+b+"";return c.childNodes[0].childNodes;default:return b}}function Q(a,b){if("srcdoc"==b)return L.HTML;var c=ta(a);if("xlinkHref"==b||"form"==c&&"action"==b||"img"!=c&&("src"==b||"ngSrc"==b))return L.RESOURCE_URL}function W(a,c,d,e,f){var g=Q(a,e);f=h[e]||f;var k=b(d,!0,g,f);if(k){if("multiple"===e&&"select"===ta(a))throw ha("selmulti",ua(a));c.push({priority:100,compile:function(){return{pre:function(a,c,h){c=h.$$observers||(h.$$observers=$());if(l.test(e))throw ha("nodomevents"); +var m=h[e];m!==d&&(k=m&&b(m,!0,g,f),d=m);k&&(h[e]=k(a),(c[e]||(c[e]=[])).$$inter=!0,(h.$$observers&&h.$$observers[e].$$scope||a).$watch(k,function(a,b){"class"===e&&a!=b?h.$updateClass(a,b):h.$set(e,a)}))}}}})}}function Y(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,h;if(a)for(g=0,h=a.length;g=b)return a;for(;b--;)8===a[b].nodeType&&Pf.call(a,b,1);return a}function Xe(){var a={},b=!1;this.register=function(b,c){Ra(b,"controller");H(b)?M(a,b):a[b]=c};this.allowGlobals=function(){b=!0};this.$get=["$injector","$window",function(d,c){function e(a,b,c,d){if(!a||!H(a.$scope))throw G("$controller")("noscp", +d,b);a.$scope[b]=c}return function(f,g,h,k){var l,m,r;h=!0===h;k&&E(k)&&(r=k);if(E(f)){k=f.match(Uc);if(!k)throw Qf("ctrlfmt",f);m=k[1];r=r||k[3];f=a.hasOwnProperty(m)?a[m]:Bc(g.$scope,m,!0)||(b?Bc(c,m,!0):u);Qa(f,m,!0)}if(h)return h=(I(f)?f[f.length-1]:f).prototype,l=Object.create(h||null),r&&e(g,r,l,m||f.name),M(function(){var a=d.invoke(f,l,g,m);a!==l&&(H(a)||z(a))&&(l=a,r&&e(g,r,l,m||f.name));return l},{instance:l,identifier:r});l=d.instantiate(f,g,m);r&&e(g,r,l,m||f.name);return l}}]}function Ye(){this.$get= +["$window",function(a){return B(a.document)}]}function Ze(){this.$get=["$log",function(a){return function(b,d){a.error.apply(a,arguments)}}]}function Zb(a){return H(a)?da(a)?a.toISOString():db(a):a}function df(){this.$get=function(){return function(a){if(!a)return"";var b=[];oc(a,function(a,c){null===a||q(a)||(I(a)?n(a,function(a,d){b.push(ja(c)+"="+ja(Zb(a)))}):b.push(ja(c)+"="+ja(Zb(a))))});return b.join("&")}}}function ef(){this.$get=function(){return function(a){function b(a,e,f){null===a||q(a)|| +(I(a)?n(a,function(a,c){b(a,e+"["+(H(a)?c:"")+"]")}):H(a)&&!da(a)?oc(a,function(a,c){b(a,e+(f?"":"[")+c+(f?"":"]"))}):d.push(ja(e)+"="+ja(Zb(a))))}if(!a)return"";var d=[];b(a,"",!0);return d.join("&")}}}function $b(a,b){if(E(a)){var d=a.replace(Rf,"").trim();if(d){var c=b("Content-Type");(c=c&&0===c.indexOf($c))||(c=(c=d.match(Sf))&&Tf[c[0]].test(d));c&&(a=uc(d))}}return a}function ad(a){var b=$(),d;E(a)?n(a.split("\n"),function(a){d=a.indexOf(":");var e=F(U(a.substr(0,d)));a=U(a.substr(d+1));e&& +(b[e]=b[e]?b[e]+", "+a:a)}):H(a)&&n(a,function(a,d){var f=F(d),g=U(a);f&&(b[f]=b[f]?b[f]+", "+g:g)});return b}function bd(a){var b;return function(d){b||(b=ad(a));return d?(d=b[F(d)],void 0===d&&(d=null),d):b}}function cd(a,b,d,c){if(z(c))return c(a,b,d);n(c,function(c){a=c(a,b,d)});return a}function cf(){var a=this.defaults={transformResponse:[$b],transformRequest:[function(a){return H(a)&&"[object File]"!==sa.call(a)&&"[object Blob]"!==sa.call(a)&&"[object FormData]"!==sa.call(a)?db(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"}, +post:ia(ac),put:ia(ac),patch:ia(ac)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer"},b=!1;this.useApplyAsync=function(a){return y(a)?(b=!!a,this):b};var d=!0;this.useLegacyPromiseExtensions=function(a){return y(a)?(d=!!a,this):d};var c=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector",function(e,f,g,h,k,l){function m(b){function c(a){var b=M({},a);b.data=cd(a.data,a.headers,a.status,f.transformResponse); +a=a.status;return 200<=a&&300>a?b:k.reject(b)}function e(a,b){var c,d={};n(a,function(a,e){z(a)?(c=a(b),null!=c&&(d[e]=c)):d[e]=a});return d}if(!fa.isObject(b))throw G("$http")("badreq",b);var f=M({method:"get",transformRequest:a.transformRequest,transformResponse:a.transformResponse,paramSerializer:a.paramSerializer},b);f.headers=function(b){var c=a.headers,d=M({},b.headers),f,g,h,c=M({},c.common,c[F(b.method)]);a:for(f in c){g=F(f);for(h in d)if(F(h)===g)continue a;d[f]=c[f]}return e(d,ia(b))}(b); +f.method=sb(f.method);f.paramSerializer=E(f.paramSerializer)?l.get(f.paramSerializer):f.paramSerializer;var g=[function(b){var d=b.headers,e=cd(b.data,bd(d),u,b.transformRequest);q(e)&&n(d,function(a,b){"content-type"===F(b)&&delete d[b]});q(b.withCredentials)&&!q(a.withCredentials)&&(b.withCredentials=a.withCredentials);return r(b,e).then(c,c)},u],h=k.when(f);for(n(v,function(a){(a.request||a.requestError)&&g.unshift(a.request,a.requestError);(a.response||a.responseError)&&g.push(a.response,a.responseError)});g.length;){b= +g.shift();var m=g.shift(),h=h.then(b,m)}d?(h.success=function(a){Qa(a,"fn");h.then(function(b){a(b.data,b.status,b.headers,f)});return h},h.error=function(a){Qa(a,"fn");h.then(null,function(b){a(b.data,b.status,b.headers,f)});return h}):(h.success=dd("success"),h.error=dd("error"));return h}function r(c,d){function g(a,c,d,e){function f(){l(c,a,d,e)}J&&(200<=a&&300>a?J.put(R,[a,c,ad(d),e]):J.remove(R));b?h.$applyAsync(f):(f(),h.$$phase||h.$apply())}function l(a,b,d,e){b=-1<=b?b:0;(200<=b&&300>b?n.resolve: +n.reject)({data:a,status:b,headers:bd(d),config:c,statusText:e})}function r(a){l(a.data,a.status,ia(a.headers()),a.statusText)}function v(){var a=m.pendingRequests.indexOf(c);-1!==a&&m.pendingRequests.splice(a,1)}var n=k.defer(),D=n.promise,J,K,O=c.headers,R=t(c.url,c.paramSerializer(c.params));m.pendingRequests.push(c);D.then(v,v);!c.cache&&!a.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(J=H(c.cache)?c.cache:H(a.cache)?a.cache:A);J&&(K=J.get(R),y(K)?K&&z(K.then)?K.then(r,r):I(K)?l(K[1], +K[0],ia(K[2]),K[3]):l(K,200,{},"OK"):J.put(R,D));q(K)&&((K=ed(c.url)?f()[c.xsrfCookieName||a.xsrfCookieName]:u)&&(O[c.xsrfHeaderName||a.xsrfHeaderName]=K),e(c.method,R,d,g,O,c.timeout,c.withCredentials,c.responseType));return D}function t(a,b){0=k&&(p.resolve(v),A(C.$$intervalId),delete f[C.$$intervalId]);n||a.$apply()},h);f[C.$$intervalId]=p;return C}var f={};e.cancel=function(a){return a&&a.$$intervalId in f?(f[a.$$intervalId].reject("canceled"),b.clearInterval(a.$$intervalId),delete f[a.$$intervalId],!0):!1};return e}]}function bc(a){a=a.split("/");for(var b=a.length;b--;)a[b]=ob(a[b]);return a.join("/")}function fd(a,b){var d=wa(a);b.$$protocol=d.protocol;b.$$host=d.hostname;b.$$port=ea(d.port)||Vf[d.protocol]|| +null}function gd(a,b){var d="/"!==a.charAt(0);d&&(a="/"+a);var c=wa(a);b.$$path=decodeURIComponent(d&&"/"===c.pathname.charAt(0)?c.pathname.substring(1):c.pathname);b.$$search=xc(c.search);b.$$hash=decodeURIComponent(c.hash);b.$$path&&"/"!=b.$$path.charAt(0)&&(b.$$path="/"+b.$$path)}function pa(a,b){if(0===b.indexOf(a))return b.substr(a.length)}function Fa(a){var b=a.indexOf("#");return-1==b?a:a.substr(0,b)}function ib(a){return a.replace(/(#.+)|#$/,"$1")}function cc(a,b,d){this.$$html5=!0;d=d||""; +fd(a,this);this.$$parse=function(a){var d=pa(b,a);if(!E(d))throw Db("ipthprfx",a,b);gd(d,this);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=Qb(this.$$search),d=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=bc(this.$$path)+(a?"?"+a:"")+d;this.$$absUrl=b+this.$$url.substr(1)};this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;y(f=pa(a,c))?(g=f,g=y(f=pa(d,f))?b+(pa("/",f)||f):a+g):y(f=pa(b,c))?g=b+f:b==c+"/"&&(g=b);g&&this.$$parse(g); +return!!g}}function dc(a,b,d){fd(a,this);this.$$parse=function(c){var e=pa(a,c)||pa(b,c),f;q(e)||"#"!==e.charAt(0)?this.$$html5?f=e:(f="",q(e)&&(a=c,this.replace())):(f=pa(d,e),q(f)&&(f=e));gd(f,this);c=this.$$path;var e=a,g=/^\/[A-Z]:(\/.*)/;0===f.indexOf(e)&&(f=f.replace(e,""));g.exec(f)||(c=(f=g.exec(c))?f[1]:c);this.$$path=c;this.$$compose()};this.$$compose=function(){var b=Qb(this.$$search),e=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=bc(this.$$path)+(b?"?"+b:"")+e;this.$$absUrl=a+(this.$$url? +d+this.$$url:"")};this.$$parseLinkUrl=function(b,d){return Fa(a)==Fa(b)?(this.$$parse(b),!0):!1}}function hd(a,b,d){this.$$html5=!0;dc.apply(this,arguments);this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;a==Fa(c)?f=c:(g=pa(b,c))?f=a+d+g:b===c+"/"&&(f=b);f&&this.$$parse(f);return!!f};this.$$compose=function(){var b=Qb(this.$$search),e=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=bc(this.$$path)+(b?"?"+b:"")+e;this.$$absUrl=a+d+this.$$url}}function Eb(a){return function(){return this[a]}} +function id(a,b){return function(d){if(q(d))return this[a];this[a]=b(d);this.$$compose();return this}}function hf(){var a="",b={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(b){return y(b)?(a=b,this):a};this.html5Mode=function(a){return $a(a)?(b.enabled=a,this):H(a)?($a(a.enabled)&&(b.enabled=a.enabled),$a(a.requireBase)&&(b.requireBase=a.requireBase),$a(a.rewriteLinks)&&(b.rewriteLinks=a.rewriteLinks),this):b};this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window", +function(d,c,e,f,g){function h(a,b,d){var e=l.url(),f=l.$$state;try{c.url(a,b,d),l.$$state=c.state()}catch(g){throw l.url(e),l.$$state=f,g;}}function k(a,b){d.$broadcast("$locationChangeSuccess",l.absUrl(),a,l.$$state,b)}var l,m;m=c.baseHref();var r=c.url(),t;if(b.enabled){if(!m&&b.requireBase)throw Db("nobase");t=r.substring(0,r.indexOf("/",r.indexOf("//")+2))+(m||"/");m=e.history?cc:hd}else t=Fa(r),m=dc;var A=t.substr(0,Fa(t).lastIndexOf("/")+1);l=new m(t,A,"#"+a);l.$$parseLinkUrl(r,r);l.$$state= +c.state();var v=/^\s*(javascript|mailto):/i;f.on("click",function(a){if(b.rewriteLinks&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&2!=a.which&&2!=a.button){for(var e=B(a.target);"a"!==ta(e[0]);)if(e[0]===f[0]||!(e=e.parent())[0])return;var h=e.prop("href"),k=e.attr("href")||e.attr("xlink:href");H(h)&&"[object SVGAnimatedString]"===h.toString()&&(h=wa(h.animVal).href);v.test(h)||!h||e.attr("target")||a.isDefaultPrevented()||!l.$$parseLinkUrl(h,k)||(a.preventDefault(),l.absUrl()!=c.url()&&(d.$apply(),g.angular["ff-684208-preventDefault"]= +!0))}});ib(l.absUrl())!=ib(r)&&c.url(l.absUrl(),!0);var n=!0;c.onUrlChange(function(a,b){q(pa(A,a))?g.location.href=a:(d.$evalAsync(function(){var c=l.absUrl(),e=l.$$state,f;a=ib(a);l.$$parse(a);l.$$state=b;f=d.$broadcast("$locationChangeStart",a,c,b,e).defaultPrevented;l.absUrl()===a&&(f?(l.$$parse(c),l.$$state=e,h(c,!1,e)):(n=!1,k(c,e)))}),d.$$phase||d.$digest())});d.$watch(function(){var a=ib(c.url()),b=ib(l.absUrl()),f=c.state(),g=l.$$replace,m=a!==b||l.$$html5&&e.history&&f!==l.$$state;if(n|| +m)n=!1,d.$evalAsync(function(){var b=l.absUrl(),c=d.$broadcast("$locationChangeStart",b,a,l.$$state,f).defaultPrevented;l.absUrl()===b&&(c?(l.$$parse(a),l.$$state=f):(m&&h(b,g,f===l.$$state?null:l.$$state),k(a,f)))});l.$$replace=!1});return l}]}function jf(){var a=!0,b=this;this.debugEnabled=function(b){return y(b)?(a=b,this):a};this.$get=["$window",function(d){function c(a){a instanceof Error&&(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&& +(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=d.console||{},e=b[a]||b.log||x;a=!1;try{a=!!e.apply}catch(k){}return a?function(){var a=[];n(arguments,function(b){a.push(c(b))});return e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){a&&c.apply(b,arguments)}}()}}]}function Va(a,b){if("__defineGetter__"===a||"__defineSetter__"===a||"__lookupGetter__"===a||"__lookupSetter__"=== +a||"__proto__"===a)throw ba("isecfld",b);return a}function jd(a,b){a+="";if(!E(a))throw ba("iseccst",b);return a}function xa(a,b){if(a){if(a.constructor===a)throw ba("isecfn",b);if(a.window===a)throw ba("isecwindow",b);if(a.children&&(a.nodeName||a.prop&&a.attr&&a.find))throw ba("isecdom",b);if(a===Object)throw ba("isecobj",b);}return a}function kd(a,b){if(a){if(a.constructor===a)throw ba("isecfn",b);if(a===Wf||a===Xf||a===Yf)throw ba("isecff",b);}}function ld(a,b){if(a&&(a===(0).constructor||a=== +(!1).constructor||a==="".constructor||a==={}.constructor||a===[].constructor||a===Function.constructor))throw ba("isecaf",b);}function Zf(a,b){return"undefined"!==typeof a?a:b}function md(a,b){return"undefined"===typeof a?b:"undefined"===typeof b?a:a+b}function W(a,b){var d,c;switch(a.type){case s.Program:d=!0;n(a.body,function(a){W(a.expression,b);d=d&&a.expression.constant});a.constant=d;break;case s.Literal:a.constant=!0;a.toWatch=[];break;case s.UnaryExpression:W(a.argument,b);a.constant=a.argument.constant; +a.toWatch=a.argument.toWatch;break;case s.BinaryExpression:W(a.left,b);W(a.right,b);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.left.toWatch.concat(a.right.toWatch);break;case s.LogicalExpression:W(a.left,b);W(a.right,b);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.constant?[]:[a];break;case s.ConditionalExpression:W(a.test,b);W(a.alternate,b);W(a.consequent,b);a.constant=a.test.constant&&a.alternate.constant&&a.consequent.constant;a.toWatch=a.constant?[]:[a];break;case s.Identifier:a.constant= +!1;a.toWatch=[a];break;case s.MemberExpression:W(a.object,b);a.computed&&W(a.property,b);a.constant=a.object.constant&&(!a.computed||a.property.constant);a.toWatch=[a];break;case s.CallExpression:d=a.filter?!b(a.callee.name).$stateful:!1;c=[];n(a.arguments,function(a){W(a,b);d=d&&a.constant;a.constant||c.push.apply(c,a.toWatch)});a.constant=d;a.toWatch=a.filter&&!b(a.callee.name).$stateful?c:[a];break;case s.AssignmentExpression:W(a.left,b);W(a.right,b);a.constant=a.left.constant&&a.right.constant; +a.toWatch=[a];break;case s.ArrayExpression:d=!0;c=[];n(a.elements,function(a){W(a,b);d=d&&a.constant;a.constant||c.push.apply(c,a.toWatch)});a.constant=d;a.toWatch=c;break;case s.ObjectExpression:d=!0;c=[];n(a.properties,function(a){W(a.value,b);d=d&&a.value.constant;a.value.constant||c.push.apply(c,a.value.toWatch)});a.constant=d;a.toWatch=c;break;case s.ThisExpression:a.constant=!1,a.toWatch=[]}}function nd(a){if(1==a.length){a=a[0].expression;var b=a.toWatch;return 1!==b.length?b:b[0]!==a?b:u}} +function od(a){return a.type===s.Identifier||a.type===s.MemberExpression}function pd(a){if(1===a.body.length&&od(a.body[0].expression))return{type:s.AssignmentExpression,left:a.body[0].expression,right:{type:s.NGValueParameter},operator:"="}}function qd(a){return 0===a.body.length||1===a.body.length&&(a.body[0].expression.type===s.Literal||a.body[0].expression.type===s.ArrayExpression||a.body[0].expression.type===s.ObjectExpression)}function rd(a,b){this.astBuilder=a;this.$filter=b}function sd(a, +b){this.astBuilder=a;this.$filter=b}function Fb(a){return"constructor"==a}function ec(a){return z(a.valueOf)?a.valueOf():$f.call(a)}function kf(){var a=$(),b=$();this.$get=["$filter",function(d){function c(a,b){return null==a||null==b?a===b:"object"===typeof a&&(a=ec(a),"object"===typeof a)?!1:a===b||a!==a&&b!==b}function e(a,b,d,e,f){var g=e.inputs,h;if(1===g.length){var k=c,g=g[0];return a.$watch(function(a){var b=g(a);c(b,k)||(h=e(a,u,u,[b]),k=b&&ec(b));return h},b,d,f)}for(var l=[],m=[],r=0,n= +g.length;r=this.promise.$$state.status&&d&&d.length&&a(function(){for(var a,e,f=0,g=d.length;fa)for(b in l++,f)qa.call(e,b)||(n--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$stateful=!0;var d=this,e,f,g,k=1n&&(v=4-n,q[v]||(q[v]=[]),q[v].push({msg:z(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):a.exp,newVal:f,oldVal:h}));else if(a===c){r=!1;break a}}catch(y){g(y)}if(!(l=A.$$watchersCount&&A.$$childHead||A!==this&&A.$$nextSibling))for(;A!==this&&!(l=A.$$nextSibling);)A=A.$parent}while(A=l);if((r||u.length)&&!n--)throw w.$$phase=null,d("infdig", +b,q);}while(r||u.length);for(w.$$phase=null;L.length;)try{L.shift()()}catch(x){g(x)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this===w&&k.$$applicationDestroyed();A(this,-this.$$watchersCount);for(var b in this.$$listenerCount)v(this,this.$$listenerCount[b],b);a&&a.$$childHead==this&&(a.$$childHead=this.$$nextSibling);a&&a.$$childTail==this&&(a.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling= +this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling);this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=x;this.$on=this.$watch=this.$watchGroup=function(){return x};this.$$listeners={};this.$$nextSibling=null;m(this)}},$eval:function(a,b){return h(a)(this,b)},$evalAsync:function(a,b){w.$$phase||u.length||k.defer(function(){u.length&&w.$digest()});u.push({scope:this,expression:a,locals:b})},$$postDigest:function(a){L.push(a)},$apply:function(a){try{t("$apply"); +try{return this.$eval(a)}finally{w.$$phase=null}}catch(b){g(b)}finally{try{w.$digest()}catch(c){throw g(c),c;}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&aa.push(b);C()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(c[d]=null,v(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,f=!1,h= +{name:a,targetScope:e,stopPropagation:function(){f=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},k=cb([h],arguments,1),l,m;do{d=e.$$listeners[a]||c;h.currentScope=e;l=0;for(m=d.length;lHa)throw ya("iequirks");var c=ia(la);c.isEnabled=function(){return a};c.trustAs=d.trustAs;c.getTrusted=d.getTrusted;c.valueOf=d.valueOf;a||(c.trustAs=c.getTrusted=function(a,b){return b},c.valueOf=Ya);c.parseAs=function(a,d){var e=b(d);return e.literal&&e.constant?e:b(d,function(b){return c.getTrusted(a,b)})};var e=c.parseAs,f=c.getTrusted,g=c.trustAs;n(la,function(a, +b){var d=F(b);c[fb("parse_as_"+d)]=function(b){return e(a,b)};c[fb("get_trusted_"+d)]=function(b){return f(a,b)};c[fb("trust_as_"+d)]=function(b){return g(a,b)}});return c}]}function qf(){this.$get=["$window","$document",function(a,b){var d={},c=ea((/android (\d+)/.exec(F((a.navigator||{}).userAgent))||[])[1]),e=/Boxee/i.test((a.navigator||{}).userAgent),f=b[0]||{},g,h=/^(Moz|webkit|ms)(?=[A-Z])/,k=f.body&&f.body.style,l=!1,m=!1;if(k){for(var r in k)if(l=h.exec(r)){g=l[0];g=g.substr(0,1).toUpperCase()+ +g.substr(1);break}g||(g="WebkitOpacity"in k&&"webkit");l=!!("transition"in k||g+"Transition"in k);m=!!("animation"in k||g+"Animation"in k);!c||l&&m||(l=E(k.webkitTransition),m=E(k.webkitAnimation))}return{history:!(!a.history||!a.history.pushState||4>c||e),hasEvent:function(a){if("input"===a&&11>=Ha)return!1;if(q(d[a])){var b=f.createElement("div");d[a]="on"+a in b}return d[a]},csp:Ba(),vendorPrefix:g,transitions:l,animations:m,android:c}}]}function sf(){this.$get=["$templateCache","$http","$q","$sce", +function(a,b,d,c){function e(f,g){e.totalPendingRequests++;E(f)&&a.get(f)||(f=c.getTrustedResourceUrl(f));var h=b.defaults&&b.defaults.transformResponse;I(h)?h=h.filter(function(a){return a!==$b}):h===$b&&(h=null);return b.get(f,{cache:a,transformResponse:h})["finally"](function(){e.totalPendingRequests--}).then(function(b){a.put(f,b.data);return b.data},function(a){if(!g)throw ha("tpload",f,a.status,a.statusText);return d.reject(a)})}e.totalPendingRequests=0;return e}]}function tf(){this.$get=["$rootScope", +"$browser","$location",function(a,b,d){return{findBindings:function(a,b,d){a=a.getElementsByClassName("ng-binding");var g=[];n(a,function(a){var c=fa.element(a).data("$binding");c&&n(c,function(c){d?(new RegExp("(^|\\s)"+ud(b)+"(\\s|\\||$)")).test(c)&&g.push(a):-1!=c.indexOf(b)&&g.push(a)})});return g},findModels:function(a,b,d){for(var g=["ng-","data-ng-","ng\\:"],h=0;ha;a=Math.abs(a);var g=Infinity===a;if(!g&&!isFinite(a))return"";var h=a+"",k="",l=!1,m=[];g&&(k="\u221e");if(!g&&-1!==h.indexOf("e")){var r=h.match(/([\d\.]+)e(-?)(\d+)/);r&&"-"==r[2]&&r[3]>e+1?a=0:(k=h,l=!0)}if(g||l)0a&&(k=a.toFixed(e),a=parseFloat(k),k=k.replace(ic,c));else{g=(h.split(ic)[1]||"").length; +q(e)&&(e=Math.min(Math.max(b.minFrac,g),b.maxFrac));a=+(Math.round(+(a.toString()+"e"+e)).toString()+"e"+-e);var g=(""+a).split(ic),h=g[0],g=g[1]||"",r=0,t=b.lgSize,n=b.gSize;if(h.length>=t+n)for(r=h.length-t,l=0;la&&(c="-",a=-a);for(a=""+a;a.length-d)e+=d;0===e&&-12==d&&(e=12);return Gb(e,b,c)}}function Hb(a,b){return function(d,c){var e=d["get"+a](),f=sb(b?"SHORT"+a:a);return c[f][e]}}function Dd(a){var b=(new Date(a,0,1)).getDay();return new Date(a,0,(4>=b?5:12)-b)}function Ed(a){return function(b){var d=Dd(b.getFullYear());b=+new Date(b.getFullYear(),b.getMonth(),b.getDate()+(4-b.getDay()))- ++d;b=1+Math.round(b/6048E5);return Gb(b,a)}}function jc(a,b){return 0>=a.getFullYear()?b.ERAS[0]:b.ERAS[1]}function zd(a){function b(a){var b;if(b=a.match(d)){a=new Date(0);var f=0,g=0,h=b[8]?a.setUTCFullYear:a.setFullYear,k=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=ea(b[9]+b[10]),g=ea(b[9]+b[11]));h.call(a,ea(b[1]),ea(b[2])-1,ea(b[3]));f=ea(b[4]||0)-f;g=ea(b[5]||0)-g;h=ea(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));k.call(a,f,g,h,b)}return a}var d=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/; +return function(c,d,f){var g="",h=[],k,l;d=d||"mediumDate";d=a.DATETIME_FORMATS[d]||d;E(c)&&(c=hg.test(c)?ea(c):b(c));Q(c)&&(c=new Date(c));if(!da(c)||!isFinite(c.getTime()))return c;for(;d;)(l=ig.exec(d))?(h=cb(h,l,1),d=h.pop()):(h.push(d),d=null);var m=c.getTimezoneOffset();f&&(m=vc(f,c.getTimezoneOffset()),c=Pb(c,f,!0));n(h,function(b){k=jg[b];g+=k?k(c,a.DATETIME_FORMATS,m):b.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function cg(){return function(a,b){q(b)&&(b=2);return db(a,b)}}function dg(){return function(a, +b,d){b=Infinity===Math.abs(Number(b))?Number(b):ea(b);if(isNaN(b))return a;Q(a)&&(a=a.toString());if(!I(a)&&!E(a))return a;d=!d||isNaN(d)?0:ea(d);d=0>d?Math.max(0,a.length+d):d;return 0<=b?a.slice(d,d+b):0===d?a.slice(b,a.length):a.slice(Math.max(0,d+b),d)}}function Bd(a){function b(b,d){d=d?-1:1;return b.map(function(b){var c=1,h=Ya;if(z(b))h=b;else if(E(b)){if("+"==b.charAt(0)||"-"==b.charAt(0))c="-"==b.charAt(0)?-1:1,b=b.substring(1);if(""!==b&&(h=a(b),h.constant))var k=h(),h=function(a){return a[k]}}return{get:h, +descending:c*d}})}function d(a){switch(typeof a){case "number":case "boolean":case "string":return!0;default:return!1}}return function(a,e,f){if(!za(a))return a;I(e)||(e=[e]);0===e.length&&(e=["+"]);var g=b(e,f);g.push({get:function(){return{}},descending:f?-1:1});a=Array.prototype.map.call(a,function(a,b){return{value:a,predicateValues:g.map(function(c){var e=c.get(a);c=typeof e;if(null===e)c="string",e="null";else if("string"===c)e=e.toLowerCase();else if("object"===c)a:{if("function"===typeof e.valueOf&& +(e=e.valueOf(),d(e)))break a;if(qc(e)&&(e=e.toString(),d(e)))break a;e=b}return{value:e,type:c}})}});a.sort(function(a,b){for(var c=0,d=0,e=g.length;db||37<=b&&40>=b||m(a,this,this.value)});if(e.hasEvent("paste"))b.on("paste cut", +m)}b.on("change",k);c.$render=function(){var a=c.$isEmpty(c.$viewValue)?"":c.$viewValue;b.val()!==a&&b.val(a)}}function Kb(a,b){return function(d,c){var e,f;if(da(d))return d;if(E(d)){'"'==d.charAt(0)&&'"'==d.charAt(d.length-1)&&(d=d.substring(1,d.length-1));if(kg.test(d))return new Date(d);a.lastIndex=0;if(e=a.exec(d))return e.shift(),f=c?{yyyy:c.getFullYear(),MM:c.getMonth()+1,dd:c.getDate(),HH:c.getHours(),mm:c.getMinutes(),ss:c.getSeconds(),sss:c.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0, +mm:0,ss:0,sss:0},n(e,function(a,c){c=s};g.$observe("min",function(a){s=n(a);h.$validate()})}if(y(g.max)||g.ngMax){var p;h.$validators.max=function(a){return!r(a)||q(p)||d(a)<=p};g.$observe("max",function(a){p=n(a);h.$validate()})}}}function Hd(a,b,d,c){(c.$$hasNativeValidators=H(b[0].validity))&&c.$parsers.push(function(a){var c=b.prop("validity")||{}; +return c.badInput&&!c.typeMismatch?u:a})}function Id(a,b,d,c,e){if(y(c)){a=a(c);if(!a.constant)throw lb("constexpr",d,c);return a(b)}return e}function lc(a,b){a="ngClass"+a;return["$animate",function(d){function c(a,b){var c=[],d=0;a:for(;d(?:<\/\1>|)$/,Tb=/<|&#?\w+;/, +Cf=/<([\w:-]+)/,Df=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,ka={option:[1,'"],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ka.optgroup=ka.option;ka.tbody=ka.tfoot=ka.colgroup=ka.caption=ka.thead;ka.th=ka.td;var Kf=Node.prototype.contains||function(a){return!!(this.compareDocumentPosition(a)& +16)},Pa=N.prototype={ready:function(a){function b(){d||(d=!0,a())}var d=!1;"complete"===X.readyState?setTimeout(b):(this.on("DOMContentLoaded",b),N(S).on("load",b))},toString:function(){var a=[];n(this,function(b){a.push(""+b)});return"["+a.join(", ")+"]"},eq:function(a){return 0<=a?B(this[a]):B(this[this.length+a])},length:0,push:mg,sort:[].sort,splice:[].splice},Cb={};n("multiple selected checked disabled readOnly required open".split(" "),function(a){Cb[F(a)]=a});var Rc={};n("input select option textarea button form details".split(" "), +function(a){Rc[a]=!0});var Zc={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};n({data:Wb,removeData:vb,hasData:function(a){for(var b in gb[a.ng339])return!0;return!1}},function(a,b){N[b]=a});n({data:Wb,inheritedData:Bb,scope:function(a){return B.data(a,"$scope")||Bb(a.parentNode||a,["$isolateScope","$scope"])},isolateScope:function(a){return B.data(a,"$isolateScope")||B.data(a,"$isolateScopeNoTemplate")},controller:Oc,injector:function(a){return Bb(a, +"$injector")},removeAttr:function(a,b){a.removeAttribute(b)},hasClass:yb,css:function(a,b,d){b=fb(b);if(y(d))a.style[b]=d;else return a.style[b]},attr:function(a,b,d){var c=a.nodeType;if(c!==Na&&2!==c&&8!==c)if(c=F(b),Cb[c])if(y(d))d?(a[b]=!0,a.setAttribute(b,c)):(a[b]=!1,a.removeAttribute(c));else return a[b]||(a.attributes.getNamedItem(b)||x).specified?c:u;else if(y(d))a.setAttribute(b,d);else if(a.getAttribute)return a=a.getAttribute(b,2),null===a?u:a},prop:function(a,b,d){if(y(d))a[b]=d;else return a[b]}, +text:function(){function a(a,d){if(q(d)){var c=a.nodeType;return 1===c||c===Na?a.textContent:""}a.textContent=d}a.$dv="";return a}(),val:function(a,b){if(q(b)){if(a.multiple&&"select"===ta(a)){var d=[];n(a.options,function(a){a.selected&&d.push(a.value||a.text)});return 0===d.length?null:d}return a.value}a.value=b},html:function(a,b){if(q(b))return a.innerHTML;ub(a,!0);a.innerHTML=b},empty:Pc},function(a,b){N.prototype[b]=function(b,c){var e,f,g=this.length;if(a!==Pc&&q(2==a.length&&a!==yb&&a!==Oc? +b:c)){if(H(b)){for(e=0;e <= >= && || ! = |".split(" "),function(a){Lb[a]=!0});var sg={n:"\n",f:"\f",r:"\r", +t:"\t",v:"\v","'":"'",'"':'"'},fc=function(a){this.options=a};fc.prototype={constructor:fc,lex:function(a){this.text=a;this.index=0;for(this.tokens=[];this.index=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a|| +"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdent:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,b,d){d=d||this.index;b=y(b)?"s "+b+"-"+this.index+" ["+this.text.substring(b,d)+"]":" "+d;throw ba("lexerr",a,b,this.text);},readNumber:function(){for(var a="",b=this.index;this.index","<=",">=");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.additive()};return a},additive:function(){for(var a=this.multiplicative(),b;b=this.expect("+","-");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var a=this.unary(),b;b=this.expect("*","/","%");)a={type:s.BinaryExpression,operator:b.text, +left:a,right:this.unary()};return a},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:s.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.constants.hasOwnProperty(this.peek().text)?a=bb(this.constants[this.consume().text]):this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant(): +this.throwError("not a primary expression",this.peek());for(var b;b=this.expect("(","[",".");)"("===b.text?(a={type:s.CallExpression,callee:a,arguments:this.parseArguments()},this.consume(")")):"["===b.text?(a={type:s.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===b.text?a={type:s.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var b={type:s.CallExpression,callee:this.identifier(), +arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return b},parseArguments:function(){var a=[];if(")"!==this.peekToken().text){do a.push(this.expression());while(this.expect(","))}return a},identifier:function(){var a=this.consume();a.identifier||this.throwError("is not a valid identifier",a);return{type:s.Identifier,name:a.text}},constant:function(){return{type:s.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break; +a.push(this.expression())}while(this.expect(","))}this.consume("]");return{type:s.ArrayExpression,elements:a}},object:function(){var a=[],b;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;b={type:s.Property,kind:"init"};this.peek().constant?b.key=this.constant():this.peek().identifier?b.key=this.identifier():this.throwError("invalid key",this.peek());this.consume(":");b.value=this.expression();a.push(b)}while(this.expect(","))}this.consume("}");return{type:s.ObjectExpression,properties:a}}, +throwError:function(a,b){throw ba("syntax",b.text,a,b.index+1,this.text,this.text.substring(b.index));},consume:function(a){if(0===this.tokens.length)throw ba("ueoe",this.text);var b=this.expect(a);b||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return b},peekToken:function(){if(0===this.tokens.length)throw ba("ueoe",this.text);return this.tokens[0]},peek:function(a,b,d,c){return this.peekAhead(0,a,b,d,c)},peekAhead:function(a,b,d,c,e){if(this.tokens.length>a){a=this.tokens[a]; +var f=a.text;if(f===b||f===d||f===c||f===e||!(b||d||c||e))return a}return!1},expect:function(a,b,d,c){return(a=this.peek(a,b,d,c))?(this.tokens.shift(),a):!1},constants:{"true":{type:s.Literal,value:!0},"false":{type:s.Literal,value:!1},"null":{type:s.Literal,value:null},undefined:{type:s.Literal,value:u},"this":{type:s.ThisExpression}}};rd.prototype={compile:function(a,b){var d=this,c=this.astBuilder.ast(a);this.state={nextId:0,filters:{},expensiveChecks:b,fn:{vars:[],body:[],own:{}},assign:{vars:[], +body:[],own:{}},inputs:[]};W(c,d.$filter);var e="",f;this.stage="assign";if(f=pd(c))this.state.computing="assign",e=this.nextId(),this.recurse(f,e),this.return_(e),e="fn.assign="+this.generateFunction("assign","s,v,l");f=nd(c.body);d.stage="inputs";n(f,function(a,b){var c="fn"+b;d.state[c]={vars:[],body:[],own:{}};d.state.computing=c;var e=d.nextId();d.recurse(a,e);d.return_(e);d.state.inputs.push(c);a.watchId=b});this.state.computing="fn";this.stage="main";this.recurse(c);e='"'+this.USE+" "+this.STRICT+ +'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+e+this.watchFns()+"return fn;";e=(new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","getStringValue","ensureSafeAssignContext","ifDefined","plus","text",e))(this.$filter,Va,xa,kd,jd,ld,Zf,md,a);this.state=this.stage=u;e.literal=qd(c);e.constant=c.constant;return e},USE:"use",STRICT:"strict",watchFns:function(){var a=[],b=this.state.inputs,d=this;n(b,function(b){a.push("var "+b+"="+d.generateFunction(b, +"s"))});b.length&&a.push("fn.inputs=["+b.join(",")+"];");return a.join("")},generateFunction:function(a,b){return"function("+b+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],b=this;n(this.state.filters,function(d,c){a.push(d+"=$filter("+b.escape(c)+")")});return a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,b, +d,c,e,f){var g,h,k=this,l,m;c=c||x;if(!f&&y(a.watchId))b=b||this.nextId(),this.if_("i",this.lazyAssign(b,this.computedMember("i",a.watchId)),this.lazyRecurse(a,b,d,c,e,!0));else switch(a.type){case s.Program:n(a.body,function(b,c){k.recurse(b.expression,u,u,function(a){h=a});c!==a.body.length-1?k.current().body.push(h,";"):k.return_(h)});break;case s.Literal:m=this.escape(a.value);this.assign(b,m);c(m);break;case s.UnaryExpression:this.recurse(a.argument,u,u,function(a){h=a});m=a.operator+"("+this.ifDefined(h, +0)+")";this.assign(b,m);c(m);break;case s.BinaryExpression:this.recurse(a.left,u,u,function(a){g=a});this.recurse(a.right,u,u,function(a){h=a});m="+"===a.operator?this.plus(g,h):"-"===a.operator?this.ifDefined(g,0)+a.operator+this.ifDefined(h,0):"("+g+")"+a.operator+"("+h+")";this.assign(b,m);c(m);break;case s.LogicalExpression:b=b||this.nextId();k.recurse(a.left,b);k.if_("&&"===a.operator?b:k.not(b),k.lazyRecurse(a.right,b));c(b);break;case s.ConditionalExpression:b=b||this.nextId();k.recurse(a.test, +b);k.if_(b,k.lazyRecurse(a.alternate,b),k.lazyRecurse(a.consequent,b));c(b);break;case s.Identifier:b=b||this.nextId();d&&(d.context="inputs"===k.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",a.name)+"?l:s"),d.computed=!1,d.name=a.name);Va(a.name);k.if_("inputs"===k.stage||k.not(k.getHasOwnProperty("l",a.name)),function(){k.if_("inputs"===k.stage||"s",function(){e&&1!==e&&k.if_(k.not(k.nonComputedMember("s",a.name)),k.lazyAssign(k.nonComputedMember("s",a.name),"{}"));k.assign(b,k.nonComputedMember("s", +a.name))})},b&&k.lazyAssign(b,k.nonComputedMember("l",a.name)));(k.state.expensiveChecks||Fb(a.name))&&k.addEnsureSafeObject(b);c(b);break;case s.MemberExpression:g=d&&(d.context=this.nextId())||this.nextId();b=b||this.nextId();k.recurse(a.object,g,u,function(){k.if_(k.notNull(g),function(){if(a.computed)h=k.nextId(),k.recurse(a.property,h),k.getStringValue(h),k.addEnsureSafeMemberName(h),e&&1!==e&&k.if_(k.not(k.computedMember(g,h)),k.lazyAssign(k.computedMember(g,h),"{}")),m=k.ensureSafeObject(k.computedMember(g, +h)),k.assign(b,m),d&&(d.computed=!0,d.name=h);else{Va(a.property.name);e&&1!==e&&k.if_(k.not(k.nonComputedMember(g,a.property.name)),k.lazyAssign(k.nonComputedMember(g,a.property.name),"{}"));m=k.nonComputedMember(g,a.property.name);if(k.state.expensiveChecks||Fb(a.property.name))m=k.ensureSafeObject(m);k.assign(b,m);d&&(d.computed=!1,d.name=a.property.name)}},function(){k.assign(b,"undefined")});c(b)},!!e);break;case s.CallExpression:b=b||this.nextId();a.filter?(h=k.filter(a.callee.name),l=[],n(a.arguments, +function(a){var b=k.nextId();k.recurse(a,b);l.push(b)}),m=h+"("+l.join(",")+")",k.assign(b,m),c(b)):(h=k.nextId(),g={},l=[],k.recurse(a.callee,h,g,function(){k.if_(k.notNull(h),function(){k.addEnsureSafeFunction(h);n(a.arguments,function(a){k.recurse(a,k.nextId(),u,function(a){l.push(k.ensureSafeObject(a))})});g.name?(k.state.expensiveChecks||k.addEnsureSafeObject(g.context),m=k.member(g.context,g.name,g.computed)+"("+l.join(",")+")"):m=h+"("+l.join(",")+")";m=k.ensureSafeObject(m);k.assign(b,m)}, +function(){k.assign(b,"undefined")});c(b)}));break;case s.AssignmentExpression:h=this.nextId();g={};if(!od(a.left))throw ba("lval");this.recurse(a.left,u,g,function(){k.if_(k.notNull(g.context),function(){k.recurse(a.right,h);k.addEnsureSafeObject(k.member(g.context,g.name,g.computed));k.addEnsureSafeAssignContext(g.context);m=k.member(g.context,g.name,g.computed)+a.operator+h;k.assign(b,m);c(b||m)})},1);break;case s.ArrayExpression:l=[];n(a.elements,function(a){k.recurse(a,k.nextId(),u,function(a){l.push(a)})}); +m="["+l.join(",")+"]";this.assign(b,m);c(m);break;case s.ObjectExpression:l=[];n(a.properties,function(a){k.recurse(a.value,k.nextId(),u,function(b){l.push(k.escape(a.key.type===s.Identifier?a.key.name:""+a.key.value)+":"+b)})});m="{"+l.join(",")+"}";this.assign(b,m);c(m);break;case s.ThisExpression:this.assign(b,"s");c("s");break;case s.NGValueParameter:this.assign(b,"v"),c("v")}},getHasOwnProperty:function(a,b){var d=a+"."+b,c=this.current().own;c.hasOwnProperty(d)||(c[d]=this.nextId(!1,a+"&&("+ +this.escape(b)+" in "+a+")"));return c[d]},assign:function(a,b){if(a)return this.current().body.push(a,"=",b,";"),a},filter:function(a){this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0));return this.state.filters[a]},ifDefined:function(a,b){return"ifDefined("+a+","+this.escape(b)+")"},plus:function(a,b){return"plus("+a+","+b+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,b,d){if(!0===a)b();else{var c=this.current().body;c.push("if(",a, +"){");b();c.push("}");d&&(c.push("else{"),d(),c.push("}"))}},not:function(a){return"!("+a+")"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,b){return a+"."+b},computedMember:function(a,b){return a+"["+b+"]"},member:function(a,b,d){return d?this.computedMember(a,b):this.nonComputedMember(a,b)},addEnsureSafeObject:function(a){this.current().body.push(this.ensureSafeObject(a),";")},addEnsureSafeMemberName:function(a){this.current().body.push(this.ensureSafeMemberName(a),";")}, +addEnsureSafeFunction:function(a){this.current().body.push(this.ensureSafeFunction(a),";")},addEnsureSafeAssignContext:function(a){this.current().body.push(this.ensureSafeAssignContext(a),";")},ensureSafeObject:function(a){return"ensureSafeObject("+a+",text)"},ensureSafeMemberName:function(a){return"ensureSafeMemberName("+a+",text)"},ensureSafeFunction:function(a){return"ensureSafeFunction("+a+",text)"},getStringValue:function(a){this.assign(a,"getStringValue("+a+",text)")},ensureSafeAssignContext:function(a){return"ensureSafeAssignContext("+ +a+",text)"},lazyRecurse:function(a,b,d,c,e,f){var g=this;return function(){g.recurse(a,b,d,c,e,f)}},lazyAssign:function(a,b){var d=this;return function(){d.assign(a,b)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(E(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(Q(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if("undefined"=== +typeof a)return"undefined";throw ba("esc");},nextId:function(a,b){var d="v"+this.state.nextId++;a||this.current().vars.push(d+(b?"="+b:""));return d},current:function(){return this.state[this.state.computing]}};sd.prototype={compile:function(a,b){var d=this,c=this.astBuilder.ast(a);this.expression=a;this.expensiveChecks=b;W(c,d.$filter);var e,f;if(e=pd(c))f=this.recurse(e);e=nd(c.body);var g;e&&(g=[],n(e,function(a,b){var c=d.recurse(a);a.input=c;g.push(c);a.watchId=b}));var h=[];n(c.body,function(a){h.push(d.recurse(a.expression))}); +e=0===c.body.length?function(){}:1===c.body.length?h[0]:function(a,b){var c;n(h,function(d){c=d(a,b)});return c};f&&(e.assign=function(a,b,c){return f(a,c,b)});g&&(e.inputs=g);e.literal=qd(c);e.constant=c.constant;return e},recurse:function(a,b,d){var c,e,f=this,g;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case s.Literal:return this.value(a.value,b);case s.UnaryExpression:return e=this.recurse(a.argument),this["unary"+a.operator](e,b);case s.BinaryExpression:return c=this.recurse(a.left), +e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case s.LogicalExpression:return c=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case s.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),b);case s.Identifier:return Va(a.name,f.expression),f.identifier(a.name,f.expensiveChecks||Fb(a.name),b,d,f.expression);case s.MemberExpression:return c=this.recurse(a.object,!1,!!d),a.computed||(Va(a.property.name, +f.expression),e=a.property.name),a.computed&&(e=this.recurse(a.property)),a.computed?this.computedMember(c,e,b,d,f.expression):this.nonComputedMember(c,e,f.expensiveChecks,b,d,f.expression);case s.CallExpression:return g=[],n(a.arguments,function(a){g.push(f.recurse(a))}),a.filter&&(e=this.$filter(a.callee.name)),a.filter||(e=this.recurse(a.callee,!0)),a.filter?function(a,c,d,f){for(var r=[],n=0;n":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>b(c,e,f,g);return d?{value:c}:c}},"binary<=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)<=b(c,e,f,g);return d?{value:c}:c}},"binary>=":function(a,b,d){return function(c, +e,f,g){c=a(c,e,f,g)>=b(c,e,f,g);return d?{value:c}:c}},"binary&&":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)&&b(c,e,f,g);return d?{value:c}:c}},"binary||":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)||b(c,e,f,g);return d?{value:c}:c}},"ternary?:":function(a,b,d,c){return function(e,f,g,h){e=a(e,f,g,h)?b(e,f,g,h):d(e,f,g,h);return c?{value:e}:e}},value:function(a,b){return function(){return b?{context:u,name:u,value:a}:a}},identifier:function(a,b,d,c,e){return function(f,g,h,k){f= +g&&a in g?g:f;c&&1!==c&&f&&!f[a]&&(f[a]={});g=f?f[a]:u;b&&xa(g,e);return d?{context:f,name:a,value:g}:g}},computedMember:function(a,b,d,c,e){return function(f,g,h,k){var l=a(f,g,h,k),m,n;null!=l&&(m=b(f,g,h,k),m=jd(m),Va(m,e),c&&1!==c&&l&&!l[m]&&(l[m]={}),n=l[m],xa(n,e));return d?{context:l,name:m,value:n}:n}},nonComputedMember:function(a,b,d,c,e,f){return function(g,h,k,l){g=a(g,h,k,l);e&&1!==e&&g&&!g[b]&&(g[b]={});h=null!=g?g[b]:u;(d||Fb(b))&&xa(h,f);return c?{context:g,name:b,value:h}:h}},inputs:function(a, +b){return function(d,c,e,f){return f?f[b]:a(d,c,e)}}};var gc=function(a,b,d){this.lexer=a;this.$filter=b;this.options=d;this.ast=new s(this.lexer);this.astCompiler=d.csp?new sd(this.ast,b):new rd(this.ast,b)};gc.prototype={constructor:gc,parse:function(a){return this.astCompiler.compile(a,this.options.expensiveChecks)}};$();$();var $f=Object.prototype.valueOf,ya=G("$sce"),la={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},ha=G("$compile"),Y=X.createElement("a"),wd=wa(S.location.href); +xd.$inject=["$document"];Jc.$inject=["$provide"];yd.$inject=["$locale"];Ad.$inject=["$locale"];var ic=".",jg={yyyy:ca("FullYear",4),yy:ca("FullYear",2,0,!0),y:ca("FullYear",1),MMMM:Hb("Month"),MMM:Hb("Month",!0),MM:ca("Month",2,1),M:ca("Month",1,1),dd:ca("Date",2),d:ca("Date",1),HH:ca("Hours",2),H:ca("Hours",1),hh:ca("Hours",2,-12),h:ca("Hours",1,-12),mm:ca("Minutes",2),m:ca("Minutes",1),ss:ca("Seconds",2),s:ca("Seconds",1),sss:ca("Milliseconds",3),EEEE:Hb("Day"),EEE:Hb("Day",!0),a:function(a,b){return 12> +a.getHours()?b.AMPMS[0]:b.AMPMS[1]},Z:function(a,b,d){a=-1*d;return a=(0<=a?"+":"")+(Gb(Math[0=a.getFullYear()?b.ERANAMES[0]:b.ERANAMES[1]}},ig=/((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,hg=/^\-?\d+$/;zd.$inject=["$locale"];var eg=na(F),fg=na(sb);Bd.$inject=["$parse"];var he=na({restrict:"E",compile:function(a,b){if(!b.href&&!b.xlinkHref)return function(a, +b){if("a"===b[0].nodeName.toLowerCase()){var e="[object SVGAnimatedString]"===sa.call(b.prop("href"))?"xlink:href":"href";b.on("click",function(a){b.attr(e)||a.preventDefault()})}}}}),tb={};n(Cb,function(a,b){function d(a,d,e){a.$watch(e[c],function(a){e.$set(b,!!a)})}if("multiple"!=a){var c=va("ng-"+b),e=d;"checked"===a&&(e=function(a,b,e){e.ngModel!==e[c]&&d(a,b,e)});tb[c]=function(){return{restrict:"A",priority:100,link:e}}}});n(Zc,function(a,b){tb[b]=function(){return{priority:100,link:function(a, +c,e){if("ngPattern"===b&&"/"==e.ngPattern.charAt(0)&&(c=e.ngPattern.match(lg))){e.$set("ngPattern",new RegExp(c[1],c[2]));return}a.$watch(e[b],function(a){e.$set(b,a)})}}}});n(["src","srcset","href"],function(a){var b=va("ng-"+a);tb[b]=function(){return{priority:99,link:function(d,c,e){var f=a,g=a;"href"===a&&"[object SVGAnimatedString]"===sa.call(c.prop("href"))&&(g="xlinkHref",e.$attr[g]="xlink:href",f=null);e.$observe(b,function(b){b?(e.$set(g,b),Ha&&f&&c.prop(f,e[g])):"href"===a&&e.$set(g,null)})}}}}); +var Ib={$addControl:x,$$renameControl:function(a,b){a.$name=b},$removeControl:x,$setValidity:x,$setDirty:x,$setPristine:x,$setSubmitted:x};Fd.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var Nd=function(a){return["$timeout","$parse",function(b,d){function c(a){return""===a?d('this[""]').assign:d(a).assign||x}return{name:"form",restrict:a?"EAC":"E",require:["form","^^?form"],controller:Fd,compile:function(d,f){d.addClass(Wa).addClass(mb);var g=f.name?"name":a&&f.ngForm?"ngForm": +!1;return{pre:function(a,d,e,f){var n=f[0];if(!("action"in e)){var q=function(b){a.$apply(function(){n.$commitViewValue();n.$setSubmitted()});b.preventDefault()};d[0].addEventListener("submit",q,!1);d.on("$destroy",function(){b(function(){d[0].removeEventListener("submit",q,!1)},0,!1)})}(f[1]||n.$$parentForm).$addControl(n);var s=g?c(n.$name):x;g&&(s(a,n),e.$observe(g,function(b){n.$name!==b&&(s(a,u),n.$$parentForm.$$renameControl(n,b),s=c(n.$name),s(a,n))}));d.on("$destroy",function(){n.$$parentForm.$removeControl(n); +s(a,u);M(n,Ib)})}}}}}]},ie=Nd(),ve=Nd(!0),kg=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/,tg=/^[A-Za-z][A-Za-z\d.+-]*:\/*(?:\w+(?::\w+)?@)?[^\s/]+(?::\d+)?(?:\/[\w#!:.?+=&%@\-/]*)?$/,ug=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,vg=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,Od=/^(\d{4})-(\d{2})-(\d{2})$/,Pd=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,mc=/^(\d{4})-W(\d\d)$/,Qd=/^(\d{4})-(\d\d)$/, +Rd=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Sd={text:function(a,b,d,c,e,f){jb(a,b,d,c,e,f);kc(c)},date:kb("date",Od,Kb(Od,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":kb("datetimelocal",Pd,Kb(Pd,"yyyy MM dd HH mm ss sss".split(" ")),"yyyy-MM-ddTHH:mm:ss.sss"),time:kb("time",Rd,Kb(Rd,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:kb("week",mc,function(a,b){if(da(a))return a;if(E(a)){mc.lastIndex=0;var d=mc.exec(a);if(d){var c=+d[1],e=+d[2],f=d=0,g=0,h=0,k=Dd(c),e=7*(e-1);b&&(d=b.getHours(),f= +b.getMinutes(),g=b.getSeconds(),h=b.getMilliseconds());return new Date(c,0,k.getDate()+e,d,f,g,h)}}return NaN},"yyyy-Www"),month:kb("month",Qd,Kb(Qd,["yyyy","MM"]),"yyyy-MM"),number:function(a,b,d,c,e,f){Hd(a,b,d,c);jb(a,b,d,c,e,f);c.$$parserName="number";c.$parsers.push(function(a){return c.$isEmpty(a)?null:vg.test(a)?parseFloat(a):u});c.$formatters.push(function(a){if(!c.$isEmpty(a)){if(!Q(a))throw lb("numfmt",a);a=a.toString()}return a});if(y(d.min)||d.ngMin){var g;c.$validators.min=function(a){return c.$isEmpty(a)|| +q(g)||a>=g};d.$observe("min",function(a){y(a)&&!Q(a)&&(a=parseFloat(a,10));g=Q(a)&&!isNaN(a)?a:u;c.$validate()})}if(y(d.max)||d.ngMax){var h;c.$validators.max=function(a){return c.$isEmpty(a)||q(h)||a<=h};d.$observe("max",function(a){y(a)&&!Q(a)&&(a=parseFloat(a,10));h=Q(a)&&!isNaN(a)?a:u;c.$validate()})}},url:function(a,b,d,c,e,f){jb(a,b,d,c,e,f);kc(c);c.$$parserName="url";c.$validators.url=function(a,b){var d=a||b;return c.$isEmpty(d)||tg.test(d)}},email:function(a,b,d,c,e,f){jb(a,b,d,c,e,f);kc(c); +c.$$parserName="email";c.$validators.email=function(a,b){var d=a||b;return c.$isEmpty(d)||ug.test(d)}},radio:function(a,b,d,c){q(d.name)&&b.attr("name",++nb);b.on("click",function(a){b[0].checked&&c.$setViewValue(d.value,a&&a.type)});c.$render=function(){b[0].checked=d.value==c.$viewValue};d.$observe("value",c.$render)},checkbox:function(a,b,d,c,e,f,g,h){var k=Id(h,a,"ngTrueValue",d.ngTrueValue,!0),l=Id(h,a,"ngFalseValue",d.ngFalseValue,!1);b.on("click",function(a){c.$setViewValue(b[0].checked,a&& +a.type)});c.$render=function(){b[0].checked=c.$viewValue};c.$isEmpty=function(a){return!1===a};c.$formatters.push(function(a){return ma(a,k)});c.$parsers.push(function(a){return a?k:l})},hidden:x,button:x,submit:x,reset:x,file:x},Dc=["$browser","$sniffer","$filter","$parse",function(a,b,d,c){return{restrict:"E",require:["?ngModel"],link:{pre:function(e,f,g,h){h[0]&&(Sd[F(g.type)]||Sd.text)(e,f,g,h[0],b,a,d,c)}}}}],wg=/^(true|false|\d+)$/,Ne=function(){return{restrict:"A",priority:100,compile:function(a, +b){return wg.test(b.ngValue)?function(a,b,e){e.$set("value",a.$eval(e.ngValue))}:function(a,b,e){a.$watch(e.ngValue,function(a){e.$set("value",a)})}}}},ne=["$compile",function(a){return{restrict:"AC",compile:function(b){a.$$addBindingClass(b);return function(b,c,e){a.$$addBindingInfo(c,e.ngBind);c=c[0];b.$watch(e.ngBind,function(a){c.textContent=q(a)?"":a})}}}}],pe=["$interpolate","$compile",function(a,b){return{compile:function(d){b.$$addBindingClass(d);return function(c,d,f){c=a(d.attr(f.$attr.ngBindTemplate)); +b.$$addBindingInfo(d,c.expressions);d=d[0];f.$observe("ngBindTemplate",function(a){d.textContent=q(a)?"":a})}}}}],oe=["$sce","$parse","$compile",function(a,b,d){return{restrict:"A",compile:function(c,e){var f=b(e.ngBindHtml),g=b(e.ngBindHtml,function(a){return(a||"").toString()});d.$$addBindingClass(c);return function(b,c,e){d.$$addBindingInfo(c,e.ngBindHtml);b.$watch(g,function(){c.html(a.getTrustedHtml(f(b))||"")})}}}}],Me=na({restrict:"A",require:"ngModel",link:function(a,b,d,c){c.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}), +qe=lc("",!0),se=lc("Odd",0),re=lc("Even",1),te=La({compile:function(a,b){b.$set("ngCloak",u);a.removeClass("ng-cloak")}}),ue=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],Ic={},xg={blur:!0,focus:!0};n("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var b=va("ng-"+a);Ic[b]=["$parse","$rootScope",function(d,c){return{restrict:"A",compile:function(e,f){var g= +d(f[b],null,!0);return function(b,d){d.on(a,function(d){var e=function(){g(b,{$event:d})};xg[a]&&c.$$phase?b.$evalAsync(e):b.$apply(e)})}}}}]});var xe=["$animate",function(a){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(b,d,c,e,f){var g,h,k;b.$watch(c.ngIf,function(b){b?h||f(function(b,e){h=e;b[b.length++]=X.createComment(" end ngIf: "+c.ngIf+" ");g={clone:b};a.enter(b,d.parent(),d)}):(k&&(k.remove(),k=null),h&&(h.$destroy(),h=null),g&&(k= +rb(g.clone),a.leave(k).then(function(){k=null}),g=null))})}}}],ye=["$templateRequest","$anchorScroll","$animate",function(a,b,d){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:fa.noop,compile:function(c,e){var f=e.ngInclude||e.src,g=e.onload||"",h=e.autoscroll;return function(c,e,m,n,q){var s=0,v,u,p,C=function(){u&&(u.remove(),u=null);v&&(v.$destroy(),v=null);p&&(d.leave(p).then(function(){u=null}),u=p,p=null)};c.$watch(f,function(f){var m=function(){!y(h)||h&&!c.$eval(h)|| +b()},u=++s;f?(a(f,!0).then(function(a){if(u===s){var b=c.$new();n.template=a;a=q(b,function(a){C();d.enter(a,null,e).then(m)});v=b;p=a;v.$emit("$includeContentLoaded",f);c.$eval(g)}},function(){u===s&&(C(),c.$emit("$includeContentError",f))}),c.$emit("$includeContentRequested",f)):(C(),n.template=null)})}}}}],Pe=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(b,d,c,e){/SVG/.test(d[0].toString())?(d.empty(),a(Lc(e.template,X).childNodes)(b,function(a){d.append(a)}, +{futureParentElement:d})):(d.html(e.template),a(d.contents())(b))}}}],ze=La({priority:450,compile:function(){return{pre:function(a,b,d){a.$eval(d.ngInit)}}}}),Le=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,b,d,c){var e=b.attr(d.$attr.ngList)||", ",f="false"!==d.ngTrim,g=f?U(e):e;c.$parsers.push(function(a){if(!q(a)){var b=[];a&&n(a.split(g),function(a){a&&b.push(f?U(a):a)});return b}});c.$formatters.push(function(a){return I(a)?a.join(e):u});c.$isEmpty=function(a){return!a|| +!a.length}}}},mb="ng-valid",Jd="ng-invalid",Wa="ng-pristine",Jb="ng-dirty",Ld="ng-pending",lb=G("ngModel"),yg=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(a,b,d,c,e,f,g,h,k,l){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=u;this.$validators={};this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty=!1; +this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=u;this.$name=l(d.name||"",!1)(a);this.$$parentForm=Ib;var m=e(d.ngModel),r=m.assign,t=m,s=r,v=null,B,p=this;this.$$setOptions=function(a){if((p.$options=a)&&a.getterSetter){var b=e(d.ngModel+"()"),f=e(d.ngModel+"($$$p)");t=function(a){var c=m(a);z(c)&&(c=b(a));return c};s=function(a,b){z(m(a))?f(a,{$$$p:p.$modelValue}):r(a,p.$modelValue)}}else if(!m.assign)throw lb("nonassign",d.ngModel,ua(c));};this.$render=x;this.$isEmpty= +function(a){return q(a)||""===a||null===a||a!==a};var C=0;Gd({ctrl:this,$element:c,set:function(a,b){a[b]=!0},unset:function(a,b){delete a[b]},$animate:f});this.$setPristine=function(){p.$dirty=!1;p.$pristine=!0;f.removeClass(c,Jb);f.addClass(c,Wa)};this.$setDirty=function(){p.$dirty=!0;p.$pristine=!1;f.removeClass(c,Wa);f.addClass(c,Jb);p.$$parentForm.$setDirty()};this.$setUntouched=function(){p.$touched=!1;p.$untouched=!0;f.setClass(c,"ng-untouched","ng-touched")};this.$setTouched=function(){p.$touched= +!0;p.$untouched=!1;f.setClass(c,"ng-touched","ng-untouched")};this.$rollbackViewValue=function(){g.cancel(v);p.$viewValue=p.$$lastCommittedViewValue;p.$render()};this.$validate=function(){if(!Q(p.$modelValue)||!isNaN(p.$modelValue)){var a=p.$$rawModelValue,b=p.$valid,c=p.$modelValue,d=p.$options&&p.$options.allowInvalid;p.$$runValidators(a,p.$$lastCommittedViewValue,function(e){d||b===e||(p.$modelValue=e?a:u,p.$modelValue!==c&&p.$$writeModelToScope())})}};this.$$runValidators=function(a,b,c){function d(){var c= +!0;n(p.$validators,function(d,e){var g=d(a,b);c=c&&g;f(e,g)});return c?!0:(n(p.$asyncValidators,function(a,b){f(b,null)}),!1)}function e(){var c=[],d=!0;n(p.$asyncValidators,function(e,g){var h=e(a,b);if(!h||!z(h.then))throw lb("$asyncValidators",h);f(g,u);c.push(h.then(function(){f(g,!0)},function(a){d=!1;f(g,!1)}))});c.length?k.all(c).then(function(){g(d)},x):g(!0)}function f(a,b){h===C&&p.$setValidity(a,b)}function g(a){h===C&&c(a)}C++;var h=C;(function(){var a=p.$$parserName||"parse";if(q(B))f(a, +null);else return B||(n(p.$validators,function(a,b){f(b,null)}),n(p.$asyncValidators,function(a,b){f(b,null)})),f(a,B),B;return!0})()?d()?e():g(!1):g(!1)};this.$commitViewValue=function(){var a=p.$viewValue;g.cancel(v);if(p.$$lastCommittedViewValue!==a||""===a&&p.$$hasNativeValidators)p.$$lastCommittedViewValue=a,p.$pristine&&this.$setDirty(),this.$$parseAndValidate()};this.$$parseAndValidate=function(){var b=p.$$lastCommittedViewValue;if(B=q(b)?u:!0)for(var c=0;ce||c.$isEmpty(b)||b.length<=e}}}}},Gc=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e=0;d.$observe("minlength",function(a){e=ea(a)||0;c.$validate()});c.$validators.minlength=function(a,b){return c.$isEmpty(b)||b.length>=e}}}}};S.angular.bootstrap? +console.log("WARNING: Tried to load angular more than once."):(ce(),ee(fa),fa.module("ngLocale",[],["$provide",function(a){function b(a){a+="";var b=a.indexOf(".");return-1==b?0:a.length-b-1}a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:"January February March April May June July August September October November December".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "), +SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a","short":"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-\u00a4", +negSuf:"",posPre:"\u00a4",posSuf:""}]},id:"en-us",pluralCat:function(a,c){var e=a|0,f=c;u===f&&(f=Math.min(b(a),3));Math.pow(10,f);return 1==e&&0==f?"one":"other"}})}]),B(X).ready(function(){Zd(X,yc)}))})(window,document);!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend(''); +//# sourceMappingURL=angular.min.js.map diff --git a/public/controllers/realTimeLogs/queryBuilder/queryBuilderController.js b/public/controllers/realTimeLogs/queryBuilder/queryBuilderController.js new file mode 100644 index 0000000..05ce3cf --- /dev/null +++ b/public/controllers/realTimeLogs/queryBuilder/queryBuilderController.js @@ -0,0 +1,157 @@ +var app = angular.module('logAggregator'); +var kk=0; +app.controller('liveQueryController', ['$scope', function ($scope) { + var data = '{"group": {"operator": "OR","rules": []}}'; + + function htmlEntities(str) { + return String(str).replace(//g, '>'); + } + + function computed(group) { + if (!group) return ""; + for (var str = "(", i = 0; i < group.rules.length; i++) { + console.log("aaaaa") + console.log($scope.select1); + console.log("len----"+ group.rules.length); + + console.log(group.rules[i]); + i > 0 && (str += " "+group.operator+" "); + kk++; + + str += group.rules[i].group ? + computed(group.rules[i].group) : + group.rules[i].field + " " + htmlEntities(group.rules[i].condition) + " " + group.rules[i].data + " Over " + group.rules[i].accumulator +" " +group.rules[i].value ; + + //if(kk>0) + //{ + // str += group.rules[i].group ? + // computed(group.rules[i].group) : + // + //} + + } + + return " Select "+$scope.select1 + " from " +$scope.stream + " where "+ str + ")"; + + } + + + function computeJson(group){ + if(!group) return ""; + + + var str2="{from: {stream: "+$scope.stream+",where: {server-name: {$regex: '/$server.*/' }}},select: ['dimension1', 'dimension2','measure3','measure4'],eval: {" + + for ( i = 0; i < group.rules.length; i++) { + console.log("aaaaa") + console.log($scope.select1); + console.log("len----"+ group.rules.length); + console.log("STR----"+i+"-----"+str2); + i > 0 && (str2 += ","); + kk++; + + str2 += group.rules[i].group ? + computeJson(group.rules[i].group) : + "val"+i+": {$rolling: { evaluate:"+group.rules[i].field+",over: {"+group.rules[i].accumulator+": "+group.rules[i].value+"},on:"+group.rules[i].data+"}}"; + + //if(kk>0) + //{ + // str += group.rules[i].group ? + // computed(group.rules[i].group) : + // + //} + + } + + + return str2; + + } + + $scope.json = null; + + $scope.filter = JSON.parse(data); + + $scope.$watch('filter', function (newValue) { + $scope.json = JSON.stringify(newValue, null, 2); + $scope.output = computed(newValue.group); + $scope.jsonOutput=computeJson(newValue.group); + }, true); +}]); + +//var queryBuilder = angular.module('queryBuilder', []); +app.directive('queryBuilder', ['$compile', function ($compile) { + return { + restrict: 'E', + scope: { + group: '=' + }, + templateUrl: '/queryBuilderDirective.html', + compile: function (element, attrs) { + var content, directive; + content = element.contents().remove(); + return function (scope, element, attrs) { + scope.operators = [ + { name: 'AND' }, + { name: 'OR' } + ]; + + scope.fields = [ + { name: 'Average' }, + { name: 'Standard Deviation' }, + { name: 'Count' }, + { name: 'Mean' }, + { name: 'Max' } + ]; + + scope.accumulators = [ + { name: 'Count' }, + { name: 'Time' } + + ]; + + scope.conditions = [ + { name: '=' }, + { name: '<>' }, + { name: '<' }, + { name: '<=' }, + { name: '>' }, + { name: '>=' } + ]; + + scope.addCondition = function () { + scope.group.rules.push({ + condition: 'of', + field: 'Firstname', + data: '', + accumulator:'', + value:'' + }); + }; + + scope.removeCondition = function (index) { + scope.group.rules.splice(index, 1); + }; + + scope.addGroup = function () { + scope.group.rules.push({ + group: { + operator: 'AND', + rules: [] + } + }); + }; + + scope.removeGroup = function () { + "group" in scope.$parent && scope.$parent.group.rules.splice(scope.$parent.$index, 1); + }; + + directive || (directive = $compile(content)); + + element.append(directive(scope, function ($compile) { + return $compile; + })); + } + } + } +}]); diff --git a/public/modules/directives/html/aptCache/dropMode.html b/public/modules/directives/html/aptCache/dropMode.html new file mode 100644 index 0000000..1402ee1 --- /dev/null +++ b/public/modules/directives/html/aptCache/dropMode.html @@ -0,0 +1,39 @@ + + +
+ + + +
diff --git a/public/modules/directives/html/aptCache/dropMonth.html b/public/modules/directives/html/aptCache/dropMonth.html new file mode 100644 index 0000000..2444cd2 --- /dev/null +++ b/public/modules/directives/html/aptCache/dropMonth.html @@ -0,0 +1,26 @@ + + + diff --git a/public/modules/directives/html/aptCache/dropYear.html b/public/modules/directives/html/aptCache/dropYear.html new file mode 100644 index 0000000..f778ac9 --- /dev/null +++ b/public/modules/directives/html/aptCache/dropYear.html @@ -0,0 +1,26 @@ + + + diff --git a/public/modules/directives/html/aptCache/radioFilter.html b/public/modules/directives/html/aptCache/radioFilter.html new file mode 100644 index 0000000..5b0cd6a --- /dev/null +++ b/public/modules/directives/html/aptCache/radioFilter.html @@ -0,0 +1,30 @@ + + +
+
+ + + + +
+
diff --git a/public/modules/directives/javascripts/aptCache/dropDownElement.js b/public/modules/directives/javascripts/aptCache/dropDownElement.js new file mode 100644 index 0000000..ecec201 --- /dev/null +++ b/public/modules/directives/javascripts/aptCache/dropDownElement.js @@ -0,0 +1,49 @@ +/*Copyright 2016 Wipro Limited, NIIT Limited + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +This code is written by Ashish Gupta, Tarun Mohandas, Suriya Prakash, Srinivasa Burli, Jishnu Surendran and Bhairavi Balakrishnan*/ + +var dropDownElement=angular.module("dropDownElement",[]); +dropDownElement.controller('dropController',function($scope) +{ + $scope.display = true; + $scope.actionFunction = function(){} +}); +dropDownElement.directive('dropMonth',function(){ + return { + restrict:'E', + templateUrl:'directives/html/aptCache/dropMonth.html' + } +}); + +dropDownElement.directive('dropYear', function(){ + return { + restrict: 'E', + templateUrl:'directives/html/aptCache/dropYear.html' + }; +}); + + +dropDownElement.directive('radioFilter',function(){ + return { + restrict:'E', + templateUrl:'directives/html/aptCache/radioFilter.html' + }; +}); +dropDownElement.directive('dropdownMode', function(){ + return { + restrict: 'E', + templateUrl:'directives/html/aptCache/dropMode.html' + }; +}); diff --git a/public/modules/directives/javascripts/nginx/trafficRate/trafficRate.directive.js b/public/modules/directives/javascripts/nginx/trafficRate/trafficRate.directive.js new file mode 100644 index 0000000..9b3f132 --- /dev/null +++ b/public/modules/directives/javascripts/nginx/trafficRate/trafficRate.directive.js @@ -0,0 +1,271 @@ +/*Copyright 2016 Wipro Limited, NIIT Limited + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +This code is written by Prateek Reddy Yammanuru, Shiva Manognya Kandikuppa, Uday Kumar Mydam, Nirup TNL, Sandeep Reddy G, Deepak Kumar*/ + +angular.module('logAggregator').directive('trafficRateDirective', function() { + return { + restrict : 'E', + replace : false, + scope: { + data: '=', + year: '=', + month: '=' + }, + link: function(scope, elem, attrs) { + scope.$watch('data', function(newVal, oldValue) { + + var margin = {top: 20, right: 20, bottom: 30, left: 70}, + width = 800 - margin.left - margin.right, + height = 300 - margin.top - margin.bottom; + + var parseDate = d3.time.format("%d-%b-%y").parse; + var monthSelection; + + var x = d3.time.scale() + .range([0, width]); + + var y = d3.scale.linear() + .range([height, 0]); + + var color = d3.scale.category10(); + + var xAxis = d3.svg.axis() + .scale(x) + .orient("bottom"); + + + var yAxis = d3.svg.axis() + .scale(y) + .orient("left"); + + function numberOfDays(year,month){ + var d = new Date(year,month,0); + return d.getDate(); + } + + year_selected = scope.year; + month_selected = scope.month; + json = scope.data; + monthSelection = month_selected; + var dates = json[0]; + + if(dates==2){ + d3.select('serverdown') + .html(''); + d3.select('serverdown') + .html('Something went wrong! Please wait while we connect to our servers'); + } + else{ + d3.select('serverdown') + .html(''); + var tempdata = json[1]; + var newdata = []; + var keys = Object.keys(tempdata); + for(i=0; i")(scope)); + + scope.$watch('data', function (data, oldVal) { + d3.select(".wrap .well nodata").html(""); + if(angular.equals({}, data)) { + d3.select("#donut").html(""); + d3.select(".color-legend").html(""); + d3.select(".wrap .well nodata").html("No data Available"); + return; + } else if(data == undefined) { + d3.select(".wrap .well nodata").html("Something went wrong. Please wait while we connect to our servers"); + return; + } + if(angular.equals(data, oldVal)) + return; + var render = function(nestKey, data, userAgentFilters) { + d3.select("#donut").html=""; + d3.select(".color-legend").html=""; + var domainNames = []; + for(var k=0,filterLen = userAgentFilters[nestKey].length; k < filterLen; k++) { + domainNames.push(userAgentFilters[nestKey][k].names) + } + + color.domain(domainNames); + + Donut3D.draw("donut", agentData(), 200, 200, 170, 140, 30, 0.4); + + colorLegendG.call(colorLegend); + + function agentData() { + var result = []; + var keys = Object.keys(data); + for(var i=0, len = keys.length; i < len; i++) { + result.push({label:keys[i], value:data[keys[i]], color:color(keys[i])}) + } + return result; + } + }; + render(scope.criteria, data, scope.userAgentFilters); + }); + + !function(){ + var Donut3D={}; + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return ""+d.data.label+" : " +d.value+ ""; + }); + + function pieTop(d, rx, ry, ir ){ + if(d.endAngle - d.startAngle == 0 ) return "M 0 0"; + var sx = rx*Math.cos(d.startAngle), + sy = ry*Math.sin(d.startAngle), + ex = rx*Math.cos(d.endAngle), + ey = ry*Math.sin(d.endAngle); + + var ret =[]; + ret.push("M",sx,sy,"A",rx,ry,"0",(d.endAngle-d.startAngle > Math.PI? 1: 0),"1",ex,ey,"L",ir*ex,ir*ey); + ret.push("A",ir*rx,ir*ry,"0",(d.endAngle-d.startAngle > Math.PI? 1: 0), "0",ir*sx,ir*sy,"z"); + return ret.join(" "); + } + + function pieOuter(d, rx, ry, h ){ + var startAngle = (d.startAngle > Math.PI ? Math.PI : d.startAngle); + var endAngle = (d.endAngle > Math.PI ? Math.PI : d.endAngle); + + var sx = rx*Math.cos(startAngle), + sy = ry*Math.sin(startAngle), + ex = rx*Math.cos(endAngle), + ey = ry*Math.sin(endAngle); + + var ret =[]; + ret.push("M",sx,h+sy,"A",rx,ry,"0 0 1",ex,h+ey,"L",ex,ey,"A",rx,ry,"0 0 0",sx,sy,"z"); + return ret.join(" "); + } + + function pieInner(d, rx, ry, h, ir ){ + var startAngle = (d.startAngle < Math.PI ? Math.PI : d.startAngle); + var endAngle = (d.endAngle < Math.PI ? Math.PI : d.endAngle); + + var sx = ir*rx*Math.cos(startAngle), + sy = ir*ry*Math.sin(startAngle), + ex = ir*rx*Math.cos(endAngle), + ey = ir*ry*Math.sin(endAngle); + + var ret =[]; + ret.push("M",sx, sy,"A",ir*rx,ir*ry,"0 0 1",ex,ey, "L",ex,h+ey,"A",ir*rx, ir*ry,"0 0 0",sx,h+sy,"z"); + return ret.join(" "); + } + + function getPercent(d){ + return (d.endAngle-d.startAngle > 0.2 ? + Math.round(1000*(d.endAngle-d.startAngle)/(Math.PI*2))/10+'%' : ''); + } + + Donut3D.transition = function(id, data, rx, ry, h, ir){ + function arcTweenInner(a) { + var i = d3.interpolate(this._current, a); + this._current = i(0); + return function(t) { return pieInner(i(t), rx+0.5, ry+0.5, h, ir); }; + } + function arcTweenTop(a) { + var i = d3.interpolate(this._current, a); + this._current = i(0); + return function(t) { return pieTop(i(t), rx, ry, ir); }; + } + function arcTweenOuter(a) { + var i = d3.interpolate(this._current, a); + this._current = i(0); + return function(t) { return pieOuter(i(t), rx-.5, ry-.5, h); }; + } + function textTweenX(a) { + var i = d3.interpolate(this._current, a); + this._current = i(0); + return function(t) { return 0.6*rx*Math.cos(0.5*(i(t).startAngle+i(t).endAngle)); }; + } + function textTweenY(a) { + var i = d3.interpolate(this._current, a); + this._current = i(0); + return function(t) { return 0.6*rx*Math.sin(0.5*(i(t).startAngle+i(t).endAngle)); }; + } + + var _data = d3.layout.pie().sort(null).value(function(d) {return d.value;})(data); + + d3.select("#"+id).selectAll(".innerSlice").data(_data) + .transition().duration(750).attrTween("d", arcTweenInner); + + d3.select("#"+id).selectAll(".topSlice").data(_data) + .transition().duration(750).attrTween("d", arcTweenTop); + + d3.select("#"+id).selectAll(".outerSlice").data(_data) + .transition().duration(750).attrTween("d", arcTweenOuter); + + d3.select("#"+id).selectAll(".percent").data(_data).transition().duration(750) + .attrTween("x",textTweenX).attrTween("y",textTweenY).text(getPercent); + } + + Donut3D.draw=function(id, data, x /*center x*/, y/*center y*/, + rx/*radius x*/, ry/*radius y*/, h/*height*/, ir/*inner radius*/){ + d3.select("#"+id).call(tip, data); + + var _data = d3.layout.pie().sort(null).value(function(d) {return d.value;})(data); + + var slices = d3.select("#"+id).append("g").attr("transform", "translate(" + x + "," + y + ")") + .attr("class", "slices"); + + slices.selectAll(".innerSlice").data(_data).enter().append("path").attr("class", "innerSlice") + .style("fill", function(d) { return d3.hsl(d.data.color).darker(0.7); }) + .attr("d",function(d){ return pieInner(d, rx+0.5,ry+0.5, h, ir);}) + .each(function(d){this._current=d;}) + .on('mouseover', tip.show) + .on('mouseout', tip.hide); + + slices.selectAll(".topSlice").data(_data).enter().append("path").attr("class", "topSlice") + .style("fill", function(d) { return d.data.color; }) + .style("stroke", function(d) { return d.data.color; }) + .attr("d",function(d){ return pieTop(d, rx, ry, ir);}) + .each(function(d){this._current=d;}) + .on('mouseover', tip.show) + .on('mouseout', tip.hide); + + slices.selectAll(".outerSlice").data(_data).enter().append("path").attr("class", "outerSlice") + .style("fill", function(d) { return d3.hsl(d.data.color).darker(0.7); }) + .attr("d",function(d){ return pieOuter(d, rx-.5,ry-.5, h);}) + .each(function(d){this._current=d;}); + + slices.selectAll(".percent").data(_data).enter().append("text").attr("class", "percent") + .attr("x",function(d){ return 0.7*rx*Math.cos(0.5*(d.startAngle+d.endAngle));}) + .attr("y",function(d){ return 0.7*ry*Math.sin(0.5*(d.startAngle+d.endAngle));}) + .text(getPercent).each(function(d){this._current=d;}); + + } + + this.Donut3D = Donut3D; + }(); + } + }; +}]); diff --git a/public/modules/graphs/dataGraphCode.js b/public/modules/graphs/dataGraphCode.js new file mode 100644 index 0000000..c6bf3c0 --- /dev/null +++ b/public/modules/graphs/dataGraphCode.js @@ -0,0 +1,137 @@ +/*Copyright 2016 Wipro Limited, NIIT Limited + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +This code is written by Ashish Gupta, Tarun Mohandas, Suriya Prakash, Srinivasa Burli, Jishnu Surendran and Bhairavi Balakrishnan*/ + +var createDataGraph = function(data) +{ + d3.select('#somegraph').remove(); + var margin = {top: 20, right: 100, bottom: 30, left: 100}, + width = 800 - margin.left - margin.right, + height = 400 - margin.top - margin.bottom; + + var x0 = d3.scale.ordinal() + .rangeRoundBands([0, width], .1); + + var x1 = d3.scale.ordinal(); + + var y = d3.scale.linear() + .range([height, 0]); + + var bytesToString = function (bytes) { + // One way to write it, not the prettiest way to write it. + + var fmt = d3.format('0.0f'); + if (bytes < 1024) { + return fmt(bytes) + ' B'; + } else if (bytes < 1024 * 1024) { + return fmt(bytes / 1024) + ' kB'; + } else { + return fmt(bytes / 1024 / 1024) + ' MB'; + } + } + + + var color = d3.scale.category10(); + + var xAxis = d3.svg.axis() + .scale(x0) + .orient("bottom"); + + var yAxis = d3.svg.axis() + .scale(y) + .tickFormat(bytesToString) + .orient("left"); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return "Size: " + bytesToString(d.value) + ""; + }) + + var svg = d3.select("div #main").append("svg") + .attr('id','somegraph') + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + svg.call(tip); + + var ageNames = d3.keys(data[0]).filter(function(key) { return key !== "period"; }); + data.forEach(function(d) { + d.ages = ageNames.map(function(name) { return {name: name, value: +d[name]}; }); + }); + x0.domain(data.map(function(d) { return d.period; })); + x1.domain(ageNames).rangeRoundBands([0, x0.rangeBand()]); + y.domain([0, d3.max(data, function(d) { return d3.max(d.ages, function(d) { return d.value; }); })]); + + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + height + ")") + .call(xAxis); + + svg.append("g") + .attr("class", "y axis") + .call(yAxis) + .append("text") + .attr("transform", "rotate(-90)") + .attr("y", 6) + .attr("dy", ".71em") + .style("text-anchor", "end") + .text("Data Rate in MB"); + + var period = svg.selectAll(".period") + .data(data) + .enter().append("g") + .attr("class", "period") + .attr("transform", function(d) { return "translate(" + x0(d.period) + ",0)"; }); + + period.selectAll("rect") + .data(function(d) { return d.ages; }) + .enter().append("rect") + .attr("width", x1.rangeBand()) + .attr("x", function(d) { return x1(d.name); }) + .attr("y", function(d) { return y(d.value); }) + .attr("height", function(d) { return height - y(d.value); }) + .style("fill", function(d) { return color(d.name); }); + + period.selectAll('rect') + .on('mouseover', tip.show) + .on('mouseout', tip.hide); + var legend = svg.selectAll(".legend") + .data(ageNames.slice().reverse()) + .enter().append("g") + .attr("class", "legend") + .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + + legend.append("rect") + .attr("x", width - 18) + .attr("width", 18) + .attr("height", 18) + .style("fill", color) + .attr("transform", "translate(100,-20)"); + + legend.append("text") + .attr("x", width - 24) + .attr("y", 9) + .attr("dy", ".35em") + .style("text-anchor", "end") + .text(function(d) { return d; }) + .attr("transform", "translate(100,-20)"); + + + +} diff --git a/public/modules/graphs/gitOtherGraphs.js b/public/modules/graphs/gitOtherGraphs.js new file mode 100644 index 0000000..85ed37b --- /dev/null +++ b/public/modules/graphs/gitOtherGraphs.js @@ -0,0 +1,227 @@ +function plot_pie_chart(data,graph_details){ + console.log("we are inside the plotting the pie chart"); + console.log(data); + var element = document.getElementById("graph-container"); + console.log(element.clientWidth); + + var width = (0.85*parseInt(element.clientWidth)) , + height = 470, + radius = Math.min(width, height) / 2; + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + + var arc = d3.svg.arc() + .outerRadius(radius - 10) + .innerRadius(radius - radius); + + var pie = d3.layout.pie() + .sort(null) + .value(function(d) { return d[graph_details["measure"]["primary"]["function"]["argument"]]; }); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return ""+"No of Commits in"+" "+ d.data["_id"][graph_details["row"]["name"]] +" :"+" " + d.data[graph_details["measure"]["primary"]["function"]["argument"]] + ""; + }) + + // var grouped_data=graph_details["columns"][0]["values"]; + + var svg = d3.select("#graph1").append("svg") + .attr("width", width) + .attr("height", height) + .append("g") + .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); + + svg.call(tip); + + // color.domain(grouped_data); + + // data.forEach(function(d) { + // var y0 = 0; + // d.ages = color.domain().map(function(name) { return {name: name, y0: y0, y1: y0 += +d[name]}; }); + // d.total = d.ages[d.ages.length - 1].y1; + // }); + + + var g = svg.selectAll(".arc") + .data(pie(data)) + .enter().append("g") + .attr("class", "arc") + .on('mouseover', tip.show) + .on('mouseout', tip.hide); + + g.append("path").transition() + .delay(500) + .attr("d", arc) + .style("fill", function(d) { return color( d.data["_id"][graph_details["row"]["name"]]); }); + + // g.append("text") + // // .attr("transform", function(d) { return "translate(" + arc.centriod(d) + ")"; }) + // .attr("transform", function(d) { + // var c = arc.centroid(d), + // x = c[0], + // y = c[1], + // // pythagorean theorem for hypotenuse + // h = Math.sqrt(x*x + y*y); + // return "translate(" + (x/h * radius) + ',' + + // (y/h * radius) + ")"; + // }) + // .attr("dy", ".35em") + // .text(function(d) { return d["data"]["_id"][graph_details["row"]["name"]]}).attr("font-size",12); + // //}); + + // legend = svg.selectAll(".legend") + // .data(some.slice().reverse()) + // .enter().append("g") + // .attr("class", "legend") + // .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + // + // legend.append("rect") + // .attr("x", width - 18) + // .attr("width", 18) + // .attr("height", 18) + // .style("fill", color); + // + // legend.append("text") + // .attr("x", width - 24) + // .attr("y", 9) + // .attr("dy", ".35em") + // .style("text-anchor", "end") + // .text(function(d) { return d; }); + + + function type(d) { + d.recommendCount = +d.recommendCount; + return d; + } +} + +function plot_multibar_graph(data,graph_details){ + console.log("plot_multibar",data); + var element = document.getElementById("graph-container"); + console.log(element.clientWidth); + var margin = {top: 20, right: 60, bottom: 80, left: 60}, + width = (0.89*parseInt(element.clientWidth)) - margin.left - margin.right, + height = 470 - margin.top - margin.bottom; + + var x0 = d3.scale.ordinal() + .rangeRoundBands([0, width], .1); + + var x1 = d3.scale.ordinal(); + + var y = d3.scale.linear() + .range([height, 0]); + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + var xAxis = d3.svg.axis() + .scale(x0) + .orient("bottom"); + + var yAxis = d3.svg.axis() + .scale(y) + .orient("left") + .innerTickSize(-width); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return " " +graph_details["measure"]["primary"]["displayName"]+" "+ d.name + " : " + (d.value) +""; + }) + + var grouped_data=graph_details["columns"][0]["name"]; + + var svg = d3.select("#graph1").append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + svg.call(tip); + + //if (error) throw error; + + var ageNames = d3.keys(data[0]).filter(function(key) { return (key !== "x_dim")&&(key !== "ages")&&(key !== "total"); }); + console.log("agenames"+ageNames); + + data.forEach(function(d) { + d.ages = ageNames.map(function(name) { return {name: name, value: +d[name]}; }); + }); + + x0.domain(data.map(function(d) { return d["x_dim"]; })); + x1.domain(ageNames).rangeRoundBands([0, x0.rangeBand()]); + y.domain([0, d3.max(data, function(d) { return d3.max(d.ages, function(d) { return d.value; }); })]); + + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + height + ")") + .call(xAxis) + .selectAll('text') + .attr("font-size",15); + + svg.append("text") + .attr("font-size",15) + .attr("x",width-70) + .attr("y",height+75) + .attr("fill", "#aaa") + .style("text-anchor", "end") + .text(graph_details["row"]["displayName"]); + + svg.append("g") + .attr("class", "y axis") + .call(yAxis) + .append("text") + .attr("font-size",15) + .attr("transform", "rotate(-90)") + .attr("y", -60) + .attr("dy", ".71em") + .style("text-anchor", "end") + .text(graph_details["measure"]["primary"]["displayName"]); + + var state = svg.selectAll(".state") + .data(data) + .enter().append("g") + .attr("class", "state") + .attr("transform", function(d) { return "translate(" + x0(d["x_dim"]) + ",0)"; }); + + state.selectAll("rect") + .data(function(d) { return d.ages; }) + .enter().append("rect") + .attr("class","bar") + .on('mouseover', tip.show) + .on('mouseout', tip.hide) + .transition() + .delay(500) + .attr("width", x1.rangeBand()) + .attr("x", function(d) { return x1(d.name); }) + .attr("y", function(d) { return y(d.value); }) + .attr("height", function(d) { return height - y(d.value); }) + .style("fill", function(d) { return color(d.name); }); + + // var legend = svg.selectAll(".legend") + // .data(ageNames.slice().reverse()) + // .enter().append("g") + // .attr("class", "legend") + // .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + // + // legend.append("rect") + // .attr("x", width - 18) + // .attr("width", 18) + // .attr("height", 18) + // .style("fill", color); + // + // legend.append("text") + // .attr("x", width - 24) + // .attr("y", 9) + // .attr("dy", ".35em") + // .style("text-anchor", "end") + // .text(function(d) { return d; }); + +} diff --git a/public/modules/graphs/gitOtherGraphs.js.orig b/public/modules/graphs/gitOtherGraphs.js.orig new file mode 100644 index 0000000..c11d520 --- /dev/null +++ b/public/modules/graphs/gitOtherGraphs.js.orig @@ -0,0 +1,249 @@ +function plot_pie_chart(data,graph_details){ + console.log("we are inside the plotting the pie chart"); + console.log(data); + console.log("graph_details",graph_details) + var element = document.getElementById("graph-container"); + console.log(element.clientWidth); + + var width = (0.85*parseInt(element.clientWidth)) , + height = 470, + radius = Math.min(width, height) / 2; + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + + var arc = d3.svg.arc() + .outerRadius(radius - 10) + .innerRadius(radius - radius); + + var pie = d3.layout.pie() + .sort(null) + .value(function(d) { return d[graph_details["measure"]["primary"]["function"]["argument"]]; }); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return ""+"No of Commits in"+" "+ d.data["_id"][graph_details["row"]["name"]] +" :"+" " + d.data[graph_details["measure"]["primary"]["function"]["argument"]] + ""; + }) + + var grouped_data=graph_details["columns"][0]["values"]; + + var svg = d3.select("#graph1").append("svg") + .attr("width", width) + .attr("height", height) + .append("g") + .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); + + svg.call(tip); + + color.domain(grouped_data); + + data.forEach(function(d) { + var y0 = 0; + d.ages = color.domain().map(function(name) { return {name: name, y0: y0, y1: y0 += +d[name]}; }); + d.total = d.ages[d.ages.length - 1].y1; + }); + + + var g = svg.selectAll(".arc") + .data(pie(data)) + .enter().append("g") + .attr("class", "arc") + .on('mouseover', tip.show) + .on('mouseout', tip.hide); + + g.append("path").transition() + .delay(500) + .attr("d", arc) + .style("fill", function(d) { return color( d.data["_id"][graph_details["row"]["name"]]); }); + + // g.append("text") + // // .attr("transform", function(d) { return "translate(" + arc.centriod(d) + ")"; }) + // .attr("transform", function(d) { + // var c = arc.centroid(d), + // x = c[0], + // y = c[1], + // // pythagorean theorem for hypotenuse + // h = Math.sqrt(x*x + y*y); + // return "translate(" + (x/h * radius) + ',' + + // (y/h * radius) + ")"; + // }) + // .attr("dy", ".35em") + // .text(function(d) { return d["data"]["_id"][graph_details["row"]["name"]]}).attr("font-size",12); + // //}); + +<<<<<<< HEAD + // legend = svg.selectAll(".legend") + // .data(d[graph_details["measure"]["primary"]["function"]["argument"]].slice().reverse()) + // .enter().append("g") + // .attr("class", "legend") + // .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + // + // legend.append("rect") + // .attr("x", width - 18) + // .attr("width", 18) + // .attr("height", 18) + // .style("fill", color); + // + // legend.append("text") + // .attr("x", width - 24) + // .attr("y", 9) + // .attr("dy", ".35em") + // .style("text-anchor", "end") + // .text(function(d) { return d; }); +======= + legend = svg.selectAll(".legend") + .data(color.domain().slice().reverse()) + .enter().append("g") + .attr("class", "legend") + .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + + legend.append("rect") + .attr("x", width - 18) + .attr("width", 18) + .attr("height", 18) + .style("fill", color); + + legend.append("text") + .attr("x", width - 24) + .attr("y", 9) + .attr("dy", ".35em") + .style("text-anchor", "end") + .text(function(d) { return d; }); +>>>>>>> 3a738e72661ce0f72f892c67f562c69ccd6bf89a + + + function type(d) { + d.recommendCount = +d.recommendCount; + return d; + } +} + +function plot_multibar_graph(data,graph_details){ + console.log("plot_multibar",data); + var element = document.getElementById("graph-container"); + console.log(element.clientWidth); + var margin = {top: 20, right: 60, bottom: 80, left: 60}, + width = (0.89*parseInt(element.clientWidth)) - margin.left - margin.right, + height = 470 - margin.top - margin.bottom; + + var x0 = d3.scale.ordinal() + .rangeRoundBands([0, width], .1); + + var x1 = d3.scale.ordinal(); + + var y = d3.scale.linear() + .range([height, 0]); + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + var xAxis = d3.svg.axis() + .scale(x0) + .orient("bottom"); + + var yAxis = d3.svg.axis() + .scale(y) + .orient("left") + .innerTickSize(-width); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return " " +graph_details["measure"]["primary"]["displayName"]+" "+ d.name + " : " + (d.value) +""; + }) + + var grouped_data=graph_details["columns"][0]["name"]; + + var svg = d3.select("#graph1").append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + svg.call(tip); + + //if (error) throw error; + + var ageNames = d3.keys(data[0]).filter(function(key) { return (key !== "x_dim")&&(key !== "ages")&&(key !== "total"); }); + console.log("agenames"+ageNames); + + data.forEach(function(d) { + d.ages = ageNames.map(function(name) { return {name: name, value: +d[name]}; }); + }); + + x0.domain(data.map(function(d) { return d["x_dim"]; })); + x1.domain(ageNames).rangeRoundBands([0, x0.rangeBand()]); + y.domain([0, d3.max(data, function(d) { return d3.max(d.ages, function(d) { return d.value; }); })]); + + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + height + ")") + .call(xAxis) + .selectAll('text') + .attr("font-size",15); + + svg.append("text") + .attr("font-size",15) + .attr("x",width-70) + .attr("y",height+75) + .attr("fill", "#aaa") + .style("text-anchor", "end") + .text(graph_details["row"]["displayName"]); + + svg.append("g") + .attr("class", "y axis") + .call(yAxis) + .append("text") + .attr("font-size",15) + .attr("transform", "rotate(-90)") + .attr("y", -60) + .attr("dy", ".71em") + .style("text-anchor", "end") + .text(graph_details["measure"]["primary"]["displayName"]); + + var state = svg.selectAll(".state") + .data(data) + .enter().append("g") + .attr("class", "state") + .attr("transform", function(d) { return "translate(" + x0(d["x_dim"]) + ",0)"; }); + + state.selectAll("rect") + .data(function(d) { return d.ages; }) + .enter().append("rect") + .attr("class","bar") + .on('mouseover', tip.show) + .on('mouseout', tip.hide) + .transition() + .delay(500) + .attr("width", x1.rangeBand()) + .attr("x", function(d) { return x1(d.name); }) + .attr("y", function(d) { return y(d.value); }) + .attr("height", function(d) { return height - y(d.value); }) + .style("fill", function(d) { return color(d.name); }); + + // var legend = svg.selectAll(".legend") + // .data(ageNames.slice().reverse()) + // .enter().append("g") + // .attr("class", "legend") + // .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + // + // legend.append("rect") + // .attr("x", width - 18) + // .attr("width", 18) + // .attr("height", 18) + // .style("fill", color); + // + // legend.append("text") + // .attr("x", width - 24) + // .attr("y", 9) + // .attr("dy", ".35em") + // .style("text-anchor", "end") + // .text(function(d) { return d; }); + +} diff --git a/public/modules/graphs/gitOtherGraphs_BACKUP_4867.js b/public/modules/graphs/gitOtherGraphs_BACKUP_4867.js new file mode 100644 index 0000000..c11d520 --- /dev/null +++ b/public/modules/graphs/gitOtherGraphs_BACKUP_4867.js @@ -0,0 +1,249 @@ +function plot_pie_chart(data,graph_details){ + console.log("we are inside the plotting the pie chart"); + console.log(data); + console.log("graph_details",graph_details) + var element = document.getElementById("graph-container"); + console.log(element.clientWidth); + + var width = (0.85*parseInt(element.clientWidth)) , + height = 470, + radius = Math.min(width, height) / 2; + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + + var arc = d3.svg.arc() + .outerRadius(radius - 10) + .innerRadius(radius - radius); + + var pie = d3.layout.pie() + .sort(null) + .value(function(d) { return d[graph_details["measure"]["primary"]["function"]["argument"]]; }); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return ""+"No of Commits in"+" "+ d.data["_id"][graph_details["row"]["name"]] +" :"+" " + d.data[graph_details["measure"]["primary"]["function"]["argument"]] + ""; + }) + + var grouped_data=graph_details["columns"][0]["values"]; + + var svg = d3.select("#graph1").append("svg") + .attr("width", width) + .attr("height", height) + .append("g") + .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); + + svg.call(tip); + + color.domain(grouped_data); + + data.forEach(function(d) { + var y0 = 0; + d.ages = color.domain().map(function(name) { return {name: name, y0: y0, y1: y0 += +d[name]}; }); + d.total = d.ages[d.ages.length - 1].y1; + }); + + + var g = svg.selectAll(".arc") + .data(pie(data)) + .enter().append("g") + .attr("class", "arc") + .on('mouseover', tip.show) + .on('mouseout', tip.hide); + + g.append("path").transition() + .delay(500) + .attr("d", arc) + .style("fill", function(d) { return color( d.data["_id"][graph_details["row"]["name"]]); }); + + // g.append("text") + // // .attr("transform", function(d) { return "translate(" + arc.centriod(d) + ")"; }) + // .attr("transform", function(d) { + // var c = arc.centroid(d), + // x = c[0], + // y = c[1], + // // pythagorean theorem for hypotenuse + // h = Math.sqrt(x*x + y*y); + // return "translate(" + (x/h * radius) + ',' + + // (y/h * radius) + ")"; + // }) + // .attr("dy", ".35em") + // .text(function(d) { return d["data"]["_id"][graph_details["row"]["name"]]}).attr("font-size",12); + // //}); + +<<<<<<< HEAD + // legend = svg.selectAll(".legend") + // .data(d[graph_details["measure"]["primary"]["function"]["argument"]].slice().reverse()) + // .enter().append("g") + // .attr("class", "legend") + // .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + // + // legend.append("rect") + // .attr("x", width - 18) + // .attr("width", 18) + // .attr("height", 18) + // .style("fill", color); + // + // legend.append("text") + // .attr("x", width - 24) + // .attr("y", 9) + // .attr("dy", ".35em") + // .style("text-anchor", "end") + // .text(function(d) { return d; }); +======= + legend = svg.selectAll(".legend") + .data(color.domain().slice().reverse()) + .enter().append("g") + .attr("class", "legend") + .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + + legend.append("rect") + .attr("x", width - 18) + .attr("width", 18) + .attr("height", 18) + .style("fill", color); + + legend.append("text") + .attr("x", width - 24) + .attr("y", 9) + .attr("dy", ".35em") + .style("text-anchor", "end") + .text(function(d) { return d; }); +>>>>>>> 3a738e72661ce0f72f892c67f562c69ccd6bf89a + + + function type(d) { + d.recommendCount = +d.recommendCount; + return d; + } +} + +function plot_multibar_graph(data,graph_details){ + console.log("plot_multibar",data); + var element = document.getElementById("graph-container"); + console.log(element.clientWidth); + var margin = {top: 20, right: 60, bottom: 80, left: 60}, + width = (0.89*parseInt(element.clientWidth)) - margin.left - margin.right, + height = 470 - margin.top - margin.bottom; + + var x0 = d3.scale.ordinal() + .rangeRoundBands([0, width], .1); + + var x1 = d3.scale.ordinal(); + + var y = d3.scale.linear() + .range([height, 0]); + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + var xAxis = d3.svg.axis() + .scale(x0) + .orient("bottom"); + + var yAxis = d3.svg.axis() + .scale(y) + .orient("left") + .innerTickSize(-width); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return " " +graph_details["measure"]["primary"]["displayName"]+" "+ d.name + " : " + (d.value) +""; + }) + + var grouped_data=graph_details["columns"][0]["name"]; + + var svg = d3.select("#graph1").append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + svg.call(tip); + + //if (error) throw error; + + var ageNames = d3.keys(data[0]).filter(function(key) { return (key !== "x_dim")&&(key !== "ages")&&(key !== "total"); }); + console.log("agenames"+ageNames); + + data.forEach(function(d) { + d.ages = ageNames.map(function(name) { return {name: name, value: +d[name]}; }); + }); + + x0.domain(data.map(function(d) { return d["x_dim"]; })); + x1.domain(ageNames).rangeRoundBands([0, x0.rangeBand()]); + y.domain([0, d3.max(data, function(d) { return d3.max(d.ages, function(d) { return d.value; }); })]); + + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + height + ")") + .call(xAxis) + .selectAll('text') + .attr("font-size",15); + + svg.append("text") + .attr("font-size",15) + .attr("x",width-70) + .attr("y",height+75) + .attr("fill", "#aaa") + .style("text-anchor", "end") + .text(graph_details["row"]["displayName"]); + + svg.append("g") + .attr("class", "y axis") + .call(yAxis) + .append("text") + .attr("font-size",15) + .attr("transform", "rotate(-90)") + .attr("y", -60) + .attr("dy", ".71em") + .style("text-anchor", "end") + .text(graph_details["measure"]["primary"]["displayName"]); + + var state = svg.selectAll(".state") + .data(data) + .enter().append("g") + .attr("class", "state") + .attr("transform", function(d) { return "translate(" + x0(d["x_dim"]) + ",0)"; }); + + state.selectAll("rect") + .data(function(d) { return d.ages; }) + .enter().append("rect") + .attr("class","bar") + .on('mouseover', tip.show) + .on('mouseout', tip.hide) + .transition() + .delay(500) + .attr("width", x1.rangeBand()) + .attr("x", function(d) { return x1(d.name); }) + .attr("y", function(d) { return y(d.value); }) + .attr("height", function(d) { return height - y(d.value); }) + .style("fill", function(d) { return color(d.name); }); + + // var legend = svg.selectAll(".legend") + // .data(ageNames.slice().reverse()) + // .enter().append("g") + // .attr("class", "legend") + // .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + // + // legend.append("rect") + // .attr("x", width - 18) + // .attr("width", 18) + // .attr("height", 18) + // .style("fill", color); + // + // legend.append("text") + // .attr("x", width - 24) + // .attr("y", 9) + // .attr("dy", ".35em") + // .style("text-anchor", "end") + // .text(function(d) { return d; }); + +} diff --git a/public/modules/graphs/gitOtherGraphs_BACKUP_4973.js b/public/modules/graphs/gitOtherGraphs_BACKUP_4973.js new file mode 100644 index 0000000..c11d520 --- /dev/null +++ b/public/modules/graphs/gitOtherGraphs_BACKUP_4973.js @@ -0,0 +1,249 @@ +function plot_pie_chart(data,graph_details){ + console.log("we are inside the plotting the pie chart"); + console.log(data); + console.log("graph_details",graph_details) + var element = document.getElementById("graph-container"); + console.log(element.clientWidth); + + var width = (0.85*parseInt(element.clientWidth)) , + height = 470, + radius = Math.min(width, height) / 2; + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + + var arc = d3.svg.arc() + .outerRadius(radius - 10) + .innerRadius(radius - radius); + + var pie = d3.layout.pie() + .sort(null) + .value(function(d) { return d[graph_details["measure"]["primary"]["function"]["argument"]]; }); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return ""+"No of Commits in"+" "+ d.data["_id"][graph_details["row"]["name"]] +" :"+" " + d.data[graph_details["measure"]["primary"]["function"]["argument"]] + ""; + }) + + var grouped_data=graph_details["columns"][0]["values"]; + + var svg = d3.select("#graph1").append("svg") + .attr("width", width) + .attr("height", height) + .append("g") + .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); + + svg.call(tip); + + color.domain(grouped_data); + + data.forEach(function(d) { + var y0 = 0; + d.ages = color.domain().map(function(name) { return {name: name, y0: y0, y1: y0 += +d[name]}; }); + d.total = d.ages[d.ages.length - 1].y1; + }); + + + var g = svg.selectAll(".arc") + .data(pie(data)) + .enter().append("g") + .attr("class", "arc") + .on('mouseover', tip.show) + .on('mouseout', tip.hide); + + g.append("path").transition() + .delay(500) + .attr("d", arc) + .style("fill", function(d) { return color( d.data["_id"][graph_details["row"]["name"]]); }); + + // g.append("text") + // // .attr("transform", function(d) { return "translate(" + arc.centriod(d) + ")"; }) + // .attr("transform", function(d) { + // var c = arc.centroid(d), + // x = c[0], + // y = c[1], + // // pythagorean theorem for hypotenuse + // h = Math.sqrt(x*x + y*y); + // return "translate(" + (x/h * radius) + ',' + + // (y/h * radius) + ")"; + // }) + // .attr("dy", ".35em") + // .text(function(d) { return d["data"]["_id"][graph_details["row"]["name"]]}).attr("font-size",12); + // //}); + +<<<<<<< HEAD + // legend = svg.selectAll(".legend") + // .data(d[graph_details["measure"]["primary"]["function"]["argument"]].slice().reverse()) + // .enter().append("g") + // .attr("class", "legend") + // .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + // + // legend.append("rect") + // .attr("x", width - 18) + // .attr("width", 18) + // .attr("height", 18) + // .style("fill", color); + // + // legend.append("text") + // .attr("x", width - 24) + // .attr("y", 9) + // .attr("dy", ".35em") + // .style("text-anchor", "end") + // .text(function(d) { return d; }); +======= + legend = svg.selectAll(".legend") + .data(color.domain().slice().reverse()) + .enter().append("g") + .attr("class", "legend") + .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + + legend.append("rect") + .attr("x", width - 18) + .attr("width", 18) + .attr("height", 18) + .style("fill", color); + + legend.append("text") + .attr("x", width - 24) + .attr("y", 9) + .attr("dy", ".35em") + .style("text-anchor", "end") + .text(function(d) { return d; }); +>>>>>>> 3a738e72661ce0f72f892c67f562c69ccd6bf89a + + + function type(d) { + d.recommendCount = +d.recommendCount; + return d; + } +} + +function plot_multibar_graph(data,graph_details){ + console.log("plot_multibar",data); + var element = document.getElementById("graph-container"); + console.log(element.clientWidth); + var margin = {top: 20, right: 60, bottom: 80, left: 60}, + width = (0.89*parseInt(element.clientWidth)) - margin.left - margin.right, + height = 470 - margin.top - margin.bottom; + + var x0 = d3.scale.ordinal() + .rangeRoundBands([0, width], .1); + + var x1 = d3.scale.ordinal(); + + var y = d3.scale.linear() + .range([height, 0]); + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + var xAxis = d3.svg.axis() + .scale(x0) + .orient("bottom"); + + var yAxis = d3.svg.axis() + .scale(y) + .orient("left") + .innerTickSize(-width); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return " " +graph_details["measure"]["primary"]["displayName"]+" "+ d.name + " : " + (d.value) +""; + }) + + var grouped_data=graph_details["columns"][0]["name"]; + + var svg = d3.select("#graph1").append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + svg.call(tip); + + //if (error) throw error; + + var ageNames = d3.keys(data[0]).filter(function(key) { return (key !== "x_dim")&&(key !== "ages")&&(key !== "total"); }); + console.log("agenames"+ageNames); + + data.forEach(function(d) { + d.ages = ageNames.map(function(name) { return {name: name, value: +d[name]}; }); + }); + + x0.domain(data.map(function(d) { return d["x_dim"]; })); + x1.domain(ageNames).rangeRoundBands([0, x0.rangeBand()]); + y.domain([0, d3.max(data, function(d) { return d3.max(d.ages, function(d) { return d.value; }); })]); + + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + height + ")") + .call(xAxis) + .selectAll('text') + .attr("font-size",15); + + svg.append("text") + .attr("font-size",15) + .attr("x",width-70) + .attr("y",height+75) + .attr("fill", "#aaa") + .style("text-anchor", "end") + .text(graph_details["row"]["displayName"]); + + svg.append("g") + .attr("class", "y axis") + .call(yAxis) + .append("text") + .attr("font-size",15) + .attr("transform", "rotate(-90)") + .attr("y", -60) + .attr("dy", ".71em") + .style("text-anchor", "end") + .text(graph_details["measure"]["primary"]["displayName"]); + + var state = svg.selectAll(".state") + .data(data) + .enter().append("g") + .attr("class", "state") + .attr("transform", function(d) { return "translate(" + x0(d["x_dim"]) + ",0)"; }); + + state.selectAll("rect") + .data(function(d) { return d.ages; }) + .enter().append("rect") + .attr("class","bar") + .on('mouseover', tip.show) + .on('mouseout', tip.hide) + .transition() + .delay(500) + .attr("width", x1.rangeBand()) + .attr("x", function(d) { return x1(d.name); }) + .attr("y", function(d) { return y(d.value); }) + .attr("height", function(d) { return height - y(d.value); }) + .style("fill", function(d) { return color(d.name); }); + + // var legend = svg.selectAll(".legend") + // .data(ageNames.slice().reverse()) + // .enter().append("g") + // .attr("class", "legend") + // .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + // + // legend.append("rect") + // .attr("x", width - 18) + // .attr("width", 18) + // .attr("height", 18) + // .style("fill", color); + // + // legend.append("text") + // .attr("x", width - 24) + // .attr("y", 9) + // .attr("dy", ".35em") + // .style("text-anchor", "end") + // .text(function(d) { return d; }); + +} diff --git a/public/modules/graphs/gitOtherGraphs_BASE_4867.js b/public/modules/graphs/gitOtherGraphs_BASE_4867.js new file mode 100644 index 0000000..f2e32ba --- /dev/null +++ b/public/modules/graphs/gitOtherGraphs_BASE_4867.js @@ -0,0 +1,216 @@ + +function plot_pie_chart(data,graph_details){ + console.log("we are inside the plotting the pie chart"); + console.log(data); + var element = document.getElementById("graph-container"); + console.log(element.clientWidth); + + var width = (0.85*parseInt(element.clientWidth)) , + height = 470, + radius = Math.min(width, height) / 2; + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + + var arc = d3.svg.arc() + .outerRadius(radius - 10) + .innerRadius(radius - radius); + + var pie = d3.layout.pie() + .sort(null) + .value(function(d) { return d[graph_details["measure"]["primary"]["function"]["argument"]]; }); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return ""+"No of Commits in"+" "+ d.data["_id"][graph_details["row"]["name"]] +" :"+" " + d.data[graph_details["measure"]["primary"]["function"]["argument"]] + ""; + }) + + var svg = d3.select("#graph1").append("svg") + .attr("width", width) + .attr("height", height) + .append("g") + .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); + + svg.call(tip); + + var g = svg.selectAll(".arc") + .data(pie(data)) + .enter().append("g") + .attr("class", "arc") + .on('mouseover', tip.show) + .on('mouseout', tip.hide); + + g.append("path").transition() + .delay(500) + .attr("d", arc) + .style("fill", function(d) { return color( d.data["_id"][graph_details["row"]["name"]]); }); + + // g.append("text") + // // .attr("transform", function(d) { return "translate(" + arc.centriod(d) + ")"; }) + // .attr("transform", function(d) { + // var c = arc.centroid(d), + // x = c[0], + // y = c[1], + // // pythagorean theorem for hypotenuse + // h = Math.sqrt(x*x + y*y); + // return "translate(" + (x/h * radius) + ',' + + // (y/h * radius) + ")"; + // }) + // .attr("dy", ".35em") + // .text(function(d) { return d["data"]["_id"][graph_details["row"]["name"]]}).attr("font-size",12); + // //}); + + legend = svg.selectAll(".legend") + .data(d[graph_details["measure"]["primary"]["function"]["argument"]].slice().reverse()) + .enter().append("g") + .attr("class", "legend") + .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + + legend.append("rect") + .attr("x", width - 18) + .attr("width", 18) + .attr("height", 18) + .style("fill", color); + + legend.append("text") + .attr("x", width - 24) + .attr("y", 9) + .attr("dy", ".35em") + .style("text-anchor", "end") + .text(function(d) { return d; }); + + + function type(d) { + d.recommendCount = +d.recommendCount; + return d; + } +} + +function plot_multibar_graph(data,graph_details){ + console.log("plot_multibar",data); + var element = document.getElementById("graph-container"); + console.log(element.clientWidth); + var margin = {top: 20, right: 60, bottom: 80, left: 60}, + width = (0.85*parseInt(element.clientWidth)) - margin.left - margin.right, + height = 370 - margin.top - margin.bottom; + + var x0 = d3.scale.ordinal() + .rangeRoundBands([0, width], .1); + + var x1 = d3.scale.ordinal(); + + var y = d3.scale.linear() + .range([height, 0]); + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + var xAxis = d3.svg.axis() + .scale(x0) + .orient("bottom"); + + var yAxis = d3.svg.axis() + .scale(y) + .orient("left") + .innerTickSize(-width); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return " " +graph_details["measure"]["primary"]["displayName"]+" "+ d.name + " : " + (d.value) +""; + }) + + var grouped_data=graph_details["columns"][0]["name"]; + + var svg = d3.select("#graph1").append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + svg.call(tip); + + //if (error) throw error; + + var ageNames = d3.keys(data[0]).filter(function(key) { return (key !== "x_dim")&&(key !== "ages")&&(key !== "total"); }); + console.log("agenames"+ageNames); + + data.forEach(function(d) { + d.ages = ageNames.map(function(name) { return {name: name, value: +d[name]}; }); + }); + + x0.domain(data.map(function(d) { return d["x_dim"]; })); + x1.domain(ageNames).rangeRoundBands([0, x0.rangeBand()]); + y.domain([0, d3.max(data, function(d) { return d3.max(d.ages, function(d) { return d.value; }); })]); + + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + height + ")") + .call(xAxis) + .selectAll('text') + .attr("font-size",15); + + svg.append("text") + .attr("font-size",18) + .attr("y", height+20) + .attr("x",width+40) + .style("text-anchor", "end") + .text(graph_details["row"]["displayName"]); + + svg.append("g") + .attr("class", "y axis") + .call(yAxis) + .append("text") + .attr("font-size",15) + .attr("transform", "rotate(-90)") + .attr("y", -60) + .attr("dy", ".71em") + .style("text-anchor", "end") + .text(graph_details["measure"]["primary"]["displayName"]); + + var state = svg.selectAll(".state") + .data(data) + .enter().append("g") + .attr("class", "state") + .attr("transform", function(d) { return "translate(" + x0(d["x_dim"]) + ",0)"; }); + + state.selectAll("rect") + .data(function(d) { return d.ages; }) + .enter().append("rect") + .attr("class","bar") + .on('mouseover', tip.show) + .on('mouseout', tip.hide) + .transition() + .delay(500) + .attr("width", x1.rangeBand()) + .attr("x", function(d) { return x1(d.name); }) + .attr("y", function(d) { return y(d.value); }) + .attr("height", function(d) { return height - y(d.value); }) + .style("fill", function(d) { return color(d.name); }); + + var legend = svg.selectAll(".legend") + .data(ageNames.slice().reverse()) + .enter().append("g") + .attr("class", "legend") + .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + + legend.append("rect") + .attr("x", width - 18) + .attr("width", 18) + .attr("height", 18) + .style("fill", color); + + legend.append("text") + .attr("x", width - 24) + .attr("y", 9) + .attr("dy", ".35em") + .style("text-anchor", "end") + .text(function(d) { return d; }); + +} diff --git a/public/modules/graphs/gitOtherGraphs_BASE_4973.js b/public/modules/graphs/gitOtherGraphs_BASE_4973.js new file mode 100644 index 0000000..f2e32ba --- /dev/null +++ b/public/modules/graphs/gitOtherGraphs_BASE_4973.js @@ -0,0 +1,216 @@ + +function plot_pie_chart(data,graph_details){ + console.log("we are inside the plotting the pie chart"); + console.log(data); + var element = document.getElementById("graph-container"); + console.log(element.clientWidth); + + var width = (0.85*parseInt(element.clientWidth)) , + height = 470, + radius = Math.min(width, height) / 2; + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + + var arc = d3.svg.arc() + .outerRadius(radius - 10) + .innerRadius(radius - radius); + + var pie = d3.layout.pie() + .sort(null) + .value(function(d) { return d[graph_details["measure"]["primary"]["function"]["argument"]]; }); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return ""+"No of Commits in"+" "+ d.data["_id"][graph_details["row"]["name"]] +" :"+" " + d.data[graph_details["measure"]["primary"]["function"]["argument"]] + ""; + }) + + var svg = d3.select("#graph1").append("svg") + .attr("width", width) + .attr("height", height) + .append("g") + .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); + + svg.call(tip); + + var g = svg.selectAll(".arc") + .data(pie(data)) + .enter().append("g") + .attr("class", "arc") + .on('mouseover', tip.show) + .on('mouseout', tip.hide); + + g.append("path").transition() + .delay(500) + .attr("d", arc) + .style("fill", function(d) { return color( d.data["_id"][graph_details["row"]["name"]]); }); + + // g.append("text") + // // .attr("transform", function(d) { return "translate(" + arc.centriod(d) + ")"; }) + // .attr("transform", function(d) { + // var c = arc.centroid(d), + // x = c[0], + // y = c[1], + // // pythagorean theorem for hypotenuse + // h = Math.sqrt(x*x + y*y); + // return "translate(" + (x/h * radius) + ',' + + // (y/h * radius) + ")"; + // }) + // .attr("dy", ".35em") + // .text(function(d) { return d["data"]["_id"][graph_details["row"]["name"]]}).attr("font-size",12); + // //}); + + legend = svg.selectAll(".legend") + .data(d[graph_details["measure"]["primary"]["function"]["argument"]].slice().reverse()) + .enter().append("g") + .attr("class", "legend") + .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + + legend.append("rect") + .attr("x", width - 18) + .attr("width", 18) + .attr("height", 18) + .style("fill", color); + + legend.append("text") + .attr("x", width - 24) + .attr("y", 9) + .attr("dy", ".35em") + .style("text-anchor", "end") + .text(function(d) { return d; }); + + + function type(d) { + d.recommendCount = +d.recommendCount; + return d; + } +} + +function plot_multibar_graph(data,graph_details){ + console.log("plot_multibar",data); + var element = document.getElementById("graph-container"); + console.log(element.clientWidth); + var margin = {top: 20, right: 60, bottom: 80, left: 60}, + width = (0.85*parseInt(element.clientWidth)) - margin.left - margin.right, + height = 370 - margin.top - margin.bottom; + + var x0 = d3.scale.ordinal() + .rangeRoundBands([0, width], .1); + + var x1 = d3.scale.ordinal(); + + var y = d3.scale.linear() + .range([height, 0]); + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + var xAxis = d3.svg.axis() + .scale(x0) + .orient("bottom"); + + var yAxis = d3.svg.axis() + .scale(y) + .orient("left") + .innerTickSize(-width); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return " " +graph_details["measure"]["primary"]["displayName"]+" "+ d.name + " : " + (d.value) +""; + }) + + var grouped_data=graph_details["columns"][0]["name"]; + + var svg = d3.select("#graph1").append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + svg.call(tip); + + //if (error) throw error; + + var ageNames = d3.keys(data[0]).filter(function(key) { return (key !== "x_dim")&&(key !== "ages")&&(key !== "total"); }); + console.log("agenames"+ageNames); + + data.forEach(function(d) { + d.ages = ageNames.map(function(name) { return {name: name, value: +d[name]}; }); + }); + + x0.domain(data.map(function(d) { return d["x_dim"]; })); + x1.domain(ageNames).rangeRoundBands([0, x0.rangeBand()]); + y.domain([0, d3.max(data, function(d) { return d3.max(d.ages, function(d) { return d.value; }); })]); + + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + height + ")") + .call(xAxis) + .selectAll('text') + .attr("font-size",15); + + svg.append("text") + .attr("font-size",18) + .attr("y", height+20) + .attr("x",width+40) + .style("text-anchor", "end") + .text(graph_details["row"]["displayName"]); + + svg.append("g") + .attr("class", "y axis") + .call(yAxis) + .append("text") + .attr("font-size",15) + .attr("transform", "rotate(-90)") + .attr("y", -60) + .attr("dy", ".71em") + .style("text-anchor", "end") + .text(graph_details["measure"]["primary"]["displayName"]); + + var state = svg.selectAll(".state") + .data(data) + .enter().append("g") + .attr("class", "state") + .attr("transform", function(d) { return "translate(" + x0(d["x_dim"]) + ",0)"; }); + + state.selectAll("rect") + .data(function(d) { return d.ages; }) + .enter().append("rect") + .attr("class","bar") + .on('mouseover', tip.show) + .on('mouseout', tip.hide) + .transition() + .delay(500) + .attr("width", x1.rangeBand()) + .attr("x", function(d) { return x1(d.name); }) + .attr("y", function(d) { return y(d.value); }) + .attr("height", function(d) { return height - y(d.value); }) + .style("fill", function(d) { return color(d.name); }); + + var legend = svg.selectAll(".legend") + .data(ageNames.slice().reverse()) + .enter().append("g") + .attr("class", "legend") + .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + + legend.append("rect") + .attr("x", width - 18) + .attr("width", 18) + .attr("height", 18) + .style("fill", color); + + legend.append("text") + .attr("x", width - 24) + .attr("y", 9) + .attr("dy", ".35em") + .style("text-anchor", "end") + .text(function(d) { return d; }); + +} diff --git a/public/modules/graphs/gitOtherGraphs_LOCAL_4867.js b/public/modules/graphs/gitOtherGraphs_LOCAL_4867.js new file mode 100644 index 0000000..c7a60fc --- /dev/null +++ b/public/modules/graphs/gitOtherGraphs_LOCAL_4867.js @@ -0,0 +1,217 @@ + +function plot_pie_chart(data,graph_details){ + console.log("we are inside the plotting the pie chart"); + console.log(data); + var element = document.getElementById("graph-container"); + console.log(element.clientWidth); + + var width = (0.85*parseInt(element.clientWidth)) , + height = 470, + radius = Math.min(width, height) / 2; + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + + var arc = d3.svg.arc() + .outerRadius(radius - 10) + .innerRadius(radius - radius); + + var pie = d3.layout.pie() + .sort(null) + .value(function(d) { return d[graph_details["measure"]["primary"]["function"]["argument"]]; }); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return ""+"No of Commits in"+" "+ d.data["_id"][graph_details["row"]["name"]] +" :"+" " + d.data[graph_details["measure"]["primary"]["function"]["argument"]] + ""; + }) + + var svg = d3.select("#graph1").append("svg") + .attr("width", width) + .attr("height", height) + .append("g") + .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); + + svg.call(tip); + + var g = svg.selectAll(".arc") + .data(pie(data)) + .enter().append("g") + .attr("class", "arc") + .on('mouseover', tip.show) + .on('mouseout', tip.hide); + + g.append("path").transition() + .delay(500) + .attr("d", arc) + .style("fill", function(d) { return color( d.data["_id"][graph_details["row"]["name"]]); }); + + // g.append("text") + // // .attr("transform", function(d) { return "translate(" + arc.centriod(d) + ")"; }) + // .attr("transform", function(d) { + // var c = arc.centroid(d), + // x = c[0], + // y = c[1], + // // pythagorean theorem for hypotenuse + // h = Math.sqrt(x*x + y*y); + // return "translate(" + (x/h * radius) + ',' + + // (y/h * radius) + ")"; + // }) + // .attr("dy", ".35em") + // .text(function(d) { return d["data"]["_id"][graph_details["row"]["name"]]}).attr("font-size",12); + // //}); + + // legend = svg.selectAll(".legend") + // .data(d[graph_details["measure"]["primary"]["function"]["argument"]].slice().reverse()) + // .enter().append("g") + // .attr("class", "legend") + // .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + // + // legend.append("rect") + // .attr("x", width - 18) + // .attr("width", 18) + // .attr("height", 18) + // .style("fill", color); + // + // legend.append("text") + // .attr("x", width - 24) + // .attr("y", 9) + // .attr("dy", ".35em") + // .style("text-anchor", "end") + // .text(function(d) { return d; }); + + + function type(d) { + d.recommendCount = +d.recommendCount; + return d; + } +} + +function plot_multibar_graph(data,graph_details){ + console.log("plot_multibar",data); + var element = document.getElementById("graph-container"); + console.log(element.clientWidth); + var margin = {top: 20, right: 60, bottom: 80, left: 60}, + width = (0.89*parseInt(element.clientWidth)) - margin.left - margin.right, + height = 470 - margin.top - margin.bottom; + + var x0 = d3.scale.ordinal() + .rangeRoundBands([0, width], .1); + + var x1 = d3.scale.ordinal(); + + var y = d3.scale.linear() + .range([height, 0]); + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + var xAxis = d3.svg.axis() + .scale(x0) + .orient("bottom"); + + var yAxis = d3.svg.axis() + .scale(y) + .orient("left") + .innerTickSize(-width); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return " " +graph_details["measure"]["primary"]["displayName"]+" "+ d.name + " : " + (d.value) +""; + }) + + var grouped_data=graph_details["columns"][0]["name"]; + + var svg = d3.select("#graph1").append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + svg.call(tip); + + //if (error) throw error; + + var ageNames = d3.keys(data[0]).filter(function(key) { return (key !== "x_dim")&&(key !== "ages")&&(key !== "total"); }); + console.log("agenames"+ageNames); + + data.forEach(function(d) { + d.ages = ageNames.map(function(name) { return {name: name, value: +d[name]}; }); + }); + + x0.domain(data.map(function(d) { return d["x_dim"]; })); + x1.domain(ageNames).rangeRoundBands([0, x0.rangeBand()]); + y.domain([0, d3.max(data, function(d) { return d3.max(d.ages, function(d) { return d.value; }); })]); + + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + height + ")") + .call(xAxis) + .selectAll('text') + .attr("font-size",15); + + svg.append("text") + .attr("font-size",15) + .attr("x",width-70) + .attr("y",height+75) + .attr("fill", "#aaa") + .style("text-anchor", "end") + .text(graph_details["row"]["displayName"]); + + svg.append("g") + .attr("class", "y axis") + .call(yAxis) + .append("text") + .attr("font-size",15) + .attr("transform", "rotate(-90)") + .attr("y", -60) + .attr("dy", ".71em") + .style("text-anchor", "end") + .text(graph_details["measure"]["primary"]["displayName"]); + + var state = svg.selectAll(".state") + .data(data) + .enter().append("g") + .attr("class", "state") + .attr("transform", function(d) { return "translate(" + x0(d["x_dim"]) + ",0)"; }); + + state.selectAll("rect") + .data(function(d) { return d.ages; }) + .enter().append("rect") + .attr("class","bar") + .on('mouseover', tip.show) + .on('mouseout', tip.hide) + .transition() + .delay(500) + .attr("width", x1.rangeBand()) + .attr("x", function(d) { return x1(d.name); }) + .attr("y", function(d) { return y(d.value); }) + .attr("height", function(d) { return height - y(d.value); }) + .style("fill", function(d) { return color(d.name); }); + + // var legend = svg.selectAll(".legend") + // .data(ageNames.slice().reverse()) + // .enter().append("g") + // .attr("class", "legend") + // .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + // + // legend.append("rect") + // .attr("x", width - 18) + // .attr("width", 18) + // .attr("height", 18) + // .style("fill", color); + // + // legend.append("text") + // .attr("x", width - 24) + // .attr("y", 9) + // .attr("dy", ".35em") + // .style("text-anchor", "end") + // .text(function(d) { return d; }); + +} diff --git a/public/modules/graphs/gitOtherGraphs_LOCAL_4973.js b/public/modules/graphs/gitOtherGraphs_LOCAL_4973.js new file mode 100644 index 0000000..c7a60fc --- /dev/null +++ b/public/modules/graphs/gitOtherGraphs_LOCAL_4973.js @@ -0,0 +1,217 @@ + +function plot_pie_chart(data,graph_details){ + console.log("we are inside the plotting the pie chart"); + console.log(data); + var element = document.getElementById("graph-container"); + console.log(element.clientWidth); + + var width = (0.85*parseInt(element.clientWidth)) , + height = 470, + radius = Math.min(width, height) / 2; + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + + var arc = d3.svg.arc() + .outerRadius(radius - 10) + .innerRadius(radius - radius); + + var pie = d3.layout.pie() + .sort(null) + .value(function(d) { return d[graph_details["measure"]["primary"]["function"]["argument"]]; }); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return ""+"No of Commits in"+" "+ d.data["_id"][graph_details["row"]["name"]] +" :"+" " + d.data[graph_details["measure"]["primary"]["function"]["argument"]] + ""; + }) + + var svg = d3.select("#graph1").append("svg") + .attr("width", width) + .attr("height", height) + .append("g") + .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); + + svg.call(tip); + + var g = svg.selectAll(".arc") + .data(pie(data)) + .enter().append("g") + .attr("class", "arc") + .on('mouseover', tip.show) + .on('mouseout', tip.hide); + + g.append("path").transition() + .delay(500) + .attr("d", arc) + .style("fill", function(d) { return color( d.data["_id"][graph_details["row"]["name"]]); }); + + // g.append("text") + // // .attr("transform", function(d) { return "translate(" + arc.centriod(d) + ")"; }) + // .attr("transform", function(d) { + // var c = arc.centroid(d), + // x = c[0], + // y = c[1], + // // pythagorean theorem for hypotenuse + // h = Math.sqrt(x*x + y*y); + // return "translate(" + (x/h * radius) + ',' + + // (y/h * radius) + ")"; + // }) + // .attr("dy", ".35em") + // .text(function(d) { return d["data"]["_id"][graph_details["row"]["name"]]}).attr("font-size",12); + // //}); + + // legend = svg.selectAll(".legend") + // .data(d[graph_details["measure"]["primary"]["function"]["argument"]].slice().reverse()) + // .enter().append("g") + // .attr("class", "legend") + // .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + // + // legend.append("rect") + // .attr("x", width - 18) + // .attr("width", 18) + // .attr("height", 18) + // .style("fill", color); + // + // legend.append("text") + // .attr("x", width - 24) + // .attr("y", 9) + // .attr("dy", ".35em") + // .style("text-anchor", "end") + // .text(function(d) { return d; }); + + + function type(d) { + d.recommendCount = +d.recommendCount; + return d; + } +} + +function plot_multibar_graph(data,graph_details){ + console.log("plot_multibar",data); + var element = document.getElementById("graph-container"); + console.log(element.clientWidth); + var margin = {top: 20, right: 60, bottom: 80, left: 60}, + width = (0.89*parseInt(element.clientWidth)) - margin.left - margin.right, + height = 470 - margin.top - margin.bottom; + + var x0 = d3.scale.ordinal() + .rangeRoundBands([0, width], .1); + + var x1 = d3.scale.ordinal(); + + var y = d3.scale.linear() + .range([height, 0]); + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + var xAxis = d3.svg.axis() + .scale(x0) + .orient("bottom"); + + var yAxis = d3.svg.axis() + .scale(y) + .orient("left") + .innerTickSize(-width); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return " " +graph_details["measure"]["primary"]["displayName"]+" "+ d.name + " : " + (d.value) +""; + }) + + var grouped_data=graph_details["columns"][0]["name"]; + + var svg = d3.select("#graph1").append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + svg.call(tip); + + //if (error) throw error; + + var ageNames = d3.keys(data[0]).filter(function(key) { return (key !== "x_dim")&&(key !== "ages")&&(key !== "total"); }); + console.log("agenames"+ageNames); + + data.forEach(function(d) { + d.ages = ageNames.map(function(name) { return {name: name, value: +d[name]}; }); + }); + + x0.domain(data.map(function(d) { return d["x_dim"]; })); + x1.domain(ageNames).rangeRoundBands([0, x0.rangeBand()]); + y.domain([0, d3.max(data, function(d) { return d3.max(d.ages, function(d) { return d.value; }); })]); + + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + height + ")") + .call(xAxis) + .selectAll('text') + .attr("font-size",15); + + svg.append("text") + .attr("font-size",15) + .attr("x",width-70) + .attr("y",height+75) + .attr("fill", "#aaa") + .style("text-anchor", "end") + .text(graph_details["row"]["displayName"]); + + svg.append("g") + .attr("class", "y axis") + .call(yAxis) + .append("text") + .attr("font-size",15) + .attr("transform", "rotate(-90)") + .attr("y", -60) + .attr("dy", ".71em") + .style("text-anchor", "end") + .text(graph_details["measure"]["primary"]["displayName"]); + + var state = svg.selectAll(".state") + .data(data) + .enter().append("g") + .attr("class", "state") + .attr("transform", function(d) { return "translate(" + x0(d["x_dim"]) + ",0)"; }); + + state.selectAll("rect") + .data(function(d) { return d.ages; }) + .enter().append("rect") + .attr("class","bar") + .on('mouseover', tip.show) + .on('mouseout', tip.hide) + .transition() + .delay(500) + .attr("width", x1.rangeBand()) + .attr("x", function(d) { return x1(d.name); }) + .attr("y", function(d) { return y(d.value); }) + .attr("height", function(d) { return height - y(d.value); }) + .style("fill", function(d) { return color(d.name); }); + + // var legend = svg.selectAll(".legend") + // .data(ageNames.slice().reverse()) + // .enter().append("g") + // .attr("class", "legend") + // .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + // + // legend.append("rect") + // .attr("x", width - 18) + // .attr("width", 18) + // .attr("height", 18) + // .style("fill", color); + // + // legend.append("text") + // .attr("x", width - 24) + // .attr("y", 9) + // .attr("dy", ".35em") + // .style("text-anchor", "end") + // .text(function(d) { return d; }); + +} diff --git a/public/modules/graphs/gitOtherGraphs_REMOTE_4867.js b/public/modules/graphs/gitOtherGraphs_REMOTE_4867.js new file mode 100644 index 0000000..2b814a2 --- /dev/null +++ b/public/modules/graphs/gitOtherGraphs_REMOTE_4867.js @@ -0,0 +1,227 @@ +function plot_pie_chart(data,graph_details){ + console.log("we are inside the plotting the pie chart"); + console.log(data); + console.log("graph_details",graph_details) + var element = document.getElementById("graph-container"); + console.log(element.clientWidth); + + var width = (0.85*parseInt(element.clientWidth)) , + height = 470, + radius = Math.min(width, height) / 2; + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + + var arc = d3.svg.arc() + .outerRadius(radius - 10) + .innerRadius(radius - radius); + + var pie = d3.layout.pie() + .sort(null) + .value(function(d) { return d[graph_details["measure"]["primary"]["function"]["argument"]]; }); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return ""+"No of Commits in"+" "+ d.data["_id"][graph_details["row"]["name"]] +" :"+" " + d.data[graph_details["measure"]["primary"]["function"]["argument"]] + ""; + }) + + var grouped_data=graph_details["columns"][0]["values"]; + + var svg = d3.select("#graph1").append("svg") + .attr("width", width) + .attr("height", height) + .append("g") + .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); + + svg.call(tip); + + color.domain(grouped_data); + + data.forEach(function(d) { + var y0 = 0; + d.ages = color.domain().map(function(name) { return {name: name, y0: y0, y1: y0 += +d[name]}; }); + d.total = d.ages[d.ages.length - 1].y1; + }); + + + var g = svg.selectAll(".arc") + .data(pie(data)) + .enter().append("g") + .attr("class", "arc") + .on('mouseover', tip.show) + .on('mouseout', tip.hide); + + g.append("path").transition() + .delay(500) + .attr("d", arc) + .style("fill", function(d) { return color( d.data["_id"][graph_details["row"]["name"]]); }); + + // g.append("text") + // // .attr("transform", function(d) { return "translate(" + arc.centriod(d) + ")"; }) + // .attr("transform", function(d) { + // var c = arc.centroid(d), + // x = c[0], + // y = c[1], + // // pythagorean theorem for hypotenuse + // h = Math.sqrt(x*x + y*y); + // return "translate(" + (x/h * radius) + ',' + + // (y/h * radius) + ")"; + // }) + // .attr("dy", ".35em") + // .text(function(d) { return d["data"]["_id"][graph_details["row"]["name"]]}).attr("font-size",12); + // //}); + + legend = svg.selectAll(".legend") + .data(color.domain().slice().reverse()) + .enter().append("g") + .attr("class", "legend") + .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + + legend.append("rect") + .attr("x", width - 18) + .attr("width", 18) + .attr("height", 18) + .style("fill", color); + + legend.append("text") + .attr("x", width - 24) + .attr("y", 9) + .attr("dy", ".35em") + .style("text-anchor", "end") + .text(function(d) { return d; }); + + + function type(d) { + d.recommendCount = +d.recommendCount; + return d; + } +} + +function plot_multibar_graph(data,graph_details){ + console.log("plot_multibar",data); + var element = document.getElementById("graph-container"); + console.log(element.clientWidth); + var margin = {top: 20, right: 60, bottom: 80, left: 60}, + width = (0.85*parseInt(element.clientWidth)) - margin.left - margin.right, + height = 370 - margin.top - margin.bottom; + + var x0 = d3.scale.ordinal() + .rangeRoundBands([0, width], .1); + + var x1 = d3.scale.ordinal(); + + var y = d3.scale.linear() + .range([height, 0]); + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + var xAxis = d3.svg.axis() + .scale(x0) + .orient("bottom"); + + var yAxis = d3.svg.axis() + .scale(y) + .orient("left") + .innerTickSize(-width); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return " " +graph_details["measure"]["primary"]["displayName"]+" "+ d.name + " : " + (d.value) +""; + }) + + var grouped_data=graph_details["columns"][0]["name"]; + + var svg = d3.select("#graph1").append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + svg.call(tip); + + //if (error) throw error; + + var ageNames = d3.keys(data[0]).filter(function(key) { return (key !== "x_dim")&&(key !== "ages")&&(key !== "total"); }); + console.log("agenames"+ageNames); + + data.forEach(function(d) { + d.ages = ageNames.map(function(name) { return {name: name, value: +d[name]}; }); + }); + + x0.domain(data.map(function(d) { return d["x_dim"]; })); + x1.domain(ageNames).rangeRoundBands([0, x0.rangeBand()]); + y.domain([0, d3.max(data, function(d) { return d3.max(d.ages, function(d) { return d.value; }); })]); + + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + height + ")") + .call(xAxis) + .selectAll('text') + .attr("font-size",15); + + svg.append("text") + .attr("font-size",18) + .attr("y", height+20) + .attr("x",width+40) + .style("text-anchor", "end") + .text(graph_details["row"]["displayName"]); + + svg.append("g") + .attr("class", "y axis") + .call(yAxis) + .append("text") + .attr("font-size",15) + .attr("transform", "rotate(-90)") + .attr("y", -60) + .attr("dy", ".71em") + .style("text-anchor", "end") + .text(graph_details["measure"]["primary"]["displayName"]); + + var state = svg.selectAll(".state") + .data(data) + .enter().append("g") + .attr("class", "state") + .attr("transform", function(d) { return "translate(" + x0(d["x_dim"]) + ",0)"; }); + + state.selectAll("rect") + .data(function(d) { return d.ages; }) + .enter().append("rect") + .attr("class","bar") + .on('mouseover', tip.show) + .on('mouseout', tip.hide) + .transition() + .delay(500) + .attr("width", x1.rangeBand()) + .attr("x", function(d) { return x1(d.name); }) + .attr("y", function(d) { return y(d.value); }) + .attr("height", function(d) { return height - y(d.value); }) + .style("fill", function(d) { return color(d.name); }); + + var legend = svg.selectAll(".legend") + .data(ageNames.slice().reverse()) + .enter().append("g") + .attr("class", "legend") + .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + + legend.append("rect") + .attr("x", width - 18) + .attr("width", 18) + .attr("height", 18) + .style("fill", color); + + legend.append("text") + .attr("x", width - 24) + .attr("y", 9) + .attr("dy", ".35em") + .style("text-anchor", "end") + .text(function(d) { return d; }); + +} diff --git a/public/modules/graphs/gitOtherGraphs_REMOTE_4973.js b/public/modules/graphs/gitOtherGraphs_REMOTE_4973.js new file mode 100644 index 0000000..2b814a2 --- /dev/null +++ b/public/modules/graphs/gitOtherGraphs_REMOTE_4973.js @@ -0,0 +1,227 @@ +function plot_pie_chart(data,graph_details){ + console.log("we are inside the plotting the pie chart"); + console.log(data); + console.log("graph_details",graph_details) + var element = document.getElementById("graph-container"); + console.log(element.clientWidth); + + var width = (0.85*parseInt(element.clientWidth)) , + height = 470, + radius = Math.min(width, height) / 2; + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + + var arc = d3.svg.arc() + .outerRadius(radius - 10) + .innerRadius(radius - radius); + + var pie = d3.layout.pie() + .sort(null) + .value(function(d) { return d[graph_details["measure"]["primary"]["function"]["argument"]]; }); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return ""+"No of Commits in"+" "+ d.data["_id"][graph_details["row"]["name"]] +" :"+" " + d.data[graph_details["measure"]["primary"]["function"]["argument"]] + ""; + }) + + var grouped_data=graph_details["columns"][0]["values"]; + + var svg = d3.select("#graph1").append("svg") + .attr("width", width) + .attr("height", height) + .append("g") + .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); + + svg.call(tip); + + color.domain(grouped_data); + + data.forEach(function(d) { + var y0 = 0; + d.ages = color.domain().map(function(name) { return {name: name, y0: y0, y1: y0 += +d[name]}; }); + d.total = d.ages[d.ages.length - 1].y1; + }); + + + var g = svg.selectAll(".arc") + .data(pie(data)) + .enter().append("g") + .attr("class", "arc") + .on('mouseover', tip.show) + .on('mouseout', tip.hide); + + g.append("path").transition() + .delay(500) + .attr("d", arc) + .style("fill", function(d) { return color( d.data["_id"][graph_details["row"]["name"]]); }); + + // g.append("text") + // // .attr("transform", function(d) { return "translate(" + arc.centriod(d) + ")"; }) + // .attr("transform", function(d) { + // var c = arc.centroid(d), + // x = c[0], + // y = c[1], + // // pythagorean theorem for hypotenuse + // h = Math.sqrt(x*x + y*y); + // return "translate(" + (x/h * radius) + ',' + + // (y/h * radius) + ")"; + // }) + // .attr("dy", ".35em") + // .text(function(d) { return d["data"]["_id"][graph_details["row"]["name"]]}).attr("font-size",12); + // //}); + + legend = svg.selectAll(".legend") + .data(color.domain().slice().reverse()) + .enter().append("g") + .attr("class", "legend") + .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + + legend.append("rect") + .attr("x", width - 18) + .attr("width", 18) + .attr("height", 18) + .style("fill", color); + + legend.append("text") + .attr("x", width - 24) + .attr("y", 9) + .attr("dy", ".35em") + .style("text-anchor", "end") + .text(function(d) { return d; }); + + + function type(d) { + d.recommendCount = +d.recommendCount; + return d; + } +} + +function plot_multibar_graph(data,graph_details){ + console.log("plot_multibar",data); + var element = document.getElementById("graph-container"); + console.log(element.clientWidth); + var margin = {top: 20, right: 60, bottom: 80, left: 60}, + width = (0.85*parseInt(element.clientWidth)) - margin.left - margin.right, + height = 370 - margin.top - margin.bottom; + + var x0 = d3.scale.ordinal() + .rangeRoundBands([0, width], .1); + + var x1 = d3.scale.ordinal(); + + var y = d3.scale.linear() + .range([height, 0]); + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + var xAxis = d3.svg.axis() + .scale(x0) + .orient("bottom"); + + var yAxis = d3.svg.axis() + .scale(y) + .orient("left") + .innerTickSize(-width); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return " " +graph_details["measure"]["primary"]["displayName"]+" "+ d.name + " : " + (d.value) +""; + }) + + var grouped_data=graph_details["columns"][0]["name"]; + + var svg = d3.select("#graph1").append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + svg.call(tip); + + //if (error) throw error; + + var ageNames = d3.keys(data[0]).filter(function(key) { return (key !== "x_dim")&&(key !== "ages")&&(key !== "total"); }); + console.log("agenames"+ageNames); + + data.forEach(function(d) { + d.ages = ageNames.map(function(name) { return {name: name, value: +d[name]}; }); + }); + + x0.domain(data.map(function(d) { return d["x_dim"]; })); + x1.domain(ageNames).rangeRoundBands([0, x0.rangeBand()]); + y.domain([0, d3.max(data, function(d) { return d3.max(d.ages, function(d) { return d.value; }); })]); + + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + height + ")") + .call(xAxis) + .selectAll('text') + .attr("font-size",15); + + svg.append("text") + .attr("font-size",18) + .attr("y", height+20) + .attr("x",width+40) + .style("text-anchor", "end") + .text(graph_details["row"]["displayName"]); + + svg.append("g") + .attr("class", "y axis") + .call(yAxis) + .append("text") + .attr("font-size",15) + .attr("transform", "rotate(-90)") + .attr("y", -60) + .attr("dy", ".71em") + .style("text-anchor", "end") + .text(graph_details["measure"]["primary"]["displayName"]); + + var state = svg.selectAll(".state") + .data(data) + .enter().append("g") + .attr("class", "state") + .attr("transform", function(d) { return "translate(" + x0(d["x_dim"]) + ",0)"; }); + + state.selectAll("rect") + .data(function(d) { return d.ages; }) + .enter().append("rect") + .attr("class","bar") + .on('mouseover', tip.show) + .on('mouseout', tip.hide) + .transition() + .delay(500) + .attr("width", x1.rangeBand()) + .attr("x", function(d) { return x1(d.name); }) + .attr("y", function(d) { return y(d.value); }) + .attr("height", function(d) { return height - y(d.value); }) + .style("fill", function(d) { return color(d.name); }); + + var legend = svg.selectAll(".legend") + .data(ageNames.slice().reverse()) + .enter().append("g") + .attr("class", "legend") + .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + + legend.append("rect") + .attr("x", width - 18) + .attr("width", 18) + .attr("height", 18) + .style("fill", color); + + legend.append("text") + .attr("x", width - 24) + .attr("y", 9) + .attr("dy", ".35em") + .style("text-anchor", "end") + .text(function(d) { return d; }); + +} diff --git a/public/modules/graphs/gitplotGraph.js b/public/modules/graphs/gitplotGraph.js new file mode 100644 index 0000000..28d3509 --- /dev/null +++ b/public/modules/graphs/gitplotGraph.js @@ -0,0 +1,351 @@ +function plotting_stacked_graph(data,graph_details){ + //console.log(data); + console.log("graph_details",graph_details); + + var element = document.getElementById("graph-container"); + var margin = {top: 60, right: 60, bottom: 180, left: 80}, + width = (0.89*parseInt(element.clientWidth)) - margin.left - margin.right, + height = 470 - margin.top - margin.bottom; + + var x = d3.scale.ordinal() + .rangeRoundBands([0, width], .1, .3); + + var y = d3.scale.linear() + .rangeRound([height, 0]); + + var color = d3.scale.ordinal() + .range(["#72B01D", "#ADE25D", "#317B22", "#FCEC52", "#a05d56", "#d0743c", "#ff8c00"]); + // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); + + var xAxis = d3.svg.axis() + .scale(x) + .orient("bottom"); + + var yAxis = d3.svg.axis() + .scale(y) + .orient("left") + .innerTickSize(-width);; + console.log(data); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return " "+graph_details["measure"]["primary"]["displayName"]+" "+ d.name + " : " + (d.y1-d.y0) +""; + }) + + var grouped_data=graph_details["columns"][0]["values"]; + //console.log(sec_grouped_data); + + d3.selectAll("svg").remove(); + var svg = d3.select("#graph").append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + svg.call(tip); + + // d3.json("./data.json", function(error, data) { + //if (error) throw error; + + color.domain(grouped_data); + + data.forEach(function(d) { + var y0 = 0; + d.ages = color.domain().map(function(name) { return {name: name, y0: y0, y1: y0 += +d[name]}; }); + d.total = d.ages[d.ages.length - 1].y1; + }); + + data.sort(function(a, b) { return b.total - a.total; }); + + x.domain(data.map(function(d) { return d["x_dim"]; })); + y.domain([0, d3.max(data, function(d) { return d.total; })]); + + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + height + ")") + .call(xAxis) + .selectAll('text') + .attr("transform","rotate(-35)") + .attr("x",-50) + .attr("font-size",15) + // .call(wrap, x.rangeBand()); + + svg.append("text") + .attr("font-size",15) + .attr("x",width-70) + .attr("y",height+75) + .attr("fill", "#aaa") + .text(graph_details["row"]["displayName"]); + + svg.append("g") + .attr("class", "y axis") + .call(yAxis) + .append("text") + .attr("font-size",15) + .attr("transform", "rotate(-90)") + .attr("y",-60) + .attr("dy", ".71em") + .style("text-anchor", "end") + .text(graph_details["measure"]["primary"]["displayName"]); + + var country = svg.selectAll(".country") + .data(data) + .enter().append("g") + .attr("class", "g") + .attr("transform", function(d) { return "translate(" + x(d["x_dim"]) + ",0)"; }); + + country.selectAll("rect") + .data(function(d) { return d.ages; }) + .enter().append("rect") + .attr("class","bar") + .attr("width", x.rangeBand()) + .on('mouseover', tip.show) + .on('mouseout', tip.hide) + .transition() + .delay(500) + .attr("y", function(d) { return y(d.y1); }) + .attr("height", function(d) { return y(d.y0) - y(d.y1); }) + .style("fill", function(d) { return color(d.name); }); + + + console.log(" chumma"); + + // var legend = svg.selectAll(".legend") + // .data(color.domain().slice().reverse()) + // .enter().append("g") + // .attr("class", "legend") + // .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + // + // legend.append("rect") + // .attr("x", width - 18) + // .attr("width", 18) + // .attr("height", 18) + // .style("fill", color); + // + // legend.append("text") + // .attr("x", width - 24) + // .attr("y", 9) + // .attr("dy", ".35em") + // .style("text-anchor", "end") + // .text(function(d) { return d; }); + + // }); + } + +function plotting_graph(data,graph_details){ + + console.log(graph_details); + var element = document.getElementById("graph"); + console.log(element.clientWidth); + var margin = {top: 40, right: 60, bottom: 120, left: 60}, + width = (0.89*parseInt(element.clientWidth)) - margin.left - margin.right, + height =470 - margin.top - margin.bottom; + + //var formatPercent = d3.format(".0%"); + + var x = d3.scale.ordinal() + .rangeRoundBands([0, width], .1); + + var y = d3.scale.linear() + .range([height, 0]); + + var xAxis = d3.svg.axis() + .scale(x) + .orient("bottom"); + + var yAxis = d3.svg.axis() + .scale(y) + .orient("left") + .innerTickSize(-width);; + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return ""+graph_details["measure"]["primary"]["function"]["argument"].substring(0,6).concat("s")+" :"+" " + d[graph_details["measure"]["primary"]["function"]["argument"]] + ""; + }) + + d3.selectAll('svg').remove(); + var svg = d3.select("#graph").append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + svg.call(tip); + + //d3.json("./test.json", function(error, data) { + console.log(data); + x.domain(data.map(function(d) { return d["_id"][graph_details["row"]["name"]]; })); + y.domain([0, d3.max(data, function(d) { return d[graph_details["measure"]["primary"]["function"]["argument"]]; })]); + + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + height + ")") + .call(xAxis) + .selectAll('text') + .attr("transform","rotate(-35)") + .attr("x",-60) + .attr("font-size",14); + + svg.append("text") + .attr("font-size",15) + .attr("x",width-70) + .attr("y",height+75) + .attr("fill", "#aaa") + .text(graph_details["row"]["displayName"]); + + svg.append("g") + .attr("class", "y axis") + .call(yAxis) + .append("text") + .attr("transform", "rotate(-90)") + .attr("y",-40) + .attr("x",-50) + .attr("dx", -50) + .attr("dy", ".35em") + //.style("text-anchor", "end") + .text(graph_details["measure"]["primary"]["function"]["argument"].substring(0,6).concat("s")) + .attr("font-size",15); + + + svg.selectAll(".bar") + .data(data) + .enter().append("rect").on('mouseover', tip.show) + .on('mouseout', tip.hide) + .attr("class", "bar") + .transition() + .delay(500) + .attr("x", function(d) { return x(d["_id"][graph_details["row"]["name"]]); }) + .attr("width", x.rangeBand()) + .attr("y", function(d) { return y(d[graph_details["measure"]["primary"]["function"]["argument"]]); }) + .attr("height", function(d) { return height - y(d[graph_details["measure"]["primary"]["function"]["argument"]]); }); + + + //}); +} + + + ///////////////////////////////////////////////////////////////////////////older plotting method +// var margin = {top: 40, right: 20, bottom: 30, left: 40}, +// width = 760 - margin.left - margin.right, +// height = 500 - margin.top - margin.bottom; +// +// var formatPercent = d3.format(".0%"); +// +// var x = d3.scale.ordinal() +// .rangeRoundBands([0, width], .1); +// +// var y = d3.scale.linear() +// .range([height, 0]); +// +// var xAxis = d3.svg.axis() +// .scale(x) +// .orient("bottom"); +// +// var yAxis = d3.svg.axis() +// .scale(y) +// .orient("left"); +// //.tickFormat(formatPercent); +// +// var tip = d3.tip() +// .attr('class', 'd3-tip') +// .offset([-10, 0]) +// .html(function(d) { +// return "Frequency: " + d.recommendCount + ""; +// }) +// d3.selectAll("svg").remove(); +// var svg = d3.select("#graph").append("svg") +// .attr("width", width + margin.left + margin.right) +// .attr("height", height + margin.top + margin.bottom) +// .append("g") +// .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); +// +// svg.call(tip); +// +// x.domain(data.map(function(d) { return d["_id"]; })); +// y.domain([0, d3.max(data, function(d) { return d["recommendCount"]; })]); +// +// svg.append("g") +// .attr("class", "x axis") +// .attr("transform", "translate(0," + height + ")") +// .call(xAxis); +// +// svg.append("g") +// .attr("class", "y axis") +// .call(yAxis) +// .append("text") +// .attr("transform", "rotate(-90)") +// .attr("y", 6) +// .attr("dy", ".71em") +// .style("text-anchor", "end") +// .text("Frequency"); +// +// svg.selectAll(".bar") +// .data(data) +// .enter().append("rect") +// .attr("class", "bar") +// .attr("x", function(d) { return x(d["_id"]); }) +// .attr("width", x.rangeBand()) +// .attr("y", function(d) { return y(d.recommendCount); }) +// .attr("height", function(d) { return height - y(d.recommendCount); }) +// .on('mouseover', tip.show) +// .on('mouseout', tip.hide) +// +// +// function type(d) { +// d.recommendCount = +d.recommendCount; +// return d; +// } +// +// plot_pie_chart(data) +// } +// +// function plot_pie_chart(data){ +// console.log("we are inside the plotting the pie chart"); +// console.log(data); +// var width = 760, +// height = 500, +// radius = Math.min(width, height) / 2; +// +// var color = d3.scale.ordinal() +// .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); +// +// var arc = d3.svg.arc() +// .outerRadius(radius - 10) +// .innerRadius(radius - 70); +// +// var pie = d3.layout.pie() +// .sort(null) +// .value(function(d) { return d.recommendCount; }); +// +// var svg = d3.select("#graph1").append("svg") +// .attr("width", width) +// .attr("height", height) +// .append("g") +// .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); +// +// // d3.csv("data.csv", type, function(error, data) { +// // if (error) throw error; +// +// var g = svg.selectAll(".arc") +// .data(pie(data)) +// .enter().append("g") +// .attr("class", "arc"); +// +// g.append("path") +// .attr("d", arc) +// .style("fill", function(d) { return color(d.data["_id"]); }); +// +// g.append("text") +// .attr("transform", function(d) { return "translate(" + arc.centroid(d) + ")"; }) +// .attr("dy", ".35em") +// .text(function(d) { return d.data["_id"]; }); +// //}); +// +// function type(d) { +// d.recommendCount = +d.recommendCount; +// return d; +// } diff --git a/public/modules/graphs/rateGraphCode.js b/public/modules/graphs/rateGraphCode.js new file mode 100644 index 0000000..30111b6 --- /dev/null +++ b/public/modules/graphs/rateGraphCode.js @@ -0,0 +1,124 @@ +/*Copyright 2016 Wipro Limited, NIIT Limited + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +This code is written by Ashish Gupta, Tarun Mohandas, Suriya Prakash, Srinivasa Burli, Jishnu Surendran and Bhairavi Balakrishnan*/ + +createGraph = function(data) +{ + d3.select('#somegraph').remove(); + + var margin = {top: 20, right: 100, bottom: 30, left: 80}, + width = 800 - margin.left - margin.right, + height = 400 - margin.top - margin.bottom; + + var x0 = d3.scale.ordinal() + .rangeRoundBands([0, width], .1); + + var x1 = d3.scale.ordinal(); + + var y = d3.scale.linear() + .range([height, 0]); + + var color = d3.scale.category10(); + + var xAxis = d3.svg.axis() + .scale(x0) + .orient("bottom"); + + var yAxis = d3.svg.axis() + .scale(y) + .orient("left"); + + var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([-10, 0]) + .html(function(d) { + return "Size: " + d.value + ""; + }) + + var svg = d3.select("div #main").append("svg") + .attr('id','somegraph') + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + svg.call(tip); + + var ageNames = d3.keys(data[0]).filter(function(key) { return key !== "period"; }); + + data.forEach(function(d) { + d.ages = ageNames.map(function(name) { return {name: name, value: +d[name]}; }); + }); + + x0.domain(data.map(function(d) { return d.period; })); + x1.domain(ageNames).rangeRoundBands([0, x0.rangeBand()]); + y.domain([0, d3.max(data, function(d) { return d3.max(d.ages, function(d) { return d.value; }); })]); + + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + height + ")") + .call(xAxis); + + svg.append("g") + .attr("class", "y axis") + .call(yAxis) + .append("text") + .attr("transform", "rotate(-90)") + .attr("y", 6) + .attr("dy", ".71em") + .style("text-anchor", "end") + .text("Number of Logs"); + + var period = svg.selectAll(".period") + .data(data) + .enter().append("g") + .attr("class", "period") + .attr("transform", function(d) { return "translate(" + x0(d.period) + ",0)"; }); + + period.selectAll("rect") + .data(function(d) { return d.ages; }) + .enter().append("rect") + .attr("width", x1.rangeBand()) + .attr("x", function(d) { return x1(d.name); }) + .attr("y", function(d) { return y(d.value); }) + .attr("height", function(d) { return height - y(d.value); }) + .style("fill", function(d) { return color(d.name); }); + + period.selectAll('rect') + .on('mouseover', tip.show) + .on('mouseout', tip.hide); + + var legend = svg.selectAll(".legend") + .data(ageNames.slice().reverse()) + .enter().append("g") + .attr("class", "legend") + .attr("transform", function(d, i) { return "translate(0," + i * 20 + ")"; }); + + legend.append("rect") + .attr("x", width - 18) + .attr("width", 18) + .attr("height", 18) + .style("fill", color) + .attr("transform", "translate(100,-20)"); + + legend.append("text") + .attr("x", width - 24) + .attr("y", 9) + .attr("dy", ".35em") + .style("text-anchor", "end") + .text(function(d) { return d; }) + .attr("transform", "translate(100,-20)"); + +} diff --git a/public/modules/images/filters/aptCache/addParaFilter.js b/public/modules/images/filters/aptCache/addParaFilter.js new file mode 100644 index 0000000..f9eff1c --- /dev/null +++ b/public/modules/images/filters/aptCache/addParaFilter.js @@ -0,0 +1,58 @@ +/*Copyright 2016 Wipro Limited, NIIT Limited + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +This code is written by Ashish Gupta, Tarun Mohandas, Suriya Prakash, Srinivasa Burli, Jishnu Surendran and Bhairavi Balakrishnan*/ + +angular.module('aptLogApp').filter('addPara',function(){ + return function(type,year,month){ + if(type==="logRateData"){ + if(month===""){ + return "This graph shows the number of apt logs grouped by outgoing requests and those cached by the server in all of "+year; + } + else{ + return "This graph shows the number of apt logs grouped by outgoing requests and those cached by the server in all of "+month+" in the year "+year; + } + } + else if(type==="dataRateData"){ + if(month===""){ + return "This graph shows the data size of apt logs grouped by outgoing requests and those cached by the server in all of "+year; + } + else{ + return "This graph shows the data size of apt logs grouped by outgoing requests and those cached by the server in all of "+month+" in the year "+year; + } + } + else if(type==="packageCount"){ + if(month===""){ + return "This table shows the number of apt logs cached by the server organized by package details for all of "+year; + } + else{ + return "This table shows the number of apt logs cached by the server organized by package details for all of "+month+" in the year "+year; + } + } + else if(type==="packageAnalytics"){ + if(month===""){ + return "This table shows the number of apt logs cached by the server organized by package and operating system for all of "+year; + } + else{ + return "This table shows the number of apt logs cached by the server organized by package and operating system for all of "+month+" in the year "+year; + } + } + } +}); + +angular.module('aptLogApp').filter('showLinks',function(){ + return function(tab){ + return angular.lowercase(tab.split(' ').join('')); + } +}); diff --git a/public/modules/images/filters/nginx/logListing/logListingFilters.js b/public/modules/images/filters/nginx/logListing/logListingFilters.js new file mode 100644 index 0000000..b3b7503 --- /dev/null +++ b/public/modules/images/filters/nginx/logListing/logListingFilters.js @@ -0,0 +1,69 @@ +/*Copyright 2016 Wipro Limited, NIIT Limited + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +This code is written by Prateek Reddy Yammanuru, Shiva Manognya Kandikuppa, Uday Kumar Mydam, Nirup TNL, Sandeep Reddy G, Deepak Kumar*/ + +angular.module('logAggregator') +.filter('sizeFilter',function() { + return function(input){ + size=parseInt(input)/8; + if (size>1000 && size<1000000) { + size = parseFloat(size)/1000; + size = (size).toFixed(2)+ " KB" ; + } + else if (size<1000) { + size = size + " B" ; + } + else if (size>1000000) { + size = parseFloat(size)/1000000; + size = (size).toFixed(2)+ " MB" ; + } + return size; + }//close fn input +}) +.filter('agentFilter',function(){ + return function(input){ + temp = input; + title = ""; + if(temp.indexOf("Chrome") != -1) + { + title = "Chrome"; + } + else if (temp.indexOf("Safari") != -1) + { + title = "Safari"; + } + else if (temp.indexOf("Trident") != -1) + { + title = "IE"; + } + else if (temp.indexOf("Vagrant") != -1) + { + title = "Others"; + } + else if (temp.indexOf("Opr") != -1) + { + title = "Opera"; + } + else if (temp.indexOf("-") != -1) + { + title = "Others"; + } + else + { + title = "Mozilla"; + } + return title; + } +}); diff --git a/public/modules/images/log_aggregator_logo.png b/public/modules/images/log_aggregator_logo.png new file mode 100644 index 0000000..43f4dd5 Binary files /dev/null and b/public/modules/images/log_aggregator_logo.png differ diff --git a/public/modules/images/logo.png b/public/modules/images/logo.png new file mode 100644 index 0000000..c5da111 Binary files /dev/null and b/public/modules/images/logo.png differ diff --git a/public/routes/logAggregator.routes.js b/public/routes/logAggregator.routes.js new file mode 100755 index 0000000..e15a27c --- /dev/null +++ b/public/routes/logAggregator.routes.js @@ -0,0 +1,153 @@ +/*Copyright 2016 Wipro Limited, NIIT Limited + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +This code is written by Prateek Reddy Yammanuru, Shiva Manognya Kandikuppa, Uday Kumar Mydam, Nirup TNL, Sandeep Reddy G, Deepak Kumar + and updated by Ashish Gupta, Tarun Mohandas, Suriya Prakash, Srinivasa Burli, Jishnu Surendran and Bhairavi Balakrishnan*/ + +angular.module('logAggregator').config(function($stateProvider, $urlRouterProvider){ + $urlRouterProvider.otherwise('/login'); + $stateProvider + .state('login',{ + url: '/login', + templateUrl : 'views/auth/auth.view.html', + controller : 'authController' + }) + .state('serviceConfig',{ + url: '/serviceConfig', + templateUrl : 'views/auth/serviceConfig.view.html', + controller : 'serviceConfigController' + }) + .state('serviceConfig.gittab',{ + url: '/gittab', + templateUrl : 'views/auth/gitServiceConfig.html' + }) + .state('serviceConfig.gittabedit',{ + url: '/gittabedit', + templateUrl : 'views/auth/gitServiceConfigEdit.html' + }) + .state('serviceConfig.gittabdbedit',{ + url: '/gittabdbedit', + templateUrl : 'views/auth/gitServiceConfigDbEdit.html' + }) + .state('serviceConfig.gittabAuthOedit',{ + url: '/gittabAuthOedit', + templateUrl : 'views/auth/gitServiceConfigAuthOEdit.html' + }) + .state('serviceConfig.nginxtab',{ + url: '/nginxtab', + templateUrl : 'views/auth/nginxServiceConfig.html' + }) + .state('serviceConfig.nginxtabedit',{ + url: '/nginxtabedit', + templateUrl : 'views/auth/nginxServiceConfigEdit.html' + }) + .state('serviceConfig.appgittab',{ + url: '/appgittab', + templateUrl : 'views/auth/appgitServiceConfig.html' + }) + .state('serviceConfig.appgittabedit',{ + url: '/appgittabedit', + templateUrl : 'views/auth/appgitServiceConfigEdit.html' + }) + .state('changePassword',{ + url: '/changePassword', + templateUrl : 'views/auth/changePassword.view.html', + controller : 'changePasswordController' + }) + .state('aboutus',{ + url: '/aboutus', + templateUrl : 'views/auth/aboutus.view.html', + controller: 'aboutusController' + }) + .state('errorhandler',{ + url: '/errorhandler', + templateUrl : 'views/auth/error.view.html', + controller : 'errorHandlerController' + }) + .state('NginxLogStatistics',{ + url: '/NginxLogStatistics', + templateUrl: 'views/nginx/NginxLogStatisticsTabs/NginxLogStatisticsTabs.html', + controller : 'NginxLogStatisticsController' + }) + .state('GitLogStatistics',{ + url: '/GitLogStatistics', + templateUrl: 'views/gitLog/mainPage/mainPage.view.html', + controller : 'myController' + }) + .state('dashboardWizard',{ + url: '/dashboardWizard', + templateUrl: 'views/gitLog/dashboardWizard/dashboardWizard.html', + controller : 'wizardController' + }) + .state('profile',{ + url: '/profile', + templateUrl: 'views/gitLog/profile/profile.view.html', + controller : 'profileMain' + }) + .state('profileEdit',{ + url: '/profileEdit', + templateUrl: 'views/gitLog/profileEdit/profileEdit.view.html', + controller : 'profileEdit' + }) + .state('NginxLogStatistics.useragent',{ + url: '/useragent', + templateUrl : 'views/nginx/userAgent/userAgent.view.html', + controller : 'userAgentController' + }) + .state('NginxLogStatistics.loglisting',{ + url: '/loglisting', + templateUrl : 'views/nginx/logListing/logListing.view.html', + controller : 'logController' + }) + .state('NginxLogStatistics.trafficrate',{ + url: '/trafficrate', + templateUrl : 'views/nginx/trafficRate/trafficRate.view.html', + controller : 'trafficRateController' + }) + .state('AptLogStatistics',{ + url: '/AptLogStatistics', + templateUrl: 'views/aptCache/AptLogStatisticsTabs/AptLogStatisticsTabs.html', + controller : 'AptLogStatisticsController' + }) + .state('AptLogStatistics.requestrate',{ + url: '/requestrate', + templateUrl : 'views/aptCache/logRate/allLogs.html', + controller: 'logRateController' + }) + .state('AptLogStatistics.packageanalytics',{ + url: '/packageanalytics', + templateUrl : 'views/aptCache/packageAnalytics/packageAnalytics.html', + controller: 'packageAnalyticsController' + }) + .state('AptLogStatistics.datarate',{ + url: '/datarate', + templateUrl : 'views/aptCache/dataRate/allData.html', + controller: 'dataRateController' + }) + .state('AptLogStatistics.packagerepository',{ + url: '/packagerepository', + templateUrl : 'views/aptCache/packageRepository/packageRepository.html', + controller: 'repositoryController' + }) + .state('AptLogStatistics.packagecount',{ + url: '/packagecount', + templateUrl : 'views/aptCache/packageCount/packageCount.html', + controller: 'packageCountController' + }) + .state('liveQueryWizard',{ + url: '/liveQueryWizard', + templateUrl: 'views/realTimeLogs/queryBuilder/liveQueryWizard.html', + controller : 'liveQueryController' + }); +}); diff --git a/public/services/realTimeLogs/queryBuilder/queryBuilderService b/public/services/realTimeLogs/queryBuilder/queryBuilderService new file mode 100644 index 0000000..e69de29 diff --git a/public/stylesheets/queryBuilder/queryBuilder.css b/public/stylesheets/queryBuilder/queryBuilder.css new file mode 100644 index 0000000..366b629 --- /dev/null +++ b/public/stylesheets/queryBuilder/queryBuilder.css @@ -0,0 +1,25 @@ +.group{ + background-color: #fff; + padding: 15px; + border-radius: 5px; + border: solid 1px #666; +} + +.group-conditions{ + margin-left: 20px; +} +.widcheck{ +} + +.alert-group{ + margin-top: 10px; + margin-bottom: 10px; + border-color: rgb(192, 152, 83); + border-color: rgb(251, 238, 213); + border-color: rgb(220, 200, 150); +} + +.condition, .group{ + margin-top: 15px; + margin-bottom: 15px; +} diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index 5a3dc1d..d70632b 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -6,7 +6,503 @@ #tabLog { border-collapse: collapse; width: 100%; +<<<<<<< Updated upstream margin-top: 10px; +======= + line-height: 1; + color: rgba(0, 0, 0, 0.8); + content: "\25BC"; + position: absolute; + text-align: center; + } + + /* Style northward tooltips differently */ + .d3-tip.n:after { + margin: -1px 0 0 0; + top: 100%; + left: 0; + } + + a:link{ + text-decoration: none; + } + a:visited{ + text-decoration: none; + } + + + /*.axis path, + .axis line { + fill: none; + stroke: #000; + shape-rendering: crispEdges; + }*/ + + .bar { + fill: #00e600; + } + + .simply{ + margin-top: 40px; + } + + .bar:hover { + fill: #ff0000; + } + +.wrapper{ + margin-top:60px; + margin-left:20px; +} +.dashboardWizardRow{ + margin-top:120px; +} +.liveQueryWizardRow{ + margin-top:120px; +} + .buttom_css{ + height:50px; + width:200px; + } + +html, +body { + min-height: 100%; + background-color: #fff; +} +body::-webkit-scrollbar { + width: 12px; +} +body::-webkit-scrollbar-track { + background-color: #eaeaea; + border-left: 1px solid #ccc; +} +body::-webkit-scrollbar-thumb { + background-color: #ccc; +} +body::-webkit-scrollbar-thumb:hover { + background-color: #aaa; +} +body { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + scrollbar-face-color: #000000; + font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-weight: 400; + overflow-x: hidden; + overflow-y: auto; +} +/* H1 - H6 font */ +h1, +h2, +h3, +h4, +h5, +h6, +.h1, +.h2, +.h3, +.h4, +.h5, +.h6 { + font-family: 'Source Sans Pro', sans-serif; +} + +/*navbar*/ +.navbar-default{ + background-color: #3c8dbc; + color: #ffffff; + border: 0px; +} +.navbar-default .navbar-nav >li>a:hover, .navbar-default .navbar-nav >li>a:active, .navbar-default .navbar-nav >li>a:focus{ + background-color: #337ab7; +} +.navbar-default .navbar-nav >.open>li>a:hover, .navbar-default .navbar-nav >.open>li>a:active, .navbar-default .navbar-nav >.open>li>a:focus{ + background-color: #337ab7; +} +.navbar-default .navbar-nav>.open>a, .navbar-default .navbar-nav>.open>a:focus, .navbar-default .navbar-nav>.open>a:hover{ + background-color: #337ab7; +} +.navbar-brand,.navbar +{ + padding-left:15px; +} +.navbar-right{ + margin-right: 0px; +} +.navbar-nav li a{ + color: #ffffff !important; +} + +.navbar-nav li.active a{ + background-color: #38474e !important; + color:#fff !important; + } + +.btn-default{ + margin: 10px; + background: #ccc; + border: 0px; + color: #ffffff; +} +.dropdown-menu li a{ + color: #333 !important; +} + +/* Navbar styling end */ +/* About us page */ +div.card { + margin: auto; + width: 80%; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); + text-align: center; + margin-top: 150px; +} + +div.header { + background-color: #4CAF50; + color: white; + padding: 5px; + font-size: 25px; +} + +div.aboutusContainer { + padding: 30px; + font-size: 18px; +} +/* About us page styling end */ + +#main-tab{ + margin-top: 100px; +} +#main-tab .tab-content{ + width: 100% !important; + height: 900px; + height: auto; + overflow: hidden; + border:1px solid #e3e3e3; + border-top: none; +} +#main-tab .nav-tabs li { + text-align: center; + width:20%; +} +#main-tab .nav-tabs li a{ + font-size: 16px; + padding-bottom: 15px; + color:#337ab7; +} +.change-pass{ + font-size: 16px; + padding-top: 17px !important; +} +.tab-content { + background-color: #F8F8F8; +} +.tab-pane { + height: 100%; + background-color: #f5f5f5; +} +.tab-pane .criteriaPane { + border-radius: 0px; + border: 0px; + border-bottom: 2px solid lightgrey; + border-left: 1px solid lightgrey; + height: 50px; + font-size: 0.83em; +} +.tab-pane .criteriaGroup { + width: 20%; + height: 100%; +} +.wrap { + width: 80%; + float: right; + height: 100%; + border-left: 1px solid lightgrey; + text-align: center; + background-color: #f5f5f5; +} +.wrap .page-header { + margin: 0px; +} +.wrap .well { + margin: 20px; +} + +.well::-webkit-scrollbar { + width: 12px; + background-color: #F5F5F5; +} + +.well::-webkit-scrollbar-track { + -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3) !important; + border-radius: 8px; +} + +.well::-webkit-scrollbar-thumb { + background-color: darkgrey; + border-radius: 8px; + outline: 1px solid slategrey; +} +.wrap svg{ + display: block; + margin: auto; + margin: 15px auto; +} +.nav li.active a{ + color:#fff !important; + background-color:#555 !important; + padding-bottom: 18px; +} +.filters .dropdown { + display: inline; +} +.AgentProgressIcon{ + margin-top: 13px; +} + +/*tooltip styling*/ +.d3-tip { + line-height: 1; + font-weight: bold; + padding: 12px; + background: rgba(0, 0, 0, 0.8); + color: #fff; + border-radius: 2px; +} +/* Creates a small triangle extender for the tooltip */ +.d3-tip:after { + box-sizing: border-box; + display: inline; + font-size: 10px; + width: 100%; + line-height: 1; + color: rgba(0, 0, 0, 0.8); + content: "\25BC"; + position: absolute; + text-align: center; +} +/* Style northward tooltips differently */ +.d3-tip.n:after { + margin: -1px 0 0 0; + top: 100%; + left: 0; +} +.noBorder { + border-left: 0px !important; +} + +/*--------------------------------------- listing page stylesheet------------------------------------------------*/ +.logButtonStyle{ + border-radius: 0px; + border: 0px; + height: 50px; + width: 100%; + margin-left: 0; + text-align: left; + white-space: normal; + margin-top: -0.5px; + color: grey !important; + background-color: #ffffff !important; + margin: 0px; +} +.buttonClicked{ + color: blue; +} +.logcontainer{ + margin-top: 0px; + font-size: 0.80em; + font-family: sans-serif; + padding: 0; + line-height: 40px; + float: left; + width:28%; + text-align: justify; + overflow-y:scroll; + height:500px; +} +/* scroll bar css */ +.logcontainer::-webkit-scrollbar { + width: 1.2em; + background-color: #F5F5F5; +} + +.logcontainer::-webkit-scrollbar-track { + -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3) !important; + border-radius: 8px; +} + +.logcontainer::-webkit-scrollbar-thumb { + background-color: darkgrey; + border-radius: 8px; + outline: 1px solid slategrey; +} +/* scroll bar css ends*/ + +.logcontainer table{ + border-collapse:inherit; +} + +.PathDataTable{ + margin-top: 0px; + width: 72%; + float: left; + height: 500px; + overflow: scroll; + margin-right: 0px; + text-align: center; + border-top: 1px solid lightgrey; +} + +/* scroll bar css */ +.PathDataTable::-webkit-scrollbar { + width: 1.2em; + background-color: #F5F5F5; +} + +.PathDataTable::-webkit-scrollbar-track { + -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3) !important; + border-radius: 8px; +} + +.PathDataTable::-webkit-scrollbar-thumb { + background-color: darkgrey; + outline: 1px solid slategrey; + border-radius: 8px; +} + +/* scroll bar css ends*/ + +table{ + width: 1000; + border:0px; + width:100%; +} + +.OnMouseEnter { + background-color: lightgrey !important; +} +OnMouseOut{ + background-color: white !important; +} +.clickedbutton{ + border-left-color:blue; + border-left-width: 4px; + border-left-style: solid; +} +.active1 { + color:lightblue; +} +.PathDataTable td{ + font-size: 12px; + width: auto; +} + +.PathDataTable td:nth-child(7){ + min-width: 80px; +} +.PathDataTable td:nth-child(5){ + max-width: 255px; +} +.PathDataTable th{ + text-transform: capitalize; + height: 50px; +} +td, tr, th{ + border: 1px solid #e3e3e3; + text-align: center; +} +.PathDataTable td,th{ + padding: 2px; +} +.pageno{ + color:black; +} +.currentpage{ + color:white; + background-color: #4CAF50; +} +.pos { + display: table-row !important; + opacity: 1 !important; +} + +.page-header { + margin: 0px; + text-align: center; + background-color: #f5f5f5; +} + +.logListingDataHeadings{ + font-weight: bold !important; +} + +/*----------------------------------------------logListing Stylesheet end------------------------------------------------------------*/ + +/* Traffic Page *******************************************************************************************/ +.LogProgressIcon { + margin: auto; + display: block; + margin-top: 220px; +} + +.changeColour{ + color: white; +} +#dropdownMenu2{ + width: 120px; +} +.dropdown.months{ + width: 50px; + margin: auto; + margin-top: 20px; +} +#requestRate { + min-height: 400px; +} + +.tab-pane h2 { + display: inline-block; + padding-left: 3px; +} + +.tab-pane small{ + display: inline-block; + font-size: 22px; + color: #333; +} + +.dropdown.month_text{ + padding-right: 0px; +} +#clear_filters{ + padding: 10px 10px 10px 0px; + color: #333; +} +.btn{ + font-size: 14px !important; + font-weight: normal !important; +} +#browserShare ,#osShare{ + margin-left: 0px; + color: grey ! important; + background-color: white !important; +} + +#browserShare:hover, #osShare:hover { + color: black ! important; + background-color: lightgrey !important; +} + + +#clear_filters:hover{ + color:#660066; + text-decoration: none; +} +.disableClick{ + pointer-events:none; +>>>>>>> Stashed changes } th { diff --git a/public/views/gitLog/dashboardWizard/dashboardWizard.html b/public/views/gitLog/dashboardWizard/dashboardWizard.html new file mode 100644 index 0000000..28c1284 --- /dev/null +++ b/public/views/gitLog/dashboardWizard/dashboardWizard.html @@ -0,0 +1,173 @@ + +
+ + + + +
+ +
+ +
+
+
+
+ × + Success! Dashboard created. +
+
+
Widget Name
+ + + +
+
+
+
Primary Groupby Field
+
    +
  • + + {{dimObj.displayName}} + + + + + + +
  • +
+
+
+
+
+
Aggregators
+
    +
  • + + {{aggregator.displayName}} + + + + +
  • +
+
+
+
Parameter
+ + + +
+
+
+
+
Secondary Groupby Field
+
    +
  • + + {{dimObj.displayName}} + + + + + + +
  • +
+
+
+
+
+
Filters
+
    +
  • + + {{dimObj.displayName}} + + + + + + +
  • +
+
+
+
+
+
Measures
+
    +
  • + + {{dimension.displayName}} + + + + +
  • +
+
+
+ +
+
+
+ +
+ +
+ +
+ diff --git a/public/views/gitLog/mainPage/mainPage.view.html b/public/views/gitLog/mainPage/mainPage.view.html new file mode 100644 index 0000000..0b84a9d --- /dev/null +++ b/public/views/gitLog/mainPage/mainPage.view.html @@ -0,0 +1,228 @@ + + +
+ + + + + + +
+
+ +
+
+
+
+ +
+
+

{{graph_type_details}}

+
+
+
+ {{description_data}}
+ {{groupedby}}
+ {{filteredby}} +
+
+
+
+
+ +
+
+ + + +
+
+
+ +
+
+
+ +
+
+
+ +
+ + +
+ + +
+
+
+
+
+
+ +
+
+ + +
+ diff --git a/public/views/realTimeLogs/queryBuilder/liveQueryWizard.html b/public/views/realTimeLogs/queryBuilder/liveQueryWizard.html new file mode 100644 index 0000000..fd9d909 --- /dev/null +++ b/public/views/realTimeLogs/queryBuilder/liveQueryWizard.html @@ -0,0 +1,129 @@ + + + +
+ + + + +
+
+ +
+
+ +
+

Angular.js Query Builder

+ +
+ Example Output
+ +
+
+ +
+ +
+
+ + + + + +
+
+ + + +
+ + + +
+
+ +
+ +
+ +
+ diff --git a/query-executor/index.js b/query-executor/index.js new file mode 100644 index 0000000..ec9a336 --- /dev/null +++ b/query-executor/index.js @@ -0,0 +1,93 @@ +var sift = require('sift'); +var _ = require('highland'); +var rollingCount=require('../rollingCount') +var QueryExecutor = function(query) { + var self = this; + self.query = query; + var RC=new Array(); + var RT=new Array(); + self.getPipeline = function() { + return self.createPipeline(self.query); + } + + self.createPipeline = function(query) { + var pipeline = []; + if(query.hasOwnProperty('from') && query.from.hasOwnProperty('where')) { + var sifter = sift(query.from.where); + pipeline.push(_.filter(sifter)); + } + + pipeline.push(_.map(function(obj) { + if(query.eval.val1.rolling.over.time){ + RT.push(new rollingTime(query.eval.val1.rolling.over.time)); //rollingTime not available + } + else { + RC.push(new rollingCount(query.eval.val1.rolling.over.count));//assume every computation is either rollingTime or rollingCount + } + if(query.eval.val2.rolling.over.count){ + RC.push(new rollingCount(query.eval.val1.rolling.over.count)); + } + else { + RT.push(new rollingTime(query.eval.val1.rolling.over.time)); //assume every computation is either rollingTime or rollingCount + } + var siftobj=new Object(); + expkeys=query.select; + siftobj.filter=function(value) { + var temp=new Object(); + for (var i = 0; i < expkeys.length; i++) { + temp[expkeys[i]]=value[expkeys[i]]; + } + var RTCount=0, + RCCount=0; + if(query.eval.val1.rolling.over.time){ + temp.val1=RT[RTCount++][query.eval.val1.rolling.evaluate](value[query.eval.val1.rolling.on]); //rollingTime not available + } + else { + temp.val1=RC[RCCount++][query.eval.val1.rolling.evaluate](value[query.eval.val1.rolling.on]);//assume every computation is either rollingTime or rollingCount + } + if(query.eval.val1.rolling.over.count){ + temp.val2=RC[RCCount++][query.eval.val1.rolling.evaluate](value[query.eval.val1.rolling.on]); //rollingTime not available + } + else { + temp.val2=RT[RTCount++][query.eval.val1.rolling.evaluate](value[query.eval.val1.rolling.on]);//assume every computation is either rollingTime or rollingCount + } + return temp; + } + var data={ + filter:obj + }; + var testQuery=sift(siftobj); + var tempdata=testQuery(data); //testQuery returns object with val1 and val2 set + var condition=query.project.$highlight.$condition; + condition=condition.replace('val1','tempdata.val1'); + condition=condition.replace('val2','tempdata.val2') + //filter that returns true/false depending on query condition + //{val1: {$gte: '$val2'}}//query.project.$highlight.$condition + tempdata.highlight=eval(condition) //highlight set to true/false depending on val1 and val2 + console.log(tempdata); + return tempdata; //object with select parameters and highlight + })); + return _.pipeline.apply(this, pipeline); + }; +}; + +exports = module.exports = QueryExecutor; + + + +// DELETE AFTER: +/*index is greater than 20 and less than or equals to 50: {index: {$gt: 20}, index: {$lte: 50}} // This syntax doesn't work when properties are the same. Use and instead as the following version. +index is greater than 20 and less than or equals to 50: +{ + $and: [ + {index: {$gt: 20}}, + {index: {$lte: 50}} + ] +} +index is greater than 90 or less than 10: +{ + $or: [ + {index: {$gt: 90}}, + {index: {$lt: 10}} + ] +}*/ diff --git a/rollingCount.js b/rollingCount.js new file mode 100644 index 0000000..dfb56d5 --- /dev/null +++ b/rollingCount.js @@ -0,0 +1,165 @@ + + +module.exports=function myfunction(n) +{ + + var arr1= new Array(); + var count=0; + this.sum= function(value) + { + value=parseInt(value); + var length; + length=arr1.length; + if(count=n) + { + var k=count%n; + arr1[k]=value; + var sum=0; + for(var h=0;h=n) + { + var k=count%n; + arr1[k]=value; + var min=99999999999; + for(var h=0;harr1[h]) + { + min=arr1[h]; + } + + } + count++; + return min; + } + + } + + this.max= function(value) + { + value=parseInt(value); + var length; + length=arr1.length; + if(count=n) + { + var k=count%n; + arr1[k]=value; + var max=-99999999999; + for(var h=0;h=n) + { + var k=count%n; + arr1[k]=value; + var sum=0; + for(var h=0;h=n) + { + var k=count%n; + arr1[k]=value; + var sum=0; + for(var h=0;h 0) { + //Calculate past date + pastDate = new Date(); + pastDate.setSeconds(pastDate.getSeconds() - this.windowDuration); + //Compute COUNT + for (var counter = arr.length - 1; counter >= 0; counter--) { + var itemdate = arr[counter].date; + if (Date.parse(itemdate) >= Date.parse(pastDate)) { + if (arr[counter].data !== "") { + datacount += 1; + } + } else { + //console.log("loop3 " + counter); + arr.splice(0, counter + 1); + //console.log(lineArr.length); + } + } + } + } + return datacount; + } + this.sum=function(data){ + //console.log(data); + var sum = 0; + var arr = accumulateByTime(windowDuration, data); + //console.log(arr); + // the array is defined and has at least one element + if (typeof arr !== 'undefined' && arr!==null) { + if (arr.length > 0) { + //Calculate past date + pastDate = new Date(); + pastDate.setSeconds(pastDate.getSeconds() - this.windowDuration); + //Compute SUM + for (var counter = arr.length - 1; counter >= 0; counter--) { + var itemdate = arr[counter].date; + if (Date.parse(itemdate) >= Date.parse(pastDate)) { + if (arr[counter].data !== "") { + sum += parseFloat(arr[counter].data); + } + } else { + //console.log("loop3 " + counter); + arr.splice(0, counter + 1); + //console.log(lineArr.length); + } + } + } + } + return sum; + } + this.avg=function(data){ + //console.log(data); + var sum = 0, + avg = 0, + datacount = 0; + var arr = accumulateByTime(windowDuration, data); + //console.log(arr); + // the array is defined and has at least one element + if (typeof arr !== 'undefined' && arr!==null) { + if (arr.length > 0) { + //Calculate past date + pastDate = new Date(); + pastDate.setSeconds(pastDate.getSeconds() - this.windowDuration); + //Compute AVG + for (var counter = arr.length - 1; counter >= 0; counter--) { + var itemdate = arr[counter].date; + if (Date.parse(itemdate) >= Date.parse(pastDate)) { + if (arr[counter].data !== "") { + sum += parseFloat(arr[counter].data); + datacount += 1; + avg = sum / datacount; + } + } else { + //console.log("loop3 " + counter); + arr.splice(0, counter + 1); + //console.log(lineArr.length); + } + } + } + } + return avg; + } + this.min=function(data){ + //console.log(data); + var min = 0,minArr=[]; + + var arr = accumulateByTime(windowDuration, data); + //console.log(arr); + // the array is defined and has at least one element + if (typeof arr !== 'undefined' && arr!==null) { + if (arr.length > 0) { + //Calculate past date + pastDate = new Date(); + pastDate.setSeconds(pastDate.getSeconds() - this.windowDuration); + //Compute AVG + for (var counter = arr.length - 1; counter >= 0; counter--) { + var itemdate = arr[counter].date; + if (Date.parse(itemdate) >= Date.parse(pastDate)) { + if (arr[counter].data !== "") { + minArr.push(arr[counter].data); + min = Math.min.apply(null, minArr); + } + } else { + //console.log("loop3 " + counter); + arr.splice(0, counter + 1); + //console.log(lineArr.length); + } + } + } + } + return min; + } + this.max=function(data){ + //console.log(data); + var max = 0,maxArr=[]; + + var arr = accumulateByTime(windowDuration, data); + //console.log(arr); + // the array is defined and has at least one element + if (typeof arr !== 'undefined' && arr!==null) { + if (arr.length > 0) { + //Calculate past date + pastDate = new Date(); + pastDate.setSeconds(pastDate.getSeconds() - this.windowDuration); + //Compute AVG + for (var counter = arr.length - 1; counter >= 0; counter--) { + var itemdate = arr[counter].date; + if (Date.parse(itemdate) >= Date.parse(pastDate)) { + if (arr[counter].data !== "") { + maxArr.push(arr[counter].data); + max = Math.max.apply(null, maxArr); + } + } else { + //console.log("loop3 " + counter); + arr.splice(0, counter + 1); + //console.log(lineArr.length); + } + } + } + } + return max; + } +} + +function accumulateByTime(windowDuration, data) { + //creating array if it doesn't exist + + if (typeof lineArr == "undefined" || !(lineArr instanceof Array)) { + lineArr = []; + } + //accumulating data for 10secs + if (typeof data !== 'undefined') { + var obj = {}; + obj.data = data.trim(); + obj.date = new Date(); + + lineArr.push(obj); + } + + if (lineArr.length == 1) { + t0 = new Date(); + } + //Get current time + currentTime = new Date(); + //Check if window active + var diffMs = currentTime.getTime() - t0.getTime(); + if (diffMs < 10) { + //window not yet active + return null; + } else { + //window active now + //return true; + //console.log(lineArr); + return lineArr; + } +} diff --git a/rollingTimeExample.js b/rollingTimeExample.js new file mode 100644 index 0000000..64f9d27 --- /dev/null +++ b/rollingTimeExample.js @@ -0,0 +1,19 @@ +var fs = require('fs'); + + + +var rollingTimeWindow = require('./rollingTime.js'); +//Creating a new instance +var timeWindow1 = new rollingTimeWindow(20); +var timeWindow2 = new rollingTimeWindow(20); +var timeWindow3 = new rollingTimeWindow(20); +var timeWindow4 = new rollingTimeWindow(20); +var timeWindow5 = new rollingTimeWindow(20); +for (var i = 0; i < 100000000; i++) { + var str='0'; + str+=i; + console.log("avg ** "+timeWindow1.avg(str)); + console.log("min ** "+timeWindow2.min(str)); + console.log("max ** "+timeWindow3.max(str)); + console.log("sum ** "+timeWindow4.sum(str)); +} diff --git a/routes/realTimeLogs/queryBuilder/expressions.js b/routes/realTimeLogs/queryBuilder/expressions.js new file mode 100644 index 0000000..f5e403b --- /dev/null +++ b/routes/realTimeLogs/queryBuilder/expressions.js @@ -0,0 +1,37 @@ +var express = require('express'); +var router = express.Router(); +var Expression=require('mongoose').model('Expression'); + + router.post('/save', function(req, res, next) { + req.body.expressions=JSON.parse(req.body.expressions); + req.body.nestedexpressions=JSON.parse(req.body.nestedexpressions); + + var temp=new Expression(req.body) + Expression.addExp(temp,function(err,doc) { + if (err) { + console.error(err); + } + else{ + res.send(doc); + } + }) +}); + + +router.get('/modify', function(req, res, next) { +var search='select * from somethin'; +if(true) +{ +Expression.searchQuery(search,function(err,doc) { + if (!err) { + res.send(doc); + } +}) +} + + + + +}); + +module.exports = router; diff --git a/samplequery.js b/samplequery.js new file mode 100644 index 0000000..f75f926 --- /dev/null +++ b/samplequery.js @@ -0,0 +1,38 @@ +var query = { + + select: ['authorName', 'authorEmail','insertions','deletions'], + eval: { + val1: { + rolling: { + evaluate: 'average', + over: { + count: 10 + }, + on: 'deletions' // measure + } + }, + val2: { + rolling: { + evaluate: 'average', + over: { + count: 10 + }, + on: 'insertions' + } + }, + }, + project: { + $highlight: {$condition: 'tempdata.val1 == tempdata.val2'} + }, + to: 'streamB' +} +module.exports=query; +// var output = { +// dimension1: '', +// dimension2: '', +// measure3: '', +// measure4: '', +// val1: '', +// val2: '', +// $highlight: true // This property should either exist with a true value, or not exist at all. +// } diff --git a/start.js b/start.js new file mode 100644 index 0000000..8589d56 --- /dev/null +++ b/start.js @@ -0,0 +1,38 @@ +var fs = require('fs'); + +//Read Data file +var input = fs.createReadStream('datastream.csv'); + +var rollingTimeWindow = require('./rollingTime.js'); +//Creating a new instance +var timeWindow = new rollingTimeWindow(10); + +readLines(input,timeWindow); +//Function for sending streaming data as input +function readLines(input, timeWindow) { + var remaining = ''; + + input.on('data', function(data) { + remaining += data; + var index = remaining.indexOf('\n'); + var last = 0; + while (index > -1) { + var line = remaining.substring(last, index); + last = index + 1; + + //console.dir(timeWindow); + //console.log(timeWindow.count(line)); + //console.log(timeWindow.sum(line)); + // console.log(timeWindow.avg(line)); + //console.log(timeWindow.min(line)); + console.log(timeWindow.max(line)); + // console.log(timeWindow.StandardDeviation()); + + index = remaining.indexOf('\n', last); + } + remaining = remaining.substring(last); + }); + input.on('end', function() { + + }); +} diff --git a/test/demo.js b/test/demo.js new file mode 100644 index 0000000..e69de29 diff --git a/test/queryParser.spec.js b/test/queryParser.spec.js new file mode 100644 index 0000000..a08202c --- /dev/null +++ b/test/queryParser.spec.js @@ -0,0 +1,68 @@ +var _ = require('highland'); +var QueryExecutor = require('../query-executor'); +var should = require('should'); + +describe('Query Parser', function() { + var inputStream = []; + var i; + for(i=0; i<100; i++) { + inputStream.push({index: i, + insertions:'2', + deletions:'4', + authorName:'rick', + authorEmail:'morph'}); + } + + it('Simple Filter Query', function(done) { + var query = { + from: { + where: { + $and: [ + {index: {$gt: 20}}, + {index: {$lte: 50}} + ], + } + }, + select:['insertions','deletions','authorName','authorEmail'], + eval: { + val1: { + rolling: { + evaluate: 'average', + over: { + count: 10 + }, + on: 'deletions' // measure + } + }, + val2: { + rolling: { + evaluate: 'average', + over: { + count: 10 + }, + on: 'insertions' + } + }, + }, + project: { + // $highlight: {$condition: {val1: {$eq: eval['val2']}}} + $highlight: {$condition: 'val1 ==val2'} + }, + to: 'streamB' + }; +console.log("****************************changed****************************************"); + var executor = new QueryExecutor(query); + + var pipeline = executor.getPipeline(); + + _(inputStream).pipe(pipeline).toArray(function(arr) { + // console.log(arr); + arr.should.be.instanceOf(Array).and.have.lengthOf(30); + var truthy = arr.every(function(x) { + return x>20 || x<=50 + }); + truthy.should.be.true; + done(); + }); + }); +}); diff --git a/trial.js b/trial.js new file mode 100644 index 0000000..39174a1 --- /dev/null +++ b/trial.js @@ -0,0 +1,31 @@ +var rollingCount=require("./rollingCount.js"); + +var ins1=new rollingCount(10); + +var ins2=new rollingCount(10); + +var ins3=new rollingCount(10); + +var ins4=new rollingCount(10); + +var ins5=new rollingCount(10); + + + +for(var j=0;j<50;j++) +{ + + + k= ins1.sum(j); + l=ins2.min(j); + m=ins3.average(j); + n=ins4.standardDeviation(j); + + + console.log("sum-----"+k); + console.log("min---"+l); + console.log("standard---"+n); + console.log("average---"+m); + + +} diff --git a/tryquery.js b/tryquery.js new file mode 100644 index 0000000..a88ac46 --- /dev/null +++ b/tryquery.js @@ -0,0 +1,65 @@ +var sift = require('sift'); +var _ = require('highland'); +var rollingCount = require('./rollingCount'); +// var rollingTime = require('rollingTime'); +var query = require('./samplequery.js'); + +var RC=[],RT=[]; + +if(query.eval.val1.rolling.over.time){ +RT.push(new rollingTime(query.eval.val1.rolling.over.time)); //rollingTime not available +} +else { + RC.push(new rollingCount(query.eval.val1.rolling.over.count));//assume every computation is either rollingTime or rollingCount +} +if(query.eval.val2.rolling.over.count){ +RC.push(new rollingCount(query.eval.val1.rolling.over.count)); +} +else { +RT.push(new rollingTime(query.eval.val1.rolling.over.time)); //assume every computation is either rollingTime or rollingCount +} +var siftobj=new Object(); + +expkeys=query.select; +// console.log(query.eval); + + +siftobj.filter=function(value) { +var temp=new Object(); +for (var i = 0; i < expkeys.length; i++) { + temp[expkeys[i]]=value[expkeys[i]]; +} +var RTCount=0, + RCCount=0; +if(query.eval.val1.rolling.over.time){ +temp.val1=RT[RTCount++][query.eval.val1.rolling.evaluate](value[query.eval.val1.rolling.on]); //rollingTime not available +} +else { + temp.val1=RC[RCCount++][query.eval.val1.rolling.evaluate](value[query.eval.val1.rolling.on]);//assume every computation is either rollingTime or rollingCount +} +if(query.eval.val1.rolling.over.count){ +temp.val2=RC[RCCount++][query.eval.val1.rolling.evaluate](value[query.eval.val1.rolling.on]); //rollingTime not available +} +else { + temp.val2=RT[RTCount++][query.eval.val1.rolling.evaluate](value[query.eval.val1.rolling.on]);//assume every computation is either rollingTime or rollingCount +} + +return temp; +} + + +var data={filter:{ + authorName:'emil', + authorEmail:'some@noone.com', + insertions:'100', + deletions:'9' +} +}; + +var testQuery=sift(siftobj); +for (var i = 0; i < 10; i++) { + console.log(testQuery(data)); +} +// var output=testQuery(data); + +// console.log(output); diff --git a/ttemp.txt b/ttemp.txt new file mode 100644 index 0000000..e69de29 diff --git a/views/footer_includes.ejs b/views/footer_includes.ejs new file mode 100755 index 0000000..0aa8a64 --- /dev/null +++ b/views/footer_includes.ejs @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +