diff --git a/caracal.js b/caracal.js index 2e646c5..0f07691 100644 --- a/caracal.js +++ b/caracal.js @@ -106,6 +106,9 @@ var HANDLERS = { "markSegmentationCount": function() { return dataHandlers.Mark.segmentationCountByExecid; }, + "markPointList": function(){ + return Mark.pointList; + }, "findMarkTypes": function() { return dataHandlers.Mark.findMarkTypes; }, diff --git a/handlers/dataHandlers.js b/handlers/dataHandlers.js index 4e69192..82c6161 100644 --- a/handlers/dataHandlers.js +++ b/handlers/dataHandlers.js @@ -345,6 +345,16 @@ Mark.updateMarksLabel = function(req, res, next) { next(); }).catch((e) => next(e)); }; + +Mark.pointList = function(req, res, next) { + var query = req.query; + mongoDB.find(db, 'mark', query, { x: 1, y: 1, _id: 0 }).toArray().then((points) => { + req.data = { points: points.map(point => [point.x, point.y]) }; + next(); + }).catch((e) => next(e)); + }; + + var Heatmap = {}; Heatmap.types = function(req, res, next) { var query = req.query;