@@ -21,7 +21,6 @@ var locationToFeature = require('../../lib/geo_location_utils').locationToFeatur
2121var geoJsonUtils = require ( '../../lib/geojson_utils' ) ;
2222var subTypes = require ( '../scatter/subtypes' ) ;
2323
24-
2524module . exports = function plot ( geo , calcData ) {
2625 for ( var i = 0 ; i < calcData . length ; i ++ ) {
2726 calcGeoJSON ( calcData [ i ] , geo . topojson ) ;
@@ -35,19 +34,19 @@ module.exports = function plot(geo, calcData) {
3534 }
3635 }
3736
38- var gScatterGeoTraces = geo . layers . frontplot . select ( '.scatterlayer' )
37+ var gTraces = geo . layers . frontplot . select ( '.scatterlayer' )
3938 . selectAll ( 'g.trace.scattergeo' )
4039 . data ( calcData , keyFunc ) ;
4140
42- gScatterGeoTraces . enter ( ) . append ( 'g' )
41+ gTraces . enter ( ) . append ( 'g' )
4342 . attr ( 'class' , 'trace scattergeo' ) ;
4443
45- gScatterGeoTraces . exit ( ) . remove ( ) ;
44+ gTraces . exit ( ) . remove ( ) ;
4645
4746 // TODO find a way to order the inner nodes on update
48- gScatterGeoTraces . selectAll ( '*' ) . remove ( ) ;
47+ gTraces . selectAll ( '*' ) . remove ( ) ;
4948
50- gScatterGeoTraces . each ( function ( calcTrace ) {
49+ gTraces . each ( function ( calcTrace ) {
5150 var s = calcTrace [ 0 ] . node3 = d3 . select ( this ) ;
5251 var trace = calcTrace [ 0 ] . trace ;
5352
@@ -103,15 +102,15 @@ function calcGeoJSON(calcTrace, topojson) {
103102}
104103
105104function style ( geo ) {
106- var selection = geo . framework . selectAll ( 'g .trace.scattergeo' ) ;
105+ var gTraces = geo . layers . frontplot . selectAll ( '.trace.scattergeo' ) ;
107106
108- selection . style ( 'opacity' , function ( calcTrace ) {
107+ gTraces . style ( 'opacity' , function ( calcTrace ) {
109108 return calcTrace [ 0 ] . trace . opacity ;
110109 } ) ;
111110
112- selection . each ( function ( calcTrace ) {
113- var trace = calcTrace [ 0 ] . trace ,
114- group = d3 . select ( this ) ;
111+ gTraces . each ( function ( calcTrace ) {
112+ var trace = calcTrace [ 0 ] . trace ;
113+ var group = d3 . select ( this ) ;
115114
116115 group . selectAll ( 'path.point' )
117116 . call ( Drawing . pointStyle , trace , geo . graphDiv ) ;
@@ -120,12 +119,12 @@ function style(geo) {
120119 } ) ;
121120
122121 // this part is incompatible with Drawing.lineGroupStyle
123- selection . selectAll ( 'path.js-line' )
122+ gTraces . selectAll ( 'path.js-line' )
124123 . style ( 'fill' , 'none' )
125124 . each ( function ( d ) {
126- var path = d3 . select ( this ) ,
127- trace = d . trace ,
128- line = trace . line || { } ;
125+ var path = d3 . select ( this ) ;
126+ var trace = d . trace ;
127+ var line = trace . line || { } ;
129128
130129 path . call ( Color . stroke , line . color )
131130 . call ( Drawing . dashLine , line . dash || '' , line . width || 0 ) ;
0 commit comments