plots.js#
- static afqb.plots.buildFromNodes(error, useless, data)#
Container function which calls other plots functions once nodes.csv data has been read.
- Arguments:
error – Passed to prevent execution in case error occurs in preceding functions.
useless – Obligatory callback argument that we don’t use in the function.
data (data) – JavaScript array created by d3.csv(data/nodes.csv).
- static afqb.plots.buildTractCheckboxes(error, data)#
Builds tract selection list in “Bundles” section. Reads unique tract IDs from nodes.csv and creates selectable text for each tract.
- Arguments:
error – Passed to prevent execution in case error occurs in preceding functions.
data (data) – JavaScript array created by d3.csv(data/nodes.csv).
- static afqb.plots.line(d, id)#
Creates line object with appropriate domain and range for each tract. Called for draw and transformation operations involving subject lines or mean lines in the 2D plots.
- Arguments:
d (data) – Subject or mean data for 2D plot of selected metric
id (string) – formatted tract name
- static afqb.plots.area(d, id)#
Creates area object with appropriate domain and range for each tract. Called for draw and transformation operations involving standard deviation and standard error in 2D plots.
- Arguments:
d (data) – Mean data for 2D plot of selected metric
id (string) – formatted tract name
- static afqb.plots.buildPlotGui(error, data)#
Builds control panel GUI for metric plots. Allows user to select which metric to plot, error type (std err or std dev) for shaded area, subject line opacity, and whether or not brushing is allowed.
- Arguments:
error – Passed to prevent execution in case error occurs in preceding functions.
data (object) – JavaScript object created by d3.csv(data/nodes.csv).
- static afqb.plots.ready(error, data)#
Generates initial 2D plots. Turns nodes.csv into nested json object. This object is used to determine x/y range, plot subject lines, and calculate mean and error for the default metric.
- Arguments:
error – Passed to prevent execution in case error occurs in preceding functions.
data (data) – JavaScript array created by d3.csv(data/nodes.csv).
- static afqb.plots.changePlots(error, data)#
Updates plots on sort or metric change. If data is sorted, means are calculated for each group of subjects defined by the sort. If metric changes, axes and means are updated accordingly. Calls afqb.plots.draw() and afqb.plots.zoomAxis().
- Arguments:
error – Passed to prevent execution in case error occurs in preceding functions.
data (data) – JavaScript array created by d3.csv(data/nodes.csv).
- static afqb.plots.draw()#
Redraws subject and mean lines after new metric or group selections. Calls afqb.plots.zoomAxis().
- static afqb.plots.zoomAxis()#
Updates y axis zoom on sort or metric change.
- static afqb.plots.newBrush(name)#
Initializes brush elements for 2D plots. Brush used to highlight a portion of tract in the “Anatomy” panel.
- Arguments:
name (string) – formatted tract name.
- static afqb.plots.updateBrush()#
Updates brush elements for 2D plots. Brush used to highlight a portion of tract in the “Anatomy” panel.
- static afqb.plots.showHideTractDetails(state, name)#
Controls whether or not a plot is displayed for a given tract, and changes color of the label in the “Bundles” panel.
- Arguments:
state (boolean) – true if the tract is selected, false if it is hidden.
name (string) – formatted tract name
- static afqb.plots.initCheckboxes(error)#
Initialize the selectable tract list.
- Arguments:
error – Passed to prevent execution in case error occurs in preceding functions.