Mercurial > code > home > repos > homeauto
diff service/wallscreen/gui.js @ 918:c6e6f717fabe
wallscreen show map of people and their distances from home
Ignore-this: f7ff288f146881a55529d9a11585aeb4
darcs-hash:20130910073652-312f9-213c4a5fe56d3b5d9b46ddc40a4e3a2bd3d16963
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Tue, 10 Sep 2013 00:36:52 -0700 |
parents | d74460cc73da |
children |
line wrap: on
line diff
--- a/service/wallscreen/gui.js Mon Sep 02 20:58:07 2013 -0700 +++ b/service/wallscreen/gui.js Tue Sep 10 00:36:52 2013 -0700 @@ -12,7 +12,8 @@ isToday: function (ev) { var today = moment().format("YYYY-MM-DD"); return ev.date == today; - } + }, + mapPersonData: ko.observable(), }; reloadData = function() { $.getJSON("content", function (data) { @@ -23,6 +24,22 @@ setInterval(reloadData, 30*60*1000); reloadData(); + reloadMap = function () { + $.getJSON("content/map", function (data) { + var personData = []; + data.pts.forEach(function (pt) { + // this is in another config but not yet in the graph + var initial = pt.who.split("#")[1].substr(0, 1).toUpperCase(); + pt.initial = initial; + pt.topFrac = initial == 'K' ? 0 : .5; + personData.push(pt); + }); + model.mapPersonData(personData); + }); + }; + setInterval(reloadMap, 2*60*1000); + reloadMap(); + function onMessage(d) { if (d.tempF) { model.requestedF(d.tempF);