Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

[Bug] Fixed image export bug due to mapbox attrition logo (#1229)

Giuseppe Macrì3d72066f773f
diff --git a/src/components/geocoder/geocoder.js b/src/components/geocoder/geocoder.js
index 29508455e..d6a5c7ae1 100644
--- a/src/components/geocoder/geocoder.js
+++ b/src/components/geocoder/geocoder.js
@@ -1,3 +1,23 @@
+// Copyright (c) 2020 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
import React, {useCallback, useMemo, useState} from 'react';
import styled from 'styled-components';
import classnames from 'classnames';
diff --git a/src/components/plot-container.js b/src/components/plot-container.js
index 6fcd739c3..6ccd7281b 100644
--- a/src/components/plot-container.js
+++ b/src/components/plot-container.js
@@ -33,7 +33,8 @@ import {getScaleFromImageSize} from 'utils/export-utils';
import {findMapBounds} from 'utils/data-utils';
import geoViewport from '@mapbox/geo-viewport';
-const DOM_FILTER_FUNC = node => node.className !== 'mapboxgl-control-container';
+const CLASS_FILTER = ['mapboxgl-control-container', 'attrition-logo']
+const DOM_FILTER_FUNC = node => !CLASS_FILTER.includes(node.className);
const OUT_OF_SCREEN_POSITION = -9999;
const propTypes = {
diff --git a/test/browser/index.js b/test/browser/index.js
index 6c5e05344..50f3bd3be 100644
--- a/test/browser/index.js
+++ b/test/browser/index.js
@@ -17,6 +17,7 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+
const configure = require('enzyme').configure;
const Adapter = require('enzyme-adapter-react-16');
configure({adapter: new Adapter()});
diff --git a/yarn.lock b/yarn.lock
index 751d5a363..3cc13fdfb 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -363,7 +363,7 @@
"@babel/helper-create-class-features-plugin" "^7.8.3"
"@babel/helper-plugin-utils" "^7.8.3"
-"@babel/plugin-proposal-decorators@^7.1.2", "@babel/plugin-proposal-decorators@^7.3.0":
+"@babel/plugin-proposal-decorators@^7.1.2":
version "7.8.3"
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.8.3.tgz#2156860ab65c5abf068c3f67042184041066543e"
integrity sha512-e3RvdvS4qPJVTe288DlXjwKflpfy1hr0j5dz5WpIYYeP7vQZg2WfAEIp8k5/Lwis/m5REXEteIz6rrcDtXXG7w==
@@ -412,7 +412,7 @@
"@babel/helper-plugin-utils" "^7.8.3"
"@babel/plugin-syntax-function-bind" "^7.8.3"
-"@babel/plugin-proposal-function-sent@^7.0.0", "@babel/plugin-proposal-function-sent@^7.1.0":
+"@babel/plugin-proposal-function-sent@^7.1.0":
version "7.8.3"
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-function-sent/-/plugin-proposal-function-sent-7.8.3.tgz#341fd532b7eadbbbdd8bcb715150f279a779f14f"
integrity sha512-lu9wQjLnXd6Zy6eBKr0gE175xfD+da1rv2wOWEnZlD5KIxl894Tg34ppZ7ANR0jzQJMn+7pGuzSdy6JK4zGtKg==
@@ -543,7 +543,7 @@
dependencies:
"@babel/helper-plugin-utils" "^7.8.3"
-"@babel/plugin-syntax-export-namespace-from@^7.2.0", "@babel/plugin-syntax-export-namespace-from@^7.8.3":
+"@babel/plugin-syntax-export-namespace-from@^7.8.3":
version "7.8.3"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz#028964a9ba80dbc094c915c487ad7c4e7a66465a"
integrity sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==
@@ -13111,14 +13111,6 @@ react-map-gl@^5.0.3:
react-virtualized-auto-sizer "^1.0.2"
viewport-mercator-project "^6.2.3 || ^7.0.1"
-react-mapbox-gl-geocoder@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/react-mapbox-gl-geocoder/-/react-mapbox-gl-geocoder-1.1.0.tgz#f07e27a1329db711ec5843fbf1b78dbdc5930c9a"
- integrity sha512-U8fVUlj7Sb19KOgkKvfr3MPuqiGZ+ldHwwfo4BxBv7cyr397PQ/0o2XiC/Nz4PvN7dbIFHz7JfuVaq/MFZ5oHw==
- dependencies:
- mapbox "^1.0.0-beta10"
- viewport-mercator-project "^6.0.0"
-
react-markdown@^4.0.6:
version "4.3.1"
resolved "https://registry.yarnpkg.com/react-markdown/-/react-markdown-4.3.1.tgz#39f0633b94a027445b86c9811142d05381300f2f"