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
49b24fe4
Commit
49b24fe4
authored
3 years ago
by
Sven Schneider
Browse files
Options
Download
Email Patches
Plain Diff
minor
parent
a88d9637
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
public/js/aggregation.js
+8
-8
public/js/aggregation.js
public/js/appCesium.js
+1
-1
public/js/appCesium.js
with
9 additions
and
9 deletions
+9
-9
public/js/aggregation.js
+
8
-
8
View file @
49b24fe4
...
@@ -104,10 +104,10 @@ export const aggregateResponse = function(obsArray, hours, method) {
...
@@ -104,10 +104,10 @@ export const aggregateResponse = function(obsArray, hours, method) {
switch
(
method
)
{
switch
(
method
)
{
case
'
mean
'
:
case
'
mean
'
:
aggregatedVals
.
push
(
vals
.
reduce
(
function
(
a
,
b
)
{
return
a
+
b
/
vals
.
length
;
},
0
));
aggregatedVals
.
push
(
vals
.
reduce
(
function
(
a
,
b
)
{
return
a
+
b
/
vals
.
length
;
},
-
1
));
break
;
break
;
case
'
sum
'
:
case
'
sum
'
:
aggregatedVals
.
push
(
vals
.
reduce
(
function
(
a
,
b
)
{
return
a
+
b
;
},
0
));
aggregatedVals
.
push
(
vals
.
reduce
(
function
(
a
,
b
)
{
return
a
+
b
;
},
-
1
));
break
;
break
;
case
'
min
'
:
case
'
min
'
:
aggregatedVals
.
push
(
vals
.
reduce
(
function
(
a
,
b
)
{
return
Math
.
min
(
a
,
b
);
}));
aggregatedVals
.
push
(
vals
.
reduce
(
function
(
a
,
b
)
{
return
Math
.
min
(
a
,
b
);
}));
...
@@ -116,7 +116,7 @@ export const aggregateResponse = function(obsArray, hours, method) {
...
@@ -116,7 +116,7 @@ export const aggregateResponse = function(obsArray, hours, method) {
aggregatedVals
.
push
(
vals
.
reduce
(
function
(
a
,
b
)
{
return
Math
.
max
(
a
,
b
);
}));
aggregatedVals
.
push
(
vals
.
reduce
(
function
(
a
,
b
)
{
return
Math
.
max
(
a
,
b
);
}));
break
;
break
;
default
:
default
:
aggregatedVals
.
push
(
vals
.
reduce
(
function
(
a
,
b
)
{
return
a
+
b
/
vals
.
length
;
},
0
));
aggregatedVals
.
push
(
vals
.
reduce
(
function
(
a
,
b
)
{
return
a
+
b
/
vals
.
length
;
},
-
1
));
}
}
vals
=
[];
// clear the daily value vector
vals
=
[];
// clear the daily value vector
vals
.
push
(
jsonData
[
d
].
temperature
);
// now push first entry of new day into my temp value vector.
vals
.
push
(
jsonData
[
d
].
temperature
);
// now push first entry of new day into my temp value vector.
...
@@ -150,19 +150,19 @@ export const aggregateResponse = function(obsArray, hours, method) {
...
@@ -150,19 +150,19 @@ export const aggregateResponse = function(obsArray, hours, method) {
switch
(
method
)
{
switch
(
method
)
{
case
'
mean
'
:
case
'
mean
'
:
aggregatedVals
.
push
(
vals
.
reduce
(
function
(
a
,
b
)
{
return
a
+
b
/
vals
.
length
;
},
0
));
aggregatedVals
.
push
(
vals
.
reduce
(
function
(
a
,
b
)
{
return
a
+
b
/
vals
.
length
;
},
-
1
));
break
;
break
;
case
'
sum
'
:
case
'
sum
'
:
aggregatedVals
.
push
(
vals
.
reduce
(
function
(
a
,
b
)
{
return
a
+
b
;
},
0
));
aggregatedVals
.
push
(
vals
.
reduce
(
function
(
a
,
b
)
{
return
a
+
b
;
},
-
1
));
break
;
break
;
case
'
min
'
:
case
'
min
'
:
aggregatedVals
.
push
(
vals
.
reduce
(
function
(
a
,
b
)
{
return
Math
.
min
(
a
,
b
);
}));
aggregatedVals
.
push
(
vals
.
reduce
(
function
(
a
,
b
)
{
return
Math
.
min
(
a
,
b
);
}
,
));
break
;
break
;
case
'
max
'
:
case
'
max
'
:
aggregatedVals
.
push
(
vals
.
reduce
(
function
(
a
,
b
)
{
return
Math
.
max
(
a
,
b
);
}));
aggregatedVals
.
push
(
vals
.
reduce
(
function
(
a
,
b
)
{
return
Math
.
max
(
a
,
b
);
}
,
));
break
;
break
;
default
:
default
:
aggregatedVals
.
push
(
vals
.
reduce
(
function
(
a
,
b
)
{
return
a
+
b
/
vals
.
length
;
},
0
));
aggregatedVals
.
push
(
vals
.
reduce
(
function
(
a
,
b
)
{
return
a
+
b
/
vals
.
length
;
},
-
1
));
}
}
vals
=
[];
// clear the daily value vector
vals
=
[];
// clear the daily value vector
vals
.
push
(
jsonData
[
d
].
temperature
);
// now push first entry of new day into my temp value vector.
vals
.
push
(
jsonData
[
d
].
temperature
);
// now push first entry of new day into my temp value vector.
...
...
This diff is collapsed.
Click to expand it.
public/js/appCesium.js
+
1
-
1
View file @
49b24fe4
...
@@ -343,7 +343,7 @@ const activate3DTileFeaturePicking = function() {
...
@@ -343,7 +343,7 @@ const activate3DTileFeaturePicking = function() {
console
.
log
(
err
);
console
.
log
(
err
);
})
})
.
then
((
observationArr
)
=>
{
.
then
((
observationArr
)
=>
{
var
agg
=
aggregateResponse
(
observationArr
,
0
,
'
sum
'
);
var
agg
=
aggregateResponse
(
observationArr
,
0
,
'
min
'
);
console
.
log
(
agg
);
console
.
log
(
agg
);
drawHeatMapHC
(
formatSTAResponseForHeatMap
(
agg
));
drawHeatMapHC
(
formatSTAResponseForHeatMap
(
agg
));
drawLineChartHC
(
formatSTAResponseForLineChart
(
agg
));
drawLineChartHC
(
formatSTAResponseForLineChart
(
agg
));
...
...
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