kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
172 lines (142 loc) • 18.3 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 _react = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _reselect = require("reselect");
var _reactIntl = require("react-intl");
var _styledComponents = require("../common/styled-components");
var _icons = require("../common/icons");
var _sourceDataCatalog = _interopRequireDefault(require("./common/source-data-catalog"));
var _filterPanel = _interopRequireDefault(require("./filter-panel/filter-panel"));
// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
FilterManagerFactory.deps = [_sourceDataCatalog["default"], _filterPanel["default"]];
function FilterManagerFactory(SourceDataCatalog, FilterPanel) {
var _class, _temp;
return _temp = _class =
/*#__PURE__*/
function (_Component) {
(0, _inherits2["default"])(FilterManager, _Component);
function FilterManager() {
var _getPrototypeOf2;
var _this;
(0, _classCallCheck2["default"])(this, FilterManager);
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"])(FilterManager)).call.apply(_getPrototypeOf2, [this].concat(args)));
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "datasetsSelector", function (state) {
return state.datasets;
});
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "defaultDatasetSelector", (0, _reselect.createSelector)(_this.datasetsSelector, function (datasets) {
return Object.keys(datasets).length && Object.keys(datasets)[0] || null;
}));
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_addFilter", function () {
var defaultDataset = _this.defaultDatasetSelector(_this.props);
_this.props.addFilter(defaultDataset);
});
return _this;
}
(0, _createClass2["default"])(FilterManager, [{
key: "render",
value: function render() {
var _this2 = this;
var _this$props = this.props,
filters = _this$props.filters,
datasets = _this$props.datasets,
layers = _this$props.layers;
var isAnyFilterAnimating = filters.some(function (f) {
return f.isAnimating;
});
var hadEmptyFilter = filters.some(function (f) {
return !f.name;
});
var hadDataset = Object.keys(datasets).length;
return _react["default"].createElement("div", {
className: "filter-manager"
}, _react["default"].createElement(SourceDataCatalog, {
datasets: datasets,
showDatasetTable: this.props.showDatasetTable
}), _react["default"].createElement(_styledComponents.SidePanelDivider, null), _react["default"].createElement(_styledComponents.SidePanelSection, null, filters && filters.map(function (filter, idx) {
return _react["default"].createElement(FilterPanel, {
key: "".concat(filter.id, "-").concat(idx),
idx: idx,
filters: filters,
filter: filter,
datasets: datasets,
layers: layers,
isAnyFilterAnimating: isAnyFilterAnimating,
removeFilter: function removeFilter() {
return _this2.props.removeFilter(idx);
},
enlargeFilter: function enlargeFilter() {
return _this2.props.enlargeFilter(idx);
},
toggleAnimation: function toggleAnimation() {
return _this2.props.toggleAnimation(idx);
},
toggleFilterFeature: function toggleFilterFeature() {
return _this2.props.toggleFilterFeature(idx);
},
setFilter: _this2.props.setFilter
});
})), _react["default"].createElement(_styledComponents.Button, {
className: "add-filter-button",
inactive: hadEmptyFilter || !hadDataset,
width: "105px",
onClick: this._addFilter
}, _react["default"].createElement(_icons.Add, {
height: "12px"
}), _react["default"].createElement(_reactIntl.FormattedMessage, {
id: 'filterManager.addFilter'
})));
}
}]);
return FilterManager;
}(_react.Component), (0, _defineProperty2["default"])(_class, "propTypes", {
datasets: _propTypes["default"].object,
layers: _propTypes["default"].arrayOf(_propTypes["default"].any).isRequired,
addFilter: _propTypes["default"].func.isRequired,
removeFilter: _propTypes["default"].func.isRequired,
enlargeFilter: _propTypes["default"].func.isRequired,
toggleAnimation: _propTypes["default"].func.isRequired,
toggleFilterFeature: _propTypes["default"].func.isRequired,
setFilter: _propTypes["default"].func.isRequired,
filters: _propTypes["default"].arrayOf(_propTypes["default"].any).isRequired,
showDatasetTable: _propTypes["default"].func,
// fields can be undefined when dataset is not selected
fields: _propTypes["default"].arrayOf(_propTypes["default"].any)
}), _temp;
}
var _default = FilterManagerFactory;
exports["default"] = _default;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL3NpZGUtcGFuZWwvZmlsdGVyLW1hbmFnZXIuanMiXS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