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

Edit documentation for functions / Chart app

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