diff --git a/DESCRIPTION b/DESCRIPTION index b41d8a9b..af04f4a3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: safetyGraphics Title: Create Interactive Graphics Related to Clinical Trial Safety -Version: 0.9.0 +Version: 0.9.1 Authors@R: c( person("Jeremy", "Wildfire", email = "jeremy_wildfire@rhoworld.com", role = c("cre","aut")), person("Becca", "Krouse", role="aut"), @@ -18,11 +18,11 @@ License: MIT + file LICENSE Encoding: UTF-8 LazyData: true RoxygenNote: 6.1.1 -Suggests: +Suggests: testthat, shinytest, knitr -Imports: +Imports: dplyr, htmlwidgets, purrr, diff --git a/README.md b/README.md index 9b95cc03..2d1134ff 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![Travis-CI Build Status](https://travis-ci.org/ASA-DIA-InteractiveSafetyGraphics/safetyGraphics.svg?branch=master)](https://travis-ci.org/ASA-DIA-InteractiveSafetyGraphics/safetyGraphics) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/safetyGraphics)](https://cran.r-project.org/package=safetyGraphics) +[![Travis-CI Build Status](https://travis-ci.org/SafetyGraphics/safetyGraphics.svg?branch=master)](https://travis-ci.org/SafetyGraphics/safetyGraphics) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/safetyGraphics)](https://cran.r-project.org/package=safetyGraphics) # safetyGraphics: Clinical Trial Safety Graphics with R diff --git a/inst/htmlwidgets/eDISH.yaml b/inst/htmlwidgets/eDISH.yaml index aa307410..17ad864a 100644 --- a/inst/htmlwidgets/eDISH.yaml +++ b/inst/htmlwidgets/eDISH.yaml @@ -4,11 +4,11 @@ dependencies: src: htmlwidgets/lib/d3-3.5.17 script: d3.v3.min.js - name: webcharts - version: 1.11.1 - src: htmlwidgets/lib/webcharts-1.11.1 + version: 1.11.3 + src: htmlwidgets/lib/webcharts-1.11.3 script: webcharts.js stylesheet: webcharts.css - name: safety-eDish - version: 0.16.2 - src: htmlwidgets/lib/safety-eDISH-0.16.2 + version: 0.16.3 + src: htmlwidgets/lib/safety-eDISH-0.16.3 script: safetyedish.js diff --git a/inst/htmlwidgets/lib/safety-eDISH-0.16.2/safetyedish.js b/inst/htmlwidgets/lib/safety-eDISH-0.16.3/safetyedish.js similarity index 99% rename from inst/htmlwidgets/lib/safety-eDISH-0.16.2/safetyedish.js rename to inst/htmlwidgets/lib/safety-eDISH-0.16.3/safetyedish.js index 0ce8b7f1..03550241 100644 --- a/inst/htmlwidgets/lib/safety-eDISH-0.16.2/safetyedish.js +++ b/inst/htmlwidgets/lib/safety-eDISH-0.16.3/safetyedish.js @@ -2,8 +2,8 @@ typeof exports === 'object' && typeof module !== 'undefined' ? (module.exports = factory(require('webcharts'))) : typeof define === 'function' && define.amd - ? define(['webcharts'], factory) - : (global.safetyedish = factory(global.webCharts)); + ? define(['webcharts'], factory) + : (global.safetyedish = factory(global.webCharts)); })(this, function(webcharts) { 'use strict'; @@ -217,8 +217,8 @@ studyday_col: 'DY', value_col: 'STRESN', measure_col: 'TEST', - normal_col_low: 'STNRLO', normal_col_high: 'STNRHI', + normal_col_low: null, visit_col: null, visitn_col: null, group_cols: null, @@ -407,8 +407,8 @@ label: filter.label ? filter.label : filter.value_col - ? filter.value_col - : filter + ? filter.value_col + : filter }; if ( @@ -432,8 +432,8 @@ label: group.label ? group.label : group.value_col - ? group.value_col - : filter + ? group.value_col + : filter }; if ( defaultDetails.find(function(f) { @@ -464,8 +464,8 @@ label: detail.label ? detail.label : detail.value_col - ? detail.value_col - : detail + ? detail.value_col + : detail }); }); settings.details = defaultDetails; @@ -718,8 +718,8 @@ label: filter.label ? filter.label : filter.value_col - ? filter.value_col - : filter + ? filter.value_col + : filter }; return filter; }); @@ -922,7 +922,7 @@ ///////////////////////// // Remove invalid rows ///////////////////////// - var numerics = ['value_col', 'studyday_col', 'normal_col_low', 'normal_col_high']; + var numerics = ['value_col', 'studyday_col', 'normal_col_high']; chart.imputed_data = chart.initial_data.filter(function(f) { return true; }); @@ -1864,10 +1864,10 @@ config.display == 'relative_uln' ? ' [xULN]' : config.display == 'relative_baseline' - ? ' [xBaseline]' - : config.display == 'absolute' - ? ' [raw values]' - : null; + ? ' [xBaseline]' + : config.display == 'absolute' + ? ' [raw values]' + : null; //Update axis labels. config.x.label = config.measure_values[config.x.column] + unit; @@ -2848,10 +2848,12 @@ visitn: config.visitn_col ? +m[config.visitn_col] : null, studyday: +m[config.studyday_col], value: +m[config.value_col], - lln: +m[config.normal_col_low], + lln: config.normal_col_low ? +m[config.normal_col_low] : null, uln: +m[config.normal_col_high], population_extent: measureObj.population_extent, - outlier_low: +m[config.value_col] < +m[config.normal_col_low], + outlier_low: config.normal_col_low + ? +m[config.value_col] < +m[config.normal_col_low] + : null, outlier_high: +m[config.value_col] > +m[config.normal_col_high] }; obj.outlier = obj.outlier_low || obj.outlier_high; @@ -3240,10 +3242,10 @@ ([0, 4, 5, 6, 7, 8, 9].indexOf(lastDigit) > -1 ? 'th' : lastDigit === 3 - ? 'rd' - : lastDigit === 2 - ? 'nd' - : 'st'); + ? 'rd' + : lastDigit === 2 + ? 'nd' + : 'st'); return text; }) .join(' and ') + @@ -3673,7 +3675,7 @@ .style('font-size', '0.7em') .style('padding-top', '0.1em') .text( - 'Points are shown for values above the current reference value. Mouseover a line to see the reference line for that lab.' + 'Points are filled for values above the current reference value. Mouseover a line to see the reference line for that lab.' ); } @@ -3745,10 +3747,10 @@ config.display == 'relative_uln' ? 'Values are plotted as multiples of the upper limit of normal for the measure.' : config.display == 'relative_baseline' - ? "Values are plotted as multiples of the partipant's baseline value for the measure." - : config.display == 'absolute' - ? ' Values are plotted using the raw units for the measure.' - : null; + ? "Values are plotted as multiples of the partipant's baseline value for the measure." + : config.display == 'absolute' + ? ' Values are plotted using the raw units for the measure.' + : null; var axisLabels = chart.svg .selectAll('.axis') diff --git a/inst/htmlwidgets/lib/webcharts-1.11.1/webcharts.css b/inst/htmlwidgets/lib/webcharts-1.11.3/webcharts.css similarity index 99% rename from inst/htmlwidgets/lib/webcharts-1.11.1/webcharts.css rename to inst/htmlwidgets/lib/webcharts-1.11.3/webcharts.css index cc3fcb48..a64215a3 100644 --- a/inst/htmlwidgets/lib/webcharts-1.11.1/webcharts.css +++ b/inst/htmlwidgets/lib/webcharts-1.11.3/webcharts.css @@ -1,4 +1,3 @@ - @import url(//fonts.googleapis.com/css?family=Open+Sans:400,300); /*------------------------------------------------------------------------------------------------\ Small Multiple Layout \------------------------------------------------------------------------------------------------*/ diff --git a/inst/htmlwidgets/lib/webcharts-1.11.1/webcharts.js b/inst/htmlwidgets/lib/webcharts-1.11.3/webcharts.js similarity index 99% rename from inst/htmlwidgets/lib/webcharts-1.11.1/webcharts.js rename to inst/htmlwidgets/lib/webcharts-1.11.3/webcharts.js index 51a61ca2..e6fe9061 100644 --- a/inst/htmlwidgets/lib/webcharts-1.11.1/webcharts.js +++ b/inst/htmlwidgets/lib/webcharts-1.11.3/webcharts.js @@ -4,9 +4,9 @@ : typeof define === 'function' && define.amd ? define(['d3'], factory) : (global.webCharts = factory(global.d3)); -})(this, function(d3) { +})(typeof self !== 'undefined' ? self : this, function(d3) { 'use strict'; - var version = '1.11.1'; + var version = '1.11.3'; function init(data) { var _this = this; @@ -433,7 +433,7 @@ return f instanceof Date; }); }) - .entries(this.raw_data) + .entries(this.filtered_data) .sort(function(a, b) { return d3.min(b.values) - d3.min(a.values); }) @@ -1592,7 +1592,7 @@ } function makeLegend() { - var scale$$1 = arguments.length > 0 && arguments[0] !== undefined + var scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.colorScale; var label = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; @@ -1638,7 +1638,7 @@ var legend_data = custom_data || - scale$$1 + scale .domain() .slice(0) .filter(function(f) { @@ -1670,7 +1670,7 @@ .attr('class', 'legend-item') .style({ 'list-style-type': 'none', 'margin-right': '1em' }); new_parts.append('span').attr('class', 'legend-mark-text').style('color', function(d) { - return scale$$1(d.label); + return scale(d.label); }); new_parts .append('svg') @@ -1695,16 +1695,16 @@ leg_parts.selectAll('.legend-color-block').select('.legend-mark').remove(); leg_parts.selectAll('.legend-color-block').each(function(e) { - var svg$$1 = d3.select(this); + var svg = d3.select(this); if (e.mark === 'circle') { - svg$$1.append('circle').attr({ + svg.append('circle').attr({ cx: '.5em', cy: '.5em', r: '.45em', class: 'legend-mark' }); } else if (e.mark === 'line') { - svg$$1.append('line').attr({ + svg.append('line').attr({ x1: 0, y1: '.5em', x2: '1em', @@ -1714,7 +1714,7 @@ class: 'legend-mark' }); } else if (e.mark === 'square') { - svg$$1.append('rect').attr({ + svg.append('rect').attr({ height: '1em', width: '1em', class: 'legend-mark', @@ -1726,10 +1726,10 @@ .selectAll('.legend-color-block') .select('.legend-mark') .attr('fill', function(d) { - return d.color || scale$$1(d.label); + return d.color || scale(d.label); }) .attr('stroke', function(d) { - return d.color || scale$$1(d.label); + return d.color || scale(d.label); }) .each(function(e) { d3.select(this).attr(e.attributes); @@ -1743,7 +1743,7 @@ return d.label; }); - if (scale$$1.domain().length > 0) { + if (scale.domain().length > 0) { var legendDisplay = (this.config.legend.location === 'bottom' || this.config.legend.location === 'top') && !this.parent @@ -3335,8 +3335,8 @@ } /*------------------------------------------------------------------------------------------------\ - Check equality of two arrays (https://stackoverflow.com/questions/7837456/how-to-compare-arrays-in-javascript) -\------------------------------------------------------------------------------------------------*/ + Check equality of two arrays (https://stackoverflow.com/questions/7837456/how-to-compare-arrays-in-javascript) + \------------------------------------------------------------------------------------------------*/ // Warn if overriding existing method if (Array.prototype.equals) @@ -3782,6 +3782,7 @@ } function layout$4() { + //Add sort container. this.sortable.wrap = this.wrap .select('.table-top') .append('div') @@ -3970,8 +3971,8 @@ if (next >= this.config.nPages) next = this.config.nPages - 1; // nothing after the last page /**-------------------------------------------------------------------------------------------\ - Left side - \-------------------------------------------------------------------------------------------**/ + Left side + \-------------------------------------------------------------------------------------------**/ this.pagination.wrap .insert('span', ':first-child') @@ -3998,8 +3999,8 @@ .text('<<'); /**-------------------------------------------------------------------------------------------\ - Right side - \-------------------------------------------------------------------------------------------**/ + Right side + \-------------------------------------------------------------------------------------------**/ this.pagination.wrap .append('span') @@ -4353,8 +4354,8 @@ this.events.onDatatransform.call(this); /**-------------------------------------------------------------------------------------------\ - Code below associated with the former paradigm of a d3.nest() data array. - \-------------------------------------------------------------------------------------------**/ + Code below associated with the former paradigm of a d3.nest() data array. + \-------------------------------------------------------------------------------------------**/ if (config.row_per) { var rev_order = config.row_per.slice(0).reverse();