Skip to content

Commit

Permalink
troubleshooting recursion issue
Browse files Browse the repository at this point in the history
  • Loading branch information
stormpython committed Feb 5, 2015
1 parent f87f255 commit 06ffa8e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/kibana/components/vislib/visualizations/pie_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,10 @@ define(function (require) {
return sizes.some(this._isZero);
};

PieChart.prototype._removeZeroNodes = function () {
// use the this.chartData
// traverse the parent child objects
// check whether size is zero
// if zero, remove object
// return modified data
PieChart.prototype._removeZeroNodes = function (arr) {
return arr.filter(function (obj) {
return (obj.size !== 0);
});
};

/**
Expand All @@ -199,7 +197,7 @@ define(function (require) {
if (!isAllZeros && !isSomeZeros) { return; }

if (isSomeZeros) {
this._removeZeroNodes();
return this._removeZeroNodes();
}

throw new errors.PieContainsAllZeros();
Expand Down

0 comments on commit 06ffa8e

Please sign in to comment.