# Modules

methods/formatSensorobject

Triggered when a sensor has been updated Format Sensor instance with SensorSnap props

methods/normalizeNumberfloat

Validate new value input ( number )

methods/mapValuetoRangefloat

Mapping a value within a know range to another value using output range

methods/xToLongitudefloat

Convert SVG X coordinate to a longitude

methods/yToLatitudefloat

Convert SVG Y coordinate to a latitude

methods/svgToGeoPointobject

Convert SVG coordinates to location coordinates

methods/longitudeToXfloat

Convert longitude to SVG Y coordinate

methods/longitudeToXfloat

Convert latitude to SVG Y coordinate

methods/geoPointToSvgobject

Convert SVG coordinates to location coordinates

methods/degreesToRadiansfloat

Transform an angle value from degree to radians ( number )

methods/getDistanceFromCoordinatesfloat

Calculate the distance travelled between two ccordinates using Haversine formula

methods/getValueInPercentagefloat

Convert input value in percentage

methods/formatSensorstring

Triggered when a new sensor type has been initialized

methods/checkComponentTypearray

Validate that the right Vue component is getting loaded

methods/getComponentResourceany

Load specific Vue component resource

methods/getComponentResource

Expose a timer module based on setTimeout

# methods/formatSensor ⇒ object

Triggered when a sensor has been updated Format Sensor instance with SensorSnap props

Returns: object - sensor - Aloes Sensor instance

Param Type Description
props object props

# methods/normalizeNumber ⇒ float

Validate new value input ( number )

Returns: float - val - Normalized value

Param Type Description
value any New sensor value
min int Min Range value
limit init Max Range value

# methods/mapValuetoRange ⇒ float

Mapping a value within a know range to another value using output range

Returns: float - output - mapped value

Param Type Description
input float Input value
x1 int Min Input range value
y1 int Max Input range value
x2 int Min Output range value
y2 int Max Output range value

# methods/xToLongitude ⇒ float

Convert SVG X coordinate to a longitude

Param Type Description
x float
svg width width

# methods/yToLatitude ⇒ float

Convert SVG Y coordinate to a latitude

Param Type Description
y float
svg width width

# methods/svgToGeoPoint ⇒ object

Convert SVG coordinates to location coordinates

Param Type Description
x float
y float
svg width width

# methods/longitudeToX ⇒ float

Convert longitude to SVG Y coordinate

Param Type Description
longitude float
svg width width

# methods/longitudeToX ⇒ float

Convert latitude to SVG Y coordinate

Param Type Description
longitude float
svg width width

# methods/geoPointToSvg ⇒ object

Convert SVG coordinates to location coordinates

Param Type Description
latitude float
longitude float
svg width width

# methods/degreesToRadians ⇒ float

Transform an angle value from degree to radians ( number )

Returns: float - angle in radians

Param Type Description
deg float Angle in degree

# methods/getDistanceFromCoordinates ⇒ float

Calculate the distance travelled between two ccordinates using Haversine formula

Returns: float - distance in kilometers

Param Type Description
lat1 float Latitude from first location set
lng1 float Longitude from first location set
lat2 float Latitude from second location set
lng2 float Longitude from second location set

# methods/getValueInPercentage ⇒ float

Convert input value in percentage

Returns: float - val - Normalized value

Param Type Description
value float New sensor value
min int Min Range value
max init Max Range value

# methods/formatSensor ⇒ string

Triggered when a new sensor type has been initialized

Returns: string - styles - Configured CSS

Param Type Description
sensor object sensor instance
stylesConf object Overriding default style config
componentName string Vue component nanme associated with this sensor type

# methods/checkComponentType ⇒ array

Validate that the right Vue component is getting loaded

Returns: array - objectIds - OMA Object ID supported by this component

Param Type Description
componentType string Vue component name associated with this sensor type
sensorType int Vue component nanme associated with this sensor type

# methods/getComponentResource ⇒ any

Load specific Vue component resource

Returns: any - result - property contained in ComponentType config

Param Type Description
componentType string Vue component name associated with this sensor type
componentResource string Vue component resource

# methods/getComponentResource

Expose a timer module based on setTimeout

Param Type Description
cb function Callback to trigger at timeout
data object Data to share between caller and callee
interval number Timeout interval