11d3 = function ( ) {
22 var d3 = {
3- version : "3.3.11 "
3+ version : "3.3.12 "
44 } ;
55 if ( ! Date . now ) Date . now = function ( ) {
66 return + new Date ( ) ;
@@ -607,7 +607,7 @@ d3 = function() {
607607 d3_selectionPrototype . classed = function ( name , value ) {
608608 if ( arguments . length < 2 ) {
609609 if ( typeof name === "string" ) {
610- var node = this . node ( ) , n = ( name = name . trim ( ) . split ( / ^ | \s + / g ) ) . length , i = - 1 ;
610+ var node = this . node ( ) , n = ( name = d3_selection_classes ( name ) ) . length , i = - 1 ;
611611 if ( value = node . classList ) {
612612 while ( ++ i < n ) if ( ! value . contains ( name [ i ] ) ) return false ;
613613 } else {
@@ -624,8 +624,11 @@ d3 = function() {
624624 function d3_selection_classedRe ( name ) {
625625 return new RegExp ( "(?:^|\\s+)" + d3 . requote ( name ) + "(?:\\s+|$)" , "g" ) ;
626626 }
627+ function d3_selection_classes ( name ) {
628+ return name . trim ( ) . split ( / ^ | \s + / ) ;
629+ }
627630 function d3_selection_classed ( name , value ) {
628- name = name . trim ( ) . split ( / \s + / ) . map ( d3_selection_classedName ) ;
631+ name = d3_selection_classes ( name ) . map ( d3_selection_classedName ) ;
629632 var n = name . length ;
630633 function classedConstant ( ) {
631634 var i = - 1 ;
@@ -4166,14 +4169,21 @@ d3 = function() {
41664169 return d3_geo_projection ( d3_geo_stereographic ) ;
41674170 } ) . raw = d3_geo_stereographic ;
41684171 function d3_geo_transverseMercator ( λ , φ ) {
4169- var B = Math . cos ( φ ) * Math . sin ( λ ) ;
4170- return [ Math . log ( ( 1 + B ) / ( 1 - B ) ) / 2 , Math . atan2 ( Math . tan ( φ ) , Math . cos ( λ ) ) ] ;
4172+ return [ Math . log ( Math . tan ( π / 4 + φ / 2 ) ) , - λ ] ;
41714173 }
41724174 d3_geo_transverseMercator . invert = function ( x , y ) {
4173- return [ Math . atan2 ( d3_sinh ( x ) , Math . cos ( y ) ) , d3_asin ( Math . sin ( y ) / d3_cosh ( x ) ) ] ;
4175+ return [ - y , 2 * Math . atan ( Math . exp ( x ) ) - halfπ ] ;
41744176 } ;
41754177 ( d3 . geo . transverseMercator = function ( ) {
4176- return d3_geo_mercatorProjection ( d3_geo_transverseMercator ) ;
4178+ var projection = d3_geo_mercatorProjection ( d3_geo_transverseMercator ) , center = projection . center , rotate = projection . rotate ;
4179+ projection . center = function ( _ ) {
4180+ return _ ? center ( [ - _ [ 1 ] , _ [ 0 ] ] ) : ( _ = center ( ) , [ - _ [ 1 ] , _ [ 0 ] ] ) ;
4181+ } ;
4182+ projection . rotate = function ( _ ) {
4183+ return _ ? rotate ( [ _ [ 0 ] , _ [ 1 ] , _ . length > 2 ? _ [ 2 ] + 90 : 90 ] ) : ( _ = rotate ( ) ,
4184+ [ _ [ 0 ] , _ [ 1 ] , _ [ 2 ] - 90 ] ) ;
4185+ } ;
4186+ return projection . rotate ( [ 0 , 0 ] ) ;
41774187 } ) . raw = d3_geo_transverseMercator ;
41784188 d3 . geom = { } ;
41794189 function d3_geom_pointX ( d ) {
@@ -6847,10 +6857,16 @@ d3 = function() {
68476857 return Math . exp ( random ( ) ) ;
68486858 } ;
68496859 } ,
6860+ bates : function ( m ) {
6861+ var random = d3 . random . irwinHall ( m ) ;
6862+ return function ( ) {
6863+ return random ( ) / m ;
6864+ } ;
6865+ } ,
68506866 irwinHall : function ( m ) {
68516867 return function ( ) {
68526868 for ( var s = 0 , j = 0 ; j < m ; j ++ ) s += Math . random ( ) ;
6853- return s / m ;
6869+ return s ;
68546870 } ;
68556871 }
68566872 } ;
0 commit comments