Skip to content

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

[Chore]: Technical: Isolate deckgl-layers (#1851)

dariaterekhovaaeb668fd28da84
diff --git a/package.json b/package.json
index e37c9aecb..0de2fb193 100644
--- a/package.json
+++ b/package.json
@@ -17,7 +17,8 @@
"private": true,
"workspaces": [
"./src/constants",
- "./src/types"
+ "./src/types",
+ "./src/deckgl-layers"
],
"repository": {
"type": "git",
@@ -48,7 +49,7 @@
"start:web": "npm run install-and-start -- website start",
"start:https": "npm run install-and-start -- examples/demo-app start-local-https",
"start:e2e": "npm run install-and-start -- examples/demo-app start-local-e2e",
- "build": "rm -fr dist && babel src --out-dir dist --source-maps inline --extensions '.ts,.tsx,.js,.jsx' --ignore '**/*.d.ts'",
+ "build": "rm -fr dist && babel src/{actions,components,layers,middleware,reducers,styles,templates,utils,cloud-providers,connect,localization,processors,schemas,tasks} --out-dir dist --source-maps inline --extensions '.ts,.tsx,.js,.jsx' --ignore '**/*.d.ts'",
"build:umd": "webpack --config ./webpack/umd.js --progress --env.prod",
"build:types": "tsc --project tsconfig.production.json",
"analyze": "npm run analyze:bundle",
diff --git a/src/components/map-container.tsx b/src/components/map-container.tsx
index 6b18d6b20..8c56810f3 100644
--- a/src/components/map-container.tsx
+++ b/src/components/map-container.tsx
@@ -50,7 +50,7 @@ import {
} from 'utils/layer-utils';
// default-settings
-import ThreeDBuildingLayer from 'deckgl-layers/3d-building-layer/3d-building-layer';
+import {ThreeDBuildingLayer} from '@kepler.gl/deckgl-layers';
import {FILTER_TYPES, GEOCODER_LAYER_ID, THROTTLE_NOTIFICATION_TIME} from '@kepler.gl/constants';
import ErrorBoundary from 'components/common/error-boundary';
diff --git a/src/constants/package.json b/src/constants/package.json
index a01e5fc20..9ff8f7093 100644
--- a/src/constants/package.json
+++ b/src/constants/package.json
@@ -29,11 +29,13 @@
"umd"
],
"dependencies": {
+ "@babel/runtime": "^7.12.1",
"colorbrewer": "^1.5.0",
"d3-scale": "^3.2.3",
"global": "^4.3.0",
"keymirror": "^0.1.1",
- "react-map-gl-draw": "0.14.8"
+ "react-map-gl-draw": "0.14.8",
+ "@kepler.gl/types": "2.5.5"
},
"exports": {
".": "./dist/index.js",
diff --git a/src/deckgl-layers/babel.config.js b/src/deckgl-layers/babel.config.js
new file mode 100644
index 000000000..0672a8d63
--- /dev/null
+++ b/src/deckgl-layers/babel.config.js
@@ -0,0 +1,64 @@
+// Copyright (c) 2022 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.
+
+const KeplerPackage = require('./package');
+
+const PRESETS = ['@babel/preset-env', '@babel/preset-react', '@babel/preset-typescript'];
+const PLUGINS = [
+ ['@babel/plugin-transform-typescript', {isTSX: true, allowDeclareFields: true}],
+ '@babel/plugin-transform-modules-commonjs',
+ '@babel/plugin-proposal-optional-chaining',
+ [
+ '@babel/transform-runtime',
+ {
+ regenerator: true
+ }
+ ],
+ [
+ 'search-and-replace',
+ {
+ rules: [
+ {
+ search: '__PACKAGE_VERSION__',
+ replace: KeplerPackage.version
+ }
+ ]
+ }
+ ]
+];
+const ENV = {
+ test: {
+ plugins: ['istanbul']
+ },
+ debug: {
+ sourceMaps: 'inline',
+ retainLines: true
+ }
+};
+
+module.exports = function babel(api) {
+ api.cache(true);
+
+ return {
+ presets: PRESETS,
+ plugins: PLUGINS,
+ env: ENV
+ };
+};
diff --git a/src/deckgl-layers/package.json b/src/deckgl-layers/package.json
new file mode 100644
index 000000000..38a0031b2
--- /dev/null
+++ b/src/deckgl-layers/package.json
@@ -0,0 +1,66 @@
+{
+ "name": "@kepler.gl/deckgl-layers",
+ "author": "Shan He <[email protected]>",
+ "version": "2.5.5",
+ "description": "kepler.gl constants used by kepler.gl components, actions and reducers",
+ "license": "MIT",
+ "main": "dist/index.js",
+ "types": "dist/deckgl-layers/src/index.d.ts",
+ "keywords": [
+ "babel",
+ "es6",
+ "react",
+ "webgl",
+ "visualization",
+ "deck.gl"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/keplergl/kepler.gl.git"
+ },
+ "scripts": {
+ "build": "rm -fr dist && babel src --out-dir dist --source-maps inline --extensions '.ts,.tsx,.js,.jsx' --ignore '**/*.d.ts'",
+ "build:umd": "webpack --config ./webpack/umd.js --progress --env.prod",
+ "build:types": "tsc --project ./tsconfig.production.json",
+ "prepublish": "uber-licence && yarn build && yarn build:types"
+ },
+ "files": [
+ "dist",
+ "umd"
+ ],
+ "dependencies": {
+ "@danmarshall/deckgl-typings": "4.9.22",
+ "@deck.gl/aggregation-layers": "8.2.0",
+ "@deck.gl/core": "8.2.0",
+ "@deck.gl/extensions": "8.2.0",
+ "@deck.gl/geo-layers": "8.2.0",
+ "@deck.gl/layers": "8.2.0",
+ "@deck.gl/mesh-layers": "8.2.0",
+ "@deck.gl/react": "8.2.0",
+ "@luma.gl/constants": "^8.2.0",
+ "@luma.gl/core": "^8.2.0",
+ "@mapbox/geo-viewport": "^0.4.1",
+ "@mapbox/vector-tile": "^1.3.1",
+ "@types/geojson": "^7946.0.7",
+ "d3-array": "^2.8.0",
+ "global": "^4.3.0",
+ "keymirror": "^0.1.1",
+ "@kepler.gl/constants": "2.5.5",
+ "lodash.memoize": "^4.1.2"
+ },
+ "nyc": {
+ "sourceMap": false,
+ "instrument": false
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "maintainers": [
+ "Shan He <[email protected]>",
+ "Giuseppe Macri <[email protected]>"
+ ],
+ "volta": {
+ "node": "12.22.0",
+ "yarn": "1.22.17"
+ }
+}
diff --git a/src/deckgl-layers/3d-building-layer/3d-building-layer.ts b/src/deckgl-layers/src/3d-building-layer/3d-building-layer.ts
similarity index 100%
rename from src/deckgl-layers/3d-building-layer/3d-building-layer.ts
rename to src/deckgl-layers/src/3d-building-layer/3d-building-layer.ts
diff --git a/src/deckgl-layers/3d-building-layer/3d-building-utils.ts b/src/deckgl-layers/src/3d-building-layer/3d-building-utils.ts
similarity index 100%
rename from src/deckgl-layers/3d-building-layer/3d-building-utils.ts
rename to src/deckgl-layers/src/3d-building-layer/3d-building-utils.ts
diff --git a/src/deckgl-layers/3d-building-layer/types.ts b/src/deckgl-layers/src/3d-building-layer/types.ts
similarity index 100%
rename from src/deckgl-layers/3d-building-layer/types.ts
rename to src/deckgl-layers/src/3d-building-layer/types.ts
diff --git a/src/deckgl-layers/cluster-layer/cluster-layer.ts b/src/deckgl-layers/src/cluster-layer/cluster-layer.ts
similarity index 99%
rename from src/deckgl-layers/cluster-layer/cluster-layer.ts
rename to src/deckgl-layers/src/cluster-layer/cluster-layer.ts
index 3f686b8dc..408ca11d4 100644
--- a/src/deckgl-layers/cluster-layer/cluster-layer.ts
+++ b/src/deckgl-layers/src/cluster-layer/cluster-layer.ts
@@ -31,7 +31,7 @@ import CPUAggregator, {
import {getDistanceScales} from 'viewport-mercator-project';
import {max} from 'd3-array';
-import {LAYER_VIS_CONFIGS} from 'layers/layer-factory';
+import {LAYER_VIS_CONFIGS} from '../../../layers/layer-factory';
import {SCALE_TYPES, DEFAULT_COLOR_RANGE} from '@kepler.gl/constants';
import ClusterBuilder, {getGeoJSON} from '../layer-utils/cluster-utils';
import {RGBAColor} from '@kepler.gl/types';
diff --git a/src/deckgl-layers/column-layer/enhanced-column-layer.ts b/src/deckgl-layers/src/column-layer/enhanced-column-layer.ts
similarity index 96%
rename from src/deckgl-layers/column-layer/enhanced-column-layer.ts
rename to src/deckgl-layers/src/column-layer/enhanced-column-layer.ts
index 29f1919e6..69e98acd0 100644
--- a/src/deckgl-layers/column-layer/enhanced-column-layer.ts
+++ b/src/deckgl-layers/src/column-layer/enhanced-column-layer.ts
@@ -19,7 +19,7 @@
// THE SOFTWARE.
import {ColumnLayer} from '@deck.gl/layers';
-import {editShader} from '../../deckgl-layers/layer-utils/shader-utils';
+import {editShader} from '../';
function addInstanceCoverage(vs) {
const addDecl = editShader(
diff --git a/src/deckgl-layers/grid-layer/enhanced-cpu-grid-layer.ts b/src/deckgl-layers/src/grid-layer/enhanced-cpu-grid-layer.ts
similarity index 100%
rename from src/deckgl-layers/grid-layer/enhanced-cpu-grid-layer.ts
rename to src/deckgl-layers/src/grid-layer/enhanced-cpu-grid-layer.ts
diff --git a/src/deckgl-layers/hexagon-layer/enhanced-hexagon-layer.ts b/src/deckgl-layers/src/hexagon-layer/enhanced-hexagon-layer.ts
similarity index 100%
rename from src/deckgl-layers/hexagon-layer/enhanced-hexagon-layer.ts
rename to src/deckgl-layers/src/hexagon-layer/enhanced-hexagon-layer.ts
diff --git a/src/deckgl-layers/src/index.ts b/src/deckgl-layers/src/index.ts
new file mode 100644
index 000000000..459c283ed
--- /dev/null
+++ b/src/deckgl-layers/src/index.ts
@@ -0,0 +1,16 @@
+export {default as ThreeDBuildingLayer} from './3d-building-layer/3d-building-layer';
+
+export {default as DeckGLClusterLayer} from './cluster-layer/cluster-layer';
+
+export {default as EnhancedColumnLayer} from './column-layer/enhanced-column-layer';
+
+export {default as EnhancedGridLayer} from './grid-layer/enhanced-cpu-grid-layer';
+
+export {default as EnhancedHexagonLayer} from './hexagon-layer/enhanced-hexagon-layer';
+export {default as EnhancedLineLayer} from './line-layer/line-layer';
+export {default as SvgIconLayer} from './svg-icon-layer/svg-icon-layer';
+
+export * from './layer-utils/shader-utils';
+
+export * from './3d-building-layer/types';
+export * from './3d-building-layer/3d-building-utils';
diff --git a/src/deckgl-layers/layer-utils/cluster-utils.ts b/src/deckgl-layers/src/layer-utils/cluster-utils.ts
similarity index 100%
rename from src/deckgl-layers/layer-utils/cluster-utils.ts
rename to src/deckgl-layers/src/layer-utils/cluster-utils.ts
diff --git a/src/deckgl-layers/layer-utils/cpu-aggregator.ts b/src/deckgl-layers/src/layer-utils/cpu-aggregator.ts
similarity index 99%
rename from src/deckgl-layers/layer-utils/cpu-aggregator.ts
rename to src/deckgl-layers/src/layer-utils/cpu-aggregator.ts
index 4a0669040..a9cce6138 100644
--- a/src/deckgl-layers/layer-utils/cpu-aggregator.ts
+++ b/src/deckgl-layers/src/layer-utils/cpu-aggregator.ts
@@ -22,7 +22,7 @@
import {AGGREGATION_OPERATION, _BinSorter as BinSorter} from '@deck.gl/aggregation-layers';
import {console as Console} from 'global/window';
-import {aggregate} from '../../utils/aggregate-utils';
+import {aggregate} from '../../../utils/aggregate-utils';
import {AGGREGATION_TYPES, SCALE_FUNC} from '@kepler.gl/constants';
import {RGBAColor} from '@kepler.gl/types';
@@ -380,7 +380,7 @@ export const defaultElevationDimension: DimensionType<number> = {
export const defaultDimensions = [defaultColorDimension, defaultElevationDimension];
-export type CPUAggregatorState = {layerData: {data?}; dimensions: {}; geoJSON?, clusterBuilder?};
+export type CPUAggregatorState = {layerData: {data?}; dimensions: {}; geoJSON?; clusterBuilder?};
export default class CPUAggregator {
static getDimensionScale: any;
diff --git a/src/deckgl-layers/layer-utils/shader-utils.ts b/src/deckgl-layers/src/layer-utils/shader-utils.ts
similarity index 100%
rename from src/deckgl-layers/layer-utils/shader-utils.ts
rename to src/deckgl-layers/src/layer-utils/shader-utils.ts
diff --git a/src/deckgl-layers/line-layer/line-layer.ts b/src/deckgl-layers/src/line-layer/line-layer.ts
similarity index 98%
rename from src/deckgl-layers/line-layer/line-layer.ts
rename to src/deckgl-layers/src/line-layer/line-layer.ts
index 98115fef5..9233539b5 100644
--- a/src/deckgl-layers/line-layer/line-layer.ts
+++ b/src/deckgl-layers/src/line-layer/line-layer.ts
@@ -21,7 +21,7 @@
import {LineLayer, LineLayerProps} from '@deck.gl/layers';
import GL from '@luma.gl/constants';
import {RGBAColor} from 'deck.gl';
-import {editShader} from '../../deckgl-layers/layer-utils/shader-utils';
+import {editShader} from '../';
const defaultProps = {
...LineLayer.defaultProps,
diff --git a/src/deckgl-layers/svg-icon-layer/scatterplot-icon-layer.ts b/src/deckgl-layers/src/svg-icon-layer/scatterplot-icon-layer.ts
similarity index 100%
rename from src/deckgl-layers/svg-icon-layer/scatterplot-icon-layer.ts
rename to src/deckgl-layers/src/svg-icon-layer/scatterplot-icon-layer.ts
diff --git a/src/deckgl-layers/svg-icon-layer/svg-icon-layer.ts b/src/deckgl-layers/src/svg-icon-layer/svg-icon-layer.ts
similarity index 100%
rename from src/deckgl-layers/svg-icon-layer/svg-icon-layer.ts
rename to src/deckgl-layers/src/svg-icon-layer/svg-icon-layer.ts
diff --git a/src/deckgl-layers/src/typedefs/deckgl.d.ts b/src/deckgl-layers/src/typedefs/deckgl.d.ts
new file mode 100644
index 000000000..bdfd40579
--- /dev/null
+++ b/src/deckgl-layers/src/typedefs/deckgl.d.ts
@@ -0,0 +1,25 @@
+// Copyright (c) 2022 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 * as DeckTypings from '@danmarshall/deckgl-typings';
+
+declare module 'deck.gl' {
+ export namespace DeckTypings {}
+}
diff --git a/src/deckgl-layers/tsconfig.production.json b/src/deckgl-layers/tsconfig.production.json
new file mode 100644
index 000000000..80e1fe48b
--- /dev/null
+++ b/src/deckgl-layers/tsconfig.production.json
@@ -0,0 +1,33 @@
+{
+ "compilerOptions": {
+ "target": "es2020",
+ "allowJs": false,
+ "checkJs": false,
+ "jsx": "react",
+ "module": "esnext",
+ "moduleResolution": "node",
+ "declaration":true,
+ "emitDeclarationOnly":true,
+ "noImplicitAny": false,
+ "noImplicitReturns": true,
+ "noImplicitThis": true,
+ "noUnusedLocals": true,
+ "outDir": "dist",
+ "sourceMap": true,
+ "strictNullChecks": true,
+ "suppressImplicitAnyIndexErrors": false,
+ "esModuleInterop": true,
+ "allowSyntheticDefaultImports": true,
+ "skipLibCheck": true,
+ "strict": true,
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "baseUrl": "../../src", //TODO change once all dependencies are isolated
+ "paths": {
+ "@kepler.gl/deckgl-layers": ["deckgl-layers/src"] //TODO change once all dependencies are isolated
+ }
+ },
+ "include": [
+ "src"
+ ]
+}
diff --git a/src/deckgl-layers/webpack/umd.js b/src/deckgl-layers/webpack/umd.js
new file mode 100644
index 000000000..3eb025d5e
--- /dev/null
+++ b/src/deckgl-layers/webpack/umd.js
@@ -0,0 +1,120 @@
+// Copyright (c) 2022 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.
+
+const resolve = require('path').resolve;
+const join = require('path').join;
+
+// Import package.json to read version
+const KeplerPackage = require('../package');
+
+const SRC_DIR = resolve(__dirname, '../src');
+const OUTPUT_DIR = resolve(__dirname, '../umd');
+
+const LIBRARY_BUNDLE_CONFIG = env => ({
+ entry: {
+ KeplerGl: join(SRC_DIR, 'index.ts')
+ },
+
+ // Silence warnings about big bundles
+ stats: {
+ warnings: false
+ },
+
+ output: {
+ // Generate the bundle in dist folder
+ path: OUTPUT_DIR,
+ filename: 'keplergl.min.js',
+ globalObject: 'this',
+ library: '[name]',
+ libraryTarget: 'umd'
+ },
+
+ // let's put everything in
+ externals: {
+ react: {
+ root: 'React',
+ commonjs2: 'react',
+ commonjs: 'react',
+ amd: 'react',
+ umd: 'react'
+ },
+ 'react-dom': {
+ root: 'ReactDOM',
+ commonjs2: 'react-dom',
+ commonjs: 'react-dom',
+ amd: 'react-dom',
+ umd: 'react-dom'
+ },
+ redux: {
+ root: 'Redux',
+ commonjs2: 'redux',
+ commonjs: 'redux',
+ amd: 'redux',
+ umd: 'redux'
+ },
+ 'react-redux': {
+ root: 'ReactRedux',
+ commonjs2: 'react-redux',
+ commonjs: 'react-redux',
+ amd: 'react-redux',
+ umd: 'react-redux'
+ },
+ 'styled-components': {
+ commonjs: 'styled-components',
+ commonjs2: 'styled-components',
+ amd: 'styled-components',
+ root: 'styled'
+ }
+ },
+ resolve: {
+ extensions: ['.tsx', '.ts', '.js'],
+ modules: ['node_modules', SRC_DIR]
+ },
+ module: {
+ rules: [
+ {
+ test: /\.(js|ts|tsx)$/,
+ loader: 'babel-loader',
+ include: [SRC_DIR],
+ options: {
+ plugins: [
+ [
+ 'search-and-replace',
+ {
+ rules: [
+ {
+ search: '__PACKAGE_VERSION__',
+ replace: KeplerPackage.version
+ }
+ ]
+ }
+ ]
+ ]
+ }
+ }
+ ]
+ },
+
+ node: {
+ fs: 'empty'
+ }
+});
+
+module.exports = env => LIBRARY_BUNDLE_CONFIG(env);
diff --git a/src/layers/cluster-layer/cluster-layer.ts b/src/layers/cluster-layer/cluster-layer.ts
index 59e50ef3a..0f381b56f 100644
--- a/src/layers/cluster-layer/cluster-layer.ts
+++ b/src/layers/cluster-layer/cluster-layer.ts
@@ -21,7 +21,7 @@
import AggregationLayer, {AggregationLayerConfig} from '../aggregation-layer';
import {ScatterplotLayer} from '@deck.gl/layers';
-import DeckGLClusterLayer from 'deckgl-layers/cluster-layer/cluster-layer';
+import {DeckGLClusterLayer} from '@kepler.gl/deckgl-layers';
import {CHANNEL_SCALES} from '@kepler.gl/constants';
import ClusterLayerIcon from './cluster-layer-icon';
import {
diff --git a/src/layers/grid-layer/grid-layer.ts b/src/layers/grid-layer/grid-layer.ts
index 6d42339d8..88066e760 100644
--- a/src/layers/grid-layer/grid-layer.ts
+++ b/src/layers/grid-layer/grid-layer.ts
@@ -19,7 +19,7 @@
// THE SOFTWARE.
import {GeoJsonLayer} from '@deck.gl/layers';
-import EnhancedGridLayer from '../../deckgl-layers/grid-layer/enhanced-cpu-grid-layer';
+import {EnhancedGridLayer} from '@kepler.gl/deckgl-layers';
import AggregationLayer, {AggregationLayerConfig} from '../aggregation-layer';
import {pointToPolygonGeo} from './grid-utils';
import GridLayerIcon from './grid-layer-icon';
diff --git a/src/layers/h3-hexagon-layer/h3-hexagon-layer.ts b/src/layers/h3-hexagon-layer/h3-hexagon-layer.ts
index 004903e37..c6616cae6 100644
--- a/src/layers/h3-hexagon-layer/h3-hexagon-layer.ts
+++ b/src/layers/h3-hexagon-layer/h3-hexagon-layer.ts
@@ -28,7 +28,7 @@ import Layer, {
import {findDefaultColorField} from 'utils/dataset-utils';
import {GeoJsonLayer} from '@deck.gl/layers';
import {H3HexagonLayer} from '@deck.gl/geo-layers';
-import EnhancedColumnLayer from 'deckgl-layers/column-layer/enhanced-column-layer';
+import {EnhancedColumnLayer} from '@kepler.gl/deckgl-layers';
import {getCentroid, idToPolygonGeo, h3IsValid, getHexFields, Centroid} from './h3-utils';
import H3HexagonLayerIcon from './h3-hexagon-layer-icon';
import {CHANNEL_SCALES, HIGHLIGH_COLOR_3D, ColorRange} from '@kepler.gl/constants';
diff --git a/src/layers/hexagon-layer/hexagon-layer.ts b/src/layers/hexagon-layer/hexagon-layer.ts
index 38f37fa99..1b6c577e3 100644
--- a/src/layers/hexagon-layer/hexagon-layer.ts
+++ b/src/layers/hexagon-layer/hexagon-layer.ts
@@ -20,7 +20,7 @@
import {GeoJsonLayer} from '@deck.gl/layers';
import AggregationLayer, {AggregationLayerConfig} from '../aggregation-layer';
-import EnhancedHexagonLayer from 'deckgl-layers/hexagon-layer/enhanced-hexagon-layer';
+import {EnhancedHexagonLayer} from '@kepler.gl/deckgl-layers';
import {hexagonToPolygonGeo} from './hexagon-utils';
import HexagonLayerIcon from './hexagon-layer-icon';
import {clamp} from 'utils/data-utils';
diff --git a/src/layers/icon-layer/icon-layer.ts b/src/layers/icon-layer/icon-layer.ts
index 3a5aab802..e1487a81b 100644
--- a/src/layers/icon-layer/icon-layer.ts
+++ b/src/layers/icon-layer/icon-layer.ts
@@ -21,7 +21,7 @@
import window from 'global/window';
import {BrushingExtension} from '@deck.gl/extensions';
-import SvgIconLayer from 'deckgl-layers/svg-icon-layer/svg-icon-layer';
+import {SvgIconLayer} from '@kepler.gl/deckgl-layers';
import IconLayerIcon from './icon-layer-icon';
import {ICON_FIELDS, CLOUDFRONT} from '@kepler.gl/constants';
import IconInfoModalFactory from './icon-info-modal';
diff --git a/src/layers/line-layer/line-layer.ts b/src/layers/line-layer/line-layer.ts
index 2c94ba84b..062afd6b8 100644
--- a/src/layers/line-layer/line-layer.ts
+++ b/src/layers/line-layer/line-layer.ts
@@ -23,7 +23,7 @@ import {BrushingExtension} from '@deck.gl/extensions';
import {LAYER_VIS_CONFIGS} from 'layers/layer-factory';
import LineLayerIcon from './line-layer-icon';
import ArcLayer, {ArcLayerConfig} from '../arc-layer/arc-layer';
-import EnhancedLineLayer from 'deckgl-layers/line-layer/line-layer';
+import {EnhancedLineLayer} from '@kepler.gl/deckgl-layers';
import {LayerColumn} from '../base-layer';
import {
VisConfigColorRange,
diff --git a/src/layers/types.ts b/src/layers/types.ts
index 80e2e0281..860038769 100644
--- a/src/layers/types.ts
+++ b/src/layers/types.ts
@@ -1,25 +1,25 @@
import keyMirror from 'keymirror';
export const LAYER_TYPES = keyMirror({
- point: null,
- arc: null,
- line: null,
- grid: null,
- hexagon: null,
- geojson: null,
- cluster: null,
- icon: null,
- heatmap: null,
- hexagonId: null,
- '3D': null,
- trip: null,
- s2: null
- });
-
- export const EDITOR_AVAILABLE_LAYERS: string[] = [
- LAYER_TYPES.point,
- LAYER_TYPES.hexagon,
- LAYER_TYPES.arc,
- LAYER_TYPES.line,
- LAYER_TYPES.hexagonId
- ];
\ No newline at end of file
+ point: null,
+ arc: null,
+ line: null,
+ grid: null,
+ hexagon: null,
+ geojson: null,
+ cluster: null,
+ icon: null,
+ heatmap: null,
+ hexagonId: null,
+ '3D': null,
+ trip: null,
+ s2: null
+});
+
+export const EDITOR_AVAILABLE_LAYERS: string[] = [
+ LAYER_TYPES.point,
+ LAYER_TYPES.hexagon,
+ LAYER_TYPES.arc,
+ LAYER_TYPES.line,
+ LAYER_TYPES.hexagonId
+];
diff --git a/src/reducers/vis-state-updaters.ts b/src/reducers/vis-state-updaters.ts
index 55700aee4..6d72bd228 100644
--- a/src/reducers/vis-state-updaters.ts
+++ b/src/reducers/vis-state-updaters.ts
@@ -83,12 +83,7 @@ import {
import {Layer, LayerClasses, LayerClassesType, LAYER_ID_LENGTH} from 'layers';
import {DEFAULT_TEXT_LABEL} from 'layers/layer-factory';
-import {
- EDITOR_MODES,
- SORT_ORDER,
- FILTER_TYPES,
- MAX_DEFAULT_TOOLTIPS
-} from '@kepler.gl/constants';
+import {EDITOR_MODES, SORT_ORDER, FILTER_TYPES, MAX_DEFAULT_TOOLTIPS} from '@kepler.gl/constants';
import {ActionTypes} from 'actions';
import {pick_, merge_, swap_} from './composer-helpers';
import {processFileContent} from 'actions/vis-state-actions';
diff --git a/src/utils/export-utils.ts b/src/utils/export-utils.ts
index 4af5df14e..90f6bdc5e 100644
--- a/src/utils/export-utils.ts
+++ b/src/utils/export-utils.ts
@@ -36,6 +36,7 @@ import {set, generateHashId} from 'utils/utils';
import {createIndexedDataContainer} from './table-utils/data-container-utils';
import {ExportImage} from 'reducers/ui-state-updaters';
+import {VisState} from 'reducers';
/**
* Default file names
@@ -208,7 +209,12 @@ export function exportHtml(state, options) {
downloadFile(fileBlob, state.appName ? `${state.appName}.html` : DEFAULT_HTML_NAME);
}
-export function exportData(state, options) {
+interface StateType {
+ visState: VisState;
+ appName?: string;
+}
+
+export function exportData(state: StateType, options) {
const {visState, appName} = state;
const {datasets} = visState;
const {selectedDataset, dataType, filtered} = options;
diff --git a/src/utils/filter-utils.ts b/src/utils/filter-utils.ts
index d7772bb5c..381bd788a 100644
--- a/src/utils/filter-utils.ts
+++ b/src/utils/filter-utils.ts
@@ -27,12 +27,7 @@ import isEqual from 'lodash.isequal';
import booleanWithin from '@turf/boolean-within';
import {point as turfPoint} from '@turf/helpers';
import {Decimal} from 'decimal.js';
-import {
- ALL_FIELD_TYPES,
- FILTER_TYPES,
- ANIMATION_WINDOW,
- PLOT_TYPES
-} from '@kepler.gl/constants';
+import {ALL_FIELD_TYPES, FILTER_TYPES, ANIMATION_WINDOW, PLOT_TYPES} from '@kepler.gl/constants';
import {LAYER_TYPES} from 'layers/types';
import {notNullorUndefined, unique, timeToUnixMilli} from './data-utils';
import * as ScaleUtils from './data-scale-utils';