UNPKG

kepler.gl

Version:

kepler.gl is a webgl based application to visualize large scale location data in the browser

582 lines (576 loc) 102 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _typeof3 = require("@babel/runtime/helpers/typeof"); Object.defineProperty(exports, "__esModule", { value: true }); exports.geoCoderPanelSelector = exports["default"] = exports.datasetAttributionSelector = exports.bottomWidgetSelector = exports.attributionSelector = exports.DEFAULT_KEPLER_GL_PROPS = void 0; exports.getVisibleDatasets = getVisibleDatasets; exports.isViewportDisjointed = exports.isSplitSelector = void 0; exports.makeGetActionCreators = makeGetActionCreators; exports.mapStateSelector = exports.mapFieldsSelector = void 0; exports.mapStateToProps = mapStateToProps; exports.sidePanelSelector = exports.plotContainerSelector = exports.notificationPanelSelector = exports.modalContainerSelector = void 0; var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")); var _react = _interopRequireWildcard(require("react")); var _console = _interopRequireDefault(require("global/console")); var _redux = require("redux"); var _isPropValid = _interopRequireDefault(require("@emotion/is-prop-valid")); var _styledComponents = _interopRequireWildcard(require("styled-components")); var _reselect = require("reselect"); var _keplerglConnect = require("./connect/keplergl-connect"); var _reactIntl = require("react-intl"); var _localization = require("@kepler.gl/localization"); var _context = require("./context"); var _actions = require("@kepler.gl/actions"); var _commonUtils = require("@kepler.gl/common-utils"); var _constants = require("@kepler.gl/constants"); var _sidePanel = _interopRequireDefault(require("./side-panel")); var _mapContainer2 = _interopRequireDefault(require("./map-container")); var _mapsLayout = _interopRequireDefault(require("./maps-layout")); var _bottomWidget = _interopRequireDefault(require("./bottom-widget")); var _modalContainer = _interopRequireDefault(require("./modal-container")); var _plotContainer = _interopRequireDefault(require("./plot-container")); var _notificationPanel = _interopRequireDefault(require("./notification-panel")); var _geocoderPanel = _interopRequireDefault(require("./geocoder-panel")); var _effectManager = _interopRequireDefault(require("./effects/effect-manager")); var _dndContext = _interopRequireDefault(require("./dnd-context")); var _useCloudListProvider = require("./hooks/use-cloud-list-provider"); var _utils = require("@kepler.gl/utils"); var _styles = require("@kepler.gl/styles"); var _templateObject; // SPDX-License-Identifier: MIT // Copyright contributors to the kepler.gl project function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; } function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // This implements the default behavior from styled-components v5 function shouldForwardProp(propName, target) { if (typeof target === 'string') { // For HTML elements, forward the prop if it is a valid HTML attribute return (0, _isPropValid["default"])(propName); } // For other elements, forward all props return true; } // Maybe we should think about exporting this or creating a variable // as part of the base.js theme var GlobalStyle = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n\n *,\n *:before,\n *:after {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n ul {\n margin: 0;\n padding: 0;\n }\n\n li {\n margin: 0;\n }\n\n a {\n text-decoration: none;\n color: ", ";\n }\n\n .maplibregl-ctrl .maplibregl-ctrl-logo {\n display: none;\n }\n\n .mapboxgl-ctrl .mapboxgl-ctrl-logo {\n display: none;\n }\n"])), function (props) { return props.theme.fontFamily; }, function (props) { return props.theme.fontWeight; }, function (props) { return props.theme.fontSize; }, function (props) { return props.theme.lineHeight; }, function (props) { return props.theme.labelColor; }); var BottomWidgetOuter = _styledComponents["default"].div(function (_ref) { var absolute = _ref.absolute; return "\n ".concat(absolute ? 'position: absolute; bottom: 0; right: 0;' : '', "\n pointer-events: none; /* prevent padding from blocking input */\n & > * {\n /* all children should allow input */\n pointer-events: all;\n }"); }); var isViewportDisjointed = exports.isViewportDisjointed = function isViewportDisjointed(props) { return props.mapState.isSplit && !props.mapState.isViewportSynced && props.mapState.splitMapViewports.length > 1; }; var mapStateSelector = exports.mapStateSelector = function mapStateSelector(props, index) { if (!Number.isFinite(index)) { // either no index arg or an invalid index was provided // it is expected to be either 0 or 1 when in split mode // only use the mapState return props.mapState; } return isViewportDisjointed(props) ? // mix together the viewport properties intended for this disjointed <MapContainer> with the other necessary mapState properties _objectSpread(_objectSpread({}, props.mapState), props.mapState.splitMapViewports[index]) : // otherwise only use the mapState props.mapState; }; var mapFieldsSelector = exports.mapFieldsSelector = function mapFieldsSelector(props) { var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; return { getMapboxRef: props.getMapboxRef, mapboxApiAccessToken: props.mapboxApiAccessToken, mapboxApiUrl: props.mapboxApiUrl ? props.mapboxApiUrl : DEFAULT_KEPLER_GL_PROPS.mapboxApiUrl, mapState: mapStateSelector(props, index), datasetAttributions: attributionSelector(props).sources, mapStyle: props.mapStyle, onDeckInitialized: props.onDeckInitialized, onViewStateChange: props.onViewStateChange, onMouseMove: props.onMouseMove, deckGlProps: props.deckGlProps, uiStateActions: props.uiStateActions, visStateActions: props.visStateActions, mapStateActions: props.mapStateActions, // visState visState: props.visState, // uiState activeSidePanel: props.uiState.activeSidePanel, mapControls: props.uiState.mapControls, readOnly: props.uiState.readOnly, locale: props.uiState.locale, isLoadingIndicatorVisible: Number(props.uiState.loadingIndicatorValue) > 0, sidePanelWidth: props.sidePanelWidth ? props.sidePanelWidth : DEFAULT_KEPLER_GL_PROPS.width, // mapStyle topMapContainerProps: props.topMapContainerProps, bottomMapContainerProps: props.bottomMapContainerProps, // transformRequest for Mapbox basemaps transformRequest: props.transformRequest }; }; function getVisibleDatasets(datasets) { // We don't want Geocoder dataset to be present in SidePanel dataset list return (0, _utils.filterObjectByPredicate)(datasets, function (key) { return key !== _constants.GEOCODER_DATASET_NAME; }); } var sidePanelSelector = exports.sidePanelSelector = function sidePanelSelector(props, availableProviders, filteredDatasets) { return { appName: props.appName ? props.appName : DEFAULT_KEPLER_GL_PROPS.appName, version: props.version ? props.version : DEFAULT_KEPLER_GL_PROPS.version, appWebsite: props.appWebsite, mapStyle: props.mapStyle, onSaveMap: props.onSaveMap, uiState: props.uiState, mapStyleActions: props.mapStyleActions, visStateActions: props.visStateActions, uiStateActions: props.uiStateActions, mapStateActions: props.mapStateActions, datasets: filteredDatasets, filters: props.visState.filters, layers: props.visState.layers, layerOrder: props.visState.layerOrder, layerClasses: props.visState.layerClasses, interactionConfig: props.visState.interactionConfig, mapInfo: props.visState.mapInfo, layerBlending: props.visState.layerBlending, overlayBlending: props.visState.overlayBlending, width: props.sidePanelWidth ? props.sidePanelWidth : DEFAULT_KEPLER_GL_PROPS.width, availableProviders: availableProviders, mapSaved: props.providerState.mapSaved }; }; var plotContainerSelector = exports.plotContainerSelector = function plotContainerSelector(props) { return { width: props.width, height: props.height, exportImageSetting: props.uiState.exportImage, mapFields: mapFieldsSelector(props), addNotification: props.uiStateActions.addNotification, setExportImageSetting: props.uiStateActions.setExportImageSetting, setExportImageDataUri: props.uiStateActions.setExportImageDataUri, setExportImageError: props.uiStateActions.setExportImageError, splitMaps: props.visState.splitMaps }; }; var isSplitSelector = exports.isSplitSelector = function isSplitSelector(props) { return props.visState.splitMaps && props.visState.splitMaps.length > 1; }; var bottomWidgetSelector = exports.bottomWidgetSelector = function bottomWidgetSelector(props, theme) { return { filters: props.visState.filters, datasets: props.visState.datasets, uiState: props.uiState, layers: props.visState.layers, animationConfig: props.visState.animationConfig, visStateActions: props.visStateActions, toggleModal: props.uiStateActions.toggleModal, sidePanelWidth: props.uiState.readOnly ? 0 : props.sidePanelWidth + theme.sidePanel.margin.left }; }; var modalContainerSelector = exports.modalContainerSelector = function modalContainerSelector(props, rootNode) { return { appName: props.appName ? props.appName : DEFAULT_KEPLER_GL_PROPS.appName, mapStyle: props.mapStyle, visState: props.visState, mapState: props.mapState, uiState: props.uiState, providerState: props.providerState, mapboxApiAccessToken: props.mapboxApiAccessToken, mapboxApiUrl: props.mapboxApiUrl, visStateActions: props.visStateActions, uiStateActions: props.uiStateActions, mapStyleActions: props.mapStyleActions, providerActions: props.providerActions, rootNode: rootNode, // User defined cloud provider props cloudProviders: props.cloudProviders ? props.cloudProviders : DEFAULT_KEPLER_GL_PROPS.cloudProviders, onExportToCloudSuccess: props.onExportToCloudSuccess, onLoadCloudMapSuccess: props.onLoadCloudMapSuccess, onLoadCloudMapError: props.onLoadCloudMapError, onExportToCloudError: props.onExportToCloudError }; }; var geoCoderPanelSelector = exports.geoCoderPanelSelector = function geoCoderPanelSelector(props, dimensions) { return { isGeocoderEnabled: props.visState.interactionConfig.geocoder.enabled, mapboxApiAccessToken: props.mapboxApiAccessToken, mapState: props.mapState, uiState: props.uiState, layerOrder: props.visState.layerOrder, updateVisData: props.visStateActions.updateVisData, removeDataset: props.visStateActions.removeDataset, updateMap: props.mapStateActions.updateMap, appWidth: dimensions.width }; }; /** * Returns array of unique dataset attributions, each with title and url properties. */ var datasetAttributionSelector = exports.datasetAttributionSelector = (0, _reselect.createSelector)([function (state) { return state.visState.datasets; }], function (datasets) { var uniqueAttributions = []; Object.keys(datasets).forEach(function (key) { var _ds$metadata; var ds = datasets[key]; var attributions = ds === null || ds === void 0 || (_ds$metadata = ds.metadata) === null || _ds$metadata === void 0 ? void 0 : _ds$metadata.attributions; if (Array.isArray(attributions)) { attributions.forEach(function (attribution) { if (typeof attribution === 'string') { // attribution can be a raw string or a string with link tags var links = attribution.match(/<a[^]+?a>/g); if (links) { try { links === null || links === void 0 || links.forEach(function (link) { var _link$match, _link$match2; var href = (_link$match = link.match(/href="([^"]*)/)) === null || _link$match === void 0 ? void 0 : _link$match[1]; var title = (_link$match2 = link.match(/title="([^"]*)/)) === null || _link$match2 === void 0 ? void 0 : _link$match2[1]; if (href && title) { uniqueAttributions.push({ title: "".concat(link.indexOf('&copy;') >= 0 ? '© ' : '').concat(title), url: href }); } }); } catch (error) { // just ignore for now } } else { uniqueAttributions.push({ title: attribution, url: null }); } } }); } }); return uniqueAttributions; }); /** * Deduplicated dataset and layer text attributions and logos. * Returns text attributions and logos to display. */ var attributionSelector = exports.attributionSelector = (0, _reselect.createSelector)([datasetAttributionSelector], function (datasetAttributions) { // TODO collect attributions from layers, and merge with dataset attributions here var uniqueTextAttributions = datasetAttributions; var logos = []; return { sources: uniqueTextAttributions, logos: logos }; }); var notificationPanelSelector = exports.notificationPanelSelector = function notificationPanelSelector(props) { return { removeNotification: props.uiStateActions.removeNotification, notifications: props.uiState.notifications }; }; var DEFAULT_KEPLER_GL_PROPS = exports.DEFAULT_KEPLER_GL_PROPS = { mapStyles: [], mapStylesReplaceDefault: false, mapboxApiUrl: _constants.DEFAULT_MAPBOX_API_URL, width: 800, height: 800, appName: _constants.KEPLER_GL_NAME, version: _constants.KEPLER_GL_VERSION, sidePanelWidth: _constants.DIMENSIONS.sidePanel.width, theme: {}, cloudProviders: [], readOnly: false, featureFlags: {} }; KeplerGlFactory.deps = [_bottomWidget["default"], _geocoderPanel["default"], _mapContainer2["default"], _mapsLayout["default"], _modalContainer["default"], _sidePanel["default"], _plotContainer["default"], _notificationPanel["default"], _dndContext["default"], _effectManager["default"]]; function KeplerGlFactory(BottomWidget, GeoCoderPanel, MapContainer, MapsLayout, ModalContainer, SidePanel, PlotContainer, NotificationPanel, DndContext) { /** @typedef {import('./kepler-gl').UnconnectedKeplerGlProps} KeplerGlProps */ /** @augments React.Component<KeplerGlProps> */ var KeplerGL = /*#__PURE__*/function (_Component) { function KeplerGL() { var _this; (0, _classCallCheck2["default"])(this, KeplerGL); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _callSuper(this, KeplerGL, [].concat(args)); (0, _defineProperty2["default"])(_this, "state", { dimensions: null }); (0, _defineProperty2["default"])(_this, "_handleResize", function (dimensions) { _this.setState({ dimensions: dimensions }); }); (0, _defineProperty2["default"])(_this, "root", /*#__PURE__*/(0, _react.createRef)()); (0, _defineProperty2["default"])(_this, "bottomWidgetRef", /*#__PURE__*/(0, _react.createRef)()); /* selectors */ (0, _defineProperty2["default"])(_this, "themeSelector", function (props) { return props.theme; }); (0, _defineProperty2["default"])(_this, "availableThemeSelector", (0, _reselect.createSelector)(_this.themeSelector, function (theme) { return (0, _typeof2["default"])(theme) === 'object' ? _objectSpread(_objectSpread({}, _styles.theme), theme) : theme === _constants.THEME.light ? _styles.themeLT : theme === _constants.THEME.base ? _styles.themeBS : theme; })); (0, _defineProperty2["default"])(_this, "datasetsSelector", function (props) { return props.visState.datasets; }); (0, _defineProperty2["default"])(_this, "filteredDatasetsSelector", (0, _reselect.createSelector)(_this.datasetsSelector, getVisibleDatasets)); (0, _defineProperty2["default"])(_this, "availableProviders", (0, _reselect.createSelector)(function (props) { return props.cloudProviders; }, function (providers) { return Array.isArray(providers) && providers.length ? { hasStorage: providers.some(function (p) { return p.hasPrivateStorage(); }), hasShare: providers.some(function (p) { return p.hasSharingUrl(); }) } : {}; })); (0, _defineProperty2["default"])(_this, "localeMessagesSelector", (0, _reselect.createSelector)(function (props) { return props.localeMessages; }, function (customMessages) { return customMessages ? (0, _utils.mergeMessages)(_localization.messages, customMessages) : _localization.messages; })); (0, _defineProperty2["default"])(_this, "_loadMapStyle", function () { var defaultStyles = Object.values(_this.props.mapStyle.mapStyles); // add id to custom map styles if not given var customStyles = (_this.props.mapStyles || []).map(function (ms) { return _objectSpread(_objectSpread({}, ms), {}, { id: ms.id || (0, _commonUtils.generateHashId)() }); }); var allStyles = [].concat((0, _toConsumableArray2["default"])(customStyles), defaultStyles).reduce(function (accu, style) { accu[style.id] = style; return accu; }, {}); _this.props.mapStyleActions.loadMapStyles(allStyles); }); (0, _defineProperty2["default"])(_this, "_deleteMapLabels", function (containerId, layerId) { _this.props.visStateActions.toggleLayerForMap(containerId, layerId); }); return _this; } (0, _inherits2["default"])(KeplerGL, _Component); return (0, _createClass2["default"])(KeplerGL, [{ key: "componentDidMount", value: function componentDidMount() { var _getApplicationConfig; if (((_getApplicationConfig = (0, _utils.getApplicationConfig)().baseMapLibraryConfig) === null || _getApplicationConfig === void 0 || (_getApplicationConfig = _getApplicationConfig['mapbox']) === null || _getApplicationConfig === void 0 ? void 0 : _getApplicationConfig.mapLibName) === 'Mapbox') { this._validateMapboxToken(); } this._loadMapStyle(); if (typeof this.props.onKeplerGlInitialized === 'function') { this.props.onKeplerGlInitialized(); } if (this.root.current instanceof HTMLElement) { (0, _utils.observeDimensions)(this.root.current, this._handleResize); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { if (this.root.current instanceof HTMLElement) { (0, _utils.unobserveDimensions)(this.root.current); } } }, { key: "_validateMapboxToken", value: /* private methods */ function _validateMapboxToken() { var mapboxApiAccessToken = this.props.mapboxApiAccessToken; if (!(0, _utils.validateToken)(mapboxApiAccessToken)) { _console["default"].warn(_constants.MISSING_MAPBOX_TOKEN); } } }, { key: "render", value: // eslint-disable-next-line complexity function render() { var _this2 = this; var _this$props = this.props, _this$props$id = _this$props.id, id = _this$props$id === void 0 ? 'map' : _this$props$id, _this$props$width = _this$props.width, width = _this$props$width === void 0 ? DEFAULT_KEPLER_GL_PROPS.width : _this$props$width, _this$props$height = _this$props.height, height = _this$props$height === void 0 ? DEFAULT_KEPLER_GL_PROPS.height : _this$props$height, uiState = _this$props.uiState, visState = _this$props.visState, readOnly = _this$props.readOnly, featureFlags = _this$props.featureFlags, _this$props$cloudProv = _this$props.cloudProviders, cloudProviders = _this$props$cloudProv === void 0 ? [] : _this$props$cloudProv; var dimensions = this.state.dimensions || { width: width, height: height }; var splitMaps = visState.splitMaps, interactionConfig = visState.interactionConfig; var isSplit = isSplitSelector(this.props); var theme = this.availableThemeSelector(this.props); var localeMessages = this.localeMessagesSelector(this.props); var isExportingImage = uiState.exportImage.exporting; var availableProviders = this.availableProviders(this.props); var filteredDatasets = this.filteredDatasetsSelector(this.props); var sideFields = sidePanelSelector(this.props, availableProviders, filteredDatasets); var plotContainerFields = plotContainerSelector(this.props); var bottomWidgetFields = bottomWidgetSelector(this.props, theme); var modalContainerFields = modalContainerSelector(this.props, this.root.current); var geoCoderPanelFields = geoCoderPanelSelector(this.props, dimensions); var notificationPanelFields = notificationPanelSelector(this.props); var mapContainers = !isSplit ? [/*#__PURE__*/_react["default"].createElement(MapContainer, (0, _extends2["default"])({ primary: true, key: 0, index: 0 }, mapFieldsSelector(this.props), { containerId: 0, deleteMapLabels: this._deleteMapLabels }))] : splitMaps.map(function (settings, index) { return /*#__PURE__*/_react["default"].createElement(MapContainer, (0, _extends2["default"])({ key: index, index: index, primary: index === 1 }, mapFieldsSelector(_this2.props, index), { containerId: index, deleteMapLabels: _this2._deleteMapLabels })); }); return /*#__PURE__*/_react["default"].createElement(_context.RootContext.Provider, { value: this.root }, /*#__PURE__*/_react["default"].createElement(_context.FeatureFlagsContextProvider, { featureFlags: featureFlags }, /*#__PURE__*/_react["default"].createElement(_reactIntl.IntlProvider, { locale: uiState.locale, messages: localeMessages[uiState.locale] }, /*#__PURE__*/_react["default"].createElement(_styledComponents.StyleSheetManager, { shouldForwardProp: shouldForwardProp }, /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, { theme: theme }, /*#__PURE__*/_react["default"].createElement(_useCloudListProvider.CloudListProvider, { providers: cloudProviders }, /*#__PURE__*/_react["default"].createElement(GlobalStyle, { className: "kepler-gl", id: "kepler-gl__".concat(id), style: { display: 'flex', flexDirection: 'column', position: 'relative', width: "".concat(width, "px"), height: "".concat(height, "px") }, ref: this.root }, /*#__PURE__*/_react["default"].createElement(NotificationPanel, notificationPanelFields), /*#__PURE__*/_react["default"].createElement(DndContext, null, !uiState.readOnly && !readOnly && /*#__PURE__*/_react["default"].createElement(SidePanel, sideFields), /*#__PURE__*/_react["default"].createElement(MapsLayout, { className: "maps", mapState: this.props.mapState }, mapContainers)), isExportingImage && /*#__PURE__*/_react["default"].createElement(PlotContainer, plotContainerFields), !isViewportDisjointed(this.props) && interactionConfig.geocoder.enabled && /*#__PURE__*/_react["default"].createElement(GeoCoderPanel, (0, _extends2["default"])({}, geoCoderPanelFields, { index: 0, unsyncedViewports: false })), isViewportDisjointed(this.props) && interactionConfig.geocoder.enabled && mapContainers.map(function (_mapContainer, index) { return /*#__PURE__*/_react["default"].createElement(GeoCoderPanel, (0, _extends2["default"])({ key: index }, geoCoderPanelFields, { index: index, unsyncedViewports: true })); }), /*#__PURE__*/_react["default"].createElement(BottomWidgetOuter, { absolute: !(0, _utils.hasPortableWidth)(_styles.breakPointValues) }, /*#__PURE__*/_react["default"].createElement(BottomWidget, (0, _extends2["default"])({ rootRef: this.bottomWidgetRef }, bottomWidgetFields, { containerW: dimensions.width, theme: theme }))), /*#__PURE__*/_react["default"].createElement(ModalContainer, (0, _extends2["default"])({}, modalContainerFields, { containerW: dimensions.width, containerH: dimensions.height }))))))))); } }]); }(_react.Component); (0, _defineProperty2["default"])(KeplerGL, "defaultProps", DEFAULT_KEPLER_GL_PROPS); (0, _defineProperty2["default"])(KeplerGL, "contextType", _context.RootContext); return (0, _keplerglConnect.connect)(mapStateToProps, makeMapDispatchToProps)((0, _styledComponents.withTheme)(KeplerGL)); } function mapStateToProps(state, props) { return _objectSpread(_objectSpread({}, props), {}, { visState: state.visState, mapStyle: state.mapStyle, mapState: state.mapState, uiState: state.uiState, providerState: state.providerState }); } var defaultUserActions = {}; var getDispatch = function getDispatch(dispatch) { return dispatch; }; var getUserActions = function getUserActions(dispatch, props) { return props.actions || defaultUserActions; }; /** @type {() => import('reselect').OutputParametricSelector<any, any, any, any>} */ function makeGetActionCreators() { return (0, _reselect.createSelector)([getDispatch, getUserActions], function (dispatch, userActions) { var _map = [_actions.VisStateActions, _actions.MapStateActions, _actions.MapStyleActions, _actions.UIStateActions, _actions.ProviderActions].map(function (actions) { return (0, _redux.bindActionCreators)(mergeActions(actions, userActions), dispatch); }), _map2 = (0, _slicedToArray2["default"])(_map, 5), visStateActions = _map2[0], mapStateActions = _map2[1], mapStyleActions = _map2[2], uiStateActions = _map2[3], providerActions = _map2[4]; return { visStateActions: visStateActions, mapStateActions: mapStateActions, mapStyleActions: mapStyleActions, uiStateActions: uiStateActions, providerActions: providerActions, dispatch: dispatch }; }); } function makeMapDispatchToProps() { var getActionCreators = makeGetActionCreators(); var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { var groupedActionCreators = getActionCreators(dispatch, ownProps); return _objectSpread(_objectSpread({}, groupedActionCreators), {}, { dispatch: dispatch }); }; return mapDispatchToProps; } /** * Override default kepler.gl actions with user defined actions using the same key */ function mergeActions(actions, userActions) { var overrides = {}; for (var key in userActions) { if (Object.prototype.hasOwnProperty.call(userActions, key) && Object.prototype.hasOwnProperty.call(actions, key)) { overrides[key] = userActions[key]; } } return _objectSpread(_objectSpread({}, actions), overrides); } var _default = exports["default"] = KeplerGlFactory; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfcmVhY3QiLCJfaW50ZXJvcFJlcXVpcmVXaWxkY2FyZCIsInJlcXVpcmUiLCJfY29uc29sZSIsIl9pbnRlcm9wUmVxdWlyZURlZmF1bHQiLCJfcmVkdXgiLCJfaXNQcm9wVmFsaWQiLCJfc3R5bGVkQ29tcG9uZW50cyIsIl9yZXNlbGVjdCIsIl9rZXBsZXJnbENvbm5lY3QiLCJfcmVhY3RJbnRsIiwiX2xvY2FsaXphdGlvbiIsIl9jb250ZXh0IiwiX2FjdGlvbnMiLCJfY29tbW9uVXRpbHMiLCJfY29uc3RhbnRzIiwiX3NpZGVQYW5lbCIsIl9tYXBDb250YWluZXIyIiwiX21hcHNMYXlvdXQiLCJfYm90dG9tV2lkZ2V0IiwiX21vZGFsQ29udGFpbmVyIiwiX3Bsb3RDb250YWluZXIiLCJfbm90aWZpY2F0aW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