FunctionsΒΆ

SDCat.App.display()

Populates and displays the app. In most cases, this is the only function you will ever need to run.

SDCat.App.displaySidemenu()

Adds the sidemenu to the app. This function will create the div and then add the required controls to the sidemenu, based on the options that were set when the App object was initialised.

SDCat.App.createSectionHeader(header, help)

Creates, populates and adds a header to a control in the app’s sidemenu.

header

(String) - The text to appear in the section header.

help

(String or Array) - The text to appear when the cursor is over the help icon.

SDCat.App.addButtonsToSidemenu()

Loops through the SDCat.App.sidemenuButtons and adds them to the sidemenu.

SDCat.App.createSelectBox(options)

Creates a select box comprised of the options in a given SDCat.App.items list.

options

(Object) - Contains the select box specific options. The attributes of this object are as follows:

header

(String) - The text of this select box’s section header. This will be passed to SDCat.App.createSectionHeader().

type

(String) - The type of items which will populate this select box.

SDCat.App.setDefaultOptions(box)

Preselects default options in a select box, based on the contents of the item’s default attribute.

box

(String) - The type of items. This will be the same as options.type in SDCat.App.createSelectBox().

SDCat.App.refreshSelectBox(box)

Refreshes the content of a select box, based on the contents of the item’s default attribute.

box

(String) - The type of items. This will be the same as options.type in SDCat.App.createSelectBox().

SDCat.App.createButtonSet(options)

Creates a JQuery buttonset comprised of the options in a given SDCat.App.items list.

options

(Object) - Contains the buttonset specific options. The attributes of this object are as follows:

header

(String) - The text of this buttonset’s section header. This will be passed to SDCat.App.createSectionHeader().

type

(String) - The type of items which will populate this buttonset.

onChange

(Function) - The function to run when the buttonset’s value has been changed.

SDCat.App.createButton(options)

Creates a JQuery button.

options

(Object) - Contains the button specific options. The attributes of this object are as follows:

title

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

SDCat.App.createDropDownBox(options)

Creates a JQuery drop down box comprised of the options in a given SDCat.App.items list.

options

(Object) - Contains the drop down box specific options. The attributes of this object are as follows:

id

(String) - The ID of this drop down box.

type

(String) - The type of items which will populate this drop down box.

headerText

(String) - A description of this drop down box. This will appear on page load as the default text that appears in the drop down box.

onChange

(Function) - The function to run when the buttonset’s value has been changed.

SDCat.App.selectItemsByAttribute(itemType, attribute, attributeValue)

Returns an array item names from a SDCat.App.items list where an attribute matches a value.

itemType

(String) - The type of items to search through.

attribute

(String) - The attribute of the item to search against.

attributeValue

(String) - The value of the attribute to search for.

Example:

// Find all BAS radars
var filteredItems = app.selectItemsByAttribute("radars", "institute", "British Antarctic Survey");

This will return an array containing the radars where the institute attribute matches British Antarctic Survey (i.e. fir and hal).

SDCat.App.selectAll()

Selects all items in the app. Note that the only items selected are those where the clearable flag is set to true.

SDCat.App.clearSelection()

Clears all selected items and resets the selection boxes. Note that the only items selected are those where the clearable flag is set to false.

SDCat.App.addHelp(element, helpText)

Adds a help tooltip to an element in the page.

element

(JQuery element) - When the cursor hovers over this element, the help tooltip will be displayed.

helpText

(String or Array) - Collection of bullet points that will appear in the tooltip which make up the help text. If a String is supplied, it will be converted to an Array. This is usually the help attribute of the app components.

SDCat.App.generatePlot()

Generates the coverage plot by creating a SDCat.CoveragePlot object and displaying it on the page.

SDCat.App.resetView()

Resets the view of the plot to the original timespan after zooming in.

Previous topic

Attributes

Next topic

SDCat.CoveragePlot

This Page