# safety-histogram

> Histogram showing distribution of lab measures, vital signs and other related measures in clinical trials.

Latest version **2.5.0** (published 2020-01-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install safety-histogram
pnpm add safety-histogram
yarn add safety-histogram
bun add safety-histogram
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.5.0 |
| Published | 2020-01-20 |
| First published | 2016-06-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 322.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Rho, Inc. |
| Maintainers | jwildfire, pburnsdata, rhographics, samussiah |
| Keywords | labs, vitals, ecg, bds, histogram, data, visualization, safety, explorer |

## Links

- npm: https://www.npmjs.com/package/safety-histogram
- Repository: https://github.com/RhoInc/safety-histogram
- Homepage: https://github.com/rhoinc/safety-histogram#readme
- Issues: https://github.com/RhoInc/safety-histogram/issues
- npm.io page: https://npm.io/package/safety-histogram

## Dependencies (3)

- [d3](https://npm.io/package/d3.md) ^3
- [jerzy](https://npm.io/package/jerzy.md) ^0.2.1
- [webcharts](https://npm.io/package/webcharts.md) ^1.11.6

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 2.5.0 (latest) — 2020-01-20
- 2.4.1 — 2019-10-22
- 2.4.0 — 2019-07-09
- 2.3.1 — 2019-06-13
- 2.3.0 — 2019-04-23
- 2.2.3 — 2019-04-22
- 2.2.2 — 2018-10-24
- 2.2.0 — 2018-04-17
- 2.1.1 — 2018-03-09
- 2.1.0 — 2018-01-23
- 2.0.1 — 2017-03-13
- 2.0.0 — 2017-02-17
- 1.2.0 — 2016-06-09

## README

# Safety Histogram
[![Safety Histogram animation](https://user-images.githubusercontent.com/5428548/55808856-e722b200-5ab2-11e9-9223-de22e2719035.gif)](https://rhoinc.github.io/safety-histogram/test-page/)

## Overview
Safety Histogram 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 histogram plotting the distribution of lab measures, vital signs, and other measures related to safety in clinical trials.
A typical chart created with safety-histogram looks like this:

![Safety Histogram image](https://user-images.githubusercontent.com/5428548/55808876-f144b080-5ab2-11e9-9354-fe7898ee91f6.PNG)

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-histogram/wiki/Configuration).

Users can view a histogram of each measure in the data, update the x-axis limits, toggle display of the normal range, and click the chart to view the raw data.
View full chart functionality [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-histogram/wiki/Data-Guidelines):

```javascript
    safetyHistogram().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) {
            safetyHistogram(element, settings).init(data);
        } // callback function in which the chart is created
    );
```

Click [here](https://rhoinc.github.io/safety-histogram/test-page/) to open an interactive example.

## Links 
- [Interactive Example](https://rhoinc.github.io/safety-histogram/test-page/)
- [Wiki](https://github.com/RhoInc/safety-histogram/wiki)
- [API](https://github.com/RhoInc/safety-histogram/wiki/API)
- [Configuration](https://github.com/RhoInc/safety-histogram/wiki/Configuration)
- [Data Guidelines](https://github.com/RhoInc/safety-histogram/wiki/Data-Guidelines)
- [Technical Documentation](https://github.com/RhoInc/safety-histogram/wiki/Technical-Documentation)

---
_Source: https://npm.io/package/safety-histogram · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
