UNPKG

kepler.gl

Version:

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

43 lines (42 loc) 6.18 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")); var _react = _interopRequireDefault(require("react")); var _styledComponents = _interopRequireDefault(require("styled-components")); var _constants = require("@kepler.gl/constants"); var _templateObject; // SPDX-License-Identifier: MIT // Copyright contributors to the kepler.gl project var FieldTag = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n background-color: rgba(", ", 0.2);\n border-radius: 2px;\n border: 1px solid rgb(", ");\n color: rgb(", ");\n display: inline-block;\n font-size: 10px;\n font-weight: 400;\n padding: 0 5px;\n text-align: center;\n width: ", "px;\n line-height: ", "px;\n"])), function (props) { return props.color; }, function (props) { return props.color; }, function (props) { return props.color; }, function (props) { return props.theme.fieldTokenWidth; }, function (props) { return props.theme.fieldTokenHeight; }); function FieldTokenFactory(fieldTypeDisplay, fieldColors) { var FieldToken = function FieldToken(_ref) { var _fieldTypeDisplay$typ, _fieldTypeDisplay$typ2; var type = _ref.type; return /*#__PURE__*/_react["default"].createElement(FieldTag, { color: ((_fieldTypeDisplay$typ = fieldTypeDisplay[type]) === null || _fieldTypeDisplay$typ === void 0 ? void 0 : _fieldTypeDisplay$typ.color) || fieldColors["default"] }, (_fieldTypeDisplay$typ2 = fieldTypeDisplay[type]) === null || _fieldTypeDisplay$typ2 === void 0 ? void 0 : _fieldTypeDisplay$typ2.label); }; return FieldToken; } function getFieldTypes() { return _constants.FIELD_TYPE_DISPLAY; } function getFieldColors() { return _constants.FIELD_COLORS; } FieldTokenFactory.deps = [getFieldTypes, getFieldColors]; var _default = exports["default"] = FieldTokenFactory; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI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