Show:

ia.Geography Class

Extends ia.BaseData
Module: ia

Contains information about a geography.

Constructor

ia.Geography

(
  • report
  • data
)

Parameters:

  • report ia.ReportData

    The report data the the geography belongs to.

  • data JSON

    The json data describing the object.

Methods

getChildren

() Object

Inherited from ia.BaseData but overwritten in ia\data\Geography.js:182

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

Returns:

Object: An array of data objects.

getComparisonFeature

(
  • id
)
ia.Feature

Returns the comparison feature that corresponds to the id provided.

Parameters:

  • id String

    The id.

Returns:

ia.Feature: A comparison feature object.

getComparisonFeatures

() ia.Feature[]

Returns the comparison features contained in the geography.

Returns:

ia.Feature[]: An array of features.

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.

getFeature

(
  • id
)
ia.Feature

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

Parameters:

  • id String

    The id.

Returns:

ia.Feature: A feature object.

getFeatureData

(
  • featureIds
  • date
)
JSON

Returns the data for a list of feature ids - listed by feature.

Parameters:

  • featureIds String

    A list of feature ids to get data for.

  • date String

    An optional date.

Returns:

JSON: As described above.

getFeatures

() ia.Feature[]

Returns the features contained in the geography.

Returns:

ia.Feature[]: An array of features.

getFilter

(
  • id
)
ia.Filter

Returns the filter that corresponds to the id provided.

Parameters:

  • id String

    The id.

Returns:

ia.Filter: A filter object.

getFilteredFeatures

(
  • filterId
  • filterValue
)
String

Returns the features ids that are contained in the given filter.

Parameters:

  • filterId String

    The filter id.

  • filterValue String

    The filter value.

Returns:

String: A list of feature ids.

getFilters

() ia.Filter[]

Returns the filters contained in the geography.

Returns:

ia.Filter[]: An array of filters.

getFilterTree

() Object

Returns a hashtable 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 filter explorers.

Returns:

Object: A hashtable of filter objects.

getFirstIndicator

(
  • reverseDates
)
ia.Indicator

Returns the first indicator - this can be within a nested theme. Where dates are used the first indicator is the one with the most recent date

Parameters:

  • reverseDates Boolean

    Should the dates be reversed.

Returns:

ia.Indicator: The indicator.

getIndicator

(
  • id
  • date
  • reverseDates
)
ia.Indicator

Returns the indicator that corresponds to the id and date provided.

Parameters:

  • id String

    The indicator id.

  • date String

    An optional date.

  • reverseDates Boolean

    Should the dates be reversed.

Returns:

ia.Indicator: The indicator.

getIndicatorData

(
  • featureIds
  • date
)
JSON

Returns the data for a list of feature ids - listed by indicator.

Parameters:

  • featureIds String

    A list of feature ids to get data for.

  • date String

    An optional date.

Returns:

JSON: As described above.

getProfileData

(
  • featureIds
  • date
  • useLatestDate
)
JSON

Returns a hashtable of the indicators/associates for a feature - used for profiles.

The returned data has the following structure:

["t0"]{id:"t0", name:"theme0", type:"parent"}
["i0"]{id:"i0", name:"indicator0", value:2345, value_formatted:2345, associate1:25, associate1_formatted:25, type:"leaf"}
["i1"]{id:"i1", name:"indicator1", value:4347, value_formatted:4347, associate1:45, associate1_formatted:45, type:"leaf"}
["i2"]{id:"i2", name:"indicator1", value:2496, value_formatted:2496, associate1:25, associate1_formatted:25, type:"leaf"}

Parameters:

  • featureIds String

    A list of feature ids to get data for.

  • date String

    An optional date.

  • useLatestDate Boolean

    Use the latest date if the specified date is unavailable?

Returns:

JSON: As described above.

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.

getTheme

(
  • id
)
ia.Theme

Returns the theme that corresponds to the id provided.

Parameters:

  • id String

    The id.

Returns:

ia.Theme: A theme object.

getThemes

() ia.Theme[]

Returns the themes contained in the geography.

Returns:

ia.Theme[]: An array of themes.

loadData

(
  • callbackFnc
)

Loads all data in the geography.

Parameters:

  • callbackFnc Function

    The callbackFnc gets called with the loaded object as the parameter.

loadIndicator

(
  • id
  • date
  • callbackFnc
)
ia.Indicator

Loads the indicator that corresponds to the id and date provided. Returns the indicator via the supplied callback function.

Parameters:

  • id String

    The indicator id.

  • date String

    An optional date.

  • callbackFnc Function

    The callbackFnc gets called with the loaded object as the parameter.

Returns:

ia.Indicator: The indicator.

parseData

(
  • data
)

Parses the geography 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.

index

Number

The geography index - this is the order the geography appears in the data.js. It is used to find a matching base layer which appears in the same position in map.js.

name

String

The name.

parent

Object

The parent object.

precision

Number

The precision. Inherited from parent if undefined.

reportData

ia.ReportData

The parent report data.

type

Number

The data type. Inherited from parent if undefined.

Default: "categoric"