tideline 1.37.0 → 1.38.0-local-data-source.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.yarn/install-state.gz +0 -0
- package/css/tideline.less +10 -0
- package/img/event/event-health.svg +4 -0
- package/img/event/event-notes.svg +16 -0
- package/img/event/event-physical_activity.svg +4 -0
- package/js/data/util/device.js +13 -0
- package/js/index.js +1 -0
- package/js/plot/event.js +25 -3
- package/js/plot/insulin.js +110 -0
- package/js/plot/quickbolus.js +1 -1
- package/js/plot/util/annotations/annotation.js +2 -2
- package/js/plot/util/commonbolus.js +6 -0
- package/js/plot/util/drawbolus.js +4 -0
- package/js/plot/util/legend.js +26 -0
- package/js/plot/wizard.js +1 -1
- package/package.json +1 -1
- package/plugins/blip/basics/chartbasicsfactory.js +5 -0
- package/plugins/blip/basics/components/sitechange/Selector.js +2 -1
- package/plugins/blip/chartdailyfactory.js +28 -7
- package/.vscode/settings.json +0 -5
- package/coverage/clover.xml +0 -258
- package/coverage/coverage-final.json +0 -3
- package/coverage/lcov-report/CalendarContainer.js.html +0 -760
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -131
- package/coverage/lcov-report/js/data/util/constants.js.html +0 -238
- package/coverage/lcov-report/js/data/util/format.js.html +0 -889
- package/coverage/lcov-report/js/data/util/index.html +0 -131
- package/coverage/lcov-report/plugins/blip/basics/TogglableState.js.html +0 -184
- package/coverage/lcov-report/plugins/blip/basics/components/BasicsUtils.js.html +0 -424
- package/coverage/lcov-report/plugins/blip/basics/components/CalendarContainer.js.html +0 -760
- package/coverage/lcov-report/plugins/blip/basics/components/day/ADay.js.html +0 -388
- package/coverage/lcov-report/plugins/blip/basics/components/day/HoverDay.js.html +0 -349
- package/coverage/lcov-report/plugins/blip/basics/components/day/hover/InfusionHoverDisplay.js.html +0 -238
- package/coverage/lcov-report/plugins/blip/basics/components/day/hover/index.html +0 -116
- package/coverage/lcov-report/plugins/blip/basics/components/day/index.html +0 -131
- package/coverage/lcov-report/plugins/blip/basics/components/index.html +0 -116
- package/coverage/lcov-report/plugins/blip/basics/components/misc/SummaryGroup.js.html +0 -649
- package/coverage/lcov-report/plugins/blip/basics/components/misc/index.html +0 -116
- package/coverage/lcov-report/plugins/blip/basics/index.html +0 -116
- package/coverage/lcov-report/plugins/blip/basics/logic/actions.js.html +0 -412
- package/coverage/lcov-report/plugins/blip/basics/logic/constants.js.html +0 -136
- package/coverage/lcov-report/plugins/blip/basics/logic/index.html +0 -131
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov-report/utils/index.html +0 -116
- package/coverage/lcov-report/utils/test-utils.js.html +0 -130
- package/coverage/lcov.info +0 -341
- package/dist/1626bc5239e4f01e260f.png +0 -1
- package/dist/16a09129333b26bb2dc0.png +0 -1
- package/dist/46df7809424c0925d116.png +0 -1
- package/dist/62e00215e15358359a4a.png +0 -1
- package/dist/alarm..svg +0 -4
- package/dist/bcfa2ee37dc782957422.png +0 -1
- package/dist/c881af35673d46f98bdb.png +0 -1
- package/dist/commons.js +0 -2
- package/dist/commons.js.LICENSE.txt +0 -659
- package/dist/commons.js.map +0 -1
- package/dist/d19a2e3682c62c90d318.png +0 -1
- package/dist/event..svg +0 -4
- package/dist/ff9c93e8f25072e91293.png +0 -1
- package/dist/index.1583479924.js +0 -1
- package/dist/loadtests.2699246386.js +0 -1
- package/dist/loadtests.2699246386.js.map +0 -1
- package/dist/new..png +0 -0
- package/dist/post_it..svg +0 -14
- package/dist/pumpAlarm..svg +0 -4
- package/dist/runtime.js +0 -1
- package/dist/runtime.js.map +0 -1
- package/dist/sitechange-loop-tubing..png +0 -0
- package/dist/sitechange..png +0 -0
- package/dist/sitechange.png +0 -1
- package/dist/sitechange_cannula..png +0 -0
- package/dist/sitechange_cannula.png +0 -1
- package/dist/sitechange_loop_tubing..png +0 -0
- package/dist/sitechange_omnipod..png +0 -0
- package/dist/sitechange_omnipod.png +0 -1
- package/dist/sitechange_tubing..png +0 -0
- package/dist/sitechange_tubing.png +0 -1
- package/dist/sitechange_twiist_cassette..svg +0 -4
- package/dist/timechange..svg +0 -13
- package/tmp/commons.js +0 -0
- package/tmp/index.1583479924.js +0 -1
- package/tmp/runtime.js +0 -0
- package/yarn-error.log +0 -8850
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/css/tideline.less
CHANGED
|
@@ -256,6 +256,11 @@ svg {
|
|
|
256
256
|
.d3-bolus-automated;
|
|
257
257
|
stroke-width: 1.5;
|
|
258
258
|
}
|
|
259
|
+
&.d3-rect-bolus-insulin-legend {
|
|
260
|
+
fill: url(#diagonalStripes);
|
|
261
|
+
stroke: url(#diagonalStripes);
|
|
262
|
+
stroke-width: 1.5;
|
|
263
|
+
}
|
|
259
264
|
&.d3-path-bolus {
|
|
260
265
|
stroke: @bolus;
|
|
261
266
|
fill: none;
|
|
@@ -862,3 +867,8 @@ text.d3-tabular-ui {
|
|
|
862
867
|
}
|
|
863
868
|
}
|
|
864
869
|
}
|
|
870
|
+
|
|
871
|
+
.d3-image-event {
|
|
872
|
+
outline: 1px solid #E9EFF1;
|
|
873
|
+
border-radius: 12px;
|
|
874
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="24" height="24" rx="12" fill="#8C8C8C"/>
|
|
3
|
+
<path d="M12.0001 19C11.9041 19 11.7875 18.9657 11.6504 18.8972C11.5133 18.8332 11.383 18.76 11.2596 18.6777C9.98883 17.855 8.88264 16.991 7.94101 16.086C7.00395 15.1763 6.27716 14.2416 5.76063 13.2816C5.2441 12.3172 4.98584 11.3458 4.98584 10.3676C4.98584 9.71853 5.08869 9.12658 5.29438 8.59177C5.50465 8.05696 5.79263 7.59529 6.15831 7.20675C6.52856 6.81821 6.95367 6.5211 7.43362 6.3154C7.91815 6.10513 8.43925 6 8.99692 6C9.68714 6 10.2837 6.1737 10.7865 6.5211C11.2939 6.8685 11.6984 7.32103 12.0001 7.87869C12.3063 7.31646 12.7109 6.86392 13.2137 6.5211C13.7211 6.1737 14.3199 6 15.0101 6C15.5586 6 16.0752 6.10513 16.5597 6.3154C17.0488 6.5211 17.4762 6.81821 17.8419 7.20675C18.2075 7.59529 18.4932 8.05696 18.6989 8.59177C18.9092 9.12658 19.0143 9.71853 19.0143 10.3676C19.0143 11.3458 18.7561 12.3172 18.2395 13.2816C17.723 14.2416 16.9939 15.1763 16.0523 16.086C15.1152 16.991 14.0136 17.855 12.7474 18.6777C12.6195 18.76 12.4869 18.8332 12.3498 18.8972C12.2172 18.9657 12.1006 19 12.0001 19Z" fill="white"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="24" height="24" rx="12" fill="#8C8C8C"/>
|
|
3
|
+
<g clip-path="url(#clip0_4901_15742)">
|
|
4
|
+
<path d="M5.52629 18.0027C5.48821 18.1348 5.52629 18.2795 5.6227 18.376C5.69381 18.447 5.79289 18.4877 5.89188 18.4877C5.92739 18.4877 5.96299 18.4826 5.99602 18.4724L9.54555 17.4593L6.53934 14.4531L5.52629 18.0027Z" fill="white"/>
|
|
5
|
+
<path d="M5.89176 18.4998C5.78762 18.4998 5.68864 18.4592 5.61505 18.3856C5.51348 18.284 5.4754 18.1367 5.51596 17.9996L6.53665 14.4297L9.5734 17.4664L5.99838 18.4846C5.96288 18.4948 5.92727 18.4998 5.89176 18.4998ZM6.54686 14.4754L5.53887 18.0047C5.50327 18.1342 5.53887 18.2713 5.6328 18.3652C5.70133 18.4338 5.79526 18.4719 5.89176 18.4719C5.92479 18.4719 5.9603 18.4668 5.99333 18.4567L9.52262 17.4487L6.54686 14.4754Z" fill="white"/>
|
|
6
|
+
<path d="M18.1531 7.46014L16.5408 5.84783C16.3225 5.63201 16.0381 5.5127 15.7309 5.5127C15.4262 5.5127 15.1392 5.63201 14.9234 5.84535L14.116 6.65269L17.3432 9.87988L18.1506 9.07244C18.3664 8.85662 18.4832 8.56969 18.4832 8.265C18.4857 7.96031 18.3664 7.67596 18.1531 7.46014Z" fill="white"/>
|
|
7
|
+
<path d="M17.3455 9.89764L14.1006 6.65269L14.9156 5.83772C15.134 5.61932 15.4234 5.5 15.7306 5.5C16.0404 5.5 16.3299 5.61932 16.5457 5.83772L18.158 7.45002C18.3763 7.66832 18.4956 7.95783 18.4956 8.265C18.4956 8.57484 18.3763 8.86426 18.158 9.08008L17.3455 9.89764ZM14.1361 6.65269L17.3455 9.86213L18.1428 9.0648C18.356 8.85156 18.4728 8.56969 18.4728 8.26758C18.4728 7.96547 18.356 7.68359 18.1428 7.47035L16.5304 5.85547C16.3172 5.64223 16.0328 5.52539 15.7306 5.52539C15.4285 5.52539 15.1467 5.64223 14.9334 5.85547L14.1361 6.65269Z" fill="white"/>
|
|
8
|
+
<path d="M6.96777 13.8028L13.58 7.19043L16.8081 10.4185L10.1959 17.0309L6.96777 13.8028Z" fill="white"/>
|
|
9
|
+
<path d="M10.1957 17.0498L6.94824 13.8024L13.5803 7.17285L16.8252 10.4178L10.1957 17.0498ZM6.98633 13.8024L10.1957 17.0117L16.7896 10.4178L13.5803 7.20846L6.98633 13.8024Z" fill="white"/>
|
|
10
|
+
</g>
|
|
11
|
+
<defs>
|
|
12
|
+
<clipPath id="clip0_4901_15742">
|
|
13
|
+
<rect width="13" height="13" fill="white" transform="translate(5.5 5.5)"/>
|
|
14
|
+
</clipPath>
|
|
15
|
+
</defs>
|
|
16
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="24" height="24" rx="12" fill="#8C8C8C"/>
|
|
3
|
+
<path d="M13.9381 7.19841C13.6371 7.19841 13.3668 7.12699 13.127 6.98416C12.8873 6.83623 12.6934 6.64238 12.5455 6.40263C12.4027 6.16288 12.3313 5.89507 12.3313 5.5992C12.3313 5.30334 12.4027 5.03553 12.5455 4.79578C12.6934 4.55092 12.8873 4.35708 13.127 4.21425C13.3668 4.07142 13.6371 4 13.9381 4C14.234 4 14.5018 4.07142 14.7415 4.21425C14.9813 4.35708 15.1726 4.55092 15.3154 4.79578C15.4634 5.03553 15.5373 5.30334 15.5373 5.5992C15.5373 5.89507 15.4634 6.16288 15.3154 6.40263C15.1726 6.64238 14.9813 6.83623 14.7415 6.98416C14.5018 7.12699 14.234 7.19841 13.9381 7.19841ZM11.436 13.5417C11.2269 13.4243 11.0152 13.2968 10.8009 13.1591C10.5867 13.0162 10.4285 12.8275 10.3265 12.5928C10.2245 12.3531 10.2347 12.0266 10.3571 11.6134L10.9387 9.51687C10.9795 9.38424 10.9591 9.28222 10.8774 9.2108C10.7958 9.13938 10.6989 9.10878 10.5867 9.11898L9.569 9.18784L9.26293 11.2997C9.19662 11.7741 8.94921 11.9935 8.52072 11.9578C8.31667 11.9374 8.16109 11.8532 8.05397 11.7053C7.94684 11.5522 7.90858 11.3609 7.93919 11.1314L8.29117 8.53745C8.31667 8.3232 8.39574 8.15232 8.52837 8.02479C8.661 7.89726 8.83189 7.82584 9.04103 7.81054L11.5967 7.63455C12.27 7.58354 12.8261 7.65496 13.2648 7.8488C13.7035 8.03754 14.0886 8.35891 14.4202 8.81291L15.675 10.5498L17.4961 9.73877C17.7002 9.64695 17.8864 9.62654 18.0547 9.67755C18.2282 9.72856 18.3582 9.84844 18.445 10.0372C18.5368 10.2259 18.547 10.4045 18.4756 10.5728C18.4042 10.7411 18.2639 10.8712 18.0547 10.963L15.7439 11.996C15.5909 12.0674 15.4327 12.0802 15.2695 12.0343C15.1114 11.9884 14.9864 11.894 14.8946 11.7512L14.0835 10.5805C14.007 10.4682 13.9101 10.4198 13.7927 10.4351C13.6754 10.4504 13.5989 10.5243 13.5632 10.657L13.0199 12.524L15.7516 14.3145C15.9607 14.4522 16.078 14.6512 16.1035 14.9113C16.129 15.1715 16.0525 15.3755 15.874 15.5234L13.3642 17.6583C13.1602 17.8317 12.9561 17.9108 12.7521 17.8955C12.5532 17.8853 12.3925 17.8113 12.27 17.6736C12.1527 17.5358 12.0992 17.3701 12.1094 17.1762C12.1196 16.9773 12.2241 16.7962 12.4231 16.6329L14.1983 15.0949L11.436 13.5417ZM6.55423 19.8313C6.4063 19.6987 6.32213 19.5253 6.30173 19.311C6.28643 19.0968 6.37569 18.8953 6.56954 18.7065L9.01808 16.2733L9.87507 13.2279C10.0077 13.4014 10.1735 13.5646 10.3724 13.7176C10.5714 13.8656 10.8086 14.0161 11.084 14.1691L11.3365 14.3145L10.3571 16.8395C10.2959 16.9926 10.2449 17.0997 10.2041 17.1609C10.1633 17.217 10.0919 17.2961 9.98984 17.3981L7.62547 19.7319C7.44183 19.9104 7.25309 19.9997 7.05925 19.9997C6.8654 20.0048 6.69707 19.9487 6.55423 19.8313Z" fill="white"/>
|
|
4
|
+
</svg>
|
package/js/data/util/device.js
CHANGED
|
@@ -29,4 +29,17 @@ module.exports = {
|
|
|
29
29
|
isAutomatedBasalDevice: (pumpUpload = {}) => {
|
|
30
30
|
return _.includes(_.get(AUTOMATED_BASAL_DEVICE_MODELS, pumpUpload.source, []), pumpUpload.deviceModel);
|
|
31
31
|
},
|
|
32
|
+
|
|
33
|
+
getUppercasedManufacturer: (manufacturer = '') => {
|
|
34
|
+
return _.map(manufacturer.split(' '), part => {
|
|
35
|
+
switch (part) {
|
|
36
|
+
case 'diy':
|
|
37
|
+
return _.upperCase(part);
|
|
38
|
+
case 'twiist':
|
|
39
|
+
return part;
|
|
40
|
+
default:
|
|
41
|
+
return _.upperFirst(part);
|
|
42
|
+
}
|
|
43
|
+
}).join(' ');
|
|
44
|
+
},
|
|
32
45
|
};
|
package/js/index.js
CHANGED
|
@@ -41,6 +41,7 @@ module.exports = {
|
|
|
41
41
|
plot: {
|
|
42
42
|
basal: require('./plot/basal'),
|
|
43
43
|
quickbolus: require('./plot/quickbolus'),
|
|
44
|
+
insulin: require('./plot/insulin'),
|
|
44
45
|
cbg: require('./plot/cbg'),
|
|
45
46
|
message: require('./plot/message'),
|
|
46
47
|
timechange: require('./plot/timechange'),
|
package/js/plot/event.js
CHANGED
|
@@ -2,6 +2,28 @@ var d3 = require('d3');
|
|
|
2
2
|
var _ = require('lodash');
|
|
3
3
|
|
|
4
4
|
var eventImage = require('../../img/event/event.svg');
|
|
5
|
+
var eventHealthImage = require('../../img/event/event-health.svg');
|
|
6
|
+
var eventPhysicalActivityImage = require('../../img/event/event-physical_activity.svg');
|
|
7
|
+
var eventNotesImage = require('../../img/event/event-notes.svg');
|
|
8
|
+
|
|
9
|
+
const EVENT_HEALTH = 'health';
|
|
10
|
+
const EVENT_NOTES = 'notes';
|
|
11
|
+
const EVENT_PHYSICAL_ACTIVITY = 'physical_activity';
|
|
12
|
+
|
|
13
|
+
function getEventImageByType(d) {
|
|
14
|
+
const eventType = d.tags?.event;
|
|
15
|
+
|
|
16
|
+
switch (eventType) {
|
|
17
|
+
case EVENT_HEALTH:
|
|
18
|
+
return eventHealthImage;
|
|
19
|
+
case EVENT_PHYSICAL_ACTIVITY:
|
|
20
|
+
return eventPhysicalActivityImage;
|
|
21
|
+
case EVENT_NOTES:
|
|
22
|
+
return eventNotesImage;
|
|
23
|
+
default:
|
|
24
|
+
return eventImage;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
5
27
|
|
|
6
28
|
/**
|
|
7
29
|
* Module for adding event markers to a chart pool
|
|
@@ -72,13 +94,13 @@ module.exports = function(pool, opts = {}) {
|
|
|
72
94
|
opts.xScale = pool.xScale().copy();
|
|
73
95
|
selection.append('image')
|
|
74
96
|
.attr({
|
|
75
|
-
'xlink:href':
|
|
97
|
+
'xlink:href': getEventImageByType,
|
|
76
98
|
x: event.xPositionCorner,
|
|
77
99
|
y: event.yPositionCorner,
|
|
78
100
|
width: opts.size,
|
|
79
|
-
height: opts.size
|
|
101
|
+
height: opts.size,
|
|
80
102
|
})
|
|
81
|
-
.classed({'d3-image': true, 'd3-event': true});
|
|
103
|
+
.classed({'d3-image': true, 'd3-event': true, 'd3-image-event': true });
|
|
82
104
|
};
|
|
83
105
|
|
|
84
106
|
event.xPositionCorner = function(d) {
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
var d3 = require('d3');
|
|
2
|
+
var _ = require('lodash');
|
|
3
|
+
|
|
4
|
+
var commonbolus = require('./util/commonbolus');
|
|
5
|
+
var drawbolus = require('./util/drawbolus');
|
|
6
|
+
|
|
7
|
+
module.exports = function(pool, opts) {
|
|
8
|
+
opts = opts || {};
|
|
9
|
+
|
|
10
|
+
var defaults = {
|
|
11
|
+
width: 12
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
_.defaults(opts, defaults);
|
|
15
|
+
|
|
16
|
+
var drawBolus = drawbolus(pool, opts);
|
|
17
|
+
|
|
18
|
+
function insulin(selection) {
|
|
19
|
+
opts.xScale = pool.xScale().copy();
|
|
20
|
+
selection.each(function(currentData) {
|
|
21
|
+
drawBolus.annotations(_.filter(currentData, function(d) { return d.annotations; }));
|
|
22
|
+
|
|
23
|
+
var insulinData = d3.select(this)
|
|
24
|
+
.selectAll('g.d3-insulin-group')
|
|
25
|
+
.data(currentData, function(d) {
|
|
26
|
+
return d.id;
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
var insulinGroups = insulinData.enter()
|
|
30
|
+
.append('g')
|
|
31
|
+
.attr({
|
|
32
|
+
'class': 'd3-insulin-group',
|
|
33
|
+
id: function(d) { return 'insulin_group_' + d.id; }
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// Add shared pattern definition to the top-level SVG if not already present
|
|
37
|
+
var svg = d3.select(this).node().ownerSVGElement
|
|
38
|
+
? d3.select(this).node().ownerSVGElement
|
|
39
|
+
: d3.select(this).node();
|
|
40
|
+
|
|
41
|
+
var svgSelection = d3.select(svg);
|
|
42
|
+
|
|
43
|
+
// Check if pattern already exists
|
|
44
|
+
if (svgSelection.select('defs #diagonalStripes').empty()) {
|
|
45
|
+
var defs = svgSelection.select('defs');
|
|
46
|
+
|
|
47
|
+
if (defs.empty()) {
|
|
48
|
+
defs = svgSelection.append('defs');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
var pattern = defs.append('pattern')
|
|
52
|
+
.attr('id', 'diagonalStripes')
|
|
53
|
+
.attr('patternUnits', 'userSpaceOnUse')
|
|
54
|
+
.attr('width', 5)
|
|
55
|
+
.attr('height', 5)
|
|
56
|
+
.attr('patternTransform', 'rotate(45)');
|
|
57
|
+
|
|
58
|
+
pattern.append('rect')
|
|
59
|
+
.attr('width', 5)
|
|
60
|
+
.attr('height', 5)
|
|
61
|
+
.attr('fill', '#7CD0F0');
|
|
62
|
+
|
|
63
|
+
pattern.append('rect')
|
|
64
|
+
.attr('x', 0)
|
|
65
|
+
.attr('y', 0)
|
|
66
|
+
.attr('width', 2)
|
|
67
|
+
.attr('height', 5)
|
|
68
|
+
.attr('fill', 'rgba(0, 0, 0, 0.15)');
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// sort by size so smaller insulin doses are drawn last
|
|
72
|
+
insulinGroups = insulinGroups.sort(function(a,b){
|
|
73
|
+
const aDose = commonbolus.getDelivered(a);
|
|
74
|
+
const bDose = commonbolus.getDelivered(b);
|
|
75
|
+
|
|
76
|
+
// in cases where the dose value is the same, tiebreak the sort by counting extended boluses
|
|
77
|
+
// as 1 unit higher so that a non-extended bolus is drawn on top, enabling both to be hovered over
|
|
78
|
+
if (aDose === bDose) {
|
|
79
|
+
return d3.descending(a.tags?.extended ? 1 : 0, b.tags?.extended ? 1 : 0);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return d3.descending(aDose, bDose);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
drawBolus.bolus(insulinGroups.filter(function(d) {
|
|
86
|
+
return commonbolus.getDelivered(d);
|
|
87
|
+
}));
|
|
88
|
+
|
|
89
|
+
insulinData.exit().remove();
|
|
90
|
+
|
|
91
|
+
var highlight = pool.highlight('.d3-wizard-group, .d3-bolus-group, .d3-insulin-group', opts);
|
|
92
|
+
|
|
93
|
+
// tooltips
|
|
94
|
+
selection.selectAll('.d3-insulin-group').on('mouseover', function(d) {
|
|
95
|
+
highlight.on(d3.select(this));
|
|
96
|
+
var parentContainer = document.getElementsByClassName('patient-data')[0].getBoundingClientRect();
|
|
97
|
+
var container = this.getBoundingClientRect();
|
|
98
|
+
container.y = container.top - parentContainer.top;
|
|
99
|
+
|
|
100
|
+
drawBolus.tooltip.add(d, container);
|
|
101
|
+
});
|
|
102
|
+
selection.selectAll('.d3-insulin-group').on('mouseout', function(d) {
|
|
103
|
+
highlight.off();
|
|
104
|
+
drawBolus.tooltip.remove(d);
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return insulin;
|
|
110
|
+
};
|
package/js/plot/quickbolus.js
CHANGED
|
@@ -113,7 +113,7 @@ module.exports = function(pool, opts) {
|
|
|
113
113
|
|
|
114
114
|
boluses.exit().remove();
|
|
115
115
|
|
|
116
|
-
var highlight = pool.highlight('.d3-wizard-group, .d3-bolus-group', opts);
|
|
116
|
+
var highlight = pool.highlight('.d3-wizard-group, .d3-bolus-group, .d3-insulin-group', opts);
|
|
117
117
|
|
|
118
118
|
// tooltips
|
|
119
119
|
selection.selectAll('.d3-bolus-group').on('mouseover', function(d) {
|
|
@@ -49,7 +49,7 @@ module.exports = function(container, annotationsGroup) {
|
|
|
49
49
|
var hoverTarget;
|
|
50
50
|
|
|
51
51
|
if (opts && opts.d && !_.isEmpty(opts.d.annotations)) {
|
|
52
|
-
if (opts.d.annotations[0].code
|
|
52
|
+
if (opts.d.annotations[0].code?.slice(0, 6) === 'stats-') {
|
|
53
53
|
// NB: this (temporarily) disables the new explainer tooltips
|
|
54
54
|
// for all stats widget components when stats are active
|
|
55
55
|
if (opts.d.annotations[0].code !== 'stats-insufficient-data') {
|
|
@@ -97,7 +97,7 @@ module.exports = function(container, annotationsGroup) {
|
|
|
97
97
|
annotation.tooltip = function(opts, selection, hoverTarget) {
|
|
98
98
|
opts = opts || {};
|
|
99
99
|
|
|
100
|
-
if (opts.d.annotations[0].code
|
|
100
|
+
if (opts.d.annotations[0].code?.slice(0, 6) === 'stats-') {
|
|
101
101
|
if (container.type === 'daily') {
|
|
102
102
|
opts.x = opts.x - (container.currentTranslation() - container.axisGutter());
|
|
103
103
|
}
|
|
@@ -47,6 +47,9 @@ module.exports = {
|
|
|
47
47
|
},
|
|
48
48
|
getMaxValue: function(d) {
|
|
49
49
|
var wiz;
|
|
50
|
+
if (d.type === 'insulin') {
|
|
51
|
+
return this.getDelivered(d);
|
|
52
|
+
}
|
|
50
53
|
if (d.type === 'wizard') {
|
|
51
54
|
if (d.bolus) {
|
|
52
55
|
wiz = _.clone(d);
|
|
@@ -64,6 +67,9 @@ module.exports = {
|
|
|
64
67
|
return rec > programmedTotal ? rec : programmedTotal;
|
|
65
68
|
},
|
|
66
69
|
getDelivered: function(d) {
|
|
70
|
+
if (d.type === 'insulin') {
|
|
71
|
+
return d?.dose?.total || NaN;
|
|
72
|
+
}
|
|
67
73
|
if (d.type === 'wizard') {
|
|
68
74
|
if (d.bolus) {
|
|
69
75
|
d = d.bolus;
|
|
@@ -145,8 +145,12 @@ module.exports = function(pool, opts) {
|
|
|
145
145
|
},
|
|
146
146
|
'class': function(d) {
|
|
147
147
|
d = pluckBolus(d);
|
|
148
|
+
if (d.type === 'insulin') return 'd3-rect-insulin d3-bolus';
|
|
148
149
|
return d.subType === 'automated' ? 'd3-bolus-automated d3-bolus' : 'd3-rect-bolus d3-bolus';
|
|
149
150
|
},
|
|
151
|
+
'fill': function(d) {
|
|
152
|
+
return (d.type === 'insulin') ? 'url(#diagonalStripes)' : null;
|
|
153
|
+
},
|
|
150
154
|
id: function(d) {
|
|
151
155
|
d = pluckBolus(d);
|
|
152
156
|
return 'bolus_' + d.id;
|
package/js/plot/util/legend.js
CHANGED
|
@@ -257,6 +257,32 @@ var legend = {
|
|
|
257
257
|
type: 'text'
|
|
258
258
|
},
|
|
259
259
|
],
|
|
260
|
+
bolusInsulin: [
|
|
261
|
+
{
|
|
262
|
+
create: function(opts) {
|
|
263
|
+
opts.widths.push(opts.SHAPE_WIDTH);
|
|
264
|
+
return opts.selection.append('rect')
|
|
265
|
+
.attr({
|
|
266
|
+
'class': 'd3-bolus d3-rect-bolus-insulin-legend'
|
|
267
|
+
});
|
|
268
|
+
},
|
|
269
|
+
type: 'rect'
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
create: function(opts) {
|
|
273
|
+
return opts.selection.append('text')
|
|
274
|
+
.attr({
|
|
275
|
+
'class': 'd3-pool-legend'
|
|
276
|
+
})
|
|
277
|
+
.text(EMPTY_SPACE + t('other'))
|
|
278
|
+
.each(function() {
|
|
279
|
+
opts.widths.push(this.getBoundingClientRect().width);
|
|
280
|
+
opts.textHeight = this.getBoundingClientRect().height;
|
|
281
|
+
});
|
|
282
|
+
},
|
|
283
|
+
type: 'text'
|
|
284
|
+
},
|
|
285
|
+
],
|
|
260
286
|
carbs: [
|
|
261
287
|
{
|
|
262
288
|
create: function(opts) {
|
package/js/plot/wizard.js
CHANGED
|
@@ -124,7 +124,7 @@ module.exports = function(pool, opts) {
|
|
|
124
124
|
|
|
125
125
|
wizards.exit().remove();
|
|
126
126
|
|
|
127
|
-
var highlight = pool.highlight('.d3-wizard-group, .d3-bolus-group', opts);
|
|
127
|
+
var highlight = pool.highlight('.d3-wizard-group, .d3-bolus-group, .d3-insulin-group', opts);
|
|
128
128
|
|
|
129
129
|
// tooltips
|
|
130
130
|
selection.selectAll('.d3-wizard-group').on('mouseover', function(d) {
|
package/package.json
CHANGED
|
@@ -199,6 +199,11 @@ class BasicsChart extends React.Component {
|
|
|
199
199
|
if (hasAutomatedSuspends && hasAutomatedStops) section.perRow = 2;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
+
if (section.type === 'boluses' && section.perRow === 3) {
|
|
203
|
+
const hasManualBoluses = _.get(props, 'data.data.aggregationsByDate.boluses.summary.subtotals.manual.count', 0) > 0;
|
|
204
|
+
if (hasManualBoluses) section.perRow = 4;
|
|
205
|
+
}
|
|
206
|
+
|
|
202
207
|
if (_.isArray(selectorOptions.rows)) selectorOptions.rows = _.chunk(_.orderBy(selectorOptions.rows, 'selectorIndex'), section.perRow || 3);
|
|
203
208
|
}
|
|
204
209
|
|
|
@@ -25,6 +25,7 @@ var cx = require('classnames');
|
|
|
25
25
|
|
|
26
26
|
var basicsActions = require('../../logic/actions');
|
|
27
27
|
var BasicsUtils = require('../BasicsUtils');
|
|
28
|
+
var { getUppercasedManufacturer } = require('../../../../../js/data/util/device');
|
|
28
29
|
|
|
29
30
|
var constants = require('../../logic/constants');
|
|
30
31
|
|
|
@@ -137,7 +138,7 @@ var Selector = createReactClass({
|
|
|
137
138
|
}
|
|
138
139
|
};
|
|
139
140
|
|
|
140
|
-
const manufacturer =
|
|
141
|
+
const manufacturer = getUppercasedManufacturer(_.get(pump, 'manufacturer', ''));
|
|
141
142
|
|
|
142
143
|
if (pumpVocabulary.hasOwnProperty(manufacturer)) {
|
|
143
144
|
return (
|
|
@@ -90,6 +90,7 @@ function chartDailyFactory(el, options) {
|
|
|
90
90
|
const bolusCarbsLegend = ['bolus', 'carbs'];
|
|
91
91
|
if (showingCarbExchanges) bolusCarbsLegend.splice(1, 0, 'carbExchanges');
|
|
92
92
|
if (options.automatedBolus) bolusCarbsLegend.unshift('bolusAutomated');
|
|
93
|
+
if (options.insulinBolus) bolusCarbsLegend.unshift('bolusInsulin');
|
|
93
94
|
|
|
94
95
|
const basalLegend = ['basal'];
|
|
95
96
|
if (options.automatedBasal) basalLegend.unshift('basalAutomated');
|
|
@@ -161,7 +162,7 @@ function chartDailyFactory(el, options) {
|
|
|
161
162
|
if (!options.pool.bolus.hidden) poolBolus = chart.newPool(options.pool.bolus)
|
|
162
163
|
.id('poolBolus', chart.poolGroup())
|
|
163
164
|
.label([{
|
|
164
|
-
'main': t('
|
|
165
|
+
'main': t('Insulin'),
|
|
165
166
|
'light': ' U'
|
|
166
167
|
},
|
|
167
168
|
{
|
|
@@ -221,6 +222,10 @@ function chartDailyFactory(el, options) {
|
|
|
221
222
|
type: 'bolus',
|
|
222
223
|
shape: 'generic'
|
|
223
224
|
});
|
|
225
|
+
if (poolBolus) chart.tooltips().addGroup(poolBolus, {
|
|
226
|
+
type: 'insulin',
|
|
227
|
+
shape: 'generic'
|
|
228
|
+
});
|
|
224
229
|
if (poolBasal) chart.tooltips().addGroup(poolBasal, {
|
|
225
230
|
type: 'basal'
|
|
226
231
|
});
|
|
@@ -235,6 +240,7 @@ function chartDailyFactory(el, options) {
|
|
|
235
240
|
'cbg',
|
|
236
241
|
'deviceEvent',
|
|
237
242
|
'food',
|
|
243
|
+
'insulin',
|
|
238
244
|
'message',
|
|
239
245
|
'smbg',
|
|
240
246
|
'wizard',
|
|
@@ -256,14 +262,19 @@ function chartDailyFactory(el, options) {
|
|
|
256
262
|
}
|
|
257
263
|
|
|
258
264
|
const groupedData = _.groupBy(processedData, 'type');
|
|
259
|
-
|
|
265
|
+
|
|
266
|
+
// Set all event data to type 'event' to allow rendering them in all sequential order regardless of actual type
|
|
267
|
+
const groupedEventData = { event: _.map(
|
|
268
|
+
_.filter(processedData, d => _.isString(d.tags?.event)),
|
|
269
|
+
d => ({ ...d, type: 'event', originalType: d.type })
|
|
270
|
+
) };
|
|
260
271
|
|
|
261
272
|
_.each(renderedDataTypes, type => {
|
|
262
273
|
if (!groupedData[type]) groupedData[type] = [];
|
|
263
274
|
});
|
|
264
275
|
|
|
265
276
|
// initialize chart with data
|
|
266
|
-
chart.data(processedData).setAxes();
|
|
277
|
+
chart.data([...processedData, ...(groupedEventData.event || [])]).setAxes();
|
|
267
278
|
if (!options.endpoints) chart.setNav().setScrollNav();
|
|
268
279
|
|
|
269
280
|
// x-axis pools
|
|
@@ -336,7 +347,7 @@ function chartDailyFactory(el, options) {
|
|
|
336
347
|
|
|
337
348
|
if (poolBolus) {
|
|
338
349
|
// bolus & carbs pool
|
|
339
|
-
var scaleBolus = scales.bolus(groupedData.bolus.concat(groupedData.wizard), poolBolus);
|
|
350
|
+
var scaleBolus = scales.bolus(groupedData.bolus.concat(groupedData.wizard).concat(groupedData.insulin), poolBolus);
|
|
340
351
|
var scaleCarbs = options.dynamicCarbs ? scales.carbs(groupedData.wizard, poolBolus) : null;
|
|
341
352
|
// set up y-axis for bolus
|
|
342
353
|
poolBolus.yAxis(d3.svg.axis()
|
|
@@ -356,7 +367,17 @@ function chartDailyFactory(el, options) {
|
|
|
356
367
|
yScale: scaleHeight
|
|
357
368
|
}), true, true);
|
|
358
369
|
|
|
359
|
-
// add
|
|
370
|
+
// add insulin data to bolus pool
|
|
371
|
+
poolBolus.addPlotType('insulin', tideline.plot.insulin(poolBolus, {
|
|
372
|
+
yScale: scaleBolus,
|
|
373
|
+
emitter: emitter,
|
|
374
|
+
subdueOpacity: 0.4,
|
|
375
|
+
timezoneAware: chart.options.timePrefs.timezoneAware,
|
|
376
|
+
onBolusHover: options.onBolusHover,
|
|
377
|
+
onBolusOut: options.onBolusOut,
|
|
378
|
+
}), true, true);
|
|
379
|
+
|
|
380
|
+
// add wizard data to bolus pool
|
|
360
381
|
poolBolus.addPlotType('wizard', tideline.plot.wizard(poolBolus, {
|
|
361
382
|
yScale: scaleBolus,
|
|
362
383
|
yScaleCarbs: scaleCarbs,
|
|
@@ -374,7 +395,7 @@ function chartDailyFactory(el, options) {
|
|
|
374
395
|
onCarbOut: options.onCarbOut,
|
|
375
396
|
}), true, true);
|
|
376
397
|
|
|
377
|
-
// quick bolus data to
|
|
398
|
+
// quick bolus data to bolus pool
|
|
378
399
|
poolBolus.addPlotType('bolus', tideline.plot.quickbolus(poolBolus, {
|
|
379
400
|
yScale: scaleBolus,
|
|
380
401
|
emitter: emitter,
|
|
@@ -462,7 +483,7 @@ function chartDailyFactory(el, options) {
|
|
|
462
483
|
// add pump events data to events pool
|
|
463
484
|
_.each(groupedEventData, function(data, type) {
|
|
464
485
|
poolEvents.addPlotType(type, tideline.plot.event(poolEvents, {
|
|
465
|
-
size:
|
|
486
|
+
size: 24,
|
|
466
487
|
emitter: emitter,
|
|
467
488
|
data: data,
|
|
468
489
|
timezoneAware: chart.options.timePrefs.timezoneAware,
|