tideline 1.25.0 → 1.26.0-rc.2

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/.babelrc CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "presets": [
3
- "es2015",
4
- "stage-0",
5
- "stage-2",
6
- "react"
3
+ "@babel/preset-env",
4
+ "@babel/preset-react",
5
+ "babel-preset-react-app"
7
6
  ]
8
- }
7
+ }
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 10.14.2
@@ -44,7 +44,8 @@ module.exports = function(pool, opts) {
44
44
  var filteredData = _.filter(currentData, {
45
45
  subType: 'status',
46
46
  status: 'suspended',
47
- reason: { suspended: 'automatic' }
47
+ reason: { suspended: 'automatic' },
48
+ payload: { suspended: { reason: 'Auto suspend by PLGS' } },
48
49
  });
49
50
 
50
51
  filteredData = _.filter(filteredData, (data) => {
package/js/twoweek.js CHANGED
@@ -43,7 +43,6 @@ module.exports = function(emitter, timePrefs) {
43
43
  currentTranslation: 0
44
44
  },
45
45
  axisGutter = 52, dataGutter, dayTickSize = 0,
46
- statsHeight = 80,
47
46
  pools = [], poolGroup, days, daysGroup,
48
47
  xScale = d3.scale.linear(), xAxis, yScale = d3.time.scale.utc(), yAxis,
49
48
  data, viewEndpoints, dataStartNoon, dataEndNoon, poolScaleHeight,
@@ -74,10 +73,10 @@ module.exports = function(emitter, timePrefs) {
74
73
  log('Jumped forward two weeks.');
75
74
  var n = 0;
76
75
  if (sortReverse) {
77
- nav.currentTranslation += height - nav.axisHeight - statsHeight;
76
+ nav.currentTranslation += height - nav.axisHeight;
78
77
  emitter.emit('inTransition', true);
79
78
  mainGroup.transition().duration(500).tween('zoom', function() {
80
- var iy = d3.interpolate(nav.currentTranslation - height + nav.axisHeight + statsHeight, nav.currentTranslation);
79
+ var iy = d3.interpolate(nav.currentTranslation - height + nav.axisHeight, nav.currentTranslation);
81
80
  return function(t) {
82
81
  nav.scroll.translate([0, iy(t)]);
83
82
  nav.scroll.event(mainGroup);
@@ -92,10 +91,10 @@ module.exports = function(emitter, timePrefs) {
92
91
  });
93
92
  }
94
93
  else {
95
- nav.currentTranslation -= height - nav.axisHeight - statsHeight;
94
+ nav.currentTranslation -= height - nav.axisHeight;
96
95
  emitter.emit('inTransition', true);
97
96
  mainGroup.transition().duration(500).tween('zoom', function() {
98
- var iy = d3.interpolate(nav.currentTranslation + height - nav.axisHeight - statsHeight, nav.currentTranslation);
97
+ var iy = d3.interpolate(nav.currentTranslation + height - nav.axisHeight, nav.currentTranslation);
99
98
  return function(t) {
100
99
  nav.scroll.translate([0, iy(t)]);
101
100
  nav.scroll.event(mainGroup);
@@ -115,10 +114,10 @@ module.exports = function(emitter, timePrefs) {
115
114
  log('Jumped back two weeks.');
116
115
  var n = 0;
117
116
  if (sortReverse) {
118
- nav.currentTranslation -= height - nav.axisHeight - statsHeight;
117
+ nav.currentTranslation -= height - nav.axisHeight;
119
118
  emitter.emit('inTransition', true);
120
119
  mainGroup.transition().duration(500).tween('zoom', function() {
121
- var iy = d3.interpolate(nav.currentTranslation + height - nav.axisHeight - statsHeight, nav.currentTranslation);
120
+ var iy = d3.interpolate(nav.currentTranslation + height - nav.axisHeight, nav.currentTranslation);
122
121
  return function(t) {
123
122
  nav.scroll.translate([0, iy(t)]);
124
123
  nav.scroll.event(mainGroup);
@@ -133,10 +132,10 @@ module.exports = function(emitter, timePrefs) {
133
132
  });
134
133
  }
135
134
  else {
136
- nav.currentTranslation += height - nav.axisHeight - statsHeight;
135
+ nav.currentTranslation += height - nav.axisHeight;
137
136
  emitter.emit('inTransition', true);
138
137
  mainGroup.transition().duration(500).tween('zoom', function() {
139
- var iy = d3.interpolate(nav.currentTranslation - height + nav.axisHeight + statsHeight, nav.currentTranslation);
138
+ var iy = d3.interpolate(nav.currentTranslation - height + nav.axisHeight, nav.currentTranslation);
140
139
  return function(t) {
141
140
  nav.scroll.translate([0, iy(t)]);
142
141
  nav.scroll.event(mainGroup);
@@ -165,7 +164,7 @@ module.exports = function(emitter, timePrefs) {
165
164
  var weight = 1.0;
166
165
  var cumWeight = weight * numPools;
167
166
  var totalPoolsHeight =
168
- container.height() - nav.axisHeight - statsHeight;
167
+ container.height() - nav.axisHeight;
169
168
  poolScaleHeight = totalPoolsHeight/cumWeight;
170
169
  var actualPoolsHeight = 0;
171
170
  pools.forEach(function(pool) {
@@ -192,7 +191,7 @@ module.exports = function(emitter, timePrefs) {
192
191
  }
193
192
  }
194
193
  else {
195
- currentYPosition = container.height() - statsHeight - poolScaleHeight;
194
+ currentYPosition = container.height() - poolScaleHeight;
196
195
  nextBatchYPosition = currentYPosition + poolScaleHeight;
197
196
  for (var k = viewIndex; k < pools.length; k++) {
198
197
  pool = pools[k];
@@ -208,13 +207,6 @@ module.exports = function(emitter, timePrefs) {
208
207
  pool.group().attr('transform', 'translate(0,' + pool.yPosition() + ')');
209
208
  }
210
209
  }
211
-
212
- // setup stats group
213
- container.poolStats = new Pool(container);
214
- container.poolStats.id('poolStats', poolGroup).heightRatio(1.05).height(statsHeight * (4/5));
215
- container.poolStats.group().attr({
216
- transform: 'translate(' + axisGutter + ',' + (height - statsHeight) + ')'
217
- });
218
210
  };
219
211
 
220
212
  container.clear = function() {
@@ -364,7 +356,7 @@ module.exports = function(emitter, timePrefs) {
364
356
  .attr({
365
357
  x: 0,
366
358
  y: 0,
367
- height: height - nav.axisHeight - statsHeight,
359
+ height: height - nav.axisHeight,
368
360
  width: width,
369
361
  transform: 'translate(0,' + nav.axisHeight + ')'
370
362
  });
@@ -427,7 +419,7 @@ module.exports = function(emitter, timePrefs) {
427
419
 
428
420
  // set the domain and range for the main two-week y-scale
429
421
  yScale.domain(viewEndpoints)
430
- .range([nav.axisHeight, height - statsHeight])
422
+ .range([nav.axisHeight, height])
431
423
  .ticks(d3.time.day.utc, 1);
432
424
 
433
425
  yAxis = d3.svg.axis().scale(yScale)
@@ -450,13 +442,13 @@ module.exports = function(emitter, timePrefs) {
450
442
  start.setUTCDate(start.getUTCDate() - 1);
451
443
  nav.scrollScale = d3.time.scale.utc()
452
444
  .domain([dataEndNoon, start])
453
- .range([nav.axisHeight + nav.scrollThumbRadius, height - statsHeight - nav.scrollThumbRadius]);
445
+ .range([nav.axisHeight + nav.scrollThumbRadius, height - nav.scrollThumbRadius]);
454
446
 
455
447
  }
456
448
  else {
457
449
  nav.scrollScale = d3.time.scale.utc()
458
450
  .domain([dataStartNoon, dataEndNoon])
459
- .range([nav.axisHeight + nav.scrollThumbRadius, height - statsHeight - nav.scrollThumbRadius]);
451
+ .range([nav.axisHeight + nav.scrollThumbRadius, height - nav.scrollThumbRadius]);
460
452
  }
461
453
 
462
454
  pools.forEach(function(pool) {
@@ -571,7 +563,7 @@ module.exports = function(emitter, timePrefs) {
571
563
  var translationAdjustment, yStart, xPos;
572
564
  if (sortReverse) {
573
565
  yStart = nav.scrollScale(viewEndpoints[1]);
574
- translationAdjustment = height - statsHeight;
566
+ translationAdjustment = height;
575
567
 
576
568
  xPos = 2 * nav.navGutter / 3;
577
569
 
@@ -581,7 +573,7 @@ module.exports = function(emitter, timePrefs) {
581
573
  x1: xPos,
582
574
  x2: xPos,
583
575
  y1: nav.axisHeight + nav.scrollGutterWidth/2,
584
- y2: height - statsHeight - nav.scrollGutterWidth/2,
576
+ y2: height - nav.scrollGutterWidth/2,
585
577
  'stroke-width': nav.scrollGutterWidth,
586
578
  'class': 'scroll'
587
579
  });
@@ -598,7 +590,7 @@ module.exports = function(emitter, timePrefs) {
598
590
  x1: xPos,
599
591
  x2: xPos,
600
592
  y1: nav.axisHeight + nav.scrollGutterWidth/2,
601
- y2: height - statsHeight - nav.scrollGutterWidth/2,
593
+ y2: height - nav.scrollGutterWidth/2,
602
594
  'stroke-width': nav.scrollGutterWidth,
603
595
  'class': 'scroll'
604
596
  });
@@ -657,7 +649,6 @@ module.exports = function(emitter, timePrefs) {
657
649
  pools.forEach(function(pool) {
658
650
  pool.annotations(annotations);
659
651
  });
660
- container.poolStats.annotations(annotations);
661
652
  return container;
662
653
  };
663
654
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tideline",
3
- "version": "1.25.0",
3
+ "version": "1.26.0-rc.2",
4
4
  "description": "Tidepool's timeline data visualization",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,14 +33,16 @@
33
33
  "sundial": "1.6.0"
34
34
  },
35
35
  "devDependencies": {
36
+ "@babel/core": "7.11.4",
37
+ "@babel/preset-env": "7.11.0",
38
+ "@babel/preset-react": "7.10.4",
36
39
  "@hot-loader/react-dom": "16.11.0",
37
40
  "autoprefixer-loader": "3.2.0",
38
- "babel-core": "6.13.2",
41
+ "babel-core": "7.0.0-bridge.0",
39
42
  "babel-eslint": "10.0.3",
40
- "babel-loader": "6.2.5",
41
- "babel-plugin-rewire": "1.0.0-rc-6",
42
- "babel-preset-es2015": "6.13.2",
43
- "babel-preset-react": "6.11.1",
43
+ "babel-loader": "8.0.2",
44
+ "babel-plugin-rewire": "1.2.0",
45
+ "babel-preset-react-app": "4.0.0-next.2150693d",
44
46
  "babel-preset-stage-0": "6.5.0",
45
47
  "babel-preset-stage-2": "6.13.0",
46
48
  "chai": "3.5.0",
@@ -86,6 +88,9 @@
86
88
  "url-loader": "0.5.7",
87
89
  "webpack": "1.13.2"
88
90
  },
91
+ "peerDependencies": {
92
+ "babel-core": "6.x || 7.0.0-bridge.0"
93
+ },
89
94
  "resolutions": {
90
95
  "sundial/moment-timezone": "0.5.21"
91
96
  }
@@ -180,6 +180,14 @@ class BasicsChart extends React.Component {
180
180
  } else {
181
181
  selectorOptions = _.groupBy(section.dimensions, dimension => dimension.primary ? 'primary' : 'rows');
182
182
  if (_.isArray(selectorOptions.primary)) selectorOptions.primary = selectorOptions.primary[0] || {};
183
+
184
+ if (section.type === 'basals') {
185
+ const basalAggregationData = this.props.data?.data?.aggregationsByDate?.basals;
186
+ const hasAutomatedSuspends = basalAggregationData?.automatedSuspend?.summary?.subtotals?.automatedSuspend?.count > 0;
187
+ const hasAutomatedStops = basalAggregationData?.basal?.summary?.subtotals?.automatedStop?.count > 0;
188
+ if (hasAutomatedSuspends && hasAutomatedStops) section.perRow = 2;
189
+ }
190
+
183
191
  if (_.isArray(selectorOptions.rows)) selectorOptions.rows = _.chunk(_.orderBy(selectorOptions.rows, 'selectorIndex'), section.perRow || 3);
184
192
  }
185
193
 
@@ -77,3 +77,7 @@
77
77
  padding: 0px 0px 10px 10px;
78
78
  }
79
79
  }
80
+
81
+ .DashboardSection:nth-child(4) .DashboardSection-container .DashboardSection-content {
82
+ padding-bottom: 0px;
83
+ }