-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove polygon and add coce coverage
- Loading branch information
Showing
6 changed files
with
89 additions
and
52 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
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
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,55 @@ | ||
var tape = require('tape'); | ||
var d3 = require('../'); | ||
|
||
tape('linestrip draws correctly', function(test){ | ||
|
||
var data = [ | ||
[ 3,5,2], | ||
[ 2,45,2], | ||
[ 1,1,2], | ||
[ 0,9,3], | ||
[-1,3,2], | ||
[-2,8,4], | ||
[-3,0,2], | ||
]; | ||
|
||
var ls3D = d3._3d() | ||
.scale(30) | ||
.origin([220,340]) | ||
.shape('LINE_STRIP'); | ||
|
||
test.equal(ls3D.draw(ls3D([data])[0]), 'M130,340L160,580L190,430L220,610L250,370L280,1690L310,490'); | ||
test.end(); | ||
}); | ||
|
||
tape('centroid calculation for linesstrip', function(test){ | ||
|
||
var data = [ | ||
[ 3,5,2], | ||
[ 2,45,2], | ||
[ 1,1,2], | ||
[ 0,9,3], | ||
[-1,3,2], | ||
[-2,8,4], | ||
[-3,0,2], | ||
]; | ||
|
||
var data2 = [ | ||
[ 3,5,2], | ||
[ 2,45,2], | ||
[ 1,1,2], | ||
[ 0,9,3], | ||
[-1,3,2], | ||
[-2,8,4], | ||
]; | ||
|
||
var ls3D = d3._3d() | ||
.scale(30) | ||
.origin([220,340]) | ||
.shape('LINE_STRIP'); | ||
|
||
test.deepEqual(ls3D([data])[0].centroid, {x: 0, y: 9, z: 3}); | ||
test.deepEqual(ls3D([data2])[0].centroid, { x: 0.5, y: 5, z: 2.5 }); | ||
|
||
test.end(); | ||
}); |
This file was deleted.
Oops, something went wrong.