Home Reference Source

Function

Static Public Summary
public

balance_subconditions(balancing_type: string, name: experiment_name, length: dataset_length): []

Returns the balanced order of the subconditions given balancing type, experiment, and number of subconditions.

public

create_condition_dataset(base_data: *, condition_data: *): *

Appends condition-specific data to the dataset.

public

D3 code for setting up scatter plot chart area with distractor dataset (so two-populations per graph)

public

Plots a bisection estimation condition (e.g.

public

Plots an interference estimation condition (e.g.

public

Plots a multi interference estimation condition (e.g.

public

Plots a regular estimation condition

public

create_ring_plot(attributes: object)

D3 code for plotting a ring plot.

public

D3 code for setting up scatter plot chart area

public

create_shape_plot(attributes: object)

D3 code for setting up shape plot chart area

public

create_strip_plot(attributes: object)

D3 code for plotting a strip plot.

public

Forces the right graph to always have the greater correlation.

public

generateDistribution(correlation: *, error: *, size: *, numsd: *, mean: *, sd: *): *

public

Generates a random population, that can exclude a coordinate set if desired.

public

get_color_paths(color: *): *

public

get_data(experiment: *): *

Retrieves the data for the corresponding experiment object.

public

get_data_subset(experiment: *): *

Retrieves a smaller dataset (4 subconditions) given experiment, trial structure and condition.

public

Generates the instructions html for the given experiment.

public

get_subconditions(experiment: *): *

public

hex_to_color(color_hex: *): *

public
public

initialize_random_order(length: *): *

public

is_custom_plot(experiment: object): boolean

Checks if the experiment needs a custom plot.

public

plot_distributions(experiment: object): *

Main point of entry to determine whether there is a custom plotting code for the condition, or we use one of the standard supported graph plots.

public

plot_scatter_points(chart: object, xscale: function, yscale: function, data: array, properties: assoc. array)

D3 code for appending data to the graph depending on point shape type.

public

Routes to the correct plotting code in /d3-custom-plots depending on experiment condition.

public

randomize_position(trial: *): *

Randomizes the position of the base and adjusted coordinates being displayed on the left or right graphs, and returns the coordinates for the graphs.

public

randomize_radius_position(trial: *, base_radius: *, adjusted_radius: *): *

Static Public

public balance_subconditions(balancing_type: string, name: experiment_name, length: dataset_length): [] source

Returns the balanced order of the subconditions given balancing type, experiment, and number of subconditions.

Params:

NameTypeAttributeDescription
balancing_type string
name experiment_name

of experiment

length dataset_length

of dataset AKA number of subconditions

Return:

[]

array of indices, representing each subcondition in the dataset.

public create_condition_dataset(base_data: *, condition_data: *): * source

Appends condition-specific data to the dataset.

Params:

NameTypeAttributeDescription
base_data *

[{assoc}, {assoc}, .... ] dataset with base experiment constants

condition_data *

[{assoc}, {assoc}, .... ] condition set for that experiment

Return:

*

dataset [{assoc}, {assoc}, .... ]

public create_distractor_scatter_plot(attributes: object) source

D3 code for setting up scatter plot chart area with distractor dataset (so two-populations per graph)

Params:

NameTypeAttributeDescription
attributes object

public create_estimation_bisection_plot(experiment: object) source

Plots a bisection estimation condition (e.g. conditions with "bisection" in their name)

Params:

NameTypeAttributeDescription
experiment object

{object} attributes

public create_estimation_interference_plot(experiment: object) source

Plots an interference estimation condition (e.g. conditions with "interference" in their name but are not multi)

Params:

NameTypeAttributeDescription
experiment object

{object} attributes

public create_estimation_multi_interference_plot(experiment: object) source

Plots a multi interference estimation condition (e.g. conditions with "interference" and "multi" in their name)

Params:

NameTypeAttributeDescription
experiment object

{object} attributes

public create_estimation_plot(experiment: object) source

Plots a regular estimation condition

Params:

NameTypeAttributeDescription
experiment object

{object} attributes

public create_ring_plot(attributes: object) source

D3 code for plotting a ring plot.

Params:

NameTypeAttributeDescription
attributes object

public create_scatter_plot(attributes: object) source

D3 code for setting up scatter plot chart area

Params:

NameTypeAttributeDescription
attributes object

public create_shape_plot(attributes: object) source

D3 code for setting up shape plot chart area

Params:

NameTypeAttributeDescription
attributes object

public create_strip_plot(attributes: object) source

D3 code for plotting a strip plot.

Params:

NameTypeAttributeDescription
attributes object

public force_greater_right_position(trial: *): * source

import {force_greater_right_position} from 'VCL-Web-Framework/scripts/helpers/experiment_helpers.js'

Forces the right graph to always have the greater correlation. Used for testing purposes.

Params:

NameTypeAttributeDescription
trial *

{object} base_coordinates { {x_values: [], y_values: []} }
adjusted_coordinates { {x_values: [], y_values: []} }
base_correlation {double} adjusted_correlation {double}

Return:

*

result { {left: [coordinates], right: [coordinates]} }

public generateDistribution(correlation: *, error: *, size: *, numsd: *, mean: *, sd: *): * source

Params:

NameTypeAttributeDescription
correlation *
error *
size *
numsd *
mean *
sd *

Return:

*

public generateRandomDistribution(row: *): * source

Generates a random population, that can exclude a coordinate set if desired.

Params:

NameTypeAttributeDescription
row *

{int} The number of possible unique x coordinates the points can land on col {int} Same as above but for y coordinates num_points {int} The number of target points to be plotted excluding_coordinates {array of coordinates to exclude} Set this to null if do not want to exclude anything

Return:

*

coordinates [ [x1, y1], [x2, y2] ... ]

public get_color_paths(color: *): * source

Params:

NameTypeAttributeDescription
color *

Return:

*

public get_data(experiment: *): * source

Retrieves the data for the corresponding experiment object.

Params:

NameTypeAttributeDescription
experiment *

{object} Model object of the experiment

Return:

*

dataset [{assoc}, {assoc}, .... ]

public get_data_subset(experiment: *): * source

Retrieves a smaller dataset (4 subconditions) given experiment, trial structure and condition.

Params:

NameTypeAttributeDescription
experiment *

{string} "jnd", "stevens", etc.
trial_structure {string} "foundational", "design", etc.
condition {string} Name of condition

Return:

*

dataset [{assoc}, {assoc}, .... ]

public get_instructions(experiment: object): string source

Generates the instructions html for the given experiment.

Params:

NameTypeAttributeDescription
experiment object

Return:

string

html for the instructions jsPsych block

public get_subconditions(experiment: *): * source

Params:

NameTypeAttributeDescription
experiment *

Return:

*

public hex_to_color(color_hex: *): * source

Params:

NameTypeAttributeDescription
color_hex *

Return:

*

public initialize_latin_square(size: *): * source

Params:

NameTypeAttributeDescription
size *

Return:

*

public initialize_random_order(length: *): * source

Params:

NameTypeAttributeDescription
length *

Return:

*

public is_custom_plot(experiment: object): boolean source

Checks if the experiment needs a custom plot.

Params:

NameTypeAttributeDescription
experiment object

Return:

boolean

public plot_distributions(experiment: object): * source

Main point of entry to determine whether there is a custom plotting code for the condition, or we use one of the standard supported graph plots.

Params:

NameTypeAttributeDescription
experiment object

Return:

*

public plot_scatter_points(chart: object, xscale: function, yscale: function, data: array, properties: assoc. array) source

D3 code for appending data to the graph depending on point shape type.

Params:

NameTypeAttributeDescription
chart object
xscale function
yscale function
data array

([x_value, y_value])

properties assoc. array

e.g. {"point_shape": "square", "point_size": 5 .... }

public prepare_custom_plot(experiment: object): boolean source

Routes to the correct plotting code in /d3-custom-plots depending on experiment condition.

Params:

NameTypeAttributeDescription
experiment object

Return:

boolean

public randomize_position(trial: *): * source

Randomizes the position of the base and adjusted coordinates being displayed on the left or right graphs, and returns the coordinates for the graphs.

Params:

NameTypeAttributeDescription
trial *

{object} base_coordinates { {x_values: [], y_values: []} }
adjusted_coordinates { {x_values: [], y_values: []} }
constants {object} adjusted_value {double}

Return:

*

result { {left: [coordinates], right: [coordinates]} }

public randomize_radius_position(trial: *, base_radius: *, adjusted_radius: *): * source

import {randomize_radius_position} from 'VCL-Web-Framework/scripts/helpers/experiment_helpers.js'

Params:

NameTypeAttributeDescription
trial *
base_radius *
adjusted_radius *

Return:

*