Skip to content

Commit

Permalink
Merge pull request #77 from RhoInc/dev-v2.1.2
Browse files Browse the repository at this point in the history
Dev v2.1.2
  • Loading branch information
samussiah authored May 17, 2019
2 parents 4665240 + 17ce6d9 commit 29643b1
Show file tree
Hide file tree
Showing 8 changed files with 218 additions and 159 deletions.
32 changes: 20 additions & 12 deletions build/safetyShiftPlot.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
typeof exports === 'object' && typeof module !== 'undefined'
? (module.exports = factory(require('d3'), require('webcharts')))
: typeof define === 'function' && define.amd
? define(['d3', 'webcharts'], factory)
: (global.safetyShiftPlot = factory(global.d3, global.webCharts));
? define(['d3', 'webcharts'], factory)
: (global.safetyShiftPlot = factory(global.d3, global.webCharts));
})(this, function(d3, webcharts) {
'use strict';

Expand Down Expand Up @@ -177,6 +177,9 @@

// Replicate settings in multiple places in the settings object
function syncSettings(settings) {
if (!(settings.filters instanceof Array))
settings.filters = typeof settings.filters === 'string' ? [settings.filters] : [];

settings.measure = settings.start_value;
return settings;
}
Expand Down Expand Up @@ -537,7 +540,13 @@
var diff = aOrder - bOrder;
return diff
? diff
: aOrder < bOrder ? -1 : aOrder > bOrder ? 1 : aVisit < bVisit ? -1 : 1;
: aOrder < bOrder
? -1
: aOrder > bOrder
? 1
: aVisit < bVisit
? -1
: 1;
})
.map(function(visit) {
return visit.split('||')[0];
Expand Down Expand Up @@ -1132,12 +1141,10 @@
});
var ybox = this.svg.append('g').attr('class', 'yMargin');
drawBoxPlot(ybox, yValues, this.plot_height, 1, this.y_dom, 10, '#bbb', 'white');
ybox
.select('g.boxplot')
.attr(
'transform',
'translate(' + (this.plot_width + this.config.margin.right / 2) + ',0)'
);
ybox.select('g.boxplot').attr(
'transform',
'translate(' + (this.plot_width + this.config.margin.right / 2) + ',0)'
);

//X-axis box plot
var xValues = this.current_data.map(function(d) {
Expand All @@ -1156,9 +1163,10 @@
'0.2f', //format
false // horizontal?
);
xbox
.select('g.boxplot')
.attr('transform', 'translate(0,' + -(this.config.margin.top / 2) + ')');
xbox.select('g.boxplot').attr(
'transform',
'translate(0,' + -(this.config.margin.top / 2) + ')'
);
}

function listVisits() {
Expand Down
Loading

0 comments on commit 29643b1

Please sign in to comment.