Skip to content

Commit

Permalink
Merge pull request #80 from blesh/area-null-data-fix
Browse files Browse the repository at this point in the history
fix error when data is null
  • Loading branch information
benlesh committed Jul 2, 2015
2 parents b7f64b2 + f757749 commit 73c0633
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions app/components/nf-area.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,16 @@ export default Ember.Component.extend(HasGraphParent, RegisteredGraphic, DataGra
mappedData: Ember.computed('data.[]', 'xPropFn', 'yPropFn', 'nextYData.@each', 'stack.aggregate', function() {
var { data, xPropFn, yPropFn, nextYData } = this.getProperties('data', 'xPropFn', 'yPropFn', 'nextYData');
var aggregate = this.get('stack.aggregate');
return data.map((d, i) => {
var x = xPropFn(d);
var y = yPropFn(d);
var result = aggregate ? [x, y + nextYData[i], nextYData[i]] : [x, y, nextYData[i]];
return result;
});
if(Array.isArray(data)) {
return data.map((d, i) => {
var x = xPropFn(d);
var y = yPropFn(d);
var result = aggregate ? [x, y + nextYData[i], nextYData[i]] : [x, y, nextYData[i]];
return result;
});
} else {
return [];
}
}),


Expand Down

0 comments on commit 73c0633

Please sign in to comment.