@@ -3482,7 +3482,7 @@ d3 = function() {
34823482 if ( y > d3_geo_pathBoundsY1 ) d3_geo_pathBoundsY1 = y ;
34833483 }
34843484 function d3_geo_pathBuffer ( ) {
3485- var pointCircle = d3_geo_pathCircle ( 4.5 ) , buffer = [ ] ;
3485+ var pointCircle = d3_geo_pathBufferCircle ( 4.5 ) , buffer = [ ] ;
34863486 var stream = {
34873487 point : point ,
34883488 lineStart : function ( ) {
@@ -3497,7 +3497,7 @@ d3 = function() {
34973497 stream . point = point ;
34983498 } ,
34993499 pointRadius : function ( _ ) {
3500- pointCircle = d3_geo_pathCircle ( _ ) ;
3500+ pointCircle = d3_geo_pathBufferCircle ( _ ) ;
35013501 return stream ;
35023502 } ,
35033503 result : function ( ) {
@@ -3526,6 +3526,9 @@ d3 = function() {
35263526 }
35273527 return stream ;
35283528 }
3529+ function d3_geo_pathBufferCircle ( radius ) {
3530+ return "m0," + radius + "a" + radius + "," + radius + " 0 1,1 0," + - 2 * radius + "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius + "z" ;
3531+ }
35293532 var d3_geo_pathCentroid = {
35303533 point : d3_geo_pathCentroidPoint ,
35313534 lineStart : d3_geo_pathCentroidLineStart ,
@@ -3630,9 +3633,12 @@ d3 = function() {
36303633 return stream ;
36313634 }
36323635 d3 . geo . path = function ( ) {
3633- var pointRadius = 4.5 , projection , context , projectStream , contextStream ;
3636+ var pointRadius = 4.5 , projection , context , projectStream , contextStream , objectStream ;
36343637 function path ( object ) {
3635- if ( object ) d3 . geo . stream ( object , projectStream ( contextStream . pointRadius ( typeof pointRadius === "function" ? + pointRadius . apply ( this , arguments ) : pointRadius ) ) ) ;
3638+ if ( object ) {
3639+ if ( typeof pointRadius === "function" ) contextStream . pointRadius ( + pointRadius . apply ( this , arguments ) ) ;
3640+ d3 . geo . stream ( object , objectStream ) ;
3641+ }
36363642 return contextStream . result ( ) ;
36373643 }
36383644 path . area = function ( object ) {
@@ -3653,23 +3659,23 @@ d3 = function() {
36533659 path . projection = function ( _ ) {
36543660 if ( ! arguments . length ) return projection ;
36553661 projectStream = ( projection = _ ) ? _ . stream || d3_geo_pathProjectStream ( _ ) : d3_identity ;
3662+ objectStream = projectStream ( contextStream ) ;
36563663 return path ;
36573664 } ;
36583665 path . context = function ( _ ) {
36593666 if ( ! arguments . length ) return context ;
36603667 contextStream = ( context = _ ) == null ? new d3_geo_pathBuffer ( ) : new d3_geo_pathContext ( _ ) ;
3668+ objectStream = projectStream ( contextStream ) ;
36613669 return path ;
36623670 } ;
36633671 path . pointRadius = function ( _ ) {
36643672 if ( ! arguments . length ) return pointRadius ;
3665- pointRadius = typeof _ === "function" ? _ : + _ ;
3673+ pointRadius = typeof _ === "function" ? _ : ( _ = + _ , contextStream . pointRadius ( _ ) ,
3674+ _ ) ;
36663675 return path ;
36673676 } ;
36683677 return path . projection ( d3 . geo . albersUsa ( ) ) . context ( null ) ;
36693678 } ;
3670- function d3_geo_pathCircle ( radius ) {
3671- return "m0," + radius + "a" + radius + "," + radius + " 0 1,1 0," + - 2 * radius + "a" + radius + "," + radius + " 0 1,1 0," + + 2 * radius + "z" ;
3672- }
36733679 function d3_geo_pathProjectStream ( project ) {
36743680 var resample = d3_geo_resample ( function ( λ , φ ) {
36753681 return project ( [ λ * d3_degrees , φ * d3_degrees ] ) ;
0 commit comments