Skip to content

Commit 9d36873

Browse files
authored
Merge branch 'dev' into wip/2025-reports
2 parents 04de452 + e74f53c commit 9d36873

File tree

12 files changed

+31
-21
lines changed

12 files changed

+31
-21
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ For remote overrides, the following extended settings must be configured:
752752
* `ns-info` - Plugins that generate notifications at the info level will cause this event to also be triggered. It will be sent in addition to `ns-event`.
753753
* `ns-warning` - Alarms at the warning level with cause this event to also be triggered. It will be sent in addition to `ns-event`.
754754
* `ns-urgent` - Alarms at the urgent level with cause this event to also be triggered. It will be sent in addition to `ns-event`.
755-
* see the [full list of events](lib/plugins/maker-setup.md#events)
755+
* see the [full list of events](docs/plugins/maker-setup.md#events)
756756

757757

758758
### Treatment Profile

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ x-logging:
1010
services:
1111
mongo:
1212
image: mongo:4.4
13+
restart: always
1314
volumes:
1415
- ${NS_MONGO_DATA_DIR:-./mongo-data}:/data/db:cached
1516
logging: *default-logging
@@ -65,6 +66,7 @@ services:
6566

6667
traefik:
6768
image: traefik:latest
69+
restart: always
6870
container_name: 'traefik'
6971
command:
7072
- '--providers.docker=true'

lib/client/browser-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function init ($) {
1515
$.fn.tooltip.defaults = {
1616
fade: true
1717
, gravity: 'n'
18-
, opacity: 0.75
18+
, opacity: 0.9
1919
};
2020

2121
$('#drawerToggle').click(function(event) {

lib/client/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ client.load = function load (serverSettings, callback) {
192192

193193
client.tooltip = d3.select('body').append('div')
194194
.attr('class', 'tooltip')
195-
.style('opacity', 0);
195+
.style('display', 'none');
196196

197197
client.settings = browserSettings(client, serverSettings, $);
198198

lib/client/renderer.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function init (client, d3) {
5454
}
5555

5656
function hideTooltip () {
57-
client.tooltip.style('opacity', 0);
57+
client.tooltip.style('display', 'none');
5858
}
5959

6060
// get the desired opacity for context chart based on the brush extent
@@ -147,7 +147,7 @@ function init (client, d3) {
147147

148148
var rawbgInfo = getRawbgInfo();
149149

150-
client.tooltip.style('opacity', .9);
150+
client.tooltip.style('display', 'block');
151151
client.tooltip.html('<strong>' + translate('BG') + ':</strong> ' + client.sbx.scaleEntry(d) +
152152
(d.type === 'mbg' ? '<br/><strong>' + translate('Device') + ': </strong>' + d.device : '') +
153153
(d.type === 'forecast' && d.forecastType ? '<br/><strong>' + translate('Forecast Type') + ': </strong>' + d.forecastType : '') +
@@ -338,7 +338,7 @@ function init (client, d3) {
338338
prepareTreatCircles(treatCircles.enter().append('circle'))
339339
.attr('class', 'treatment-dot')
340340
.on('mouseover', function(d) {
341-
client.tooltip.style('opacity', .9);
341+
client.tooltip.style('display', 'block');
342342
client.tooltip.html(d.isAnnouncement ? announcementTooltip(d) : treatmentTooltip(d))
343343
.style('left', tooltipLeft())
344344
.style('top', (d3.event.pageY + 15) + 'px');
@@ -435,7 +435,7 @@ function init (client, d3) {
435435
.attr('class', 'g-duration')
436436
.attr('transform', rectTranslate)
437437
.on('mouseover', function(d) {
438-
client.tooltip.style('opacity', .9);
438+
client.tooltip.style('display', 'block');
439439
client.tooltip.html(d.isAnnouncement ? announcementTooltip(d) : treatmentTooltip(d))
440440
.style('left', tooltipLeft())
441441
.style('top', (d3.event.pageY + 15) + 'px');
@@ -640,7 +640,7 @@ function init (client, d3) {
640640
glucose = Math.round(glucose * decimals) / decimals;
641641
}
642642

643-
client.tooltip.style('opacity', .9);
643+
client.tooltip.style('display', 'block');
644644
client.tooltip.html('<strong>' + translate('Time') + ':</strong> ' + client.formatTime(getOrAddDate(treatment)) + '<br/>' + '<strong>' + translate('Treatment type') + ':</strong> ' + translate(client.careportal.resolveEventName(treatment.eventType)) + '<br/>' +
645645
(treatment.carbs ? '<strong>' + translate('Carbs') + ':</strong> ' + treatment.carbs + '<br/>' : '') +
646646
(treatment.protein ? '<strong>' + translate('Protein') + ':</strong> ' + treatment.protein + '<br/>' : '') +
@@ -667,7 +667,7 @@ function init (client, d3) {
667667
//console.log(treatment);
668668
var windowWidth = $(client.tooltip.node()).parent().parent().width();
669669
var left = d3.event.x + TOOLTIP_WIDTH < windowWidth ? d3.event.x : windowWidth - TOOLTIP_WIDTH - 10;
670-
client.tooltip.style('opacity', .9)
670+
client.tooltip.style('display', 'block')
671671
.style('left', left + 'px')
672672
.style('top', (d3.event.pageY ? d3.event.pageY + 15 : 40) + 'px');
673673

@@ -760,7 +760,7 @@ function init (client, d3) {
760760
})
761761
.on('drag', function() {
762762
//console.log(d3.event);
763-
client.tooltip.style('opacity', .9);
763+
client.tooltip.style('display', 'block');
764764
var x = Math.min(Math.max(0, d3.event.x), chart().charts.attr('width'));
765765
var y = Math.min(Math.max(0, d3.event.y), chart().focusHeight);
766766

@@ -1266,7 +1266,7 @@ function init (client, d3) {
12661266
})
12671267
.text(generateText)
12681268
.on('mouseover', function(d) {
1269-
client.tooltip.style('opacity', .9);
1269+
client.tooltip.style('display', 'block');
12701270
client.tooltip.html(profileTooltip(d))
12711271
.style('left', (d3.event.pageX) + 'px')
12721272
.style('top', (d3.event.pageY + 15) + 'px');

lib/constants.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"HTTP_BAD_REQUEST": 400,
88
"ENTRIES_DEFAULT_COUNT" : 10,
99
"PROFILES_DEFAULT_COUNT" : 10,
10-
"MMOL_TO_MGDL": 18.018018018,
10+
"MMOL_TO_MGDL": 18.01559,
1111
"ONE_DAY" : 86400000,
1212
"TWO_DAYS" : 172800000,
1313
"FIFTEEN_MINUTES": 900000,

lib/plugins/pluginbase.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function init (majorPills, minorPills, statusPills, bgStatus, tooltip) {
8484
}).join('<br/>\n');
8585

8686
pill.mouseover(function pillMouseover (event) {
87-
tooltip.style('opacity', .9);
87+
tooltip.style('display', 'block');
8888

8989
var windowWidth = $(tooltip.node()).parent().parent().width();
9090
var left = event.pageX + TOOLTIP_WIDTH < windowWidth ? event.pageX : windowWidth - TOOLTIP_WIDTH - 10;
@@ -94,7 +94,7 @@ function init (majorPills, minorPills, statusPills, bgStatus, tooltip) {
9494
});
9595

9696
pill.mouseout(function pillMouseout ( ) {
97-
tooltip.style('opacity', 0);
97+
tooltip.style('display', 'none');
9898
});
9999
} else {
100100
pill.off('mouseover');

lib/report_plugins/dailystats.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
var consts = require('../constants');
4+
35
var dailystats = {
46
name: 'dailystats'
57
, label: 'Daily Stats'
@@ -68,6 +70,8 @@ dailystats.report = function report_dailystats (datastorage, sorteddaystoshow, o
6870
$('<th>' + translate('25%') + '</th>').appendTo(thead);
6971
$('<th>' + translate('Median') + '</th>').appendTo(thead);
7072
$('<th>' + translate('75%') + '</th>').appendTo(thead);
73+
$('<th>' + translate('A1c est* %<sub>DCCT</sub>') + '</th>').appendTo(thead);
74+
$('<th>' + translate('A1c est* <sub>IFCC</sub>') + '</th>').appendTo(thead);
7175
thead.appendTo(table);
7276

7377
sorteddaystoshow.forEach(function(day) {
@@ -116,6 +120,8 @@ dailystats.report = function report_dailystats (datastorage, sorteddaystoshow, o
116120
, highs: 0
117121
});
118122
var average = sum / daysRecords.length;
123+
var averageA1cDCCT = (average * consts.MMOL_TO_MGDL + 46.7) / 28.7;
124+
var averageA1cIFCC = ((average * consts.MMOL_TO_MGDL + 46.7) / 28.7 - 2.15) * 10.929;
119125

120126
var bgValues = daysRecords.map(function(r) { return r.sgv; });
121127
$('<td><div id="dailystat-chart-' + day.toString() + '" class="inlinepiechart"></div></td>').appendTo(tr);
@@ -139,6 +145,8 @@ dailystats.report = function report_dailystats (datastorage, sorteddaystoshow, o
139145
$('<td class="tdborder">' + ss.quantile(bgValues, 0.25).toFixed(1) + '</td>').appendTo(tr);
140146
$('<td class="tdborder">' + ss.quantile(bgValues, 0.5).toFixed(1) + '</td>').appendTo(tr);
141147
$('<td class="tdborder">' + ss.quantile(bgValues, 0.75).toFixed(1) + '</td>').appendTo(tr);
148+
$('<td class="tdborder">' + averageA1cDCCT.toFixed(1) + '%</td>').appendTo(tr);
149+
$('<td class="tdborder">' + averageA1cIFCC.toFixed(0) + '</td>').appendTo(tr);
142150

143151
table.append(tr);
144152
var inrange = [{

lib/report_plugins/daytoday.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ daytoday.report = function report_daytoday (datastorage, sorteddaystoshow, optio
311311
})
312312
.on('mouseover', function(d) {
313313
if (options.openAps && d.openaps) {
314-
client.tooltip.style('opacity', .9);
314+
client.tooltip.style('display', 'block');
315315
var text = '<b>BG:</b> ' + d.openaps.suggested.bg +
316316
', ' + d.openaps.suggested.reason +
317317
(d.openaps.suggested.mealAssist ? ' <b>Meal Assist:</b> ' + d.openaps.suggested.mealAssist : '');
@@ -1122,6 +1122,6 @@ daytoday.report = function report_daytoday (datastorage, sorteddaystoshow, optio
11221122
}
11231123

11241124
function hideTooltip () {
1125-
client.tooltip.style('opacity', 0);
1125+
client.tooltip.style('display', 'none');
11261126
}
11271127
};

lib/report_plugins/weektoweek.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ function init (ctx) {
326326
}
327327

328328
function hideTooltip () {
329-
client.tooltip.style('opacity', 0);
329+
client.tooltip.style('display', 'none');
330330
}
331331
};
332332
return weektoweek;

0 commit comments

Comments
 (0)