Packageorg.axiis.data
Classpublic class DataSet
InheritanceDataSet Inheritance flash.events.EventDispatcher

DataSet is a data utility class that can be used for pre-proccesing of external data into usable Flex collections that are easy to process within Axiis Layouts. Axiis DOES NOT require you use this class for its visualizations and layouts. Axiis Layouts are designed to work with Objects, Arrays, ArrayCollections, and XMLListCollections. But, when using hierarchal layouts the Axiis framework does expect parent child relationships are supported through parent-child object relationships. DataSet provides functionality to group, aggregate, pivot, and shape data. It will support grouping on common fields with operations like sum, count, avg. It will turn flat table (.csv/array) data into object level data.



Public Properties
 PropertyDefined By
  columnCount : int
[read-only] The number of columns (attributes) in each Object in the data object.
DataSet
  data : Object
[read-only] The object produced during the most recent call to either processXmlString, processCsvAsTable, pivotTable, or aggregateData.
DataSet
  nullValues : String = NA, null
A comma-delimited string of values that DataSet should convert to nulls as it encounters them while processing a CSV.
DataSet
  rowCount : int
[read-only] The number of rows (Objects) in the data object.
DataSet
Public Methods
 MethodDefined By
  
DataSet
  
aggregateData(data:Object, collectionName:String, properties:Array):void
Perform simple aggregations against the "data" property by dynamically adding properties to the parent object.
DataSet
  
aggregateTable(name:String, groupings:Array, summaryCols:Array = null):void
Groups table data into a hierarchal collection of
DataSet
  
pivotTable(pivotColumn:int):void
Pivots a table, converting rows to columns and columns to rows.
DataSet
  
processCsvAsTable(payload:String, addSummaryFields:Boolean = false):void
Converts a CSV Payload into a table structure The structure has the following format: data.rows[] row.index = ordinal position row.columns[] = array of columns column.index = ordinal position column.name = header name for column - column.value = value
DataSet
  
processTsvAsTable(payload:String, addSummaryFields:Boolean = false):void
Converts a TSV Payload into a table structure The structure has the following format: data.rows[] row.index = ordinal position row.columns[] = array of columns column.index = ordinal position column.name = header name for column - column.value = value
DataSet
  
processXmlString(payload:String):void
Converts XML into ActionScript objects.
DataSet
Public Constants
 ConstantDefined By
  AGGREGATE_AVG : int = 2
[static]
DataSet
  AGGREGATE_SUM : int = 0
[static]
DataSet
Property Detail
columnCountproperty
columnCount:int  [read-only]

The number of columns (attributes) in each Object in the data object.


Implementation
    public function get columnCount():int
dataproperty 
data:Object  [read-only]

The object produced during the most recent call to either processXmlString, processCsvAsTable, pivotTable, or aggregateData.

This property can be used as the source for data binding.


Implementation
    public function get data():Object
nullValuesproperty 
public var nullValues:String = NA, null

A comma-delimited string of values that DataSet should convert to nulls as it encounters them while processing a CSV.

rowCountproperty 
rowCount:int  [read-only]

The number of rows (Objects) in the data object.


Implementation
    public function get rowCount():int
Constructor Detail
DataSet()Constructor
public function DataSet()

Method Detail
aggregateData()method
public function aggregateData(data:Object, collectionName:String, properties:Array):void

Perform simple aggregations against the "data" property by dynamically adding properties to the parent object. Collections are traversed hierarchally (if you target a nested collection) and aggregations roll up the hierarchy. Aggregations are added as a dynamic object to the owner of the collection.

		 
		 ownerObject.aggregates.propertyName_sum;
		 ownerObject.aggregates.propertyName_min;
		 ownerObject.aggregates.propertyName_max;
		 ownerObject.aggregates.propertyName_avg;
		 
		 

If data is a shapedDataSet (created from flattened hierachal CSV data) or TableData with columns, aggregation will occur for each column under the aggregates object aggregates.columns where columns is an ArrayCollection of obj.min, obj.max, obj.sum, obj.avg

Parameters

data:Object — The name of the collection within the "data" property. You can use "." notation to drill down to it
 
collectionName:String — An array of collection item properties you want to aggregate. You can use "." notation to drill down to specific objects within a collection item. DEVELOPER NOTE: aggregateData will most likely be deprecated in a future release in favor of a more universal grouping and aggregation format.
 
properties:Array

aggregateTable()method 
public function aggregateTable(name:String, groupings:Array, summaryCols:Array = null):void

Groups table data into a hierarchal collection of

Parameters

name:String — This function assumes you have already created a table structure within the DataSet, which currently can only be generated via the processCsvAsTable() function;
 
groupings:Array — property SUM is currently the only aggregation supported and is stored in the
 
summaryCols:Array (default = null) — property.

pivotTable()method 
public function pivotTable(pivotColumn:int):void

Pivots a table, converting rows to columns and columns to rows. Converted Column are given the new field "RowName" indicating their header.

Parameters

pivotColumn:int — The column to pivot

processCsvAsTable()method 
public function processCsvAsTable(payload:String, addSummaryFields:Boolean = false):void

Converts a CSV Payload into a table structure

The structure has the following format:

Parameters

payload:String — The CSV formatted text to convert.
 
addSummaryFields:Boolean (default = false) — When true, this method will dynamically add min and max values to each row for each column.

processTsvAsTable()method 
public function processTsvAsTable(payload:String, addSummaryFields:Boolean = false):void

Converts a TSV Payload into a table structure

The structure has the following format:

Parameters

payload:String — The TSV formatted text to convert.
 
addSummaryFields:Boolean (default = false) — When true, this method will dynamically add min and max values to each row for each column.

processXmlString()method 
public function processXmlString(payload:String):void

Converts XML into ActionScript objects. Each element becomes and object and each attribute becomes a property.

Parameters

payload:String — The XML string to be converted.

Constant Detail
AGGREGATE_AVGConstant
public static const AGGREGATE_AVG:int = 2

AGGREGATE_SUMConstant 
public static const AGGREGATE_SUM:int = 0