-
Notifications
You must be signed in to change notification settings - Fork 71.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed error if latestSGV not filled #4919
Changes from all commits
6f8a295
f81298f
1ce3b0b
6727428
94be928
5f222b7
5afbdd4
60b40d1
8d06b40
409b6a5
0a2dcbe
b523419
007cea4
11aff8a
3c25914
baa613f
366d10c
bb5fe99
3a52cac
ce21b4e
d2d82dd
d61e8f9
7bb7289
050808d
ccad081
293ac55
afbe6a3
fa442ae
d361a72
22474e2
bd42ad8
db1febb
7f22ad4
2c935ee
88c6d16
6baf359
beed799
f4e07fb
18cd822
a87fb50
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,7 @@ function init (client, d3) { | |
|
||
// get the desired opacity for context chart based on the brush extent | ||
renderer.highlightBrushPoints = function highlightBrushPoints (data) { | ||
if (data.mills >= chart().brush.extent()[0].getTime() && data.mills <= chart().brush.extent()[1].getTime()) { | ||
if (client.latestSGV && data.mills >= chart().brush.extent()[0].getTime() && data.mills <= chart().brush.extent()[1].getTime()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At the very first start there is no measured values and the user can see errors in console. |
||
return chart().futureOpacity(data.mills - client.latestSGV.mills); | ||
} else { | ||
return 0.5; | ||
|
@@ -111,7 +111,7 @@ function init (client, d3) { | |
return d.type === 'forecast' ? 'none' : d.color; | ||
}) | ||
.attr('opacity', function(d) { | ||
return d.noFade ? 100 : chart().futureOpacity(d.mills - client.latestSGV.mills); | ||
return d.noFade || !client.latestSGV ? 100 : chart().futureOpacity(d.mills - client.latestSGV.mills); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At the very first start there is no measured values and the user can see errors in console. |
||
}) | ||
.attr('stroke-width', function(d) { | ||
return d.type === 'mbg' ? 2 : d.type === 'forecast' ? 2 : 0; | ||
|
@@ -897,7 +897,7 @@ function init (client, d3) { | |
, treatments: treatmentCount | ||
}, client.sbx.data.profile.getCarbRatio(new Date())); | ||
}); | ||
} | ||
}; | ||
|
||
renderer.drawTreatment = function drawTreatment (treatment, opts, carbratio) { | ||
if (!treatment.carbs && !treatment.insulin) { | ||
|
@@ -920,7 +920,7 @@ function init (client, d3) { | |
var arc = prepareArc(treatment, radius); | ||
var treatmentDots = appendTreatments(treatment, arc); | ||
appendLabels(treatmentDots, arc, opts); | ||
} | ||
}; | ||
|
||
renderer.addBasals = function addBasals (client) { | ||
|
||
|
@@ -1009,15 +1009,15 @@ function init (client, d3) { | |
.attr('stroke', '#0099ff') | ||
.attr('stroke-width', 1) | ||
.attr('fill', 'none') | ||
.attr('d', valueline(linedata)) | ||
.attr('d', valueline(linedata)); | ||
|
||
g.append('path') | ||
.attr('class', 'line notempline') | ||
.attr('stroke', '#0099ff') | ||
.attr('stroke-width', 1) | ||
.attr('stroke-dasharray', ('3, 3')) | ||
.attr('fill', 'none') | ||
.attr('d', valueline(notemplinedata)) | ||
.attr('d', valueline(notemplinedata)); | ||
|
||
g.append('path') | ||
.attr('class', 'area basalarea') | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,10 +102,11 @@ daytoday.report = function report_daytoday (datastorage, sorteddaystoshow, optio | |
var fatAverage = fatSum / datastorage.alldays; | ||
|
||
if (options.insulindistribution) | ||
$('#daytodaycharts').append('<br><br><b>' + translate('TDD average') + ':</b> ' + tddAverage.toFixed(1) + 'U <b>' + | ||
translate('Carbs average') + ':</b> ' + carbsAverage.toFixed(0) + 'g' + | ||
translate('Protein average') + ':</b> ' + proteinAverage.toFixed(0) + 'g' + | ||
translate('Fat average') + ':</b> ' + fatAverage.toFixed(0) + 'g' | ||
$('#daytodaycharts').append('<br><br>' + | ||
'<b>' + translate('TDD average') + ':</b> ' + tddAverage.toFixed(1) + 'U ' + | ||
'<b>' + translate('Carbs average') + ':</b> ' + carbsAverage.toFixed(0) + 'g ' + | ||
'<b>' + translate('Protein average') + ':</b> ' + proteinAverage.toFixed(0) + 'g ' + | ||
'<b>' + translate('Fat average') + ':</b> ' + fatAverage.toFixed(0) + 'g' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See screenshots in PR description |
||
); | ||
|
||
function timeTicks (n, i) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,9 +54,9 @@ | |
width: 100%; | ||
height: 90%; | ||
top: 30%; | ||
left: 0%; | ||
left: 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just CSS formatting |
||
font-size: 16px; | ||
} | ||
} | ||
|
||
.spinner { | ||
margin: 100px auto 0; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One 'use strict' too much