22
33var d3 = require ( '@plotly/d3' ) ;
44var countryRegex = require ( 'country-regex' ) ;
5- var turfArea = require ( '@turf/area' ) ;
6- var turfCentroid = require ( '@turf/centroid' ) ;
7- var turfBbox = require ( '@turf/bbox' ) ;
5+ var { area : turfArea } = require ( '@turf/area' ) ;
6+ var { centroid : turfCentroid } = require ( '@turf/centroid' ) ;
7+ var { bbox : turfBbox } = require ( '@turf/bbox' ) ;
88
99var identity = require ( './identity' ) ;
1010var loggers = require ( './loggers' ) ;
@@ -295,7 +295,7 @@ function findCentroid(feature) {
295295
296296 for ( var i = 0 ; i < coords . length ; i ++ ) {
297297 var polyi = { type : 'Polygon' , coordinates : coords [ i ] } ;
298- var area = turfArea . default ( polyi ) ;
298+ var area = turfArea ( polyi ) ;
299299 if ( area > maxArea ) {
300300 maxArea = area ;
301301 poly = polyi ;
@@ -305,7 +305,7 @@ function findCentroid(feature) {
305305 poly = geometry ;
306306 }
307307
308- return turfCentroid . default ( poly ) . geometry . coordinates ;
308+ return turfCentroid ( poly ) . geometry . coordinates ;
309309}
310310
311311function fetchTraceGeoData ( calcData ) {
@@ -366,7 +366,7 @@ function fetchTraceGeoData(calcData) {
366366// TODO `turf/bbox` gives wrong result when the input feature/geometry
367367// crosses the anti-meridian. We should try to implement our own bbox logic.
368368function computeBbox ( d ) {
369- return turfBbox . default ( d ) ;
369+ return turfBbox ( d ) ;
370370}
371371
372372module . exports = {
0 commit comments