Skip to content
Spencer Childress edited this page Sep 18, 2024 · 21 revisions

rbmViz

library namespace

Scatter Plot

  • function: rbmViz.default.scatterPlot

Parameters

  1. {(Node|string)} _element_ - DOM element or ID in which to render chart
  2. {Array} _results_ - analysis results data with one object per group ID
  3. {Object} _config_ - chart configuration and metadata
  4. {Array} _bounds_ - optional auxiliary data of predicted analysis output
  5. {Array} _groupMetadata_ - optional group metadata

Configuration

Configuration of the scatter plot is generally data-driven by the metric metadata. The workflow metadata object is also the configuration object for the chart. Customize the chart by modifying the configuration object.

  • x
    • the name of the variable to be plotted on the x-axis
    • default: 'denominator'
  • xType
    • the type of the variable to be plotted on the x-axis
    • default: 'logarithmic'
  • xLabel
    • a short description of the x-axis variable
    • default: config[ config.x ]
  • y
    • the name of the variable to be plotted on the y-axis
    • default: 'numerator'
  • yType
    • the type of the variable to be plotted on the y-axis
    • default: 'linear'
  • yLabel
    • a short description of the y-axis variable
    • default: config[ config.y ]
  • color
    • the name of the variable by which to color the points
    • default: 'flag'
  • selectedGroupIDs
    • an array of group IDs that will be highlighted in the chart
    • default: []
  • 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) => {}
  • maintainAspectRatio
    • a boolean that controls whether the chart fits its parent (true) or maintains its aspect ratio (false)
    • default: false

Bar Chart

  • function: rbmViz.default.barChart

Parameters

  1. {(Node|string)} _element_ - DOM element or ID in which to render chart
  2. {Array} _results_ - analysis results data with one object per group ID
  3. {Object} _config_ - chart configuration and metadata
  4. {Array} _thresholds_ - optional threshold annotation values
  5. {Array} _groupMetadata_ - optional group metadata

Configuration

Configuration of the bar chart 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.

  • x
    • the name of the variable to be plotted on the x-axis
    • default: 'groupid'
  • xType
    • the type of the variable to be plotted on the x-axis
    • default: 'logarithmic'
  • xLabel
    • a short description of the x-axis variable
    • default: config[ 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: config[ config.y ]
  • yType
    • the type of the variable to be plotted on the y-axis
    • default: 'linear'
  • color
    • the name of the variable by which to color the bars
    • default: 'flag'
  • colorLabel
    • a short description of the color variable
    • default: ''
  • 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: []
  • thresholds
    • an array of thresholds (applies only when y-variable is metric score)
    • default: [ { threshold: -7, flag: -2 }, { threshold: -5, flag: -1 }, { threshold: 5, flag: 1 }, { threshold: 7, flag: 2 }, ];
  • maintainAspectRatio
    • a boolean that controls whether the chart fits its parent (true) or maintains its aspect ratio (false)
    • default: false

Sparkline

  • function: rbmViz.default.sparkline

Parameters

  1. {(Node|string)} _element_ canvas node or a unique HTML id
  2. {Array} _results_ results for a single metric; see metric results data specification
  3. {Object} _config_ Metric metadata and chart configuration; see metric metadata specification
  4. {Array} _thresholds_ Metric threshold parameters; see metric parameters data specification

Configuration

Configuration of the sparkline is generally data-driven by meta_workflow. The workflow metadata object is also the configuration object for all sparklines except for that of flag counts by group. Customize the chart by modifying the configuration object.

  • 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: 'flag'
  • nSnapshots
    • the number of dates to plot
    • default: 5

Time Series

  • function: rbmViz.default.timeSeries

Parameters

  1. {(Node|string)} _element_ canvas node or a unique HTML id
  2. {Array} _results_ results for a single metric; see metric results data specification
  3. {Object} _config_ Metric metadata and chart configuration; see metric metadata specification
  4. {Array} _thresholds_ Metric threshold parameters; see metric parameters data specification
  5. {Array} _intervals_ additional metric analysis output; see additional metric analysis output data specification
  6. {Array} _groupMetadata_ - optional group metadata

Configuration

Configuration of the time series 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:

  • 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: config[ config.y ]
  • selectedGroupIDs
    • an array of group IDs that will be highlighted in the chart
    • default: []
  • maintainAspectRatio
    • a boolean that controls whether the chart fits its parent (true) or maintains its aspect ratio (false)
    • default: false
  • 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: config[ config.x ]
  • thresholds
    • an array of thresholds (applies only when y-variable is metric score)
    • default: [ { threshold: -7, flag: -2 }, { threshold: -5, flag: -1 }, { threshold: 5, flag: 1 }, { threshold: 7, flag: 2 }, ];
  • aggregateLabel
    • the legend label, either study or selected country
    • default: 'Study'

Group Overview

  • function: rbmViz.default.groupOverview

Parameters

  1. {(Node|string)} _element_ - DOM element or ID in which to render chart
  2. {Array} _results_ - analysis results data with one object per group ID per metric ID
  3. {Object} _config_ - table configuration and metadata
  4. {Array} _groupMetadata_ - optional group metadata
  5. {Array} _metricMetadata_ - optional metric metadata

Configuration

  • GroupLevel
    • the level of the group to be displayed, either 'Site' or 'Country'
    • default: 'Site'
  • groupLabelKey
    • the key in the group metadata object that contains the group label
    • default: null
  • `groupParticipantCountKey
    • the key in the group metadata object that contains the participant count
    • default: 'ParticipantCount'
  • groupClickCallback
    • a callback function that runs whenever a click event occurs in the group column; returned value is structured as { GroupLevel, GroupID, data }, where data contains group metadata
    • default: (datum) => {}
  • metricClickCallback
    • a callback function that runs whenever a click event occurs in a metric column; returned value is structured as { GroupLevel, GroupID, MetricID, data }, where data contains metric results
    • default: (datum) => {}

Clone this wiki locally