UNPKG

kepler.gl

Version:

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

63 lines (61 loc) 9.76 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.LINE_STYLE = exports.FEATURE_STYLE = exports.EDIT_HANDLE_STYLE = void 0; var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); var _constants = require("./constants"); // SPDX-License-Identifier: MIT // Copyright contributors to the kepler.gl project var POINT_RADIUS = 5; var STROKE_WIDTH_SELECTED = 2.5; var STROKE_WIDTH_NOT_SELECTED = 2; var STROKE_SOLID_ARRAY = [0, 0]; var STROKE_DASH_ARRAY = [4, 3]; var ALPHA_0 = 0x00; var ALPHA_005 = 0x0d; var ALPHA_01 = 0x1a; var ALPHA_05 = 0x80; var ALPHA_1 = 0xff; var PRIMARY_COLOR_TRANSPARENT = [].concat((0, _toConsumableArray2["default"])(_constants.COLORS.PRIMARY), [ALPHA_01]); var PRIMARY_COLOR = [].concat((0, _toConsumableArray2["default"])(_constants.COLORS.PRIMARY), [ALPHA_1]); var SECONDARY_COLOR_TRANSPARENT = [].concat((0, _toConsumableArray2["default"])(_constants.COLORS.SECONDARY), [ALPHA_0]); var TENTATIVE_FEATURE_COLOR = [].concat((0, _toConsumableArray2["default"])(_constants.COLORS.SECONDARY), [ALPHA_1]); var TENTATIVE_FEATURE_COLOR_TRANSPARENT = [].concat((0, _toConsumableArray2["default"])(_constants.COLORS.SECONDARY), [ALPHA_005]); var EDIT_HANDLE_STYLE = exports.EDIT_HANDLE_STYLE = { getRadius: POINT_RADIUS, getFillColor: SECONDARY_COLOR_TRANSPARENT, getOutlineColor: function getOutlineColor(handle) { var _handle$properties; return (handle === null || handle === void 0 || (_handle$properties = handle.properties) === null || _handle$properties === void 0 ? void 0 : _handle$properties.featureIndex) < 0 ? TENTATIVE_FEATURE_COLOR : PRIMARY_COLOR; }, highlightMultiplier: [].concat((0, _toConsumableArray2["default"])(_constants.COLORS.HIGHLIGHT), [ALPHA_05]), highlightMultiplierNone: SECONDARY_COLOR_TRANSPARENT }; var FEATURE_STYLE = exports.FEATURE_STYLE = { getColor: function getColor(feature, isSelected) { return isSelected ? PRIMARY_COLOR_TRANSPARENT : SECONDARY_COLOR_TRANSPARENT; }, highlightMultiplier: [].concat((0, _toConsumableArray2["default"])(_constants.COLORS.HIGHLIGHT), [ALPHA_01]), highlightMultiplierNone: SECONDARY_COLOR_TRANSPARENT }; var LINE_STYLE = exports.LINE_STYLE = { getColor: function getColor(_feature, isSelected) { return isSelected ? PRIMARY_COLOR : PRIMARY_COLOR; }, getWidth: function getWidth(_feature, isSelected) { return isSelected ? STROKE_WIDTH_SELECTED : STROKE_WIDTH_NOT_SELECTED; }, getTentativeLineColor: function getTentativeLineColor() { return TENTATIVE_FEATURE_COLOR; }, getTentativeLineWidth: function getTentativeLineWidth() { return STROKE_WIDTH_NOT_SELECTED; }, getTentativeFillColor: TENTATIVE_FEATURE_COLOR_TRANSPARENT, dashArray: STROKE_DASH_ARRAY, solidArray: STROKE_SOLID_ARRAY, highlightMultiplier: [].concat((0, _toConsumableArray2["default"])(_constants.COLORS.HIGHLIGHT), [ALPHA_1]) }; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfY29uc3RhbnRzIiwicmVxdWlyZSIsIlBPSU5UX1JBRElVUyIsIlNUUk9LRV9XSURUSF9TRUxFQ1RFRCIsIlNUUk9LRV9XSURUSF9OT1RfU0VMRUNURUQiLCJTVFJPS0VfU09MSURfQVJSQVkiLCJTVFJPS0VfREFTSF9BUlJBWSIsIkFMUEhBXzAiLCJBTFBIQV8wMDUiLCJBTFBIQV8wMSIsIkFMUEhBXzA1IiwiQUxQSEFfMSIsIlBSSU1BUllfQ09MT1JfVFJBTlNQQVJFTlQiLCJjb25jYXQiLCJfdG9Db25zdW1hYmxlQXJyYXkyIiwiQ09MT1JTIiwiUFJJ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