Show:

ia.Associate Class

Extends ia.BaseData
Module: ia

Contains information about an associate.

Constructor

ia.Associate

(
  • geography
  • indicator
  • data
)

Parameters:

  • geography ia.Geography

    The geography the associate belongs to.

  • indicator ia.Indicator

    The indicator the associate belongs to.

  • data JSON

    The json data describing the object.

Methods

getChildren

() Object

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

Returns:

Object: An array of data objects.

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

(
  • featureIds
)
Associative Array

Returns a hashtable of the 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}

Parameters:

  • featureIds String

    An optional list of feature ids to get data for.

Returns:

Associative Array: As described above.

getData

(
  • featureIds
)
Associative Array

Returns a hashtable of the 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.

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.

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 return a comparison value if the id starts with "#".

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.

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.

getValue

(
  • id
)
Number | String

Returns the value that corresponds to the feature id. Will return a comparison value if the id starts with "#".

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.

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.

indicator

ia.Indicator

The parent indicator.

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.

type

Number

The data type. Inherited from parent if undefined.

Default: "categoric"