kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
128 lines (126 loc) • 23.4 kB
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PreviewDataPanel = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
var _react = _interopRequireWildcard(require("react"));
var _styledComponents = require("styled-components");
var _components = require("@kepler.gl/components");
var _processors = require("@kepler.gl/processors");
var _utils = require("@kepler.gl/utils");
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
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; } // SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
var DEFAULT_ROWS_TO_CALCULATE_PREVIEW = 100;
// min Cellsize should take into account option button and field token
var minCellSize = 80;
// option buttons and field token
var optionButtonWidth = 20;
var pinButton = 20;
var cellPadding = 20;
var PreviewDataPanelWOTheme = function PreviewDataPanelWOTheme(_ref) {
var result = _ref.result,
_ref$rowsToCalculateP = _ref.rowsToCalculatePreview,
rowsToCalculatePreview = _ref$rowsToCalculateP === void 0 ? DEFAULT_ROWS_TO_CALCULATE_PREVIEW : _ref$rowsToCalculateP,
_ref$defaultPinnedCol = _ref.defaultPinnedColumns,
defaultPinnedColumns = _ref$defaultPinnedCol === void 0 ? [] : _ref$defaultPinnedCol,
theme = _ref.theme;
var _useState = (0, _react.useState)(defaultPinnedColumns),
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
pinnedColumns = _useState2[0],
setPinnedColumns = _useState2[1];
var fields = (0, _react.useMemo)(function () {
return (0, _processors.arrowSchemaToFields)(result.table, result.tableDuckDBTypes);
}, [result]);
var dataContainer = (0, _react.useMemo)(function () {
var cols = (0, _toConsumableArray2["default"])(Array(result.table.numCols).keys()).map(function (i) {
return result.table.getChildAt(i);
});
var dataContainer = (0, _utils.createDataContainer)(cols, {
fields: fields,
inputDataFormat: _utils.DataForm.COLS_ARRAY
});
return dataContainer;
}, [result, fields]);
var columns = (0, _react.useMemo)(function () {
return fields.map(function (f) {
return f.name;
});
}, [fields]);
var colMeta = (0, _react.useMemo)(function () {
return fields.reduce(function (acc, _ref2, colIdx) {
var name = _ref2.name,
displayName = _ref2.displayName,
type = _ref2.type,
displayFormat = _ref2.displayFormat;
return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2["default"])({}, name, {
// because '' || 'aaa' = 'aaa'
name: displayName !== undefined ? displayName : name,
displayName: displayName,
displayFormat: displayFormat,
type: type,
colIdx: colIdx
}));
}, {});
}, [fields]);
var copyTableColumn = (0, _react.useCallback)(function (column) {
var _navigator;
var _colMeta$column = colMeta[column],
colIdx = _colMeta$column.colIdx,
type = _colMeta$column.type;
var text = dataContainer.mapIndex(function (row) {
return (0, _utils.parseFieldValue)(dataContainer.valueAt(row.index, colIdx), type);
}).join('\n');
(_navigator = navigator) === null || _navigator === void 0 || _navigator.clipboard.writeText(text);
}, [colMeta, dataContainer]);
var pinTableColumn = (0, _react.useCallback)(function (column) {
return pinnedColumns.includes(column) ? setPinnedColumns(pinnedColumns.filter(function (c) {
return c !== column;
})) : setPinnedColumns([].concat((0, _toConsumableArray2["default"])(pinnedColumns), [column]));
}, [pinnedColumns]);
// TODO Potentially costly operation for non row based data containers. Revisit sorting below.
var dataTableStyle = (0, _react.useMemo)(function () {
return {
minCellSize: minCellSize,
cellPadding: cellPadding,
optionsButton: theme.fieldTokenWidth + theme.fieldTokenRightMargin + optionButtonWidth + pinButton,
fontSize: theme.cellFontSize,
font: theme.fontFamily
};
}, [theme]);
var cellSizeCache = (0, _react.useMemo)(function () {
return columns.reduce(function (acc, column) {
var _colMeta$column2 = colMeta[column],
colIdx = _colMeta$column2.colIdx,
displayName = _colMeta$column2.displayName,
type = _colMeta$column2.type;
return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2["default"])({}, column, (0, _components.renderedSize)(_objectSpread({
text: {
dataContainer: dataContainer,
column: displayName
},
colIdx: colIdx,
type: type,
numRowsToCalculate: rowsToCalculatePreview
}, dataTableStyle))));
}, {});
}, [columns, colMeta, dataContainer, rowsToCalculatePreview, dataTableStyle]);
return /*#__PURE__*/_react["default"].createElement(_components.DataTable, {
colMeta: colMeta,
columns: columns,
cellSizeCache: cellSizeCache,
dataContainer: dataContainer,
pinnedColumns: pinnedColumns,
copyTableColumn: copyTableColumn,
pinTableColumn: pinTableColumn
});
};
var PreviewDataPanel = exports.PreviewDataPanel = (0, _styledComponents.with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