-
Notifications
You must be signed in to change notification settings - Fork 1
API
Spencer Childress edited this page Oct 25, 2022
·
21 revisions
library namespace
- function:
rbmViz.default.scatterPlot
-
{(Node|string)}_element_canvasnode or a unique HTMLid -
{Array}_data_results for a single KRI; see KRI results data specification -
{Object}_config_KRI metadata and chart configuration; see KRI metadata specification -
{Array}_bounds_threshold bounds for a single KRI; see KRI bounds data specification
Configuration of the scatter plot is generally data-driven by
meta_workflow. The workflow metadata object is also the
configuration object for the chart. Customize the chart by modifying the configuration object:
// Filter array of workflows to KRI0001.
const config = meta_workflow
.find(meta => meta.workflow === 'kri0001');
config.selectedGroupIDs = ['123']; // specify the selected group ID
config.hoverCallback = (datum) => {
console.table(datum);
// do something with chart element's data
};
config.clickCallback = (datum) => {
console.table(datum);
// do something with chart element's data
};
const scatterPlot = rbmViz.default.scatterPlot(
'#canvas',
results_summary.filter(d => d.workflowid === config.workflowid),
config,
results_bounds.filter(d => d.workflowid === config.workflowid)
);
-
clickCallback- a callback function that runs whenever a click event occurs on a given graphical element
- default:
(datum) => {}
-
hoverCallback- a callback function that runs whenever a mouseover event occurs on a given graphical element
- default:
(datum) => {}
-
selectedGroupIDs- an array of group IDs that will be highlighted in the chart
- default:
[]
-
maintAspectRatio- a boolean that controls whether the chart fits its parent (
true) or maintains its aspect ratio (false) - default:
false
- a boolean that controls whether the chart fits its parent (
-
x- the name of the variable to be plotted on the x-axis
- default:
'denominator'
-
xLabel- a short description of the x-axis variable
- default:
meta_workflow[ config.x ]
-
y- the name of the variable to be plotted on the y-axis
- default:
'numerator'
-
yLabel- a short description of the y-axis variable
- default:
meta_workflow[ config.y ]
-
color- the name of the variable by which to color the points
- default:
'flag'
-
colors- an array of hex values
- default:
['#52C41A', '#FADB14', '#FF4D4F']
- function:
rbmViz.default.barChart
-
{(Node|string)}_element_canvasnode or a unique HTMLid -
{Array}_data_results for a single KRI; see KRI results data specification -
{Object}_config_KRI metadata and chart configuration; see KRI metadata specification -
{Array}_thresholds_KRI threshold parameters; see KRI parameters data specification
Configuration of the scatter plot is generally data-driven by
meta_workflow. The workflow metadata object is also the
configuration object for the chart. Customize the chart by modifying the configuration object:
// Filter array of workflows to KRI0001.
const config = meta_workflow
.find(meta => meta.workflow === 'kri0001');
config.selectedGroupIDs = ['123']; // specify the selected group ID
config.hoverCallback = (datum) => {
console.table(datum);
// do something with chart element's data
};
config.clickCallback = (datum) => {
console.table(datum);
// do something with chart element's data
};
config.y = 'metric'; // plot KRI value instead of score
const barChart = rbmViz.default.barChart(
'#canvas',
results_summary.filter(d => d.workflowid === config.workflowid),
config,
meta_param.filter(d => d.workflowid === config.workflowid)
);
-
clickCallback- a callback function that runs whenever a click event occurs on a given graphical element
- default:
(datum) => {}
-
hoverCallback- a callback function that runs whenever a mouseover event occurs on a given graphical element
- default:
(datum) => {}
-
selectedGroupIDs- an array of group IDs that will be highlighted in the chart
- default:
[]
-
maintAspectRatio- a boolean that controls whether the chart fits its parent (
true) or maintains its aspect ratio (false) - default:
false
- a boolean that controls whether the chart fits its parent (
-
x- the name of the variable to be plotted on the x-axis
- default:
'groupid'
-
xLabel- a short description of the x-axis variable
- default:
meta_workflow[ config.x ]
-
y- the name of the variable to be plotted on the y-axis
- default:
'score'
-
yLabel- a short description of the y-axis variable
- default:
meta_workflow[ config.y ]
-
color- the name of the variable by which to color the bars
- default:
'flag'
-
colorLabel- a short description of the color variable
- default:
''
-
n- the name of the variable that captures the number of participants in each group
- default:
'n'
-
nLabel- a short description of the
nvariable - default:
meta_workflow[ config.n ]
- a short description of the
-
num- the variable name of the numerator in the KRI calculation
- default:
'numerator'
-
numeratorLabel- a short description of the numerator variable
- default:
meta_workflow[ config.num ]
-
denom- the variable name of the denominator in the KRI calculation
- default:
'denominator'
-
denominatorLabel- a short description of the denominator variable
- default:
meta_workflow[ config.denom ]
-
thresholds- an array of thresholds
- default: [ { threshold: -7, flag: -2 }, { threshold: -5, flag: -1 }, { threshold: 5, flag: 1 }, { threshold: 7, flag: 2 }, ];
- function:
rbmViz.default.sparkline
-
{(Node|string)}_element_canvasnode or a unique HTMLid -
{Array}_data_results for a single KRI; see KRI results data specification -
{Object}_config_KRI metadata and chart configuration; see KRI metadata specification -
{Array}_thresholds_KRI threshold parameters; see KRI parameters data specification
Configuration of the sparkline is generally data-driven by
meta_workflow. The workflow metadata object is also the
configuration object for the chart. Customize the chart by modifying the configuration object:
// Filter array of workflows to KRI0001.
const config = meta_workflow
.find(meta => meta.workflow === 'kri0001');
const sparkline = rbmViz.default.scatterPlot(
'#canvas',
results_summary.filter(d => d.workflowid === config.workflowid && d.groupid === '123'),
config,
meta_param.filter(d => d.workflowid === config.workflowid)
);
-
nSnapshots- the number of snapshots to plot
- default:
5
-
x:- the name of the variable to be plotted on the x-axis
- default:
'snapshot_date'
-
y:- the name of the variable to be plotted on the y-axis
- default:
'score'
-
color:- the name of the variable with which to color the points
- default:
'score'
- function:
rbmViz.default.timeSeries