Comparing version 0.0.14 to 0.0.15
@@ -30,3 +30,4 @@ cube.piece.type.area = function(board) { | ||
time.append("input"); | ||
time.append("input") | ||
.property("value", 1440); | ||
@@ -33,0 +34,0 @@ time.append("select").selectAll("option") |
@@ -31,3 +31,4 @@ cube.piece.type.sum = function(board) { | ||
time.append("input"); | ||
time.append("input") | ||
.property("value", 1440); | ||
@@ -34,0 +35,0 @@ time.append("select").selectAll("option") |
@@ -5,3 +5,4 @@ var endpoint = require("./endpoint"), | ||
exports.register = function(db, endpoints) { | ||
var putter = require("./event").putter(db); | ||
var putter = require("./event").putter(db), | ||
poster = post(putter); | ||
endpoints.ws.push( | ||
@@ -11,3 +12,4 @@ endpoint.exact("/1.0/event/put", putter) | ||
endpoints.http.push( | ||
endpoint.exact("POST", "/1.0/event/put", post(putter)), | ||
endpoint.exact("POST", "/1.0/event", poster), | ||
endpoint.exact("POST", "/1.0/event/put", poster), | ||
endpoint.exact("POST", "/collectd", require("./collectd").putter(putter)) | ||
@@ -14,0 +16,0 @@ ); |
@@ -1,8 +0,39 @@ | ||
var endpoint = require("./endpoint"); | ||
var endpoint = require("./endpoint"), | ||
url = require("url"); | ||
var headers = { | ||
"Content-Type": "application/json", | ||
"Access-Control-Allow-Origin": "*" | ||
}; | ||
exports.register = function(db, endpoints) { | ||
var event = require("./event").getter(db), | ||
metric = require("./metric").getter(db); | ||
endpoints.ws.push( | ||
endpoint.exact("/1.0/event/get", require("./event").getter(db)), | ||
endpoint.exact("/1.0/metric/get", require("./metric").getter(db)) | ||
endpoint.exact("/1.0/event/get", event), | ||
endpoint.exact("/1.0/metric/get", metric) | ||
); | ||
endpoints.http.push( | ||
endpoint.exact("GET", "/1.0/metric", metricGet), | ||
endpoint.exact("GET", "/1.0/metric/get", metricGet) | ||
); | ||
function metricGet(request, response) { | ||
var values = [], | ||
expected = metric(url.parse(request.url, true).query, callback); | ||
response.writeHead(expected < 0 ? 400 : 200, headers); | ||
if (expected <= 0) response.end(JSON.stringify([])); | ||
function callback(value) { | ||
if (values.push(value) === expected) { | ||
response.end(JSON.stringify(values.sort(chronological))); | ||
} | ||
} | ||
} | ||
}; | ||
function chronological(a, b) { | ||
return a.time - b.time; | ||
} |
@@ -264,4 +264,4 @@ var util = require("util"), | ||
id = request.id; | ||
if (isNaN(start)) return util.log("invalid start: " + request.start); | ||
if (isNaN(stop)) return util.log("invalid stop: " + request.stop); | ||
if (isNaN(start)) return util.log("invalid start: " + request.start), -1; | ||
if (isNaN(stop)) return util.log("invalid stop: " + request.stop), -1; | ||
@@ -273,4 +273,4 @@ // Parse the expression. | ||
expression = parser.parse(request.expression); | ||
} catch (error) { | ||
return util.log("invalid expression: " + error); | ||
} catch (e) { | ||
return util.log("invalid expression: " + e), -1; | ||
} | ||
@@ -280,3 +280,3 @@ | ||
var tier = tiers[request.step]; | ||
if (!tier) return util.log("invalid step: " + request.step); | ||
if (!tier) return util.log("invalid step: " + request.step), -1; | ||
start = tier.floor(start); | ||
@@ -305,3 +305,8 @@ stop = tier.ceil(stop); | ||
: ("id" in request ? callbackValueId : callbackValue)); | ||
// Return the expected number of values. | ||
var expected = 0; | ||
while ((start = tier.step(start)) < stop) ++expected; | ||
return expected; | ||
}; | ||
}; |
{ | ||
"name": "cube", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "A system for time series visualization using MongoDB, Node and D3.", | ||
@@ -11,3 +11,3 @@ "keywords": ["time series", "visualization"], | ||
"dependencies": { | ||
"d3": "2.6.0", | ||
"d3": "2.7.2", | ||
"mongodb": "0.9.7-1.3", | ||
@@ -14,0 +14,0 @@ "pegjs": "0.6.2", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
693854
10320
+ Addedcontextify@0.0.7(transitive)
+ Addedcssom@0.2.5(transitive)
+ Addedd3@2.7.2(transitive)
+ Addedjsdom@0.2.10(transitive)
- Removedbindings@1.5.0(transitive)
- Removedcontextify@1.0.0(transitive)
- Removedcssom@0.5.0(transitive)
- Removedd3@2.6.0(transitive)
- Removedfile-uri-to-path@1.0.0(transitive)
- Removedjsdom@0.2.9(transitive)
- Removednan@2.22.0(transitive)
- Removeduglify-js@1.1.1(transitive)
- Removedvows@0.5.13(transitive)
Updatedd3@2.7.2