Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safety Delta-Delta v1.0.0 #14

Merged
merged 15 commits into from
Nov 27, 2019
Binary file removed .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["env"]
}
56 changes: 54 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,54 @@
# safety-delta-delta
Chart for exploring changes over time across multiple measures in clinical trial safety data
# Safety Delta-Delta Plot
[![Safety Delta-Delta animation](https://user-images.githubusercontent.com/3680095/67397935-51e39880-f580-11e9-8ff0-a6ae930745eb.gif)](https://rhoinc.github.io/safety-delta-delta/test-page/)

## Overview
Safety Delta Delta is a JavaScript library built with Webcharts ([1](https://github.com/RhoInc/Webcharts), [2](https://github.com/RhoInc/webcharts-wrapper-boilerplate)) that creates an interactive scatter plot showing relationships over time for lab measures, vital signs, and other measures related to safety in clinical trials. Click the animation above to try out an interactive demo of the chart.

By default the chart expects [SDTM](http://www.cdisc.org/sdtm)-structured data, but can be configured for any dataset with one record per measurement.
View full chart configuration details [here](https://github.com/RhoInc/safety-delta-delta/wiki/Configuration).

In addition to standard groups and filters, users can also select time points and measurements to compare, and can click any participant to see all of thier lab values over time. See the documentation for all features [here](https://github.com/RhoInc/safety-histogram/wiki/Technical-Documentation).

## Typical Usage
In the simplest case, the chart can be created with a single line of code provided the input dataset meets the [default requirements](https://github.com/RhoInc/safety-delta-delta/wiki/Data-Guidelines):

```javascript
safetyDeltaDelta().init(data);
```

Alternatively, the chart can be configured for a different data standard, such as for [ADaM](https://www.cdisc.org/standards/foundational/adam) in the example below:

```javascript
const element = 'body'; // element in which to draw the chart
const settings = {
measure_col: 'PARAM',
value_col: 'AVAL',
id_col: 'USUBJID',
normal_col_low: 'ANRLO',
normal_col_high: 'ANRHI',
filters: [
{value_col: 'SEX' , label: 'Sex'},
{value_col: 'RACE' , label: 'Race'},
{value_col: 'ARM' , label: 'Arm'},
{value_col: 'AVISIT' , label: 'Visit'},
{value_col: 'SITE' , label: 'Site'},
],
}; // custom chart settings

d3.csv(
'https://raw.githubusercontent.com/RhoInc/data-library/master/data/clinical-trials/adam/advs.csv', // data file location
function(data) {
safetyDeltaDelta(element, settings).init(data);
}
);
```

Click [here](https://rhoinc.github.io/safety-delta-delta/test-page/) to open an interactive example.

## Links
- [Interactive Example](https://rhoinc.github.io/safety-delta-delta/test-page/)
- [Wiki](https://github.com/RhoInc/safety-delta-delta/wiki)
- [API](https://github.com/RhoInc/safety-delta-delta/wiki/API)
- [Configuration](https://github.com/RhoInc/safety-delta-delta/wiki/Configuration)
- [Data Guidelines](https://github.com/RhoInc/safety-delta-delta/wiki/Data-Guidelines)
- [Technical Documentation](https://github.com/RhoInc/safety-delta-delta/wiki/Technical-Documentation)
139 changes: 133 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "safety-delta-delta",
"description": "Chart for exploring changes over time across multiple measures in clinical trial safety data",
"version": "0.2.0",
"version": "1.0.0",
"author": "Rho, Inc.",
"license": "MIT",
"homepage": "https://github.com/rhoinc/safety-delta-delta#readme",
Expand Down Expand Up @@ -43,9 +43,11 @@
"babel-preset-env": "^1.7.0",
"babel-register": "^6.26.0",
"prettier": "^1.18.2",
"rollup": "^0.66.6",
"rollup": "^1.26.0",
"rollup-plugin-babel": "^3.0.7",
"rollup-plugin-json": "^4.0.0"
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0"
},
"repository": {
"type": "git",
Expand Down
9 changes: 7 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import json from 'rollup-plugin-json';
import babel from 'rollup-plugin-babel';
import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';

var pkg = require('./package.json');

Expand All @@ -22,9 +24,10 @@ module.exports = {
},
},
external: (function() {
var dependencies = pkg.dependencies;
var dependencies = Object.keys(pkg.dependencies)
.filter(dependency => dependency !== 'regression');

return Object.keys(dependencies);
return dependencies;
}()),
plugins: [
json({
Expand All @@ -40,6 +43,8 @@ module.exports = {
],
babelrc: false
}),
nodeResolve(),
commonjs(),
]
};

Loading