Class vq.utils.GoogleDSUtils
Provides a set of static functions for use in converting
a google.visualization.DataTable object into a Protovis consumable
JSON array.
Intended to be used as a static class object to reserve a useful namespace.
For the Circvis project, the fundamental data element is node JSON object consisting of:
{chromosome, start, end, value, options}
{string} chromosome
{integer} start
{integer} end
{string} value
{string} options
Defined in: vq.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
<static> |
vq.utils.GoogleDSUtils.dataTableToArray(googleDataTable)
Converts any DataTable object into an array of JSON objects, each object consisting of a single row in the
DataTable.
|
<static> |
vq.utils.GoogleDSUtils.dataTableToNetworkArray(googleDataTable)
Converts a special DataTable object into a network object used by CircVis.
|
Method Detail
<static>
vq.utils.GoogleDSUtils.dataTableToArray(googleDataTable)
Converts any DataTable object into an array of JSON objects, each object consisting of a single row in the
DataTable. The property label is obtained from the getColumnLabel() function of the google.visualiztion.DataTable class.
Column types listed as a 'number' are passed in as numeric data. All other data types are passed in as strings.
The returned JSON array conforms to the common input format of Protovis visualizations.
- Parameters:
- googleDataTable
- - google.visualizations.DataTable object returned by a google datasource query
- Returns:
- data_array - JSON array.
<static>
vq.utils.GoogleDSUtils.dataTableToNetworkArray(googleDataTable)
Converts a special DataTable object into a network object used by CircVis.
For a DataTable with fields: chr1, start1, end1, value1, options1, chr2, start2, end2, value2, options2, linkValue
the function returns an array of JSON objects consisting of two node JSON objects and a linkValue:
{node1,node2,linkValue}
The JSON array can then be passed into the NETWORK.DATA.data_array parameter used to configure Circvis.
- Parameters:
- googleDataTable
- - google.visualizations.DataTable object returned by a google datasource query
- Returns:
- network_json_array - a JSON array representation of a Google Visualizations DataTable object. The column label is assigned as the property label