kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
34 lines (33 loc) • 5.68 kB
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = DatasetInfoFactory;
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
var _react = _interopRequireDefault(require("react"));
var _styledComponents = _interopRequireDefault(require("styled-components"));
var _d3Format = require("d3-format");
var _constants = require("@kepler.gl/constants");
var _localization = require("@kepler.gl/localization");
var _templateObject; // SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
var numFormat = (0, _d3Format.format)(',');
var StyledDataRowCount = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n font-size: 11px;\n color: ", ";\n padding-left: 19px;\n"])), function (props) {
return props.theme.subtextColor;
});
function DatasetInfoFactory() {
var DatasetInfo = function DatasetInfo(_ref) {
var dataset = _ref.dataset;
return /*#__PURE__*/_react["default"].createElement(StyledDataRowCount, {
className: "source-data-rows"
}, /*#__PURE__*/_react["default"].createElement(_localization.FormattedMessage, {
id: dataset.type === _constants.DatasetType.VECTOR_TILE ? 'datasetInfo.vectorTile' : dataset.type === _constants.DatasetType.RASTER_TILE ? 'datasetInfo.rasterTile' : dataset.type === _constants.DatasetType.WMS_TILE ? 'datasetInfo.wmsTile' : 'datasetInfo.rowCount',
values: {
rowCount: numFormat(dataset.dataContainer.numRows())
}
}));
};
return DatasetInfo;
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfcmVhY3QiLCJfaW50ZXJvcFJlcXVpcmVEZWZhdWx0IiwicmVxdWlyZSIsIl9zdHlsZWRDb21wb25lbnRzIiwiX2QzRm9ybWF0IiwiX2NvbnN0YW50cyIsIl9sb2NhbGl6YXRpb24iLCJfdGVtcGxhdGVPYmplY3QiLCJudW1Gb3JtY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