AttributesΒΆ

SDCat.App.sdcat

(SDCat) - This is the SDCat object which will be used to query the API. It will be created automatically using the parameters specified in the SDCat.App constructor.

SDCat.App.now

(Date) - A Javascript Date object containing the current time and date when the object was created.

SDCat.App.preselectedDateRanges

(Object) - Object containing the preselected date ranges for use in the Date Range dropdown box. A number of preselected date ranges have already been specified:

  • Current Day
  • Current Month
  • Current Year
  • Last 7 Days
  • Previous Day
  • Previous Month
  • Previous Year

To add additional date ranges, add another object to this object where the attribute name is the name of the text that will appear in the dropdown box. The new object must have the following attributes:

start

(Date) - Start date of the date range in UTC.

end

(Date) - End date of the date range in UTC.

Example:

app.preSelectedDateRanges["Last Month"] = {
   start: new Date(Date.UTC(app.now.getUTCFullYear(), app.now.getUTCMonth() - 1, 1,  0,  0,  0)),
   end:   new Date(Date.UTC(app.now.getUTCFullYear(), app.now.getUTCMonth(),     0, 23, 59, 59))
};

This will add a new date range called “Last Month” to the list of date ranges.

SDCat.App.items

(Object) - This stores all of the various data components required for the app. The content of the various controls on the app are populated from this object. Each “component” is an object with the following attributes:

sort

(Boolean) - Determines whether or not to sort these items into alphabetical order when displayed on the page.

clearable

(Boolean) - Determines whether or not to clear the selected items when the “Clear Selection” button is pressed.

list

(Object) - List of items that will populate the appropriate control. Each attribute of this object will be another object containing component specific information. The name of the attribute is the text that will appear in the control on the app. See below for the component specific information.

filterFunction

(Function) - User specified function to return a filtered list of the items. This should return an array of required item names.

changeButtonState

(Boolean) - Determines whether selected elements of this item can change the state of the Generate Plot button. If it is not defined, it is assumed to be false.

coverageAttributes

(Object) - Contains the information required to match up the items in the components list with the coverage objects that will be returned. In this object source is the attribute in the list object and coverage is the attribute in the coverage object.

help

(Array) - Array of bullet points to show in the help tooltip when the cursor hovers over the control’s help button.

filtersRadars

(Boolean) - Determines whether these items can filter the radars. You should not need to change the value of this attribute.

default

(String or Array) - List of items that are to be automatically preselected when the sidemenu is created. If this attribute is a String, it will be converted to an Array. For all items, by default this attribute is undefined.

The next sections contained detailed information about the components which can be found in the items object:

SDCat.App.items.radars

Contains information about the radars. The list object contains objects with the following attributes:

selected

(Boolean) - Determines if this radar has been selected by the user. (Default: false)

latitude

(Number) - The latitude of this radar in WGS84.

longitude

(Number) - The longitude of this radar in WGS84.

name

(String) - The name of the radar.

institute

(String) - The name of the institute that maintains the radar.

country

(String) - The name of the country the radar is located in.

code

(String) - The radar’s three letter identification code.

show

(Boolean) - Determines whether or not to show the radar on the app.

Radars can be referenced from the list attribute by using their three-letter ID code. At initialisation, show, clearable and changeButtonState are set to true and the default filterFunction returns all the radars found in the API. coverageAttributes uses code as the source attribute and radar_code as the coverage attribute.

An example of manipulating this object is as follows:

// Set the name of the hal radar to Halley VI
app.items.radars.list.hal.name = "Halley VI";

// Preselect this radar
app.items.radars.list.hal.selected = true;

This renames the hal radar and then programatically selects it.

SDCat.App.items.fileTypes

Contains information about the file types. The list object contains objects with the following attributes:

selected

(Boolean) - Determines if this file type has been selected by the user. (Default: false)

name

(String) - The name of this file type.

show

(Boolean) - Determines whether or not to show the file type on the app.

File types can be referenced from the list attribute by using their name. At initialisation, show, clearable and changeButtonState are set to true and the default filterFunction returns all the file types found in the API. coverageAttributes uses name as the source attribute and file_type as the coverage attribute.

An example of manipulating this object is as follows:

// Create an array of the different file types and sort them
var fileTypes = Object.keys(app.items.fileTypes.list).sort()

This sets a variable containing an array of the different fileTypes, sorted into alphabetical order.

SDCat.App.items.dateTypes

Contains information about the different date types. The different date types currently available are dates based on the file name (File) or dates based on the data within the file (Data). As a result, this object has been hardcoded, though you can override the information if you require. The definition of this object is as follows:

dateTypes: {
   sort: false,
   clearable: false,
   list: {
      file: { selected: true,  value: "File", show: true },
      data: { selected: false, value: "Data", show: true }
   },
   changeButtonState: true,
   coverageAttributes: { source: "value", coverage: "coverage_type" },
   help: [
      "Select the date type you are interested in",
      "File dates are dates inferred from the file names",
      "Data dates are dates calculated from the data within a file",
      "Only one date type can be selected"
   ]
SDCat.App.items.institutes

Contains information about the institutes. The list object contains objects with the following attributes:

selected

(Boolean) - Determines if this institute has been selected by the user. (Default: false)

Institutes can be referenced from the list attribute by using their name. At initialisation, show and filtersRadars are set to true and clearable is set to false.

SDCat.App.items.countries

Contains information about the countries. The list object contains objects with the following attributes:

selected

(Boolean) - Determines if this country has been selected by the user. (Default: false)

Countries can be referenced from the list attribute by using their name. At initialisation, show and filtersRadars are set to true and clearable is set to false.

Note

The countries list only contains the countries that contain radars. The countries of institutes are not included

SDCat.App.items.dateRanges

Contains information about the date ranges. The list object contains the preSelectedDateRanges and can be referenced by using their name. At initialisation, show and clearable are set to false.

SDCat.App.items.radarNameOptions

Contains information about the radar name options. The information in this item is used to create a control which will allow the user to display the radars by either their identification code or their name. As a result, this object has been hardcoded, though you can override the information if you require. The definition of this object is as follows:

radarNameOptions: {
   sort: false,
   clearable: false,
   list: {
      code: { selected: true,  value: "Radar Code", show: true },
      name: { selected: false, value: "Radar Name", show: true }
   },
   help: [
      "Use these options to switch between displaying radars as their 3 letter code or by their actual name"
   ]
};
SDCat.App.sidemenuButtons

(Array) - This consists of a list of single action buttons that will appear in the sidemenu. Each element of this array is in another array and it is that inner array that contains the button information. The outer arrays are there to allow the buttons to be grouped together with gaps placed between the groups.

The buttons that are created via this array are the Select All, Clear Selection, Show/Hide Help, Reset View and Generate Plot buttons. By default, Select All, Clear Selection, Show/Hide Help and Reset View are in one group and Generate Plot is in another group, though you can rearrange this or add new buttons if required. The button objects contain the following attributes:

id

(String) - The ID for the HTML element of this button.

title

(String) - The text that will appear on this button.

action

(String) - Name of the SDCat.App function that will be run when this button is clicked.

show

(Boolean) - Determines whether or not to display this button on the page. The default value for this is the value of the appropriate option in the SDCat.App constructor.

enable

(Boolean) - Determines whether or not to enable this button.

help

(String) - Text that appears when help is to be displayed and the cursor hovers over the button.

SDCat.App.dateRanges

(Object) - Contains information about the date ranges of different parts of the app:

plot

(Object) - Contains the date range that the plot will cover:

start

(Date) - Start date of the plot. (Default: 00:00:00 on January 01 of the current year)

end

(Date) - End date of the plot. (Default: 23:59:59 on December 31 of the current year)

coverage

(Object) - Contains the date range over which coverage is available

start

(Date) - Earliest date of available coverage. (Default: null)

end

(Date) - Latest date of available coverage. This usually gets set to 23:59:59 on December 31 of the last year of the coverage. (Default: null)

help

(Array) - Array of bullet points to show in the help tooltip when the cursor hovers over the control’s help button.

SDCat.App.containerDiv

(JQuery DIV element) - This is the div that the app will be inserted into. The ID of this div is specified in SDCat.options.containerDivId.

SDCat.App.helpBox

(Object) - Contains information about the tooltip that appears when the cursor hovers over the help button. Contains the following attributes:

div

(JQuery DIV element) - The div of the help box itself. The ID of this element is helpbox.

show

(Boolean) - Determines whether or not to show the help box on the app. (Default: true)

SDCat.App.sidemenu

(Object) - Contains information about the app’s sidemenu. Contains the following attributes:

div

(JQuery DIV element) - The div of the sidemenu itself. The ID of this element is sidemenu.

buttons

(Object) - Collection of buttons to add to the sidemenu. These are added programatically. (Default: {})

SDCat.App.mainBody

(Object) - Contains information about the main body of the app (i.e. where the plot appears). Contains the following attributes:

div

(JQuery DIV element) - The div of the main body itself. The ID of this element is main.

Previous topic

Prerequisites

Next topic

Functions

This Page