| 1 | "use strict";
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
|---|
| 4 | value: true
|
|---|
| 5 | });
|
|---|
| 6 | exports.selectScatterPoints = void 0;
|
|---|
| 7 | var _reselect = require("reselect");
|
|---|
| 8 | var _Scatter = require("../../cartesian/Scatter");
|
|---|
| 9 | var _dataSelectors = require("./dataSelectors");
|
|---|
| 10 | var _axisSelectors = require("./axisSelectors");
|
|---|
| 11 | var selectXAxisWithScale = (state, xAxisId, _yAxisId, _zAxisId, _id, _cells, isPanorama) => (0, _axisSelectors.selectAxisWithScale)(state, 'xAxis', xAxisId, isPanorama);
|
|---|
| 12 | var selectXAxisTicks = (state, xAxisId, _yAxisId, _zAxisId, _id, _cells, isPanorama) => (0, _axisSelectors.selectTicksOfGraphicalItem)(state, 'xAxis', xAxisId, isPanorama);
|
|---|
| 13 | var selectYAxisWithScale = (state, _xAxisId, yAxisId, _zAxisId, _id, _cells, isPanorama) => (0, _axisSelectors.selectAxisWithScale)(state, 'yAxis', yAxisId, isPanorama);
|
|---|
| 14 | var selectYAxisTicks = (state, _xAxisId, yAxisId, _zAxisId, _id, _cells, isPanorama) => (0, _axisSelectors.selectTicksOfGraphicalItem)(state, 'yAxis', yAxisId, isPanorama);
|
|---|
| 15 | var selectZAxis = (state, _xAxisId, _yAxisId, zAxisId) => (0, _axisSelectors.selectZAxisWithScale)(state, 'zAxis', zAxisId, false);
|
|---|
| 16 | var pickScatterId = (_state, _xAxisId, _yAxisId, _zAxisId, id) => id;
|
|---|
| 17 | var pickCells = (_state, _xAxisId, _yAxisId, _zAxisId, _id, cells) => cells;
|
|---|
| 18 | var scatterChartDataSelector = (state, _xAxisId, _yAxisId, _zAxisId, _id, _cells, isPanorama) => (0, _dataSelectors.selectChartDataWithIndexesIfNotInPanoramaPosition4)(state, undefined, undefined, isPanorama);
|
|---|
| 19 | var selectSynchronisedScatterSettings = (0, _reselect.createSelector)([_axisSelectors.selectUnfilteredCartesianItems, pickScatterId], (graphicalItems, id) => {
|
|---|
| 20 | return graphicalItems.filter(item => item.type === 'scatter').find(item => item.id === id);
|
|---|
| 21 | });
|
|---|
| 22 | var selectScatterPoints = exports.selectScatterPoints = (0, _reselect.createSelector)([scatterChartDataSelector, selectXAxisWithScale, selectXAxisTicks, selectYAxisWithScale, selectYAxisTicks, selectZAxis, selectSynchronisedScatterSettings, pickCells], (_ref, xAxis, xAxisTicks, yAxis, yAxisTicks, zAxis, scatterSettings, cells) => {
|
|---|
| 23 | var {
|
|---|
| 24 | chartData,
|
|---|
| 25 | dataStartIndex,
|
|---|
| 26 | dataEndIndex
|
|---|
| 27 | } = _ref;
|
|---|
| 28 | if (scatterSettings == null) {
|
|---|
| 29 | return undefined;
|
|---|
| 30 | }
|
|---|
| 31 | var displayedData;
|
|---|
| 32 | if ((scatterSettings === null || scatterSettings === void 0 ? void 0 : scatterSettings.data) != null && scatterSettings.data.length > 0) {
|
|---|
| 33 | displayedData = scatterSettings.data;
|
|---|
| 34 | } else {
|
|---|
| 35 | displayedData = chartData === null || chartData === void 0 ? void 0 : chartData.slice(dataStartIndex, dataEndIndex + 1);
|
|---|
| 36 | }
|
|---|
| 37 | if (displayedData == null || xAxis == null || yAxis == null || xAxisTicks == null || yAxisTicks == null || (xAxisTicks === null || xAxisTicks === void 0 ? void 0 : xAxisTicks.length) === 0 || (yAxisTicks === null || yAxisTicks === void 0 ? void 0 : yAxisTicks.length) === 0) {
|
|---|
| 38 | return undefined;
|
|---|
| 39 | }
|
|---|
| 40 | return (0, _Scatter.computeScatterPoints)({
|
|---|
| 41 | displayedData,
|
|---|
| 42 | xAxis,
|
|---|
| 43 | yAxis,
|
|---|
| 44 | zAxis,
|
|---|
| 45 | scatterSettings,
|
|---|
| 46 | xAxisTicks,
|
|---|
| 47 | yAxisTicks,
|
|---|
| 48 | cells
|
|---|
| 49 | });
|
|---|
| 50 | }); |
|---|