kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
61 lines (59 loc) • 9.28 kB
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = exports.SYNC_TIMELINE_ANIMATION_ITEMS = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _react = _interopRequireDefault(require("react"));
var _styledComponents = require("../common/styled-components");
var _localization = require("@kepler.gl/localization");
var _constants = require("@kepler.gl/constants");
var _iconButton = _interopRequireDefault(require("./icon-button"));
// SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
var SYNC_TIMELINE_ANIMATION_ITEMS = exports.SYNC_TIMELINE_ANIMATION_ITEMS = (0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, _constants.SYNC_TIMELINE_MODES.start, {
id: _constants.SYNC_TIMELINE_MODES.start,
content: function content() {
return /*#__PURE__*/_react["default"].createElement("span", null, "Start");
},
tooltip: 'tooltip.syncTimelineStart'
}), _constants.SYNC_TIMELINE_MODES.end, {
id: _constants.SYNC_TIMELINE_MODES.end,
content: function content() {
return /*#__PURE__*/_react["default"].createElement("span", null, "End");
},
tooltip: 'tooltip.syncTimelineEnd'
});
function SyncTimelineControlFactory() {
var SyncTimelineControl = function SyncTimelineControl(_ref) {
var _ref$syncTimelineAnim = _ref.syncTimelineAnimationItems,
syncTimelineAnimationItems = _ref$syncTimelineAnim === void 0 ? SYNC_TIMELINE_ANIMATION_ITEMS : _ref$syncTimelineAnim,
syncTimelineMode = _ref.syncTimelineMode,
btnStyle = _ref.btnStyle,
setFilterSyncTimelineMode = _ref.setFilterSyncTimelineMode;
return /*#__PURE__*/_react["default"].createElement("div", null, Object.values(syncTimelineAnimationItems).filter(function (item, _index) {
return item.id !== syncTimelineMode;
}).map(function (item) {
return /*#__PURE__*/_react["default"].createElement(_iconButton["default"], (0, _extends2["default"])({
key: item.id,
"data-tip": true,
"data-for": "".concat(item.id, "-tooltip"),
className: "playback-control-button",
onClick: function onClick() {
return setFilterSyncTimelineMode(item.id);
}
}, btnStyle), /*#__PURE__*/_react["default"].createElement(item.content, null), item.tooltip ? /*#__PURE__*/_react["default"].createElement(_styledComponents.Tooltip, {
id: "".concat(item.id, "-tooltip"),
effect: "solid",
place: "top"
}, /*#__PURE__*/_react["default"].createElement(_localization.FormattedMessage, {
id: item.tooltip
})) : null);
}));
};
return SyncTimelineControl;
}
var _default = exports["default"] = SyncTimelineControlFactory;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfcmVhY3QiLCJfaW50ZXJvcFJlcXVpcmVEZWZhdWx0IiwicmVxdWlyZSIsIl9zdHlsZWRDb21wb25lbnRzIiwiX2xvY2FsaXphdGlvbiIsIl9jb25zdGFudHMiLCJfaWNvbkJ1dHRvbiIsIlNZTkNfVElNRUxJTkVfQU5JTUFUSU9OX0lURU1TIiwiZXhwb3J0cyIsIl9kZWZpbmVQcm9wZXJ0eTIiLCJTWU5DX1RJTUVMSU5FX01PREVTIiwic3RhcnQiLCJpZCIsImNvbnRlbnQiLCJjcmVhdGVFbGVtZW50IiwidG9vbHRpcCIsImVuZCIsIlN5bmNUaW1lbGluZUNvbnRyb2xGYWN0b3J5IiwiU3luY1RpbWVsaW5lQ29udHJvbCIsIl9yZWYiLCJfcmVmJHN5bmNUaW1lbGluZUFuaW0iLCJzeW5jVGltZWxpbmVBbmltYXRpb25JdGVtcyIsInN5bmNUaW1lbGluZU1vZGUiLCJidG5TdHlsZSIsInNldEZpbHRlclN5bmNUaW1lbGluZU1vZGUiLCJPYmplY3QiLCJ2YWx1ZXMiLCJmaWx0ZXIiLCJpdGVtIiwiX2luZGV4IiwibWFwIiwiX2V4dGVuZHMyIiwia2V5IiwiY29uY2F0IiwiY2xhc3NOYW1lIiwib25DbGljayIsIlRvb2x0aXAiLC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ICAgLm1hcChpdGVtID0+IChcbiAgICAgICAgICAgIDxJY29uQnV0dG9uXG4gICAgICAgICAgICAgIGtleT17aXRlbS5pZH1cbiAgICAgICAgICAgICAgZGF0YS10aXBcbiAgICAgICAgICAgICAgZGF0YS1mb3I9e2Ake2l0ZW0uaWR9LXRvb2x0aXBgfVxuICAgICAgICAgICAgICBjbGFzc05hbWU9XCJwbGF5YmFjay1jb250cm9sLWJ1dHRvblwiXG4gICAgICAgICAgICAgIG9uQ2xpY2s9eygpID0+IHNldEZpbHRlclN5bmNUaW1lbGluZU1vZGUoaXRlbS5pZCl9XG4gICAgICAgICAgICAgIHsuLi5idG5TdHlsZX1cbiAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgPGl0ZW0uY29udGVudCAvPlxuICAgICAgICAgICAgICB7aXRlbS50b29sdGlwID8gKFxuICAgICAgICAgICAgICAgIDxUb29sdGlwIGlkPXtgJHtpdGVtLmlkfS10b29sdGlwYH0gZWZmZWN0PVwic29saWRcIiBwbGFjZT1cInRvcFwiPlxuICAgICAgICAgICAgICAgICAgPEZvcm1hdHRlZE1lc3NhZ2UgaWQ9e2l0ZW0udG9vbHRpcH0gLz5cbiAgICAgICAgICAgICAgICA8L1Rvb2x0aXA+XG4gICAgICAgICAgICAgICkgOiBudWxsfVxuICAgICAgICAgICAgPC9JY29uQnV0dG9uPlxuICAgICAgICAgICkpfVxuICAgICAgPC9kaXY+XG4gICAgKTtcbiAgfTtcblxuICByZXR1cm4gU3luY1RpbWVsaW5lQ29udHJvbDtcbn1cblxuZXhwb3J0IGRlZmF1bHQgU3luY1RpbWVsaW5lQ29udHJvbEZhY3Rvcnk7XG4iXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQUdBLElBQUFBLE1BQUEsR0FBQUMsc0JBQUEsQ0FBQUMsT0FBQTtBQUNBLElBQUFDLGlCQUFBLEdBQUFELE9BQUE7QUFDQSxJQUFBRSxhQUFBLEdBQUFGLE9BQUE7QUFDQSxJQUFBRyxVQ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