Show:

ia.Indicator Class

Extends ia.BaseData
Module: ia

Contains information about an indicator.

Constructor

ia.Indicator

(
  • geography
  • theme
  • data
)

Parameters:

  • geography ia.Geography

    The geography the indicator belongs to.

  • theme ia.Theme

    The theme the indicator belongs to.

  • data JSON

    The json data describing the object.

Methods

getAssociate

(
  • associateName
)
ia.Associate

Returns the associate that corresponds to the name.

Parameters:

  • associateName String

    The associate name.

Returns:

ia.Associate: An associate.

getAssociates

() ia.Associate[]

Returns the associates contained in the indicator.

Returns:

ia.Associate[]: An array of associates.

getChildren

() Object

Returns an array of data objects that are children of this object.

Returns:

Object: An array of data objects.

getComparisonData

() Associative Array

Returns a hashtable of the indicator plus associate comparison data.

The returned data has the following structure:

["eh11"]{id:"eh11", name:"polwarth", value:2345, value_formatted:2345, associate1:25, associate1_formatted:25}
["eh12"]{id:"eh12", name:"morningside", value:4347, value_formatted:4347, associate1:45, associate1_formatted:45}
["eh13"]{id:"eh13", name:"merchiston", value:2496, value_formatted:2496, associate1:25, associate1_formatted:25}

Returns:

Associative Array: As described above.

getComparisonValue

(
  • id
)
Number | String

Returns the comparison value that corresponds to the feature id.

Parameters:

  • id String

    The feature id.

Returns:

Number | String: The value for the given id.

getComparisonValues

() Number | String

Returns the list of comparison values.

Returns:

Number | String: An array of values.

getData

(
  • associateNames
  • featureIds
)
Object

Gets the indicators associate comparison data.

Parameters:

  • associateNames String

    An optional list of associate ids.

  • featureIds String

    An optional list of feature ids to get data for.

Returns:

Object: An array of data objects.

getData

(
  • associateNames
  • featureIds
)
Object

Gets the indicators associate data.

Parameters:

  • associateNames String

    An optional list of associate ids.

  • featureIds String

    An optional list of feature ids to get data for.

Returns:

Object: An array of data objects.

getData

(
  • featureIds
)
Associative Array

Returns a hashtable of the indicator plus associate data.

The returned data has the following structure:

["eh11"]{id:"eh11", name:"polwarth", value:2345, value_formatted:2345, associate1:25, associate1_formatted:25}
["eh12"]{id:"eh12", name:"morningside", value:4347, value_formatted:4347, associate1:45, associate1_formatted:45}
["eh13"]{id:"eh13", name:"merchiston", value:2496, value_formatted:2496, associate1:25, associate1_formatted:25}

Parameters:

  • featureIds String

    An optional list of feature ids to get data for.

Returns:

Associative Array: As described above.

getDataPrecision

(
  • dataField
)
Number

Gets the data precision for the passed data field.

Parameters:

  • dataField String

    The data field as a String eg "value"; "associate1"; "name" etc.

Returns:

Number: The data precision or undefined.

getDataTree

(
  • showDates
  • reverseDates
  • dataHash
  • parentId
)

Returns an associative array of the form:

["i1"]{id:"i1"; label:"Home"; type:"branch"; children:["i2"; "i3"; "i4"]}
["i2"]{id:"i2"; label:"ia.Indicator 1"; type:"branch"; parent:"i1"; children:["i5"; "i6"; "i7"]}
["i5"]{id:"i5~2004"; label:"2004"; type:"leaf"; parent:"i2"}

Used by data explorers. Dates are returned as part of the tree.

Parameters:

  • showDates Boolean

    Should the dates be displayed.

  • reverseDates Boolean

    Should the dates be reversed.

  • dataHash Associative Array

    An associative array as described.

  • parentId String

    The parent id.

getDataType

(
  • dataField
)
String

Gets the data type for the passed data field.

Parameters:

  • dataField String

    The data field as a String eg "value"; "associate1"; "name" etc.

Returns:

String: The data type or undefined.

getFormattedComparisonValue

(
  • id
)
String

Returns the formatted comparison value that corresponds to the feature id.

Parameters:

  • id String

    The feature id.

Returns:

String: The formatted value for the given id.

getFormattedComparisonValues

() String

Returns the list of formatted comparison values.

Returns:

String: An array of formatted values.

getFormattedValue

(
  • id
)
String

Returns the formatted value that corresponds to the feature id. Will also return a comparison value.

Parameters:

  • id String

    The feature id.

Returns:

String: The formatted value for the given id.

getFormattedValues

() String

Returns the list of formatted values.

Returns:

String: An array of formatted values.

getLowerLimits

() ia.Limits

Returns the lower limits

Returns:

ia.Limits: A Limits object.

getProperties

() Associative Array

Returns the custom properties. An associative array of the form: [propName] = propValue.

Returns:

Associative Array: The properties.

getProperty

(
  • propName
)
Number | String

Returns a value for a custom property.

Parameters:

  • propName String

    The name of the property.

Returns:

Number | String: The value of the property, or undefined if it doesnt exist.

getUpperLimits

() ia.Limits

Returns the upper limits

Returns:

ia.Limits: A Limits object.

getValue

(
  • id
)
Number | String

Returns the value that corresponds to the feature id. Will also return a comparison value.

Parameters:

  • id String

    The feature id.

Returns:

Number | String: The value for the given id.

getValues

() Number | String

Returns the list of values.

Returns:

Number | String: An array of values.

parseData

(
  • data
)

Parses the JSON data.

Parameters:

  • data JSON

    The json data describing the object.

Properties

customColumns

Object} Array of columns.

The custom columns that can be used in the data table.

data

JSON

The raw json data describing the object.

date

String

The indicator date.

fileName

String

The file name.

geography

ia.Geography

The parent geography.

hasData

Boolean

Indicates if this object contains data.

Default: true

href

String

The href.

id

String

The id.

maxValue

Number

The maximum value.

minValue

Number

The minimum value.

name

String

The name.

parent

Object

The parent object.

precision

Number

The precision. Inherited from parent if undefined.

theme

ia.Theme

The parent theme.

type

Number

The data type. Inherited from parent if undefined.

Default: "categoric"