Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
iCity
EnergyDashboard
Commits
b81e04f1
Commit
b81e04f1
authored
3 years ago
by
Pithon Kabiro
Browse files
Options
Download
Email Patches
Plain Diff
Minor tweaks to functions
parent
05f9d528
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/js/appChart.js
+3
-0
public/js/appChart.js
with
3 additions
and
0 deletions
+3
-0
public/js/appChart.js
+
3
-
0
View file @
b81e04f1
...
...
@@ -125,6 +125,7 @@ export const PARAM_SELECT = "result,phenomenonTime";
* @returns {Array} Array of formatted observations suitable for use in a heatmap
*/
export
const
formatSTAResponseForHeatMap
=
function
(
obsArray
)
{
if
(
!
obsArray
)
return
;
const
dataSTAFormatted
=
[];
obsArray
.
forEach
((
obs
)
=>
{
// Get the date/time string; first element in input array; remove trailing "Z"
...
...
@@ -246,6 +247,7 @@ export const drawHeatMapHC = function (formattedObsArrayForHeatmap) {
* @returns {Array} Array of formatted observations suitable for use in a line chart
*/
export
const
formatSTAResponseForLineChart
=
function
(
obsArray
)
{
if
(
!
obsArray
)
return
;
const
dataSTAFormatted
=
[];
obsArray
.
forEach
((
result
)
=>
{
const
timestampObs
=
new
Date
(
result
[
0
].
slice
(
0
,
-
1
)).
getTime
();
// slice() removes trailing "Z" character in timestamp
...
...
@@ -302,6 +304,7 @@ export const drawLineChartHC = function (formattedObsArrayForLineChart) {
* @returns {Object} - Object containing results from all the "@iot.nextLink" links
*/
export
const
followNextLink
=
function
(
responsePromise
)
{
if
(
!
responsePromise
)
return
;
return
responsePromise
.
then
(
function
(
lastSuccess
)
{
if
(
lastSuccess
.
data
[
"
@iot.nextLink
"
])
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment