Skip to content

Commit

Permalink
#9 heatwave population impact examples
Browse files Browse the repository at this point in the history
  • Loading branch information
p-a-s-c-a-l committed Mar 1, 2019
1 parent aed5db4 commit f4d5c31
Show file tree
Hide file tree
Showing 5 changed files with 680 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,11 @@ angular.module(
var fileObj;
try {
fileObj = JSON.parse(e.target.result);
loadIndicatorObject(fileObj);
if (Object.prototype.toString.call(fileObj) !== '[object Array]') {
loadIndicatorObject(fileObj);
} else {
loadIndicatorObjects(fileObj);
}
$scope.$apply();
} catch (err) {
console.log(err.toString());
Expand All @@ -180,6 +184,7 @@ angular.module(

loadIndicatorObjects = function (indicatorObjects) {
var arrayLength = indicatorObjects.length;
console.debug('loading ' + arrayLength + ' indicator arrays');
for (var i = 0; i < arrayLength; i++) {
loadIndicatorObject(indicatorObjects[i]);
}
Expand Down
10 changes: 10 additions & 0 deletions nbproject/customs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"elements": {
"indicator-band": {
"attributes": {
"criteria-function": {}
}
}
},
"attributes": {}
}
76 changes: 76 additions & 0 deletions samples/claritiyCriteriaFunction.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
[
{
"name": "Population HW Impact Criteria Function",
"criteriaFunctions": [
{
"indicator": "Fatigue, discomfort",
"lowerBoundary": {
"criteriaValue": 0,
"indicatorValue": 0
},
"upperBoundary": {
"criteriaValue": 100,
"indicatorValue": 0
},
"intervals": [
]
},
{
"indicator": "Heat cramps, heat exhaustion",
"lowerBoundary": {
"criteriaValue": 0,
"indicatorValue": 0
},
"upperBoundary": {
"criteriaValue": 100,
"indicatorValue": 0
},
"intervals": [
]
},
{
"indicator": "Heat cramps, heatstroke",
"lowerBoundary": {
"criteriaValue": 0,
"indicatorValue": 25
},
"upperBoundary": {
"criteriaValue": 100,
"indicatorValue": 0
},
"intervals": [
]
},
{
"indicator": "Heatstroke, sunstroke",
"lowerBoundary": {
"criteriaValue": 0,
"indicatorValue": 0
},
"upperBoundary": {
"criteriaValue": 100,
"indicatorValue": 0
},
"intervals": [
]
},
{
"indicator": "Death",
"lowerBoundary": {
"criteriaValue": 0,
"indicatorValue": 100
},
"upperBoundary": {
"criteriaValue": 100,
"indicatorValue": 0
},
"intervals": [
{
"criteriaValue": 50,
"indicatorValue": 50
}
]
}
]
}
]
Loading

0 comments on commit f4d5c31

Please sign in to comment.