kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
200 lines (162 loc) • 24.2 kB
JavaScript
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _getPrototypeOf3 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
var _react = _interopRequireWildcard(require("react"));
var _styledComponents = _interopRequireDefault(require("styled-components"));
var _reselect = require("reselect");
var _fieldSelector = _interopRequireDefault(require("../common/field-selector"));
var _styledComponents2 = require("../common/styled-components");
var _icons = require("../common/icons");
var _speedControl = _interopRequireDefault(require("../common/animation-control/speed-control"));
var _timeRangeFilter = _interopRequireDefault(require("./time-range-filter"));
var _floatingTimeDisplay = _interopRequireDefault(require("../common/animation-control/floating-time-display"));
function _templateObject2() {
var data = (0, _taggedTemplateLiteral2["default"])(["\n flex-grow: 0;\n color: ", ";\n margin-right: 10px;\n\n .bottom-widget__icon {\n margin-right: 6px;\n }\n .bottom-widget__icon.speed {\n margin-right: 0;\n }\n"]);
_templateObject2 = function _templateObject2() {
return data;
};
return data;
}
function _templateObject() {
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n width: 100%;\n color: ", ";\n height: ", ";\n\n .bottom-widget__y-axis {\n flex-grow: 1;\n margin-left: 20px;\n }\n\n .bottom-widget__field-select {\n width: 160px;\n display: inline-block;\n\n .item-selector__dropdown {\n background: transparent;\n padding: 4px 10px 4px 4px;\n border-color: transparent;\n\n :active,\n :focus,\n &.focus,\n &.active {\n background: transparent;\n border-color: transparent;\n }\n }\n\n .item-selector__dropdown:hover {\n background: transparent;\n border-color: transparent;\n\n .item-selector__dropdown__value {\n color: ", ";\n }\n }\n }\n\n .animation-control__speed-control {\n margin-right: -12px;\n\n .animation-control__speed-slider {\n right: calc(0% - 48px);\n }\n }\n"]);
_templateObject = function _templateObject() {
return data;
};
return data;
}
var TOP_SECTION_HEIGHT = '36px';
var TopSectionWrapper = _styledComponents["default"].div(_templateObject(), function (props) {
return props.theme.labelColor;
}, TOP_SECTION_HEIGHT, function (props) {
return props.hoverColor ? props.theme[props.hoverColor] : props.theme.textColorHl;
});
var StyledTitle = (0, _styledComponents["default"])(_styledComponents2.CenterFlexbox)(_templateObject2(), function (props) {
return props.theme.textColor;
});
TimeWidgetFactory.deps = [_speedControl["default"], _timeRangeFilter["default"], _floatingTimeDisplay["default"]];
function TimeWidgetFactory(SpeedControl, TimeRangeFilter, FloatingTimeDisplay) {
var TimeWidget =
/*#__PURE__*/
function (_Component) {
(0, _inherits2["default"])(TimeWidget, _Component);
function TimeWidget() {
var _getPrototypeOf2;
var _this;
(0, _classCallCheck2["default"])(this, TimeWidget);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = (0, _possibleConstructorReturn2["default"])(this, (_getPrototypeOf2 = (0, _getPrototypeOf3["default"])(TimeWidget)).call.apply(_getPrototypeOf2, [this].concat(args)));
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
showSpeedControl: false
});
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "fieldSelector", function (props) {
return props.fields;
});
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "yAxisFieldsSelector", (0, _reselect.createSelector)(_this.fieldSelector, function (fields) {
return fields.filter(function (f) {
return f.type === 'integer' || f.type === 'real';
});
}));
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_updateAnimationSpeed", function (speed) {
return _this.props.updateAnimationSpeed(_this.props.index, speed);
});
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_toggleSpeedControl", function () {
return _this.setState({
showSpeedControl: !_this.state.showSpeedControl
});
});
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_setFilterPlotYAxis", function (value) {
return _this.props.setFilterPlot(_this.props.index, {
yAxis: value
});
});
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_updateAnimationSpeed", function (speed) {
return _this.props.updateAnimationSpeed(_this.props.index, speed);
});
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_toggleAnimation", function () {
return _this.props.toggleAnimation(_this.props.index);
});
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_onClose", function () {
return _this.props.enlargeFilter(_this.props.index);
});
return _this;
}
(0, _createClass2["default"])(TimeWidget, [{
key: "render",
value: function render() {
var _this$props = this.props,
datasets = _this$props.datasets,
filter = _this$props.filter,
index = _this$props.index,
readOnly = _this$props.readOnly,
_setFilter = _this$props.setFilter,
showTimeDisplay = _this$props.showTimeDisplay;
var showSpeedControl = this.state.showSpeedControl;
return _react["default"].createElement(_styledComponents2.BottomWidgetInner, {
className: "bottom-widget--inner"
}, _react["default"].createElement(TopSectionWrapper, null, _react["default"].createElement(StyledTitle, {
className: "bottom-widget__field"
}, _react["default"].createElement(_styledComponents2.CenterFlexbox, {
className: "bottom-widget__icon"
}, _react["default"].createElement(_icons.Clock, {
height: "15px"
})), _react["default"].createElement(_styledComponents2.SelectTextBold, null, filter.name)), _react["default"].createElement(StyledTitle, {
className: "bottom-widget__y-axis"
}, _react["default"].createElement(_styledComponents2.CenterFlexbox, {
className: "bottom-widget__icon"
}, _react["default"].createElement(_icons.LineChart, {
height: "15px"
})), _react["default"].createElement("div", {
className: "bottom-widget__field-select"
}, _react["default"].createElement(_fieldSelector["default"], {
fields: this.yAxisFieldsSelector(datasets[filter.dataId[0]]),
placement: "top",
id: "selected-time-widget-field",
value: filter.yAxis ? filter.yAxis.name : null,
onSelect: this._setFilterPlotYAxis,
placeholder: "placeholder.yAxis",
erasable: true,
showToken: false
}))), _react["default"].createElement(StyledTitle, {
className: "bottom-widget__speed"
}, _react["default"].createElement(SpeedControl, {
onClick: this._toggleSpeedControl,
showSpeedControl: showSpeedControl,
updateAnimationSpeed: this._updateAnimationSpeed,
speed: filter.speed
})), !readOnly ? _react["default"].createElement(_styledComponents2.CenterFlexbox, null, _react["default"].createElement(_styledComponents2.IconRoundSmall, null, _react["default"].createElement(_icons.Close, {
height: "12px",
onClick: this._onClose
}))) : null), _react["default"].createElement(TimeRangeFilter, {
filter: filter,
setFilter: function setFilter(value) {
return _setFilter(index, 'value', value);
},
toggleAnimation: this._toggleAnimation,
hideTimeTitle: showTimeDisplay,
isAnimatable: true
}), showTimeDisplay ? _react["default"].createElement(FloatingTimeDisplay, {
currentTime: filter.value
}) : null);
}
}]);
return TimeWidget;
}(_react.Component);
return TimeWidget;
}
var _default = TimeWidgetFactory;
exports["default"] = _default;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL2ZpbHRlcnMvdGltZS13aWRnZXQuanMiXSwibmFtZXMiOlsiVE9QX1NFQ1RJT05fSEVJR0hUIiwiVG9wU2VjdGlvbldyYXBwZXIiLCJzdHlsZWQiLCJkaXYiLCJwcm9wcyIsInRoZW1lIiwibGFiZWxDb2xvciIsImhvdmVyQ29sb3IiLCJ0ZXh0Q29sb3JIbCIsIlN0eWxlZFRpdGxlIiwiQ2VudGVyRmxleGJveCIsInRleHRDb2xvciIsIlRpbWVXaWRnZXRGYWN0b3J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iAgICAgICAgICAgICAgPC9DZW50ZXJGbGV4Ym94PlxuICAgICAgICAgICAgICA8U2VsZWN0VGV4dEJvbGQ+e2ZpbHRlci5uYW1lfTwvU2VsZWN0VGV4dEJvbGQ+XG4gICAgICAgICAgICA8L1N0eWxlZFRpdGxlPlxuICAgICAgICAgICAgPFN0eWxlZFRpdGxlIGNsYXNzTmFtZT1cImJvdHRvbS13aWRnZXRfX3ktYXhpc1wiPlxuICAgICAgICAgICAgICA8Q2VudGVyRmxleGJveCBjbGFzc05hbWU9XCJib3R0b20td2lkZ2V0X19pY29uXCI+XG4gICAgICAgICAgICAgICAgPExpbmVDaGFydCBoZWlnaHQ9XCIxNXB4XCIgLz5cbiAgICAgICAgICAgICAgPC9DZW50ZXJGbGV4Ym94PlxuICAgICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cImJvdHRvbS13aWRnZXRfX2ZpZWxkLXNlbGVjdFwiPlxuICAgICAgICAgICAgICAgIDxGaWVsZFNlbGVjdG9yXG4gICAgICAgICAgICAgICAgICBmaWVsZHM9e3RoaXMueUF4aXNGaWVsZHNTZWxlY3RvcihkYXRhc2V0c1tmaWx0ZXIuZGF0YUlkWzBdXSl9XG4gICAgICAgICAgICAgICAgICBwbGFjZW1lbnQ9XCJ0b3BcIlxuICAgICAgICAgICAgICAgICAgaWQ9XCJzZWxlY3RlZC10aW1lLXdpZGdldC1maWVsZFwiXG4gICAgICAgICAgICAgICAgICB2YWx1ZT17ZmlsdGVyLnlBeGlzID8gZmlsdGVyLnlBeGlzLm5hbWUgOiBudWxsfVxuICAgICAgICAgICAgICAgICAgb25TZWxlY3Q9e3RoaXMuX3NldEZpbHRlclBsb3RZQXhpc31cbiAgICAgICAgICAgICAgICAgIHBsYWNlaG9sZGVyPVwicGxhY2Vob2xkZXIueUF4aXNcIlxuICAgICAgICAgICAgICAgICAgZXJhc2FibGVcbiAgICAgICAgICAgICAgICAgIHNob3dUb2tlbj17ZmFsc2V9XG4gICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICA8L1N0eWxlZFRpdGxlPlxuICAgICAgICAgICAgPFN0eWxlZFRpdGxlIGNsYXNzTmFtZT1cImJvdHRvbS13aWRnZXRfX3NwZWVkXCI+XG4gICAgICAgICAgICAgIDxTcGVlZENvbnRyb2xcbiAgICAgICAgICAgICAgICBvbkNsaWNrPXt0aGlzLl90b2dnbGVTcGVlZENvbnRyb2x9XG4gICAgICAgICAgICAgICAgc2hvd1NwZWVkQ29udHJvbD17c2hvd1NwZWVkQ29udHJvbH1cbiAgICAgICAgICAgICAgICB1cGRhdGVBbmltYXRpb25TcGVlZD17dGhpcy5fdXBkYXRlQW5pbWF0aW9uU3BlZWR9XG4gICAgICAgICAgICAgICAgc3BlZWQ9e2ZpbHRlci5zcGVlZH1cbiAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgIDwvU3R5bGVkVGl0bGU+XG4gICAgICAgICAgICB7IXJlYWRPbmx5ID8gKFxuICAgICAgICAgICAgICA8Q2VudGVyRmxleGJveD5cbiAgICAgICAgICAgICAgICA8SWNvblJvdW5kU21hbGw+XG4gICAgICAgICAgICAgICAgICA8Q2xvc2UgaGVpZ2h0PVwiMTJweFwiIG9uQ2xpY2s9e3RoaXMuX29uQ2xvc2V9IC8+XG4gICAgICAgICAgICAgICAgPC9JY29uUm91bmRTbWFsbD5cbiAgICAgICAgICAgICAgPC9DZW50ZXJGbGV4Ym94PlxuICAgICAgICAgICAgKSA6IG51bGx9XG4gICAgICAgICAgPC9Ub3BTZWN0aW9uV3JhcHBlcj5cbiAgICAgICAgICA8VGltZVJhbmdlRmlsdGVyXG4gICAgICAgICAgICBmaWx0ZXI9e2ZpbHRlcn1cbiAgICAgICAgICAgIHNldEZpbHRlcj17dmFsdWUgPT4gc2V0RmlsdGVyKGluZGV4LCAndmFsdWUnLCB2YWx1ZSl9XG4gICAgICAgICAgICB0b2dnbGVBbmltYXRpb249e3RoaXMuX3RvZ2dsZ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