Merge pull request #1243 from nightscout/wip/basal-flip

flip basals, since everyone is confused by the inverse
This commit is contained in:
Scott Leibrand
2015-10-23 09:24:43 -07:00
+12 -12
View File
@@ -516,16 +516,16 @@ function init (client, d3) {
lastdate = date;
date += times.mins(1).msecs;
}
linedata.push( { d: to, b: profile.getTempBasal(to,client.tempbasaltreatments).tempbasal } );
notemplinedata.push( { d: to, b: profile.getTempBasal(to,client.tempbasaltreatments).basal } );
basalareadata.push( { d: to, b: profile.getTempBasal(to,client.tempbasaltreatments).basal } );
tempbasalareadata.push( { d: to, b: profile.getTempBasal(to,client.tempbasaltreatments).tempbasal } );
var toTempBasal = profile.getTempBasal(to, client.tempbasaltreatments);
linedata.push( { d: to, b: toTempBasal.tempbasal } );
notemplinedata.push( { d: to, b: toTempBasal.basal } );
basalareadata.push( { d: to, b: toTempBasal.basal } );
tempbasalareadata.push( { d: to, b: toTempBasal.tempbasal } );
chart().yScaleBasals.domain([0, d3.max(linedata, function(d) { return d.b; }) ]);
// update y axis domain
// chart().basals.select('.y')
// .call(chart().yAxisBasals);
chart().yScaleBasals.domain([d3.max(linedata, function(d) { return d.b; }), 0]);
chart().basals.selectAll('g').remove();
chart().basals.selectAll('.basalline').remove().data(linedata);
chart().basals.selectAll('.notempline').remove().data(notemplinedata);
@@ -549,7 +549,7 @@ function init (client, d3) {
g.append('path')
.attr('class', 'line basalline')
.attr('stroke', '#0099ff')
.attr('stroke-width', 2)
.attr('stroke-width', 1)
.attr('fill', 'none')
.attr('d', valueline(linedata))
.attr('clip-path', 'url(#clip)');
@@ -575,8 +575,8 @@ function init (client, d3) {
.attr('class', 'area tempbasalarea')
.datum(tempbasalareadata)
.attr('fill', '#0099ff')
.attr('fill-opacity', .6)
.attr('stroke-width', 2)
.attr('fill-opacity', .2)
.attr('stroke-width', 1)
.attr('d', area);
//console.log(tempbasals);