UNPKG

kepler.gl

Version:

kepler.gl is a webgl based application to visualize large scale location data in the browser

313 lines (304 loc) 54.4 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _typeof = require("@babel/runtime/helpers/typeof"); Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = exports.HISTOGRAM_WIDTH = exports.HISTOGRAM_HEIGHT = exports.ColorChartTick = exports.ColorChartHeader = 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 _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")); var _d3Format = require("d3-format"); var _d3Scale = require("d3-scale"); var _react = _interopRequireWildcard(require("react")); var _styledComponents = _interopRequireDefault(require("styled-components")); var _utils = require("@kepler.gl/utils"); var _colorPalette = _interopRequireDefault(require("../side-panel/layer-panel/color-palette")); var _histogramPlot = _interopRequireWildcard(require("./histogram-plot")); var _loadingSpinner = _interopRequireDefault(require("./loading-spinner")); var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8; // SPDX-License-Identifier: MIT // Copyright contributors to the kepler.gl project 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; } var HISTOGRAM_WIDTH = exports.HISTOGRAM_WIDTH = 210; var HISTOGRAM_HEIGHT = exports.HISTOGRAM_HEIGHT = 80; var HISTOGRAM_MARGIN = { top: 10, bottom: 8, left: 10, right: 20 }; var COLOR_CHART_TICK_WRAPPER_HEIGHT = 10; var COLOR_CHART_TICK_HEIGHT = 8; var COLOR_CHART_TICK_WIDTH = 4; var COLOR_CHART_TICK_BORDER_COLOR = '#999999'; var StyledContainer = _styledComponents["default"].div.attrs({ className: 'color-chart-loading' })(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n height: ", "px;\n"])), HISTOGRAM_HEIGHT); // height 142 = 18 + 110 + 10 var ColorChartContainer = _styledComponents["default"].div.attrs({ className: 'color-chart-container' })(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n margin-top: 8px;\n"]))); var ColorChartHeaderWrapper = _styledComponents["default"].div.attrs({ className: 'color-chart-header' })(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-around;\n color: ", ";\n margin-left: ", "px;\n margin-right: ", "px;\n font-size: 9px;\n"])), function (props) { return props.theme.textColor; }, HISTOGRAM_MARGIN.left, HISTOGRAM_MARGIN.right); var ColorChartHeaderItem = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n width: 33%;\n overflow: hidden;\n white-space: nowrap;\n"]))); var ColorChartWrapper = _styledComponents["default"].div.attrs({ className: 'color-chart-wrapper' })(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n height: ", "px;\n"])), HISTOGRAM_HEIGHT + 30); var ColorPaletteWrapper = _styledComponents["default"].div.attrs({ className: 'color-chart-palette' })(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n margin-top: ", "px;\n margin-left: ", "px;\n margin-right: ", "px;\n"])), HISTOGRAM_MARGIN.top, HISTOGRAM_MARGIN.left, HISTOGRAM_MARGIN.right); var HistogramWrapper = _styledComponents["default"].div.attrs({ className: 'color-chart-histogram' })(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n"]))); var ColorChartTickContainer = _styledComponents["default"].div.attrs({ className: 'color-chart-tick-container' })(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n height: ", "px;\n position: relative;\n margin-left: ", "px;\n margin-right: ", "px;\n"])), COLOR_CHART_TICK_WRAPPER_HEIGHT, HISTOGRAM_MARGIN.left, HISTOGRAM_MARGIN.right); var ColorChartHeader = exports.ColorChartHeader = function ColorChartHeader(_ref) { var minVal = _ref.minVal, meanVal = _ref.meanVal, maxVal = _ref.maxVal; return /*#__PURE__*/_react["default"].createElement(ColorChartHeaderWrapper, null, /*#__PURE__*/_react["default"].createElement(ColorChartHeaderItem, { title: minVal }, "MIN: ", minVal), /*#__PURE__*/_react["default"].createElement(ColorChartHeaderItem, { title: meanVal }, "MEAN: ", (0, _d3Format.format)('.4~r')(meanVal)), /*#__PURE__*/_react["default"].createElement(ColorChartHeaderItem, { title: maxVal, style: { textAlign: 'right' } }, "MAX: ", maxVal)); }; var ColorChartTick = exports.ColorChartTick = function ColorChartTick(_ref2) { var colors = _ref2.colors, positions = _ref2.positions, histogramWidth = _ref2.histogramWidth, onTickMoving = _ref2.onTickMoving, onTickChanged = _ref2.onTickChanged; var _useState = (0, _react.useState)(positions), _useState2 = (0, _slicedToArray2["default"])(_useState, 2), statePositions = _useState2[0], setPositions = _useState2[1]; var _useState3 = (0, _react.useState)(-1), _useState4 = (0, _slicedToArray2["default"])(_useState3, 2), dragTick = _useState4[0], setDragTick = _useState4[1]; var containerRef = (0, _react.useRef)(null); (0, _react.useEffect)(function () { setPositions(positions); setDragTick(dragTick); }, [positions, dragTick]); var onMouseMove = (0, _react.useCallback)(function (e) { if (dragTick >= 0) { // @ts-ignore var offsetX = containerRef.current.getBoundingClientRect().x; statePositions[dragTick] = e.clientX - (offsetX !== null && offsetX !== void 0 ? offsetX : 0); var leftBound = dragTick === 0 ? 0 : statePositions[dragTick - 1] + 1; var rightBound = dragTick === positions.length - 1 ? histogramWidth : statePositions[dragTick + 1] - 1; // restrict user drag-n-move between left and right neighboring ticks if (statePositions[dragTick] < leftBound) { statePositions[dragTick] = leftBound; } if (statePositions[dragTick] > rightBound) { statePositions[dragTick] = rightBound; } setPositions((0, _toConsumableArray2["default"])(statePositions)); onTickMoving(statePositions, dragTick); } }, [dragTick, onTickMoving, positions.length, statePositions, histogramWidth]); var onMouseUp = (0, _react.useCallback)(function (e) { if (dragTick >= 0) { onTickChanged(); setDragTick(-1); e.stopPropagation(); e.preventDefault(); } }, [dragTick, onTickChanged]); var _onMouseDown = (0, _react.useCallback)(function (e, tickIndex) { if ((0, _utils.isNumber)(tickIndex)) { setDragTick(tickIndex); e.stopPropagation(); e.preventDefault(); } }, []); return /*#__PURE__*/_react["default"].createElement(ColorChartTickContainer, { ref: containerRef, onMouseMove: onMouseMove, onMouseUp: onMouseUp, onMouseLeave: onMouseUp }, colors.map(function (color, index) { return /*#__PURE__*/_react["default"].createElement("div", { draggable: true, key: "color-chart-tick-".concat(color, "-").concat(index), onMouseDown: function onMouseDown(e) { return _onMouseDown(e, index); }, style: { backgroundColor: color, left: "".concat(statePositions[index] - COLOR_CHART_TICK_WIDTH / 2 - 1, "px"), borderWidth: "1px", borderStyle: 'solid', borderColor: COLOR_CHART_TICK_BORDER_COLOR, position: 'absolute', width: "".concat(COLOR_CHART_TICK_WIDTH, "px"), height: "".concat(COLOR_CHART_TICK_HEIGHT, "px"), cursor: 'pointer' } }); })); }; // only for numetic field ColumnStatsChartFactory.deps = [_histogramPlot["default"]]; function ColumnStatsChartFactory(HistogramPlot) { var ColumnStatsChart = function ColumnStatsChart(_ref3) { var allBins = _ref3.allBins, filteredBins = _ref3.filteredBins, isFiltered = _ref3.isFiltered, histogramDomain = _ref3.histogramDomain, colorBreaks = _ref3.colorBreaks, onChangedUpdater = _ref3.onChangedUpdater; var _useState5 = (0, _react.useState)(colorBreaks), _useState6 = (0, _slicedToArray2["default"])(_useState5, 2), ticks = _useState6[0], setTicks = _useState6[1]; var _useDimensions = (0, _utils.useDimensions)(), _useDimensions2 = (0, _slicedToArray2["default"])(_useDimensions, 2), ref = _useDimensions2[0], size = _useDimensions2[1]; var histogramWidth = size ? size.width - HISTOGRAM_MARGIN.left - HISTOGRAM_MARGIN.right : HISTOGRAM_WIDTH; // distinguish between props.colorBreaks and states.ticks var isTickChangingRef = _react["default"].useRef(false); (0, _react.useEffect)(function () { setTicks(ticks); // reset isTickChanging once histogram domain is recomputed isTickChangingRef.current = false; }, [ticks]); // histograms used by histogram-plot.js var histogramsByGroup = (0, _react.useMemo)(function () { return { bins: allBins, filteredBins: filteredBins }; }, [allBins, filteredBins]); // get colors from colorBreaks var domainColors = (0, _react.useMemo)(function () { return colorBreaks ? colorBreaks.map(function (c) { return c.data; }) : []; }, [colorBreaks]); var tickPositions = (0, _react.useMemo)(function () { if (!isTickChangingRef.current) { setTicks(colorBreaks); } var _histogramDomain = (0, _slicedToArray2["default"])(histogramDomain, 2), valueMin = _histogramDomain[0], valueMax = _histogramDomain[1]; var widthScale = (0, _d3Scale.scaleLinear)().domain([valueMin, valueMax]).range([0, histogramWidth]); return ticks.slice(0, -1).map(function (cb) { var pos = widthScale(cb.range[1]); if (pos < 0) return 0;else if (pos > histogramWidth) return histogramWidth; return pos; }); }, [histogramDomain, ticks, colorBreaks, histogramWidth]); var domainColorWidths = (0, _react.useMemo)(function () { var n = tickPositions.length; var widths = [tickPositions[0]]; for (var i = 1; i < n; ++i) { widths.push(tickPositions[i] - tickPositions[i - 1]); } widths.push(histogramWidth - tickPositions[n - 1]); return widths; }, [tickPositions, histogramWidth]); // handle tick drag-n-move var onTickMovingHandler = (0, _react.useCallback)(function (newTickPositions, tickIndex) { var _histogramDomain2 = (0, _slicedToArray2["default"])(histogramDomain, 2), valueMin = _histogramDomain2[0], valueMax = _histogramDomain2[1]; var valueRange = valueMax - valueMin; var breaks = [valueMin]; newTickPositions.forEach(function (element) { breaks.push(valueMin + valueRange * element / histogramWidth); }); breaks.push(valueMax); for (var i = 0; i < ticks.length; ++i) { var leftValue = i === tickIndex + 1 ? breaks[i] : ticks[i].range[0]; var rightValue = i + 1 === tickIndex + 1 ? breaks[i + 1] : ticks[i].range[1]; ticks[i] = _objectSpread(_objectSpread({}, ticks[i]), {}, { range: [leftValue, rightValue], inputs: [leftValue, rightValue], label: "".concat((0, _d3Format.format)('.2f')(breaks[i]), " to ").concat((0, _d3Format.format)('.2f')(breaks[i + 1])) }); } isTickChangingRef.current = true; setTicks((0, _toConsumableArray2["default"])(ticks)); }, [histogramDomain, ticks, histogramWidth]); // update parent and sibling components when tick dragging ended var onTickChangedHandler = (0, _react.useCallback)(function () { onChangedUpdater(ticks); }, [onChangedUpdater, ticks]); return /*#__PURE__*/_react["default"].createElement(ColorChartContainer, { ref: ref }, /*#__PURE__*/_react["default"].createElement(ColorChartHeader, { minVal: histogramDomain[0], maxVal: histogramDomain[1], meanVal: histogramDomain[2] }), /*#__PURE__*/_react["default"].createElement(ColorChartWrapper, null, /*#__PURE__*/_react["default"].createElement(ColorPaletteWrapper, null, /*#__PURE__*/_react["default"].createElement(_colorPalette["default"], { colors: domainColors, colorWidths: domainColorWidths, height: HISTOGRAM_HEIGHT + 16 })), /*#__PURE__*/_react["default"].createElement(HistogramWrapper, null, /*#__PURE__*/_react["default"].createElement(HistogramPlot, { histogramsByGroup: histogramsByGroup, colorsByGroup: null, isMasked: isFiltered ? _histogramPlot.HISTOGRAM_MASK_MODE.MaskWithOverlay : _histogramPlot.HISTOGRAM_MASK_MODE.Mask, value: histogramDomain, width: histogramWidth, height: HISTOGRAM_HEIGHT, margin: HISTOGRAM_MARGIN, breakLines: tickPositions }))), /*#__PURE__*/_react["default"].createElement(ColorChartTick, { colors: domainColors.slice(0, -1), positions: tickPositions, histogramWidth: histogramWidth, onTickMoving: onTickMovingHandler, onTickChanged: onTickChangedHandler })); }; var ColumnStatsChartWLoading = function ColumnStatsChartWLoading(_ref4) { var colorField = _ref4.colorField, dataset = _ref4.dataset, colorBreaks = _ref4.colorBreaks, allBins = _ref4.allBins, filteredBins = _ref4.filteredBins, isFiltered = _ref4.isFiltered, histogramDomain = _ref4.histogramDomain, onChangedUpdater = _ref4.onChangedUpdater; var fieldName = colorField === null || colorField === void 0 ? void 0 : colorField.name; var field = (0, _react.useMemo)(function () { return fieldName ? dataset.getColumnField(fieldName) : null; }, [dataset, fieldName]); if (!(0, _utils.isNumericColorBreaks)(colorBreaks)) { // TODO: implement display for ordinal breaks return null; } if (field !== null && field !== void 0 && field.isLoadingStats) { return /*#__PURE__*/_react["default"].createElement(StyledContainer, null, /*#__PURE__*/_react["default"].createElement(_loadingSpinner["default"], null)); } return /*#__PURE__*/_react["default"].createElement(ColumnStatsChart, { colorBreaks: colorBreaks, allBins: allBins, filteredBins: filteredBins, isFiltered: isFiltered, histogramDomain: histogramDomain, onChangedUpdater: onChangedUpdater }); }; return ColumnStatsChartWLoading; } var _default = exports["default"] = ColumnStatsChartFactory; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfZ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PXtoaXN0b2dyYW1Eb21haW5bMV19XG4gICAgICAgICAgbWVhblZhbD17aGlzdG9ncmFtRG9tYWluWzJdfVxuICAgICAgICAvPlxuICAgICAgICA8Q29sb3JDaGFydFdyYXBwZXI+XG4gICAgICAgICAgPENvbG9yUGFsZXR0ZVdyYXBwZXI+XG4gICAgICAgICAgICA8Q29sb3JQYWxldHRlXG4gICAgICAgICAgICAgIGNvbG9ycz17ZG9tYWluQ29sb3JzfVxuICAgICAgICAgICAgICBjb2xvcldpZHRocz17ZG9tYWluQ29sb3JXaWR0aHN9XG4gICAgICAgICAgICAgIGhlaWdodD17SElTVE9HUkFNX0hFSUdIVCArIDE2fVxuICAgICAgICAgICAgLz5cbiAgICAgICAgICA8L0NvbG9yUGFsZXR0ZVdyYXBwZXI+XG4gICAgICAgICAgPEhpc3RvZ3JhbVdyYXBwZXI+XG4gICAgICAgICAgICA8SGlzdG9ncmFtUGxvdFxuICAgICAgICAgICAgICBoaXN0b2dyYW1zQnlHcm91cD17aGlzdG9ncmFtc0J5R3JvdXB9XG4gICAgICAgICAgICAgIGNvbG9yc0J5R3JvdXA9e251bGx9XG4gICAgICAgICAgICAgIGlzTWFza2VkPXtpc0ZpbHRlcmVkID8gSElTVE9HUkFNX01BU0tfTU9ERS5NYXNrV2l0aE92ZXJsYXkgOiBISVNUT0dSQU1fTUFTS19NT0RFLk1hc2t9XG4gICAgICAgICAgICAgIHZhbHVlPXtoaXN0b2dyYW1Eb21haW59XG4gICAgICAgICAgICAgIHdpZHRoPXtoaXN0b2dyYW1XaWR0aH1cbiAgICAgICAgICAgICAgaGVpZ2h0PXtISVNUT0dSQU1fSEVJR0hUfVxuICAgICAgICAgICAgICBtYXJnaW49e0hJU1RPR1JBTV9NQVJHSU59XG4gICAgICAgICAgICAgIGJyZWFrTGluZXM9e3RpY2tQb3NpdGlvbnN9XG4gICAgICAgICAgICAvPlxuICAgICAgICAgIDwvSGlzdG9ncmFtV3JhcHBlcj5cbiAgICAgICAgPC9Db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