kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
115 lines (82 loc) • 9.18 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 _rangeSlider = _interopRequireDefault(require("../range-slider"));
var _reactOnclickoutside = _interopRequireDefault(require("react-onclickoutside"));
var _defaultSettings = require("../../../constants/default-settings");
function _templateObject2() {
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n bottom: 50px;\n right: calc(0% - 32px);\n width: 180px;\n padding: 2px 8px 2px 12px;\n background-color: ", ";\n box-shadow: -2px -2px 0 0 rgba(0, 0, 0, 0.1);\n .kg-range-slider__input {\n width: 36px;\n }\n"]);
_templateObject2 = function _templateObject2() {
return data;
};
return data;
}
function _templateObject() {
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n"]);
_templateObject = function _templateObject() {
return data;
};
return data;
}
var SliderWrapper = _styledComponents["default"].div(_templateObject());
var SpeedSliderContainer = _styledComponents["default"].div(_templateObject2(), function (props) {
return props.theme.panelBackground;
});
var AnimationSpeedSlider =
/*#__PURE__*/
function (_Component) {
(0, _inherits2["default"])(AnimationSpeedSlider, _Component);
function AnimationSpeedSlider() {
var _getPrototypeOf2;
var _this;
(0, _classCallCheck2["default"])(this, AnimationSpeedSlider);
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"])(AnimationSpeedSlider)).call.apply(_getPrototypeOf2, [this].concat(args)));
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleClickOutside", function (e) {
_this.props.onHide();
});
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_onChange", function (v) {
return _this.props.updateAnimationSpeed(v[1]);
});
return _this;
}
(0, _createClass2["default"])(AnimationSpeedSlider, [{
key: "render",
value: function render() {
return _react["default"].createElement(SpeedSliderContainer, {
className: "animation-control__speed-slider"
}, _react["default"].createElement(SliderWrapper, null, _react["default"].createElement(_rangeSlider["default"], {
range: _defaultSettings.SPEED_CONTROL_RANGE,
step: 0.01,
value0: 0,
value1: this.props.speed,
onChange: this._onChange,
isRanged: false,
showTooltip: true,
showInput: true,
inputTheme: "secondary",
inputSize: "tiny"
})));
}
}]);
return AnimationSpeedSlider;
}(_react.Component);
var _default = (0, _reactOnclickoutside["default"])(AnimationSpeedSlider);
exports["default"] = _default;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL2NvbW1vbi9hbmltYXRpb24tY29udHJvbC9hbmltYXRpb24tc3BlZWQtc2xpZGVyLmpzIl0sIm5hbWVzIjpbIlNsaWRlcldyYXBwZXIiLCJzdHlsZWQiLCJkaXYiLCJTcGVlZFNsaWRlckNvbnRhaW5lciIsInByb3BzIiwidGhlbWUiLCJwYW5lbEJhY2tncm91bmQiLCJBbmltYX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