-
Notifications
You must be signed in to change notification settings - Fork 1
Examples
Spencer Childress edited this page Sep 18, 2024
·
7 revisions
Example datasets is available in the examples/data
directory. Datasets include:
-
Analysis resultswith one record per group and metric -
Metric metadatawith one record per metric -
Group metadatawith one record per group per parameter -
Predicted boundswith one record per metric per interval
The bar chart can be generated with the following code:
const MetricID = 'kri0001';
// configuration
const config = metricMetadata.filter(
(workflow) => workflow.MetricID === MetricID
);
config.y = 'Score'; // [ 'Numerator', 'Denominator', 'Metric', 'Score']
// visualization
const barChart = rbmViz.default.barChart(
document.getElementById('container'), // an element in the DOM in which to render the visualization
results.filter((result) => result.MetricID === MetricID),
config,
config.Thresholds.split(',').map((d) => +d),
groupMetadata
);
The scatter plot can be generated with the following code:
const MetricID = 'kri0001';
// configuration
const config = metricMetadata.filter(
(workflow) => workflow.MetricID === MetricID
);
// visualization
const scatterPlot = rbmViz.default.scatterPlot(
document.getElementById('container'), // an element in the DOM in which to render the visualization
results.filter((result) => result.MetricID === MetricID),
config,
resultsPredicted.filter((result) => result.MetricID === MetricID),
groupMetadata
);
The sparkline can be generated with the following code:
const MetricID = 'kri0001';
const GroupID = '43';
// configuration
const config = metricMetadata.filter(
(workflow) => workflow.MetricID === MetricID
);
config.y = 'Score'; // [ 'Numerator', 'Denominator', 'Metric', 'Score']
// visualization
const sparkline = rbmViz.default.sparkline(
document.getElementById('container'), // an element in the DOM in which to render the visualization
results.filter((result) => result.MetricID === MetricID && result.GroupID === GroupID),
config
);
The time series can be generated with the following code:
const MetricID = 'kri0001';
// configuration
const config = metricMetadata.filter(
(metadata) => metadata.MetricID === MetricID
);
config.y = 'Score'; // or 'Metric'
// visualization
const timeSeries = rbmViz.default.timeSeries(
document.getElementById('container'), // an element in the DOM in which to render the visualization
results.filter((result) => result.MetricID === MetricID),
config,
config.Thresholds.split(',').map((d) => +d),
null,
groupMetadata
);
The group overview can be generated with the following code:
const GroupLevel = 'Site';
// configuration
const config = {
GroupLevel,
groupLabelKey: 'InvestigatorLastName'
};
// visualization
const groupOverview = rbmViz.default.groupOverview(
document.getElementById('container'), // an element in the DOM in which to render the visualization
results.filter((result) => /^kri/.test(result.MetricID),
config,
groupMetadata,
metricMetadata
);