UNPKG

kepler.gl

Version:

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

65 lines (64 loc) 11.6 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 _reactMarkdown = _interopRequireDefault(require("react-markdown")); var _reactIntl = require("react-intl"); var _localization = require("@kepler.gl/localization"); var _exampleTable = _interopRequireDefault(require("../example-table")); var _templateObject, _templateObject2, _templateObject3; // SPDX-License-Identifier: MIT // Copyright contributors to the kepler.gl project var InfoModal = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n font-size: 13px;\n color: ", ";\n\n pre {\n padding: 12px;\n background-color: #f8f8f9;\n }\n"])), function (props) { return props.theme.titleColorLT; }); var StyledTitle = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n font-size: 20px;\n letter-spacing: 1.25px;\n margin: 18px 0 14px 0;\n color: ", ";\n"])), function (props) { return props.theme.titleColorLT; }); var StyledCode = _styledComponents["default"].code(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n"])), function (props) { return props.theme.titleColorLT; }); var exampleTableHeader = ['id', 'latitude', 'longitude', 'sort by']; var exampleTabbleRows = [['A', '40.81773', '-74.20986', '0'], ['A', '40.81765', '-74.20987', '1'], ['A', '40.81746', '-74.20998', '2'], ['B', '40.64375', '-74.33242', '0'], ['B', '40.64353', '-74.20987', '1'], ['B', '40.64222', '-74.33001', '2']]; var ExampleTable = function ExampleTable() { return /*#__PURE__*/_react["default"].createElement(_exampleTable["default"], { className: "geojson-example-table" }, /*#__PURE__*/_react["default"].createElement("thead", null, /*#__PURE__*/_react["default"].createElement("tr", null, exampleTableHeader.map(function (v) { return /*#__PURE__*/_react["default"].createElement("th", { key: v }, v); }))), /*#__PURE__*/_react["default"].createElement("tbody", null, exampleTabbleRows.map(function (row, i) { return /*#__PURE__*/_react["default"].createElement("tr", { key: i }, row.map(function (v, j) { return /*#__PURE__*/_react["default"].createElement("td", { key: j }, /*#__PURE__*/_react["default"].createElement(StyledCode, null, v)); })); }))); }; var GeojsonInfoModalFactory = function GeojsonInfoModalFactory(columnMode) { var GeojsonInfoModal = function GeojsonInfoModal() { var intl = (0, _reactIntl.useIntl)(); return /*#__PURE__*/_react["default"].createElement(InfoModal, { className: "geojson-info-modal" }, /*#__PURE__*/_react["default"].createElement("div", { className: "geojson-info-modal__description" }, /*#__PURE__*/_react["default"].createElement(_reactMarkdown["default"], { children: intl.formatMessage({ id: columnMode === 'geojson' ? 'modal.polygonInfo.description' : 'modal.polygonInfo.descriptionTable' }) })), columnMode === 'table' ? /*#__PURE__*/_react["default"].createElement("div", { className: "geojson-info-modal__example" }, /*#__PURE__*/_react["default"].createElement(StyledTitle, null, /*#__PURE__*/_react["default"].createElement(_localization.FormattedMessage, { id: "modal.polygonInfo.exampleTable" })), /*#__PURE__*/_react["default"].createElement(ExampleTable, null)) : null); }; return GeojsonInfoModal; }; var _default = exports["default"] = GeojsonInfoModalFactory; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfcmVhY3QiLCJfaW50ZXJvcFJlcXVpcmVEZWZhdWx0IiwicmVxdWlyZSIsIl9zdHlsZWRDb21wb25lbnRzIiwiX3JlYWN0TWFya2Rvd24iLCJfcmVhY3RJbnRsIiwiX2xvY2FsaXphdGlvbiIsIl9leGFtcGxlVGFibGUiLCJfdGVtcGxhdGVPYmplY3QiLCJfdGVtcGxhdGVPYmplY3QyIiwiX3RlbXBsYXRlT2JqZWN0MyIsIkluZm9Nb2RhbCIsInN0eWxlZCIsImRpdiIsIl90YWdnZWRUZW1wbGF0ZUxpdGVyYWwyIi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xlVGFibGVIZWFkZXIubWFwKHYgPT4gKFxuICAgICAgICAgIDx0aCBrZXk9e3Z9Pnt2fTwvdGg+XG4gICAgICAgICkpfVxuICAgICAgPC90cj5cbiAgICA8L3RoZWFkPlxuICAgIDx0Ym9keT5cbiAgICAgIHtleGFtcGxlVGFiYmxlUm93cy5tYXAoKHJvdywgaSkgPT4gKFxuICAgICAgICA8dHIga2V5PXtpfT5cbiAgICAgICAgICB7cm93Lm1hcCgodiwgaikgPT4gKFxuICAgICAgICAgICAgPHRkIGtleT17an0+XG4gICAgICAgICAgICAgIDxTdHlsZWRDb2RlPnt2fTwvU3R5bGVkQ29kZT5cbiAgICAgICAgICAgIDwvdGQ+XG4gICAgICAgICAgKSl9XG4gICAgICAgIDwvdHI+XG4gICAgICApKX1cbiAgICA8L3Rib2R5PlxuICA8L1RhYmxlPlxuKTtcblxuY29uc3QgR2VvanNvbkluZm9Nb2RhbEZhY3RvcnkgPSBjb2x1bW5Nb2RlID0+IHtcbiAgY29uc3QgR2VvanNvbkluZm9Nb2RhbCA9ICgpID0+IHtcbiAgICBjb25zdCBpbnRsID0gdXNlSW50bCgpO1xuICAgIHJldHVybiAoXG4gICAgICA8SW5mb01vZGFsIGNsYXNzTmFtZT1cImdlb2pzb24taW5mby1tb2RhbFwiPlxuICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cImdlb2pzb24taW5mby1tb2RhbF9fZGVzY3JpcHRpb25cIj5cbiAgICAgICAgICA8UmVhY3RNYXJrZG93blxuICAgICAgICAgICAgY2hpbGRyZW49e2ludGwuZm9ybWF0TWVzc2FnZSh7XG4gICAgICAgICAgICAgIGlkOlxuICAgICAgICAgICAgICAgIGNvbHVtbk1vZGUgPT09ICdnZW9qc29uJ1xuICAgICAgICAgICAgICAgICAgPyAnbW9kYWwucG9seWdvbkluZm8uZGVzY3JpcHRpb24nXG4gICAgICAgICAgICAgICAgICA6ICdtb2RhbC5wb2x5Z29uSW5mby5kZXNjcmlwdGlvblRhYmxlJ1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