@@ -186,6 +186,22 @@ suite.addBatch({
186186 } ,
187187 "Sphere" : function ( area ) {
188188 assert . strictEqual ( area ( { type : "Sphere" } ) , 1620000 ) ;
189+ } ,
190+ "supports fallback stream" : function ( ) {
191+ var path = d3 . geo . path ( ) ,
192+ area = path . area ( { type : "Polygon" , coordinates : [ [ [ - 122 , 37 ] , [ - 71 , 42 ] , [ - 80 , 25 ] , [ - 122 , 37 ] ] ] } ) ;
193+ assert . inDelta ( area , 109021.503 , 1e-3 ) ;
194+ }
195+ } ,
196+
197+ "bounds" : {
198+ "supports fallback stream" : function ( ) {
199+ var path = d3 . geo . path ( ) ,
200+ bounds = path . bounds ( { type : "LineString" , coordinates : [ [ - 122 , 37 ] , [ - 74 , 40 ] , [ - 100 , 0 ] ] } ) ;
201+ assert . inDelta ( bounds [ 0 ] [ 0 ] , - 5.1214 , 1e-3 ) ;
202+ assert . inDelta ( bounds [ 0 ] [ 1 ] , 174.825 , 1e-3 ) ;
203+ assert . inDelta ( bounds [ 1 ] [ 0 ] , 794.602 , 1e-3 ) ;
204+ assert . inDelta ( bounds [ 1 ] [ 1 ] , 856.501 , 1e-3 ) ;
189205 }
190206 } ,
191207
@@ -321,6 +337,12 @@ suite.addBatch({
321337 assert . deepEqual ( testContext . buffer ( ) . filter ( function ( d ) { return d . type === "moveTo" ; } ) , [
322338 { type : "moveTo" , x : 1370 , y : 243 }
323339 ] ) ;
340+ } ,
341+ "supports fallback stream" : function ( ) {
342+ var path = d3 . geo . path ( ) ,
343+ centroid = path . centroid ( { type : "LineString" , coordinates : [ [ - 122 , 37 ] , [ - 74 , 40 ] , [ - 100 , 0 ] ] } ) ;
344+ assert . inDelta ( centroid [ 0 ] , 434.655 , 1e-3 ) ;
345+ assert . inDelta ( centroid [ 1 ] , 397.940 , 1e-3 ) ;
324346 }
325347 } ,
326348
0 commit comments