Show:

ia.ReportData Class

Module: ia

Contains information about a report.

Constructor

ia.ReportData

()

Methods

addEventListener

(
  • eventType
  • fnc
  • obj
)

Add an event listener.

Parameters:

  • eventType String

    The type of event to listen for.

  • fnc Function

    The function to call when the event occurs.

  • obj Object

    An optional parent object.

dispatchEvent

(
  • event
)

Dispatch an event to the listeners.

Parameters:

  • event Object

    The event object.

getDataTree

(
  • showDates
  • reverseDates
)
Associative Array

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.

Returns:

Associative Array: An associative array as described.

getGeographies

() ia.Geography[]

Returns the geographies contained in the data.

Returns:

ia.Geography[]: An array of geographies.

getGeography

(
  • id
)
ia.Geography

Returns the geography that corresponds to the geography id.

Parameters:

  • id String

    The geography id.

Returns:

ia.Geography: The geography for the given id.

getGeographyTree

(
  • 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:

  • dataHash Associative Array

    An associative array as described.

  • parentId String

    The parent id.

getProperties

() Object

Gets the properties.

Returns:

Object: A hashtable of properties.

getProperty

(
  • propName
)
Object

Get a value for a custom property.

Parameters:

  • propName String

    The name of the property.

Returns:

Object: The value for that property, or null.

loadSource

(
  • url
  • callbackFunction
)

Loads and parses the source file then calls the given function.

Parameters:

  • url String

    The url to the data.

  • callbackFunction Function

    The call back function.

parseData

(
  • data
  • callbackFunction
)

Parses the geography data.

Parameters:

  • data JSON

    The json data describing the object.

  • callbackFunction Function

    The call back function.

refresh

(
  • callbackFunction
)

Refreshes the data.

Parameters:

  • callbackFunction Function

    The call back function.

removeListener

(
  • obj
)

Removes all event listeners for the given object.

Parameters:

  • obj Object

    The object.

setProperty

(
  • propName
  • propValue
)

Set a value for a custom property. Use this to set any default properties to be inherited by all data types beneath.

Parameters:

  • propName String

    The name of the property.

  • propValue Object

    The value of the property.

Properties

data

JSON

The raw json data describing the object.

getValue

ia.Formatter

The formatter

path

String

The directory path to the data source.

Default: ""

precision

Number

The precision. Inherited from parent if undefined.

url

String

The url of the data source.

Default: ""