-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
d3.layout.pie: return arcs in original data order.
Fixes d3#406.
- Loading branch information
1 parent
05d871b
commit c603af8
Showing
4 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require("../env"); | ||
require("../../d3"); | ||
require("../../d3.layout"); | ||
|
||
var vows = require("vows"), | ||
assert = require("assert"); | ||
|
||
var suite = vows.describe("d3.layout.pie"); | ||
|
||
suite.addBatch({ | ||
"pie": { | ||
topic: d3.layout.pie, | ||
"arcs are in same order as original data": function(pie) { | ||
assert.deepEqual(pie([5, 30, 15]).map(function(d) { return d.data; }), [ | ||
5, 30, 15 | ||
]); | ||
assert.deepEqual(pie([ | ||
84, 90, 48, 61, 58, 8, 6, 31, 45, 18 | ||
]).map(function(d) { return d.data; }), [ | ||
84, 90, 48, 61, 58, 8, 6, 31, 45, 18 | ||
]); | ||
} | ||
} | ||
}); | ||
|
||
suite.export(module); |