From 456d63aef5871993f53b56f17eaca7ce1f3eeea7 Mon Sep 17 00:00:00 2001 From: Jason Calabrese Date: Tue, 16 Sep 2014 16:39:32 -0700 Subject: [PATCH 1/8] revert css change to fix toolbar wrapping bug --- static/css/drawer.css | 1 - 1 file changed, 1 deletion(-) diff --git a/static/css/drawer.css b/static/css/drawer.css index 36aa917664c..7b7810b5610 100644 --- a/static/css/drawer.css +++ b/static/css/drawer.css @@ -151,7 +151,6 @@ h1, legend, height: 44px; opacity: 0.75; vertical-align: middle; - width: 20ex; } #buttonbar div { border-radius: 5px; From 062acb1e2a2702046a79d6afc0873f04f7ec9a74 Mon Sep 17 00:00:00 2001 From: Jason Calabrese Date: Tue, 16 Sep 2014 17:13:57 -0700 Subject: [PATCH 2/8] bump cache buster versions :( --- static/index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/static/index.html b/static/index.html index 599ac189f18..acc372b5ef3 100644 --- a/static/index.html +++ b/static/index.html @@ -6,9 +6,9 @@ NightScout - + - + @@ -180,8 +180,8 @@

Nightscout

- - + + From 4ad93a9ac1d3e68a77bd5b270094b3235aadd2de Mon Sep 17 00:00:00 2001 From: Jason Calabrese Date: Tue, 16 Sep 2014 17:14:42 -0700 Subject: [PATCH 3/8] display LOW if < 40 and HIGH if > 400 --- static/js/client.js | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/static/js/client.js b/static/js/client.js index 86052014aad..407b7a14ab0 100644 --- a/static/js/client.js +++ b/static/js/client.js @@ -238,9 +238,16 @@ var prediction = predictAR(nowData); focusData = focusData.concat(prediction); var focusPoint = nowData[nowData.length - 1]; - $('.container .currentBG') - .text(focusPoint.sgv) - .css('text-decoration','line-through'); + + //in this case the SGV is scaled + if (focusPoint.sgv < scaleBg(40)) + $('.container .currentBG').text('LOW'); + else if (focusPoint.sgv > scaleBg(400)) + $('.container .currentBG').text('HIGH'); + else + $('.container .currentBG').text(focusPoint.sgv); + + $('.container .currentBG').css('text-decoration','line-through'); $('.container .currentDirection') .html(focusPoint.direction) } else { @@ -304,9 +311,15 @@ var secsSinceLast = (Date.now() - new Date(latestSGV.x).getTime()) / 1000; $('#lastEntry').text(timeAgo(secsSinceLast)).toggleClass('current', secsSinceLast < 10 * 60); - $('.container .currentBG') - .text(scaleBg(latestSGV.y)) - .css('text-decoration', ''); + //in this case the SGV is unscaled + if (latestSGV.y < 40) + $('.container .currentBG').text('LOW'); + else if (latestSGV.y > 400) + $('.container .currentBG').text('HIGH'); + else + $('.container .currentBG').text(scaleBg(latestSGV.y)); + + $('.container .currentBG').css('text-decoration', ''); $('.container .currentDirection') .html(latestSGV.direction); From 4f1155bf43f9cce1579e97f1b5bc93cbe8829037 Mon Sep 17 00:00:00 2001 From: Jason Calabrese Date: Tue, 16 Sep 2014 17:57:48 -0700 Subject: [PATCH 4/8] use data type instead of color to filter points --- static/js/client.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/static/js/client.js b/static/js/client.js index 407b7a14ab0..c2858c2b525 100644 --- a/static/js/client.js +++ b/static/js/client.js @@ -232,7 +232,7 @@ var nowData = data.filter(function(d) { return d.date.getTime() >= brushExtent[1].getTime() - FORTY_TWO_MINS_IN_MS && d.date.getTime() <= brushExtent[1].getTime() - TWENTY_FIVE_MINS_IN_MS && - d.color != 'none'; + d.type == 'sgv'; }); if (nowData.length > 1) { var prediction = predictAR(nowData); @@ -267,7 +267,7 @@ } else { // if the brush comes back into the current time range then it should reset to the current time and sg var nowData = data.filter(function(d) { - return d.color != 'none' && d.color != 'red'; + return d.type == 'sgv'; }); nowData = [nowData[nowData.length - 2], nowData[nowData.length - 1]]; var prediction = predictAR(nowData); @@ -813,15 +813,17 @@ } } data = d[0].map(function (obj) { - return { date: new Date(obj.x), y: obj.y, sgv: scaleBg(obj.y), direction: obj.direction, color: sgvToColor(obj.y)} + return { date: new Date(obj.x), y: obj.y, sgv: scaleBg(obj.y), direction: obj.direction, color: sgvToColor(obj.y), type: 'sgv'} }); // TODO: This is a kludge to advance the time as data becomes stale by making old predictor clear (using color = 'none') // This shouldn't have to be sent and can be fixed by using xScale.domain([x0,x1]) function with // 2 days before now as x0 and 30 minutes from now for x1 for context plot, but this will be // required to happen when "now" event is sent from websocket.js every minute. When fixed, // remove all "color != 'none'" code - data = data.concat(d[1].map(function (obj) { return { date: new Date(obj.x), y: obj.y, sgv: scaleBg(obj.y), color: 'none'} })); - data = data.concat(d[2].map(function (obj) { return { date: new Date(obj.x), y: obj.y, sgv: scaleBg(obj.y), color: 'red'} })); + data = data.concat(d[1].map(function (obj) { return { date: new Date(obj.x), y: obj.y, sgv: scaleBg(obj.y), color: 'none', type: 'server-forecast'} })); + + //Add MBG's also, pretend they are SGV's + data = data.concat(d[2].map(function (obj) { return { date: new Date(obj.x), y: obj.y, sgv: scaleBg(obj.y), color: 'red', type: 'mbg'} })); data.forEach(function (d) { if (d.y < 39) @@ -1105,6 +1107,7 @@ color: predictedColor }; predicted.forEach(function (d) { + d.type = 'forecast'; if (d.sgv < BG_MIN) d.color = "transparent"; }) From 909f1472b2f43c2ec86ee185cec9795fdbf86cd2 Mon Sep 17 00:00:00 2001 From: Jason Calabrese Date: Tue, 16 Sep 2014 18:15:51 -0700 Subject: [PATCH 5/8] make mbg's display a little bigger, so they stand out even when the colors theme is used --- static/js/client.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/client.js b/static/js/client.js index c2858c2b525..19768df3f18 100644 --- a/static/js/client.js +++ b/static/js/client.js @@ -349,7 +349,7 @@ .attr('cy', function (d) { return yScale(d.sgv); }) .attr('fill', function (d) { return d.color; }) .attr('opacity', function (d) { return futureOpacity(d.date - latestSGV.x); }) - .attr('r', 3); + .attr('r', function(d) { if (d.type == 'mbg') return 6; else return 3;}); focusCircles.exit() .remove(); @@ -744,7 +744,7 @@ .attr('cy', function (d) { return yScale2(d.sgv); }) .attr('fill', function (d) { return d.color; }) .style('opacity', function (d) { return highlightBrushPoints(d) }) - .attr('r', 2); + .attr('r', function(d) { if (d.type == 'mbg') return 4; else return 2;}); contextCircles.exit() .remove(); From f59cade0d862e1f9562a209cd586bd34c62f9d3f Mon Sep 17 00:00:00 2001 From: Jason Calabrese Date: Tue, 16 Sep 2014 22:56:21 -0700 Subject: [PATCH 6/8] version bumps --- bower.json | 2 +- package.json | 2 +- static/index.html | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bower.json b/bower.json index 8a91092f296..0ba21c05c32 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "nightscout", - "version": "0.4.0", + "version": "0.4.2", "dependencies": { "angularjs": "1.3.0-beta.19", "bootstrap": "~3.2.0", diff --git a/package.json b/package.json index df5c55628e5..b8a9f3ba2b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Nightscout", - "version": "0.4.1", + "version": "0.4.2", "description": "Nightscout acts as a web-based CGM (Continuous Glucose Montinor) to allow multiple caregivers to remotely view a patients glucose data in realtime.", "license": "MIT", "author": "Nightscout Team", diff --git a/static/index.html b/static/index.html index acc372b5ef3..0674a856e94 100644 --- a/static/index.html +++ b/static/index.html @@ -6,9 +6,9 @@ NightScout - + - + @@ -180,8 +180,8 @@

Nightscout

- - + + From 77dce9f09fa87552b61eba59c423c3df358791d5 Mon Sep 17 00:00:00 2001 From: Jason Calabrese Date: Wed, 17 Sep 2014 17:33:31 -0700 Subject: [PATCH 7/8] use absolute positioning instead a float right to prevent button bar wrapping --- static/css/drawer.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/css/drawer.css b/static/css/drawer.css index 7b7810b5610..3723260d7e6 100644 --- a/static/css/drawer.css +++ b/static/css/drawer.css @@ -147,10 +147,11 @@ h1, legend, } #buttonbar { padding-right: 10px; - float: right; height: 44px; opacity: 0.75; vertical-align: middle; + position: absolute; + right: 0; } #buttonbar div { border-radius: 5px; From 22678fd5727e611ea0b8a36f46b73dc6b976f8c9 Mon Sep 17 00:00:00 2001 From: Jason Calabrese Date: Thu, 18 Sep 2014 19:02:45 -0700 Subject: [PATCH 8/8] removed unused battery div from toolbar (maybe part or the wrapping problem?); make drawers the full hight; prevent wrapping of title text --- static/css/drawer.css | 15 +++++++-------- static/index.html | 3 +-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/static/css/drawer.css b/static/css/drawer.css index 3723260d7e6..d567053b3aa 100644 --- a/static/css/drawer.css +++ b/static/css/drawer.css @@ -5,7 +5,7 @@ color: #eee; display: none; font-size: 16px; - height: calc(100% - 45px); + height: 100%; overflow-y: auto; position: absolute; margin-top: 45px; @@ -25,7 +25,7 @@ color: #eee; display: none; font-size: 16px; - height: calc(100% - 45px); + height: 100%; overflow-y: auto; position: absolute; margin-top: 45px; @@ -144,6 +144,10 @@ h1, legend, margin-top: 0; margin-left: 42px; padding-top: 10px; + padding-right: 150px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; } #buttonbar { padding-right: 10px; @@ -153,12 +157,7 @@ h1, legend, position: absolute; right: 0; } -#buttonbar div { - border-radius: 5px; - float: left; - height: 44px; - width: 44px; -} + #buttonbar a, #buttonbar i { color: #ccc; diff --git a/static/index.html b/static/index.html index 0674a856e94..27bc18806ea 100644 --- a/static/index.html +++ b/static/index.html @@ -8,13 +8,12 @@ - +
-