11var vows = require ( "vows" ) ,
2+ _ = require ( "../../" ) ,
23 load = require ( "../load" ) ,
34 assert = require ( "../assert" ) ;
45
@@ -26,19 +27,22 @@ suite.addBatch({
2627 "of two points is empty" : function ( h ) {
2728 assert . deepEqual ( h ( [ [ 200 , 200 ] , [ 760 , 300 ] ] ) , [ ] ) ;
2829 } ,
29- "for three points is empty " : function ( h ) {
30- assert . deepEqual ( h ( [ [ 200 , 200 ] , [ 760 , 300 ] , [ 500 , 500 ] ] ) , [ [ 200 , 200 ] , [ 760 , 300 ] , [ 500 , 500 ] ] ) ;
30+ "for three points" : function ( h ) {
31+ assert . deepEqual ( h ( [ [ 200 , 200 ] , [ 760 , 300 ] , [ 500 , 500 ] ] ) , [ [ 500 , 500 ] , [ 760 , 300 ] , [ 200 , 200 ] ] ) ;
3132 } ,
3233 "for four points" : function ( h ) {
33- assert . deepEqual ( h ( [ [ 200 , 200 ] , [ 760 , 300 ] , [ 500 , 500 ] , [ 400 , 400 ] ] ) , [ [ 200 , 200 ] , [ 760 , 300 ] , [ 500 , 500 ] ] ) ;
34+ assert . deepEqual ( h ( [ [ 200 , 200 ] , [ 760 , 300 ] , [ 500 , 500 ] , [ 400 , 400 ] ] ) , [ [ 500 , 500 ] , [ 760 , 300 ] , [ 200 , 200 ] ] ) ;
35+ } ,
36+ "returns a counter-clockwise polygon" : function ( h ) {
37+ assert . greater ( _ . geom . polygon ( h ( [ [ 200 , 200 ] , [ 760 , 300 ] , [ 500 , 500 ] , [ 400 , 400 ] ] ) ) . area ( ) , 0 ) ;
3438 }
3539 } ,
3640 "the hull layout with custom accessors" : {
3741 topic : function ( hull ) {
3842 return hull ( ) . x ( function ( d ) { return d . x ; } ) . y ( function ( d ) { return d . y ; } ) ;
3943 } ,
4044 "of four points" : function ( h ) {
41- assert . deepEqual ( h ( [ { x : 200 , y : 200 } , { x : 760 , y : 300 } , { x : 500 , y : 500 } , { x : 400 , y : 400 } ] ) , [ { x : 200 , y : 200 } , { x : 760 , y : 300 } , { x : 500 , y : 500 } ] ) ;
45+ assert . deepEqual ( h ( [ { x : 200 , y : 200 } , { x : 760 , y : 300 } , { x : 500 , y : 500 } , { x : 400 , y : 400 } ] ) , [ { x : 500 , y : 500 } , { x : 760 , y : 300 } , { x : 200 , y : 200 } ] ) ;
4246 }
4347 } ,
4448 "the default hull layout applied directly" : {
@@ -52,10 +56,10 @@ suite.addBatch({
5256 return h ( [ [ 200 , 200 ] , [ 760 , 300 ] ] ) ;
5357 } ,
5458 "for three points" : function ( h ) {
55- assert . deepEqual ( h ( [ [ 200 , 200 ] , [ 760 , 300 ] , [ 500 , 500 ] ] ) , [ [ 200 , 200 ] , [ 760 , 300 ] , [ 500 , 500 ] ] ) ;
59+ assert . deepEqual ( h ( [ [ 200 , 200 ] , [ 760 , 300 ] , [ 500 , 500 ] ] ) , [ [ 500 , 500 ] , [ 760 , 300 ] , [ 200 , 200 ] ] ) ;
5660 } ,
5761 "for four points" : function ( h ) {
58- assert . deepEqual ( h ( [ [ 200 , 200 ] , [ 760 , 300 ] , [ 500 , 500 ] , [ 400 , 400 ] ] ) , [ [ 200 , 200 ] , [ 760 , 300 ] , [ 500 , 500 ] ] ) ;
62+ assert . deepEqual ( h ( [ [ 200 , 200 ] , [ 760 , 300 ] , [ 500 , 500 ] , [ 400 , 400 ] ] ) , [ [ 500 , 500 ] , [ 760 , 300 ] , [ 200 , 200 ] ] ) ;
5963 }
6064 }
6165 }
0 commit comments