loadCSVData

Loads all CSV Files

loadCSVData(csvAddress: String): Array<Object>
Parameters
csvAddress (String) contains the address of the csvFile
Returns
Array<Object>: The object fields are based on the headings in the csv file.

loadWeatherStation

Loads weather stations CSV Data Array into Array of Weather Stations

loadWeatherStation(csvData: DataArray): Array<GlobalDataPoint>
Parameters
csvData (DataArray) contains the weather station location and details.
Returns
Array<GlobalDataPoint>: A datastructure that maps a value to a location.

loadWeatherLayer

Loads the weather station layer

loadWeatherLayer(wwd: WorldWindow, weatherDataArray: Array<DataLayer>)
Parameters
wwd (WorldWindow) is the world window of the globe
weatherDataArray (Array<DataLayer>) is an array containing the WMS Layers that needs to be loaded

loadCountries

Loads country CSV Data Array into Array of Countries

loadCountries(countryDataArray: DataArray): Array
Parameters
countryDataArray (DataArray) DataArray that contains data of where the countries are located (centre-based).
Returns
Array: temp is an array containing all countries

loadCountryLayer

Loads the country layer

loadCountryLayer(wwd: WorldWindow, countryDataArray: DataArray): DataLayer
Parameters
wwd (WorldWindow) is the window to draw the things on.
countryDataArray (DataArray) is the data array containing where the flags need to be placed
Returns
DataLayer: an object containing the layer and other details such as configuration of the layer

loadGEOJsonData

hardcoded link: loads appropriate geoJSON data

loadGEOJsonData(geoJSONAddress: string): Object
Parameters
geoJSONAddress (string) address where the geoJSON file is at.
Returns
Object: contains details of the country borders in object format.

generateWeatherHTML

Generates the html for the weather search

generateWeatherHTML(countryDataArray: DataArray)
Parameters
countryDataArray (DataArray) of data containing the country codes to be loaded onto the HTML

giveWeatherButtonFunctionality

Provides functionality to the weather button. (Hardcoded API Key)

giveWeatherButtonFunctionality()

checkTabs

Checks if the tab should be displayed. Also adds sensors to create readjusting graphs.

checkTabs()

tabsFn

Lets the resizable tab to resizable

tabsFn

giveWMSTLayersFunctionality

Gives functionality to the WMST buttons associated with the layers the part which lets the controls to be visible and turning on the the layer on and off

giveWMSTLayersFunctionality(layerNumber: number, layer: Layer)
Parameters
layerNumber (number) shows which layer is associated
layer (Layer) The layer that will be toggled on and off

loadWMSTLayers

preloads WMST layers

loadWMSTLayers(wwd: WorldWind, layerManager: LayerManager, layerPoint: LayerPoint, layerNumber: number): WmtsLayer
Parameters
wwd (WorldWind) worldwindow
layerManager (LayerManager) layerManager from layerManager.js
layerPoint (LayerPoint) The layer itself with other details to display
layerNumber (number) the number of the layer inserted for control purposes
Returns
WmtsLayer: The WMST Layer that has just been loaded

generateLayerControl

This function generates the HTML first then supplies functionality Given a layerName and its layernumber, generate a layer control block

generateLayerControl(wwd: WorldWindow, wmsConfig: Object, wmsLayerCapabilities: WmsLayerCapabilities, layerName: String, layerNumber: Number)
Parameters
wwd (WorldWindow) world window
wmsConfig (Object) object containing how layer should look
wmsLayerCapabilities (WmsLayerCapabilities) object representing what the wmslayer can do
layerName (String) name of layer
layerNumber (Number) number of layer in list

generateLegend

Creates a legend for a layer given its name and number

generateLegend(wmsLayerCapabilities: Object): String
Parameters
wmsLayerCapabilities (Object) object representing what the wms layer can do
Returns
String: contains the HTML to generate

generateOpacityControl

Generates opacity control for a layer in HTML

generateOpacityControl(layerNumber: Number): String
Parameters
layerNumber (Number) identifier to place layer
Returns
String: contains the HTML for opacity control

giveOpacitySliderFunctionality

Gives layer opacity control given its name

giveOpacitySliderFunctionality(wwd: WorldWindow, layerName: String, layerNumber: Number)
Parameters
wwd (WorldWindow) world window
layerName (String) name of layer to give opacity control
layerNumber (Number) id of layer

generateRemoveButton

Generates remove button for graphs

generateRemoveButton()

generateTimeControl

Generates time HTML control for specified layer

generateTimeControl(layerName: String, layerNumber: Number, wmsConfig: Object): String
Parameters
layerName (String) name of layer to give time control
layerNumber (Number) number id for layer
wmsConfig (Object) WMS configuration for layer control
Returns
String: contains the HTML of the time control

giveTimeButtonFunctionality

Simply provides functionality to the time control button.

giveTimeButtonFunctionality(wwd: WorldWindow, layerName: String, layerNumber: Number, wmsConfig: Object)
Parameters
wwd (WorldWindow) the world window for the globe.
layerName (String) the name of the layer ro search for
layerNumber (Number) the div to refer to
wmsConfig (Object) configuration of the layer

getLayerFromName

Searches for a layer given name and returns the layer object

getLayerFromName(wwd: WorldWindow, layerName: String): Layer
Parameters
wwd (WorldWindow) world window of the globe
layerName (String) name of layer to search for
Returns
Layer: the correct layer object, 0 otherwise

setLayerControls

Refreshes the control or the functionality of the layerManager buttons every time it is called for wmts layers

setLayerControls()

generateCountryButtons

generateCountryButtons(buttonDataArray: any): String
Parameters
buttonDataArray (any)
Returns
String: Returns the HTML to be displayed

giveCountryButtonsFunctionality

giveCountryButtonsFunctionality(buttonDataArray: any, countryCode: any, Contains: Array<DataArray>, The: string)
Parameters
buttonDataArray (any)
countryCode (any)
Contains (Array<DataArray>) the details of what needs to shown for the HTML.
The (string) 3-letter code of the country that is being viewed

plotScatter

plotScatter(titleName: any, secondName: any, inputData: any, htmlID: any, mode: any, The: string, The: secondName, The: DataArray, The: string, Determine: integer)
Parameters
titleName (any)
secondName (any)
inputData (any)
htmlID (any)
mode (any)
The (string) name of the title for the graph.
The (secondName) other part of the title.
The (DataArray) data to be plotted.
The (string) ID to place the graph
Determine (integer) whether to accomodate for a subplot or not

generateDataButtons

generateDataButtons(inputData: any, countryCode: any, mode: any, Contains: DataArray, Contains: string, The: mode)
Parameters
inputData (any)
countryCode (any)
mode (any)
Contains (DataArray) the data to provide the HTML for
Contains (string) the code of the country for data search
The (mode) mode to determine what to display

giveDataButtonsFunctionality

giveDataButtonsFunctionality(detailsHTML: any, inputData: any, countryCode: any, mode: any, The: string, The: DataArray, The: string, A: integer)
Parameters
detailsHTML (any)
inputData (any)
countryCode (any)
mode (any)
The (string) id to search for sorting function
The (DataArray) data to use for plotting
The (string) 3-letter code to identify the data
A (integer) number finding out what HTML element to modify

giveStationButtonsFunctionality

giveStationButtonsFunctionality(atmoData: any, stationName: any, countryCode: any)
Parameters
atmoData (any)
stationName (any)
countryCode (any)

generateCountryTab

generateCountryTab(buttonDataArray: any, countryData: any, placeLat: any, placeLon: any, The: DataArray, The: Integer, The: Integer)
Parameters
buttonDataArray (any)
countryData (any)
placeLat (any)
placeLon (any)
The (DataArray) country location to determine what has been clicked
The (Integer) latitude of the click
The (Integer) longitide of the click

giveGeoComparisonFunctionality

Gives funcitonality to the geoComparison tab

giveGeoComparisonFunctionality(agriData: any, geoJSONData: any, wwd: any, layerManager: any, The: DataArray, The: Array, The: WorldWindow, The: LayerManager)
Parameters
agriData (any)
geoJSONData (any)
wwd (any)
layerManager (any)
The (DataArray) data to be placed on the geo comparison
The (Array) array containing the geoJSONData of borderStyle
The (WorldWindow) WorldWind interface
The (LayerManager) layer manager to modify after creating borders

createSubPlot

createSubPlot(subData: any, htmlID: any, The: DataArray, The: String)
Parameters
subData (any)
htmlID (any)
The (DataArray) array which acts a subgraph for the current plot.
The (String) string containing the ID of the graph placement

plotStack

The stack is the top X produced.

plotStack(inputData: any, htmlID: any, amount: any, The: DataArray, The: String, The: Integer)
Parameters
inputData (any)
htmlID (any)
amount (any)
The (DataArray) data to be used
The (String) ID of the graph to be placed
The (Integer) amount of the top that is being looked at

generateGeoComparisonButton

Generates the html for geo location comparison

generateGeoComparisonButton(data: any, Contains: DataArray)
Parameters
data (any)
Contains (DataArray) titles to show what data can be displayed

timeConverter

Converts unixt time into a date

timeConverter(UNIX_timestamp: any)
Parameters
UNIX_timestamp (any)

loadCSVDataArray

Loads CSV file in a different format (for FAO data)

loadCSVDataArray()

findDataBaseName

findDataBaseName(inputArray: any, name: any, The: Array, The: String)
Parameters
inputArray (any)
name (any)
The (Array) array to find the code in
The (String) code that is being checked

convertArrayToDataSet

Given a csv data array, convert the segment into objects

convertArrayToDataSet(csvData: any)
Parameters
csvData (any) in the format of id, paramatertype, year1 value, year2 value...

createColumns

Creates columns for a geoJSON load

createColumns(allValues: any)
Parameters
allValues (any)

displayTab

Displays the desired tab and hides the rest

displayTab(tabName: string)
Parameters
tabName (string) , the name of the tab to show

getColour

Based on z-score get a colour Green means above mean, red means below, alpha is 1 by default

getColour(zScore: any, mode: any): {}
Parameters
zScore (any) country's z score
mode (any)
Returns
{}:

colourizeCountries

Given a set of gradients and country pairs, colorize the countries

colourizeCountries(valueCountryPair: any, geoJSONData: any, dataName: any)
Parameters
valueCountryPair (any) country and value together
geoJSONData (any) country borders
dataName (any) name of data type