Skip to content

Commit

Permalink
Create appearance
Browse files Browse the repository at this point in the history
  • Loading branch information
isaomatsunami authored and mbostock committed Jan 23, 2019
1 parent 5045b02 commit 63d7507
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/order/appearance
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function stackOrderAppearance(series) {
var appearanceIndex = series.map(function(d,i){
for(var k = 0,n = d.length;k < n;++k){
if(d[k][1] > 0) break;
}
return [k, i];
});
appearanceIndex.sort(function(a,b){return a[0] - b[0];})
return appearanceIndex.map(function(d){return d[1]});
}

0 comments on commit 63d7507

Please sign in to comment.