Add settings page for managing forecasting API key and URL via UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cae411eae7
commit
1c411e402e
19809 changed files with 1962608 additions and 97 deletions
98
frontend/node_modules/recharts/lib/state/selectors/areaSelectors.js
generated
vendored
Normal file
98
frontend/node_modules/recharts/lib/state/selectors/areaSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectGraphicalItemStackedData = exports.selectArea = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _Area = require("../../cartesian/Area");
|
||||
var _axisSelectors = require("./axisSelectors");
|
||||
var _chartLayoutContext = require("../../context/chartLayoutContext");
|
||||
var _dataSelectors = require("./dataSelectors");
|
||||
var _ChartUtils = require("../../util/ChartUtils");
|
||||
var _getStackSeriesIdentifier = require("../../util/stacks/getStackSeriesIdentifier");
|
||||
var _rootPropsSelectors = require("./rootPropsSelectors");
|
||||
var _graphicalItemSelectors = require("./graphicalItemSelectors");
|
||||
var selectXAxisWithScale = (state, graphicalItemId, isPanorama) => (0, _axisSelectors.selectAxisWithScale)(state, 'xAxis', (0, _graphicalItemSelectors.selectXAxisIdFromGraphicalItemId)(state, graphicalItemId), isPanorama);
|
||||
var selectXAxisTicks = (state, graphicalItemId, isPanorama) => (0, _axisSelectors.selectTicksOfGraphicalItem)(state, 'xAxis', (0, _graphicalItemSelectors.selectXAxisIdFromGraphicalItemId)(state, graphicalItemId), isPanorama);
|
||||
var selectYAxisWithScale = (state, graphicalItemId, isPanorama) => (0, _axisSelectors.selectAxisWithScale)(state, 'yAxis', (0, _graphicalItemSelectors.selectYAxisIdFromGraphicalItemId)(state, graphicalItemId), isPanorama);
|
||||
var selectYAxisTicks = (state, graphicalItemId, isPanorama) => (0, _axisSelectors.selectTicksOfGraphicalItem)(state, 'yAxis', (0, _graphicalItemSelectors.selectYAxisIdFromGraphicalItemId)(state, graphicalItemId), isPanorama);
|
||||
var selectBandSize = (0, _reselect.createSelector)([_chartLayoutContext.selectChartLayout, selectXAxisWithScale, selectYAxisWithScale, selectXAxisTicks, selectYAxisTicks], (layout, xAxis, yAxis, xAxisTicks, yAxisTicks) => {
|
||||
if ((0, _ChartUtils.isCategoricalAxis)(layout, 'xAxis')) {
|
||||
return (0, _ChartUtils.getBandSizeOfAxis)(xAxis, xAxisTicks, false);
|
||||
}
|
||||
return (0, _ChartUtils.getBandSizeOfAxis)(yAxis, yAxisTicks, false);
|
||||
});
|
||||
var pickAreaId = (_state, id) => id;
|
||||
|
||||
/*
|
||||
* There is a race condition problem because we read some data from props and some from the state.
|
||||
* The state is updated through a dispatch and is one render behind,
|
||||
* and so we have this weird one tick render where the displayedData in one selector have the old dataKey
|
||||
* but the new dataKey in another selector.
|
||||
*
|
||||
* A proper fix is to either move everything into the state, or read the dataKey always from props
|
||||
* - but this is a smaller change.
|
||||
*/
|
||||
var selectSynchronisedAreaSettings = (0, _reselect.createSelector)([_axisSelectors.selectUnfilteredCartesianItems, pickAreaId], (graphicalItems, id) => graphicalItems.filter(item => item.type === 'area').find(item => item.id === id));
|
||||
var selectNumericalAxisType = state => {
|
||||
var layout = (0, _chartLayoutContext.selectChartLayout)(state);
|
||||
var isXAxisCategorical = (0, _ChartUtils.isCategoricalAxis)(layout, 'xAxis');
|
||||
return isXAxisCategorical ? 'yAxis' : 'xAxis';
|
||||
};
|
||||
var selectNumericalAxisIdFromGraphicalItemId = (state, graphicalItemId) => {
|
||||
var axisType = selectNumericalAxisType(state);
|
||||
if (axisType === 'yAxis') {
|
||||
return (0, _graphicalItemSelectors.selectYAxisIdFromGraphicalItemId)(state, graphicalItemId);
|
||||
}
|
||||
return (0, _graphicalItemSelectors.selectXAxisIdFromGraphicalItemId)(state, graphicalItemId);
|
||||
};
|
||||
var selectNumericalAxisStackGroups = (state, graphicalItemId, isPanorama) => (0, _axisSelectors.selectStackGroups)(state, selectNumericalAxisType(state), selectNumericalAxisIdFromGraphicalItemId(state, graphicalItemId), isPanorama);
|
||||
var selectGraphicalItemStackedData = exports.selectGraphicalItemStackedData = (0, _reselect.createSelector)([selectSynchronisedAreaSettings, selectNumericalAxisStackGroups], (areaSettings, stackGroups) => {
|
||||
var _stackGroups$stackId;
|
||||
if (areaSettings == null || stackGroups == null) {
|
||||
return undefined;
|
||||
}
|
||||
var stackId = areaSettings.stackId;
|
||||
var stackSeriesIdentifier = (0, _getStackSeriesIdentifier.getStackSeriesIdentifier)(areaSettings);
|
||||
if (stackId == null || stackSeriesIdentifier == null) {
|
||||
return undefined;
|
||||
}
|
||||
var groups = (_stackGroups$stackId = stackGroups[stackId]) === null || _stackGroups$stackId === void 0 ? void 0 : _stackGroups$stackId.stackedData;
|
||||
var found = groups === null || groups === void 0 ? void 0 : groups.find(v => v.key === stackSeriesIdentifier);
|
||||
if (found == null) {
|
||||
return undefined;
|
||||
}
|
||||
return found.map(item => [item[0], item[1]]);
|
||||
});
|
||||
var selectArea = exports.selectArea = (0, _reselect.createSelector)([_chartLayoutContext.selectChartLayout, selectXAxisWithScale, selectYAxisWithScale, selectXAxisTicks, selectYAxisTicks, selectGraphicalItemStackedData, _dataSelectors.selectChartDataWithIndexesIfNotInPanoramaPosition3, selectBandSize, selectSynchronisedAreaSettings, _rootPropsSelectors.selectChartBaseValue], (layout, xAxis, yAxis, xAxisTicks, yAxisTicks, stackedData, _ref, bandSize, areaSettings, chartBaseValue) => {
|
||||
var chartData = _ref.chartData,
|
||||
dataStartIndex = _ref.dataStartIndex,
|
||||
dataEndIndex = _ref.dataEndIndex;
|
||||
if (areaSettings == null || layout !== 'horizontal' && layout !== 'vertical' || xAxis == null || yAxis == null || xAxisTicks == null || yAxisTicks == null || xAxisTicks.length === 0 || yAxisTicks.length === 0 || bandSize == null) {
|
||||
return undefined;
|
||||
}
|
||||
var data = areaSettings.data;
|
||||
var displayedData;
|
||||
if (data && data.length > 0) {
|
||||
displayedData = data;
|
||||
} else {
|
||||
displayedData = chartData === null || chartData === void 0 ? void 0 : chartData.slice(dataStartIndex, dataEndIndex + 1);
|
||||
}
|
||||
if (displayedData == null) {
|
||||
return undefined;
|
||||
}
|
||||
return (0, _Area.computeArea)({
|
||||
layout,
|
||||
xAxis,
|
||||
yAxis,
|
||||
xAxisTicks,
|
||||
yAxisTicks,
|
||||
dataStartIndex,
|
||||
areaSettings,
|
||||
stackedData,
|
||||
displayedData,
|
||||
chartBaseValue,
|
||||
bandSize
|
||||
});
|
||||
});
|
||||
37
frontend/node_modules/recharts/lib/state/selectors/arrayEqualityCheck.js
generated
vendored
Normal file
37
frontend/node_modules/recharts/lib/state/selectors/arrayEqualityCheck.js
generated
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.arrayContentsAreEqualCheck = arrayContentsAreEqualCheck;
|
||||
exports.emptyArraysAreEqualCheck = emptyArraysAreEqualCheck;
|
||||
/**
|
||||
* Checks if two arrays are equal, treating empty arrays as equal regardless of reference.
|
||||
* If both arrays are non-empty, it checks for reference equality.
|
||||
* @param a
|
||||
* @param b
|
||||
*/
|
||||
function emptyArraysAreEqualCheck(a, b) {
|
||||
if (Array.isArray(a) && Array.isArray(b) && a.length === 0 && b.length === 0) {
|
||||
// empty arrays are always equal, regardless of reference
|
||||
return true;
|
||||
}
|
||||
return a === b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if two arrays have the same contents in the same order.
|
||||
* @param a
|
||||
* @param b
|
||||
*/
|
||||
function arrayContentsAreEqualCheck(a, b) {
|
||||
if (a.length === b.length) {
|
||||
for (var i = 0; i < a.length; i++) {
|
||||
if (a[i] !== b[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
1499
frontend/node_modules/recharts/lib/state/selectors/axisSelectors.js
generated
vendored
Normal file
1499
frontend/node_modules/recharts/lib/state/selectors/axisSelectors.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
166
frontend/node_modules/recharts/lib/state/selectors/barSelectors.js
generated
vendored
Normal file
166
frontend/node_modules/recharts/lib/state/selectors/barSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectStackedDataOfItem = exports.selectMaxBarSize = exports.selectBarSizeList = exports.selectBarRectangles = exports.selectBarPosition = exports.selectBarCartesianAxisSize = exports.selectBarBandSize = exports.selectAxisBandSize = exports.selectAllVisibleBars = exports.selectAllBarPositions = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _axisSelectors = require("./axisSelectors");
|
||||
var _DataUtils = require("../../util/DataUtils");
|
||||
var _ChartUtils = require("../../util/ChartUtils");
|
||||
var _Bar = require("../../cartesian/Bar");
|
||||
var _chartLayoutContext = require("../../context/chartLayoutContext");
|
||||
var _dataSelectors = require("./dataSelectors");
|
||||
var _selectChartOffsetInternal = require("./selectChartOffsetInternal");
|
||||
var _rootPropsSelectors = require("./rootPropsSelectors");
|
||||
var _combineBarSizeList = require("./combiners/combineBarSizeList");
|
||||
var _combineAllBarPositions = require("./combiners/combineAllBarPositions");
|
||||
var _combineStackedData = require("./combiners/combineStackedData");
|
||||
var _graphicalItemSelectors = require("./graphicalItemSelectors");
|
||||
var _combineBarPosition = require("./combiners/combineBarPosition");
|
||||
var pickIsPanorama = (_state, _id, isPanorama) => isPanorama;
|
||||
var pickBarId = (_state, id) => id;
|
||||
var selectSynchronisedBarSettings = (0, _reselect.createSelector)([_axisSelectors.selectUnfilteredCartesianItems, pickBarId], (graphicalItems, id) => graphicalItems.filter(item => item.type === 'bar').find(item => item.id === id));
|
||||
var selectMaxBarSize = exports.selectMaxBarSize = (0, _reselect.createSelector)([selectSynchronisedBarSettings], barSettings => barSettings === null || barSettings === void 0 ? void 0 : barSettings.maxBarSize);
|
||||
var pickCells = (_state, _id, _isPanorama, cells) => cells;
|
||||
var selectAllVisibleBars = exports.selectAllVisibleBars = (0, _reselect.createSelector)([_chartLayoutContext.selectChartLayout, _axisSelectors.selectUnfilteredCartesianItems, _graphicalItemSelectors.selectXAxisIdFromGraphicalItemId, _graphicalItemSelectors.selectYAxisIdFromGraphicalItemId, pickIsPanorama], (layout, allItems, xAxisId, yAxisId, isPanorama) => allItems.filter(i => {
|
||||
if (layout === 'horizontal') {
|
||||
return i.xAxisId === xAxisId;
|
||||
}
|
||||
return i.yAxisId === yAxisId;
|
||||
}).filter(i => i.isPanorama === isPanorama).filter(i => i.hide === false).filter(i => i.type === 'bar'));
|
||||
var selectBarStackGroups = (state, id, isPanorama) => {
|
||||
var layout = (0, _chartLayoutContext.selectChartLayout)(state);
|
||||
var xAxisId = (0, _graphicalItemSelectors.selectXAxisIdFromGraphicalItemId)(state, id);
|
||||
var yAxisId = (0, _graphicalItemSelectors.selectYAxisIdFromGraphicalItemId)(state, id);
|
||||
if (xAxisId == null || yAxisId == null) {
|
||||
return undefined;
|
||||
}
|
||||
if (layout === 'horizontal') {
|
||||
return (0, _axisSelectors.selectStackGroups)(state, 'yAxis', yAxisId, isPanorama);
|
||||
}
|
||||
return (0, _axisSelectors.selectStackGroups)(state, 'xAxis', xAxisId, isPanorama);
|
||||
};
|
||||
var selectBarCartesianAxisSize = (state, id) => {
|
||||
var layout = (0, _chartLayoutContext.selectChartLayout)(state);
|
||||
var xAxisId = (0, _graphicalItemSelectors.selectXAxisIdFromGraphicalItemId)(state, id);
|
||||
var yAxisId = (0, _graphicalItemSelectors.selectYAxisIdFromGraphicalItemId)(state, id);
|
||||
if (xAxisId == null || yAxisId == null) {
|
||||
return undefined;
|
||||
}
|
||||
if (layout === 'horizontal') {
|
||||
return (0, _axisSelectors.selectCartesianAxisSize)(state, 'xAxis', xAxisId);
|
||||
}
|
||||
return (0, _axisSelectors.selectCartesianAxisSize)(state, 'yAxis', yAxisId);
|
||||
};
|
||||
exports.selectBarCartesianAxisSize = selectBarCartesianAxisSize;
|
||||
var selectBarSizeList = exports.selectBarSizeList = (0, _reselect.createSelector)([selectAllVisibleBars, _rootPropsSelectors.selectRootBarSize, selectBarCartesianAxisSize], _combineBarSizeList.combineBarSizeList);
|
||||
var selectBarBandSize = (state, id, isPanorama) => {
|
||||
var _ref, _getBandSizeOfAxis;
|
||||
var barSettings = selectSynchronisedBarSettings(state, id);
|
||||
if (barSettings == null) {
|
||||
return 0;
|
||||
}
|
||||
var xAxisId = (0, _graphicalItemSelectors.selectXAxisIdFromGraphicalItemId)(state, id);
|
||||
var yAxisId = (0, _graphicalItemSelectors.selectYAxisIdFromGraphicalItemId)(state, id);
|
||||
if (xAxisId == null || yAxisId == null) {
|
||||
return 0;
|
||||
}
|
||||
var layout = (0, _chartLayoutContext.selectChartLayout)(state);
|
||||
var globalMaxBarSize = (0, _rootPropsSelectors.selectRootMaxBarSize)(state);
|
||||
var childMaxBarSize = barSettings.maxBarSize;
|
||||
var maxBarSize = (0, _DataUtils.isNullish)(childMaxBarSize) ? globalMaxBarSize : childMaxBarSize;
|
||||
var axis, ticks;
|
||||
if (layout === 'horizontal') {
|
||||
axis = (0, _axisSelectors.selectAxisWithScale)(state, 'xAxis', xAxisId, isPanorama);
|
||||
ticks = (0, _axisSelectors.selectTicksOfGraphicalItem)(state, 'xAxis', xAxisId, isPanorama);
|
||||
} else {
|
||||
axis = (0, _axisSelectors.selectAxisWithScale)(state, 'yAxis', yAxisId, isPanorama);
|
||||
ticks = (0, _axisSelectors.selectTicksOfGraphicalItem)(state, 'yAxis', yAxisId, isPanorama);
|
||||
}
|
||||
return (_ref = (_getBandSizeOfAxis = (0, _ChartUtils.getBandSizeOfAxis)(axis, ticks, true)) !== null && _getBandSizeOfAxis !== void 0 ? _getBandSizeOfAxis : maxBarSize) !== null && _ref !== void 0 ? _ref : 0;
|
||||
};
|
||||
exports.selectBarBandSize = selectBarBandSize;
|
||||
var selectAxisBandSize = (state, id, isPanorama) => {
|
||||
var layout = (0, _chartLayoutContext.selectChartLayout)(state);
|
||||
var xAxisId = (0, _graphicalItemSelectors.selectXAxisIdFromGraphicalItemId)(state, id);
|
||||
var yAxisId = (0, _graphicalItemSelectors.selectYAxisIdFromGraphicalItemId)(state, id);
|
||||
if (xAxisId == null || yAxisId == null) {
|
||||
return undefined;
|
||||
}
|
||||
var axis, ticks;
|
||||
if (layout === 'horizontal') {
|
||||
axis = (0, _axisSelectors.selectAxisWithScale)(state, 'xAxis', xAxisId, isPanorama);
|
||||
ticks = (0, _axisSelectors.selectTicksOfGraphicalItem)(state, 'xAxis', xAxisId, isPanorama);
|
||||
} else {
|
||||
axis = (0, _axisSelectors.selectAxisWithScale)(state, 'yAxis', yAxisId, isPanorama);
|
||||
ticks = (0, _axisSelectors.selectTicksOfGraphicalItem)(state, 'yAxis', yAxisId, isPanorama);
|
||||
}
|
||||
return (0, _ChartUtils.getBandSizeOfAxis)(axis, ticks);
|
||||
};
|
||||
exports.selectAxisBandSize = selectAxisBandSize;
|
||||
var selectAllBarPositions = exports.selectAllBarPositions = (0, _reselect.createSelector)([selectBarSizeList, _rootPropsSelectors.selectRootMaxBarSize, _rootPropsSelectors.selectBarGap, _rootPropsSelectors.selectBarCategoryGap, selectBarBandSize, selectAxisBandSize, selectMaxBarSize], _combineAllBarPositions.combineAllBarPositions);
|
||||
var selectXAxisWithScale = (state, id, isPanorama) => {
|
||||
var xAxisId = (0, _graphicalItemSelectors.selectXAxisIdFromGraphicalItemId)(state, id);
|
||||
if (xAxisId == null) {
|
||||
return undefined;
|
||||
}
|
||||
return (0, _axisSelectors.selectAxisWithScale)(state, 'xAxis', xAxisId, isPanorama);
|
||||
};
|
||||
var selectYAxisWithScale = (state, id, isPanorama) => {
|
||||
var yAxisId = (0, _graphicalItemSelectors.selectYAxisIdFromGraphicalItemId)(state, id);
|
||||
if (yAxisId == null) {
|
||||
return undefined;
|
||||
}
|
||||
return (0, _axisSelectors.selectAxisWithScale)(state, 'yAxis', yAxisId, isPanorama);
|
||||
};
|
||||
var selectXAxisTicks = (state, id, isPanorama) => {
|
||||
var xAxisId = (0, _graphicalItemSelectors.selectXAxisIdFromGraphicalItemId)(state, id);
|
||||
if (xAxisId == null) {
|
||||
return undefined;
|
||||
}
|
||||
return (0, _axisSelectors.selectTicksOfGraphicalItem)(state, 'xAxis', xAxisId, isPanorama);
|
||||
};
|
||||
var selectYAxisTicks = (state, id, isPanorama) => {
|
||||
var yAxisId = (0, _graphicalItemSelectors.selectYAxisIdFromGraphicalItemId)(state, id);
|
||||
if (yAxisId == null) {
|
||||
return undefined;
|
||||
}
|
||||
return (0, _axisSelectors.selectTicksOfGraphicalItem)(state, 'yAxis', yAxisId, isPanorama);
|
||||
};
|
||||
var selectBarPosition = exports.selectBarPosition = (0, _reselect.createSelector)([selectAllBarPositions, selectSynchronisedBarSettings], _combineBarPosition.combineBarPosition);
|
||||
var selectStackedDataOfItem = exports.selectStackedDataOfItem = (0, _reselect.createSelector)([selectBarStackGroups, selectSynchronisedBarSettings], _combineStackedData.combineStackedData);
|
||||
var selectBarRectangles = exports.selectBarRectangles = (0, _reselect.createSelector)([_selectChartOffsetInternal.selectChartOffsetInternal, _selectChartOffsetInternal.selectAxisViewBox, selectXAxisWithScale, selectYAxisWithScale, selectXAxisTicks, selectYAxisTicks, selectBarPosition, _chartLayoutContext.selectChartLayout, _dataSelectors.selectChartDataWithIndexesIfNotInPanoramaPosition3, selectAxisBandSize, selectStackedDataOfItem, selectSynchronisedBarSettings, pickCells], (offset, axisViewBox, xAxis, yAxis, xAxisTicks, yAxisTicks, pos, layout, _ref2, bandSize, stackedData, barSettings, cells) => {
|
||||
var chartData = _ref2.chartData,
|
||||
dataStartIndex = _ref2.dataStartIndex,
|
||||
dataEndIndex = _ref2.dataEndIndex;
|
||||
if (barSettings == null || pos == null || axisViewBox == null || layout !== 'horizontal' && layout !== 'vertical' || xAxis == null || yAxis == null || xAxisTicks == null || yAxisTicks == null || bandSize == null) {
|
||||
return undefined;
|
||||
}
|
||||
var data = barSettings.data;
|
||||
var displayedData;
|
||||
if (data != null && data.length > 0) {
|
||||
displayedData = data;
|
||||
} else {
|
||||
displayedData = chartData === null || chartData === void 0 ? void 0 : chartData.slice(dataStartIndex, dataEndIndex + 1);
|
||||
}
|
||||
if (displayedData == null) {
|
||||
return undefined;
|
||||
}
|
||||
return (0, _Bar.computeBarRectangles)({
|
||||
layout,
|
||||
barSettings,
|
||||
pos,
|
||||
parentViewBox: axisViewBox,
|
||||
bandSize,
|
||||
xAxis,
|
||||
yAxis,
|
||||
xAxisTicks,
|
||||
yAxisTicks,
|
||||
stackedData,
|
||||
displayedData,
|
||||
offset,
|
||||
cells,
|
||||
dataStartIndex
|
||||
});
|
||||
});
|
||||
58
frontend/node_modules/recharts/lib/state/selectors/barStackSelectors.js
generated
vendored
Normal file
58
frontend/node_modules/recharts/lib/state/selectors/barStackSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectStackRects = exports.selectAllBarsInStack = exports.expandRectangle = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _axisSelectors = require("./axisSelectors");
|
||||
var _barSelectors = require("./barSelectors");
|
||||
var pickStackId = (state, stackId) => stackId;
|
||||
var pickIsPanorama = (state, stackId, isPanorama) => isPanorama;
|
||||
var selectAllBarsInStack = exports.selectAllBarsInStack = (0, _reselect.createSelector)([pickStackId, _axisSelectors.selectUnfilteredCartesianItems, pickIsPanorama], (stackId, allItems, isPanorama) => {
|
||||
return allItems.filter(i => i.type === 'bar').filter(i => i.stackId === stackId).filter(i => i.isPanorama === isPanorama).filter(i => !i.hide);
|
||||
});
|
||||
var selectAllBarIdsInStack = (0, _reselect.createSelector)([selectAllBarsInStack], allBars => {
|
||||
return allBars.map(bar => bar.id);
|
||||
});
|
||||
/**
|
||||
* Takes two rectangles and returns a new rectangle that encompasses both.
|
||||
* It takes the minimum x and y, and the maximum width and height.
|
||||
* It handles overlapping rectangles, and rectangles with a gap between them.
|
||||
* @param rect1
|
||||
* @param rect2
|
||||
*/
|
||||
var expandRectangle = (rect1, rect2) => {
|
||||
if (!rect1) {
|
||||
return rect2;
|
||||
}
|
||||
if (!rect2) {
|
||||
return rect1;
|
||||
}
|
||||
var x = Math.min(rect1.x, rect1.x + rect1.width, rect2.x, rect2.x + rect2.width);
|
||||
var y = Math.min(rect1.y, rect1.y + rect1.height, rect2.y, rect2.y + rect2.height);
|
||||
var maxX = Math.max(rect1.x, rect1.x + rect1.width, rect2.x, rect2.x + rect2.width);
|
||||
var maxY = Math.max(rect1.y, rect1.y + rect1.height, rect2.y, rect2.y + rect2.height);
|
||||
var width = maxX - x;
|
||||
var height = maxY - y;
|
||||
return {
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height
|
||||
};
|
||||
};
|
||||
exports.expandRectangle = expandRectangle;
|
||||
var combineStackRects = (state, stackId, isPanorama) => {
|
||||
var allBarIds = selectAllBarIdsInStack(state, stackId, isPanorama);
|
||||
var stackRects = [];
|
||||
allBarIds.forEach(barId => {
|
||||
var rectangles = (0, _barSelectors.selectBarRectangles)(state, barId, isPanorama, undefined);
|
||||
rectangles === null || rectangles === void 0 || rectangles.forEach(rect => {
|
||||
var rectIndex = rect.originalDataIndex;
|
||||
stackRects[rectIndex] = expandRectangle(stackRects[rectIndex], rect);
|
||||
});
|
||||
});
|
||||
return stackRects;
|
||||
};
|
||||
var selectStackRects = exports.selectStackRects = (0, _reselect.createSelector)([state => state, pickStackId, pickIsPanorama], combineStackRects);
|
||||
18
frontend/node_modules/recharts/lib/state/selectors/brushSelectors.js
generated
vendored
Normal file
18
frontend/node_modules/recharts/lib/state/selectors/brushSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectBrushSettings = exports.selectBrushDimensions = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _selectChartOffsetInternal = require("./selectChartOffsetInternal");
|
||||
var _containerSelectors = require("./containerSelectors");
|
||||
var _DataUtils = require("../../util/DataUtils");
|
||||
var selectBrushSettings = state => state.brush;
|
||||
exports.selectBrushSettings = selectBrushSettings;
|
||||
var selectBrushDimensions = exports.selectBrushDimensions = (0, _reselect.createSelector)([selectBrushSettings, _selectChartOffsetInternal.selectChartOffsetInternal, _containerSelectors.selectMargin], (brushSettings, offset, margin) => ({
|
||||
height: brushSettings.height,
|
||||
x: (0, _DataUtils.isNumber)(brushSettings.x) ? brushSettings.x : offset.left,
|
||||
y: (0, _DataUtils.isNumber)(brushSettings.y) ? brushSettings.y : offset.top + offset.height + offset.brushBottom - ((margin === null || margin === void 0 ? void 0 : margin.bottom) || 0),
|
||||
width: (0, _DataUtils.isNumber)(brushSettings.width) ? brushSettings.width : offset.width
|
||||
}));
|
||||
16
frontend/node_modules/recharts/lib/state/selectors/combiners/combineActiveLabel.js
generated
vendored
Normal file
16
frontend/node_modules/recharts/lib/state/selectors/combiners/combineActiveLabel.js
generated
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.combineActiveLabel = void 0;
|
||||
var _DataUtils = require("../../../util/DataUtils");
|
||||
var combineActiveLabel = (tooltipTicks, activeIndex) => {
|
||||
var _tooltipTicks$n;
|
||||
var n = Number(activeIndex);
|
||||
if ((0, _DataUtils.isNan)(n) || activeIndex == null) {
|
||||
return undefined;
|
||||
}
|
||||
return n >= 0 ? tooltipTicks === null || tooltipTicks === void 0 || (_tooltipTicks$n = tooltipTicks[n]) === null || _tooltipTicks$n === void 0 ? void 0 : _tooltipTicks$n.value : undefined;
|
||||
};
|
||||
exports.combineActiveLabel = combineActiveLabel;
|
||||
77
frontend/node_modules/recharts/lib/state/selectors/combiners/combineActiveTooltipIndex.js
generated
vendored
Normal file
77
frontend/node_modules/recharts/lib/state/selectors/combiners/combineActiveTooltipIndex.js
generated
vendored
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.combineActiveTooltipIndex = void 0;
|
||||
var _isWellBehavedNumber = require("../../../util/isWellBehavedNumber");
|
||||
var _ChartUtils = require("../../../util/ChartUtils");
|
||||
var _isDomainSpecifiedByUser = require("../../../util/isDomainSpecifiedByUser");
|
||||
function toFiniteNumber(value) {
|
||||
if (typeof value === 'number') {
|
||||
return Number.isFinite(value) ? value : undefined;
|
||||
}
|
||||
if (value instanceof Date) {
|
||||
var numericValue = value.valueOf();
|
||||
return Number.isFinite(numericValue) ? numericValue : undefined;
|
||||
}
|
||||
var parsed = Number(value);
|
||||
return Number.isFinite(parsed) ? parsed : undefined;
|
||||
}
|
||||
function isValueWithinNumberDomain(value, domain) {
|
||||
var numericValue = toFiniteNumber(value);
|
||||
var lowerBound = domain[0];
|
||||
var upperBound = domain[1];
|
||||
if (numericValue === undefined) {
|
||||
return false;
|
||||
}
|
||||
var min = Math.min(lowerBound, upperBound);
|
||||
var max = Math.max(lowerBound, upperBound);
|
||||
return numericValue >= min && numericValue <= max;
|
||||
}
|
||||
function isValueWithinDomain(entry, axisDataKey, domain) {
|
||||
if (domain == null || axisDataKey == null) {
|
||||
return true;
|
||||
}
|
||||
var value = (0, _ChartUtils.getValueByDataKey)(entry, axisDataKey);
|
||||
if (value == null) {
|
||||
return true;
|
||||
}
|
||||
if (!(0, _isDomainSpecifiedByUser.isWellFormedNumberDomain)(domain)) {
|
||||
return true;
|
||||
}
|
||||
return isValueWithinNumberDomain(value, domain);
|
||||
}
|
||||
var combineActiveTooltipIndex = (tooltipInteraction, chartData, axisDataKey, domain) => {
|
||||
var desiredIndex = tooltipInteraction === null || tooltipInteraction === void 0 ? void 0 : tooltipInteraction.index;
|
||||
if (desiredIndex == null) {
|
||||
return null;
|
||||
}
|
||||
var indexAsNumber = Number(desiredIndex);
|
||||
if (!(0, _isWellBehavedNumber.isWellBehavedNumber)(indexAsNumber)) {
|
||||
// this is for charts like Sankey and Treemap that do not support numerical indexes. We need a proper solution for this before we can start supporting keyboard events on these charts.
|
||||
return desiredIndex;
|
||||
}
|
||||
|
||||
/*
|
||||
* Zero is a trivial limit for single-dimensional charts like Line and Area,
|
||||
* but this also needs a support for multidimensional charts like Sankey and Treemap! TODO
|
||||
*/
|
||||
var lowerLimit = 0;
|
||||
var upperLimit = +Infinity;
|
||||
if (chartData.length > 0) {
|
||||
upperLimit = chartData.length - 1;
|
||||
}
|
||||
|
||||
// now let's clamp the desiredIndex between the limits
|
||||
var clampedIndex = Math.max(lowerLimit, Math.min(indexAsNumber, upperLimit));
|
||||
var entry = chartData[clampedIndex];
|
||||
if (entry == null) {
|
||||
return String(clampedIndex);
|
||||
}
|
||||
if (!isValueWithinDomain(entry, axisDataKey, domain)) {
|
||||
return null;
|
||||
}
|
||||
return String(clampedIndex);
|
||||
};
|
||||
exports.combineActiveTooltipIndex = combineActiveTooltipIndex;
|
||||
92
frontend/node_modules/recharts/lib/state/selectors/combiners/combineAllBarPositions.js
generated
vendored
Normal file
92
frontend/node_modules/recharts/lib/state/selectors/combiners/combineAllBarPositions.js
generated
vendored
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.combineAllBarPositions = void 0;
|
||||
var _DataUtils = require("../../../util/DataUtils");
|
||||
var _isWellBehavedNumber = require("../../../util/isWellBehavedNumber");
|
||||
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) { _defineProperty(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; }
|
||||
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
||||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
||||
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
||||
function getBarPositions(barGap, barCategoryGap, bandSize, sizeList, maxBarSize) {
|
||||
var _sizeList$;
|
||||
var len = sizeList.length;
|
||||
if (len < 1) {
|
||||
return undefined;
|
||||
}
|
||||
var realBarGap = (0, _DataUtils.getPercentValue)(barGap, bandSize, 0, true);
|
||||
var result;
|
||||
var initialValue = [];
|
||||
|
||||
// whether is barSize set by user
|
||||
// Okay but why does it check only for the first element? What if the first element is set but others are not?
|
||||
if ((0, _isWellBehavedNumber.isWellBehavedNumber)((_sizeList$ = sizeList[0]) === null || _sizeList$ === void 0 ? void 0 : _sizeList$.barSize)) {
|
||||
var useFull = false;
|
||||
var fullBarSize = bandSize / len;
|
||||
var sum = sizeList.reduce((res, entry) => res + (entry.barSize || 0), 0);
|
||||
sum += (len - 1) * realBarGap;
|
||||
if (sum >= bandSize) {
|
||||
sum -= (len - 1) * realBarGap;
|
||||
realBarGap = 0;
|
||||
}
|
||||
if (sum >= bandSize && fullBarSize > 0) {
|
||||
useFull = true;
|
||||
fullBarSize *= 0.9;
|
||||
sum = len * fullBarSize;
|
||||
}
|
||||
var offset = Math.round((bandSize - sum) / 2);
|
||||
var prev = {
|
||||
offset: offset - realBarGap,
|
||||
size: 0
|
||||
};
|
||||
result = sizeList.reduce((res, entry) => {
|
||||
var _entry$barSize;
|
||||
var newPosition = {
|
||||
stackId: entry.stackId,
|
||||
dataKeys: entry.dataKeys,
|
||||
position: {
|
||||
offset: prev.offset + prev.size + realBarGap,
|
||||
size: useFull ? fullBarSize : (_entry$barSize = entry.barSize) !== null && _entry$barSize !== void 0 ? _entry$barSize : 0
|
||||
}
|
||||
};
|
||||
var newRes = [...res, newPosition];
|
||||
prev = newPosition.position;
|
||||
return newRes;
|
||||
}, initialValue);
|
||||
} else {
|
||||
var _offset = (0, _DataUtils.getPercentValue)(barCategoryGap, bandSize, 0, true);
|
||||
if (bandSize - 2 * _offset - (len - 1) * realBarGap <= 0) {
|
||||
realBarGap = 0;
|
||||
}
|
||||
var originalSize = (bandSize - 2 * _offset - (len - 1) * realBarGap) / len;
|
||||
if (originalSize > 1) {
|
||||
originalSize = Math.round(originalSize);
|
||||
}
|
||||
var size = (0, _isWellBehavedNumber.isWellBehavedNumber)(maxBarSize) ? Math.min(originalSize, maxBarSize) : originalSize;
|
||||
result = sizeList.reduce((res, entry, i) => [...res, {
|
||||
stackId: entry.stackId,
|
||||
dataKeys: entry.dataKeys,
|
||||
position: {
|
||||
offset: _offset + (originalSize + realBarGap) * i + (originalSize - size) / 2,
|
||||
size
|
||||
}
|
||||
}], initialValue);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
var combineAllBarPositions = (sizeList, globalMaxBarSize, barGap, barCategoryGap, barBandSize, bandSize, childMaxBarSize) => {
|
||||
var maxBarSize = (0, _DataUtils.isNullish)(childMaxBarSize) ? globalMaxBarSize : childMaxBarSize;
|
||||
var allBarPositions = getBarPositions(barGap, barCategoryGap, barBandSize !== bandSize ? barBandSize : bandSize, sizeList, maxBarSize);
|
||||
if (barBandSize !== bandSize && allBarPositions != null) {
|
||||
allBarPositions = allBarPositions.map(pos => _objectSpread(_objectSpread({}, pos), {}, {
|
||||
position: _objectSpread(_objectSpread({}, pos.position), {}, {
|
||||
offset: pos.position.offset - barBandSize / 2
|
||||
})
|
||||
}));
|
||||
}
|
||||
return allBarPositions;
|
||||
};
|
||||
exports.combineAllBarPositions = combineAllBarPositions;
|
||||
16
frontend/node_modules/recharts/lib/state/selectors/combiners/combineAxisRangeWithReverse.js
generated
vendored
Normal file
16
frontend/node_modules/recharts/lib/state/selectors/combiners/combineAxisRangeWithReverse.js
generated
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.combineAxisRangeWithReverse = void 0;
|
||||
var combineAxisRangeWithReverse = (axisSettings, axisRange) => {
|
||||
if (!axisSettings || !axisRange) {
|
||||
return undefined;
|
||||
}
|
||||
if (axisSettings !== null && axisSettings !== void 0 && axisSettings.reversed) {
|
||||
return [axisRange[1], axisRange[0]];
|
||||
}
|
||||
return axisRange;
|
||||
};
|
||||
exports.combineAxisRangeWithReverse = combineAxisRangeWithReverse;
|
||||
17
frontend/node_modules/recharts/lib/state/selectors/combiners/combineBarPosition.js
generated
vendored
Normal file
17
frontend/node_modules/recharts/lib/state/selectors/combiners/combineBarPosition.js
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.combineBarPosition = void 0;
|
||||
var combineBarPosition = (allBarPositions, barSettings) => {
|
||||
if (allBarPositions == null || barSettings == null) {
|
||||
return undefined;
|
||||
}
|
||||
var position = allBarPositions.find(p => p.stackId === barSettings.stackId && barSettings.dataKey != null && p.dataKeys.includes(barSettings.dataKey));
|
||||
if (position == null) {
|
||||
return undefined;
|
||||
}
|
||||
return position.position;
|
||||
};
|
||||
exports.combineBarPosition = combineBarPosition;
|
||||
59
frontend/node_modules/recharts/lib/state/selectors/combiners/combineBarSizeList.js
generated
vendored
Normal file
59
frontend/node_modules/recharts/lib/state/selectors/combiners/combineBarSizeList.js
generated
vendored
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.combineBarSizeList = void 0;
|
||||
var _StackedGraphicalItem = require("../../types/StackedGraphicalItem");
|
||||
var _DataUtils = require("../../../util/DataUtils");
|
||||
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
||||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
||||
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
||||
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
||||
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
||||
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
||||
var getBarSize = (globalSize, totalSize, selfSize) => {
|
||||
var barSize = selfSize !== null && selfSize !== void 0 ? selfSize : globalSize;
|
||||
if ((0, _DataUtils.isNullish)(barSize)) {
|
||||
return undefined;
|
||||
}
|
||||
return (0, _DataUtils.getPercentValue)(barSize, totalSize, 0);
|
||||
};
|
||||
var combineBarSizeList = (allBars, globalSize, totalSize) => {
|
||||
var initialValue = {};
|
||||
var stackedBars = allBars.filter(_StackedGraphicalItem.isStacked);
|
||||
var unstackedBars = allBars.filter(b => b.stackId == null);
|
||||
var groupByStack = stackedBars.reduce((acc, bar) => {
|
||||
var s = acc[bar.stackId];
|
||||
if (s == null) {
|
||||
s = [];
|
||||
}
|
||||
s.push(bar);
|
||||
acc[bar.stackId] = s;
|
||||
return acc;
|
||||
}, initialValue);
|
||||
var stackedSizeList = Object.entries(groupByStack).map(_ref => {
|
||||
var _bars$;
|
||||
var _ref2 = _slicedToArray(_ref, 2),
|
||||
stackId = _ref2[0],
|
||||
bars = _ref2[1];
|
||||
var dataKeys = bars.map(b => b.dataKey);
|
||||
var barSize = getBarSize(globalSize, totalSize, (_bars$ = bars[0]) === null || _bars$ === void 0 ? void 0 : _bars$.barSize);
|
||||
return {
|
||||
stackId,
|
||||
dataKeys,
|
||||
barSize
|
||||
};
|
||||
});
|
||||
var unstackedSizeList = unstackedBars.map(b => {
|
||||
var dataKeys = [b.dataKey].filter(dk => dk != null);
|
||||
var barSize = getBarSize(globalSize, totalSize, b.barSize);
|
||||
return {
|
||||
stackId: undefined,
|
||||
dataKeys,
|
||||
barSize
|
||||
};
|
||||
});
|
||||
return [...stackedSizeList, ...unstackedSizeList];
|
||||
};
|
||||
exports.combineBarSizeList = combineBarSizeList;
|
||||
49
frontend/node_modules/recharts/lib/state/selectors/combiners/combineCheckedDomain.js
generated
vendored
Normal file
49
frontend/node_modules/recharts/lib/state/selectors/combiners/combineCheckedDomain.js
generated
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.combineCheckedDomain = void 0;
|
||||
var _isDomainSpecifiedByUser = require("../../../util/isDomainSpecifiedByUser");
|
||||
var _isWellBehavedNumber = require("../../../util/isWellBehavedNumber");
|
||||
/**
|
||||
* This function validates and transforms the axis domain so that it is safe to use in the provided scale.
|
||||
*/
|
||||
var combineCheckedDomain = (realScaleType, axisDomain) => {
|
||||
if (axisDomain == null) {
|
||||
return undefined;
|
||||
}
|
||||
switch (realScaleType) {
|
||||
case 'linear':
|
||||
{
|
||||
/*
|
||||
* linear scale only reads the first two numbers in the domain, and ignores everything else.
|
||||
* So if it happens that someone somehow gave us a bigger domain,
|
||||
* let's pick the min and max from it.
|
||||
*/
|
||||
if (!(0, _isDomainSpecifiedByUser.isWellFormedNumberDomain)(axisDomain)) {
|
||||
var min, max;
|
||||
for (var i = 0; i < axisDomain.length; i++) {
|
||||
var value = axisDomain[i];
|
||||
if (!(0, _isWellBehavedNumber.isWellBehavedNumber)(value)) {
|
||||
continue;
|
||||
}
|
||||
if (min === undefined || value < min) {
|
||||
min = value;
|
||||
}
|
||||
if (max === undefined || value > max) {
|
||||
max = value;
|
||||
}
|
||||
}
|
||||
if (min !== undefined && max !== undefined) {
|
||||
return [min, max];
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
return axisDomain;
|
||||
}
|
||||
default:
|
||||
return axisDomain;
|
||||
}
|
||||
};
|
||||
exports.combineCheckedDomain = combineCheckedDomain;
|
||||
52
frontend/node_modules/recharts/lib/state/selectors/combiners/combineConfiguredScale.js
generated
vendored
Normal file
52
frontend/node_modules/recharts/lib/state/selectors/combiners/combineConfiguredScale.js
generated
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.combineConfiguredScale = combineConfiguredScale;
|
||||
exports.combineConfiguredScaleInternal = combineConfiguredScaleInternal;
|
||||
var d3Scales = _interopRequireWildcard(require("victory-vendor/d3-scale"));
|
||||
var _DataUtils = require("../../../util/DataUtils");
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
||||
function getD3ScaleFromType(realScaleType) {
|
||||
var scales = d3Scales;
|
||||
if (realScaleType in scales && typeof scales[realScaleType] === 'function') {
|
||||
return scales[realScaleType]();
|
||||
}
|
||||
var name = "scale".concat((0, _DataUtils.upperFirst)(realScaleType));
|
||||
if (name in scales && typeof scales[name] === 'function') {
|
||||
return scales[name]();
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts external scale definition into internal RechartsScale definition.
|
||||
* @param scale custom function scale - if you have the `string` from outside, use `combineRealScaleType` first which will validate it and return RechartsScaleType or undefined
|
||||
* @param axisDomain
|
||||
* @param axisRange
|
||||
*/
|
||||
|
||||
function combineConfiguredScaleInternal(scale, axisDomain, axisRange) {
|
||||
if (typeof scale === 'function') {
|
||||
return scale.copy().domain(axisDomain).range(axisRange);
|
||||
}
|
||||
if (scale == null) {
|
||||
return undefined;
|
||||
}
|
||||
var d3ScaleFunction = getD3ScaleFromType(scale);
|
||||
if (d3ScaleFunction == null) {
|
||||
return undefined;
|
||||
}
|
||||
d3ScaleFunction.domain(axisDomain).range(axisRange);
|
||||
return d3ScaleFunction;
|
||||
}
|
||||
function combineConfiguredScale(axis, realScaleType, axisDomain, axisRange) {
|
||||
if (axisDomain == null || axisRange == null) {
|
||||
return undefined;
|
||||
}
|
||||
if (typeof axis.scale === 'function') {
|
||||
return combineConfiguredScaleInternal(axis.scale, axisDomain, axisRange);
|
||||
}
|
||||
return combineConfiguredScaleInternal(realScaleType, axisDomain, axisRange);
|
||||
}
|
||||
43
frontend/node_modules/recharts/lib/state/selectors/combiners/combineCoordinateForDefaultIndex.js
generated
vendored
Normal file
43
frontend/node_modules/recharts/lib/state/selectors/combiners/combineCoordinateForDefaultIndex.js
generated
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.combineCoordinateForDefaultIndex = void 0;
|
||||
var combineCoordinateForDefaultIndex = (width, height, layout, offset, tooltipTicks, defaultIndex, tooltipConfigurations) => {
|
||||
if (defaultIndex == null) {
|
||||
return undefined;
|
||||
}
|
||||
/*
|
||||
* With defaultIndex alone, we don't have enough information to decide _which_ of the multiple tooltips to display.
|
||||
* Maybe one day we could add new prop `activeGraphicalItemId` to the chart to help with that.
|
||||
* Until then, we choose the first one.
|
||||
*/
|
||||
var firstConfiguration = tooltipConfigurations[0];
|
||||
var maybePosition = firstConfiguration === null || firstConfiguration === void 0 ? void 0 : firstConfiguration.getPosition(defaultIndex);
|
||||
if (maybePosition != null) {
|
||||
return maybePosition;
|
||||
}
|
||||
var tick = tooltipTicks === null || tooltipTicks === void 0 ? void 0 : tooltipTicks[Number(defaultIndex)];
|
||||
if (!tick) {
|
||||
return undefined;
|
||||
}
|
||||
switch (layout) {
|
||||
case 'horizontal':
|
||||
{
|
||||
return {
|
||||
x: tick.coordinate,
|
||||
y: (offset.top + height) / 2
|
||||
};
|
||||
}
|
||||
default:
|
||||
{
|
||||
// This logic is not super sound - it conflates vertical, radial, centric layouts into just one. TODO improve!
|
||||
return {
|
||||
x: (offset.left + width) / 2,
|
||||
y: tick.coordinate
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.combineCoordinateForDefaultIndex = combineCoordinateForDefaultIndex;
|
||||
53
frontend/node_modules/recharts/lib/state/selectors/combiners/combineDisplayedStackedData.js
generated
vendored
Normal file
53
frontend/node_modules/recharts/lib/state/selectors/combiners/combineDisplayedStackedData.js
generated
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.combineDisplayedStackedData = combineDisplayedStackedData;
|
||||
var _getStackSeriesIdentifier = require("../../../util/stacks/getStackSeriesIdentifier");
|
||||
var _ChartUtils = require("../../../util/ChartUtils");
|
||||
/**
|
||||
* In a stacked chart, each graphical item has its own data. That data could be either:
|
||||
* - defined on the chart root, in which case the item gets a unique dataKey
|
||||
* - or defined on the item itself, in which case multiple items can share the same dataKey
|
||||
*
|
||||
* That means we cannot use the dataKey as a unique identifier for the item.
|
||||
*
|
||||
* This type represents a single data point in a stacked chart, where each key is a series identifier
|
||||
* and the value is the numeric value for that series using the numerical axis dataKey.
|
||||
*/
|
||||
|
||||
function combineDisplayedStackedData(stackedGraphicalItems, _ref, tooltipAxisSettings) {
|
||||
var _ref$chartData = _ref.chartData,
|
||||
chartData = _ref$chartData === void 0 ? [] : _ref$chartData;
|
||||
var allowDuplicatedCategory = tooltipAxisSettings.allowDuplicatedCategory,
|
||||
tooltipDataKey = tooltipAxisSettings.dataKey;
|
||||
|
||||
// A map of tooltip data keys to the stacked data points
|
||||
var knownItemsByDataKey = new Map();
|
||||
stackedGraphicalItems.forEach(item => {
|
||||
var _item$data;
|
||||
// If there is no data on the individual item then we use the root chart data
|
||||
var resolvedData = (_item$data = item.data) !== null && _item$data !== void 0 ? _item$data : chartData;
|
||||
if (resolvedData == null || resolvedData.length === 0) {
|
||||
// if that doesn't work then we skip this item
|
||||
return;
|
||||
}
|
||||
var stackIdentifier = (0, _getStackSeriesIdentifier.getStackSeriesIdentifier)(item);
|
||||
resolvedData.forEach((entry, index) => {
|
||||
var tooltipValue = tooltipDataKey == null || allowDuplicatedCategory ? index : String((0, _ChartUtils.getValueByDataKey)(entry, tooltipDataKey, null));
|
||||
var numericValue = (0, _ChartUtils.getValueByDataKey)(entry, item.dataKey, 0);
|
||||
var curr;
|
||||
if (knownItemsByDataKey.has(tooltipValue)) {
|
||||
curr = knownItemsByDataKey.get(tooltipValue);
|
||||
} else {
|
||||
curr = {};
|
||||
}
|
||||
Object.assign(curr, {
|
||||
[stackIdentifier]: numericValue
|
||||
});
|
||||
knownItemsByDataKey.set(tooltipValue, curr);
|
||||
});
|
||||
});
|
||||
return Array.from(knownItemsByDataKey.values());
|
||||
}
|
||||
16
frontend/node_modules/recharts/lib/state/selectors/combiners/combineInverseScaleFunction.js
generated
vendored
Normal file
16
frontend/node_modules/recharts/lib/state/selectors/combiners/combineInverseScaleFunction.js
generated
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.combineInverseScaleFunction = combineInverseScaleFunction;
|
||||
var _createCategoricalInverse = require("../../../util/scale/createCategoricalInverse");
|
||||
function combineInverseScaleFunction(configuredScale) {
|
||||
if (configuredScale == null) {
|
||||
return undefined;
|
||||
}
|
||||
if ('invert' in configuredScale && typeof configuredScale.invert === 'function') {
|
||||
return configuredScale.invert.bind(configuredScale);
|
||||
}
|
||||
return (0, _createCategoricalInverse.createCategoricalInverse)(configuredScale, undefined);
|
||||
}
|
||||
36
frontend/node_modules/recharts/lib/state/selectors/combiners/combineRealScaleType.js
generated
vendored
Normal file
36
frontend/node_modules/recharts/lib/state/selectors/combiners/combineRealScaleType.js
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.combineRealScaleType = void 0;
|
||||
var d3Scales = _interopRequireWildcard(require("victory-vendor/d3-scale"));
|
||||
var _DataUtils = require("../../../util/DataUtils");
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
||||
function getD3ScaleName(name) {
|
||||
return "scale".concat((0, _DataUtils.upperFirst)(name));
|
||||
}
|
||||
function isSupportedScaleName(name) {
|
||||
return getD3ScaleName(name) in d3Scales;
|
||||
}
|
||||
var combineRealScaleType = (axisConfig, hasBar, chartType) => {
|
||||
if (axisConfig == null) {
|
||||
return undefined;
|
||||
}
|
||||
var scale = axisConfig.scale,
|
||||
type = axisConfig.type;
|
||||
if (scale === 'auto') {
|
||||
if (type === 'category' && chartType && (chartType.indexOf('LineChart') >= 0 || chartType.indexOf('AreaChart') >= 0 || chartType.indexOf('ComposedChart') >= 0 && !hasBar)) {
|
||||
return 'point';
|
||||
}
|
||||
if (type === 'category') {
|
||||
return 'band';
|
||||
}
|
||||
return 'linear';
|
||||
}
|
||||
if (typeof scale === 'string') {
|
||||
return isSupportedScaleName(scale) ? scale : 'point';
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
exports.combineRealScaleType = combineRealScaleType;
|
||||
27
frontend/node_modules/recharts/lib/state/selectors/combiners/combineStackedData.js
generated
vendored
Normal file
27
frontend/node_modules/recharts/lib/state/selectors/combiners/combineStackedData.js
generated
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.combineStackedData = void 0;
|
||||
var _getStackSeriesIdentifier = require("../../../util/stacks/getStackSeriesIdentifier");
|
||||
var combineStackedData = (stackGroups, barSettings) => {
|
||||
var stackSeriesIdentifier = (0, _getStackSeriesIdentifier.getStackSeriesIdentifier)(barSettings);
|
||||
if (!stackGroups || stackSeriesIdentifier == null || barSettings == null) {
|
||||
return undefined;
|
||||
}
|
||||
var stackId = barSettings.stackId;
|
||||
if (stackId == null) {
|
||||
return undefined;
|
||||
}
|
||||
var stackGroup = stackGroups[stackId];
|
||||
if (!stackGroup) {
|
||||
return undefined;
|
||||
}
|
||||
var stackedData = stackGroup.stackedData;
|
||||
if (!stackedData) {
|
||||
return undefined;
|
||||
}
|
||||
return stackedData.find(sd => sd.key === stackSeriesIdentifier);
|
||||
};
|
||||
exports.combineStackedData = combineStackedData;
|
||||
65
frontend/node_modules/recharts/lib/state/selectors/combiners/combineTooltipInteractionState.js
generated
vendored
Normal file
65
frontend/node_modules/recharts/lib/state/selectors/combiners/combineTooltipInteractionState.js
generated
vendored
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.combineTooltipInteractionState = void 0;
|
||||
var _tooltipSlice = require("../../tooltipSlice");
|
||||
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) { _defineProperty(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; }
|
||||
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
||||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
||||
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
||||
function chooseAppropriateMouseInteraction(tooltipState, tooltipEventType, trigger) {
|
||||
if (tooltipEventType === 'axis') {
|
||||
if (trigger === 'click') {
|
||||
return tooltipState.axisInteraction.click;
|
||||
}
|
||||
return tooltipState.axisInteraction.hover;
|
||||
}
|
||||
if (trigger === 'click') {
|
||||
return tooltipState.itemInteraction.click;
|
||||
}
|
||||
return tooltipState.itemInteraction.hover;
|
||||
}
|
||||
function hasBeenActivePreviously(tooltipInteractionState) {
|
||||
return tooltipInteractionState.index != null;
|
||||
}
|
||||
var combineTooltipInteractionState = (tooltipState, tooltipEventType, trigger, defaultIndex) => {
|
||||
if (tooltipEventType == null) {
|
||||
return _tooltipSlice.noInteraction;
|
||||
}
|
||||
var appropriateMouseInteraction = chooseAppropriateMouseInteraction(tooltipState, tooltipEventType, trigger);
|
||||
if (appropriateMouseInteraction == null) {
|
||||
return _tooltipSlice.noInteraction;
|
||||
}
|
||||
if (appropriateMouseInteraction.active) {
|
||||
return appropriateMouseInteraction;
|
||||
}
|
||||
if (tooltipState.keyboardInteraction.active) {
|
||||
return tooltipState.keyboardInteraction;
|
||||
}
|
||||
if (tooltipState.syncInteraction.active && tooltipState.syncInteraction.index != null) {
|
||||
return tooltipState.syncInteraction;
|
||||
}
|
||||
var activeFromProps = tooltipState.settings.active === true;
|
||||
if (hasBeenActivePreviously(appropriateMouseInteraction)) {
|
||||
if (activeFromProps) {
|
||||
return _objectSpread(_objectSpread({}, appropriateMouseInteraction), {}, {
|
||||
active: true
|
||||
});
|
||||
}
|
||||
} else if (defaultIndex != null) {
|
||||
return {
|
||||
active: true,
|
||||
coordinate: undefined,
|
||||
dataKey: undefined,
|
||||
index: defaultIndex,
|
||||
graphicalItemId: undefined
|
||||
};
|
||||
}
|
||||
return _objectSpread(_objectSpread({}, _tooltipSlice.noInteraction), {}, {
|
||||
coordinate: appropriateMouseInteraction.coordinate
|
||||
});
|
||||
};
|
||||
exports.combineTooltipInteractionState = combineTooltipInteractionState;
|
||||
162
frontend/node_modules/recharts/lib/state/selectors/combiners/combineTooltipPayload.js
generated
vendored
Normal file
162
frontend/node_modules/recharts/lib/state/selectors/combiners/combineTooltipPayload.js
generated
vendored
Normal file
|
|
@ -0,0 +1,162 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.combineTooltipPayload = void 0;
|
||||
var _DataUtils = require("../../../util/DataUtils");
|
||||
var _ChartUtils = require("../../../util/ChartUtils");
|
||||
var _getSliced = require("../../../util/getSliced");
|
||||
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) { _defineProperty(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; }
|
||||
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
||||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
||||
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
||||
function parseName(value) {
|
||||
if (typeof value === 'string' || typeof value === 'number') {
|
||||
return value;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
function parseUnit(value) {
|
||||
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
||||
return value;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
function parseDataKey(value) {
|
||||
if (typeof value === 'string' || typeof value === 'number') {
|
||||
return value;
|
||||
}
|
||||
if (typeof value === 'function') {
|
||||
return obj => value(obj);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
function parseColor(value) {
|
||||
if (typeof value === 'string') {
|
||||
return value;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
function parseTooltipPayloadItem(item) {
|
||||
if (item == null || typeof item !== 'object') {
|
||||
return undefined;
|
||||
}
|
||||
var name = 'name' in item ? parseName(item.name) : undefined;
|
||||
var unit = 'unit' in item ? parseUnit(item.unit) : undefined;
|
||||
var dataKey = 'dataKey' in item ? parseDataKey(item.dataKey) : undefined;
|
||||
var payload = 'payload' in item ? item.payload : undefined;
|
||||
var color = 'color' in item ? parseColor(item.color) : undefined;
|
||||
var fill = 'fill' in item ? parseColor(item.fill) : undefined;
|
||||
return {
|
||||
name,
|
||||
unit,
|
||||
dataKey,
|
||||
payload,
|
||||
color,
|
||||
fill
|
||||
};
|
||||
}
|
||||
function selectFinalData(dataDefinedOnItem, dataDefinedOnChart) {
|
||||
/*
|
||||
* If a payload has data specified directly from the graphical item, prefer that.
|
||||
* Otherwise, fill in data from the chart level, using the same index.
|
||||
*/
|
||||
if (dataDefinedOnItem != null) {
|
||||
return dataDefinedOnItem;
|
||||
}
|
||||
return dataDefinedOnChart;
|
||||
}
|
||||
var combineTooltipPayload = (tooltipPayloadConfigurations, activeIndex, chartDataState, tooltipAxisDataKey, activeLabel, tooltipPayloadSearcher, tooltipEventType) => {
|
||||
if (activeIndex == null || tooltipPayloadSearcher == null) {
|
||||
return undefined;
|
||||
}
|
||||
var chartData = chartDataState.chartData,
|
||||
computedData = chartDataState.computedData,
|
||||
dataStartIndex = chartDataState.dataStartIndex,
|
||||
dataEndIndex = chartDataState.dataEndIndex;
|
||||
var init = [];
|
||||
return tooltipPayloadConfigurations.reduce((agg, _ref) => {
|
||||
var _settings$dataKey;
|
||||
var dataDefinedOnItem = _ref.dataDefinedOnItem,
|
||||
settings = _ref.settings;
|
||||
var finalData = selectFinalData(dataDefinedOnItem, chartData);
|
||||
var sliced = Array.isArray(finalData) ? (0, _getSliced.getSliced)(finalData, dataStartIndex, dataEndIndex) : finalData;
|
||||
var finalDataKey = (_settings$dataKey = settings === null || settings === void 0 ? void 0 : settings.dataKey) !== null && _settings$dataKey !== void 0 ? _settings$dataKey : tooltipAxisDataKey;
|
||||
// BaseAxisProps does not support nameKey but it could!
|
||||
var finalNameKey = settings === null || settings === void 0 ? void 0 : settings.nameKey; // ?? tooltipAxis?.nameKey;
|
||||
var tooltipPayload;
|
||||
if (tooltipAxisDataKey && Array.isArray(sliced) &&
|
||||
/*
|
||||
* findEntryInArray won't work for Scatter because Scatter provides an array of arrays
|
||||
* as tooltip payloads and findEntryInArray is not prepared to handle that.
|
||||
* Sad but also ScatterChart only allows 'item' tooltipEventType
|
||||
* and also this is only a problem if there are multiple Scatters and each has its own data array
|
||||
* so let's fix that some other time.
|
||||
*/
|
||||
!Array.isArray(sliced[0]) &&
|
||||
/*
|
||||
* If the tooltipEventType is 'axis', we should search for the dataKey in the sliced data
|
||||
* because thanks to allowDuplicatedCategory=false, the order of elements in the array
|
||||
* no longer matches the order of elements in the original data
|
||||
* and so we need to search by the active dataKey + label rather than by index.
|
||||
*
|
||||
* The same happens if multiple graphical items are present in the chart
|
||||
* and each of them has its own data array. Those arrays get concatenated
|
||||
* and again the tooltip index no longer matches the original data.
|
||||
*
|
||||
* On the other hand the tooltipEventType 'item' should always search by index
|
||||
* because we get the index from interacting over the individual elements
|
||||
* which is always accurate, irrespective of the allowDuplicatedCategory setting.
|
||||
*/
|
||||
tooltipEventType === 'axis') {
|
||||
tooltipPayload = (0, _DataUtils.findEntryInArray)(sliced, tooltipAxisDataKey, activeLabel);
|
||||
} else {
|
||||
/*
|
||||
* This is a problem because it assumes that the index is pointing to the displayed data
|
||||
* which it isn't because the index is pointing to the tooltip ticks array.
|
||||
* The above approach (with findEntryInArray) is the correct one, but it only works
|
||||
* if the axis dataKey is defined explicitly, and if the data is an array of objects.
|
||||
*/
|
||||
tooltipPayload = tooltipPayloadSearcher(sliced, activeIndex, computedData, finalNameKey);
|
||||
}
|
||||
if (Array.isArray(tooltipPayload)) {
|
||||
tooltipPayload.forEach(item => {
|
||||
var _parsedItem$color, _parsedItem$fill;
|
||||
var parsedItem = parseTooltipPayloadItem(item);
|
||||
var itemName = parsedItem === null || parsedItem === void 0 ? void 0 : parsedItem.name;
|
||||
var itemDataKey = parsedItem === null || parsedItem === void 0 ? void 0 : parsedItem.dataKey;
|
||||
var itemPayload = parsedItem === null || parsedItem === void 0 ? void 0 : parsedItem.payload;
|
||||
var newSettings = _objectSpread(_objectSpread({}, settings), {}, {
|
||||
name: itemName,
|
||||
unit: parsedItem === null || parsedItem === void 0 ? void 0 : parsedItem.unit,
|
||||
// Preserve item-level color/fill from graphical items.
|
||||
color: (_parsedItem$color = parsedItem === null || parsedItem === void 0 ? void 0 : parsedItem.color) !== null && _parsedItem$color !== void 0 ? _parsedItem$color : settings === null || settings === void 0 ? void 0 : settings.color,
|
||||
fill: (_parsedItem$fill = parsedItem === null || parsedItem === void 0 ? void 0 : parsedItem.fill) !== null && _parsedItem$fill !== void 0 ? _parsedItem$fill : settings === null || settings === void 0 ? void 0 : settings.fill
|
||||
});
|
||||
agg.push((0, _ChartUtils.getTooltipEntry)({
|
||||
tooltipEntrySettings: newSettings,
|
||||
dataKey: itemDataKey,
|
||||
payload: itemPayload,
|
||||
value: (0, _ChartUtils.getValueByDataKey)(itemPayload, itemDataKey),
|
||||
name: itemName == null ? undefined : String(itemName)
|
||||
}));
|
||||
});
|
||||
} else {
|
||||
var _getValueByDataKey;
|
||||
// I am not quite sure why these two branches (Array vs Array of Arrays) have to behave differently - I imagine we should unify these. 3.x breaking change?
|
||||
agg.push((0, _ChartUtils.getTooltipEntry)({
|
||||
tooltipEntrySettings: settings,
|
||||
dataKey: finalDataKey,
|
||||
payload: tooltipPayload,
|
||||
// getValueByDataKey does not validate the output type
|
||||
value: (0, _ChartUtils.getValueByDataKey)(tooltipPayload, finalDataKey),
|
||||
// getValueByDataKey does not validate the output type
|
||||
name: (_getValueByDataKey = (0, _ChartUtils.getValueByDataKey)(tooltipPayload, finalNameKey)) !== null && _getValueByDataKey !== void 0 ? _getValueByDataKey : settings === null || settings === void 0 ? void 0 : settings.name
|
||||
}));
|
||||
}
|
||||
return agg;
|
||||
}, init);
|
||||
};
|
||||
exports.combineTooltipPayload = combineTooltipPayload;
|
||||
52
frontend/node_modules/recharts/lib/state/selectors/combiners/combineTooltipPayloadConfigurations.js
generated
vendored
Normal file
52
frontend/node_modules/recharts/lib/state/selectors/combiners/combineTooltipPayloadConfigurations.js
generated
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.combineTooltipPayloadConfigurations = void 0;
|
||||
var combineTooltipPayloadConfigurations = (tooltipState, tooltipEventType, trigger, defaultIndex) => {
|
||||
// if tooltip reacts to axis interaction, then we display all items at the same time.
|
||||
if (tooltipEventType === 'axis') {
|
||||
return tooltipState.tooltipItemPayloads;
|
||||
}
|
||||
/*
|
||||
* By now we already know that tooltipEventType is 'item', so we can only search in itemInteractions.
|
||||
* item means that only the hovered or clicked item will be present in the tooltip.
|
||||
*/
|
||||
if (tooltipState.tooltipItemPayloads.length === 0) {
|
||||
// No point filtering if the payload is empty
|
||||
return [];
|
||||
}
|
||||
var filterByGraphicalItemId;
|
||||
if (trigger === 'hover') {
|
||||
filterByGraphicalItemId = tooltipState.itemInteraction.hover.graphicalItemId;
|
||||
} else {
|
||||
filterByGraphicalItemId = tooltipState.itemInteraction.click.graphicalItemId;
|
||||
}
|
||||
if (tooltipState.syncInteraction.active && filterByGraphicalItemId == null) {
|
||||
/*
|
||||
* When a tooltip is synchronised from another chart, the local itemInteraction
|
||||
* has no graphicalItemId because the user hasn't hovered over this chart.
|
||||
* In that case we show all tooltip items so the receiving chart can display
|
||||
* its own data at the synced index — matching the behaviour of axis-type tooltips.
|
||||
*/
|
||||
return tooltipState.tooltipItemPayloads;
|
||||
}
|
||||
if (filterByGraphicalItemId == null && (defaultIndex != null || tooltipState.keyboardInteraction.active)) {
|
||||
/*
|
||||
* So when we use `defaultIndex` - we don't have a dataKey to filter by because user did not hover over anything yet.
|
||||
* In that case let's display the first item in the tooltip; after all, this is `item` interaction case,
|
||||
* so we should display only one item at a time instead of all.
|
||||
*/
|
||||
var firstItemPayload = tooltipState.tooltipItemPayloads[0];
|
||||
if (firstItemPayload != null) {
|
||||
return [firstItemPayload];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
return tooltipState.tooltipItemPayloads.filter(tpc => {
|
||||
var _tpc$settings;
|
||||
return ((_tpc$settings = tpc.settings) === null || _tpc$settings === void 0 ? void 0 : _tpc$settings.graphicalItemId) === filterByGraphicalItemId;
|
||||
});
|
||||
};
|
||||
exports.combineTooltipPayloadConfigurations = combineTooltipPayloadConfigurations;
|
||||
14
frontend/node_modules/recharts/lib/state/selectors/containerSelectors.js
generated
vendored
Normal file
14
frontend/node_modules/recharts/lib/state/selectors/containerSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectMargin = exports.selectContainerScale = exports.selectChartWidth = exports.selectChartHeight = void 0;
|
||||
var selectChartWidth = state => state.layout.width;
|
||||
exports.selectChartWidth = selectChartWidth;
|
||||
var selectChartHeight = state => state.layout.height;
|
||||
exports.selectChartHeight = selectChartHeight;
|
||||
var selectContainerScale = state => state.layout.scale;
|
||||
exports.selectContainerScale = selectContainerScale;
|
||||
var selectMargin = state => state.layout.margin;
|
||||
exports.selectMargin = selectMargin;
|
||||
87
frontend/node_modules/recharts/lib/state/selectors/dataSelectors.js
generated
vendored
Normal file
87
frontend/node_modules/recharts/lib/state/selectors/dataSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectChartDataWithIndexesIfNotInPanoramaPosition4 = exports.selectChartDataWithIndexesIfNotInPanoramaPosition3 = exports.selectChartDataWithIndexes = exports.selectChartDataSliceWithIndexes = exports.selectChartDataSliceIgnoringIndexes = exports.selectChartDataSliceIfNotInPanorama = exports.selectChartDataAndAlwaysIgnoreIndexes = void 0;
|
||||
var _reselect = require("reselect");
|
||||
/**
|
||||
* This selector always returns the data with the indexes set by a Brush.
|
||||
* Trouble is, that might or might not be what you want.
|
||||
*
|
||||
* In charts with Brush, you will sometimes want to select the full range of data, and sometimes the one decided by the Brush
|
||||
* - even if the Brush is active, the panorama inside the Brush should show the full range of data.
|
||||
*
|
||||
* So instead of this selector, consider using either selectChartDataAndAlwaysIgnoreIndexes or selectChartDataWithIndexesIfNotInPanorama
|
||||
*
|
||||
* @param state RechartsRootState
|
||||
* @returns data defined on the chart root element, such as BarChart or ScatterChart
|
||||
*/
|
||||
var selectChartDataWithIndexes = state => state.chartData;
|
||||
|
||||
/**
|
||||
* This selector will always return the full range of data, ignoring the indexes set by a Brush.
|
||||
* Useful for when you want to render the full range of data, even if a Brush is active.
|
||||
* For example: in the Brush panorama, in Legend, in Tooltip.
|
||||
*/
|
||||
exports.selectChartDataWithIndexes = selectChartDataWithIndexes;
|
||||
var selectChartDataAndAlwaysIgnoreIndexes = exports.selectChartDataAndAlwaysIgnoreIndexes = (0, _reselect.createSelector)([selectChartDataWithIndexes], dataState => {
|
||||
var dataEndIndex = dataState.chartData != null ? dataState.chartData.length - 1 : 0;
|
||||
return {
|
||||
chartData: dataState.chartData,
|
||||
computedData: dataState.computedData,
|
||||
dataEndIndex,
|
||||
dataStartIndex: 0
|
||||
};
|
||||
});
|
||||
var selectChartDataWithIndexesIfNotInPanoramaPosition4 = (state, _unused1, _unused2, isPanorama) => {
|
||||
if (isPanorama) {
|
||||
return selectChartDataAndAlwaysIgnoreIndexes(state);
|
||||
}
|
||||
return selectChartDataWithIndexes(state);
|
||||
};
|
||||
exports.selectChartDataWithIndexesIfNotInPanoramaPosition4 = selectChartDataWithIndexesIfNotInPanoramaPosition4;
|
||||
var selectChartDataWithIndexesIfNotInPanoramaPosition3 = (state, _unused1, isPanorama) => {
|
||||
if (isPanorama) {
|
||||
return selectChartDataAndAlwaysIgnoreIndexes(state);
|
||||
}
|
||||
return selectChartDataWithIndexes(state);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the chart-level data slice (respecting Brush indexes), memoized by content so that
|
||||
* spurious Immer reference changes (e.g. dispatching `setChartData(undefined)` when data is
|
||||
* already `undefined`) do not propagate to downstream selectors.
|
||||
*
|
||||
* Used when a selector needs chart-level data but must avoid extra recomputes when the
|
||||
* data content has not actually changed.
|
||||
*/
|
||||
exports.selectChartDataWithIndexesIfNotInPanoramaPosition3 = selectChartDataWithIndexesIfNotInPanoramaPosition3;
|
||||
var selectChartDataSliceIfNotInPanorama = exports.selectChartDataSliceIfNotInPanorama = (0, _reselect.createSelector)([selectChartDataWithIndexesIfNotInPanoramaPosition4], _ref => {
|
||||
var chartData = _ref.chartData,
|
||||
dataStartIndex = _ref.dataStartIndex,
|
||||
dataEndIndex = _ref.dataEndIndex;
|
||||
return chartData != null ? chartData.slice(dataStartIndex, dataEndIndex + 1) : [];
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns the chart-level data slice (ignoring Brush indexes), memoized by content.
|
||||
* Used in tooltip and polar selectors that always need the full data range.
|
||||
*/
|
||||
var selectChartDataSliceIgnoringIndexes = exports.selectChartDataSliceIgnoringIndexes = (0, _reselect.createSelector)([selectChartDataAndAlwaysIgnoreIndexes], _ref2 => {
|
||||
var chartData = _ref2.chartData,
|
||||
dataStartIndex = _ref2.dataStartIndex,
|
||||
dataEndIndex = _ref2.dataEndIndex;
|
||||
return chartData != null ? chartData.slice(dataStartIndex, dataEndIndex + 1) : [];
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns the chart-level data slice (with Brush indexes applied), memoized by content.
|
||||
* Used in tooltip selectors.
|
||||
*/
|
||||
var selectChartDataSliceWithIndexes = exports.selectChartDataSliceWithIndexes = (0, _reselect.createSelector)([selectChartDataWithIndexes], _ref3 => {
|
||||
var chartData = _ref3.chartData,
|
||||
dataStartIndex = _ref3.dataStartIndex,
|
||||
dataEndIndex = _ref3.dataEndIndex;
|
||||
return chartData != null ? chartData.slice(dataStartIndex, dataEndIndex + 1) : [];
|
||||
});
|
||||
55
frontend/node_modules/recharts/lib/state/selectors/funnelSelectors.js
generated
vendored
Normal file
55
frontend/node_modules/recharts/lib/state/selectors/funnelSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectFunnelTrapezoids = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _Funnel = require("../../cartesian/Funnel");
|
||||
var _selectChartOffsetInternal = require("./selectChartOffsetInternal");
|
||||
var _dataSelectors = require("./dataSelectors");
|
||||
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) { _defineProperty(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; }
|
||||
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
||||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
||||
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
||||
var pickFunnelSettings = (_state, funnelSettings) => funnelSettings;
|
||||
var selectFunnelTrapezoids = exports.selectFunnelTrapezoids = (0, _reselect.createSelector)([_selectChartOffsetInternal.selectChartOffsetInternal, pickFunnelSettings, _dataSelectors.selectChartDataAndAlwaysIgnoreIndexes], (offset, _ref, _ref2) => {
|
||||
var data = _ref.data,
|
||||
dataKey = _ref.dataKey,
|
||||
nameKey = _ref.nameKey,
|
||||
tooltipType = _ref.tooltipType,
|
||||
lastShapeType = _ref.lastShapeType,
|
||||
reversed = _ref.reversed,
|
||||
customWidth = _ref.customWidth,
|
||||
cells = _ref.cells,
|
||||
presentationProps = _ref.presentationProps,
|
||||
graphicalItemId = _ref.id;
|
||||
var chartData = _ref2.chartData;
|
||||
var displayedData;
|
||||
if (data != null && data.length > 0) {
|
||||
displayedData = data;
|
||||
} else if (chartData != null && chartData.length > 0) {
|
||||
displayedData = chartData;
|
||||
}
|
||||
if (displayedData && displayedData.length) {
|
||||
displayedData = displayedData.map((entry, index) => _objectSpread(_objectSpread(_objectSpread({
|
||||
payload: entry
|
||||
}, presentationProps), entry), cells && cells[index] && cells[index].props));
|
||||
} else if (cells && cells.length) {
|
||||
displayedData = cells.map(cell => _objectSpread(_objectSpread({}, presentationProps), cell.props));
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
return (0, _Funnel.computeFunnelTrapezoids)({
|
||||
dataKey,
|
||||
nameKey,
|
||||
displayedData,
|
||||
tooltipType,
|
||||
lastShapeType,
|
||||
reversed,
|
||||
offset,
|
||||
customWidth,
|
||||
graphicalItemId
|
||||
});
|
||||
});
|
||||
16
frontend/node_modules/recharts/lib/state/selectors/graphicalItemSelectors.js
generated
vendored
Normal file
16
frontend/node_modules/recharts/lib/state/selectors/graphicalItemSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectXAxisIdFromGraphicalItemId = selectXAxisIdFromGraphicalItemId;
|
||||
exports.selectYAxisIdFromGraphicalItemId = selectYAxisIdFromGraphicalItemId;
|
||||
var _cartesianAxisSlice = require("../cartesianAxisSlice");
|
||||
function selectXAxisIdFromGraphicalItemId(state, id) {
|
||||
var _state$graphicalItems, _state$graphicalItems2;
|
||||
return (_state$graphicalItems = (_state$graphicalItems2 = state.graphicalItems.cartesianItems.find(item => item.id === id)) === null || _state$graphicalItems2 === void 0 ? void 0 : _state$graphicalItems2.xAxisId) !== null && _state$graphicalItems !== void 0 ? _state$graphicalItems : _cartesianAxisSlice.defaultAxisId;
|
||||
}
|
||||
function selectYAxisIdFromGraphicalItemId(state, id) {
|
||||
var _state$graphicalItems3, _state$graphicalItems4;
|
||||
return (_state$graphicalItems3 = (_state$graphicalItems4 = state.graphicalItems.cartesianItems.find(item => item.id === id)) === null || _state$graphicalItems4 === void 0 ? void 0 : _state$graphicalItems4.yAxisId) !== null && _state$graphicalItems3 !== void 0 ? _state$graphicalItems3 : _cartesianAxisSlice.defaultAxisId;
|
||||
}
|
||||
19
frontend/node_modules/recharts/lib/state/selectors/legendSelectors.js
generated
vendored
Normal file
19
frontend/node_modules/recharts/lib/state/selectors/legendSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectLegendSize = exports.selectLegendSettings = exports.selectLegendPayload = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _sortBy = _interopRequireDefault(require("es-toolkit/compat/sortBy"));
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
||||
var selectLegendSettings = state => state.legend.settings;
|
||||
exports.selectLegendSettings = selectLegendSettings;
|
||||
var selectLegendSize = state => state.legend.size;
|
||||
exports.selectLegendSize = selectLegendSize;
|
||||
var selectAllLegendPayload2DArray = state => state.legend.payload;
|
||||
var selectLegendPayload = exports.selectLegendPayload = (0, _reselect.createSelector)([selectAllLegendPayload2DArray, selectLegendSettings], (payloads, _ref) => {
|
||||
var itemSorter = _ref.itemSorter;
|
||||
var flat = payloads.flat(1);
|
||||
return itemSorter ? (0, _sortBy.default)(flat, itemSorter) : flat;
|
||||
});
|
||||
65
frontend/node_modules/recharts/lib/state/selectors/lineSelectors.js
generated
vendored
Normal file
65
frontend/node_modules/recharts/lib/state/selectors/lineSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectLinePoints = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _Line = require("../../cartesian/Line");
|
||||
var _dataSelectors = require("./dataSelectors");
|
||||
var _chartLayoutContext = require("../../context/chartLayoutContext");
|
||||
var _axisSelectors = require("./axisSelectors");
|
||||
var _ChartUtils = require("../../util/ChartUtils");
|
||||
var selectXAxisWithScale = (state, xAxisId, _yAxisId, isPanorama) => (0, _axisSelectors.selectAxisWithScale)(state, 'xAxis', xAxisId, isPanorama);
|
||||
var selectXAxisTicks = (state, xAxisId, _yAxisId, isPanorama) => (0, _axisSelectors.selectTicksOfGraphicalItem)(state, 'xAxis', xAxisId, isPanorama);
|
||||
var selectYAxisWithScale = (state, _xAxisId, yAxisId, isPanorama) => (0, _axisSelectors.selectAxisWithScale)(state, 'yAxis', yAxisId, isPanorama);
|
||||
var selectYAxisTicks = (state, _xAxisId, yAxisId, isPanorama) => (0, _axisSelectors.selectTicksOfGraphicalItem)(state, 'yAxis', yAxisId, isPanorama);
|
||||
var selectBandSize = (0, _reselect.createSelector)([_chartLayoutContext.selectChartLayout, selectXAxisWithScale, selectYAxisWithScale, selectXAxisTicks, selectYAxisTicks], (layout, xAxis, yAxis, xAxisTicks, yAxisTicks) => {
|
||||
if ((0, _ChartUtils.isCategoricalAxis)(layout, 'xAxis')) {
|
||||
return (0, _ChartUtils.getBandSizeOfAxis)(xAxis, xAxisTicks, false);
|
||||
}
|
||||
return (0, _ChartUtils.getBandSizeOfAxis)(yAxis, yAxisTicks, false);
|
||||
});
|
||||
var pickLineId = (_state, _xAxisId, _yAxisId, _isPanorama, id) => id;
|
||||
function isLineSettings(item) {
|
||||
return item.type === 'line';
|
||||
}
|
||||
|
||||
/*
|
||||
* There is a race condition problem because we read some data from props and some from the state.
|
||||
* The state is updated through a dispatch and is one render behind,
|
||||
* and so we have this weird one tick render where the displayedData in one selector have the old dataKey
|
||||
* but the new dataKey in another selector.
|
||||
*
|
||||
* So here instead of reading the dataKey from the props, we always read it from the state.
|
||||
*/
|
||||
var selectSynchronisedLineSettings = (0, _reselect.createSelector)([_axisSelectors.selectUnfilteredCartesianItems, pickLineId], (graphicalItems, id) => graphicalItems.filter(isLineSettings).find(x => x.id === id));
|
||||
var selectLinePoints = exports.selectLinePoints = (0, _reselect.createSelector)([_chartLayoutContext.selectChartLayout, selectXAxisWithScale, selectYAxisWithScale, selectXAxisTicks, selectYAxisTicks, selectSynchronisedLineSettings, selectBandSize, _dataSelectors.selectChartDataWithIndexesIfNotInPanoramaPosition4], (layout, xAxis, yAxis, xAxisTicks, yAxisTicks, lineSettings, bandSize, _ref) => {
|
||||
var chartData = _ref.chartData,
|
||||
dataStartIndex = _ref.dataStartIndex,
|
||||
dataEndIndex = _ref.dataEndIndex;
|
||||
if (lineSettings == null || xAxis == null || yAxis == null || xAxisTicks == null || yAxisTicks == null || xAxisTicks.length === 0 || yAxisTicks.length === 0 || bandSize == null || layout !== 'horizontal' && layout !== 'vertical') {
|
||||
return undefined;
|
||||
}
|
||||
var dataKey = lineSettings.dataKey,
|
||||
data = lineSettings.data;
|
||||
var displayedData;
|
||||
if (data != null && data.length > 0) {
|
||||
displayedData = data;
|
||||
} else {
|
||||
displayedData = chartData === null || chartData === void 0 ? void 0 : chartData.slice(dataStartIndex, dataEndIndex + 1);
|
||||
}
|
||||
if (displayedData == null) {
|
||||
return undefined;
|
||||
}
|
||||
return (0, _Line.computeLinePoints)({
|
||||
layout,
|
||||
xAxis,
|
||||
yAxis,
|
||||
xAxisTicks,
|
||||
yAxisTicks,
|
||||
dataKey,
|
||||
bandSize,
|
||||
displayedData
|
||||
});
|
||||
});
|
||||
16
frontend/node_modules/recharts/lib/state/selectors/numberDomainEqualityCheck.js
generated
vendored
Normal file
16
frontend/node_modules/recharts/lib/state/selectors/numberDomainEqualityCheck.js
generated
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.numberDomainEqualityCheck = void 0;
|
||||
var numberDomainEqualityCheck = (a, b) => {
|
||||
if (a === b) {
|
||||
return true;
|
||||
}
|
||||
if (a == null || b == null) {
|
||||
return false;
|
||||
}
|
||||
return a[0] === b[0] && a[1] === b[1];
|
||||
};
|
||||
exports.numberDomainEqualityCheck = numberDomainEqualityCheck;
|
||||
8
frontend/node_modules/recharts/lib/state/selectors/pickAxisId.js
generated
vendored
Normal file
8
frontend/node_modules/recharts/lib/state/selectors/pickAxisId.js
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.pickAxisId = void 0;
|
||||
var pickAxisId = (_state, _axisType, axisId) => axisId;
|
||||
exports.pickAxisId = pickAxisId;
|
||||
8
frontend/node_modules/recharts/lib/state/selectors/pickAxisType.js
generated
vendored
Normal file
8
frontend/node_modules/recharts/lib/state/selectors/pickAxisType.js
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.pickAxisType = void 0;
|
||||
var pickAxisType = (_state, axisType) => axisType;
|
||||
exports.pickAxisType = pickAxisType;
|
||||
83
frontend/node_modules/recharts/lib/state/selectors/pieSelectors.js
generated
vendored
Normal file
83
frontend/node_modules/recharts/lib/state/selectors/pieSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectPieSectors = exports.selectPieLegend = exports.selectDisplayedData = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _Pie = require("../../polar/Pie");
|
||||
var _dataSelectors = require("./dataSelectors");
|
||||
var _selectChartOffsetInternal = require("./selectChartOffsetInternal");
|
||||
var _ChartUtils = require("../../util/ChartUtils");
|
||||
var _polarSelectors = require("./polarSelectors");
|
||||
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) { _defineProperty(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; }
|
||||
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
||||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
||||
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
||||
var pickId = (_state, id) => id;
|
||||
var selectSynchronisedPieSettings = (0, _reselect.createSelector)([_polarSelectors.selectUnfilteredPolarItems, pickId], (graphicalItems, id) => graphicalItems.filter(item => item.type === 'pie').find(item => item.id === id));
|
||||
|
||||
// Keep stable reference to an empty array to prevent re-renders
|
||||
var emptyArray = [];
|
||||
var pickCells = (_state, _id, cells) => {
|
||||
if ((cells === null || cells === void 0 ? void 0 : cells.length) === 0) {
|
||||
return emptyArray;
|
||||
}
|
||||
return cells;
|
||||
};
|
||||
var selectDisplayedData = exports.selectDisplayedData = (0, _reselect.createSelector)([_dataSelectors.selectChartDataAndAlwaysIgnoreIndexes, selectSynchronisedPieSettings, pickCells], (_ref, pieSettings, cells) => {
|
||||
var chartData = _ref.chartData;
|
||||
if (pieSettings == null) {
|
||||
return undefined;
|
||||
}
|
||||
var displayedData;
|
||||
if ((pieSettings === null || pieSettings === void 0 ? void 0 : pieSettings.data) != null && pieSettings.data.length > 0) {
|
||||
displayedData = pieSettings.data;
|
||||
} else {
|
||||
displayedData = chartData;
|
||||
}
|
||||
if ((!displayedData || !displayedData.length) && cells != null) {
|
||||
displayedData = cells.map(cell => _objectSpread(_objectSpread({}, pieSettings.presentationProps), cell.props));
|
||||
}
|
||||
if (displayedData == null) {
|
||||
return undefined;
|
||||
}
|
||||
return displayedData;
|
||||
});
|
||||
var selectPieLegend = exports.selectPieLegend = (0, _reselect.createSelector)([selectDisplayedData, selectSynchronisedPieSettings, pickCells], (displayedData, pieSettings, cells) => {
|
||||
if (displayedData == null || pieSettings == null) {
|
||||
return undefined;
|
||||
}
|
||||
return displayedData.map((entry, i) => {
|
||||
var _cells$i;
|
||||
var name = (0, _ChartUtils.getValueByDataKey)(entry, pieSettings.nameKey, pieSettings.name);
|
||||
var color;
|
||||
if (cells !== null && cells !== void 0 && (_cells$i = cells[i]) !== null && _cells$i !== void 0 && (_cells$i = _cells$i.props) !== null && _cells$i !== void 0 && _cells$i.fill) {
|
||||
color = cells[i].props.fill;
|
||||
} else if (typeof entry === 'object' && entry != null && 'fill' in entry) {
|
||||
color = entry.fill;
|
||||
} else {
|
||||
color = pieSettings.fill;
|
||||
}
|
||||
return {
|
||||
value: (0, _ChartUtils.getTooltipNameProp)(name, pieSettings.dataKey),
|
||||
dataKey: pieSettings.dataKey,
|
||||
color,
|
||||
// @ts-expect-error Legend payload.payload says it wants objects but our data can be unknown
|
||||
payload: entry,
|
||||
type: pieSettings.legendType
|
||||
};
|
||||
});
|
||||
});
|
||||
var selectPieSectors = exports.selectPieSectors = (0, _reselect.createSelector)([selectDisplayedData, selectSynchronisedPieSettings, pickCells, _selectChartOffsetInternal.selectChartOffsetInternal], (displayedData, pieSettings, cells, offset) => {
|
||||
if (pieSettings == null || displayedData == null) {
|
||||
return undefined;
|
||||
}
|
||||
return (0, _Pie.computePieSectors)({
|
||||
offset,
|
||||
pieSettings,
|
||||
displayedData,
|
||||
cells
|
||||
});
|
||||
});
|
||||
137
frontend/node_modules/recharts/lib/state/selectors/polarAxisSelectors.js
generated
vendored
Normal file
137
frontend/node_modules/recharts/lib/state/selectors/polarAxisSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectRadiusAxisRangeWithReversed = exports.selectRadiusAxisRange = exports.selectRadiusAxis = exports.selectPolarViewBox = exports.selectPolarOptions = exports.selectOuterRadius = exports.selectMaxRadius = exports.selectAngleAxisRangeWithReversed = exports.selectAngleAxisRange = exports.selectAngleAxis = exports.implicitRadiusAxis = exports.implicitAngleAxis = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _containerSelectors = require("./containerSelectors");
|
||||
var _selectChartOffsetInternal = require("./selectChartOffsetInternal");
|
||||
var _PolarUtils = require("../../util/PolarUtils");
|
||||
var _DataUtils = require("../../util/DataUtils");
|
||||
var _defaultPolarAngleAxisProps = require("../../polar/defaultPolarAngleAxisProps");
|
||||
var _defaultPolarRadiusAxisProps = require("../../polar/defaultPolarRadiusAxisProps");
|
||||
var _combineAxisRangeWithReverse = require("./combiners/combineAxisRangeWithReverse");
|
||||
var _chartLayoutContext = require("../../context/chartLayoutContext");
|
||||
var _getAxisTypeBasedOnLayout = require("../../util/getAxisTypeBasedOnLayout");
|
||||
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) { _defineProperty(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; }
|
||||
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
||||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
||||
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
||||
var implicitAngleAxis = exports.implicitAngleAxis = {
|
||||
allowDataOverflow: _defaultPolarAngleAxisProps.defaultPolarAngleAxisProps.allowDataOverflow,
|
||||
allowDecimals: _defaultPolarAngleAxisProps.defaultPolarAngleAxisProps.allowDecimals,
|
||||
allowDuplicatedCategory: false,
|
||||
// defaultPolarAngleAxisProps.allowDuplicatedCategory has it set to true but the actual axis rendering ignores the prop because reasons,
|
||||
dataKey: undefined,
|
||||
domain: undefined,
|
||||
id: _defaultPolarAngleAxisProps.defaultPolarAngleAxisProps.angleAxisId,
|
||||
includeHidden: false,
|
||||
name: undefined,
|
||||
reversed: _defaultPolarAngleAxisProps.defaultPolarAngleAxisProps.reversed,
|
||||
scale: _defaultPolarAngleAxisProps.defaultPolarAngleAxisProps.scale,
|
||||
tick: _defaultPolarAngleAxisProps.defaultPolarAngleAxisProps.tick,
|
||||
tickCount: undefined,
|
||||
ticks: undefined,
|
||||
type: _defaultPolarAngleAxisProps.defaultPolarAngleAxisProps.type,
|
||||
unit: undefined,
|
||||
niceTicks: 'auto'
|
||||
};
|
||||
var implicitRadiusAxis = exports.implicitRadiusAxis = {
|
||||
allowDataOverflow: _defaultPolarRadiusAxisProps.defaultPolarRadiusAxisProps.allowDataOverflow,
|
||||
allowDecimals: _defaultPolarRadiusAxisProps.defaultPolarRadiusAxisProps.allowDecimals,
|
||||
allowDuplicatedCategory: _defaultPolarRadiusAxisProps.defaultPolarRadiusAxisProps.allowDuplicatedCategory,
|
||||
dataKey: undefined,
|
||||
domain: undefined,
|
||||
id: _defaultPolarRadiusAxisProps.defaultPolarRadiusAxisProps.radiusAxisId,
|
||||
includeHidden: _defaultPolarRadiusAxisProps.defaultPolarRadiusAxisProps.includeHidden,
|
||||
name: undefined,
|
||||
reversed: _defaultPolarRadiusAxisProps.defaultPolarRadiusAxisProps.reversed,
|
||||
scale: _defaultPolarRadiusAxisProps.defaultPolarRadiusAxisProps.scale,
|
||||
tick: _defaultPolarRadiusAxisProps.defaultPolarRadiusAxisProps.tick,
|
||||
tickCount: _defaultPolarRadiusAxisProps.defaultPolarRadiusAxisProps.tickCount,
|
||||
ticks: undefined,
|
||||
type: _defaultPolarRadiusAxisProps.defaultPolarRadiusAxisProps.type,
|
||||
unit: undefined,
|
||||
niceTicks: 'auto'
|
||||
};
|
||||
var selectAngleAxisNoDefaults = (state, angleAxisId) => {
|
||||
if (angleAxisId == null) {
|
||||
return undefined;
|
||||
}
|
||||
return state.polarAxis.angleAxis[angleAxisId];
|
||||
};
|
||||
var selectAngleAxis = exports.selectAngleAxis = (0, _reselect.createSelector)([selectAngleAxisNoDefaults, _chartLayoutContext.selectPolarChartLayout], (angleAxisSettings, layout) => {
|
||||
var _getAxisTypeBasedOnLa;
|
||||
if (angleAxisSettings != null) {
|
||||
return angleAxisSettings;
|
||||
}
|
||||
var evaluatedType = (_getAxisTypeBasedOnLa = (0, _getAxisTypeBasedOnLayout.getAxisTypeBasedOnLayout)(layout, 'angleAxis', implicitAngleAxis.type)) !== null && _getAxisTypeBasedOnLa !== void 0 ? _getAxisTypeBasedOnLa : 'category';
|
||||
return _objectSpread(_objectSpread({}, implicitAngleAxis), {}, {
|
||||
type: evaluatedType
|
||||
});
|
||||
});
|
||||
var selectRadiusAxisNoDefaults = (state, radiusAxisId) => {
|
||||
return state.polarAxis.radiusAxis[radiusAxisId];
|
||||
};
|
||||
var selectRadiusAxis = exports.selectRadiusAxis = (0, _reselect.createSelector)([selectRadiusAxisNoDefaults, _chartLayoutContext.selectPolarChartLayout], (radiusAxisSettings, layout) => {
|
||||
var _getAxisTypeBasedOnLa2;
|
||||
if (radiusAxisSettings != null) {
|
||||
return radiusAxisSettings;
|
||||
}
|
||||
var evaluatedType = (_getAxisTypeBasedOnLa2 = (0, _getAxisTypeBasedOnLayout.getAxisTypeBasedOnLayout)(layout, 'radiusAxis', implicitRadiusAxis.type)) !== null && _getAxisTypeBasedOnLa2 !== void 0 ? _getAxisTypeBasedOnLa2 : 'category';
|
||||
return _objectSpread(_objectSpread({}, implicitRadiusAxis), {}, {
|
||||
type: evaluatedType
|
||||
});
|
||||
});
|
||||
var selectPolarOptions = state => state.polarOptions;
|
||||
exports.selectPolarOptions = selectPolarOptions;
|
||||
var selectMaxRadius = exports.selectMaxRadius = (0, _reselect.createSelector)([_containerSelectors.selectChartWidth, _containerSelectors.selectChartHeight, _selectChartOffsetInternal.selectChartOffsetInternal], _PolarUtils.getMaxRadius);
|
||||
var selectInnerRadius = (0, _reselect.createSelector)([selectPolarOptions, selectMaxRadius], (polarChartOptions, maxRadius) => {
|
||||
if (polarChartOptions == null) {
|
||||
return undefined;
|
||||
}
|
||||
return (0, _DataUtils.getPercentValue)(polarChartOptions.innerRadius, maxRadius, 0);
|
||||
});
|
||||
var selectOuterRadius = exports.selectOuterRadius = (0, _reselect.createSelector)([selectPolarOptions, selectMaxRadius], (polarChartOptions, maxRadius) => {
|
||||
if (polarChartOptions == null) {
|
||||
return undefined;
|
||||
}
|
||||
return (0, _DataUtils.getPercentValue)(polarChartOptions.outerRadius, maxRadius, maxRadius * 0.8);
|
||||
});
|
||||
var combineAngleAxisRange = polarOptions => {
|
||||
if (polarOptions == null) {
|
||||
return [0, 0];
|
||||
}
|
||||
var startAngle = polarOptions.startAngle,
|
||||
endAngle = polarOptions.endAngle;
|
||||
return [startAngle, endAngle];
|
||||
};
|
||||
var selectAngleAxisRange = exports.selectAngleAxisRange = (0, _reselect.createSelector)([selectPolarOptions], combineAngleAxisRange);
|
||||
var selectAngleAxisRangeWithReversed = exports.selectAngleAxisRangeWithReversed = (0, _reselect.createSelector)([selectAngleAxis, selectAngleAxisRange], _combineAxisRangeWithReverse.combineAxisRangeWithReverse);
|
||||
var selectRadiusAxisRange = exports.selectRadiusAxisRange = (0, _reselect.createSelector)([selectMaxRadius, selectInnerRadius, selectOuterRadius], (maxRadius, innerRadius, outerRadius) => {
|
||||
if (maxRadius == null || innerRadius == null || outerRadius == null) {
|
||||
return undefined;
|
||||
}
|
||||
return [innerRadius, outerRadius];
|
||||
});
|
||||
var selectRadiusAxisRangeWithReversed = exports.selectRadiusAxisRangeWithReversed = (0, _reselect.createSelector)([selectRadiusAxis, selectRadiusAxisRange], _combineAxisRangeWithReverse.combineAxisRangeWithReverse);
|
||||
var selectPolarViewBox = exports.selectPolarViewBox = (0, _reselect.createSelector)([_chartLayoutContext.selectChartLayout, selectPolarOptions, selectInnerRadius, selectOuterRadius, _containerSelectors.selectChartWidth, _containerSelectors.selectChartHeight], (layout, polarOptions, innerRadius, outerRadius, width, height) => {
|
||||
if (layout !== 'centric' && layout !== 'radial' || polarOptions == null || innerRadius == null || outerRadius == null) {
|
||||
return undefined;
|
||||
}
|
||||
var cx = polarOptions.cx,
|
||||
cy = polarOptions.cy,
|
||||
startAngle = polarOptions.startAngle,
|
||||
endAngle = polarOptions.endAngle;
|
||||
return {
|
||||
cx: (0, _DataUtils.getPercentValue)(cx, width, width / 2),
|
||||
cy: (0, _DataUtils.getPercentValue)(cy, height, height / 2),
|
||||
innerRadius,
|
||||
outerRadius,
|
||||
startAngle,
|
||||
endAngle,
|
||||
clockWise: false // this property look useful, why not use it?
|
||||
};
|
||||
});
|
||||
22
frontend/node_modules/recharts/lib/state/selectors/polarGridSelectors.js
generated
vendored
Normal file
22
frontend/node_modules/recharts/lib/state/selectors/polarGridSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectPolarGridRadii = exports.selectPolarGridAngles = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _polarScaleSelectors = require("./polarScaleSelectors");
|
||||
var selectAngleAxisTicks = (state, anglexisId) => (0, _polarScaleSelectors.selectPolarAxisTicks)(state, 'angleAxis', anglexisId, false);
|
||||
var selectPolarGridAngles = exports.selectPolarGridAngles = (0, _reselect.createSelector)([selectAngleAxisTicks], ticks => {
|
||||
if (!ticks) {
|
||||
return undefined;
|
||||
}
|
||||
return ticks.map(tick => tick.coordinate);
|
||||
});
|
||||
var selectRadiusAxisTicks = (state, radiusAxisId) => (0, _polarScaleSelectors.selectPolarAxisTicks)(state, 'radiusAxis', radiusAxisId, false);
|
||||
var selectPolarGridRadii = exports.selectPolarGridRadii = (0, _reselect.createSelector)([selectRadiusAxisTicks], ticks => {
|
||||
if (!ticks) {
|
||||
return undefined;
|
||||
}
|
||||
return ticks.map(tick => tick.coordinate);
|
||||
});
|
||||
69
frontend/node_modules/recharts/lib/state/selectors/polarScaleSelectors.js
generated
vendored
Normal file
69
frontend/node_modules/recharts/lib/state/selectors/polarScaleSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectPolarGraphicalItemAxisTicks = exports.selectPolarCategoricalDomain = exports.selectPolarAxisTicks = exports.selectPolarAxisScale = exports.selectPolarAxis = exports.selectPolarAngleAxisTicks = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _axisSelectors = require("./axisSelectors");
|
||||
var _polarAxisSelectors = require("./polarAxisSelectors");
|
||||
var _chartLayoutContext = require("../../context/chartLayoutContext");
|
||||
var _polarSelectors = require("./polarSelectors");
|
||||
var _pickAxisType = require("./pickAxisType");
|
||||
var _RechartsScale = require("../../util/scale/RechartsScale");
|
||||
var _combineConfiguredScale = require("./combiners/combineConfiguredScale");
|
||||
var selectPolarAxis = (state, axisType, axisId) => {
|
||||
switch (axisType) {
|
||||
case 'angleAxis':
|
||||
{
|
||||
return (0, _polarAxisSelectors.selectAngleAxis)(state, axisId);
|
||||
}
|
||||
case 'radiusAxis':
|
||||
{
|
||||
return (0, _polarAxisSelectors.selectRadiusAxis)(state, axisId);
|
||||
}
|
||||
default:
|
||||
{
|
||||
throw new Error("Unexpected axis type: ".concat(axisType));
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.selectPolarAxis = selectPolarAxis;
|
||||
var selectPolarAxisRangeWithReversed = (state, axisType, axisId) => {
|
||||
switch (axisType) {
|
||||
case 'angleAxis':
|
||||
{
|
||||
return (0, _polarAxisSelectors.selectAngleAxisRangeWithReversed)(state, axisId);
|
||||
}
|
||||
case 'radiusAxis':
|
||||
{
|
||||
return (0, _polarAxisSelectors.selectRadiusAxisRangeWithReversed)(state, axisId);
|
||||
}
|
||||
default:
|
||||
{
|
||||
throw new Error("Unexpected axis type: ".concat(axisType));
|
||||
}
|
||||
}
|
||||
};
|
||||
var selectPolarConfiguredScale = (0, _reselect.createSelector)([selectPolarAxis, _axisSelectors.selectRealScaleType, _polarSelectors.selectPolarAxisCheckedDomain, selectPolarAxisRangeWithReversed], _combineConfiguredScale.combineConfiguredScale);
|
||||
var selectPolarAxisScale = exports.selectPolarAxisScale = (0, _reselect.createSelector)([selectPolarConfiguredScale], _RechartsScale.rechartsScaleFactory);
|
||||
var selectPolarCategoricalDomain = exports.selectPolarCategoricalDomain = (0, _reselect.createSelector)([_chartLayoutContext.selectChartLayout, _polarSelectors.selectPolarAppliedValues, _axisSelectors.selectRenderableAxisSettings, _pickAxisType.pickAxisType], _axisSelectors.combineCategoricalDomain);
|
||||
var selectPolarAxisTicks = exports.selectPolarAxisTicks = (0, _reselect.createSelector)([_chartLayoutContext.selectChartLayout, selectPolarAxis, _axisSelectors.selectRealScaleType, selectPolarAxisScale, _polarSelectors.selectPolarNiceTicks, selectPolarAxisRangeWithReversed, _axisSelectors.selectDuplicateDomain, selectPolarCategoricalDomain, _pickAxisType.pickAxisType], _axisSelectors.combineAxisTicks);
|
||||
var selectPolarAngleAxisTicks = exports.selectPolarAngleAxisTicks = (0, _reselect.createSelector)([selectPolarAxisTicks], ticks => {
|
||||
/*
|
||||
* Angle axis is circular; so here we need to look for ticks that overlap (i.e., 0 and 360 degrees)
|
||||
* and remove the duplicate tick to avoid rendering issues.
|
||||
*/
|
||||
if (!ticks) {
|
||||
return undefined;
|
||||
}
|
||||
var uniqueTicksMap = new Map();
|
||||
ticks.forEach(tick => {
|
||||
var normalizedCoordinate = (tick.coordinate + 360) % 360;
|
||||
if (!uniqueTicksMap.has(normalizedCoordinate)) {
|
||||
uniqueTicksMap.set(normalizedCoordinate, tick);
|
||||
}
|
||||
});
|
||||
return Array.from(uniqueTicksMap.values());
|
||||
});
|
||||
var selectPolarGraphicalItemAxisTicks = exports.selectPolarGraphicalItemAxisTicks = (0, _reselect.createSelector)([_chartLayoutContext.selectChartLayout, selectPolarAxis, selectPolarAxisScale, selectPolarAxisRangeWithReversed, _axisSelectors.selectDuplicateDomain, selectPolarCategoricalDomain, _pickAxisType.pickAxisType], _axisSelectors.combineGraphicalItemTicks);
|
||||
53
frontend/node_modules/recharts/lib/state/selectors/polarSelectors.js
generated
vendored
Normal file
53
frontend/node_modules/recharts/lib/state/selectors/polarSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectUnfilteredPolarItems = exports.selectPolarNiceTicks = exports.selectPolarItemsSettings = exports.selectPolarDisplayedData = exports.selectPolarAxisDomainIncludingNiceTicks = exports.selectPolarAxisDomain = exports.selectPolarAxisCheckedDomain = exports.selectPolarAppliedValues = exports.selectAllPolarAppliedNumericalValues = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _dataSelectors = require("./dataSelectors");
|
||||
var _axisSelectors = require("./axisSelectors");
|
||||
var _chartLayoutContext = require("../../context/chartLayoutContext");
|
||||
var _ChartUtils = require("../../util/ChartUtils");
|
||||
var _pickAxisType = require("./pickAxisType");
|
||||
var _pickAxisId = require("./pickAxisId");
|
||||
var _rootPropsSelectors = require("./rootPropsSelectors");
|
||||
var _combineCheckedDomain = require("./combiners/combineCheckedDomain");
|
||||
var selectUnfilteredPolarItems = state => state.graphicalItems.polarItems;
|
||||
exports.selectUnfilteredPolarItems = selectUnfilteredPolarItems;
|
||||
var selectAxisPredicate = (0, _reselect.createSelector)([_pickAxisType.pickAxisType, _pickAxisId.pickAxisId], _axisSelectors.itemAxisPredicate);
|
||||
var selectPolarItemsSettings = exports.selectPolarItemsSettings = (0, _reselect.createSelector)([selectUnfilteredPolarItems, _axisSelectors.selectBaseAxis, selectAxisPredicate], _axisSelectors.combineGraphicalItemsSettings);
|
||||
var selectPolarGraphicalItemsData = (0, _reselect.createSelector)([selectPolarItemsSettings], _axisSelectors.combineGraphicalItemsData);
|
||||
var selectPolarDisplayedData = exports.selectPolarDisplayedData = (0, _reselect.createSelector)([selectPolarGraphicalItemsData, _dataSelectors.selectChartDataAndAlwaysIgnoreIndexes], _axisSelectors.combineDisplayedData);
|
||||
var selectPolarAppliedValues = exports.selectPolarAppliedValues = (0, _reselect.createSelector)([selectPolarDisplayedData, _axisSelectors.selectBaseAxis, selectPolarItemsSettings], _axisSelectors.combineAppliedValues);
|
||||
var selectAllPolarAppliedNumericalValues = exports.selectAllPolarAppliedNumericalValues = (0, _reselect.createSelector)([selectPolarDisplayedData, _axisSelectors.selectBaseAxis, selectPolarItemsSettings], (data, axisSettings, items) => {
|
||||
if (items.length > 0) {
|
||||
return data.flatMap(entry => {
|
||||
return items.flatMap(item => {
|
||||
var _axisSettings$dataKey;
|
||||
var valueByDataKey = (0, _ChartUtils.getValueByDataKey)(entry, (_axisSettings$dataKey = axisSettings.dataKey) !== null && _axisSettings$dataKey !== void 0 ? _axisSettings$dataKey : item.dataKey);
|
||||
return {
|
||||
value: valueByDataKey,
|
||||
errorDomain: [] // polar charts do not have error bars
|
||||
};
|
||||
});
|
||||
}).filter(Boolean);
|
||||
}
|
||||
if ((axisSettings === null || axisSettings === void 0 ? void 0 : axisSettings.dataKey) != null) {
|
||||
return data.map(item => ({
|
||||
value: (0, _ChartUtils.getValueByDataKey)(item, axisSettings.dataKey),
|
||||
errorDomain: []
|
||||
}));
|
||||
}
|
||||
return data.map(entry => ({
|
||||
value: entry,
|
||||
errorDomain: []
|
||||
}));
|
||||
});
|
||||
var unsupportedInPolarChart = () => undefined;
|
||||
var selectDomainOfAllPolarAppliedNumericalValues = (0, _reselect.createSelector)([selectPolarDisplayedData, _axisSelectors.selectBaseAxis, selectPolarItemsSettings, _axisSelectors.selectAllErrorBarSettings, _pickAxisType.pickAxisType, _dataSelectors.selectChartDataSliceIgnoringIndexes], _axisSelectors.combineDomainOfAllAppliedNumericalValuesIncludingErrorValues);
|
||||
var selectPolarNumericalDomain = (0, _reselect.createSelector)([_axisSelectors.selectBaseAxis, _axisSelectors.selectDomainDefinition, _axisSelectors.selectDomainFromUserPreference, unsupportedInPolarChart, selectDomainOfAllPolarAppliedNumericalValues, unsupportedInPolarChart, _chartLayoutContext.selectChartLayout, _pickAxisType.pickAxisType], _axisSelectors.combineNumericalDomain);
|
||||
var selectPolarAxisDomain = exports.selectPolarAxisDomain = (0, _reselect.createSelector)([_axisSelectors.selectBaseAxis, _chartLayoutContext.selectChartLayout, selectPolarDisplayedData, selectPolarAppliedValues, _rootPropsSelectors.selectStackOffsetType, _pickAxisType.pickAxisType, selectPolarNumericalDomain], _axisSelectors.combineAxisDomain);
|
||||
var selectPolarNiceTicks = exports.selectPolarNiceTicks = (0, _reselect.createSelector)([selectPolarAxisDomain, _axisSelectors.selectRenderableAxisSettings, _axisSelectors.selectRealScaleType], _axisSelectors.combineNiceTicks);
|
||||
var selectPolarAxisDomainIncludingNiceTicks = exports.selectPolarAxisDomainIncludingNiceTicks = (0, _reselect.createSelector)([_axisSelectors.selectBaseAxis, selectPolarAxisDomain, selectPolarNiceTicks, _pickAxisType.pickAxisType], _axisSelectors.combineAxisDomainWithNiceTicks);
|
||||
var selectPolarAxisCheckedDomain = exports.selectPolarAxisCheckedDomain = (0, _reselect.createSelector)([_axisSelectors.selectRealScaleType, selectPolarAxisDomainIncludingNiceTicks], _combineCheckedDomain.combineCheckedDomain);
|
||||
96
frontend/node_modules/recharts/lib/state/selectors/radarSelectors.js
generated
vendored
Normal file
96
frontend/node_modules/recharts/lib/state/selectors/radarSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectRadiusAxisForBandSize = exports.selectRadarPoints = exports.selectAngleAxisWithScaleAndViewport = exports.selectAngleAxisForBandSize = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _Radar = require("../../polar/Radar");
|
||||
var _polarScaleSelectors = require("./polarScaleSelectors");
|
||||
var _polarAxisSelectors = require("./polarAxisSelectors");
|
||||
var _dataSelectors = require("./dataSelectors");
|
||||
var _chartLayoutContext = require("../../context/chartLayoutContext");
|
||||
var _ChartUtils = require("../../util/ChartUtils");
|
||||
var _polarSelectors = require("./polarSelectors");
|
||||
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) { _defineProperty(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; }
|
||||
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
||||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
||||
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
||||
var selectRadiusAxisScale = (state, radiusAxisId) => (0, _polarScaleSelectors.selectPolarAxisScale)(state, 'radiusAxis', radiusAxisId);
|
||||
var selectRadiusAxisForRadar = (0, _reselect.createSelector)([selectRadiusAxisScale], scale => {
|
||||
if (scale == null) {
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
scale
|
||||
};
|
||||
});
|
||||
var selectRadiusAxisForBandSize = exports.selectRadiusAxisForBandSize = (0, _reselect.createSelector)([_polarAxisSelectors.selectRadiusAxis, selectRadiusAxisScale], (axisSettings, scale) => {
|
||||
if (axisSettings == null || scale == null) {
|
||||
return undefined;
|
||||
}
|
||||
return _objectSpread(_objectSpread({}, axisSettings), {}, {
|
||||
scale
|
||||
});
|
||||
});
|
||||
var selectRadiusAxisTicks = (state, radiusAxisId, _angleAxisId, isPanorama) => {
|
||||
return (0, _polarScaleSelectors.selectPolarAxisTicks)(state, 'radiusAxis', radiusAxisId, isPanorama);
|
||||
};
|
||||
var selectAngleAxisForRadar = (state, _radiusAxisId, angleAxisId) => (0, _polarAxisSelectors.selectAngleAxis)(state, angleAxisId);
|
||||
var selectPolarAxisScaleForRadar = (state, _radiusAxisId, angleAxisId) => (0, _polarScaleSelectors.selectPolarAxisScale)(state, 'angleAxis', angleAxisId);
|
||||
var selectAngleAxisForBandSize = exports.selectAngleAxisForBandSize = (0, _reselect.createSelector)([selectAngleAxisForRadar, selectPolarAxisScaleForRadar], (axisSettings, scale) => {
|
||||
if (axisSettings == null || scale == null) {
|
||||
return undefined;
|
||||
}
|
||||
return _objectSpread(_objectSpread({}, axisSettings), {}, {
|
||||
scale
|
||||
});
|
||||
});
|
||||
var selectAngleAxisTicks = (state, _radiusAxisId, angleAxisId, isPanorama) => {
|
||||
return (0, _polarScaleSelectors.selectPolarAxisTicks)(state, 'angleAxis', angleAxisId, isPanorama);
|
||||
};
|
||||
var selectAngleAxisWithScaleAndViewport = exports.selectAngleAxisWithScaleAndViewport = (0, _reselect.createSelector)([selectAngleAxisForRadar, selectPolarAxisScaleForRadar, _polarAxisSelectors.selectPolarViewBox], (axisOptions, scale, polarViewBox) => {
|
||||
if (polarViewBox == null || scale == null) {
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
scale,
|
||||
type: axisOptions.type,
|
||||
dataKey: axisOptions.dataKey,
|
||||
cx: polarViewBox.cx,
|
||||
cy: polarViewBox.cy
|
||||
};
|
||||
});
|
||||
var pickId = (_state, _radiusAxisId, _angleAxisId, _isPanorama, radarId) => radarId;
|
||||
var selectBandSizeOfAxis = (0, _reselect.createSelector)([_chartLayoutContext.selectChartLayout, selectRadiusAxisForBandSize, selectRadiusAxisTicks, selectAngleAxisForBandSize, selectAngleAxisTicks], (layout, radiusAxis, radiusAxisTicks, angleAxis, angleAxisTicks) => {
|
||||
if ((0, _ChartUtils.isCategoricalAxis)(layout, 'radiusAxis')) {
|
||||
return (0, _ChartUtils.getBandSizeOfAxis)(radiusAxis, radiusAxisTicks, false);
|
||||
}
|
||||
return (0, _ChartUtils.getBandSizeOfAxis)(angleAxis, angleAxisTicks, false);
|
||||
});
|
||||
var selectSynchronisedRadarDataKey = (0, _reselect.createSelector)([_polarSelectors.selectUnfilteredPolarItems, pickId], (graphicalItems, radarId) => {
|
||||
if (graphicalItems == null) {
|
||||
return undefined;
|
||||
}
|
||||
// Find the radar item with the given radarId
|
||||
var pgis = graphicalItems.find(item => item.type === 'radar' && radarId === item.id);
|
||||
// If found, return its dataKey
|
||||
return pgis === null || pgis === void 0 ? void 0 : pgis.dataKey;
|
||||
});
|
||||
var selectRadarPoints = exports.selectRadarPoints = (0, _reselect.createSelector)([selectRadiusAxisForRadar, selectAngleAxisWithScaleAndViewport, _dataSelectors.selectChartDataAndAlwaysIgnoreIndexes, selectSynchronisedRadarDataKey, selectBandSizeOfAxis], (radiusAxis, angleAxis, _ref, dataKey, bandSize) => {
|
||||
var chartData = _ref.chartData,
|
||||
dataStartIndex = _ref.dataStartIndex,
|
||||
dataEndIndex = _ref.dataEndIndex;
|
||||
if (radiusAxis == null || angleAxis == null || chartData == null || bandSize == null || dataKey == null) {
|
||||
return undefined;
|
||||
}
|
||||
var displayedData = chartData.slice(dataStartIndex, dataEndIndex + 1);
|
||||
return (0, _Radar.computeRadarPoints)({
|
||||
radiusAxis,
|
||||
angleAxis,
|
||||
displayedData,
|
||||
dataKey,
|
||||
bandSize
|
||||
});
|
||||
});
|
||||
183
frontend/node_modules/recharts/lib/state/selectors/radialBarSelectors.js
generated
vendored
Normal file
183
frontend/node_modules/recharts/lib/state/selectors/radialBarSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,183 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectRadiusAxisWithScale = exports.selectRadiusAxisTicks = exports.selectRadialBarSectors = exports.selectRadialBarLegendPayload = exports.selectPolarBarSizeList = exports.selectPolarBarPosition = exports.selectPolarBarBandSize = exports.selectBaseValue = exports.selectBandSizeOfPolarAxis = exports.selectAngleAxisWithScale = exports.selectAllPolarBarPositions = exports.pickMaxBarSize = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _RadialBar = require("../../polar/RadialBar");
|
||||
var _dataSelectors = require("./dataSelectors");
|
||||
var _polarScaleSelectors = require("./polarScaleSelectors");
|
||||
var _axisSelectors = require("./axisSelectors");
|
||||
var _polarAxisSelectors = require("./polarAxisSelectors");
|
||||
var _chartLayoutContext = require("../../context/chartLayoutContext");
|
||||
var _ChartUtils = require("../../util/ChartUtils");
|
||||
var _rootPropsSelectors = require("./rootPropsSelectors");
|
||||
var _polarSelectors = require("./polarSelectors");
|
||||
var _DataUtils = require("../../util/DataUtils");
|
||||
var _combineDisplayedStackedData = require("./combiners/combineDisplayedStackedData");
|
||||
var _StackedGraphicalItem = require("../types/StackedGraphicalItem");
|
||||
var _combineBarSizeList = require("./combiners/combineBarSizeList");
|
||||
var _combineAllBarPositions = require("./combiners/combineAllBarPositions");
|
||||
var _combineStackedData = require("./combiners/combineStackedData");
|
||||
var _combineBarPosition = require("./combiners/combineBarPosition");
|
||||
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) { _defineProperty(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; }
|
||||
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
||||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
||||
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
||||
var selectRadiusAxisForRadialBar = (state, radiusAxisId) => (0, _polarAxisSelectors.selectRadiusAxis)(state, radiusAxisId);
|
||||
var selectRadiusAxisScaleForRadar = (state, radiusAxisId) => (0, _polarScaleSelectors.selectPolarAxisScale)(state, 'radiusAxis', radiusAxisId);
|
||||
var selectRadiusAxisWithScale = exports.selectRadiusAxisWithScale = (0, _reselect.createSelector)([selectRadiusAxisForRadialBar, selectRadiusAxisScaleForRadar], (axis, scale) => {
|
||||
if (axis == null || scale == null) {
|
||||
return undefined;
|
||||
}
|
||||
return _objectSpread(_objectSpread({}, axis), {}, {
|
||||
scale
|
||||
});
|
||||
});
|
||||
var selectRadiusAxisTicks = (state, radiusAxisId) => {
|
||||
return (0, _polarScaleSelectors.selectPolarGraphicalItemAxisTicks)(state, 'radiusAxis', radiusAxisId, false);
|
||||
};
|
||||
exports.selectRadiusAxisTicks = selectRadiusAxisTicks;
|
||||
var selectAngleAxisForRadialBar = (state, _radiusAxisId, angleAxisId) => (0, _polarAxisSelectors.selectAngleAxis)(state, angleAxisId);
|
||||
var selectAngleAxisScaleForRadialBar = (state, _radiusAxisId, angleAxisId) => (0, _polarScaleSelectors.selectPolarAxisScale)(state, 'angleAxis', angleAxisId);
|
||||
var selectAngleAxisWithScale = exports.selectAngleAxisWithScale = (0, _reselect.createSelector)([selectAngleAxisForRadialBar, selectAngleAxisScaleForRadialBar], (axis, scale) => {
|
||||
if (axis == null || scale == null) {
|
||||
return undefined;
|
||||
}
|
||||
return _objectSpread(_objectSpread({}, axis), {}, {
|
||||
scale
|
||||
});
|
||||
});
|
||||
var selectAngleAxisTicks = (state, _radiusAxisId, angleAxisId) => {
|
||||
// here we can hardcode isPanorama to false because radialBar does not support panorama mode
|
||||
return (0, _polarScaleSelectors.selectPolarAxisTicks)(state, 'angleAxis', angleAxisId, false);
|
||||
};
|
||||
var pickRadialBarSettings = (_state, _radiusAxisId, _angleAxisId, radialBarSettings) => radialBarSettings;
|
||||
var selectSynchronisedRadialBarSettings = (0, _reselect.createSelector)([_polarSelectors.selectUnfilteredPolarItems, pickRadialBarSettings], (graphicalItems, radialBarSettingsFromProps) => {
|
||||
if (graphicalItems.some(pgis => pgis.type === 'radialBar' && radialBarSettingsFromProps.dataKey === pgis.dataKey && radialBarSettingsFromProps.stackId === pgis.stackId)) {
|
||||
return radialBarSettingsFromProps;
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
var selectBandSizeOfPolarAxis = exports.selectBandSizeOfPolarAxis = (0, _reselect.createSelector)([_chartLayoutContext.selectChartLayout, selectRadiusAxisWithScale, selectRadiusAxisTicks, selectAngleAxisWithScale, selectAngleAxisTicks], (layout, radiusAxis, radiusAxisTicks, angleAxis, angleAxisTicks) => {
|
||||
if ((0, _ChartUtils.isCategoricalAxis)(layout, 'radiusAxis')) {
|
||||
return (0, _ChartUtils.getBandSizeOfAxis)(radiusAxis, radiusAxisTicks, false);
|
||||
}
|
||||
return (0, _ChartUtils.getBandSizeOfAxis)(angleAxis, angleAxisTicks, false);
|
||||
});
|
||||
var selectBaseValue = exports.selectBaseValue = (0, _reselect.createSelector)([selectAngleAxisWithScale, selectRadiusAxisWithScale, _chartLayoutContext.selectChartLayout], (angleAxis, radiusAxis, layout) => {
|
||||
var numericAxis = layout === 'radial' ? angleAxis : radiusAxis;
|
||||
if (numericAxis == null || numericAxis.scale == null) {
|
||||
return undefined;
|
||||
}
|
||||
return (0, _ChartUtils.getBaseValueOfBar)({
|
||||
numericAxis
|
||||
});
|
||||
});
|
||||
var pickCells = (_state, _radiusAxisId, _angleAxisId, _radialBarSettings, cells) => cells;
|
||||
var pickAngleAxisId = (_state, _radiusAxisId, angleAxisId, _radialBarSettings, _cells) => angleAxisId;
|
||||
var pickRadiusAxisId = (_state, radiusAxisId, _angleAxisId, _radialBarSettings, _cells) => radiusAxisId;
|
||||
var pickMaxBarSize = (_state, _radiusAxisId, _angleAxisId, radialBarSettings, _cells) => radialBarSettings.maxBarSize;
|
||||
exports.pickMaxBarSize = pickMaxBarSize;
|
||||
var isRadialBar = item => item.type === 'radialBar';
|
||||
var selectAllVisibleRadialBars = (0, _reselect.createSelector)([_chartLayoutContext.selectChartLayout, _polarSelectors.selectUnfilteredPolarItems, pickAngleAxisId, pickRadiusAxisId], (layout, allItems, angleAxisId, radiusAxisId) => {
|
||||
return allItems.filter(i => {
|
||||
if (layout === 'centric') {
|
||||
return i.angleAxisId === angleAxisId;
|
||||
}
|
||||
return i.radiusAxisId === radiusAxisId;
|
||||
}).filter(i => i.hide === false).filter(isRadialBar);
|
||||
});
|
||||
|
||||
/**
|
||||
* The generator never returned the totalSize which means that barSize in polar chart can not support percent values.
|
||||
* We can add that if we want to I suppose.
|
||||
* @returns undefined - but it should be a total size of numerical axis in polar chart
|
||||
*/
|
||||
var selectPolarBarAxisSize = () => undefined;
|
||||
var selectPolarBarSizeList = exports.selectPolarBarSizeList = (0, _reselect.createSelector)([selectAllVisibleRadialBars, _rootPropsSelectors.selectRootBarSize, selectPolarBarAxisSize], _combineBarSizeList.combineBarSizeList);
|
||||
var selectPolarBarBandSize = exports.selectPolarBarBandSize = (0, _reselect.createSelector)([_chartLayoutContext.selectChartLayout, _rootPropsSelectors.selectRootMaxBarSize, selectAngleAxisWithScale, selectAngleAxisTicks, selectRadiusAxisWithScale, selectRadiusAxisTicks, pickMaxBarSize], (layout, globalMaxBarSize, angleAxis, angleAxisTicks, radiusAxis, radiusAxisTicks, childMaxBarSize) => {
|
||||
var _ref2, _getBandSizeOfAxis2;
|
||||
var maxBarSize = (0, _DataUtils.isNullish)(childMaxBarSize) ? globalMaxBarSize : childMaxBarSize;
|
||||
if (layout === 'centric') {
|
||||
var _ref, _getBandSizeOfAxis;
|
||||
return (_ref = (_getBandSizeOfAxis = (0, _ChartUtils.getBandSizeOfAxis)(angleAxis, angleAxisTicks, true)) !== null && _getBandSizeOfAxis !== void 0 ? _getBandSizeOfAxis : maxBarSize) !== null && _ref !== void 0 ? _ref : 0;
|
||||
}
|
||||
return (_ref2 = (_getBandSizeOfAxis2 = (0, _ChartUtils.getBandSizeOfAxis)(radiusAxis, radiusAxisTicks, true)) !== null && _getBandSizeOfAxis2 !== void 0 ? _getBandSizeOfAxis2 : maxBarSize) !== null && _ref2 !== void 0 ? _ref2 : 0;
|
||||
});
|
||||
var selectAllPolarBarPositions = exports.selectAllPolarBarPositions = (0, _reselect.createSelector)([selectPolarBarSizeList, _rootPropsSelectors.selectRootMaxBarSize, _rootPropsSelectors.selectBarGap, _rootPropsSelectors.selectBarCategoryGap, selectPolarBarBandSize, selectBandSizeOfPolarAxis, pickMaxBarSize], _combineAllBarPositions.combineAllBarPositions);
|
||||
var selectPolarBarPosition = exports.selectPolarBarPosition = (0, _reselect.createSelector)([selectAllPolarBarPositions, selectSynchronisedRadialBarSettings], _combineBarPosition.combineBarPosition);
|
||||
var selectStackedRadialBars = (0, _reselect.createSelector)([_polarSelectors.selectPolarItemsSettings], allPolarItems => allPolarItems.filter(isRadialBar).filter(_StackedGraphicalItem.isStacked));
|
||||
var selectPolarCombinedStackedData = (0, _reselect.createSelector)([selectStackedRadialBars, _dataSelectors.selectChartDataAndAlwaysIgnoreIndexes, _axisSelectors.selectTooltipAxis], _combineDisplayedStackedData.combineDisplayedStackedData);
|
||||
var selectStackGroups = (0, _reselect.createSelector)([selectPolarCombinedStackedData, selectStackedRadialBars, _rootPropsSelectors.selectStackOffsetType, _rootPropsSelectors.selectReverseStackOrder], _axisSelectors.combineStackGroups);
|
||||
var selectRadialBarStackGroups = (state, radiusAxisId, angleAxisId) => {
|
||||
var layout = (0, _chartLayoutContext.selectChartLayout)(state);
|
||||
if (layout === 'centric') {
|
||||
return selectStackGroups(state, 'radiusAxis', radiusAxisId);
|
||||
}
|
||||
return selectStackGroups(state, 'angleAxis', angleAxisId);
|
||||
};
|
||||
var selectPolarStackedData = (0, _reselect.createSelector)([selectRadialBarStackGroups, selectSynchronisedRadialBarSettings], _combineStackedData.combineStackedData);
|
||||
var selectRadialBarSectors = exports.selectRadialBarSectors = (0, _reselect.createSelector)([selectAngleAxisWithScale, selectAngleAxisTicks, selectRadiusAxisWithScale, selectRadiusAxisTicks, _dataSelectors.selectChartDataWithIndexes, selectSynchronisedRadialBarSettings, selectBandSizeOfPolarAxis, _chartLayoutContext.selectChartLayout, selectBaseValue, _polarAxisSelectors.selectPolarViewBox, pickCells, selectPolarBarPosition, selectPolarStackedData], (angleAxis, angleAxisTicks, radiusAxis, radiusAxisTicks, _ref3, radialBarSettings, bandSize, layout, baseValue, polarViewBox, cells, pos, stackedData) => {
|
||||
var chartData = _ref3.chartData,
|
||||
dataStartIndex = _ref3.dataStartIndex,
|
||||
dataEndIndex = _ref3.dataEndIndex;
|
||||
if (radialBarSettings == null || radiusAxis == null || angleAxis == null || chartData == null || bandSize == null || pos == null || layout !== 'centric' && layout !== 'radial' || radiusAxisTicks == null || polarViewBox == null) {
|
||||
return [];
|
||||
}
|
||||
var dataKey = radialBarSettings.dataKey,
|
||||
minPointSize = radialBarSettings.minPointSize;
|
||||
var cx = polarViewBox.cx,
|
||||
cy = polarViewBox.cy,
|
||||
startAngle = polarViewBox.startAngle,
|
||||
endAngle = polarViewBox.endAngle;
|
||||
var displayedData = chartData.slice(dataStartIndex, dataEndIndex + 1);
|
||||
var numericAxis = layout === 'centric' ? radiusAxis : angleAxis;
|
||||
var stackedDomain = stackedData ? numericAxis.scale.domain() : null;
|
||||
return (0, _RadialBar.computeRadialBarDataItems)({
|
||||
angleAxis,
|
||||
angleAxisTicks,
|
||||
bandSize,
|
||||
baseValue,
|
||||
cells,
|
||||
cx,
|
||||
cy,
|
||||
dataKey,
|
||||
dataStartIndex,
|
||||
displayedData,
|
||||
endAngle,
|
||||
layout,
|
||||
minPointSize,
|
||||
pos,
|
||||
radiusAxis,
|
||||
radiusAxisTicks,
|
||||
stackedData,
|
||||
stackedDomain,
|
||||
startAngle
|
||||
});
|
||||
});
|
||||
var selectRadialBarLegendPayload = exports.selectRadialBarLegendPayload = (0, _reselect.createSelector)([_dataSelectors.selectChartDataAndAlwaysIgnoreIndexes, (_s, l) => l], (_ref4, legendType) => {
|
||||
var chartData = _ref4.chartData,
|
||||
dataStartIndex = _ref4.dataStartIndex,
|
||||
dataEndIndex = _ref4.dataEndIndex;
|
||||
if (chartData == null) {
|
||||
return [];
|
||||
}
|
||||
var displayedData = chartData.slice(dataStartIndex, dataEndIndex + 1);
|
||||
if (displayedData.length === 0) {
|
||||
return [];
|
||||
}
|
||||
return displayedData.map(entry => {
|
||||
return {
|
||||
type: legendType,
|
||||
// @ts-expect-error we need a better typing for our data inputs
|
||||
value: entry.name,
|
||||
// @ts-expect-error we need a better typing for our data inputs
|
||||
color: entry.fill,
|
||||
// @ts-expect-error Legend payload.payload says it wants objects but our data can be unknown
|
||||
payload: entry
|
||||
};
|
||||
});
|
||||
});
|
||||
28
frontend/node_modules/recharts/lib/state/selectors/rootPropsSelectors.js
generated
vendored
Normal file
28
frontend/node_modules/recharts/lib/state/selectors/rootPropsSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectSyncMethod = exports.selectSyncId = exports.selectStackOffsetType = exports.selectRootMaxBarSize = exports.selectRootBarSize = exports.selectReverseStackOrder = exports.selectEventEmitter = exports.selectChartName = exports.selectChartBaseValue = exports.selectBarGap = exports.selectBarCategoryGap = void 0;
|
||||
var selectRootMaxBarSize = state => state.rootProps.maxBarSize;
|
||||
exports.selectRootMaxBarSize = selectRootMaxBarSize;
|
||||
var selectBarGap = state => state.rootProps.barGap;
|
||||
exports.selectBarGap = selectBarGap;
|
||||
var selectBarCategoryGap = state => state.rootProps.barCategoryGap;
|
||||
exports.selectBarCategoryGap = selectBarCategoryGap;
|
||||
var selectRootBarSize = state => state.rootProps.barSize;
|
||||
exports.selectRootBarSize = selectRootBarSize;
|
||||
var selectStackOffsetType = state => state.rootProps.stackOffset;
|
||||
exports.selectStackOffsetType = selectStackOffsetType;
|
||||
var selectReverseStackOrder = state => state.rootProps.reverseStackOrder;
|
||||
exports.selectReverseStackOrder = selectReverseStackOrder;
|
||||
var selectChartName = state => state.options.chartName;
|
||||
exports.selectChartName = selectChartName;
|
||||
var selectSyncId = state => state.rootProps.syncId;
|
||||
exports.selectSyncId = selectSyncId;
|
||||
var selectSyncMethod = state => state.rootProps.syncMethod;
|
||||
exports.selectSyncMethod = selectSyncMethod;
|
||||
var selectEventEmitter = state => state.options.eventEmitter;
|
||||
exports.selectEventEmitter = selectEventEmitter;
|
||||
var selectChartBaseValue = state => state.rootProps.baseValue;
|
||||
exports.selectChartBaseValue = selectChartBaseValue;
|
||||
48
frontend/node_modules/recharts/lib/state/selectors/scatterSelectors.js
generated
vendored
Normal file
48
frontend/node_modules/recharts/lib/state/selectors/scatterSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectScatterPoints = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _Scatter = require("../../cartesian/Scatter");
|
||||
var _dataSelectors = require("./dataSelectors");
|
||||
var _axisSelectors = require("./axisSelectors");
|
||||
var selectXAxisWithScale = (state, xAxisId, _yAxisId, _zAxisId, _id, _cells, isPanorama) => (0, _axisSelectors.selectAxisWithScale)(state, 'xAxis', xAxisId, isPanorama);
|
||||
var selectXAxisTicks = (state, xAxisId, _yAxisId, _zAxisId, _id, _cells, isPanorama) => (0, _axisSelectors.selectTicksOfGraphicalItem)(state, 'xAxis', xAxisId, isPanorama);
|
||||
var selectYAxisWithScale = (state, _xAxisId, yAxisId, _zAxisId, _id, _cells, isPanorama) => (0, _axisSelectors.selectAxisWithScale)(state, 'yAxis', yAxisId, isPanorama);
|
||||
var selectYAxisTicks = (state, _xAxisId, yAxisId, _zAxisId, _id, _cells, isPanorama) => (0, _axisSelectors.selectTicksOfGraphicalItem)(state, 'yAxis', yAxisId, isPanorama);
|
||||
var selectZAxis = (state, _xAxisId, _yAxisId, zAxisId) => (0, _axisSelectors.selectZAxisWithScale)(state, 'zAxis', zAxisId, false);
|
||||
var pickScatterId = (_state, _xAxisId, _yAxisId, _zAxisId, id) => id;
|
||||
var pickCells = (_state, _xAxisId, _yAxisId, _zAxisId, _id, cells) => cells;
|
||||
var scatterChartDataSelector = (state, _xAxisId, _yAxisId, _zAxisId, _id, _cells, isPanorama) => (0, _dataSelectors.selectChartDataWithIndexesIfNotInPanoramaPosition4)(state, undefined, undefined, isPanorama);
|
||||
var selectSynchronisedScatterSettings = (0, _reselect.createSelector)([_axisSelectors.selectUnfilteredCartesianItems, pickScatterId], (graphicalItems, id) => {
|
||||
return graphicalItems.filter(item => item.type === 'scatter').find(item => item.id === id);
|
||||
});
|
||||
var selectScatterPoints = exports.selectScatterPoints = (0, _reselect.createSelector)([scatterChartDataSelector, selectXAxisWithScale, selectXAxisTicks, selectYAxisWithScale, selectYAxisTicks, selectZAxis, selectSynchronisedScatterSettings, pickCells], (_ref, xAxis, xAxisTicks, yAxis, yAxisTicks, zAxis, scatterSettings, cells) => {
|
||||
var chartData = _ref.chartData,
|
||||
dataStartIndex = _ref.dataStartIndex,
|
||||
dataEndIndex = _ref.dataEndIndex;
|
||||
if (scatterSettings == null) {
|
||||
return undefined;
|
||||
}
|
||||
var displayedData;
|
||||
if ((scatterSettings === null || scatterSettings === void 0 ? void 0 : scatterSettings.data) != null && scatterSettings.data.length > 0) {
|
||||
displayedData = scatterSettings.data;
|
||||
} else {
|
||||
displayedData = chartData === null || chartData === void 0 ? void 0 : chartData.slice(dataStartIndex, dataEndIndex + 1);
|
||||
}
|
||||
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) {
|
||||
return undefined;
|
||||
}
|
||||
return (0, _Scatter.computeScatterPoints)({
|
||||
displayedData,
|
||||
xAxis,
|
||||
yAxis,
|
||||
zAxis,
|
||||
scatterSettings,
|
||||
xAxisTicks,
|
||||
yAxisTicks,
|
||||
cells
|
||||
});
|
||||
});
|
||||
15
frontend/node_modules/recharts/lib/state/selectors/selectActivePropsFromChartPointer.js
generated
vendored
Normal file
15
frontend/node_modules/recharts/lib/state/selectors/selectActivePropsFromChartPointer.js
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectActivePropsFromChartPointer = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _chartLayoutContext = require("../../context/chartLayoutContext");
|
||||
var _tooltipSelectors = require("./tooltipSelectors");
|
||||
var _selectChartOffsetInternal = require("./selectChartOffsetInternal");
|
||||
var _selectors = require("./selectors");
|
||||
var _polarAxisSelectors = require("./polarAxisSelectors");
|
||||
var _selectTooltipAxisType = require("./selectTooltipAxisType");
|
||||
var pickChartPointer = (_state, chartPointer) => chartPointer;
|
||||
var selectActivePropsFromChartPointer = exports.selectActivePropsFromChartPointer = (0, _reselect.createSelector)([pickChartPointer, _chartLayoutContext.selectChartLayout, _polarAxisSelectors.selectPolarViewBox, _selectTooltipAxisType.selectTooltipAxisType, _tooltipSelectors.selectTooltipAxisRangeWithReverse, _tooltipSelectors.selectTooltipAxisTicks, _selectors.selectOrderedTooltipTicks, _selectChartOffsetInternal.selectChartOffsetInternal], _selectors.combineActiveProps);
|
||||
13
frontend/node_modules/recharts/lib/state/selectors/selectAllAxes.js
generated
vendored
Normal file
13
frontend/node_modules/recharts/lib/state/selectors/selectAllAxes.js
generated
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectAllYAxes = exports.selectAllXAxes = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var selectAllXAxes = exports.selectAllXAxes = (0, _reselect.createSelector)(state => state.cartesianAxis.xAxis, xAxisMap => {
|
||||
return Object.values(xAxisMap);
|
||||
});
|
||||
var selectAllYAxes = exports.selectAllYAxes = (0, _reselect.createSelector)(state => state.cartesianAxis.yAxis, yAxisMap => {
|
||||
return Object.values(yAxisMap);
|
||||
});
|
||||
16
frontend/node_modules/recharts/lib/state/selectors/selectChartOffset.js
generated
vendored
Normal file
16
frontend/node_modules/recharts/lib/state/selectors/selectChartOffset.js
generated
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectChartOffset = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _selectChartOffsetInternal = require("./selectChartOffsetInternal");
|
||||
var selectChartOffset = exports.selectChartOffset = (0, _reselect.createSelector)([_selectChartOffsetInternal.selectChartOffsetInternal], offsetInternal => {
|
||||
return {
|
||||
top: offsetInternal.top,
|
||||
bottom: offsetInternal.bottom,
|
||||
left: offsetInternal.left,
|
||||
right: offsetInternal.right
|
||||
};
|
||||
});
|
||||
99
frontend/node_modules/recharts/lib/state/selectors/selectChartOffsetInternal.js
generated
vendored
Normal file
99
frontend/node_modules/recharts/lib/state/selectors/selectChartOffsetInternal.js
generated
vendored
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectChartViewBox = exports.selectChartOffsetInternal = exports.selectBrushHeight = exports.selectAxisViewBox = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _legendSelectors = require("./legendSelectors");
|
||||
var _ChartUtils = require("../../util/ChartUtils");
|
||||
var _containerSelectors = require("./containerSelectors");
|
||||
var _selectAllAxes = require("./selectAllAxes");
|
||||
var _Constants = require("../../util/Constants");
|
||||
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) { _defineProperty(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; }
|
||||
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
||||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
||||
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
||||
var selectBrushHeight = state => state.brush.height;
|
||||
exports.selectBrushHeight = selectBrushHeight;
|
||||
function selectLeftAxesOffset(state) {
|
||||
var yAxes = (0, _selectAllAxes.selectAllYAxes)(state);
|
||||
return yAxes.reduce((result, entry) => {
|
||||
if (entry.orientation === 'left' && !entry.mirror && !entry.hide) {
|
||||
var width = typeof entry.width === 'number' ? entry.width : _Constants.DEFAULT_Y_AXIS_WIDTH;
|
||||
return result + width;
|
||||
}
|
||||
return result;
|
||||
}, 0);
|
||||
}
|
||||
function selectRightAxesOffset(state) {
|
||||
var yAxes = (0, _selectAllAxes.selectAllYAxes)(state);
|
||||
return yAxes.reduce((result, entry) => {
|
||||
if (entry.orientation === 'right' && !entry.mirror && !entry.hide) {
|
||||
var width = typeof entry.width === 'number' ? entry.width : _Constants.DEFAULT_Y_AXIS_WIDTH;
|
||||
return result + width;
|
||||
}
|
||||
return result;
|
||||
}, 0);
|
||||
}
|
||||
function selectTopAxesOffset(state) {
|
||||
var xAxes = (0, _selectAllAxes.selectAllXAxes)(state);
|
||||
return xAxes.reduce((result, entry) => {
|
||||
if (entry.orientation === 'top' && !entry.mirror && !entry.hide) {
|
||||
return result + entry.height;
|
||||
}
|
||||
return result;
|
||||
}, 0);
|
||||
}
|
||||
function selectBottomAxesOffset(state) {
|
||||
var xAxes = (0, _selectAllAxes.selectAllXAxes)(state);
|
||||
return xAxes.reduce((result, entry) => {
|
||||
if (entry.orientation === 'bottom' && !entry.mirror && !entry.hide) {
|
||||
return result + entry.height;
|
||||
}
|
||||
return result;
|
||||
}, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* For internal use only.
|
||||
*
|
||||
* @param root state
|
||||
* @return ChartOffsetInternal
|
||||
*/
|
||||
var selectChartOffsetInternal = exports.selectChartOffsetInternal = (0, _reselect.createSelector)([_containerSelectors.selectChartWidth, _containerSelectors.selectChartHeight, _containerSelectors.selectMargin, selectBrushHeight, selectLeftAxesOffset, selectRightAxesOffset, selectTopAxesOffset, selectBottomAxesOffset, _legendSelectors.selectLegendSettings, _legendSelectors.selectLegendSize], (chartWidth, chartHeight, margin, brushHeight, leftAxesOffset, rightAxesOffset, topAxesOffset, bottomAxesOffset, legendSettings, legendSize) => {
|
||||
var offsetH = {
|
||||
left: (margin.left || 0) + leftAxesOffset,
|
||||
right: (margin.right || 0) + rightAxesOffset
|
||||
};
|
||||
var offsetV = {
|
||||
top: (margin.top || 0) + topAxesOffset,
|
||||
bottom: (margin.bottom || 0) + bottomAxesOffset
|
||||
};
|
||||
var offset = _objectSpread(_objectSpread({}, offsetV), offsetH);
|
||||
var brushBottom = offset.bottom;
|
||||
offset.bottom += brushHeight;
|
||||
offset = (0, _ChartUtils.appendOffsetOfLegend)(offset, legendSettings, legendSize);
|
||||
var offsetWidth = chartWidth - offset.left - offset.right;
|
||||
var offsetHeight = chartHeight - offset.top - offset.bottom;
|
||||
return _objectSpread(_objectSpread({
|
||||
brushBottom
|
||||
}, offset), {}, {
|
||||
// never return negative values for height and width
|
||||
width: Math.max(offsetWidth, 0),
|
||||
height: Math.max(offsetHeight, 0)
|
||||
});
|
||||
});
|
||||
var selectChartViewBox = exports.selectChartViewBox = (0, _reselect.createSelector)(selectChartOffsetInternal, offset => ({
|
||||
x: offset.left,
|
||||
y: offset.top,
|
||||
width: offset.width,
|
||||
height: offset.height
|
||||
}));
|
||||
var selectAxisViewBox = exports.selectAxisViewBox = (0, _reselect.createSelector)(_containerSelectors.selectChartWidth, _containerSelectors.selectChartHeight, (width, height) => ({
|
||||
x: 0,
|
||||
y: 0,
|
||||
width,
|
||||
height
|
||||
}));
|
||||
20
frontend/node_modules/recharts/lib/state/selectors/selectPlotArea.js
generated
vendored
Normal file
20
frontend/node_modules/recharts/lib/state/selectors/selectPlotArea.js
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectPlotArea = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _selectChartOffset = require("./selectChartOffset");
|
||||
var _containerSelectors = require("./containerSelectors");
|
||||
var selectPlotArea = exports.selectPlotArea = (0, _reselect.createSelector)([_selectChartOffset.selectChartOffset, _containerSelectors.selectChartWidth, _containerSelectors.selectChartHeight], (offset, chartWidth, chartHeight) => {
|
||||
if (!offset || chartWidth == null || chartHeight == null) {
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
x: offset.left,
|
||||
y: offset.top,
|
||||
width: Math.max(0, chartWidth - offset.left - offset.right),
|
||||
height: Math.max(0, chartHeight - offset.top - offset.bottom)
|
||||
};
|
||||
});
|
||||
8
frontend/node_modules/recharts/lib/state/selectors/selectTooltipAxisId.js
generated
vendored
Normal file
8
frontend/node_modules/recharts/lib/state/selectors/selectTooltipAxisId.js
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectTooltipAxisId = void 0;
|
||||
var selectTooltipAxisId = state => state.tooltip.settings.axisId;
|
||||
exports.selectTooltipAxisId = selectTooltipAxisId;
|
||||
29
frontend/node_modules/recharts/lib/state/selectors/selectTooltipAxisType.js
generated
vendored
Normal file
29
frontend/node_modules/recharts/lib/state/selectors/selectTooltipAxisType.js
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectTooltipAxisType = void 0;
|
||||
var _chartLayoutContext = require("../../context/chartLayoutContext");
|
||||
/**
|
||||
* angle, radius, X, Y, and Z axes all have domain and range and scale and associated settings
|
||||
*/
|
||||
|
||||
/**
|
||||
* Z axis is never displayed and so it lacks ticks and tick settings.
|
||||
*/
|
||||
|
||||
var selectTooltipAxisType = state => {
|
||||
var layout = (0, _chartLayoutContext.selectChartLayout)(state);
|
||||
if (layout === 'horizontal') {
|
||||
return 'xAxis';
|
||||
}
|
||||
if (layout === 'vertical') {
|
||||
return 'yAxis';
|
||||
}
|
||||
if (layout === 'centric') {
|
||||
return 'angleAxis';
|
||||
}
|
||||
return 'radiusAxis';
|
||||
};
|
||||
exports.selectTooltipAxisType = selectTooltipAxisType;
|
||||
33
frontend/node_modules/recharts/lib/state/selectors/selectTooltipEventType.js
generated
vendored
Normal file
33
frontend/node_modules/recharts/lib/state/selectors/selectTooltipEventType.js
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.combineTooltipEventType = combineTooltipEventType;
|
||||
exports.selectDefaultTooltipEventType = void 0;
|
||||
exports.selectTooltipEventType = selectTooltipEventType;
|
||||
exports.selectValidateTooltipEventTypes = void 0;
|
||||
exports.useTooltipEventType = useTooltipEventType;
|
||||
var _hooks = require("../hooks");
|
||||
var selectDefaultTooltipEventType = state => state.options.defaultTooltipEventType;
|
||||
exports.selectDefaultTooltipEventType = selectDefaultTooltipEventType;
|
||||
var selectValidateTooltipEventTypes = state => state.options.validateTooltipEventTypes;
|
||||
exports.selectValidateTooltipEventTypes = selectValidateTooltipEventTypes;
|
||||
function combineTooltipEventType(shared, defaultTooltipEventType, validateTooltipEventTypes) {
|
||||
if (shared == null) {
|
||||
return defaultTooltipEventType;
|
||||
}
|
||||
var eventType = shared ? 'axis' : 'item';
|
||||
if (validateTooltipEventTypes == null) {
|
||||
return defaultTooltipEventType;
|
||||
}
|
||||
return validateTooltipEventTypes.includes(eventType) ? eventType : defaultTooltipEventType;
|
||||
}
|
||||
function selectTooltipEventType(state, shared) {
|
||||
var defaultTooltipEventType = selectDefaultTooltipEventType(state);
|
||||
var validateTooltipEventTypes = selectValidateTooltipEventTypes(state);
|
||||
return combineTooltipEventType(shared, defaultTooltipEventType, validateTooltipEventTypes);
|
||||
}
|
||||
function useTooltipEventType(shared) {
|
||||
return (0, _hooks.useAppSelector)(state => selectTooltipEventType(state, shared));
|
||||
}
|
||||
8
frontend/node_modules/recharts/lib/state/selectors/selectTooltipPayloadSearcher.js
generated
vendored
Normal file
8
frontend/node_modules/recharts/lib/state/selectors/selectTooltipPayloadSearcher.js
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectTooltipPayloadSearcher = void 0;
|
||||
var selectTooltipPayloadSearcher = state => state.options.tooltipPayloadSearcher;
|
||||
exports.selectTooltipPayloadSearcher = selectTooltipPayloadSearcher;
|
||||
8
frontend/node_modules/recharts/lib/state/selectors/selectTooltipSettings.js
generated
vendored
Normal file
8
frontend/node_modules/recharts/lib/state/selectors/selectTooltipSettings.js
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectTooltipSettings = void 0;
|
||||
var selectTooltipSettings = state => state.tooltip.settings;
|
||||
exports.selectTooltipSettings = selectTooltipSettings;
|
||||
8
frontend/node_modules/recharts/lib/state/selectors/selectTooltipState.js
generated
vendored
Normal file
8
frontend/node_modules/recharts/lib/state/selectors/selectTooltipState.js
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectTooltipState = void 0;
|
||||
var selectTooltipState = state => state.tooltip;
|
||||
exports.selectTooltipState = selectTooltipState;
|
||||
110
frontend/node_modules/recharts/lib/state/selectors/selectors.js
generated
vendored
Normal file
110
frontend/node_modules/recharts/lib/state/selectors/selectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.useChartName = exports.selectTooltipPayloadConfigurations = exports.selectTooltipPayload = exports.selectTooltipInteractionState = exports.selectTooltipDataKey = exports.selectOrderedTooltipTicks = exports.selectIsTooltipActive = exports.selectCoordinateForDefaultIndex = exports.selectActiveLabel = exports.selectActiveIndex = exports.selectActiveCoordinate = exports.combineActiveProps = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _sortBy = _interopRequireDefault(require("es-toolkit/compat/sortBy"));
|
||||
var _hooks = require("../hooks");
|
||||
var _ChartUtils = require("../../util/ChartUtils");
|
||||
var _dataSelectors = require("./dataSelectors");
|
||||
var _tooltipSelectors = require("./tooltipSelectors");
|
||||
var _axisSelectors = require("./axisSelectors");
|
||||
var _rootPropsSelectors = require("./rootPropsSelectors");
|
||||
var _chartLayoutContext = require("../../context/chartLayoutContext");
|
||||
var _selectChartOffsetInternal = require("./selectChartOffsetInternal");
|
||||
var _containerSelectors = require("./containerSelectors");
|
||||
var _combineActiveLabel = require("./combiners/combineActiveLabel");
|
||||
var _combineTooltipInteractionState = require("./combiners/combineTooltipInteractionState");
|
||||
var _combineActiveTooltipIndex = require("./combiners/combineActiveTooltipIndex");
|
||||
var _combineCoordinateForDefaultIndex = require("./combiners/combineCoordinateForDefaultIndex");
|
||||
var _combineTooltipPayloadConfigurations = require("./combiners/combineTooltipPayloadConfigurations");
|
||||
var _selectTooltipPayloadSearcher = require("./selectTooltipPayloadSearcher");
|
||||
var _selectTooltipState = require("./selectTooltipState");
|
||||
var _combineTooltipPayload = require("./combiners/combineTooltipPayload");
|
||||
var _getActiveCoordinate = require("../../util/getActiveCoordinate");
|
||||
var _PolarUtils = require("../../util/PolarUtils");
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
||||
var useChartName = () => {
|
||||
return (0, _hooks.useAppSelector)(_rootPropsSelectors.selectChartName);
|
||||
};
|
||||
exports.useChartName = useChartName;
|
||||
var pickTooltipEventType = (_state, tooltipEventType) => tooltipEventType;
|
||||
var pickTrigger = (_state, _tooltipEventType, trigger) => trigger;
|
||||
var pickDefaultIndex = (_state, _tooltipEventType, _trigger, defaultIndex) => defaultIndex;
|
||||
var selectOrderedTooltipTicks = exports.selectOrderedTooltipTicks = (0, _reselect.createSelector)(_tooltipSelectors.selectTooltipAxisTicks, ticks => (0, _sortBy.default)(ticks, o => o.coordinate));
|
||||
var selectTooltipInteractionState = exports.selectTooltipInteractionState = (0, _reselect.createSelector)([_selectTooltipState.selectTooltipState, pickTooltipEventType, pickTrigger, pickDefaultIndex], _combineTooltipInteractionState.combineTooltipInteractionState);
|
||||
var selectActiveIndex = exports.selectActiveIndex = (0, _reselect.createSelector)([selectTooltipInteractionState, _tooltipSelectors.selectTooltipDisplayedData, _axisSelectors.selectTooltipAxisDataKey, _tooltipSelectors.selectTooltipAxisDomain], _combineActiveTooltipIndex.combineActiveTooltipIndex);
|
||||
var selectTooltipDataKey = (state, tooltipEventType, trigger) => {
|
||||
if (tooltipEventType == null) {
|
||||
return undefined;
|
||||
}
|
||||
var tooltipState = (0, _selectTooltipState.selectTooltipState)(state);
|
||||
if (tooltipEventType === 'axis') {
|
||||
if (trigger === 'hover') {
|
||||
return tooltipState.axisInteraction.hover.dataKey;
|
||||
}
|
||||
return tooltipState.axisInteraction.click.dataKey;
|
||||
}
|
||||
if (trigger === 'hover') {
|
||||
return tooltipState.itemInteraction.hover.dataKey;
|
||||
}
|
||||
return tooltipState.itemInteraction.click.dataKey;
|
||||
};
|
||||
exports.selectTooltipDataKey = selectTooltipDataKey;
|
||||
var selectTooltipPayloadConfigurations = exports.selectTooltipPayloadConfigurations = (0, _reselect.createSelector)([_selectTooltipState.selectTooltipState, pickTooltipEventType, pickTrigger, pickDefaultIndex], _combineTooltipPayloadConfigurations.combineTooltipPayloadConfigurations);
|
||||
var selectCoordinateForDefaultIndex = exports.selectCoordinateForDefaultIndex = (0, _reselect.createSelector)([_containerSelectors.selectChartWidth, _containerSelectors.selectChartHeight, _chartLayoutContext.selectChartLayout, _selectChartOffsetInternal.selectChartOffsetInternal, _tooltipSelectors.selectTooltipAxisTicks, pickDefaultIndex, selectTooltipPayloadConfigurations], _combineCoordinateForDefaultIndex.combineCoordinateForDefaultIndex);
|
||||
var selectActiveCoordinate = exports.selectActiveCoordinate = (0, _reselect.createSelector)([selectTooltipInteractionState, selectCoordinateForDefaultIndex], (tooltipInteractionState, defaultIndexCoordinate) => {
|
||||
var _tooltipInteractionSt;
|
||||
return (_tooltipInteractionSt = tooltipInteractionState.coordinate) !== null && _tooltipInteractionSt !== void 0 ? _tooltipInteractionSt : defaultIndexCoordinate;
|
||||
});
|
||||
var selectActiveLabel = exports.selectActiveLabel = (0, _reselect.createSelector)([_tooltipSelectors.selectTooltipAxisTicks, selectActiveIndex], _combineActiveLabel.combineActiveLabel);
|
||||
var selectTooltipPayload = exports.selectTooltipPayload = (0, _reselect.createSelector)([selectTooltipPayloadConfigurations, selectActiveIndex, _dataSelectors.selectChartDataWithIndexes, _axisSelectors.selectTooltipAxisDataKey, selectActiveLabel, _selectTooltipPayloadSearcher.selectTooltipPayloadSearcher, pickTooltipEventType], _combineTooltipPayload.combineTooltipPayload);
|
||||
var selectIsTooltipActive = exports.selectIsTooltipActive = (0, _reselect.createSelector)([selectTooltipInteractionState, selectActiveIndex], (tooltipInteractionState, activeIndex) => {
|
||||
return {
|
||||
isActive: tooltipInteractionState.active && activeIndex != null,
|
||||
activeIndex
|
||||
};
|
||||
});
|
||||
var combineActiveCartesianProps = (chartEvent, layout, tooltipAxisType, tooltipAxisRange, tooltipTicks, orderedTooltipTicks, offset) => {
|
||||
if (!chartEvent || !tooltipAxisType || !tooltipAxisRange || !tooltipTicks) {
|
||||
return undefined;
|
||||
}
|
||||
if (!(0, _getActiveCoordinate.isInCartesianRange)(chartEvent, offset)) {
|
||||
return undefined;
|
||||
}
|
||||
var pos = (0, _ChartUtils.calculateCartesianTooltipPos)(chartEvent, layout);
|
||||
var activeIndex = (0, _getActiveCoordinate.calculateActiveTickIndex)(pos, orderedTooltipTicks, tooltipTicks, tooltipAxisType, tooltipAxisRange);
|
||||
var activeCoordinate = (0, _getActiveCoordinate.getActiveCartesianCoordinate)(layout, tooltipTicks, activeIndex, chartEvent);
|
||||
return {
|
||||
activeIndex: String(activeIndex),
|
||||
activeCoordinate
|
||||
};
|
||||
};
|
||||
var combineActivePolarProps = (chartEvent, layout, polarViewBox, tooltipAxisType, tooltipAxisRange, tooltipTicks, orderedTooltipTicks) => {
|
||||
if (!chartEvent || !tooltipAxisType || !tooltipAxisRange || !tooltipTicks || !polarViewBox) {
|
||||
return undefined;
|
||||
}
|
||||
var rangeObj = (0, _PolarUtils.inRangeOfSector)(chartEvent, polarViewBox);
|
||||
if (!rangeObj) {
|
||||
return undefined;
|
||||
}
|
||||
var pos = (0, _ChartUtils.calculatePolarTooltipPos)(rangeObj, layout);
|
||||
var activeIndex = (0, _getActiveCoordinate.calculateActiveTickIndex)(pos, orderedTooltipTicks, tooltipTicks, tooltipAxisType, tooltipAxisRange);
|
||||
var activeCoordinate = (0, _getActiveCoordinate.getActivePolarCoordinate)(layout, tooltipTicks, activeIndex, rangeObj);
|
||||
return {
|
||||
activeIndex: String(activeIndex),
|
||||
activeCoordinate
|
||||
};
|
||||
};
|
||||
var combineActiveProps = (chartEvent, layout, polarViewBox, tooltipAxisType, tooltipAxisRange, tooltipTicks, orderedTooltipTicks, offset) => {
|
||||
if (!chartEvent || !layout || !tooltipAxisType || !tooltipAxisRange || !tooltipTicks) {
|
||||
return undefined;
|
||||
}
|
||||
if (layout === 'horizontal' || layout === 'vertical') {
|
||||
return combineActiveCartesianProps(chartEvent, layout, tooltipAxisType, tooltipAxisRange, tooltipTicks, orderedTooltipTicks, offset);
|
||||
}
|
||||
return combineActivePolarProps(chartEvent, layout, polarViewBox, tooltipAxisType, tooltipAxisRange, tooltipTicks, orderedTooltipTicks);
|
||||
};
|
||||
exports.combineActiveProps = combineActiveProps;
|
||||
188
frontend/node_modules/recharts/lib/state/selectors/tooltipSelectors.js
generated
vendored
Normal file
188
frontend/node_modules/recharts/lib/state/selectors/tooltipSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectTooltipGraphicalItemsData = exports.selectTooltipDisplayedData = exports.selectTooltipCategoricalDomain = exports.selectTooltipAxisTicks = exports.selectTooltipAxisScale = exports.selectTooltipAxisRealScaleType = exports.selectTooltipAxisRangeWithReverse = exports.selectTooltipAxisDomainIncludingNiceTicks = exports.selectTooltipAxisDomain = exports.selectIsTooltipActive = exports.selectAllUnfilteredGraphicalItems = exports.selectAllGraphicalItemsSettings = exports.selectActiveTooltipPayload = exports.selectActiveTooltipIndex = exports.selectActiveTooltipGraphicalItemId = exports.selectActiveTooltipDataPoints = exports.selectActiveTooltipDataKey = exports.selectActiveTooltipCoordinate = exports.selectActiveLabel = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _axisSelectors = require("./axisSelectors");
|
||||
var _chartLayoutContext = require("../../context/chartLayoutContext");
|
||||
var _ChartUtils = require("../../util/ChartUtils");
|
||||
var _dataSelectors = require("./dataSelectors");
|
||||
var _rootPropsSelectors = require("./rootPropsSelectors");
|
||||
var _DataUtils = require("../../util/DataUtils");
|
||||
var _combineAxisRangeWithReverse = require("./combiners/combineAxisRangeWithReverse");
|
||||
var _selectTooltipEventType = require("./selectTooltipEventType");
|
||||
var _combineActiveLabel = require("./combiners/combineActiveLabel");
|
||||
var _selectTooltipSettings = require("./selectTooltipSettings");
|
||||
var _combineTooltipInteractionState = require("./combiners/combineTooltipInteractionState");
|
||||
var _combineActiveTooltipIndex = require("./combiners/combineActiveTooltipIndex");
|
||||
var _combineCoordinateForDefaultIndex = require("./combiners/combineCoordinateForDefaultIndex");
|
||||
var _containerSelectors = require("./containerSelectors");
|
||||
var _selectChartOffsetInternal = require("./selectChartOffsetInternal");
|
||||
var _combineTooltipPayloadConfigurations = require("./combiners/combineTooltipPayloadConfigurations");
|
||||
var _selectTooltipPayloadSearcher = require("./selectTooltipPayloadSearcher");
|
||||
var _selectTooltipState = require("./selectTooltipState");
|
||||
var _combineTooltipPayload = require("./combiners/combineTooltipPayload");
|
||||
var _selectTooltipAxisId = require("./selectTooltipAxisId");
|
||||
var _selectTooltipAxisType = require("./selectTooltipAxisType");
|
||||
var _combineDisplayedStackedData = require("./combiners/combineDisplayedStackedData");
|
||||
var _StackedGraphicalItem = require("../types/StackedGraphicalItem");
|
||||
var _isDomainSpecifiedByUser = require("../../util/isDomainSpecifiedByUser");
|
||||
var _numberDomainEqualityCheck = require("./numberDomainEqualityCheck");
|
||||
var _arrayEqualityCheck = require("./arrayEqualityCheck");
|
||||
var _RechartsScale = require("../../util/scale/RechartsScale");
|
||||
var _isWellBehavedNumber = require("../../util/isWellBehavedNumber");
|
||||
var _combineRealScaleType = require("./combiners/combineRealScaleType");
|
||||
var _combineConfiguredScale = require("./combiners/combineConfiguredScale");
|
||||
var selectTooltipAxisRealScaleType = exports.selectTooltipAxisRealScaleType = (0, _reselect.createSelector)([_axisSelectors.selectTooltipAxis, _axisSelectors.selectHasBar, _rootPropsSelectors.selectChartName], _combineRealScaleType.combineRealScaleType);
|
||||
var selectAllUnfilteredGraphicalItems = exports.selectAllUnfilteredGraphicalItems = (0, _reselect.createSelector)([state => state.graphicalItems.cartesianItems, state => state.graphicalItems.polarItems], (cartesianItems, polarItems) => [...cartesianItems, ...polarItems]);
|
||||
var selectTooltipAxisPredicate = (0, _reselect.createSelector)([_selectTooltipAxisType.selectTooltipAxisType, _selectTooltipAxisId.selectTooltipAxisId], _axisSelectors.itemAxisPredicate);
|
||||
var selectAllGraphicalItemsSettings = exports.selectAllGraphicalItemsSettings = (0, _reselect.createSelector)([selectAllUnfilteredGraphicalItems, _axisSelectors.selectTooltipAxis, selectTooltipAxisPredicate], _axisSelectors.combineGraphicalItemsSettings, {
|
||||
memoizeOptions: {
|
||||
resultEqualityCheck: _arrayEqualityCheck.emptyArraysAreEqualCheck
|
||||
}
|
||||
});
|
||||
var selectAllStackedGraphicalItemsSettings = (0, _reselect.createSelector)([selectAllGraphicalItemsSettings], graphicalItems => graphicalItems.filter(_StackedGraphicalItem.isStacked));
|
||||
var selectTooltipGraphicalItemsData = exports.selectTooltipGraphicalItemsData = (0, _reselect.createSelector)([selectAllGraphicalItemsSettings], _axisSelectors.combineGraphicalItemsData, {
|
||||
memoizeOptions: {
|
||||
resultEqualityCheck: _arrayEqualityCheck.emptyArraysAreEqualCheck
|
||||
}
|
||||
});
|
||||
var selectAnyTooltipItemUsesChartData = (0, _reselect.createSelector)([selectAllGraphicalItemsSettings], items => items.some(item => !item.data));
|
||||
|
||||
/**
|
||||
* Data for tooltip always use the data with indexes set by a Brush,
|
||||
* and never accept the isPanorama flag:
|
||||
* because Tooltip never displays inside the panorama anyway
|
||||
* so we don't need to worry what would happen there.
|
||||
*/
|
||||
var selectTooltipDisplayedData = exports.selectTooltipDisplayedData = (0, _reselect.createSelector)([selectTooltipGraphicalItemsData, _dataSelectors.selectChartDataWithIndexes], _axisSelectors.combineDisplayedData);
|
||||
var selectTooltipStackedData = (0, _reselect.createSelector)([selectAllStackedGraphicalItemsSettings, _dataSelectors.selectChartDataWithIndexes, _axisSelectors.selectTooltipAxis], _combineDisplayedStackedData.combineDisplayedStackedData);
|
||||
var selectAllTooltipAppliedValues = (0, _reselect.createSelector)([selectTooltipDisplayedData, _axisSelectors.selectTooltipAxis, selectAllGraphicalItemsSettings, _dataSelectors.selectChartDataWithIndexes, selectAnyTooltipItemUsesChartData, selectTooltipGraphicalItemsData], _axisSelectors.combineAllAppliedValues);
|
||||
var selectTooltipAxisDomainDefinition = (0, _reselect.createSelector)([_axisSelectors.selectTooltipAxis], _axisSelectors.getDomainDefinition);
|
||||
var selectTooltipDataOverflow = (0, _reselect.createSelector)([_axisSelectors.selectTooltipAxis], axisSettings => axisSettings.allowDataOverflow);
|
||||
var selectTooltipDomainFromUserPreferences = (0, _reselect.createSelector)([selectTooltipAxisDomainDefinition, selectTooltipDataOverflow], _isDomainSpecifiedByUser.numericalDomainSpecifiedWithoutRequiringData);
|
||||
var selectAllStackedGraphicalItems = (0, _reselect.createSelector)([selectAllGraphicalItemsSettings], graphicalItems => graphicalItems.filter(_StackedGraphicalItem.isStacked));
|
||||
var selectTooltipStackGroups = (0, _reselect.createSelector)([selectTooltipStackedData, selectAllStackedGraphicalItems, _rootPropsSelectors.selectStackOffsetType, _rootPropsSelectors.selectReverseStackOrder], _axisSelectors.combineStackGroups);
|
||||
var selectTooltipDomainOfStackGroups = (0, _reselect.createSelector)([selectTooltipStackGroups, _dataSelectors.selectChartDataWithIndexes, _selectTooltipAxisType.selectTooltipAxisType, selectTooltipDomainFromUserPreferences], _axisSelectors.combineDomainOfStackGroups);
|
||||
var selectTooltipItemsSettingsExceptStacked = (0, _reselect.createSelector)([selectAllGraphicalItemsSettings], _axisSelectors.filterGraphicalNotStackedItems);
|
||||
var selectDomainOfAllAppliedNumericalValuesIncludingErrorValues = (0, _reselect.createSelector)([selectTooltipDisplayedData, _axisSelectors.selectTooltipAxis, selectTooltipItemsSettingsExceptStacked, _axisSelectors.selectAllErrorBarSettings, _selectTooltipAxisType.selectTooltipAxisType, _dataSelectors.selectChartDataSliceWithIndexes], _axisSelectors.combineDomainOfAllAppliedNumericalValuesIncludingErrorValues, {
|
||||
memoizeOptions: {
|
||||
resultEqualityCheck: _numberDomainEqualityCheck.numberDomainEqualityCheck
|
||||
}
|
||||
});
|
||||
var selectReferenceDotsByTooltipAxis = (0, _reselect.createSelector)([_axisSelectors.selectReferenceDots, _selectTooltipAxisType.selectTooltipAxisType, _selectTooltipAxisId.selectTooltipAxisId], _axisSelectors.filterReferenceElements);
|
||||
var selectTooltipReferenceDotsDomain = (0, _reselect.createSelector)([selectReferenceDotsByTooltipAxis, _selectTooltipAxisType.selectTooltipAxisType], _axisSelectors.combineDotsDomain);
|
||||
var selectReferenceAreasByTooltipAxis = (0, _reselect.createSelector)([_axisSelectors.selectReferenceAreas, _selectTooltipAxisType.selectTooltipAxisType, _selectTooltipAxisId.selectTooltipAxisId], _axisSelectors.filterReferenceElements);
|
||||
var selectTooltipReferenceAreasDomain = (0, _reselect.createSelector)([selectReferenceAreasByTooltipAxis, _selectTooltipAxisType.selectTooltipAxisType], _axisSelectors.combineAreasDomain);
|
||||
var selectReferenceLinesByTooltipAxis = (0, _reselect.createSelector)([_axisSelectors.selectReferenceLines, _selectTooltipAxisType.selectTooltipAxisType, _selectTooltipAxisId.selectTooltipAxisId], _axisSelectors.filterReferenceElements);
|
||||
var selectTooltipReferenceLinesDomain = (0, _reselect.createSelector)([selectReferenceLinesByTooltipAxis, _selectTooltipAxisType.selectTooltipAxisType], _axisSelectors.combineLinesDomain);
|
||||
var selectTooltipReferenceElementsDomain = (0, _reselect.createSelector)([selectTooltipReferenceDotsDomain, selectTooltipReferenceLinesDomain, selectTooltipReferenceAreasDomain], _axisSelectors.mergeDomains);
|
||||
var selectTooltipNumericalDomain = (0, _reselect.createSelector)([_axisSelectors.selectTooltipAxis, selectTooltipAxisDomainDefinition, selectTooltipDomainFromUserPreferences, selectTooltipDomainOfStackGroups, selectDomainOfAllAppliedNumericalValuesIncludingErrorValues, selectTooltipReferenceElementsDomain, _chartLayoutContext.selectChartLayout, _selectTooltipAxisType.selectTooltipAxisType], _axisSelectors.combineNumericalDomain);
|
||||
var selectTooltipAxisDomain = exports.selectTooltipAxisDomain = (0, _reselect.createSelector)([_axisSelectors.selectTooltipAxis, _chartLayoutContext.selectChartLayout, selectTooltipDisplayedData, selectAllTooltipAppliedValues, _rootPropsSelectors.selectStackOffsetType, _selectTooltipAxisType.selectTooltipAxisType, selectTooltipNumericalDomain], _axisSelectors.combineAxisDomain);
|
||||
var selectTooltipNiceTicks = (0, _reselect.createSelector)([selectTooltipAxisDomain, _axisSelectors.selectTooltipAxis, selectTooltipAxisRealScaleType], _axisSelectors.combineNiceTicks);
|
||||
var selectTooltipAxisDomainIncludingNiceTicks = exports.selectTooltipAxisDomainIncludingNiceTicks = (0, _reselect.createSelector)([_axisSelectors.selectTooltipAxis, selectTooltipAxisDomain, selectTooltipNiceTicks, _selectTooltipAxisType.selectTooltipAxisType], _axisSelectors.combineAxisDomainWithNiceTicks);
|
||||
var selectTooltipAxisRange = state => {
|
||||
var axisType = (0, _selectTooltipAxisType.selectTooltipAxisType)(state);
|
||||
var axisId = (0, _selectTooltipAxisId.selectTooltipAxisId)(state);
|
||||
var isPanorama = false; // Tooltip never displays in panorama so this is safe to assume
|
||||
return (0, _axisSelectors.selectAxisRange)(state, axisType, axisId, isPanorama);
|
||||
};
|
||||
var selectTooltipAxisRangeWithReverse = exports.selectTooltipAxisRangeWithReverse = (0, _reselect.createSelector)([_axisSelectors.selectTooltipAxis, selectTooltipAxisRange], _combineAxisRangeWithReverse.combineAxisRangeWithReverse);
|
||||
var selectTooltipConfiguredScale = (0, _reselect.createSelector)([_axisSelectors.selectTooltipAxis, selectTooltipAxisRealScaleType, selectTooltipAxisDomainIncludingNiceTicks, selectTooltipAxisRangeWithReverse], _combineConfiguredScale.combineConfiguredScale);
|
||||
var selectTooltipAxisScale = exports.selectTooltipAxisScale = (0, _reselect.createSelector)([selectTooltipConfiguredScale], _RechartsScale.rechartsScaleFactory);
|
||||
var selectTooltipDuplicateDomain = (0, _reselect.createSelector)([_chartLayoutContext.selectChartLayout, selectAllTooltipAppliedValues, _axisSelectors.selectTooltipAxis, _selectTooltipAxisType.selectTooltipAxisType], _axisSelectors.combineDuplicateDomain);
|
||||
var selectTooltipCategoricalDomain = exports.selectTooltipCategoricalDomain = (0, _reselect.createSelector)([_chartLayoutContext.selectChartLayout, selectAllTooltipAppliedValues, _axisSelectors.selectTooltipAxis, _selectTooltipAxisType.selectTooltipAxisType], _axisSelectors.combineCategoricalDomain);
|
||||
var combineTicksOfTooltipAxis = (layout, axis, realScaleType, scale, range, duplicateDomain, categoricalDomain, axisType) => {
|
||||
if (!axis) {
|
||||
return undefined;
|
||||
}
|
||||
var type = axis.type;
|
||||
var isCategorical = (0, _ChartUtils.isCategoricalAxis)(layout, axisType);
|
||||
if (!scale) {
|
||||
return undefined;
|
||||
}
|
||||
var offsetForBand = realScaleType === 'scaleBand' && scale.bandwidth ? scale.bandwidth() / 2 : 2;
|
||||
var offset = type === 'category' && scale.bandwidth ? scale.bandwidth() / offsetForBand : 0;
|
||||
offset = axisType === 'angleAxis' && range != null && (range === null || range === void 0 ? void 0 : range.length) >= 2 ? (0, _DataUtils.mathSign)(range[0] - range[1]) * 2 * offset : offset;
|
||||
|
||||
// When axis is a categorical axis, but the type of axis is number or the scale of axis is not "auto"
|
||||
if (isCategorical && categoricalDomain) {
|
||||
return categoricalDomain.map((entry, index) => {
|
||||
var scaled = scale.map(entry);
|
||||
if (!(0, _isWellBehavedNumber.isWellBehavedNumber)(scaled)) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
coordinate: scaled + offset,
|
||||
value: entry,
|
||||
index,
|
||||
offset
|
||||
};
|
||||
}).filter(_DataUtils.isNotNil);
|
||||
}
|
||||
|
||||
// When axis has duplicated text, serial numbers are used to generate scale
|
||||
return scale.domain().map((entry, index) => {
|
||||
var scaled = scale.map(entry);
|
||||
if (!(0, _isWellBehavedNumber.isWellBehavedNumber)(scaled)) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
coordinate: scaled + offset,
|
||||
// @ts-expect-error can't use Date as an index
|
||||
value: duplicateDomain ? duplicateDomain[entry] : entry,
|
||||
index,
|
||||
offset
|
||||
};
|
||||
}).filter(_DataUtils.isNotNil);
|
||||
};
|
||||
|
||||
/**
|
||||
* Of on four almost identical implementations of tick generation.
|
||||
* The four horsemen of tick generation are:
|
||||
* - {@link selectTooltipAxisTicks}
|
||||
* - {@link combineAxisTicks}
|
||||
* - {@link getTicksOfAxis}.
|
||||
* - {@link combineGraphicalItemTicks}
|
||||
*/
|
||||
var selectTooltipAxisTicks = exports.selectTooltipAxisTicks = (0, _reselect.createSelector)([_chartLayoutContext.selectChartLayout, _axisSelectors.selectTooltipAxis, selectTooltipAxisRealScaleType, selectTooltipAxisScale, selectTooltipAxisRange, selectTooltipDuplicateDomain, selectTooltipCategoricalDomain, _selectTooltipAxisType.selectTooltipAxisType], combineTicksOfTooltipAxis);
|
||||
var selectTooltipEventType = (0, _reselect.createSelector)([_selectTooltipEventType.selectDefaultTooltipEventType, _selectTooltipEventType.selectValidateTooltipEventTypes, _selectTooltipSettings.selectTooltipSettings], (defaultTooltipEventType, validateTooltipEventType, settings) => (0, _selectTooltipEventType.combineTooltipEventType)(settings.shared, defaultTooltipEventType, validateTooltipEventType));
|
||||
var selectTooltipTrigger = state => state.tooltip.settings.trigger;
|
||||
var selectDefaultIndex = state => state.tooltip.settings.defaultIndex;
|
||||
var selectTooltipInteractionState = (0, _reselect.createSelector)([_selectTooltipState.selectTooltipState, selectTooltipEventType, selectTooltipTrigger, selectDefaultIndex], _combineTooltipInteractionState.combineTooltipInteractionState);
|
||||
var selectActiveTooltipIndex = exports.selectActiveTooltipIndex = (0, _reselect.createSelector)([selectTooltipInteractionState, selectTooltipDisplayedData, _axisSelectors.selectTooltipAxisDataKey, selectTooltipAxisDomain], _combineActiveTooltipIndex.combineActiveTooltipIndex);
|
||||
var selectActiveLabel = exports.selectActiveLabel = (0, _reselect.createSelector)([selectTooltipAxisTicks, selectActiveTooltipIndex], _combineActiveLabel.combineActiveLabel);
|
||||
var selectActiveTooltipDataKey = exports.selectActiveTooltipDataKey = (0, _reselect.createSelector)([selectTooltipInteractionState], tooltipInteraction => {
|
||||
if (!tooltipInteraction) {
|
||||
return undefined;
|
||||
}
|
||||
return tooltipInteraction.dataKey;
|
||||
});
|
||||
var selectActiveTooltipGraphicalItemId = exports.selectActiveTooltipGraphicalItemId = (0, _reselect.createSelector)([selectTooltipInteractionState], tooltipInteraction => {
|
||||
if (!tooltipInteraction) {
|
||||
return undefined;
|
||||
}
|
||||
return tooltipInteraction.graphicalItemId;
|
||||
});
|
||||
var selectTooltipPayloadConfigurations = (0, _reselect.createSelector)([_selectTooltipState.selectTooltipState, selectTooltipEventType, selectTooltipTrigger, selectDefaultIndex], _combineTooltipPayloadConfigurations.combineTooltipPayloadConfigurations);
|
||||
var selectTooltipCoordinateForDefaultIndex = (0, _reselect.createSelector)([_containerSelectors.selectChartWidth, _containerSelectors.selectChartHeight, _chartLayoutContext.selectChartLayout, _selectChartOffsetInternal.selectChartOffsetInternal, selectTooltipAxisTicks, selectDefaultIndex, selectTooltipPayloadConfigurations], _combineCoordinateForDefaultIndex.combineCoordinateForDefaultIndex);
|
||||
var selectActiveTooltipCoordinate = exports.selectActiveTooltipCoordinate = (0, _reselect.createSelector)([selectTooltipInteractionState, selectTooltipCoordinateForDefaultIndex], (tooltipInteractionState, defaultIndexCoordinate) => {
|
||||
if (tooltipInteractionState !== null && tooltipInteractionState !== void 0 && tooltipInteractionState.coordinate) {
|
||||
return tooltipInteractionState.coordinate;
|
||||
}
|
||||
return defaultIndexCoordinate;
|
||||
});
|
||||
var selectIsTooltipActive = exports.selectIsTooltipActive = (0, _reselect.createSelector)([selectTooltipInteractionState], tooltipInteractionState => {
|
||||
var _tooltipInteractionSt;
|
||||
return (_tooltipInteractionSt = tooltipInteractionState === null || tooltipInteractionState === void 0 ? void 0 : tooltipInteractionState.active) !== null && _tooltipInteractionSt !== void 0 ? _tooltipInteractionSt : false;
|
||||
});
|
||||
var selectActiveTooltipPayload = exports.selectActiveTooltipPayload = (0, _reselect.createSelector)([selectTooltipPayloadConfigurations, selectActiveTooltipIndex, _dataSelectors.selectChartDataWithIndexes, _axisSelectors.selectTooltipAxisDataKey, selectActiveLabel, _selectTooltipPayloadSearcher.selectTooltipPayloadSearcher, selectTooltipEventType], _combineTooltipPayload.combineTooltipPayload);
|
||||
var selectActiveTooltipDataPoints = exports.selectActiveTooltipDataPoints = (0, _reselect.createSelector)([selectActiveTooltipPayload], payload => {
|
||||
if (payload == null) {
|
||||
return undefined;
|
||||
}
|
||||
var dataPoints = payload.map(p => p.payload).filter(p => p != null);
|
||||
return Array.from(new Set(dataPoints));
|
||||
});
|
||||
25
frontend/node_modules/recharts/lib/state/selectors/touchSelectors.js
generated
vendored
Normal file
25
frontend/node_modules/recharts/lib/state/selectors/touchSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.selectTooltipCoordinate = void 0;
|
||||
var _reselect = require("reselect");
|
||||
var _selectTooltipState = require("./selectTooltipState");
|
||||
var selectAllTooltipPayloadConfiguration = (0, _reselect.createSelector)([_selectTooltipState.selectTooltipState], tooltipState => tooltipState.tooltipItemPayloads);
|
||||
var selectTooltipCoordinate = exports.selectTooltipCoordinate = (0, _reselect.createSelector)([selectAllTooltipPayloadConfiguration, (_state, tooltipIndex) => tooltipIndex, (_state, _tooltipIndex, graphicalItemId) => graphicalItemId], (allTooltipConfigurations, tooltipIndex, graphicalItemId) => {
|
||||
if (tooltipIndex == null) {
|
||||
return undefined;
|
||||
}
|
||||
var mostRelevantTooltipConfiguration = allTooltipConfigurations.find(tooltipConfiguration => {
|
||||
return tooltipConfiguration.settings.graphicalItemId === graphicalItemId;
|
||||
});
|
||||
if (mostRelevantTooltipConfiguration == null) {
|
||||
return undefined;
|
||||
}
|
||||
var getPosition = mostRelevantTooltipConfiguration.getPosition;
|
||||
if (getPosition == null) {
|
||||
return undefined;
|
||||
}
|
||||
return getPosition(tooltipIndex);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue