UNPKG

kepler.gl

Version:

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

390 lines (385 loc) 54.2 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.pointVisConfigs = exports.iconRequiredColumns = exports.iconPosAccessor = exports.iconOptionalColumns = exports.iconAccessor = exports["default"] = exports.SVG_ICON_URL = void 0; var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); 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 _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get")); var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); var _window = _interopRequireDefault(require("global/window")); var _extensions = require("@deck.gl/extensions"); var _constants = _interopRequireDefault(require("@luma.gl/constants")); var _deckglLayers = require("@kepler.gl/deckgl-layers"); var _iconLayerIcon = _interopRequireDefault(require("./icon-layer-icon")); var _constants2 = require("@kepler.gl/constants"); var _iconInfoModal = _interopRequireDefault(require("./icon-info-modal")); var _baseLayer = _interopRequireDefault(require("../base-layer")); var _layerUtils = require("../layer-utils"); var _utils = require("@kepler.gl/utils"); var _layerTextLabel = require("../layer-text-label"); 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; } 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 _superPropGet(t, e, r, o) { var p = (0, _get2["default"])((0, _getPrototypeOf2["default"])(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; } // SPDX-License-Identifier: MIT // Copyright contributors to the kepler.gl project var brushingExtension = new _extensions.BrushingExtension(); var SVG_ICON_URL = exports.SVG_ICON_URL = "".concat(_constants2.KEPLER_UNFOLDED_BUCKET, "/icons/svg-icons.json"); var iconPosAccessor = exports.iconPosAccessor = function iconPosAccessor(_ref) { var lat = _ref.lat, lng = _ref.lng, altitude = _ref.altitude; return function (dc) { return function (d) { return [dc.valueAt(d.index, lng.fieldIdx), dc.valueAt(d.index, lat.fieldIdx), (altitude === null || altitude === void 0 ? void 0 : altitude.fieldIdx) > -1 ? dc.valueAt(d.index, altitude.fieldIdx) : 0]; }; }; }; var iconAccessor = exports.iconAccessor = function iconAccessor(_ref2) { var icon = _ref2.icon; return function (dc) { return function (d) { return dc.valueAt(d.index, icon.fieldIdx); }; }; }; var iconRequiredColumns = exports.iconRequiredColumns = ['lat', 'lng', 'icon']; var iconOptionalColumns = exports.iconOptionalColumns = ['altitude']; var pointVisConfigs = exports.pointVisConfigs = { radius: 'radius', fixedRadius: 'fixedRadius', opacity: 'opacity', colorRange: 'colorRange', radiusRange: 'radiusRange', billboard: 'billboard' }; function flatterIconPositions(icon) { // had to flip y, since @luma modal has changed return icon.mesh.cells.reduce(function (prev, cell) { cell.forEach(function (p) { prev.push.apply(prev, [icon.mesh.positions[p][0], -icon.mesh.positions[p][1], icon.mesh.positions[p][2]]); }); return prev; }, []); } var IconLayer = exports["default"] = /*#__PURE__*/function (_Layer) { function IconLayer(props) { var _this; (0, _classCallCheck2["default"])(this, IconLayer); _this = _callSuper(this, IconLayer, [props]); (0, _defineProperty2["default"])(_this, "getIconAccessor", void 0); (0, _defineProperty2["default"])(_this, "_layerInfoModal", void 0); (0, _defineProperty2["default"])(_this, "iconGeometry", void 0); _this.registerVisConfig(pointVisConfigs); _this.getPositionAccessor = function (dataContainer) { return iconPosAccessor(_this.config.columns)(dataContainer); }; _this.getIconAccessor = function (dataContainer) { return iconAccessor(_this.config.columns)(dataContainer); }; _this._layerInfoModal = (0, _iconInfoModal["default"])(props.svgIcons); _this.iconGeometry = props.iconGeometry || null; if ((0, _utils.isTest)()) { return (0, _possibleConstructorReturn2["default"])(_this); } if (props.svgIcons) { // if svg icons are passed in then bypass fetching of remote svg icons _this.setSvgIcons(props.svgIcons); } else { // prepare layer info modal and fetch remote svg icons _this.getSvgIcons(); } return _this; } (0, _inherits2["default"])(IconLayer, _Layer); return (0, _createClass2["default"])(IconLayer, [{ key: "svgIconUrl", get: function get() { return SVG_ICON_URL; } }, { key: "type", get: function get() { return 'icon'; } }, { key: "requiredLayerColumns", get: function get() { return iconRequiredColumns; } }, { key: "optionalColumns", get: function get() { return iconOptionalColumns; } }, { key: "columnPairs", get: function get() { return this.defaultPointColumnPairs; } }, { key: "layerIcon", get: function get() { return _iconLayerIcon["default"]; } }, { key: "visualChannels", get: function get() { return { color: _objectSpread(_objectSpread({}, _superPropGet(IconLayer, "visualChannels", this, 1).color), {}, { accessor: 'getFillColor', defaultValue: function defaultValue(config) { return config.color; } }), size: _objectSpread(_objectSpread({}, _superPropGet(IconLayer, "visualChannels", this, 1).size), {}, { property: 'radius', range: 'radiusRange', channelScaleType: 'radius', accessor: 'getRadius', defaultValue: 1 }) }; } }, { key: "layerInfoModal", get: function get() { return { id: 'iconInfo', template: this._layerInfoModal, modalProps: { title: 'modal.iconInfo.title' } }; } }, { key: "getZoomFactor", value: function getZoomFactor(_ref3) { var zoom = _ref3.zoom, _ref3$zoomOffset = _ref3.zoomOffset, zoomOffset = _ref3$zoomOffset === void 0 ? 0 : _ref3$zoomOffset; return Math.pow(2, 14 - zoom + zoomOffset); } }, { key: "getSvgIcons", value: function getSvgIcons() { var _this2 = this; var fetchConfig = { method: 'GET', mode: 'cors', cache: 'no-cache' }; if (_window["default"].fetch && this.svgIconUrl) { _window["default"].fetch(this.svgIconUrl, fetchConfig).then(function (response) { return response.json(); }).then(function () { var parsed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; _this2.setSvgIcons(parsed.svgIcons); }); } } }, { key: "setSvgIcons", value: function setSvgIcons() { var svgIcons = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; this.iconGeometry = svgIcons.reduce(function (accu, curr) { return _objectSpread(_objectSpread({}, accu), {}, (0, _defineProperty2["default"])({}, curr.id, flatterIconPositions(curr))); }, {}); this._layerInfoModal = (0, _iconInfoModal["default"])(svgIcons); } }, { key: "getFilteredItemCount", value: function getFilteredItemCount() { // use total if (Object.keys(this.filteredItemCount).length) { return Object.values(this.filteredItemCount).reduce(function (total, curr) { return Number.isFinite(curr) ? total + curr : total; }, 0); } return null; } }, { key: "calculateDataAttribute", value: function calculateDataAttribute(_ref4, getPosition) { var dataContainer = _ref4.dataContainer, filteredIndex = _ref4.filteredIndex; var getIcon = this.getIconAccessor(dataContainer); var data = []; for (var i = 0; i < filteredIndex.length; i++) { var index = filteredIndex[i]; var rowIndex = { index: index }; var pos = getPosition(rowIndex); var icon = getIcon(rowIndex); // if doesn't have point lat or lng, do not add the point // deck.gl can't handle position = null if (pos.every(Number.isFinite) && typeof icon === 'string') { data.push({ index: index, icon: icon }); } } return data; } }, { key: "formatLayerData", value: function formatLayerData(datasets, oldLayerData) { if (this.config.dataId === null) { return {}; } var textLabel = this.config.textLabel; var _datasets$this$config = datasets[this.config.dataId], gpuFilter = _datasets$this$config.gpuFilter, dataContainer = _datasets$this$config.dataContainer; var getPosition = this.getPositionAccessor(dataContainer); var _this$updateData = this.updateData(datasets, oldLayerData), data = _this$updateData.data, triggerChanged = _this$updateData.triggerChanged; // get all distinct characters in the text labels var textLabels = (0, _layerTextLabel.formatTextLabelData)({ textLabel: textLabel, triggerChanged: triggerChanged, oldLayerData: oldLayerData, data: data, dataContainer: dataContainer }); var accessors = this.getAttributeAccessors({ dataContainer: dataContainer }); return _objectSpread({ data: data, getPosition: getPosition, getFilterValue: gpuFilter.filterValueAccessor(dataContainer)(), textLabels: textLabels }, accessors); } }, { key: "updateLayerMeta", value: function updateLayerMeta(dataset, getPosition) { var dataContainer = dataset.dataContainer; var bounds = this.getPointsBounds(dataContainer, getPosition); this.updateMeta({ bounds: bounds }); } }, { key: "renderLayer", value: function renderLayer(opts) { var _this$config$columns$, _this3 = this; var data = opts.data, gpuFilter = opts.gpuFilter, objectHovered = opts.objectHovered, mapState = opts.mapState, interactionConfig = opts.interactionConfig; var radiusScale = this.getRadiusScaleByZoom(mapState); var layerProps = _objectSpread({ radiusScale: radiusScale, billboard: this.config.visConfig.billboard }, this.config.visConfig.fixedRadius ? {} : { radiusMaxPixels: 500 }); var updateTriggers = _objectSpread({ getPosition: this.config.columns, getFilterValue: gpuFilter.filterValueUpdateTriggers }, this.getVisualChannelUpdateTriggers()); var defaultLayerProps = this.getDefaultDeckLayerProps(opts); var brushingProps = this.getBrushingExtensionProps(interactionConfig); var getPixelOffset = (0, _layerTextLabel.getTextOffsetByRadius)(radiusScale, data.getRadius, mapState); var extensions = [].concat((0, _toConsumableArray2["default"])(defaultLayerProps.extensions), [brushingExtension]); // shared Props between layer and label layer var sharedProps = _objectSpread({ getFilterValue: data.getFilterValue, extensions: extensions, filterRange: defaultLayerProps.filterRange }, brushingProps); var labelLayers = (0, _toConsumableArray2["default"])(this.renderTextLabelLayer({ getPosition: data.getPosition, sharedProps: sharedProps, getPixelOffset: getPixelOffset, updateTriggers: updateTriggers }, opts)); var hoveredObject = this.hasHoveredObject(objectHovered); var parameters = { // icons will be flat on the map when the altitude column is not used depthTest: ((_this$config$columns$ = this.config.columns.altitude) === null || _this$config$columns$ === void 0 ? void 0 : _this$config$columns$.fieldIdx) > -1, cullFace: _constants["default"].FRONT }; return !this.iconGeometry ? [] : [new _deckglLayers.SvgIconLayer(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, defaultLayerProps), brushingProps), layerProps), data), {}, { parameters: parameters, getIconGeometry: function getIconGeometry(id) { var _this3$iconGeometry; return (_this3$iconGeometry = _this3.iconGeometry) === null || _this3$iconGeometry === void 0 ? void 0 : _this3$iconGeometry[id]; }, // update triggers updateTriggers: updateTriggers, extensions: extensions }))].concat((0, _toConsumableArray2["default"])(hoveredObject ? [ // @ts-expect-error SvgIconLayerProps needs getIcon Field new _deckglLayers.SvgIconLayer(_objectSpread(_objectSpread(_objectSpread({}, this.getDefaultHoverLayerProps()), layerProps), {}, { visible: defaultLayerProps.visible, data: [hoveredObject], parameters: parameters, getPosition: data.getPosition, getRadius: data.getRadius, getFillColor: this.config.highlightColor, getIconGeometry: function getIconGeometry(id) { var _this3$iconGeometry2; return (_this3$iconGeometry2 = _this3.iconGeometry) === null || _this3$iconGeometry2 === void 0 ? void 0 : _this3$iconGeometry2[id]; } }))] : []), (0, _toConsumableArray2["default"])(labelLayers)); } }], [{ key: "findDefaultLayerProps", value: function findDefaultLayerProps(_ref5) { var _ref5$fieldPairs = _ref5.fieldPairs, fieldPairs = _ref5$fieldPairs === void 0 ? [] : _ref5$fieldPairs, _ref5$fields = _ref5.fields, fields = _ref5$fields === void 0 ? [] : _ref5$fields; var notFound = { props: [] }; if (!fieldPairs.length || !fields.length) { return notFound; } var iconFields = fields.filter(function (_ref6) { var name = _ref6.name; return name.replace(/[_,.]+/g, ' ').trim().split(' ').some(function (seg) { return _constants2.ICON_FIELDS.icon.some(function (t) { return t.includes(seg); }); }); }); if (!iconFields.length) { return notFound; } // create icon layers for first point pair var ptPair = fieldPairs[0]; var columns = (0, _layerUtils.assignPointPairToLayerColumn)(ptPair, true); var props = iconFields.map(function (iconField) { return { label: iconField.name.replace(/[_,.]+/g, ' ').trim(), columns: _objectSpread(_objectSpread({}, columns), {}, { icon: { value: iconField.name, fieldIdx: iconField.fieldIdx } }), isVisible: true }; }); return { props: props }; } }]); }(_baseLayer["default"]); //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfd2luZG93IiwiX2ludGVyb3BSZXF1aXJlRGVmYXVsdCIsInJlcXVpcmUiLCJfZXh0ZW5zaW9ucyIsIl9jb25zdGFudHMiLCJfZGVja2dsTGF5ZXJzIiwiX2ljb25MYXllckljb24iLCJfY29uc3RhbnRzMiIsIl9pY29uSW5mb01vZGFsIiwiX2Jhc2VMYXllciIsIl9sYXllclV0aWxzIiwiX3V0aWxzIiwiX2xheWVyVGV4dExhYmVsIiwib3duS2V5cyIsImUiLCJyIiwidCIsIk9iamVjdCIsImtleXMiLCJnZXRPd25Qcm9wZXJ0eVN5bWJvbHMiLCJvIiwiZmlsdGVyIiwiZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yIiwiZW51bWVyYWJsZSIsInB1c2giLCJhcHBseSIsIl9vYmplY3RTcHJlYWQiLCJhcmd1bWVudHMiLCJsZW5ndGgiLCJmb3JFYWNoIiwiX2RlZmluZVByb3BlcnR5MiIsImdldE93blByb3BlcnR5RGVzY3JpcHRvcnMiLCJkZWZpbmVQcm9wZXJ0aWVzIiwiZGVmaW5lUHJvcGVydHkiLCJfY2FsbFN1cGVyIiwiX2dldFByb3RvdHlwZU9mMiIsIl9wb3NzaWJsZUNvbnN0cnVjdG9yUmV0dXJuMiIsIl9pc05hdGl2ZVJlZmxlY3RDb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G4gICAgICAgICAgICBleHRlbnNpb25zXG4gICAgICAgICAgfSksXG5cbiAgICAgICAgICAvLyBob3ZlciBsYXllclxuICAgICAgICAgIC4uLihob3ZlcmVkT2JqZWN0XG4gICAgICAgICAgICA/IFtcbiAgICAgICAgICAgICAgICAvLyBAdHMtZXhwZWN0LWVycm9yIFN2Z0ljb25MYXllclByb3BzIG5lZWRzIGdldEljb24gRmllbGRcbiAgICAgICAgICAgICAgICBuZXcgU3ZnSWNvbkxheWVyKHtcbiAgICAgICAgICAgICAgICAgIC4uLnRoaXMuZ2V0RGVmYXVsdEhvdmVyTGF5ZXJQcm9wcygpLFxuICAgICAgICAgICAgICAgICAgLi4ubGF5ZXJQcm9wcyxcbiAgICAgICAgICAgICAgICAgIHZpc2libGU6IGRlZmF1bHRMYXllclByb3BzLnZpc2libGUsXG4gICAgICAgICAgICAgICAgICBkYXRhOiBbaG92ZXJlZE9iamVjdF0sXG4gICAgICAgICAgICAgICAgICBwYXJhbWV0ZXJzLFxuICAgICAgICAgICAgICAgICAgZ2V0UG9zaXRpb246IGRhdGEuZ2V0UG9zaXRpb24sXG4gICAgICAgICAgICAgICAgICBnZXRSYWRpdXM6IGRhdGEuZ2V0UmFkaXVzLFxuICAgICAgICAgICAgICAgICAgZ2V0RmlsbENvbG9yOiB0aGlzLmNvbmZpZy5oaWdobGlnaHRDb2xvcixcbiAgICAgICAgICAgICAgICAgIGdldEljb25HZW9tZXRyeTogaWQgPT4gdGhpcy5pY29uR2VvbWV0cnk/LltpZF1cbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICBdXG4gICAgICAgICAgICA6IFtdKSxcblxuICAgICAgICAgIC8vIHRleHQgbGFiZWwgbGF5ZXJcbiAgICAgICAgICAuLi5sYWJlbExheWVyc1xuICAgICAgICBdO1xuICB9XG59XG4iXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7OztBQUdBLElBQUFBLE9BQUEsR0FBQUMsc0JBQUEsQ0FBQUMsT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