Commit 5d01b6df authored by Pithon Kabiro's avatar Pithon Kabiro
Browse files

Edit documentation for functions / Chart app

parent cecb9f7d
......@@ -8,8 +8,8 @@ const BASE_URL = "http://193.196.39.91:8080/frost-icity-tp31/v1.1";
/**
* Create URL to fetch the Observations corresponding to a provided Datastream
* @param {*} datastreamID - integer representing the Datastream ID
* @returns {String}
* @param {Number} datastreamID - Integer representing the Datastream ID
* @returns {String} URL string for fetching the Observations corresponding to a Datastream
*/
const getObservationsUrl = function (datastreamID) {
if (!datastreamID) return;
......@@ -19,9 +19,9 @@ const getObservationsUrl = function (datastreamID) {
/**
* Create a temporal filter string for the fetched Observations
* @param {*} dateStart - start date in YYYY-MM-DD format
* @param {*} dateStop - stop date in YYYY-MM-DD format
* @returns {String}
* @param {String} dateStart Start date in YYYY-MM-DD format
* @param {String} dateStop Stop date in YYYY-MM-DD format
* @returns {String} Temporal filter string
*/
const createTemporalFilterString = function (dateStart, dateStop) {
if (!dateStart || !dateStop) return;
......@@ -46,8 +46,8 @@ const axiosGetRequest = axios.get(BASE_URL_OBSERVATIONS, {
/**
* Format the response from SensorThings API to make it suitable for heatmap
* @param {*} obsArray - Response from SensorThings API as array
* @returns {Array}
* @param {Array} obsArray Response from SensorThings API as array
* @returns {Array} Array of formatted observations suitable for use in a heatmap
*/
const formatSTAResponseForHeatMap = function (obsArray) {
const dataSTAFormatted = [];
......@@ -72,8 +72,8 @@ const formatSTAResponseForHeatMap = function (obsArray) {
/**
* Draw a heatmap using Highcharts library
* @param {*} obsArray - Response from SensorThings API
* @returns {void}
* @param {Array} obsArray Response from SensorThings API
* @returns {Object} Highcharts library heatmap object
*/
const drawHeatMapHC = function (obsArray) {
Highcharts.chart("chart-heatmap", {
......@@ -167,8 +167,8 @@ const drawHeatMapHC = function (obsArray) {
/**
* Convert the observations' phenomenonTime from an ISO 8601 string to Unix epoch
* @param {*} obsArray - Response from SensorThings API as array
* @returns {Array}
* @param {Array} obsArray Response from SensorThings API as array
* @returns {Array} Array of formatted observations suitable for use in a line chart
*/
const formatSTAResponseForLineChart = function (obsArray) {
const dataSTAFormatted = [];
......@@ -182,8 +182,8 @@ const formatSTAResponseForLineChart = function (obsArray) {
/**
* Draw a line chart using Highcharts library
* @param {*} obsArray - Response from SensorThings API
* @returns {void}
* @param {Array} obsArray - Response from SensorThings API
* @returns {Object} Highcharts library line chart object
*/
const drawLineChartHC = function (obsArray) {
// Create the chart
......@@ -217,7 +217,7 @@ const drawLineChartHC = function (obsArray) {
* Follows "@iot.nextLink" links in SensorThingsAPI's response
* Appends new results to existing results
* @async
* @param {Object} responsePromise - Promise object
* @param {Object} responsePromise Promise object
* @returns {Object} - Object containing results from all the "@iot.nextLink" links
*/
const followNextLink = function (responsePromise) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment