Skip to content

Commit

Permalink
Merge pull request #137 from RhoInc/dev-v2.5.5
Browse files Browse the repository at this point in the history
Dev v2.5.5
  • Loading branch information
jwildfire authored Aug 19, 2019
2 parents 0311a14 + 3acc650 commit a5316a6
Show file tree
Hide file tree
Showing 17 changed files with 138 additions and 77 deletions.
105 changes: 50 additions & 55 deletions package-lock.json

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

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "safety-outlier-explorer",
"version": "2.5.4",
"version": "2.5.5",
"description": "Chart showing participant trajectories of lab measures, vital signs and other related measures in clinical trials.",
"module": "./src/index.js",
"main": "./safetyOutlierExplorer.js",
"author": "Rho, Inc.",
"license": "MIT",
"dependencies": {
"d3": "^3",
"webcharts": "^1.11.5"
"webcharts": "^1.11.6"
},
"scripts": {
"build": "npm audit fix && npm run bundle && npm run format && npm run build-wiki && npm run check-settings-schema",
Expand All @@ -28,8 +28,8 @@
"babel-plugin-external-helpers": "^6.22.0",
"babel-preset-env": "^1.7.0",
"babel-register": "^6.26.0",
"prettier": "^1.17.1",
"rollup": "^1.1.2",
"prettier": "^1.18.2",
"rollup": "^1.19.4",
"rollup-plugin-babel": "^3.0.7"
}
}
29 changes: 29 additions & 0 deletions safetyOutlierExplorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,12 @@
updateNormalRangeControl.call(this);
}

function initCustomEvents() {
var chart = this;
chart.participantsSelected = [];
chart.events.participantsSelected = new CustomEvent('participantsSelected');
}

function onInit() {
// 1. Count number of unique participant IDs in data prior to data cleaning.
countParticipants.call(this);
Expand All @@ -874,6 +880,9 @@

// 5. Check controls.
checkControls.call(this);

// 6. Initialize custom events
initCustomEvents.call(this);
}

function identifyControls() {
Expand Down Expand Up @@ -1587,6 +1596,11 @@
});
if (this.multiples.chart) this.multiples.chart.destroy();
delete this.selected_id;

//Trigger participantsSelected event
this.participantsSelected = [];
this.events.participantsSelected.data = this.participantsSelected;
this.wrap.node().dispatchEvent(this.events.participantsSelected);
}

function addOverlayEventListener() {
Expand Down Expand Up @@ -2009,6 +2023,11 @@
context.selected_id = context.multiples.id;
highlightSelected.call(context);
smallMultiples.call(context);

//Trigger participantsSelected event
context.participantsSelected = [context.selected_id];
context.events.participantsSelected.data = context.participantsSelected;
context.wrap.node().dispatchEvent(context.events.participantsSelected);
});
}

Expand Down Expand Up @@ -2060,6 +2079,11 @@
highlightSelected.call(_this);
reorderMarks.call(_this);
smallMultiples.call(_this);

//Trigger participantsSelected event
_this.participantsSelected = [_this.selected_id];
_this.events.participantsSelected.data = _this.participantsSelected;
_this.wrap.node().dispatchEvent(_this.events.participantsSelected);
});
}

Expand All @@ -2085,6 +2109,11 @@
highlightSelected.call(_this);
reorderMarks.call(_this);
smallMultiples.call(_this);

//Trigger participantsSelected event
_this.participantsSelected = [_this.selected_id];
_this.events.participantsSelected.data = _this.participantsSelected;
_this.wrap.node().dispatchEvent(_this.events.participantsSelected);
});
}

Expand Down
4 changes: 1 addition & 3 deletions src/callbacks/onDraw/updateParticipantCount.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export default function updateParticipantCount() {

//update the annotation
this.participantCount.container.text(
`\n${this.participantCount.n} of ${this.participantCount.N} participant(s) shown (${
this.participantCount.percentage
})`
`\n${this.participantCount.n} of ${this.participantCount.N} participant(s) shown (${this.participantCount.percentage})`
);
}
4 changes: 4 additions & 0 deletions src/callbacks/onInit.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import cleanData from './onInit/cleanData';
import addVariables from './onInit/addVariables';
import defineSets from './onInit/defineSets';
import checkControls from './onInit/checkControls';
import initCustomEvents from './onInit/initCustomEvents';

export default function onInit() {
// 1. Count number of unique participant IDs in data prior to data cleaning.
Expand All @@ -19,4 +20,7 @@ export default function onInit() {

// 5. Check controls.
checkControls.call(this);

// 6. Initialize custom events
initCustomEvents.call(this);
}
Loading

0 comments on commit a5316a6

Please sign in to comment.