Class Index | File Index

Classes


Namespace LABKEY.vis.GenericChartHelper

Namespace used to encapsulate functions related to creating Generic Charts (Box, Scatter, etc.). Used in the Generic Chart Wizard and when exporting Generic Charts as Scripts.
Defined in: genericChartHelper.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
<static>  
LABKEY.vis.GenericChartHelper.loadVisDependencies
Loads all of the required dependencies for a Generic Chart.
Method Summary
Method Attributes Method Name and Description
<inner>  
doValueConversion(chartConfig, aes, renderType, data)
Converts data values passed in to the appropriate type based on measure/dimension information.
<inner>  
generateAes(chartType, measures, schemaName, queryName)
Generates the aesthetic map object needed by the visualization API to render the chart.
<inner>  
generateAggregateData(data, dimensionName, measureName, aggregate, nullDisplayValue)
Backwards compatibility for function that has been moved to LABKEY.vis.getAggregateData.
<inner>  
generateBarGeom(chartOptions)
Generates the Barplot Geom used for bar charts.
<inner>  
generateBinGeom(chartOptions)
Generates the Bin Geom used to bin a set of points.
<inner>  
generateBoxplotGeom(chartOptions)
Generates the Boxplot Geom used for box plots.
<inner>  
Returns a function used to generate the hover text for box plots.
<inner>  
generateContinuousAcc(measureName)
Generates an accessor function that returns a value from a row of data for a given measure.
<inner>  
generateDiscreteAcc(measureName, measureLabel)
Generates an accessor function that returns a discrete value from a row of data for a given measure and label.
<inner>  
generateGeom(chartType, chartOptions)
Generates a Geom based on the chartType.
<inner>  
generateGroupingAcc(measureName)
Generates an accesssor function for shape and color measures.
<inner>  
Given the saved labels object we convert it to include all label types (main, x, and y).
<inner>  
Generates an accessor for boxplots that do not have an x-axis measure.
<inner>  
generatePlotConfig(renderTo, chartConfig, labels, aes, scales, geom, data)
Generate the plot config for the given chart renderType and config options.
<inner>  
generatePlotConfigs(renderTo, chartConfig, labels, aes, scales, geom, data)
Generate an array of plot configs for the given chart renderType and config options.
<inner>  
generatePointClickFn(measures, schemaName, queryName, fnString)
Generates the function to be executed when a user clicks a point.
<inner>  
generatePointGeom(chartOptions)
Generates the Point Geom used for scatter plots and box plots with all points visible.
<inner>  
Generates a function that returns the text used for point hovers.
<inner>  
generateScales(chartType, measures, savedScales, aes, measureStore, defaultFormatFn)
Generates an object containing LABKEY.vis.Scale objects used for the chart.
<inner>  
getChartType(renderType, xAxisType)
Gets the chart type (i.e.
<inner>  
getChartTypeBasedWidth(chartType, measures, measureStore, defaultWidth)
Determine a reasonable width for the chart based on the chart type and selected measures / data.
<inner>  
Generate a default label for an array of measures by concatenating each meaures label together.
<inner>  
Return the distinct set of y-axis sides for the given measures object.
<inner>  
getQueryColumns(queryConfig, successCallback, callbackScope)
Get the sorted set of column metadata for the given schema/query/view.
<static>  
LABKEY.vis.GenericChartHelper.getRenderTypes()
<inner>  
getSelectedMeasureLabel(renderType, measureName, properties)
Generate a default label for the selected measure for the given renderType.
<inner>  
getTitleFromMeasures(renderType, measures)
Generate a plot title based on the selected measures array or object.
<inner>  
removes all traces of String -> Numeric Conversion from the given chart config
<inner>  
validateAxisMeasure(chartType, chartConfigOrMeasure, measureName, aes, scales, data, dataConversionHappened)
Verifies that the axis measure is actually present and has data.
<inner>  
validateResponseHasData(measureStore, includeFilterMsg)
Check if the MeasureStore selectRows API response has data.
<inner>  
validateXAxis(chartType, chartConfig, aes, scales, data)
Deprecated - use validateAxisMeasure
<inner>  
validateYAxis(chartType, chartConfig, aes, scales, data)
Deprecated - use validateAxisMeasure
Namespace Detail
LABKEY.vis.GenericChartHelper
Field Detail
<static> LABKEY.vis.GenericChartHelper.loadVisDependencies
Loads all of the required dependencies for a Generic Chart.
Method Detail
<inner> {{processed: {}|warningMessage: *}} doValueConversion(chartConfig, aes, renderType, data)
Converts data values passed in to the appropriate type based on measure/dimension information.
Parameters:
chartConfig
Chart configuration object
aes
Aesthetic mapping functions for each measure/axis
renderType
The type of plot or chart (e.g. scatter_plot, bar_chart)
data
The response data from SelectRows
Returns:
{{processed: {}|warningMessage: *}}

<inner> {Object} generateAes(chartType, measures, schemaName, queryName)
Generates the aesthetic map object needed by the visualization API to render the chart. See LABKEY.vis.Plot and LABKEY.vis.Layer.
Parameters:
{String} chartType
The chartType from getChartType.
{Object} measures
The measures from getMeasures.
{String} schemaName
The schemaName from the saved queryConfig.
{String} queryName
The queryName from the saved queryConfig.
Returns:
{Object}

<inner> generateAggregateData(data, dimensionName, measureName, aggregate, nullDisplayValue)
Backwards compatibility for function that has been moved to LABKEY.vis.getAggregateData.
Parameters:
data
dimensionName
measureName
aggregate
nullDisplayValue

<inner> {LABKEY.vis.Geom.BarPlot} generateBarGeom(chartOptions)
Generates the Barplot Geom used for bar charts.
Parameters:
{Object} chartOptions
The saved chartOptions object from the chart config.
Returns:
{LABKEY.vis.Geom.BarPlot}

<inner> {LABKEY.vis.Geom.Bin} generateBinGeom(chartOptions)
Generates the Bin Geom used to bin a set of points.
Parameters:
{Object} chartOptions
The saved chartOptions object from the chart config.
Returns:
{LABKEY.vis.Geom.Bin}

<inner> {LABKEY.vis.Geom.Boxplot} generateBoxplotGeom(chartOptions)
Generates the Boxplot Geom used for box plots.
Parameters:
{Object} chartOptions
The saved chartOptions object from the chart config.
Returns:
{LABKEY.vis.Geom.Boxplot}

<inner> {Function} generateBoxplotHover()
Returns a function used to generate the hover text for box plots.
Returns:
{Function}

<inner> {Function} generateContinuousAcc(measureName)
Generates an accessor function that returns a value from a row of data for a given measure.
Parameters:
{String} measureName
The name of the measure.
Returns:
{Function}

<inner> {Function} generateDiscreteAcc(measureName, measureLabel)
Generates an accessor function that returns a discrete value from a row of data for a given measure and label. Used when an axis has a discrete measure (i.e. string).
Parameters:
{String} measureName
The name of the measure.
{String} measureLabel
The label of the measure.
Returns:
{Function}

<inner> {LABKEY.vis.Geom} generateGeom(chartType, chartOptions)
Generates a Geom based on the chartType.
Parameters:
{String} chartType
The chart type from getChartType.
{Object} chartOptions
The chartOptions object from the saved chart config.
Returns:
{LABKEY.vis.Geom}

<inner> {Function} generateGroupingAcc(measureName)
Generates an accesssor function for shape and color measures.
Parameters:
{String} measureName
The name of the measure.
Returns:
{Function}

<inner> {Object} generateLabels(labels)
Given the saved labels object we convert it to include all label types (main, x, and y). Each label type defaults to empty string ('').
Parameters:
{Object} labels
The saved labels object.
Returns:
{Object}

<inner> {Function} generateMeasurelessAcc(measureName)
Generates an accessor for boxplots that do not have an x-axis measure. Generally the measureName passed in is the queryName.
Parameters:
{String} measureName
The name of the measure. In this case it is generally the query name.
Returns:
{Function}

<inner> {Object} generatePlotConfig(renderTo, chartConfig, labels, aes, scales, geom, data)
Generate the plot config for the given chart renderType and config options.
Parameters:
renderTo
chartConfig
labels
aes
scales
geom
data
Returns:
{Object}

<inner> {Array} generatePlotConfigs(renderTo, chartConfig, labels, aes, scales, geom, data)
Generate an array of plot configs for the given chart renderType and config options.
Parameters:
renderTo
chartConfig
labels
aes
scales
geom
data
Returns:
{Array} array of plot config objects

<inner> {Function} generatePointClickFn(measures, schemaName, queryName, fnString)
Generates the function to be executed when a user clicks a point.
Parameters:
{Object} measures
The measures from the saved chart config.
{String} schemaName
The schema name from the saved query config.
{String} queryName
The query name from the saved query config.
{String} fnString
The string value of the user-provided function to be executed when a point is clicked.
Returns:
{Function}

<inner> {LABKEY.vis.Geom.Point} generatePointGeom(chartOptions)
Generates the Point Geom used for scatter plots and box plots with all points visible.
Parameters:
{Object} chartOptions
The saved chartOptions object from the chart config.
Returns:
{LABKEY.vis.Geom.Point}

<inner> {Function} generatePointHover(measures)
Generates a function that returns the text used for point hovers.
Parameters:
{Object} measures
The measures object from the saved chart config.
Returns:
{Function}

<inner> {Object} generateScales(chartType, measures, savedScales, aes, measureStore, defaultFormatFn)
Generates an object containing LABKEY.vis.Scale objects used for the chart.
Parameters:
{String} chartType
The chartType from getChartType.
{Object} measures
The measures from generateMeasures.
{Object} savedScales
The scales object from the saved chart config.
{Object} aes
The aesthetic map object from genereateAes.
{Object} measureStore
The MeasureStore data using a selectRows API call.
{Function} defaultFormatFn
used to format values for tick marks.
Returns:
{Object}

<inner> {String} getChartType(renderType, xAxisType)
Gets the chart type (i.e. box or scatter).
Parameters:
{String} renderType
The selected renderType, this can be SCATTER_PLOT, BOX_PLOT, or BAR_CHART. Determined at chart creation time in the Generic Chart Wizard.
{String} xAxisType
The datatype of the x-axis, i.e. String, Boolean, Number.
Returns:
{String}

<inner> {int} getChartTypeBasedWidth(chartType, measures, measureStore, defaultWidth)
Determine a reasonable width for the chart based on the chart type and selected measures / data.
Parameters:
chartType
measures
measureStore
defaultWidth
Returns:
{int}

<inner> getDefaultMeasuresLabel(measures)
Generate a default label for an array of measures by concatenating each meaures label together.
Parameters:
measures
Returns:
string concatenation of all measure labels

<inner> getDistinctYAxisSides(measures)
Return the distinct set of y-axis sides for the given measures object.
Parameters:
measures

<inner> getQueryColumns(queryConfig, successCallback, callbackScope)
Get the sorted set of column metadata for the given schema/query/view.
Parameters:
queryConfig
successCallback
callbackScope

<static> LABKEY.vis.GenericChartHelper.getRenderTypes()

<inner> getSelectedMeasureLabel(renderType, measureName, properties)
Generate a default label for the selected measure for the given renderType.
Parameters:
renderType
measureName
- the chart type's measure name
properties
- properties for the selected column, note that this can be an array of properties

<inner> {string} getTitleFromMeasures(renderType, measures)
Generate a plot title based on the selected measures array or object.
Parameters:
renderType
measures
Returns:
{string}

<inner> {updated ChartConfig} removeNumericConversionConfig(chartConfig)
removes all traces of String -> Numeric Conversion from the given chart config
Parameters:
chartConfig
Returns:
{updated ChartConfig}

<inner> {Object} validateAxisMeasure(chartType, chartConfigOrMeasure, measureName, aes, scales, data, dataConversionHappened)
Verifies that the axis measure is actually present and has data. Also checks to make sure that data can be used in a log scale (if applicable). Returns an object with a success parameter (boolean) and a message parameter (string). If the success parameter is false there is a critical error and the chart cannot be rendered. If success is true the chart can be rendered. Message will contain an error or warning message if applicable. If message is not null and success is true, there is a warning.
Parameters:
{String} chartType
The chartType from getChartType.
{Object} chartConfigOrMeasure
The saved chartConfig object or a specific measure object.
{String} measureName
The name of the axis measure property.
{Object} aes
The aes object from generateAes.
{Object} scales
The scales object from generateScales.
{Array} data
The response data from selectRows.
{Boolean} dataConversionHappened
Whether we converted any values in the measure data
Returns:
{Object}

<inner> {String} validateResponseHasData(measureStore, includeFilterMsg)
Check if the MeasureStore selectRows API response has data. Return an error string if no data exists.
Parameters:
measureStore
includeFilterMsg
true to include a message about removing filters
Returns:
{String}

<inner> validateXAxis(chartType, chartConfig, aes, scales, data)
Deprecated - use validateAxisMeasure
Parameters:
chartType
chartConfig
aes
scales
data

<inner> validateYAxis(chartType, chartConfig, aes, scales, data)
Deprecated - use validateAxisMeasure
Parameters:
chartType
chartConfig
aes
scales
data

Documentation generated by JsDoc Toolkit 2.3.2 on Thu Jun 11 2020 17:30:57 GMT-0000 (UTC)