Skip to content

Commit

Permalink
Move comment to where it belongs, changed math so first 10 treatments…
Browse files Browse the repository at this point in the history
… don't reduce scaling
  • Loading branch information
sulkaharo committed Nov 29, 2017
1 parent 0ad3829 commit 5b27df2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/client/renderer.js
Expand Up @@ -451,9 +451,10 @@ function init (client, d3) {

if ( treatment.insulin < 1 && !treatment.carbs && enteredBy.indexOf('openaps') > -1) { // don't show the unit of measurement for insulin boluses < 1 without carbs (e.g. oref0 SMB's). Otherwise lot's of small insulin only dosages are often unreadable
unit_of_measurement = '';
// remove leading zeros to avoid overlap with adjacent boluses
dosage_units = (dosage_units+"").replace(/^0/,"");
}
// remove leading zeros to avoid overlap with adjacent boluses

arc_data[3].element = dosage_units + unit_of_measurement;
}

Expand Down Expand Up @@ -861,7 +862,7 @@ function init (client, d3) {
.style('fill', 'white');

// reduce the treatment label font size to make it readable with SMB
var fontBaseSize = (opts.treatments >= 50) ? 40 : 50 - Math.floor((50-opts.treatments)/50 * 10);
var fontBaseSize = (opts.treatments >= 50) ? 40 : 50 - Math.floor((60-opts.treatments)/50 * 10);

label.append('text')
.style('font-size', fontBaseSize / opts.scale)
Expand Down

0 comments on commit 5b27df2

Please sign in to comment.