safety-results-over-time
Version:
Chart showing population averages for lab measures, vital signs and other related measures during the course of a clinical trial.
12 lines (10 loc) • 505 B
JavaScript
import { set, format, select } from 'd3';
export default function updateParticipantCount() {
this.populationCountContainer.selectAll('*').remove();
const subpopulationCount = set(this.filtered_data.map(d => d[this.config.id_col])).values()
.length;
const percentage = format('0.1%')(subpopulationCount / this.populationCount);
this.populationCountContainer.html(
`\n${subpopulationCount} of ${this.populationCount} participants shown (${percentage})`
);
}