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
17
frontend/node_modules/recharts/es6/state/RechartsReduxContext.js
generated
vendored
Normal file
17
frontend/node_modules/recharts/es6/state/RechartsReduxContext.js
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { createContext } from 'react';
|
||||
|
||||
/*
|
||||
* This is a copy of the React-Redux context type, but with our own store type.
|
||||
* We could import directly from react-redux like this:
|
||||
* import { ReactReduxContextValue } from 'react-redux/src/components/Context';
|
||||
* but that makes typescript angry with some errors I am not sure how to resolve
|
||||
* so copy it is.
|
||||
*/
|
||||
|
||||
/**
|
||||
* We need to use our own independent Redux context because we need to avoid interfering with other people's Redux stores
|
||||
* in case they decide to install and use Recharts in another Redux app which is likely to happen.
|
||||
*
|
||||
* https://react-redux.js.org/using-react-redux/accessing-store#providing-custom-context
|
||||
*/
|
||||
export var RechartsReduxContext = /*#__PURE__*/createContext(null);
|
||||
45
frontend/node_modules/recharts/es6/state/RechartsStoreProvider.js
generated
vendored
Normal file
45
frontend/node_modules/recharts/es6/state/RechartsStoreProvider.js
generated
vendored
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
import * as React from 'react';
|
||||
import { useRef } from 'react';
|
||||
import { Provider } from 'react-redux';
|
||||
import { createRechartsStore } from './store';
|
||||
import { useIsPanorama } from '../context/PanoramaContext';
|
||||
import { RechartsReduxContext } from './RechartsReduxContext';
|
||||
export function RechartsStoreProvider(_ref) {
|
||||
var preloadedState = _ref.preloadedState,
|
||||
children = _ref.children,
|
||||
reduxStoreName = _ref.reduxStoreName;
|
||||
var isPanorama = useIsPanorama();
|
||||
/*
|
||||
* Why the ref? Redux official documentation recommends to use store as a singleton,
|
||||
* and reuse that everywhere: https://redux-toolkit.js.org/api/configureStore#basic-example
|
||||
*
|
||||
* Which is correct! Except that is considering deploying Redux in an app.
|
||||
* Recharts as a library supports multiple charts on the same page.
|
||||
* And each of these charts needs its own store independent of others!
|
||||
*
|
||||
* The alternative is to have everything in the store keyed by the chart id.
|
||||
* Which would make working with everything a little bit more painful because we need the chart id everywhere.
|
||||
*/
|
||||
var storeRef = useRef(null);
|
||||
|
||||
/*
|
||||
* Panorama means that this chart is not its own chart, it's only a "preview"
|
||||
* being rendered as a child of Brush.
|
||||
* In such case, it should not have a store on its own - it should implicitly inherit
|
||||
* whatever data is in the "parent" or "root" chart.
|
||||
* Which here is represented by not having a Provider at all. All selectors will use the root store by default.
|
||||
*/
|
||||
if (isPanorama) {
|
||||
return children;
|
||||
}
|
||||
if (storeRef.current == null) {
|
||||
storeRef.current = createRechartsStore(preloadedState, reduxStoreName);
|
||||
}
|
||||
|
||||
// @ts-expect-error React-Redux types demand that the context internal value is not null, but we have that as default.
|
||||
var nonNullContext = RechartsReduxContext;
|
||||
return /*#__PURE__*/React.createElement(Provider, {
|
||||
context: nonNullContext,
|
||||
store: storeRef.current
|
||||
}, children);
|
||||
}
|
||||
10
frontend/node_modules/recharts/es6/state/ReportChartProps.js
generated
vendored
Normal file
10
frontend/node_modules/recharts/es6/state/ReportChartProps.js
generated
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { useEffect } from 'react';
|
||||
import { updateOptions } from './rootPropsSlice';
|
||||
import { useAppDispatch } from './hooks';
|
||||
export function ReportChartProps(props) {
|
||||
var dispatch = useAppDispatch();
|
||||
useEffect(() => {
|
||||
dispatch(updateOptions(props));
|
||||
}, [dispatch, props]);
|
||||
return null;
|
||||
}
|
||||
12
frontend/node_modules/recharts/es6/state/ReportEventSettings.js
generated
vendored
Normal file
12
frontend/node_modules/recharts/es6/state/ReportEventSettings.js
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import { useEffect, memo } from 'react';
|
||||
import { useAppDispatch } from './hooks';
|
||||
import { setEventSettings } from './eventSettingsSlice';
|
||||
import { propsAreEqual } from '../util/propsAreEqual';
|
||||
var ReportEventSettingsImpl = props => {
|
||||
var dispatch = useAppDispatch();
|
||||
useEffect(() => {
|
||||
dispatch(setEventSettings(props));
|
||||
}, [dispatch, props]);
|
||||
return null;
|
||||
};
|
||||
export var ReportEventSettings = /*#__PURE__*/memo(ReportEventSettingsImpl, propsAreEqual);
|
||||
38
frontend/node_modules/recharts/es6/state/ReportMainChartProps.js
generated
vendored
Normal file
38
frontend/node_modules/recharts/es6/state/ReportMainChartProps.js
generated
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import { memo, useEffect } from 'react';
|
||||
import { useIsPanorama } from '../context/PanoramaContext';
|
||||
import { setLayout, setMargin } from './layoutSlice';
|
||||
import { useAppDispatch } from './hooks';
|
||||
import { propsAreEqual } from '../util/propsAreEqual';
|
||||
|
||||
/**
|
||||
* "Main" props are props that are only accepted on the main chart,
|
||||
* as opposed to the small panorama chart inside a Brush.
|
||||
*/
|
||||
|
||||
function ReportMainChartPropsImpl(_ref) {
|
||||
var layout = _ref.layout,
|
||||
margin = _ref.margin;
|
||||
var dispatch = useAppDispatch();
|
||||
|
||||
/*
|
||||
* Skip dispatching properties in panorama chart for two reasons:
|
||||
* 1. The root chart should be deciding on these properties, and
|
||||
* 2. Brush reads these properties from redux store, and so they must remain stable
|
||||
* to avoid circular dependency and infinite re-rendering.
|
||||
*/
|
||||
var isPanorama = useIsPanorama();
|
||||
/*
|
||||
* useEffect here is required to avoid the "Cannot update a component while rendering a different component" error.
|
||||
* https://github.com/facebook/react/issues/18178
|
||||
*
|
||||
* Reported in https://github.com/recharts/recharts/issues/5514
|
||||
*/
|
||||
useEffect(() => {
|
||||
if (!isPanorama) {
|
||||
dispatch(setLayout(layout));
|
||||
dispatch(setMargin(margin));
|
||||
}
|
||||
}, [dispatch, isPanorama, layout, margin]);
|
||||
return null;
|
||||
}
|
||||
export var ReportMainChartProps = /*#__PURE__*/memo(ReportMainChartPropsImpl, propsAreEqual);
|
||||
10
frontend/node_modules/recharts/es6/state/ReportPolarOptions.js
generated
vendored
Normal file
10
frontend/node_modules/recharts/es6/state/ReportPolarOptions.js
generated
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { useEffect } from 'react';
|
||||
import { useAppDispatch } from './hooks';
|
||||
import { updatePolarOptions } from './polarOptionsSlice';
|
||||
export function ReportPolarOptions(props) {
|
||||
var dispatch = useAppDispatch();
|
||||
useEffect(() => {
|
||||
dispatch(updatePolarOptions(props));
|
||||
}, [dispatch, props]);
|
||||
return null;
|
||||
}
|
||||
66
frontend/node_modules/recharts/es6/state/SetGraphicalItem.js
generated
vendored
Normal file
66
frontend/node_modules/recharts/es6/state/SetGraphicalItem.js
generated
vendored
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
import { memo, useLayoutEffect, useRef } from 'react';
|
||||
import { useAppDispatch } from './hooks';
|
||||
import { addCartesianGraphicalItem, addPolarGraphicalItem, removeCartesianGraphicalItem, removePolarGraphicalItem, replaceCartesianGraphicalItem, replacePolarGraphicalItem } from './graphicalItemsSlice';
|
||||
var SetCartesianGraphicalItemImpl = props => {
|
||||
var dispatch = useAppDispatch();
|
||||
var prevPropsRef = useRef(null);
|
||||
useLayoutEffect(() => {
|
||||
if (prevPropsRef.current === null) {
|
||||
dispatch(addCartesianGraphicalItem(props));
|
||||
} else if (prevPropsRef.current !== props) {
|
||||
dispatch(replaceCartesianGraphicalItem({
|
||||
prev: prevPropsRef.current,
|
||||
next: props
|
||||
}));
|
||||
}
|
||||
prevPropsRef.current = props;
|
||||
}, [dispatch, props]);
|
||||
useLayoutEffect(() => {
|
||||
return () => {
|
||||
if (prevPropsRef.current) {
|
||||
dispatch(removeCartesianGraphicalItem(prevPropsRef.current));
|
||||
/*
|
||||
* Here we have to reset the ref to null because in StrictMode, the effect will run twice,
|
||||
* but it will keep the same ref value from the first render.
|
||||
*
|
||||
* In browser, React will clear the ref after the first effect cleanup,
|
||||
* so that wouldn't be an issue.
|
||||
*
|
||||
* In StrictMode, however, the ref is kept,
|
||||
* and in the hook above the code checks for `prevPropsRef.current === null`
|
||||
* which would be false so it would not dispatch the `addCartesianGraphicalItem` action again.
|
||||
*
|
||||
* https://github.com/recharts/recharts/issues/6022
|
||||
*/
|
||||
prevPropsRef.current = null;
|
||||
}
|
||||
};
|
||||
}, [dispatch]);
|
||||
return null;
|
||||
};
|
||||
export var SetCartesianGraphicalItem = /*#__PURE__*/memo(SetCartesianGraphicalItemImpl);
|
||||
var SetPolarGraphicalItemImpl = props => {
|
||||
var dispatch = useAppDispatch();
|
||||
var prevPropsRef = useRef(null);
|
||||
useLayoutEffect(() => {
|
||||
if (prevPropsRef.current === null) {
|
||||
dispatch(addPolarGraphicalItem(props));
|
||||
} else if (prevPropsRef.current !== props) {
|
||||
dispatch(replacePolarGraphicalItem({
|
||||
prev: prevPropsRef.current,
|
||||
next: props
|
||||
}));
|
||||
}
|
||||
prevPropsRef.current = props;
|
||||
}, [dispatch, props]);
|
||||
useLayoutEffect(() => {
|
||||
return () => {
|
||||
if (prevPropsRef.current) {
|
||||
dispatch(removePolarGraphicalItem(prevPropsRef.current));
|
||||
prevPropsRef.current = null;
|
||||
}
|
||||
};
|
||||
}, [dispatch]);
|
||||
return null;
|
||||
};
|
||||
export var SetPolarGraphicalItem = /*#__PURE__*/memo(SetPolarGraphicalItemImpl);
|
||||
63
frontend/node_modules/recharts/es6/state/SetLegendPayload.js
generated
vendored
Normal file
63
frontend/node_modules/recharts/es6/state/SetLegendPayload.js
generated
vendored
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
import { useLayoutEffect, useRef } from 'react';
|
||||
import { useIsPanorama } from '../context/PanoramaContext';
|
||||
import { selectChartLayout } from '../context/chartLayoutContext';
|
||||
import { useAppDispatch, useAppSelector } from './hooks';
|
||||
import { addLegendPayload, replaceLegendPayload, removeLegendPayload } from './legendSlice';
|
||||
export function SetLegendPayload(_ref) {
|
||||
var legendPayload = _ref.legendPayload;
|
||||
var dispatch = useAppDispatch();
|
||||
var isPanorama = useIsPanorama();
|
||||
var prevPayloadRef = useRef(null);
|
||||
useLayoutEffect(() => {
|
||||
if (isPanorama) {
|
||||
return;
|
||||
}
|
||||
if (prevPayloadRef.current === null) {
|
||||
dispatch(addLegendPayload(legendPayload));
|
||||
} else if (prevPayloadRef.current !== legendPayload) {
|
||||
dispatch(replaceLegendPayload({
|
||||
prev: prevPayloadRef.current,
|
||||
next: legendPayload
|
||||
}));
|
||||
}
|
||||
prevPayloadRef.current = legendPayload;
|
||||
}, [dispatch, isPanorama, legendPayload]);
|
||||
useLayoutEffect(() => {
|
||||
return () => {
|
||||
if (prevPayloadRef.current) {
|
||||
dispatch(removeLegendPayload(prevPayloadRef.current));
|
||||
prevPayloadRef.current = null;
|
||||
}
|
||||
};
|
||||
}, [dispatch]);
|
||||
return null;
|
||||
}
|
||||
export function SetPolarLegendPayload(_ref2) {
|
||||
var legendPayload = _ref2.legendPayload;
|
||||
var dispatch = useAppDispatch();
|
||||
var layout = useAppSelector(selectChartLayout);
|
||||
var prevPayloadRef = useRef(null);
|
||||
useLayoutEffect(() => {
|
||||
if (layout !== 'centric' && layout !== 'radial') {
|
||||
return;
|
||||
}
|
||||
if (prevPayloadRef.current === null) {
|
||||
dispatch(addLegendPayload(legendPayload));
|
||||
} else if (prevPayloadRef.current !== legendPayload) {
|
||||
dispatch(replaceLegendPayload({
|
||||
prev: prevPayloadRef.current,
|
||||
next: legendPayload
|
||||
}));
|
||||
}
|
||||
prevPayloadRef.current = legendPayload;
|
||||
}, [dispatch, layout, legendPayload]);
|
||||
useLayoutEffect(() => {
|
||||
return () => {
|
||||
if (prevPayloadRef.current) {
|
||||
dispatch(removeLegendPayload(prevPayloadRef.current));
|
||||
prevPayloadRef.current = null;
|
||||
}
|
||||
};
|
||||
}, [dispatch]);
|
||||
return null;
|
||||
}
|
||||
34
frontend/node_modules/recharts/es6/state/SetTooltipEntrySettings.js
generated
vendored
Normal file
34
frontend/node_modules/recharts/es6/state/SetTooltipEntrySettings.js
generated
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import { useLayoutEffect, useRef } from 'react';
|
||||
import { useAppDispatch } from './hooks';
|
||||
import { addTooltipEntrySettings, removeTooltipEntrySettings, replaceTooltipEntrySettings } from './tooltipSlice';
|
||||
import { useIsPanorama } from '../context/PanoramaContext';
|
||||
export function SetTooltipEntrySettings(_ref) {
|
||||
var tooltipEntrySettings = _ref.tooltipEntrySettings;
|
||||
var dispatch = useAppDispatch();
|
||||
var isPanorama = useIsPanorama();
|
||||
var prevSettingsRef = useRef(null);
|
||||
useLayoutEffect(() => {
|
||||
if (isPanorama) {
|
||||
// Panorama graphical items should never contribute to Tooltip payload.
|
||||
return;
|
||||
}
|
||||
if (prevSettingsRef.current === null) {
|
||||
dispatch(addTooltipEntrySettings(tooltipEntrySettings));
|
||||
} else if (prevSettingsRef.current !== tooltipEntrySettings) {
|
||||
dispatch(replaceTooltipEntrySettings({
|
||||
prev: prevSettingsRef.current,
|
||||
next: tooltipEntrySettings
|
||||
}));
|
||||
}
|
||||
prevSettingsRef.current = tooltipEntrySettings;
|
||||
}, [tooltipEntrySettings, dispatch, isPanorama]);
|
||||
useLayoutEffect(() => {
|
||||
return () => {
|
||||
if (prevSettingsRef.current) {
|
||||
dispatch(removeTooltipEntrySettings(prevSettingsRef.current));
|
||||
prevSettingsRef.current = null;
|
||||
}
|
||||
};
|
||||
}, [dispatch]);
|
||||
return null;
|
||||
}
|
||||
34
frontend/node_modules/recharts/es6/state/brushSlice.js
generated
vendored
Normal file
34
frontend/node_modules/recharts/es6/state/brushSlice.js
generated
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import { createSlice } from '@reduxjs/toolkit';
|
||||
|
||||
/**
|
||||
* From all Brush properties, only height has a default value and will always be defined.
|
||||
* Other properties are nullable and will be computed from offsets and margins if they are not set.
|
||||
*/
|
||||
|
||||
var initialState = {
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: 0,
|
||||
height: 0,
|
||||
padding: {
|
||||
top: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
left: 0
|
||||
}
|
||||
};
|
||||
export var brushSlice = createSlice({
|
||||
name: 'brush',
|
||||
initialState,
|
||||
reducers: {
|
||||
setBrushSettings(_state, action) {
|
||||
if (action.payload == null) {
|
||||
return initialState;
|
||||
}
|
||||
return action.payload;
|
||||
}
|
||||
}
|
||||
});
|
||||
var setBrushSettings = brushSlice.actions.setBrushSettings;
|
||||
export { setBrushSettings };
|
||||
export var brushReducer = brushSlice.reducer;
|
||||
187
frontend/node_modules/recharts/es6/state/cartesianAxisSlice.js
generated
vendored
Normal file
187
frontend/node_modules/recharts/es6/state/cartesianAxisSlice.js
generated
vendored
Normal file
|
|
@ -0,0 +1,187 @@
|
|||
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); }
|
||||
import { createSlice, prepareAutoBatched } from '@reduxjs/toolkit';
|
||||
import { castDraft } from 'immer';
|
||||
|
||||
/**
|
||||
* @inline
|
||||
*/
|
||||
|
||||
export var defaultAxisId = 0;
|
||||
|
||||
/**
|
||||
* Properties shared in X, Y, and Z axes.
|
||||
* User defined axis settings, coming from props.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Controls how Recharts calculates "nice" tick values for numerical axes.
|
||||
*
|
||||
* - `'none'`: Recharts does not apply any tick-rounding algorithm; tick positions are
|
||||
* determined entirely by d3, evenly spaced but not rounded to human-friendly numbers.
|
||||
* There is no domain-extension logic applied in this mode.
|
||||
*
|
||||
* - `'auto'` *(default)*: Recharts automatically decides whether and how to apply tick
|
||||
* niceties based on the domain definition. When the domain contains an `'auto'` keyword,
|
||||
* Recharts uses the `'adaptive'` algorithm and may extend the domain slightly to
|
||||
* produce clean tick labels. Otherwise, it applies the same algorithm while keeping
|
||||
* ticks within the fixed domain. This mirrors the default behavior from Recharts v2.
|
||||
*
|
||||
* - `'adaptive'`: Always applies the space-efficient algorithm (`getAdaptiveStep`),
|
||||
* which fills the available range as densely as possible while still rounding steps
|
||||
* to reasonable numbers (e.g. 10, 20, 25). May produce less "round-looking" labels
|
||||
* than `'snap125'`, but wastes less space. The domain-extension logic still applies
|
||||
* when the domain contains an `'auto'` keyword.
|
||||
*
|
||||
* - `'snap125'`: Always applies the round-numbers algorithm (`getSnap125Step`), which
|
||||
* snaps step sizes to values from the set {1, 2, 2.5, 5} × 10ⁿ. Produces very
|
||||
* human-friendly labels (e.g. 0, 5, 10, 15, 20) but may leave blank space at the
|
||||
* edges of the chart. The domain-extension logic still applies when the domain
|
||||
* contains an `'auto'` keyword.
|
||||
*
|
||||
* @see {@link https://recharts.github.io/guide/axisTicks/}
|
||||
* @inline
|
||||
*/
|
||||
|
||||
/**
|
||||
* These are the external props, visible for users as they set them using our public API.
|
||||
* There is all sorts of internal computed things based on these, but they will come through selectors.
|
||||
*
|
||||
* Properties shared between X and Y axes
|
||||
*/
|
||||
|
||||
/**
|
||||
* Z axis is special because it's never displayed. It controls the size of Scatter dots,
|
||||
* but it never displays ticks anywhere.
|
||||
*/
|
||||
|
||||
var initialState = {
|
||||
xAxis: {},
|
||||
yAxis: {},
|
||||
zAxis: {}
|
||||
};
|
||||
|
||||
/**
|
||||
* This is the slice where each individual Axis element pushes its own configuration.
|
||||
* Prefer to use this one instead of axisSlice.
|
||||
*/
|
||||
var cartesianAxisSlice = createSlice({
|
||||
name: 'cartesianAxis',
|
||||
initialState,
|
||||
reducers: {
|
||||
addXAxis: {
|
||||
reducer(state, action) {
|
||||
state.xAxis[action.payload.id] = castDraft(action.payload);
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
replaceXAxis: {
|
||||
reducer(state, action) {
|
||||
var _action$payload = action.payload,
|
||||
prev = _action$payload.prev,
|
||||
next = _action$payload.next;
|
||||
if (state.xAxis[prev.id] !== undefined) {
|
||||
if (prev.id !== next.id) {
|
||||
delete state.xAxis[prev.id];
|
||||
}
|
||||
state.xAxis[next.id] = castDraft(next);
|
||||
}
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
removeXAxis: {
|
||||
reducer(state, action) {
|
||||
delete state.xAxis[action.payload.id];
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
addYAxis: {
|
||||
reducer(state, action) {
|
||||
state.yAxis[action.payload.id] = castDraft(action.payload);
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
replaceYAxis: {
|
||||
reducer(state, action) {
|
||||
var _action$payload2 = action.payload,
|
||||
prev = _action$payload2.prev,
|
||||
next = _action$payload2.next;
|
||||
if (state.yAxis[prev.id] !== undefined) {
|
||||
if (prev.id !== next.id) {
|
||||
delete state.yAxis[prev.id];
|
||||
}
|
||||
state.yAxis[next.id] = castDraft(next);
|
||||
}
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
removeYAxis: {
|
||||
reducer(state, action) {
|
||||
delete state.yAxis[action.payload.id];
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
addZAxis: {
|
||||
reducer(state, action) {
|
||||
state.zAxis[action.payload.id] = castDraft(action.payload);
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
replaceZAxis: {
|
||||
reducer(state, action) {
|
||||
var _action$payload3 = action.payload,
|
||||
prev = _action$payload3.prev,
|
||||
next = _action$payload3.next;
|
||||
if (state.zAxis[prev.id] !== undefined) {
|
||||
if (prev.id !== next.id) {
|
||||
delete state.zAxis[prev.id];
|
||||
}
|
||||
state.zAxis[next.id] = castDraft(next);
|
||||
}
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
removeZAxis: {
|
||||
reducer(state, action) {
|
||||
delete state.zAxis[action.payload.id];
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
updateYAxisWidth(state, action) {
|
||||
var _action$payload4 = action.payload,
|
||||
id = _action$payload4.id,
|
||||
width = _action$payload4.width;
|
||||
var axis = state.yAxis[id];
|
||||
if (axis) {
|
||||
var _history$;
|
||||
var history = axis.widthHistory || [];
|
||||
// An oscillation is detected when the new width is the same as the width before the last one.
|
||||
// This is a simple A -> B -> A pattern. If the next width is B, and the difference is less than 1 pixel, we ignore it.
|
||||
if (history.length === 3 && history[0] === history[2] && width === history[1] && width !== axis.width && Math.abs(width - ((_history$ = history[0]) !== null && _history$ !== void 0 ? _history$ : 0)) <= 1) {
|
||||
return;
|
||||
}
|
||||
var newHistory = [...history, width].slice(-3);
|
||||
state.yAxis[id] = _objectSpread(_objectSpread({}, axis), {}, {
|
||||
width,
|
||||
widthHistory: newHistory
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
var _cartesianAxisSlice$a = cartesianAxisSlice.actions,
|
||||
addXAxis = _cartesianAxisSlice$a.addXAxis,
|
||||
replaceXAxis = _cartesianAxisSlice$a.replaceXAxis,
|
||||
removeXAxis = _cartesianAxisSlice$a.removeXAxis,
|
||||
addYAxis = _cartesianAxisSlice$a.addYAxis,
|
||||
replaceYAxis = _cartesianAxisSlice$a.replaceYAxis,
|
||||
removeYAxis = _cartesianAxisSlice$a.removeYAxis,
|
||||
addZAxis = _cartesianAxisSlice$a.addZAxis,
|
||||
replaceZAxis = _cartesianAxisSlice$a.replaceZAxis,
|
||||
removeZAxis = _cartesianAxisSlice$a.removeZAxis,
|
||||
updateYAxisWidth = _cartesianAxisSlice$a.updateYAxisWidth;
|
||||
export { addXAxis, replaceXAxis, removeXAxis, addYAxis, replaceYAxis, removeYAxis, addZAxis, replaceZAxis, removeZAxis, updateYAxisWidth };
|
||||
export var cartesianAxisReducer = cartesianAxisSlice.reducer;
|
||||
65
frontend/node_modules/recharts/es6/state/chartDataSlice.js
generated
vendored
Normal file
65
frontend/node_modules/recharts/es6/state/chartDataSlice.js
generated
vendored
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
import { createSlice } from '@reduxjs/toolkit';
|
||||
import { castDraft } from 'immer';
|
||||
|
||||
/**
|
||||
* This is the data that's coming through main chart `data` prop
|
||||
* Recharts is very flexible in what it accepts so the type is very flexible too.
|
||||
* This will typically be an object, and various components will provide various `dataKey`
|
||||
* that dictates how to pull data from that object.
|
||||
*
|
||||
* TL;DR: before dataKey
|
||||
*
|
||||
* @inline
|
||||
*/
|
||||
|
||||
/**
|
||||
* So this is the same unknown type as ChartData but this is after the dataKey has been applied.
|
||||
* We still don't know what the type is - that depends on what exactly it was before the dataKey application,
|
||||
* and the dataKey can return whatever anyway - but let's keep it separate as a form of documentation.
|
||||
*
|
||||
* TL;DR: ChartData after dataKey.
|
||||
*/
|
||||
|
||||
export var initialChartDataState = {
|
||||
chartData: undefined,
|
||||
computedData: undefined,
|
||||
dataStartIndex: 0,
|
||||
dataEndIndex: 0
|
||||
};
|
||||
var chartDataSlice = createSlice({
|
||||
name: 'chartData',
|
||||
initialState: initialChartDataState,
|
||||
reducers: {
|
||||
setChartData(state, action) {
|
||||
state.chartData = castDraft(action.payload);
|
||||
if (action.payload == null) {
|
||||
state.dataStartIndex = 0;
|
||||
state.dataEndIndex = 0;
|
||||
return;
|
||||
}
|
||||
if (action.payload.length > 0 && state.dataEndIndex !== action.payload.length - 1) {
|
||||
state.dataEndIndex = action.payload.length - 1;
|
||||
}
|
||||
},
|
||||
setComputedData(state, action) {
|
||||
state.computedData = action.payload;
|
||||
},
|
||||
setDataStartEndIndexes(state, action) {
|
||||
var _action$payload = action.payload,
|
||||
startIndex = _action$payload.startIndex,
|
||||
endIndex = _action$payload.endIndex;
|
||||
if (startIndex != null) {
|
||||
state.dataStartIndex = startIndex;
|
||||
}
|
||||
if (endIndex != null) {
|
||||
state.dataEndIndex = endIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
var _chartDataSlice$actio = chartDataSlice.actions,
|
||||
setChartData = _chartDataSlice$actio.setChartData,
|
||||
setDataStartEndIndexes = _chartDataSlice$actio.setDataStartEndIndexes,
|
||||
setComputedData = _chartDataSlice$actio.setComputedData;
|
||||
export { setChartData, setDataStartEndIndexes, setComputedData };
|
||||
export var chartDataReducer = chartDataSlice.reducer;
|
||||
47
frontend/node_modules/recharts/es6/state/errorBarSlice.js
generated
vendored
Normal file
47
frontend/node_modules/recharts/es6/state/errorBarSlice.js
generated
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
import { createSlice } from '@reduxjs/toolkit';
|
||||
|
||||
/**
|
||||
* ErrorBars have lot more settings but all the others are scoped to the component itself.
|
||||
* Only some of them required to be reported to the global store because XAxis and YAxis need to know
|
||||
* if the error bar is contributing to extending the axis domain.
|
||||
*/
|
||||
|
||||
var initialState = {};
|
||||
var errorBarSlice = createSlice({
|
||||
name: 'errorBars',
|
||||
initialState,
|
||||
reducers: {
|
||||
addErrorBar: (state, action) => {
|
||||
var _action$payload = action.payload,
|
||||
itemId = _action$payload.itemId,
|
||||
errorBar = _action$payload.errorBar;
|
||||
if (!state[itemId]) {
|
||||
state[itemId] = [];
|
||||
}
|
||||
state[itemId].push(errorBar);
|
||||
},
|
||||
replaceErrorBar: (state, action) => {
|
||||
var _action$payload2 = action.payload,
|
||||
itemId = _action$payload2.itemId,
|
||||
prev = _action$payload2.prev,
|
||||
next = _action$payload2.next;
|
||||
if (state[itemId]) {
|
||||
state[itemId] = state[itemId].map(e => e.dataKey === prev.dataKey && e.direction === prev.direction ? next : e);
|
||||
}
|
||||
},
|
||||
removeErrorBar: (state, action) => {
|
||||
var _action$payload3 = action.payload,
|
||||
itemId = _action$payload3.itemId,
|
||||
errorBar = _action$payload3.errorBar;
|
||||
if (state[itemId]) {
|
||||
state[itemId] = state[itemId].filter(e => e.dataKey !== errorBar.dataKey || e.direction !== errorBar.direction);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
var _errorBarSlice$action = errorBarSlice.actions,
|
||||
addErrorBar = _errorBarSlice$action.addErrorBar,
|
||||
replaceErrorBar = _errorBarSlice$action.replaceErrorBar,
|
||||
removeErrorBar = _errorBarSlice$action.removeErrorBar;
|
||||
export { addErrorBar, replaceErrorBar, removeErrorBar };
|
||||
export var errorBarReducer = errorBarSlice.reducer;
|
||||
23
frontend/node_modules/recharts/es6/state/eventSettingsSlice.js
generated
vendored
Normal file
23
frontend/node_modules/recharts/es6/state/eventSettingsSlice.js
generated
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { createSlice } from '@reduxjs/toolkit';
|
||||
import { castDraft } from 'immer';
|
||||
export var initialEventSettingsState = {
|
||||
throttleDelay: 'raf',
|
||||
throttledEvents: ['mousemove', 'touchmove', 'pointermove', 'scroll', 'wheel']
|
||||
};
|
||||
var eventSettingsSlice = createSlice({
|
||||
name: 'eventSettings',
|
||||
initialState: initialEventSettingsState,
|
||||
reducers: {
|
||||
setEventSettings: (state, action) => {
|
||||
if (action.payload.throttleDelay != null) {
|
||||
state.throttleDelay = action.payload.throttleDelay;
|
||||
}
|
||||
if (action.payload.throttledEvents != null) {
|
||||
state.throttledEvents = castDraft(action.payload.throttledEvents);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
var setEventSettings = eventSettingsSlice.actions.setEventSettings;
|
||||
export { setEventSettings };
|
||||
export var eventSettingsReducer = eventSettingsSlice.reducer;
|
||||
115
frontend/node_modules/recharts/es6/state/externalEventsMiddleware.js
generated
vendored
Normal file
115
frontend/node_modules/recharts/es6/state/externalEventsMiddleware.js
generated
vendored
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
import { createAction, createListenerMiddleware } from '@reduxjs/toolkit';
|
||||
import { selectActiveLabel, selectActiveTooltipCoordinate, selectActiveTooltipDataKey, selectActiveTooltipIndex, selectIsTooltipActive } from './selectors/tooltipSelectors';
|
||||
import { createEventProxy } from '../util/createEventProxy';
|
||||
export var externalEventAction = createAction('externalEvent');
|
||||
export var externalEventsMiddleware = createListenerMiddleware();
|
||||
|
||||
/*
|
||||
* We need a Map keyed by event type because this middleware handles MULTIPLE different event types
|
||||
* (click, mouseenter, mouseleave, mousedown, mouseup, contextmenu, dblclick, touchstart, touchmove, touchend)
|
||||
* from the same DOM element. Different event types should NOT cancel each other's animation frames.
|
||||
* For example, a click event and a mousemove event can happen in quick succession and both should be processed.
|
||||
* This is different from mouseMoveMiddleware which only handles one event type and uses a single rafId.
|
||||
*/
|
||||
var rafIdMap = new Map();
|
||||
var timeoutIdMap = new Map();
|
||||
var latestEventMap = new Map();
|
||||
externalEventsMiddleware.startListening({
|
||||
actionCreator: externalEventAction,
|
||||
effect: (action, listenerApi) => {
|
||||
var _action$payload = action.payload,
|
||||
handler = _action$payload.handler,
|
||||
reactEvent = _action$payload.reactEvent;
|
||||
if (handler == null) {
|
||||
return;
|
||||
}
|
||||
var eventType = reactEvent.type;
|
||||
var eventProxy = createEventProxy(reactEvent);
|
||||
latestEventMap.set(eventType, {
|
||||
handler,
|
||||
reactEvent: eventProxy
|
||||
});
|
||||
|
||||
// Cancel any pending execution for this event type
|
||||
var existingRafId = rafIdMap.get(eventType);
|
||||
if (existingRafId !== undefined) {
|
||||
cancelAnimationFrame(existingRafId);
|
||||
rafIdMap.delete(eventType);
|
||||
}
|
||||
var state = listenerApi.getState();
|
||||
var _state$eventSettings = state.eventSettings,
|
||||
throttleDelay = _state$eventSettings.throttleDelay,
|
||||
throttledEvents = _state$eventSettings.throttledEvents;
|
||||
|
||||
/*
|
||||
* reactEvent.type gives us the event type as a string, e.g., 'click', 'mousemove', etc.
|
||||
* which is the same as the names used in throttledEvents array
|
||||
* but that array is strictly typed as ReadonlyArray<keyof GlobalEventHandlersEventMap> | 'all' | undefined
|
||||
* so that we can have relevant autocomplete and type checking elsewhere.
|
||||
* This makes TypeScript panic because it refuses to call .includes() on ReadonlyArray<keyof GlobalEventHandlersEventMap>
|
||||
* with a string argument.
|
||||
* To satisfy TypeScript, we need to explicitly typecast throttledEvents here.
|
||||
*/
|
||||
var eventListAsString = throttledEvents;
|
||||
|
||||
// Check if this event type should be throttled
|
||||
// throttledEvents can be 'all' or an array of event names
|
||||
var isThrottled = eventListAsString === 'all' || (eventListAsString === null || eventListAsString === void 0 ? void 0 : eventListAsString.includes(eventType));
|
||||
var existingTimeoutId = timeoutIdMap.get(eventType);
|
||||
if (existingTimeoutId !== undefined && (typeof throttleDelay !== 'number' || !isThrottled)) {
|
||||
clearTimeout(existingTimeoutId);
|
||||
timeoutIdMap.delete(eventType);
|
||||
}
|
||||
var callback = () => {
|
||||
var latestAction = latestEventMap.get(eventType);
|
||||
try {
|
||||
if (!latestAction) {
|
||||
// This happens if the event was consumed by the leading edge and no new event came in
|
||||
return;
|
||||
}
|
||||
var latestHandler = latestAction.handler,
|
||||
latestEvent = latestAction.reactEvent;
|
||||
var currentState = listenerApi.getState();
|
||||
var nextState = {
|
||||
activeCoordinate: selectActiveTooltipCoordinate(currentState),
|
||||
activeDataKey: selectActiveTooltipDataKey(currentState),
|
||||
activeIndex: selectActiveTooltipIndex(currentState),
|
||||
activeLabel: selectActiveLabel(currentState),
|
||||
activeTooltipIndex: selectActiveTooltipIndex(currentState),
|
||||
isTooltipActive: selectIsTooltipActive(currentState)
|
||||
};
|
||||
if (latestHandler) {
|
||||
latestHandler(nextState, latestEvent);
|
||||
}
|
||||
} finally {
|
||||
rafIdMap.delete(eventType);
|
||||
timeoutIdMap.delete(eventType);
|
||||
latestEventMap.delete(eventType);
|
||||
}
|
||||
};
|
||||
if (!isThrottled) {
|
||||
// Execute immediately
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
if (throttleDelay === 'raf') {
|
||||
var rafId = requestAnimationFrame(callback);
|
||||
rafIdMap.set(eventType, rafId);
|
||||
} else if (typeof throttleDelay === 'number') {
|
||||
if (!timeoutIdMap.has(eventType)) {
|
||||
/*
|
||||
* Leading edge execution - execute immediately on the first event
|
||||
* and then start the cooldown period to throttle subsequent events.
|
||||
*/
|
||||
callback();
|
||||
|
||||
// Start cooldown
|
||||
var timeoutId = setTimeout(callback, throttleDelay);
|
||||
timeoutIdMap.set(eventType, timeoutId);
|
||||
}
|
||||
} else {
|
||||
// Should not happen based on type, but fallback to immediate
|
||||
callback();
|
||||
}
|
||||
}
|
||||
});
|
||||
82
frontend/node_modules/recharts/es6/state/graphicalItemsSlice.js
generated
vendored
Normal file
82
frontend/node_modules/recharts/es6/state/graphicalItemsSlice.js
generated
vendored
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
import { createSlice, current, prepareAutoBatched } from '@reduxjs/toolkit';
|
||||
import { castDraft } from 'immer';
|
||||
|
||||
/**
|
||||
* Unique ID of the graphical item.
|
||||
* This is used to identify the graphical item in the state and in the React tree.
|
||||
* This is required for every graphical item - it's either provided by the user or generated automatically.
|
||||
*/
|
||||
|
||||
var initialState = {
|
||||
cartesianItems: [],
|
||||
polarItems: []
|
||||
};
|
||||
var graphicalItemsSlice = createSlice({
|
||||
name: 'graphicalItems',
|
||||
initialState,
|
||||
reducers: {
|
||||
addCartesianGraphicalItem: {
|
||||
reducer(state, action) {
|
||||
state.cartesianItems.push(castDraft(action.payload));
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
replaceCartesianGraphicalItem: {
|
||||
reducer(state, action) {
|
||||
var _action$payload = action.payload,
|
||||
prev = _action$payload.prev,
|
||||
next = _action$payload.next;
|
||||
var index = current(state).cartesianItems.indexOf(castDraft(prev));
|
||||
if (index > -1) {
|
||||
state.cartesianItems[index] = castDraft(next);
|
||||
}
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
removeCartesianGraphicalItem: {
|
||||
reducer(state, action) {
|
||||
var index = current(state).cartesianItems.indexOf(castDraft(action.payload));
|
||||
if (index > -1) {
|
||||
state.cartesianItems.splice(index, 1);
|
||||
}
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
addPolarGraphicalItem: {
|
||||
reducer(state, action) {
|
||||
state.polarItems.push(castDraft(action.payload));
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
removePolarGraphicalItem: {
|
||||
reducer(state, action) {
|
||||
var index = current(state).polarItems.indexOf(castDraft(action.payload));
|
||||
if (index > -1) {
|
||||
state.polarItems.splice(index, 1);
|
||||
}
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
replacePolarGraphicalItem: {
|
||||
reducer(state, action) {
|
||||
var _action$payload2 = action.payload,
|
||||
prev = _action$payload2.prev,
|
||||
next = _action$payload2.next;
|
||||
var index = current(state).polarItems.indexOf(castDraft(prev));
|
||||
if (index > -1) {
|
||||
state.polarItems[index] = castDraft(next);
|
||||
}
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
}
|
||||
}
|
||||
});
|
||||
var _graphicalItemsSlice$ = graphicalItemsSlice.actions,
|
||||
addCartesianGraphicalItem = _graphicalItemsSlice$.addCartesianGraphicalItem,
|
||||
replaceCartesianGraphicalItem = _graphicalItemsSlice$.replaceCartesianGraphicalItem,
|
||||
removeCartesianGraphicalItem = _graphicalItemsSlice$.removeCartesianGraphicalItem,
|
||||
addPolarGraphicalItem = _graphicalItemsSlice$.addPolarGraphicalItem,
|
||||
removePolarGraphicalItem = _graphicalItemsSlice$.removePolarGraphicalItem,
|
||||
replacePolarGraphicalItem = _graphicalItemsSlice$.replacePolarGraphicalItem;
|
||||
export { addCartesianGraphicalItem, replaceCartesianGraphicalItem, removeCartesianGraphicalItem, addPolarGraphicalItem, removePolarGraphicalItem, replacePolarGraphicalItem };
|
||||
export var graphicalItemsReducer = graphicalItemsSlice.reducer;
|
||||
46
frontend/node_modules/recharts/es6/state/hooks.js
generated
vendored
Normal file
46
frontend/node_modules/recharts/es6/state/hooks.js
generated
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';
|
||||
import { useContext, useMemo } from 'react';
|
||||
import { RechartsReduxContext } from './RechartsReduxContext';
|
||||
var noopDispatch = a => a;
|
||||
export var useAppDispatch = () => {
|
||||
var context = useContext(RechartsReduxContext);
|
||||
if (context) {
|
||||
return context.store.dispatch;
|
||||
}
|
||||
return noopDispatch;
|
||||
};
|
||||
var noop = () => {};
|
||||
var addNestedSubNoop = () => noop;
|
||||
var refEquality = (a, b) => a === b;
|
||||
|
||||
/**
|
||||
* This is a recharts variant of `useSelector` from 'react-redux' package.
|
||||
*
|
||||
* The difference is that react-redux version will throw an Error when used outside of Redux context.
|
||||
*
|
||||
* This, recharts version, will return undefined instead.
|
||||
*
|
||||
* This is because we want to allow using our components outside the Chart wrapper,
|
||||
* and have people provide all props explicitly.
|
||||
*
|
||||
* If however they use the component inside a chart wrapper then those props become optional,
|
||||
* and we read them from Redux state instead.
|
||||
*
|
||||
* @param selector for pulling things out of Redux store; will not be called if the store is not accessible
|
||||
* @return whatever the selector returned; or undefined when outside of Redux store
|
||||
*/
|
||||
export function useAppSelector(selector) {
|
||||
var context = useContext(RechartsReduxContext);
|
||||
var outOfContextSelector = useMemo(() => {
|
||||
if (!context) {
|
||||
return noop;
|
||||
}
|
||||
return state => {
|
||||
if (state == null) {
|
||||
return undefined;
|
||||
}
|
||||
return selector(state);
|
||||
};
|
||||
}, [context, selector]);
|
||||
return useSyncExternalStoreWithSelector(context ? context.subscription.addNestedSub : addNestedSubNoop, context ? context.store.getState : noop, context ? context.store.getState : noop, outOfContextSelector, refEquality);
|
||||
}
|
||||
181
frontend/node_modules/recharts/es6/state/keyboardEventsMiddleware.js
generated
vendored
Normal file
181
frontend/node_modules/recharts/es6/state/keyboardEventsMiddleware.js
generated
vendored
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
import { createAction, createListenerMiddleware } from '@reduxjs/toolkit';
|
||||
import { setKeyboardInteraction } from './tooltipSlice';
|
||||
import { selectTooltipAxisDomain, selectTooltipAxisTicks, selectTooltipDisplayedData } from './selectors/tooltipSelectors';
|
||||
import { selectCoordinateForDefaultIndex } from './selectors/selectors';
|
||||
import { selectChartDirection, selectTooltipAxisDataKey } from './selectors/axisSelectors';
|
||||
import { combineActiveTooltipIndex } from './selectors/combiners/combineActiveTooltipIndex';
|
||||
import { selectTooltipEventType } from './selectors/selectTooltipEventType';
|
||||
export var keyDownAction = createAction('keyDown');
|
||||
export var focusAction = createAction('focus');
|
||||
export var blurAction = createAction('blur');
|
||||
export var keyboardEventsMiddleware = createListenerMiddleware();
|
||||
var rafId = null;
|
||||
var timeoutId = null;
|
||||
var latestKeyboardActionPayload = null;
|
||||
keyboardEventsMiddleware.startListening({
|
||||
actionCreator: keyDownAction,
|
||||
effect: (action, listenerApi) => {
|
||||
latestKeyboardActionPayload = action.payload;
|
||||
if (rafId !== null) {
|
||||
cancelAnimationFrame(rafId);
|
||||
rafId = null;
|
||||
}
|
||||
var state = listenerApi.getState();
|
||||
var _state$eventSettings = state.eventSettings,
|
||||
throttleDelay = _state$eventSettings.throttleDelay,
|
||||
throttledEvents = _state$eventSettings.throttledEvents;
|
||||
var isThrottled = throttledEvents === 'all' || throttledEvents.includes('keydown');
|
||||
if (timeoutId !== null && (typeof throttleDelay !== 'number' || !isThrottled)) {
|
||||
clearTimeout(timeoutId);
|
||||
timeoutId = null;
|
||||
}
|
||||
var callback = () => {
|
||||
try {
|
||||
var currentState = listenerApi.getState();
|
||||
var accessibilityLayerIsActive = currentState.rootProps.accessibilityLayer !== false;
|
||||
if (!accessibilityLayerIsActive) {
|
||||
return;
|
||||
}
|
||||
var keyboardInteraction = currentState.tooltip.keyboardInteraction;
|
||||
var key = latestKeyboardActionPayload;
|
||||
if (key !== 'ArrowRight' && key !== 'ArrowLeft' && key !== 'Enter') {
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO this is lacking index for charts that do not support numeric indexes
|
||||
var resolvedIndex = combineActiveTooltipIndex(keyboardInteraction, selectTooltipDisplayedData(currentState), selectTooltipAxisDataKey(currentState), selectTooltipAxisDomain(currentState));
|
||||
var currentIndex = resolvedIndex == null ? -1 : Number(resolvedIndex);
|
||||
var isOutsideDomain = !Number.isFinite(currentIndex) || currentIndex < 0;
|
||||
var tooltipTicks = selectTooltipAxisTicks(currentState);
|
||||
var displayedData = selectTooltipDisplayedData(currentState);
|
||||
var tooltipEventType = selectTooltipEventType(currentState, currentState.tooltip.settings.shared);
|
||||
if (key === 'Enter') {
|
||||
if (isOutsideDomain) {
|
||||
return;
|
||||
}
|
||||
var _coordinate = selectCoordinateForDefaultIndex(currentState, tooltipEventType, 'hover', String(keyboardInteraction.index));
|
||||
listenerApi.dispatch(setKeyboardInteraction({
|
||||
active: !keyboardInteraction.active,
|
||||
activeIndex: keyboardInteraction.index,
|
||||
activeCoordinate: _coordinate
|
||||
}));
|
||||
return;
|
||||
}
|
||||
var direction = selectChartDirection(currentState);
|
||||
var directionMultiplier = direction === 'left-to-right' ? 1 : -1;
|
||||
var movement = key === 'ArrowRight' ? 1 : -1;
|
||||
var nextIndex;
|
||||
if (isOutsideDomain) {
|
||||
var axisDataKey = selectTooltipAxisDataKey(currentState);
|
||||
var domain = selectTooltipAxisDomain(currentState);
|
||||
var effectiveMovement = movement * directionMultiplier;
|
||||
|
||||
// Build a minimal TooltipInteractionState for the candidate-index check.
|
||||
var mkInteraction = i => ({
|
||||
active: false,
|
||||
index: String(i),
|
||||
dataKey: undefined,
|
||||
graphicalItemId: undefined,
|
||||
coordinate: undefined
|
||||
});
|
||||
nextIndex = -1;
|
||||
if (effectiveMovement > 0) {
|
||||
for (var i = 0; i < displayedData.length; i++) {
|
||||
if (combineActiveTooltipIndex(mkInteraction(i), displayedData, axisDataKey, domain) != null) {
|
||||
nextIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (var _i = displayedData.length - 1; _i >= 0; _i--) {
|
||||
if (combineActiveTooltipIndex(mkInteraction(_i), displayedData, axisDataKey, domain) != null) {
|
||||
nextIndex = _i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (nextIndex < 0) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
nextIndex = currentIndex + movement * directionMultiplier;
|
||||
var dataLength = (tooltipTicks === null || tooltipTicks === void 0 ? void 0 : tooltipTicks.length) || displayedData.length;
|
||||
if (dataLength === 0 || nextIndex >= dataLength || nextIndex < 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
var coordinate = selectCoordinateForDefaultIndex(currentState, tooltipEventType, 'hover', String(nextIndex));
|
||||
listenerApi.dispatch(setKeyboardInteraction({
|
||||
active: true,
|
||||
activeIndex: nextIndex.toString(),
|
||||
activeCoordinate: coordinate
|
||||
}));
|
||||
} finally {
|
||||
rafId = null;
|
||||
timeoutId = null;
|
||||
}
|
||||
};
|
||||
if (!isThrottled) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
if (throttleDelay === 'raf') {
|
||||
rafId = requestAnimationFrame(callback);
|
||||
} else if (typeof throttleDelay === 'number') {
|
||||
if (timeoutId === null) {
|
||||
callback();
|
||||
latestKeyboardActionPayload = null;
|
||||
timeoutId = setTimeout(() => {
|
||||
if (latestKeyboardActionPayload) {
|
||||
callback();
|
||||
} else {
|
||||
timeoutId = null;
|
||||
rafId = null;
|
||||
}
|
||||
}, throttleDelay);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
keyboardEventsMiddleware.startListening({
|
||||
actionCreator: focusAction,
|
||||
effect: (_action, listenerApi) => {
|
||||
var state = listenerApi.getState();
|
||||
var accessibilityLayerIsActive = state.rootProps.accessibilityLayer !== false;
|
||||
if (!accessibilityLayerIsActive) {
|
||||
return;
|
||||
}
|
||||
var keyboardInteraction = state.tooltip.keyboardInteraction;
|
||||
if (keyboardInteraction.active) {
|
||||
return;
|
||||
}
|
||||
if (keyboardInteraction.index == null) {
|
||||
var nextIndex = '0';
|
||||
var tooltipEventType = selectTooltipEventType(state, state.tooltip.settings.shared);
|
||||
var coordinate = selectCoordinateForDefaultIndex(state, tooltipEventType, 'hover', String(nextIndex));
|
||||
listenerApi.dispatch(setKeyboardInteraction({
|
||||
active: true,
|
||||
activeIndex: nextIndex,
|
||||
activeCoordinate: coordinate
|
||||
}));
|
||||
}
|
||||
}
|
||||
});
|
||||
keyboardEventsMiddleware.startListening({
|
||||
actionCreator: blurAction,
|
||||
effect: (_action, listenerApi) => {
|
||||
var state = listenerApi.getState();
|
||||
var accessibilityLayerIsActive = state.rootProps.accessibilityLayer !== false;
|
||||
if (!accessibilityLayerIsActive) {
|
||||
return;
|
||||
}
|
||||
var keyboardInteraction = state.tooltip.keyboardInteraction;
|
||||
if (keyboardInteraction.active) {
|
||||
listenerApi.dispatch(setKeyboardInteraction({
|
||||
active: false,
|
||||
activeIndex: keyboardInteraction.index,
|
||||
activeCoordinate: keyboardInteraction.coordinate
|
||||
}));
|
||||
}
|
||||
}
|
||||
});
|
||||
43
frontend/node_modules/recharts/es6/state/layoutSlice.js
generated
vendored
Normal file
43
frontend/node_modules/recharts/es6/state/layoutSlice.js
generated
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import { createSlice } from '@reduxjs/toolkit';
|
||||
var initialState = {
|
||||
layoutType: 'horizontal',
|
||||
width: 0,
|
||||
height: 0,
|
||||
margin: {
|
||||
top: 5,
|
||||
right: 5,
|
||||
bottom: 5,
|
||||
left: 5
|
||||
},
|
||||
scale: 1
|
||||
};
|
||||
var chartLayoutSlice = createSlice({
|
||||
name: 'chartLayout',
|
||||
initialState,
|
||||
reducers: {
|
||||
setLayout(state, action) {
|
||||
state.layoutType = action.payload;
|
||||
},
|
||||
setChartSize(state, action) {
|
||||
state.width = action.payload.width;
|
||||
state.height = action.payload.height;
|
||||
},
|
||||
setMargin(state, action) {
|
||||
var _action$payload$top, _action$payload$right, _action$payload$botto, _action$payload$left;
|
||||
state.margin.top = (_action$payload$top = action.payload.top) !== null && _action$payload$top !== void 0 ? _action$payload$top : 0;
|
||||
state.margin.right = (_action$payload$right = action.payload.right) !== null && _action$payload$right !== void 0 ? _action$payload$right : 0;
|
||||
state.margin.bottom = (_action$payload$botto = action.payload.bottom) !== null && _action$payload$botto !== void 0 ? _action$payload$botto : 0;
|
||||
state.margin.left = (_action$payload$left = action.payload.left) !== null && _action$payload$left !== void 0 ? _action$payload$left : 0;
|
||||
},
|
||||
setScale(state, action) {
|
||||
state.scale = action.payload;
|
||||
}
|
||||
}
|
||||
});
|
||||
var _chartLayoutSlice$act = chartLayoutSlice.actions,
|
||||
setMargin = _chartLayoutSlice$act.setMargin,
|
||||
setLayout = _chartLayoutSlice$act.setLayout,
|
||||
setChartSize = _chartLayoutSlice$act.setChartSize,
|
||||
setScale = _chartLayoutSlice$act.setScale;
|
||||
export { setMargin, setLayout, setChartSize, setScale };
|
||||
export var chartLayoutReducer = chartLayoutSlice.reducer;
|
||||
75
frontend/node_modules/recharts/es6/state/legendSlice.js
generated
vendored
Normal file
75
frontend/node_modules/recharts/es6/state/legendSlice.js
generated
vendored
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
import { createSlice, current, prepareAutoBatched } from '@reduxjs/toolkit';
|
||||
import { castDraft } from 'immer';
|
||||
|
||||
/**
|
||||
* The properties inside this state update independently of each other and quite often.
|
||||
* When selecting, never select the whole state because you are going to get
|
||||
* unnecessary re-renders. Select only the properties you need.
|
||||
*
|
||||
* This is why this state type is not exported - don't use it directly.
|
||||
*/
|
||||
|
||||
var initialState = {
|
||||
settings: {
|
||||
layout: 'horizontal',
|
||||
align: 'center',
|
||||
verticalAlign: 'bottom',
|
||||
itemSorter: 'value'
|
||||
},
|
||||
size: {
|
||||
width: 0,
|
||||
height: 0
|
||||
},
|
||||
payload: []
|
||||
};
|
||||
var legendSlice = createSlice({
|
||||
name: 'legend',
|
||||
initialState,
|
||||
reducers: {
|
||||
setLegendSize(state, action) {
|
||||
state.size.width = action.payload.width;
|
||||
state.size.height = action.payload.height;
|
||||
},
|
||||
setLegendSettings(state, action) {
|
||||
state.settings.align = action.payload.align;
|
||||
state.settings.layout = action.payload.layout;
|
||||
state.settings.verticalAlign = action.payload.verticalAlign;
|
||||
state.settings.itemSorter = action.payload.itemSorter;
|
||||
},
|
||||
addLegendPayload: {
|
||||
reducer(state, action) {
|
||||
state.payload.push(castDraft(action.payload));
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
replaceLegendPayload: {
|
||||
reducer(state, action) {
|
||||
var _action$payload = action.payload,
|
||||
prev = _action$payload.prev,
|
||||
next = _action$payload.next;
|
||||
var index = current(state).payload.indexOf(castDraft(prev));
|
||||
if (index > -1) {
|
||||
state.payload[index] = castDraft(next);
|
||||
}
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
removeLegendPayload: {
|
||||
reducer(state, action) {
|
||||
var index = current(state).payload.indexOf(castDraft(action.payload));
|
||||
if (index > -1) {
|
||||
state.payload.splice(index, 1);
|
||||
}
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
}
|
||||
}
|
||||
});
|
||||
var _legendSlice$actions = legendSlice.actions,
|
||||
setLegendSize = _legendSlice$actions.setLegendSize,
|
||||
setLegendSettings = _legendSlice$actions.setLegendSettings,
|
||||
addLegendPayload = _legendSlice$actions.addLegendPayload,
|
||||
replaceLegendPayload = _legendSlice$actions.replaceLegendPayload,
|
||||
removeLegendPayload = _legendSlice$actions.removeLegendPayload;
|
||||
export { setLegendSize, setLegendSettings, addLegendPayload, replaceLegendPayload, removeLegendPayload };
|
||||
export var legendReducer = legendSlice.reducer;
|
||||
109
frontend/node_modules/recharts/es6/state/mouseEventsMiddleware.js
generated
vendored
Normal file
109
frontend/node_modules/recharts/es6/state/mouseEventsMiddleware.js
generated
vendored
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
import { createAction, createListenerMiddleware } from '@reduxjs/toolkit';
|
||||
import { mouseLeaveChart, setMouseClickAxisIndex, setMouseOverAxisIndex } from './tooltipSlice';
|
||||
import { selectActivePropsFromChartPointer } from './selectors/selectActivePropsFromChartPointer';
|
||||
import { selectTooltipEventType } from './selectors/selectTooltipEventType';
|
||||
import { getRelativeCoordinate } from '../util/getRelativeCoordinate';
|
||||
export var mouseClickAction = createAction('mouseClick');
|
||||
export var mouseClickMiddleware = createListenerMiddleware();
|
||||
|
||||
// TODO: there's a bug here when you click the chart the activeIndex resets to zero
|
||||
mouseClickMiddleware.startListening({
|
||||
actionCreator: mouseClickAction,
|
||||
effect: (action, listenerApi) => {
|
||||
var mousePointer = action.payload;
|
||||
var activeProps = selectActivePropsFromChartPointer(listenerApi.getState(), getRelativeCoordinate(mousePointer));
|
||||
if ((activeProps === null || activeProps === void 0 ? void 0 : activeProps.activeIndex) != null) {
|
||||
listenerApi.dispatch(setMouseClickAxisIndex({
|
||||
activeIndex: activeProps.activeIndex,
|
||||
activeDataKey: undefined,
|
||||
activeCoordinate: activeProps.activeCoordinate
|
||||
}));
|
||||
}
|
||||
}
|
||||
});
|
||||
export var mouseMoveAction = createAction('mouseMove');
|
||||
export var mouseMoveMiddleware = createListenerMiddleware();
|
||||
|
||||
/*
|
||||
* This single rafId is safe because:
|
||||
* 1. Each chart has its own Redux store instance with its own middleware
|
||||
* 2. mouseMoveAction only fires from one DOM element (the chart wrapper)
|
||||
* 3. Rapid mousemove events from the same element SHOULD debounce - we only care about the latest position
|
||||
* This is different from externalEventsMiddleware which handles multiple event types
|
||||
* (click, mouseenter, mouseleave, etc.) that should NOT cancel each other.
|
||||
*/
|
||||
var rafId = null;
|
||||
var timeoutId = null;
|
||||
var latestChartPointer = null;
|
||||
mouseMoveMiddleware.startListening({
|
||||
actionCreator: mouseMoveAction,
|
||||
effect: (action, listenerApi) => {
|
||||
var mousePointer = action.payload;
|
||||
var state = listenerApi.getState();
|
||||
var _state$eventSettings = state.eventSettings,
|
||||
throttleDelay = _state$eventSettings.throttleDelay,
|
||||
throttledEvents = _state$eventSettings.throttledEvents;
|
||||
var isThrottled = throttledEvents === 'all' || (throttledEvents === null || throttledEvents === void 0 ? void 0 : throttledEvents.includes('mousemove'));
|
||||
|
||||
// Cancel any pending execution
|
||||
if (rafId !== null) {
|
||||
cancelAnimationFrame(rafId);
|
||||
rafId = null;
|
||||
}
|
||||
if (timeoutId !== null && (typeof throttleDelay !== 'number' || !isThrottled)) {
|
||||
clearTimeout(timeoutId);
|
||||
timeoutId = null;
|
||||
}
|
||||
|
||||
/*
|
||||
* Here it is important to resolve the chart pointer _before_ the callback,
|
||||
* because once we leave the current event loop, the mousePointer event object will lose
|
||||
* reference to currentTarget which getRelativeCoordinate uses.
|
||||
*/
|
||||
latestChartPointer = getRelativeCoordinate(mousePointer);
|
||||
var callback = () => {
|
||||
/*
|
||||
* Here we read a fresh state again inside the callback to ensure we have the latest state values
|
||||
* after any potential actions that may have been dispatched between the original event and this callback.
|
||||
*/
|
||||
var currentState = listenerApi.getState();
|
||||
var tooltipEventType = selectTooltipEventType(currentState, currentState.tooltip.settings.shared);
|
||||
if (!latestChartPointer) {
|
||||
rafId = null;
|
||||
timeoutId = null;
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* This functionality only applies to charts that have axes.
|
||||
* Graphical items have its own mouse events handling mechanism where they attach events directly to the items.
|
||||
*/
|
||||
if (tooltipEventType === 'axis') {
|
||||
var activeProps = selectActivePropsFromChartPointer(currentState, latestChartPointer);
|
||||
if ((activeProps === null || activeProps === void 0 ? void 0 : activeProps.activeIndex) != null) {
|
||||
listenerApi.dispatch(setMouseOverAxisIndex({
|
||||
activeIndex: activeProps.activeIndex,
|
||||
activeDataKey: undefined,
|
||||
activeCoordinate: activeProps.activeCoordinate
|
||||
}));
|
||||
} else {
|
||||
// this is needed to clear tooltip state when the mouse moves out of the inRange (svg - offset) function, but not yet out of the svg
|
||||
listenerApi.dispatch(mouseLeaveChart());
|
||||
}
|
||||
}
|
||||
rafId = null;
|
||||
timeoutId = null;
|
||||
};
|
||||
if (!isThrottled) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
if (throttleDelay === 'raf') {
|
||||
rafId = requestAnimationFrame(callback);
|
||||
} else if (typeof throttleDelay === 'number') {
|
||||
if (timeoutId === null) {
|
||||
timeoutId = setTimeout(callback, throttleDelay);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
43
frontend/node_modules/recharts/es6/state/optionsSlice.js
generated
vendored
Normal file
43
frontend/node_modules/recharts/es6/state/optionsSlice.js
generated
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import { createSlice } from '@reduxjs/toolkit';
|
||||
import { isNan } from '../util/DataUtils';
|
||||
|
||||
/**
|
||||
* These chart options are decided internally, by Recharts,
|
||||
* and will not change during the lifetime of the chart.
|
||||
*
|
||||
* Changing these options can be done by swapping the root element
|
||||
* which will make a brand-new Redux store.
|
||||
*
|
||||
* If you want to store options that can be changed by the user,
|
||||
* use UpdatableChartOptions in rootPropsSlice.ts.
|
||||
*/
|
||||
|
||||
export var arrayTooltipSearcher = (data, strIndex) => {
|
||||
if (!strIndex) return undefined;
|
||||
if (!Array.isArray(data)) return undefined;
|
||||
var numIndex = Number.parseInt(strIndex, 10);
|
||||
if (isNan(numIndex)) {
|
||||
return undefined;
|
||||
}
|
||||
return data[numIndex];
|
||||
};
|
||||
var initialState = {
|
||||
chartName: '',
|
||||
tooltipPayloadSearcher: () => undefined,
|
||||
eventEmitter: undefined,
|
||||
defaultTooltipEventType: 'axis'
|
||||
};
|
||||
var optionsSlice = createSlice({
|
||||
name: 'options',
|
||||
initialState,
|
||||
reducers: {
|
||||
createEventEmitter: state => {
|
||||
if (state.eventEmitter == null) {
|
||||
state.eventEmitter = Symbol('rechartsEventEmitter');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
export var optionsReducer = optionsSlice.reducer;
|
||||
var createEventEmitter = optionsSlice.actions.createEventEmitter;
|
||||
export { createEventEmitter };
|
||||
31
frontend/node_modules/recharts/es6/state/polarAxisSlice.js
generated
vendored
Normal file
31
frontend/node_modules/recharts/es6/state/polarAxisSlice.js
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import { createSlice } from '@reduxjs/toolkit';
|
||||
import { castDraft } from 'immer';
|
||||
var initialState = {
|
||||
radiusAxis: {},
|
||||
angleAxis: {}
|
||||
};
|
||||
var polarAxisSlice = createSlice({
|
||||
name: 'polarAxis',
|
||||
initialState,
|
||||
reducers: {
|
||||
addRadiusAxis(state, action) {
|
||||
state.radiusAxis[action.payload.id] = castDraft(action.payload);
|
||||
},
|
||||
removeRadiusAxis(state, action) {
|
||||
delete state.radiusAxis[action.payload.id];
|
||||
},
|
||||
addAngleAxis(state, action) {
|
||||
state.angleAxis[action.payload.id] = castDraft(action.payload);
|
||||
},
|
||||
removeAngleAxis(state, action) {
|
||||
delete state.angleAxis[action.payload.id];
|
||||
}
|
||||
}
|
||||
});
|
||||
var _polarAxisSlice$actio = polarAxisSlice.actions,
|
||||
addRadiusAxis = _polarAxisSlice$actio.addRadiusAxis,
|
||||
removeRadiusAxis = _polarAxisSlice$actio.removeRadiusAxis,
|
||||
addAngleAxis = _polarAxisSlice$actio.addAngleAxis,
|
||||
removeAngleAxis = _polarAxisSlice$actio.removeAngleAxis;
|
||||
export { addRadiusAxis, removeRadiusAxis, addAngleAxis, removeAngleAxis };
|
||||
export var polarAxisReducer = polarAxisSlice.reducer;
|
||||
24
frontend/node_modules/recharts/es6/state/polarOptionsSlice.js
generated
vendored
Normal file
24
frontend/node_modules/recharts/es6/state/polarOptionsSlice.js
generated
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import { createSlice } from '@reduxjs/toolkit';
|
||||
var initialState = null;
|
||||
var reducers = {
|
||||
updatePolarOptions: (state, action) => {
|
||||
if (state === null) {
|
||||
return action.payload;
|
||||
}
|
||||
state.startAngle = action.payload.startAngle;
|
||||
state.endAngle = action.payload.endAngle;
|
||||
state.cx = action.payload.cx;
|
||||
state.cy = action.payload.cy;
|
||||
state.innerRadius = action.payload.innerRadius;
|
||||
state.outerRadius = action.payload.outerRadius;
|
||||
return state;
|
||||
}
|
||||
};
|
||||
var polarOptionsSlice = createSlice({
|
||||
name: 'polarOptions',
|
||||
initialState,
|
||||
reducers
|
||||
});
|
||||
var updatePolarOptions = polarOptionsSlice.actions.updatePolarOptions;
|
||||
export { updatePolarOptions };
|
||||
export var polarOptionsReducer = polarOptionsSlice.reducer;
|
||||
12
frontend/node_modules/recharts/es6/state/reduxDevtoolsJsonStringifyReplacer.js
generated
vendored
Normal file
12
frontend/node_modules/recharts/es6/state/reduxDevtoolsJsonStringifyReplacer.js
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
export function reduxDevtoolsJsonStringifyReplacer(key, value) {
|
||||
if (value instanceof HTMLElement) {
|
||||
return "HTMLElement <".concat(value.tagName, " class=\"").concat(value.className, "\">");
|
||||
}
|
||||
if (value === window) {
|
||||
return 'global.window';
|
||||
}
|
||||
if (key === 'children' && typeof value === 'object' && value !== null) {
|
||||
return '<<CHILDREN>>';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
49
frontend/node_modules/recharts/es6/state/referenceElementsSlice.js
generated
vendored
Normal file
49
frontend/node_modules/recharts/es6/state/referenceElementsSlice.js
generated
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
import { createSlice, current } from '@reduxjs/toolkit';
|
||||
import { castDraft } from 'immer';
|
||||
var initialState = {
|
||||
dots: [],
|
||||
areas: [],
|
||||
lines: []
|
||||
};
|
||||
export var referenceElementsSlice = createSlice({
|
||||
name: 'referenceElements',
|
||||
initialState,
|
||||
reducers: {
|
||||
addDot: (state, action) => {
|
||||
state.dots.push(action.payload);
|
||||
},
|
||||
removeDot: (state, action) => {
|
||||
var index = current(state).dots.findIndex(dot => dot === action.payload);
|
||||
if (index !== -1) {
|
||||
state.dots.splice(index, 1);
|
||||
}
|
||||
},
|
||||
addArea: (state, action) => {
|
||||
state.areas.push(action.payload);
|
||||
},
|
||||
removeArea: (state, action) => {
|
||||
var index = current(state).areas.findIndex(area => area === action.payload);
|
||||
if (index !== -1) {
|
||||
state.areas.splice(index, 1);
|
||||
}
|
||||
},
|
||||
addLine: (state, action) => {
|
||||
state.lines.push(castDraft(action.payload));
|
||||
},
|
||||
removeLine: (state, action) => {
|
||||
var index = current(state).lines.findIndex(line => line === action.payload);
|
||||
if (index !== -1) {
|
||||
state.lines.splice(index, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
var _referenceElementsSli = referenceElementsSlice.actions,
|
||||
addDot = _referenceElementsSli.addDot,
|
||||
removeDot = _referenceElementsSli.removeDot,
|
||||
addArea = _referenceElementsSli.addArea,
|
||||
removeArea = _referenceElementsSli.removeArea,
|
||||
addLine = _referenceElementsSli.addLine,
|
||||
removeLine = _referenceElementsSli.removeLine;
|
||||
export { addDot, removeDot, addArea, removeArea, addLine, removeLine };
|
||||
export var referenceElementsReducer = referenceElementsSlice.reducer;
|
||||
39
frontend/node_modules/recharts/es6/state/renderedTicksSlice.js
generated
vendored
Normal file
39
frontend/node_modules/recharts/es6/state/renderedTicksSlice.js
generated
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/**
|
||||
* @fileOverview this stores actually rendered ticks.
|
||||
*
|
||||
* What we do is that we have the domain -> ticks mapping in the cartesianSlice,
|
||||
* which is fine but the result then goes to CartesianAxis where we use DOM measurement
|
||||
* to decide which ticks to actually render.
|
||||
*
|
||||
* This renderedTickSlice stores those actually rendered ticks so that we can return them from a hook later.
|
||||
*/
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
import { castDraft } from 'immer';
|
||||
var initialState = {
|
||||
xAxis: {},
|
||||
yAxis: {}
|
||||
};
|
||||
export var renderedTicksSlice = createSlice({
|
||||
name: 'renderedTicks',
|
||||
initialState,
|
||||
reducers: {
|
||||
setRenderedTicks: (state, action) => {
|
||||
var _action$payload = action.payload,
|
||||
axisType = _action$payload.axisType,
|
||||
axisId = _action$payload.axisId,
|
||||
ticks = _action$payload.ticks;
|
||||
state[axisType][axisId] = castDraft(ticks);
|
||||
},
|
||||
removeRenderedTicks: (state, action) => {
|
||||
var _action$payload2 = action.payload,
|
||||
axisType = _action$payload2.axisType,
|
||||
axisId = _action$payload2.axisId;
|
||||
delete state[axisType][axisId];
|
||||
}
|
||||
}
|
||||
});
|
||||
var _renderedTicksSlice$a = renderedTicksSlice.actions,
|
||||
setRenderedTicks = _renderedTicksSlice$a.setRenderedTicks,
|
||||
removeRenderedTicks = _renderedTicksSlice$a.removeRenderedTicks;
|
||||
export { setRenderedTicks, removeRenderedTicks };
|
||||
export var renderedTicksReducer = renderedTicksSlice.reducer;
|
||||
43
frontend/node_modules/recharts/es6/state/rootPropsSlice.js
generated
vendored
Normal file
43
frontend/node_modules/recharts/es6/state/rootPropsSlice.js
generated
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import { createSlice } from '@reduxjs/toolkit';
|
||||
|
||||
/**
|
||||
* These are chart options that users can choose - which means they can also
|
||||
* choose to change them which should trigger a re-render.
|
||||
*/
|
||||
|
||||
export var initialState = {
|
||||
accessibilityLayer: true,
|
||||
barCategoryGap: '10%',
|
||||
barGap: 4,
|
||||
barSize: undefined,
|
||||
className: undefined,
|
||||
maxBarSize: undefined,
|
||||
stackOffset: 'none',
|
||||
syncId: undefined,
|
||||
syncMethod: 'index',
|
||||
baseValue: undefined,
|
||||
reverseStackOrder: false
|
||||
};
|
||||
var rootPropsSlice = createSlice({
|
||||
name: 'rootProps',
|
||||
initialState,
|
||||
reducers: {
|
||||
updateOptions: (state, action) => {
|
||||
var _action$payload$barGa;
|
||||
state.accessibilityLayer = action.payload.accessibilityLayer;
|
||||
state.barCategoryGap = action.payload.barCategoryGap;
|
||||
state.barGap = (_action$payload$barGa = action.payload.barGap) !== null && _action$payload$barGa !== void 0 ? _action$payload$barGa : initialState.barGap;
|
||||
state.barSize = action.payload.barSize;
|
||||
state.maxBarSize = action.payload.maxBarSize;
|
||||
state.stackOffset = action.payload.stackOffset;
|
||||
state.syncId = action.payload.syncId;
|
||||
state.syncMethod = action.payload.syncMethod;
|
||||
state.className = action.payload.className;
|
||||
state.baseValue = action.payload.baseValue;
|
||||
state.reverseStackOrder = action.payload.reverseStackOrder;
|
||||
}
|
||||
}
|
||||
});
|
||||
export var rootPropsReducer = rootPropsSlice.reducer;
|
||||
var updateOptions = rootPropsSlice.actions.updateOptions;
|
||||
export { updateOptions };
|
||||
92
frontend/node_modules/recharts/es6/state/selectors/areaSelectors.js
generated
vendored
Normal file
92
frontend/node_modules/recharts/es6/state/selectors/areaSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
import { createSelector } from 'reselect';
|
||||
import { computeArea } from '../../cartesian/Area';
|
||||
import { selectAxisWithScale, selectStackGroups, selectTicksOfGraphicalItem, selectUnfilteredCartesianItems } from './axisSelectors';
|
||||
import { selectChartLayout } from '../../context/chartLayoutContext';
|
||||
import { selectChartDataWithIndexesIfNotInPanoramaPosition3 } from './dataSelectors';
|
||||
import { getBandSizeOfAxis, isCategoricalAxis } from '../../util/ChartUtils';
|
||||
import { getStackSeriesIdentifier } from '../../util/stacks/getStackSeriesIdentifier';
|
||||
import { selectChartBaseValue } from './rootPropsSelectors';
|
||||
import { selectXAxisIdFromGraphicalItemId, selectYAxisIdFromGraphicalItemId } from './graphicalItemSelectors';
|
||||
var selectXAxisWithScale = (state, graphicalItemId, isPanorama) => selectAxisWithScale(state, 'xAxis', selectXAxisIdFromGraphicalItemId(state, graphicalItemId), isPanorama);
|
||||
var selectXAxisTicks = (state, graphicalItemId, isPanorama) => selectTicksOfGraphicalItem(state, 'xAxis', selectXAxisIdFromGraphicalItemId(state, graphicalItemId), isPanorama);
|
||||
var selectYAxisWithScale = (state, graphicalItemId, isPanorama) => selectAxisWithScale(state, 'yAxis', selectYAxisIdFromGraphicalItemId(state, graphicalItemId), isPanorama);
|
||||
var selectYAxisTicks = (state, graphicalItemId, isPanorama) => selectTicksOfGraphicalItem(state, 'yAxis', selectYAxisIdFromGraphicalItemId(state, graphicalItemId), isPanorama);
|
||||
var selectBandSize = createSelector([selectChartLayout, selectXAxisWithScale, selectYAxisWithScale, selectXAxisTicks, selectYAxisTicks], (layout, xAxis, yAxis, xAxisTicks, yAxisTicks) => {
|
||||
if (isCategoricalAxis(layout, 'xAxis')) {
|
||||
return getBandSizeOfAxis(xAxis, xAxisTicks, false);
|
||||
}
|
||||
return 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 = createSelector([selectUnfilteredCartesianItems, pickAreaId], (graphicalItems, id) => graphicalItems.filter(item => item.type === 'area').find(item => item.id === id));
|
||||
var selectNumericalAxisType = state => {
|
||||
var layout = selectChartLayout(state);
|
||||
var isXAxisCategorical = isCategoricalAxis(layout, 'xAxis');
|
||||
return isXAxisCategorical ? 'yAxis' : 'xAxis';
|
||||
};
|
||||
var selectNumericalAxisIdFromGraphicalItemId = (state, graphicalItemId) => {
|
||||
var axisType = selectNumericalAxisType(state);
|
||||
if (axisType === 'yAxis') {
|
||||
return selectYAxisIdFromGraphicalItemId(state, graphicalItemId);
|
||||
}
|
||||
return selectXAxisIdFromGraphicalItemId(state, graphicalItemId);
|
||||
};
|
||||
var selectNumericalAxisStackGroups = (state, graphicalItemId, isPanorama) => selectStackGroups(state, selectNumericalAxisType(state), selectNumericalAxisIdFromGraphicalItemId(state, graphicalItemId), isPanorama);
|
||||
export var selectGraphicalItemStackedData = createSelector([selectSynchronisedAreaSettings, selectNumericalAxisStackGroups], (areaSettings, stackGroups) => {
|
||||
var _stackGroups$stackId;
|
||||
if (areaSettings == null || stackGroups == null) {
|
||||
return undefined;
|
||||
}
|
||||
var stackId = areaSettings.stackId;
|
||||
var stackSeriesIdentifier = 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]]);
|
||||
});
|
||||
export var selectArea = createSelector([selectChartLayout, selectXAxisWithScale, selectYAxisWithScale, selectXAxisTicks, selectYAxisTicks, selectGraphicalItemStackedData, selectChartDataWithIndexesIfNotInPanoramaPosition3, selectBandSize, selectSynchronisedAreaSettings, 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 computeArea({
|
||||
layout,
|
||||
xAxis,
|
||||
yAxis,
|
||||
xAxisTicks,
|
||||
yAxisTicks,
|
||||
dataStartIndex,
|
||||
areaSettings,
|
||||
stackedData,
|
||||
displayedData,
|
||||
chartBaseValue,
|
||||
bandSize
|
||||
});
|
||||
});
|
||||
30
frontend/node_modules/recharts/es6/state/selectors/arrayEqualityCheck.js
generated
vendored
Normal file
30
frontend/node_modules/recharts/es6/state/selectors/arrayEqualityCheck.js
generated
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
/**
|
||||
* 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
|
||||
*/
|
||||
export 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
|
||||
*/
|
||||
export 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;
|
||||
}
|
||||
1446
frontend/node_modules/recharts/es6/state/selectors/axisSelectors.js
generated
vendored
Normal file
1446
frontend/node_modules/recharts/es6/state/selectors/axisSelectors.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
157
frontend/node_modules/recharts/es6/state/selectors/barSelectors.js
generated
vendored
Normal file
157
frontend/node_modules/recharts/es6/state/selectors/barSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
import { createSelector } from 'reselect';
|
||||
import { selectAxisWithScale, selectCartesianAxisSize, selectStackGroups, selectTicksOfGraphicalItem, selectUnfilteredCartesianItems } from './axisSelectors';
|
||||
import { isNullish } from '../../util/DataUtils';
|
||||
import { getBandSizeOfAxis } from '../../util/ChartUtils';
|
||||
import { computeBarRectangles } from '../../cartesian/Bar';
|
||||
import { selectChartLayout } from '../../context/chartLayoutContext';
|
||||
import { selectChartDataWithIndexesIfNotInPanoramaPosition3 } from './dataSelectors';
|
||||
import { selectAxisViewBox, selectChartOffsetInternal } from './selectChartOffsetInternal';
|
||||
import { selectBarCategoryGap, selectBarGap, selectRootBarSize, selectRootMaxBarSize } from './rootPropsSelectors';
|
||||
import { combineBarSizeList } from './combiners/combineBarSizeList';
|
||||
import { combineAllBarPositions } from './combiners/combineAllBarPositions';
|
||||
import { combineStackedData } from './combiners/combineStackedData';
|
||||
import { selectXAxisIdFromGraphicalItemId, selectYAxisIdFromGraphicalItemId } from './graphicalItemSelectors';
|
||||
import { combineBarPosition } from './combiners/combineBarPosition';
|
||||
var pickIsPanorama = (_state, _id, isPanorama) => isPanorama;
|
||||
var pickBarId = (_state, id) => id;
|
||||
var selectSynchronisedBarSettings = createSelector([selectUnfilteredCartesianItems, pickBarId], (graphicalItems, id) => graphicalItems.filter(item => item.type === 'bar').find(item => item.id === id));
|
||||
export var selectMaxBarSize = createSelector([selectSynchronisedBarSettings], barSettings => barSettings === null || barSettings === void 0 ? void 0 : barSettings.maxBarSize);
|
||||
var pickCells = (_state, _id, _isPanorama, cells) => cells;
|
||||
export var selectAllVisibleBars = createSelector([selectChartLayout, selectUnfilteredCartesianItems, selectXAxisIdFromGraphicalItemId, 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 = selectChartLayout(state);
|
||||
var xAxisId = selectXAxisIdFromGraphicalItemId(state, id);
|
||||
var yAxisId = selectYAxisIdFromGraphicalItemId(state, id);
|
||||
if (xAxisId == null || yAxisId == null) {
|
||||
return undefined;
|
||||
}
|
||||
if (layout === 'horizontal') {
|
||||
return selectStackGroups(state, 'yAxis', yAxisId, isPanorama);
|
||||
}
|
||||
return selectStackGroups(state, 'xAxis', xAxisId, isPanorama);
|
||||
};
|
||||
export var selectBarCartesianAxisSize = (state, id) => {
|
||||
var layout = selectChartLayout(state);
|
||||
var xAxisId = selectXAxisIdFromGraphicalItemId(state, id);
|
||||
var yAxisId = selectYAxisIdFromGraphicalItemId(state, id);
|
||||
if (xAxisId == null || yAxisId == null) {
|
||||
return undefined;
|
||||
}
|
||||
if (layout === 'horizontal') {
|
||||
return selectCartesianAxisSize(state, 'xAxis', xAxisId);
|
||||
}
|
||||
return selectCartesianAxisSize(state, 'yAxis', yAxisId);
|
||||
};
|
||||
export var selectBarSizeList = createSelector([selectAllVisibleBars, selectRootBarSize, selectBarCartesianAxisSize], combineBarSizeList);
|
||||
export var selectBarBandSize = (state, id, isPanorama) => {
|
||||
var _ref, _getBandSizeOfAxis;
|
||||
var barSettings = selectSynchronisedBarSettings(state, id);
|
||||
if (barSettings == null) {
|
||||
return 0;
|
||||
}
|
||||
var xAxisId = selectXAxisIdFromGraphicalItemId(state, id);
|
||||
var yAxisId = selectYAxisIdFromGraphicalItemId(state, id);
|
||||
if (xAxisId == null || yAxisId == null) {
|
||||
return 0;
|
||||
}
|
||||
var layout = selectChartLayout(state);
|
||||
var globalMaxBarSize = selectRootMaxBarSize(state);
|
||||
var childMaxBarSize = barSettings.maxBarSize;
|
||||
var maxBarSize = isNullish(childMaxBarSize) ? globalMaxBarSize : childMaxBarSize;
|
||||
var axis, ticks;
|
||||
if (layout === 'horizontal') {
|
||||
axis = selectAxisWithScale(state, 'xAxis', xAxisId, isPanorama);
|
||||
ticks = selectTicksOfGraphicalItem(state, 'xAxis', xAxisId, isPanorama);
|
||||
} else {
|
||||
axis = selectAxisWithScale(state, 'yAxis', yAxisId, isPanorama);
|
||||
ticks = selectTicksOfGraphicalItem(state, 'yAxis', yAxisId, isPanorama);
|
||||
}
|
||||
return (_ref = (_getBandSizeOfAxis = getBandSizeOfAxis(axis, ticks, true)) !== null && _getBandSizeOfAxis !== void 0 ? _getBandSizeOfAxis : maxBarSize) !== null && _ref !== void 0 ? _ref : 0;
|
||||
};
|
||||
export var selectAxisBandSize = (state, id, isPanorama) => {
|
||||
var layout = selectChartLayout(state);
|
||||
var xAxisId = selectXAxisIdFromGraphicalItemId(state, id);
|
||||
var yAxisId = selectYAxisIdFromGraphicalItemId(state, id);
|
||||
if (xAxisId == null || yAxisId == null) {
|
||||
return undefined;
|
||||
}
|
||||
var axis, ticks;
|
||||
if (layout === 'horizontal') {
|
||||
axis = selectAxisWithScale(state, 'xAxis', xAxisId, isPanorama);
|
||||
ticks = selectTicksOfGraphicalItem(state, 'xAxis', xAxisId, isPanorama);
|
||||
} else {
|
||||
axis = selectAxisWithScale(state, 'yAxis', yAxisId, isPanorama);
|
||||
ticks = selectTicksOfGraphicalItem(state, 'yAxis', yAxisId, isPanorama);
|
||||
}
|
||||
return getBandSizeOfAxis(axis, ticks);
|
||||
};
|
||||
export var selectAllBarPositions = createSelector([selectBarSizeList, selectRootMaxBarSize, selectBarGap, selectBarCategoryGap, selectBarBandSize, selectAxisBandSize, selectMaxBarSize], combineAllBarPositions);
|
||||
var selectXAxisWithScale = (state, id, isPanorama) => {
|
||||
var xAxisId = selectXAxisIdFromGraphicalItemId(state, id);
|
||||
if (xAxisId == null) {
|
||||
return undefined;
|
||||
}
|
||||
return selectAxisWithScale(state, 'xAxis', xAxisId, isPanorama);
|
||||
};
|
||||
var selectYAxisWithScale = (state, id, isPanorama) => {
|
||||
var yAxisId = selectYAxisIdFromGraphicalItemId(state, id);
|
||||
if (yAxisId == null) {
|
||||
return undefined;
|
||||
}
|
||||
return selectAxisWithScale(state, 'yAxis', yAxisId, isPanorama);
|
||||
};
|
||||
var selectXAxisTicks = (state, id, isPanorama) => {
|
||||
var xAxisId = selectXAxisIdFromGraphicalItemId(state, id);
|
||||
if (xAxisId == null) {
|
||||
return undefined;
|
||||
}
|
||||
return selectTicksOfGraphicalItem(state, 'xAxis', xAxisId, isPanorama);
|
||||
};
|
||||
var selectYAxisTicks = (state, id, isPanorama) => {
|
||||
var yAxisId = selectYAxisIdFromGraphicalItemId(state, id);
|
||||
if (yAxisId == null) {
|
||||
return undefined;
|
||||
}
|
||||
return selectTicksOfGraphicalItem(state, 'yAxis', yAxisId, isPanorama);
|
||||
};
|
||||
export var selectBarPosition = createSelector([selectAllBarPositions, selectSynchronisedBarSettings], combineBarPosition);
|
||||
export var selectStackedDataOfItem = createSelector([selectBarStackGroups, selectSynchronisedBarSettings], combineStackedData);
|
||||
export var selectBarRectangles = createSelector([selectChartOffsetInternal, selectAxisViewBox, selectXAxisWithScale, selectYAxisWithScale, selectXAxisTicks, selectYAxisTicks, selectBarPosition, selectChartLayout, 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 computeBarRectangles({
|
||||
layout,
|
||||
barSettings,
|
||||
pos,
|
||||
parentViewBox: axisViewBox,
|
||||
bandSize,
|
||||
xAxis,
|
||||
yAxis,
|
||||
xAxisTicks,
|
||||
yAxisTicks,
|
||||
stackedData,
|
||||
displayedData,
|
||||
offset,
|
||||
cells,
|
||||
dataStartIndex
|
||||
});
|
||||
});
|
||||
51
frontend/node_modules/recharts/es6/state/selectors/barStackSelectors.js
generated
vendored
Normal file
51
frontend/node_modules/recharts/es6/state/selectors/barStackSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
import { createSelector } from 'reselect';
|
||||
import { selectUnfilteredCartesianItems } from './axisSelectors';
|
||||
import { selectBarRectangles } from './barSelectors';
|
||||
var pickStackId = (state, stackId) => stackId;
|
||||
var pickIsPanorama = (state, stackId, isPanorama) => isPanorama;
|
||||
export var selectAllBarsInStack = createSelector([pickStackId, 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 = 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
|
||||
*/
|
||||
export 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
|
||||
};
|
||||
};
|
||||
var combineStackRects = (state, stackId, isPanorama) => {
|
||||
var allBarIds = selectAllBarIdsInStack(state, stackId, isPanorama);
|
||||
var stackRects = [];
|
||||
allBarIds.forEach(barId => {
|
||||
var rectangles = 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;
|
||||
};
|
||||
export var selectStackRects = createSelector([state => state, pickStackId, pickIsPanorama], combineStackRects);
|
||||
11
frontend/node_modules/recharts/es6/state/selectors/brushSelectors.js
generated
vendored
Normal file
11
frontend/node_modules/recharts/es6/state/selectors/brushSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { createSelector } from 'reselect';
|
||||
import { selectChartOffsetInternal } from './selectChartOffsetInternal';
|
||||
import { selectMargin } from './containerSelectors';
|
||||
import { isNumber } from '../../util/DataUtils';
|
||||
export var selectBrushSettings = state => state.brush;
|
||||
export var selectBrushDimensions = createSelector([selectBrushSettings, selectChartOffsetInternal, selectMargin], (brushSettings, offset, margin) => ({
|
||||
height: brushSettings.height,
|
||||
x: isNumber(brushSettings.x) ? brushSettings.x : offset.left,
|
||||
y: isNumber(brushSettings.y) ? brushSettings.y : offset.top + offset.height + offset.brushBottom - ((margin === null || margin === void 0 ? void 0 : margin.bottom) || 0),
|
||||
width: isNumber(brushSettings.width) ? brushSettings.width : offset.width
|
||||
}));
|
||||
9
frontend/node_modules/recharts/es6/state/selectors/combiners/combineActiveLabel.js
generated
vendored
Normal file
9
frontend/node_modules/recharts/es6/state/selectors/combiners/combineActiveLabel.js
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { isNan } from '../../../util/DataUtils';
|
||||
export var combineActiveLabel = (tooltipTicks, activeIndex) => {
|
||||
var _tooltipTicks$n;
|
||||
var n = Number(activeIndex);
|
||||
if (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;
|
||||
};
|
||||
70
frontend/node_modules/recharts/es6/state/selectors/combiners/combineActiveTooltipIndex.js
generated
vendored
Normal file
70
frontend/node_modules/recharts/es6/state/selectors/combiners/combineActiveTooltipIndex.js
generated
vendored
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
import { isWellBehavedNumber } from '../../../util/isWellBehavedNumber';
|
||||
import { getValueByDataKey } from '../../../util/ChartUtils';
|
||||
import { isWellFormedNumberDomain } from '../../../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 = getValueByDataKey(entry, axisDataKey);
|
||||
if (value == null) {
|
||||
return true;
|
||||
}
|
||||
if (!isWellFormedNumberDomain(domain)) {
|
||||
return true;
|
||||
}
|
||||
return isValueWithinNumberDomain(value, domain);
|
||||
}
|
||||
export 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 (!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);
|
||||
};
|
||||
85
frontend/node_modules/recharts/es6/state/selectors/combiners/combineAllBarPositions.js
generated
vendored
Normal file
85
frontend/node_modules/recharts/es6/state/selectors/combiners/combineAllBarPositions.js
generated
vendored
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
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); }
|
||||
import { getPercentValue, isNullish } from '../../../util/DataUtils';
|
||||
import { isWellBehavedNumber } from '../../../util/isWellBehavedNumber';
|
||||
function getBarPositions(barGap, barCategoryGap, bandSize, sizeList, maxBarSize) {
|
||||
var _sizeList$;
|
||||
var len = sizeList.length;
|
||||
if (len < 1) {
|
||||
return undefined;
|
||||
}
|
||||
var realBarGap = 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 (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 = 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 = 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;
|
||||
}
|
||||
export var combineAllBarPositions = (sizeList, globalMaxBarSize, barGap, barCategoryGap, barBandSize, bandSize, childMaxBarSize) => {
|
||||
var maxBarSize = 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;
|
||||
};
|
||||
9
frontend/node_modules/recharts/es6/state/selectors/combiners/combineAxisRangeWithReverse.js
generated
vendored
Normal file
9
frontend/node_modules/recharts/es6/state/selectors/combiners/combineAxisRangeWithReverse.js
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
export var combineAxisRangeWithReverse = (axisSettings, axisRange) => {
|
||||
if (!axisSettings || !axisRange) {
|
||||
return undefined;
|
||||
}
|
||||
if (axisSettings !== null && axisSettings !== void 0 && axisSettings.reversed) {
|
||||
return [axisRange[1], axisRange[0]];
|
||||
}
|
||||
return axisRange;
|
||||
};
|
||||
10
frontend/node_modules/recharts/es6/state/selectors/combiners/combineBarPosition.js
generated
vendored
Normal file
10
frontend/node_modules/recharts/es6/state/selectors/combiners/combineBarPosition.js
generated
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
export 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;
|
||||
};
|
||||
52
frontend/node_modules/recharts/es6/state/selectors/combiners/combineBarSizeList.js
generated
vendored
Normal file
52
frontend/node_modules/recharts/es6/state/selectors/combiners/combineBarSizeList.js
generated
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
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; }
|
||||
import { isStacked } from '../../types/StackedGraphicalItem';
|
||||
import { getPercentValue, isNullish } from '../../../util/DataUtils';
|
||||
var getBarSize = (globalSize, totalSize, selfSize) => {
|
||||
var barSize = selfSize !== null && selfSize !== void 0 ? selfSize : globalSize;
|
||||
if (isNullish(barSize)) {
|
||||
return undefined;
|
||||
}
|
||||
return getPercentValue(barSize, totalSize, 0);
|
||||
};
|
||||
export var combineBarSizeList = (allBars, globalSize, totalSize) => {
|
||||
var initialValue = {};
|
||||
var stackedBars = allBars.filter(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];
|
||||
};
|
||||
43
frontend/node_modules/recharts/es6/state/selectors/combiners/combineCheckedDomain.js
generated
vendored
Normal file
43
frontend/node_modules/recharts/es6/state/selectors/combiners/combineCheckedDomain.js
generated
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import { isWellFormedNumberDomain } from '../../../util/isDomainSpecifiedByUser';
|
||||
import { isWellBehavedNumber } from '../../../util/isWellBehavedNumber';
|
||||
|
||||
/**
|
||||
* This function validates and transforms the axis domain so that it is safe to use in the provided scale.
|
||||
*/
|
||||
export 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 (!isWellFormedNumberDomain(axisDomain)) {
|
||||
var min, max;
|
||||
for (var i = 0; i < axisDomain.length; i++) {
|
||||
var value = axisDomain[i];
|
||||
if (!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;
|
||||
}
|
||||
};
|
||||
44
frontend/node_modules/recharts/es6/state/selectors/combiners/combineConfiguredScale.js
generated
vendored
Normal file
44
frontend/node_modules/recharts/es6/state/selectors/combiners/combineConfiguredScale.js
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import * as d3Scales from 'victory-vendor/d3-scale';
|
||||
import { upperFirst } from '../../../util/DataUtils';
|
||||
function getD3ScaleFromType(realScaleType) {
|
||||
var scales = d3Scales;
|
||||
if (realScaleType in scales && typeof scales[realScaleType] === 'function') {
|
||||
return scales[realScaleType]();
|
||||
}
|
||||
var name = "scale".concat(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
|
||||
*/
|
||||
|
||||
export 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;
|
||||
}
|
||||
export 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);
|
||||
}
|
||||
36
frontend/node_modules/recharts/es6/state/selectors/combiners/combineCoordinateForDefaultIndex.js
generated
vendored
Normal file
36
frontend/node_modules/recharts/es6/state/selectors/combiners/combineCoordinateForDefaultIndex.js
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
export 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
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
48
frontend/node_modules/recharts/es6/state/selectors/combiners/combineDisplayedStackedData.js
generated
vendored
Normal file
48
frontend/node_modules/recharts/es6/state/selectors/combiners/combineDisplayedStackedData.js
generated
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
import { getStackSeriesIdentifier } from '../../../util/stacks/getStackSeriesIdentifier';
|
||||
import { getValueByDataKey } from '../../../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.
|
||||
*/
|
||||
|
||||
export 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 = getStackSeriesIdentifier(item);
|
||||
resolvedData.forEach((entry, index) => {
|
||||
var tooltipValue = tooltipDataKey == null || allowDuplicatedCategory ? index : String(getValueByDataKey(entry, tooltipDataKey, null));
|
||||
var numericValue = 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());
|
||||
}
|
||||
10
frontend/node_modules/recharts/es6/state/selectors/combiners/combineInverseScaleFunction.js
generated
vendored
Normal file
10
frontend/node_modules/recharts/es6/state/selectors/combiners/combineInverseScaleFunction.js
generated
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { createCategoricalInverse } from '../../../util/scale/createCategoricalInverse';
|
||||
export function combineInverseScaleFunction(configuredScale) {
|
||||
if (configuredScale == null) {
|
||||
return undefined;
|
||||
}
|
||||
if ('invert' in configuredScale && typeof configuredScale.invert === 'function') {
|
||||
return configuredScale.invert.bind(configuredScale);
|
||||
}
|
||||
return createCategoricalInverse(configuredScale, undefined);
|
||||
}
|
||||
28
frontend/node_modules/recharts/es6/state/selectors/combiners/combineRealScaleType.js
generated
vendored
Normal file
28
frontend/node_modules/recharts/es6/state/selectors/combiners/combineRealScaleType.js
generated
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import * as d3Scales from 'victory-vendor/d3-scale';
|
||||
import { upperFirst } from '../../../util/DataUtils';
|
||||
function getD3ScaleName(name) {
|
||||
return "scale".concat(upperFirst(name));
|
||||
}
|
||||
function isSupportedScaleName(name) {
|
||||
return getD3ScaleName(name) in d3Scales;
|
||||
}
|
||||
export 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;
|
||||
};
|
||||
20
frontend/node_modules/recharts/es6/state/selectors/combiners/combineStackedData.js
generated
vendored
Normal file
20
frontend/node_modules/recharts/es6/state/selectors/combiners/combineStackedData.js
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { getStackSeriesIdentifier } from '../../../util/stacks/getStackSeriesIdentifier';
|
||||
export var combineStackedData = (stackGroups, barSettings) => {
|
||||
var stackSeriesIdentifier = 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);
|
||||
};
|
||||
58
frontend/node_modules/recharts/es6/state/selectors/combiners/combineTooltipInteractionState.js
generated
vendored
Normal file
58
frontend/node_modules/recharts/es6/state/selectors/combiners/combineTooltipInteractionState.js
generated
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
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); }
|
||||
import { noInteraction } from '../../tooltipSlice';
|
||||
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;
|
||||
}
|
||||
export var combineTooltipInteractionState = (tooltipState, tooltipEventType, trigger, defaultIndex) => {
|
||||
if (tooltipEventType == null) {
|
||||
return noInteraction;
|
||||
}
|
||||
var appropriateMouseInteraction = chooseAppropriateMouseInteraction(tooltipState, tooltipEventType, trigger);
|
||||
if (appropriateMouseInteraction == null) {
|
||||
return 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({}, noInteraction), {}, {
|
||||
coordinate: appropriateMouseInteraction.coordinate
|
||||
});
|
||||
};
|
||||
155
frontend/node_modules/recharts/es6/state/selectors/combiners/combineTooltipPayload.js
generated
vendored
Normal file
155
frontend/node_modules/recharts/es6/state/selectors/combiners/combineTooltipPayload.js
generated
vendored
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
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); }
|
||||
import { findEntryInArray } from '../../../util/DataUtils';
|
||||
import { getTooltipEntry, getValueByDataKey } from '../../../util/ChartUtils';
|
||||
import { getSliced } from '../../../util/getSliced';
|
||||
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;
|
||||
}
|
||||
export 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) ? 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 = 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(getTooltipEntry({
|
||||
tooltipEntrySettings: newSettings,
|
||||
dataKey: itemDataKey,
|
||||
payload: itemPayload,
|
||||
value: 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(getTooltipEntry({
|
||||
tooltipEntrySettings: settings,
|
||||
dataKey: finalDataKey,
|
||||
payload: tooltipPayload,
|
||||
// getValueByDataKey does not validate the output type
|
||||
value: getValueByDataKey(tooltipPayload, finalDataKey),
|
||||
// getValueByDataKey does not validate the output type
|
||||
name: (_getValueByDataKey = getValueByDataKey(tooltipPayload, finalNameKey)) !== null && _getValueByDataKey !== void 0 ? _getValueByDataKey : settings === null || settings === void 0 ? void 0 : settings.name
|
||||
}));
|
||||
}
|
||||
return agg;
|
||||
}, init);
|
||||
};
|
||||
45
frontend/node_modules/recharts/es6/state/selectors/combiners/combineTooltipPayloadConfigurations.js
generated
vendored
Normal file
45
frontend/node_modules/recharts/es6/state/selectors/combiners/combineTooltipPayloadConfigurations.js
generated
vendored
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
export 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;
|
||||
});
|
||||
};
|
||||
4
frontend/node_modules/recharts/es6/state/selectors/containerSelectors.js
generated
vendored
Normal file
4
frontend/node_modules/recharts/es6/state/selectors/containerSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
export var selectChartWidth = state => state.layout.width;
|
||||
export var selectChartHeight = state => state.layout.height;
|
||||
export var selectContainerScale = state => state.layout.scale;
|
||||
export var selectMargin = state => state.layout.margin;
|
||||
78
frontend/node_modules/recharts/es6/state/selectors/dataSelectors.js
generated
vendored
Normal file
78
frontend/node_modules/recharts/es6/state/selectors/dataSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
import { createSelector } from '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
|
||||
*/
|
||||
export 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.
|
||||
*/
|
||||
export var selectChartDataAndAlwaysIgnoreIndexes = createSelector([selectChartDataWithIndexes], dataState => {
|
||||
var dataEndIndex = dataState.chartData != null ? dataState.chartData.length - 1 : 0;
|
||||
return {
|
||||
chartData: dataState.chartData,
|
||||
computedData: dataState.computedData,
|
||||
dataEndIndex,
|
||||
dataStartIndex: 0
|
||||
};
|
||||
});
|
||||
export var selectChartDataWithIndexesIfNotInPanoramaPosition4 = (state, _unused1, _unused2, isPanorama) => {
|
||||
if (isPanorama) {
|
||||
return selectChartDataAndAlwaysIgnoreIndexes(state);
|
||||
}
|
||||
return selectChartDataWithIndexes(state);
|
||||
};
|
||||
export 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.
|
||||
*/
|
||||
export var selectChartDataSliceIfNotInPanorama = 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.
|
||||
*/
|
||||
export var selectChartDataSliceIgnoringIndexes = 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.
|
||||
*/
|
||||
export var selectChartDataSliceWithIndexes = createSelector([selectChartDataWithIndexes], _ref3 => {
|
||||
var chartData = _ref3.chartData,
|
||||
dataStartIndex = _ref3.dataStartIndex,
|
||||
dataEndIndex = _ref3.dataEndIndex;
|
||||
return chartData != null ? chartData.slice(dataStartIndex, dataEndIndex + 1) : [];
|
||||
});
|
||||
49
frontend/node_modules/recharts/es6/state/selectors/funnelSelectors.js
generated
vendored
Normal file
49
frontend/node_modules/recharts/es6/state/selectors/funnelSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
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); }
|
||||
import { createSelector } from 'reselect';
|
||||
import { computeFunnelTrapezoids } from '../../cartesian/Funnel';
|
||||
import { selectChartOffsetInternal } from './selectChartOffsetInternal';
|
||||
import { selectChartDataAndAlwaysIgnoreIndexes } from './dataSelectors';
|
||||
var pickFunnelSettings = (_state, funnelSettings) => funnelSettings;
|
||||
export var selectFunnelTrapezoids = createSelector([selectChartOffsetInternal, pickFunnelSettings, 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 computeFunnelTrapezoids({
|
||||
dataKey,
|
||||
nameKey,
|
||||
displayedData,
|
||||
tooltipType,
|
||||
lastShapeType,
|
||||
reversed,
|
||||
offset,
|
||||
customWidth,
|
||||
graphicalItemId
|
||||
});
|
||||
});
|
||||
9
frontend/node_modules/recharts/es6/state/selectors/graphicalItemSelectors.js
generated
vendored
Normal file
9
frontend/node_modules/recharts/es6/state/selectors/graphicalItemSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { defaultAxisId } from '../cartesianAxisSlice';
|
||||
export 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 : defaultAxisId;
|
||||
}
|
||||
export 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 : defaultAxisId;
|
||||
}
|
||||
10
frontend/node_modules/recharts/es6/state/selectors/legendSelectors.js
generated
vendored
Normal file
10
frontend/node_modules/recharts/es6/state/selectors/legendSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { createSelector } from 'reselect';
|
||||
import sortBy from 'es-toolkit/compat/sortBy';
|
||||
export var selectLegendSettings = state => state.legend.settings;
|
||||
export var selectLegendSize = state => state.legend.size;
|
||||
var selectAllLegendPayload2DArray = state => state.legend.payload;
|
||||
export var selectLegendPayload = createSelector([selectAllLegendPayload2DArray, selectLegendSettings], (payloads, _ref) => {
|
||||
var itemSorter = _ref.itemSorter;
|
||||
var flat = payloads.flat(1);
|
||||
return itemSorter ? sortBy(flat, itemSorter) : flat;
|
||||
});
|
||||
59
frontend/node_modules/recharts/es6/state/selectors/lineSelectors.js
generated
vendored
Normal file
59
frontend/node_modules/recharts/es6/state/selectors/lineSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
import { createSelector } from 'reselect';
|
||||
import { computeLinePoints } from '../../cartesian/Line';
|
||||
import { selectChartDataWithIndexesIfNotInPanoramaPosition4 } from './dataSelectors';
|
||||
import { selectChartLayout } from '../../context/chartLayoutContext';
|
||||
import { selectAxisWithScale, selectTicksOfGraphicalItem, selectUnfilteredCartesianItems } from './axisSelectors';
|
||||
import { getBandSizeOfAxis, isCategoricalAxis } from '../../util/ChartUtils';
|
||||
var selectXAxisWithScale = (state, xAxisId, _yAxisId, isPanorama) => selectAxisWithScale(state, 'xAxis', xAxisId, isPanorama);
|
||||
var selectXAxisTicks = (state, xAxisId, _yAxisId, isPanorama) => selectTicksOfGraphicalItem(state, 'xAxis', xAxisId, isPanorama);
|
||||
var selectYAxisWithScale = (state, _xAxisId, yAxisId, isPanorama) => selectAxisWithScale(state, 'yAxis', yAxisId, isPanorama);
|
||||
var selectYAxisTicks = (state, _xAxisId, yAxisId, isPanorama) => selectTicksOfGraphicalItem(state, 'yAxis', yAxisId, isPanorama);
|
||||
var selectBandSize = createSelector([selectChartLayout, selectXAxisWithScale, selectYAxisWithScale, selectXAxisTicks, selectYAxisTicks], (layout, xAxis, yAxis, xAxisTicks, yAxisTicks) => {
|
||||
if (isCategoricalAxis(layout, 'xAxis')) {
|
||||
return getBandSizeOfAxis(xAxis, xAxisTicks, false);
|
||||
}
|
||||
return 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 = createSelector([selectUnfilteredCartesianItems, pickLineId], (graphicalItems, id) => graphicalItems.filter(isLineSettings).find(x => x.id === id));
|
||||
export var selectLinePoints = createSelector([selectChartLayout, selectXAxisWithScale, selectYAxisWithScale, selectXAxisTicks, selectYAxisTicks, selectSynchronisedLineSettings, selectBandSize, 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 computeLinePoints({
|
||||
layout,
|
||||
xAxis,
|
||||
yAxis,
|
||||
xAxisTicks,
|
||||
yAxisTicks,
|
||||
dataKey,
|
||||
bandSize,
|
||||
displayedData
|
||||
});
|
||||
});
|
||||
9
frontend/node_modules/recharts/es6/state/selectors/numberDomainEqualityCheck.js
generated
vendored
Normal file
9
frontend/node_modules/recharts/es6/state/selectors/numberDomainEqualityCheck.js
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
export 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];
|
||||
};
|
||||
1
frontend/node_modules/recharts/es6/state/selectors/pickAxisId.js
generated
vendored
Normal file
1
frontend/node_modules/recharts/es6/state/selectors/pickAxisId.js
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export var pickAxisId = (_state, _axisType, axisId) => axisId;
|
||||
1
frontend/node_modules/recharts/es6/state/selectors/pickAxisType.js
generated
vendored
Normal file
1
frontend/node_modules/recharts/es6/state/selectors/pickAxisType.js
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export var pickAxisType = (_state, axisType) => axisType;
|
||||
77
frontend/node_modules/recharts/es6/state/selectors/pieSelectors.js
generated
vendored
Normal file
77
frontend/node_modules/recharts/es6/state/selectors/pieSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
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); }
|
||||
import { createSelector } from 'reselect';
|
||||
import { computePieSectors } from '../../polar/Pie';
|
||||
import { selectChartDataAndAlwaysIgnoreIndexes } from './dataSelectors';
|
||||
import { selectChartOffsetInternal } from './selectChartOffsetInternal';
|
||||
import { getTooltipNameProp, getValueByDataKey } from '../../util/ChartUtils';
|
||||
import { selectUnfilteredPolarItems } from './polarSelectors';
|
||||
var pickId = (_state, id) => id;
|
||||
var selectSynchronisedPieSettings = createSelector([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;
|
||||
};
|
||||
export var selectDisplayedData = createSelector([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;
|
||||
});
|
||||
export var selectPieLegend = createSelector([selectDisplayedData, selectSynchronisedPieSettings, pickCells], (displayedData, pieSettings, cells) => {
|
||||
if (displayedData == null || pieSettings == null) {
|
||||
return undefined;
|
||||
}
|
||||
return displayedData.map((entry, i) => {
|
||||
var _cells$i;
|
||||
var name = 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: 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
|
||||
};
|
||||
});
|
||||
});
|
||||
export var selectPieSectors = createSelector([selectDisplayedData, selectSynchronisedPieSettings, pickCells, selectChartOffsetInternal], (displayedData, pieSettings, cells, offset) => {
|
||||
if (pieSettings == null || displayedData == null) {
|
||||
return undefined;
|
||||
}
|
||||
return computePieSectors({
|
||||
offset,
|
||||
pieSettings,
|
||||
displayedData,
|
||||
cells
|
||||
});
|
||||
});
|
||||
130
frontend/node_modules/recharts/es6/state/selectors/polarAxisSelectors.js
generated
vendored
Normal file
130
frontend/node_modules/recharts/es6/state/selectors/polarAxisSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
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); }
|
||||
import { createSelector } from 'reselect';
|
||||
import { selectChartHeight, selectChartWidth } from './containerSelectors';
|
||||
import { selectChartOffsetInternal } from './selectChartOffsetInternal';
|
||||
import { getMaxRadius } from '../../util/PolarUtils';
|
||||
import { getPercentValue } from '../../util/DataUtils';
|
||||
import { defaultPolarAngleAxisProps } from '../../polar/defaultPolarAngleAxisProps';
|
||||
import { defaultPolarRadiusAxisProps } from '../../polar/defaultPolarRadiusAxisProps';
|
||||
import { combineAxisRangeWithReverse } from './combiners/combineAxisRangeWithReverse';
|
||||
import { selectChartLayout, selectPolarChartLayout } from '../../context/chartLayoutContext';
|
||||
import { getAxisTypeBasedOnLayout } from '../../util/getAxisTypeBasedOnLayout';
|
||||
export var implicitAngleAxis = {
|
||||
allowDataOverflow: defaultPolarAngleAxisProps.allowDataOverflow,
|
||||
allowDecimals: 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.angleAxisId,
|
||||
includeHidden: false,
|
||||
name: undefined,
|
||||
reversed: defaultPolarAngleAxisProps.reversed,
|
||||
scale: defaultPolarAngleAxisProps.scale,
|
||||
tick: defaultPolarAngleAxisProps.tick,
|
||||
tickCount: undefined,
|
||||
ticks: undefined,
|
||||
type: defaultPolarAngleAxisProps.type,
|
||||
unit: undefined,
|
||||
niceTicks: 'auto'
|
||||
};
|
||||
export var implicitRadiusAxis = {
|
||||
allowDataOverflow: defaultPolarRadiusAxisProps.allowDataOverflow,
|
||||
allowDecimals: defaultPolarRadiusAxisProps.allowDecimals,
|
||||
allowDuplicatedCategory: defaultPolarRadiusAxisProps.allowDuplicatedCategory,
|
||||
dataKey: undefined,
|
||||
domain: undefined,
|
||||
id: defaultPolarRadiusAxisProps.radiusAxisId,
|
||||
includeHidden: defaultPolarRadiusAxisProps.includeHidden,
|
||||
name: undefined,
|
||||
reversed: defaultPolarRadiusAxisProps.reversed,
|
||||
scale: defaultPolarRadiusAxisProps.scale,
|
||||
tick: defaultPolarRadiusAxisProps.tick,
|
||||
tickCount: defaultPolarRadiusAxisProps.tickCount,
|
||||
ticks: undefined,
|
||||
type: defaultPolarRadiusAxisProps.type,
|
||||
unit: undefined,
|
||||
niceTicks: 'auto'
|
||||
};
|
||||
var selectAngleAxisNoDefaults = (state, angleAxisId) => {
|
||||
if (angleAxisId == null) {
|
||||
return undefined;
|
||||
}
|
||||
return state.polarAxis.angleAxis[angleAxisId];
|
||||
};
|
||||
export var selectAngleAxis = createSelector([selectAngleAxisNoDefaults, selectPolarChartLayout], (angleAxisSettings, layout) => {
|
||||
var _getAxisTypeBasedOnLa;
|
||||
if (angleAxisSettings != null) {
|
||||
return angleAxisSettings;
|
||||
}
|
||||
var evaluatedType = (_getAxisTypeBasedOnLa = 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];
|
||||
};
|
||||
export var selectRadiusAxis = createSelector([selectRadiusAxisNoDefaults, selectPolarChartLayout], (radiusAxisSettings, layout) => {
|
||||
var _getAxisTypeBasedOnLa2;
|
||||
if (radiusAxisSettings != null) {
|
||||
return radiusAxisSettings;
|
||||
}
|
||||
var evaluatedType = (_getAxisTypeBasedOnLa2 = getAxisTypeBasedOnLayout(layout, 'radiusAxis', implicitRadiusAxis.type)) !== null && _getAxisTypeBasedOnLa2 !== void 0 ? _getAxisTypeBasedOnLa2 : 'category';
|
||||
return _objectSpread(_objectSpread({}, implicitRadiusAxis), {}, {
|
||||
type: evaluatedType
|
||||
});
|
||||
});
|
||||
export var selectPolarOptions = state => state.polarOptions;
|
||||
export var selectMaxRadius = createSelector([selectChartWidth, selectChartHeight, selectChartOffsetInternal], getMaxRadius);
|
||||
var selectInnerRadius = createSelector([selectPolarOptions, selectMaxRadius], (polarChartOptions, maxRadius) => {
|
||||
if (polarChartOptions == null) {
|
||||
return undefined;
|
||||
}
|
||||
return getPercentValue(polarChartOptions.innerRadius, maxRadius, 0);
|
||||
});
|
||||
export var selectOuterRadius = createSelector([selectPolarOptions, selectMaxRadius], (polarChartOptions, maxRadius) => {
|
||||
if (polarChartOptions == null) {
|
||||
return undefined;
|
||||
}
|
||||
return 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];
|
||||
};
|
||||
export var selectAngleAxisRange = createSelector([selectPolarOptions], combineAngleAxisRange);
|
||||
export var selectAngleAxisRangeWithReversed = createSelector([selectAngleAxis, selectAngleAxisRange], combineAxisRangeWithReverse);
|
||||
export var selectRadiusAxisRange = createSelector([selectMaxRadius, selectInnerRadius, selectOuterRadius], (maxRadius, innerRadius, outerRadius) => {
|
||||
if (maxRadius == null || innerRadius == null || outerRadius == null) {
|
||||
return undefined;
|
||||
}
|
||||
return [innerRadius, outerRadius];
|
||||
});
|
||||
export var selectRadiusAxisRangeWithReversed = createSelector([selectRadiusAxis, selectRadiusAxisRange], combineAxisRangeWithReverse);
|
||||
export var selectPolarViewBox = createSelector([selectChartLayout, selectPolarOptions, selectInnerRadius, selectOuterRadius, selectChartWidth, 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: getPercentValue(cx, width, width / 2),
|
||||
cy: getPercentValue(cy, height, height / 2),
|
||||
innerRadius,
|
||||
outerRadius,
|
||||
startAngle,
|
||||
endAngle,
|
||||
clockWise: false // this property look useful, why not use it?
|
||||
};
|
||||
});
|
||||
16
frontend/node_modules/recharts/es6/state/selectors/polarGridSelectors.js
generated
vendored
Normal file
16
frontend/node_modules/recharts/es6/state/selectors/polarGridSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { createSelector } from 'reselect';
|
||||
import { selectPolarAxisTicks } from './polarScaleSelectors';
|
||||
var selectAngleAxisTicks = (state, anglexisId) => selectPolarAxisTicks(state, 'angleAxis', anglexisId, false);
|
||||
export var selectPolarGridAngles = createSelector([selectAngleAxisTicks], ticks => {
|
||||
if (!ticks) {
|
||||
return undefined;
|
||||
}
|
||||
return ticks.map(tick => tick.coordinate);
|
||||
});
|
||||
var selectRadiusAxisTicks = (state, radiusAxisId) => selectPolarAxisTicks(state, 'radiusAxis', radiusAxisId, false);
|
||||
export var selectPolarGridRadii = createSelector([selectRadiusAxisTicks], ticks => {
|
||||
if (!ticks) {
|
||||
return undefined;
|
||||
}
|
||||
return ticks.map(tick => tick.coordinate);
|
||||
});
|
||||
62
frontend/node_modules/recharts/es6/state/selectors/polarScaleSelectors.js
generated
vendored
Normal file
62
frontend/node_modules/recharts/es6/state/selectors/polarScaleSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
import { createSelector } from 'reselect';
|
||||
import { combineAxisTicks, combineCategoricalDomain, combineGraphicalItemTicks, selectDuplicateDomain, selectRealScaleType, selectRenderableAxisSettings } from './axisSelectors';
|
||||
import { selectAngleAxis, selectAngleAxisRangeWithReversed, selectRadiusAxis, selectRadiusAxisRangeWithReversed } from './polarAxisSelectors';
|
||||
import { selectChartLayout } from '../../context/chartLayoutContext';
|
||||
import { selectPolarAppliedValues, selectPolarAxisCheckedDomain, selectPolarNiceTicks } from './polarSelectors';
|
||||
import { pickAxisType } from './pickAxisType';
|
||||
import { rechartsScaleFactory } from '../../util/scale/RechartsScale';
|
||||
import { combineConfiguredScale } from './combiners/combineConfiguredScale';
|
||||
export var selectPolarAxis = (state, axisType, axisId) => {
|
||||
switch (axisType) {
|
||||
case 'angleAxis':
|
||||
{
|
||||
return selectAngleAxis(state, axisId);
|
||||
}
|
||||
case 'radiusAxis':
|
||||
{
|
||||
return selectRadiusAxis(state, axisId);
|
||||
}
|
||||
default:
|
||||
{
|
||||
throw new Error("Unexpected axis type: ".concat(axisType));
|
||||
}
|
||||
}
|
||||
};
|
||||
var selectPolarAxisRangeWithReversed = (state, axisType, axisId) => {
|
||||
switch (axisType) {
|
||||
case 'angleAxis':
|
||||
{
|
||||
return selectAngleAxisRangeWithReversed(state, axisId);
|
||||
}
|
||||
case 'radiusAxis':
|
||||
{
|
||||
return selectRadiusAxisRangeWithReversed(state, axisId);
|
||||
}
|
||||
default:
|
||||
{
|
||||
throw new Error("Unexpected axis type: ".concat(axisType));
|
||||
}
|
||||
}
|
||||
};
|
||||
var selectPolarConfiguredScale = createSelector([selectPolarAxis, selectRealScaleType, selectPolarAxisCheckedDomain, selectPolarAxisRangeWithReversed], combineConfiguredScale);
|
||||
export var selectPolarAxisScale = createSelector([selectPolarConfiguredScale], rechartsScaleFactory);
|
||||
export var selectPolarCategoricalDomain = createSelector([selectChartLayout, selectPolarAppliedValues, selectRenderableAxisSettings, pickAxisType], combineCategoricalDomain);
|
||||
export var selectPolarAxisTicks = createSelector([selectChartLayout, selectPolarAxis, selectRealScaleType, selectPolarAxisScale, selectPolarNiceTicks, selectPolarAxisRangeWithReversed, selectDuplicateDomain, selectPolarCategoricalDomain, pickAxisType], combineAxisTicks);
|
||||
export var selectPolarAngleAxisTicks = 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());
|
||||
});
|
||||
export var selectPolarGraphicalItemAxisTicks = createSelector([selectChartLayout, selectPolarAxis, selectPolarAxisScale, selectPolarAxisRangeWithReversed, selectDuplicateDomain, selectPolarCategoricalDomain, pickAxisType], combineGraphicalItemTicks);
|
||||
46
frontend/node_modules/recharts/es6/state/selectors/polarSelectors.js
generated
vendored
Normal file
46
frontend/node_modules/recharts/es6/state/selectors/polarSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
import { createSelector } from 'reselect';
|
||||
import { selectChartDataAndAlwaysIgnoreIndexes, selectChartDataSliceIgnoringIndexes } from './dataSelectors';
|
||||
import { combineAppliedValues, combineAxisDomain, combineAxisDomainWithNiceTicks, combineDisplayedData, combineDomainOfAllAppliedNumericalValuesIncludingErrorValues, combineGraphicalItemsData, combineGraphicalItemsSettings, combineNiceTicks, combineNumericalDomain, itemAxisPredicate, selectAllErrorBarSettings, selectBaseAxis, selectDomainDefinition, selectDomainFromUserPreference, selectRealScaleType, selectRenderableAxisSettings } from './axisSelectors';
|
||||
import { selectChartLayout } from '../../context/chartLayoutContext';
|
||||
import { getValueByDataKey } from '../../util/ChartUtils';
|
||||
import { pickAxisType } from './pickAxisType';
|
||||
import { pickAxisId } from './pickAxisId';
|
||||
import { selectStackOffsetType } from './rootPropsSelectors';
|
||||
import { combineCheckedDomain } from './combiners/combineCheckedDomain';
|
||||
export var selectUnfilteredPolarItems = state => state.graphicalItems.polarItems;
|
||||
var selectAxisPredicate = createSelector([pickAxisType, pickAxisId], itemAxisPredicate);
|
||||
export var selectPolarItemsSettings = createSelector([selectUnfilteredPolarItems, selectBaseAxis, selectAxisPredicate], combineGraphicalItemsSettings);
|
||||
var selectPolarGraphicalItemsData = createSelector([selectPolarItemsSettings], combineGraphicalItemsData);
|
||||
export var selectPolarDisplayedData = createSelector([selectPolarGraphicalItemsData, selectChartDataAndAlwaysIgnoreIndexes], combineDisplayedData);
|
||||
export var selectPolarAppliedValues = createSelector([selectPolarDisplayedData, selectBaseAxis, selectPolarItemsSettings], combineAppliedValues);
|
||||
export var selectAllPolarAppliedNumericalValues = createSelector([selectPolarDisplayedData, selectBaseAxis, selectPolarItemsSettings], (data, axisSettings, items) => {
|
||||
if (items.length > 0) {
|
||||
return data.flatMap(entry => {
|
||||
return items.flatMap(item => {
|
||||
var _axisSettings$dataKey;
|
||||
var valueByDataKey = 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: getValueByDataKey(item, axisSettings.dataKey),
|
||||
errorDomain: []
|
||||
}));
|
||||
}
|
||||
return data.map(entry => ({
|
||||
value: entry,
|
||||
errorDomain: []
|
||||
}));
|
||||
});
|
||||
var unsupportedInPolarChart = () => undefined;
|
||||
var selectDomainOfAllPolarAppliedNumericalValues = createSelector([selectPolarDisplayedData, selectBaseAxis, selectPolarItemsSettings, selectAllErrorBarSettings, pickAxisType, selectChartDataSliceIgnoringIndexes], combineDomainOfAllAppliedNumericalValuesIncludingErrorValues);
|
||||
var selectPolarNumericalDomain = createSelector([selectBaseAxis, selectDomainDefinition, selectDomainFromUserPreference, unsupportedInPolarChart, selectDomainOfAllPolarAppliedNumericalValues, unsupportedInPolarChart, selectChartLayout, pickAxisType], combineNumericalDomain);
|
||||
export var selectPolarAxisDomain = createSelector([selectBaseAxis, selectChartLayout, selectPolarDisplayedData, selectPolarAppliedValues, selectStackOffsetType, pickAxisType, selectPolarNumericalDomain], combineAxisDomain);
|
||||
export var selectPolarNiceTicks = createSelector([selectPolarAxisDomain, selectRenderableAxisSettings, selectRealScaleType], combineNiceTicks);
|
||||
export var selectPolarAxisDomainIncludingNiceTicks = createSelector([selectBaseAxis, selectPolarAxisDomain, selectPolarNiceTicks, pickAxisType], combineAxisDomainWithNiceTicks);
|
||||
export var selectPolarAxisCheckedDomain = createSelector([selectRealScaleType, selectPolarAxisDomainIncludingNiceTicks], combineCheckedDomain);
|
||||
90
frontend/node_modules/recharts/es6/state/selectors/radarSelectors.js
generated
vendored
Normal file
90
frontend/node_modules/recharts/es6/state/selectors/radarSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
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); }
|
||||
import { createSelector } from 'reselect';
|
||||
import { computeRadarPoints } from '../../polar/Radar';
|
||||
import { selectPolarAxisScale, selectPolarAxisTicks } from './polarScaleSelectors';
|
||||
import { selectAngleAxis, selectPolarViewBox, selectRadiusAxis } from './polarAxisSelectors';
|
||||
import { selectChartDataAndAlwaysIgnoreIndexes } from './dataSelectors';
|
||||
import { selectChartLayout } from '../../context/chartLayoutContext';
|
||||
import { getBandSizeOfAxis, isCategoricalAxis } from '../../util/ChartUtils';
|
||||
import { selectUnfilteredPolarItems } from './polarSelectors';
|
||||
var selectRadiusAxisScale = (state, radiusAxisId) => selectPolarAxisScale(state, 'radiusAxis', radiusAxisId);
|
||||
var selectRadiusAxisForRadar = createSelector([selectRadiusAxisScale], scale => {
|
||||
if (scale == null) {
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
scale
|
||||
};
|
||||
});
|
||||
export var selectRadiusAxisForBandSize = createSelector([selectRadiusAxis, selectRadiusAxisScale], (axisSettings, scale) => {
|
||||
if (axisSettings == null || scale == null) {
|
||||
return undefined;
|
||||
}
|
||||
return _objectSpread(_objectSpread({}, axisSettings), {}, {
|
||||
scale
|
||||
});
|
||||
});
|
||||
var selectRadiusAxisTicks = (state, radiusAxisId, _angleAxisId, isPanorama) => {
|
||||
return selectPolarAxisTicks(state, 'radiusAxis', radiusAxisId, isPanorama);
|
||||
};
|
||||
var selectAngleAxisForRadar = (state, _radiusAxisId, angleAxisId) => selectAngleAxis(state, angleAxisId);
|
||||
var selectPolarAxisScaleForRadar = (state, _radiusAxisId, angleAxisId) => selectPolarAxisScale(state, 'angleAxis', angleAxisId);
|
||||
export var selectAngleAxisForBandSize = createSelector([selectAngleAxisForRadar, selectPolarAxisScaleForRadar], (axisSettings, scale) => {
|
||||
if (axisSettings == null || scale == null) {
|
||||
return undefined;
|
||||
}
|
||||
return _objectSpread(_objectSpread({}, axisSettings), {}, {
|
||||
scale
|
||||
});
|
||||
});
|
||||
var selectAngleAxisTicks = (state, _radiusAxisId, angleAxisId, isPanorama) => {
|
||||
return selectPolarAxisTicks(state, 'angleAxis', angleAxisId, isPanorama);
|
||||
};
|
||||
export var selectAngleAxisWithScaleAndViewport = createSelector([selectAngleAxisForRadar, selectPolarAxisScaleForRadar, 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 = createSelector([selectChartLayout, selectRadiusAxisForBandSize, selectRadiusAxisTicks, selectAngleAxisForBandSize, selectAngleAxisTicks], (layout, radiusAxis, radiusAxisTicks, angleAxis, angleAxisTicks) => {
|
||||
if (isCategoricalAxis(layout, 'radiusAxis')) {
|
||||
return getBandSizeOfAxis(radiusAxis, radiusAxisTicks, false);
|
||||
}
|
||||
return getBandSizeOfAxis(angleAxis, angleAxisTicks, false);
|
||||
});
|
||||
var selectSynchronisedRadarDataKey = createSelector([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;
|
||||
});
|
||||
export var selectRadarPoints = createSelector([selectRadiusAxisForRadar, selectAngleAxisWithScaleAndViewport, 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 computeRadarPoints({
|
||||
radiusAxis,
|
||||
angleAxis,
|
||||
displayedData,
|
||||
dataKey,
|
||||
bandSize
|
||||
});
|
||||
});
|
||||
175
frontend/node_modules/recharts/es6/state/selectors/radialBarSelectors.js
generated
vendored
Normal file
175
frontend/node_modules/recharts/es6/state/selectors/radialBarSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
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); }
|
||||
import { createSelector } from 'reselect';
|
||||
import { computeRadialBarDataItems } from '../../polar/RadialBar';
|
||||
import { selectChartDataAndAlwaysIgnoreIndexes, selectChartDataWithIndexes } from './dataSelectors';
|
||||
import { selectPolarAxisScale, selectPolarAxisTicks, selectPolarGraphicalItemAxisTicks } from './polarScaleSelectors';
|
||||
import { combineStackGroups, selectTooltipAxis } from './axisSelectors';
|
||||
import { selectAngleAxis, selectPolarViewBox, selectRadiusAxis } from './polarAxisSelectors';
|
||||
import { selectChartLayout } from '../../context/chartLayoutContext';
|
||||
import { getBandSizeOfAxis, getBaseValueOfBar, isCategoricalAxis } from '../../util/ChartUtils';
|
||||
import { selectBarCategoryGap, selectBarGap, selectReverseStackOrder, selectRootBarSize, selectRootMaxBarSize, selectStackOffsetType } from './rootPropsSelectors';
|
||||
import { selectPolarItemsSettings, selectUnfilteredPolarItems } from './polarSelectors';
|
||||
import { isNullish } from '../../util/DataUtils';
|
||||
import { combineDisplayedStackedData } from './combiners/combineDisplayedStackedData';
|
||||
import { isStacked } from '../types/StackedGraphicalItem';
|
||||
import { combineBarSizeList } from './combiners/combineBarSizeList';
|
||||
import { combineAllBarPositions } from './combiners/combineAllBarPositions';
|
||||
import { combineStackedData } from './combiners/combineStackedData';
|
||||
import { combineBarPosition } from './combiners/combineBarPosition';
|
||||
var selectRadiusAxisForRadialBar = (state, radiusAxisId) => selectRadiusAxis(state, radiusAxisId);
|
||||
var selectRadiusAxisScaleForRadar = (state, radiusAxisId) => selectPolarAxisScale(state, 'radiusAxis', radiusAxisId);
|
||||
export var selectRadiusAxisWithScale = createSelector([selectRadiusAxisForRadialBar, selectRadiusAxisScaleForRadar], (axis, scale) => {
|
||||
if (axis == null || scale == null) {
|
||||
return undefined;
|
||||
}
|
||||
return _objectSpread(_objectSpread({}, axis), {}, {
|
||||
scale
|
||||
});
|
||||
});
|
||||
export var selectRadiusAxisTicks = (state, radiusAxisId) => {
|
||||
return selectPolarGraphicalItemAxisTicks(state, 'radiusAxis', radiusAxisId, false);
|
||||
};
|
||||
var selectAngleAxisForRadialBar = (state, _radiusAxisId, angleAxisId) => selectAngleAxis(state, angleAxisId);
|
||||
var selectAngleAxisScaleForRadialBar = (state, _radiusAxisId, angleAxisId) => selectPolarAxisScale(state, 'angleAxis', angleAxisId);
|
||||
export var selectAngleAxisWithScale = 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 selectPolarAxisTicks(state, 'angleAxis', angleAxisId, false);
|
||||
};
|
||||
var pickRadialBarSettings = (_state, _radiusAxisId, _angleAxisId, radialBarSettings) => radialBarSettings;
|
||||
var selectSynchronisedRadialBarSettings = createSelector([selectUnfilteredPolarItems, pickRadialBarSettings], (graphicalItems, radialBarSettingsFromProps) => {
|
||||
if (graphicalItems.some(pgis => pgis.type === 'radialBar' && radialBarSettingsFromProps.dataKey === pgis.dataKey && radialBarSettingsFromProps.stackId === pgis.stackId)) {
|
||||
return radialBarSettingsFromProps;
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
export var selectBandSizeOfPolarAxis = createSelector([selectChartLayout, selectRadiusAxisWithScale, selectRadiusAxisTicks, selectAngleAxisWithScale, selectAngleAxisTicks], (layout, radiusAxis, radiusAxisTicks, angleAxis, angleAxisTicks) => {
|
||||
if (isCategoricalAxis(layout, 'radiusAxis')) {
|
||||
return getBandSizeOfAxis(radiusAxis, radiusAxisTicks, false);
|
||||
}
|
||||
return getBandSizeOfAxis(angleAxis, angleAxisTicks, false);
|
||||
});
|
||||
export var selectBaseValue = createSelector([selectAngleAxisWithScale, selectRadiusAxisWithScale, selectChartLayout], (angleAxis, radiusAxis, layout) => {
|
||||
var numericAxis = layout === 'radial' ? angleAxis : radiusAxis;
|
||||
if (numericAxis == null || numericAxis.scale == null) {
|
||||
return undefined;
|
||||
}
|
||||
return 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;
|
||||
export var pickMaxBarSize = (_state, _radiusAxisId, _angleAxisId, radialBarSettings, _cells) => radialBarSettings.maxBarSize;
|
||||
var isRadialBar = item => item.type === 'radialBar';
|
||||
var selectAllVisibleRadialBars = createSelector([selectChartLayout, 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;
|
||||
export var selectPolarBarSizeList = createSelector([selectAllVisibleRadialBars, selectRootBarSize, selectPolarBarAxisSize], combineBarSizeList);
|
||||
export var selectPolarBarBandSize = createSelector([selectChartLayout, selectRootMaxBarSize, selectAngleAxisWithScale, selectAngleAxisTicks, selectRadiusAxisWithScale, selectRadiusAxisTicks, pickMaxBarSize], (layout, globalMaxBarSize, angleAxis, angleAxisTicks, radiusAxis, radiusAxisTicks, childMaxBarSize) => {
|
||||
var _ref2, _getBandSizeOfAxis2;
|
||||
var maxBarSize = isNullish(childMaxBarSize) ? globalMaxBarSize : childMaxBarSize;
|
||||
if (layout === 'centric') {
|
||||
var _ref, _getBandSizeOfAxis;
|
||||
return (_ref = (_getBandSizeOfAxis = getBandSizeOfAxis(angleAxis, angleAxisTicks, true)) !== null && _getBandSizeOfAxis !== void 0 ? _getBandSizeOfAxis : maxBarSize) !== null && _ref !== void 0 ? _ref : 0;
|
||||
}
|
||||
return (_ref2 = (_getBandSizeOfAxis2 = getBandSizeOfAxis(radiusAxis, radiusAxisTicks, true)) !== null && _getBandSizeOfAxis2 !== void 0 ? _getBandSizeOfAxis2 : maxBarSize) !== null && _ref2 !== void 0 ? _ref2 : 0;
|
||||
});
|
||||
export var selectAllPolarBarPositions = createSelector([selectPolarBarSizeList, selectRootMaxBarSize, selectBarGap, selectBarCategoryGap, selectPolarBarBandSize, selectBandSizeOfPolarAxis, pickMaxBarSize], combineAllBarPositions);
|
||||
export var selectPolarBarPosition = createSelector([selectAllPolarBarPositions, selectSynchronisedRadialBarSettings], combineBarPosition);
|
||||
var selectStackedRadialBars = createSelector([selectPolarItemsSettings], allPolarItems => allPolarItems.filter(isRadialBar).filter(isStacked));
|
||||
var selectPolarCombinedStackedData = createSelector([selectStackedRadialBars, selectChartDataAndAlwaysIgnoreIndexes, selectTooltipAxis], combineDisplayedStackedData);
|
||||
var selectStackGroups = createSelector([selectPolarCombinedStackedData, selectStackedRadialBars, selectStackOffsetType, selectReverseStackOrder], combineStackGroups);
|
||||
var selectRadialBarStackGroups = (state, radiusAxisId, angleAxisId) => {
|
||||
var layout = selectChartLayout(state);
|
||||
if (layout === 'centric') {
|
||||
return selectStackGroups(state, 'radiusAxis', radiusAxisId);
|
||||
}
|
||||
return selectStackGroups(state, 'angleAxis', angleAxisId);
|
||||
};
|
||||
var selectPolarStackedData = createSelector([selectRadialBarStackGroups, selectSynchronisedRadialBarSettings], combineStackedData);
|
||||
export var selectRadialBarSectors = createSelector([selectAngleAxisWithScale, selectAngleAxisTicks, selectRadiusAxisWithScale, selectRadiusAxisTicks, selectChartDataWithIndexes, selectSynchronisedRadialBarSettings, selectBandSizeOfPolarAxis, selectChartLayout, selectBaseValue, 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 computeRadialBarDataItems({
|
||||
angleAxis,
|
||||
angleAxisTicks,
|
||||
bandSize,
|
||||
baseValue,
|
||||
cells,
|
||||
cx,
|
||||
cy,
|
||||
dataKey,
|
||||
dataStartIndex,
|
||||
displayedData,
|
||||
endAngle,
|
||||
layout,
|
||||
minPointSize,
|
||||
pos,
|
||||
radiusAxis,
|
||||
radiusAxisTicks,
|
||||
stackedData,
|
||||
stackedDomain,
|
||||
startAngle
|
||||
});
|
||||
});
|
||||
export var selectRadialBarLegendPayload = createSelector([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
|
||||
};
|
||||
});
|
||||
});
|
||||
11
frontend/node_modules/recharts/es6/state/selectors/rootPropsSelectors.js
generated
vendored
Normal file
11
frontend/node_modules/recharts/es6/state/selectors/rootPropsSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
export var selectRootMaxBarSize = state => state.rootProps.maxBarSize;
|
||||
export var selectBarGap = state => state.rootProps.barGap;
|
||||
export var selectBarCategoryGap = state => state.rootProps.barCategoryGap;
|
||||
export var selectRootBarSize = state => state.rootProps.barSize;
|
||||
export var selectStackOffsetType = state => state.rootProps.stackOffset;
|
||||
export var selectReverseStackOrder = state => state.rootProps.reverseStackOrder;
|
||||
export var selectChartName = state => state.options.chartName;
|
||||
export var selectSyncId = state => state.rootProps.syncId;
|
||||
export var selectSyncMethod = state => state.rootProps.syncMethod;
|
||||
export var selectEventEmitter = state => state.options.eventEmitter;
|
||||
export var selectChartBaseValue = state => state.rootProps.baseValue;
|
||||
42
frontend/node_modules/recharts/es6/state/selectors/scatterSelectors.js
generated
vendored
Normal file
42
frontend/node_modules/recharts/es6/state/selectors/scatterSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import { createSelector } from 'reselect';
|
||||
import { computeScatterPoints } from '../../cartesian/Scatter';
|
||||
import { selectChartDataWithIndexesIfNotInPanoramaPosition4 } from './dataSelectors';
|
||||
import { selectAxisWithScale, selectTicksOfGraphicalItem, selectUnfilteredCartesianItems, selectZAxisWithScale } from './axisSelectors';
|
||||
var selectXAxisWithScale = (state, xAxisId, _yAxisId, _zAxisId, _id, _cells, isPanorama) => selectAxisWithScale(state, 'xAxis', xAxisId, isPanorama);
|
||||
var selectXAxisTicks = (state, xAxisId, _yAxisId, _zAxisId, _id, _cells, isPanorama) => selectTicksOfGraphicalItem(state, 'xAxis', xAxisId, isPanorama);
|
||||
var selectYAxisWithScale = (state, _xAxisId, yAxisId, _zAxisId, _id, _cells, isPanorama) => selectAxisWithScale(state, 'yAxis', yAxisId, isPanorama);
|
||||
var selectYAxisTicks = (state, _xAxisId, yAxisId, _zAxisId, _id, _cells, isPanorama) => selectTicksOfGraphicalItem(state, 'yAxis', yAxisId, isPanorama);
|
||||
var selectZAxis = (state, _xAxisId, _yAxisId, zAxisId) => 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) => selectChartDataWithIndexesIfNotInPanoramaPosition4(state, undefined, undefined, isPanorama);
|
||||
var selectSynchronisedScatterSettings = createSelector([selectUnfilteredCartesianItems, pickScatterId], (graphicalItems, id) => {
|
||||
return graphicalItems.filter(item => item.type === 'scatter').find(item => item.id === id);
|
||||
});
|
||||
export var selectScatterPoints = 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 computeScatterPoints({
|
||||
displayedData,
|
||||
xAxis,
|
||||
yAxis,
|
||||
zAxis,
|
||||
scatterSettings,
|
||||
xAxisTicks,
|
||||
yAxisTicks,
|
||||
cells
|
||||
});
|
||||
});
|
||||
9
frontend/node_modules/recharts/es6/state/selectors/selectActivePropsFromChartPointer.js
generated
vendored
Normal file
9
frontend/node_modules/recharts/es6/state/selectors/selectActivePropsFromChartPointer.js
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { createSelector } from 'reselect';
|
||||
import { selectChartLayout } from '../../context/chartLayoutContext';
|
||||
import { selectTooltipAxisRangeWithReverse, selectTooltipAxisTicks } from './tooltipSelectors';
|
||||
import { selectChartOffsetInternal } from './selectChartOffsetInternal';
|
||||
import { combineActiveProps, selectOrderedTooltipTicks } from './selectors';
|
||||
import { selectPolarViewBox } from './polarAxisSelectors';
|
||||
import { selectTooltipAxisType } from './selectTooltipAxisType';
|
||||
var pickChartPointer = (_state, chartPointer) => chartPointer;
|
||||
export var selectActivePropsFromChartPointer = createSelector([pickChartPointer, selectChartLayout, selectPolarViewBox, selectTooltipAxisType, selectTooltipAxisRangeWithReverse, selectTooltipAxisTicks, selectOrderedTooltipTicks, selectChartOffsetInternal], combineActiveProps);
|
||||
7
frontend/node_modules/recharts/es6/state/selectors/selectAllAxes.js
generated
vendored
Normal file
7
frontend/node_modules/recharts/es6/state/selectors/selectAllAxes.js
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { createSelector } from 'reselect';
|
||||
export var selectAllXAxes = createSelector(state => state.cartesianAxis.xAxis, xAxisMap => {
|
||||
return Object.values(xAxisMap);
|
||||
});
|
||||
export var selectAllYAxes = createSelector(state => state.cartesianAxis.yAxis, yAxisMap => {
|
||||
return Object.values(yAxisMap);
|
||||
});
|
||||
10
frontend/node_modules/recharts/es6/state/selectors/selectChartOffset.js
generated
vendored
Normal file
10
frontend/node_modules/recharts/es6/state/selectors/selectChartOffset.js
generated
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { createSelector } from 'reselect';
|
||||
import { selectChartOffsetInternal } from './selectChartOffsetInternal';
|
||||
export var selectChartOffset = createSelector([selectChartOffsetInternal], offsetInternal => {
|
||||
return {
|
||||
top: offsetInternal.top,
|
||||
bottom: offsetInternal.bottom,
|
||||
left: offsetInternal.left,
|
||||
right: offsetInternal.right
|
||||
};
|
||||
});
|
||||
92
frontend/node_modules/recharts/es6/state/selectors/selectChartOffsetInternal.js
generated
vendored
Normal file
92
frontend/node_modules/recharts/es6/state/selectors/selectChartOffsetInternal.js
generated
vendored
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
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); }
|
||||
import { createSelector } from 'reselect';
|
||||
import { selectLegendSettings, selectLegendSize } from './legendSelectors';
|
||||
import { appendOffsetOfLegend } from '../../util/ChartUtils';
|
||||
import { selectChartHeight, selectChartWidth, selectMargin } from './containerSelectors';
|
||||
import { selectAllXAxes, selectAllYAxes } from './selectAllAxes';
|
||||
import { DEFAULT_Y_AXIS_WIDTH } from '../../util/Constants';
|
||||
export var selectBrushHeight = state => state.brush.height;
|
||||
function selectLeftAxesOffset(state) {
|
||||
var yAxes = selectAllYAxes(state);
|
||||
return yAxes.reduce((result, entry) => {
|
||||
if (entry.orientation === 'left' && !entry.mirror && !entry.hide) {
|
||||
var width = typeof entry.width === 'number' ? entry.width : DEFAULT_Y_AXIS_WIDTH;
|
||||
return result + width;
|
||||
}
|
||||
return result;
|
||||
}, 0);
|
||||
}
|
||||
function selectRightAxesOffset(state) {
|
||||
var yAxes = selectAllYAxes(state);
|
||||
return yAxes.reduce((result, entry) => {
|
||||
if (entry.orientation === 'right' && !entry.mirror && !entry.hide) {
|
||||
var width = typeof entry.width === 'number' ? entry.width : DEFAULT_Y_AXIS_WIDTH;
|
||||
return result + width;
|
||||
}
|
||||
return result;
|
||||
}, 0);
|
||||
}
|
||||
function selectTopAxesOffset(state) {
|
||||
var xAxes = 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 = 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
|
||||
*/
|
||||
export var selectChartOffsetInternal = createSelector([selectChartWidth, selectChartHeight, selectMargin, selectBrushHeight, selectLeftAxesOffset, selectRightAxesOffset, selectTopAxesOffset, selectBottomAxesOffset, selectLegendSettings, 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 = 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)
|
||||
});
|
||||
});
|
||||
export var selectChartViewBox = createSelector(selectChartOffsetInternal, offset => ({
|
||||
x: offset.left,
|
||||
y: offset.top,
|
||||
width: offset.width,
|
||||
height: offset.height
|
||||
}));
|
||||
export var selectAxisViewBox = createSelector(selectChartWidth, selectChartHeight, (width, height) => ({
|
||||
x: 0,
|
||||
y: 0,
|
||||
width,
|
||||
height
|
||||
}));
|
||||
14
frontend/node_modules/recharts/es6/state/selectors/selectPlotArea.js
generated
vendored
Normal file
14
frontend/node_modules/recharts/es6/state/selectors/selectPlotArea.js
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { createSelector } from 'reselect';
|
||||
import { selectChartOffset } from './selectChartOffset';
|
||||
import { selectChartHeight, selectChartWidth } from './containerSelectors';
|
||||
export var selectPlotArea = createSelector([selectChartOffset, selectChartWidth, 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)
|
||||
};
|
||||
});
|
||||
1
frontend/node_modules/recharts/es6/state/selectors/selectTooltipAxisId.js
generated
vendored
Normal file
1
frontend/node_modules/recharts/es6/state/selectors/selectTooltipAxisId.js
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export var selectTooltipAxisId = state => state.tooltip.settings.axisId;
|
||||
23
frontend/node_modules/recharts/es6/state/selectors/selectTooltipAxisType.js
generated
vendored
Normal file
23
frontend/node_modules/recharts/es6/state/selectors/selectTooltipAxisType.js
generated
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { selectChartLayout } from '../../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.
|
||||
*/
|
||||
|
||||
export var selectTooltipAxisType = state => {
|
||||
var layout = selectChartLayout(state);
|
||||
if (layout === 'horizontal') {
|
||||
return 'xAxis';
|
||||
}
|
||||
if (layout === 'vertical') {
|
||||
return 'yAxis';
|
||||
}
|
||||
if (layout === 'centric') {
|
||||
return 'angleAxis';
|
||||
}
|
||||
return 'radiusAxis';
|
||||
};
|
||||
21
frontend/node_modules/recharts/es6/state/selectors/selectTooltipEventType.js
generated
vendored
Normal file
21
frontend/node_modules/recharts/es6/state/selectors/selectTooltipEventType.js
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { useAppSelector } from '../hooks';
|
||||
export var selectDefaultTooltipEventType = state => state.options.defaultTooltipEventType;
|
||||
export var selectValidateTooltipEventTypes = state => state.options.validateTooltipEventTypes;
|
||||
export 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;
|
||||
}
|
||||
export function selectTooltipEventType(state, shared) {
|
||||
var defaultTooltipEventType = selectDefaultTooltipEventType(state);
|
||||
var validateTooltipEventTypes = selectValidateTooltipEventTypes(state);
|
||||
return combineTooltipEventType(shared, defaultTooltipEventType, validateTooltipEventTypes);
|
||||
}
|
||||
export function useTooltipEventType(shared) {
|
||||
return useAppSelector(state => selectTooltipEventType(state, shared));
|
||||
}
|
||||
1
frontend/node_modules/recharts/es6/state/selectors/selectTooltipPayloadSearcher.js
generated
vendored
Normal file
1
frontend/node_modules/recharts/es6/state/selectors/selectTooltipPayloadSearcher.js
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export var selectTooltipPayloadSearcher = state => state.options.tooltipPayloadSearcher;
|
||||
1
frontend/node_modules/recharts/es6/state/selectors/selectTooltipSettings.js
generated
vendored
Normal file
1
frontend/node_modules/recharts/es6/state/selectors/selectTooltipSettings.js
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export var selectTooltipSettings = state => state.tooltip.settings;
|
||||
1
frontend/node_modules/recharts/es6/state/selectors/selectTooltipState.js
generated
vendored
Normal file
1
frontend/node_modules/recharts/es6/state/selectors/selectTooltipState.js
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export var selectTooltipState = state => state.tooltip;
|
||||
100
frontend/node_modules/recharts/es6/state/selectors/selectors.js
generated
vendored
Normal file
100
frontend/node_modules/recharts/es6/state/selectors/selectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
import { createSelector } from 'reselect';
|
||||
import sortBy from 'es-toolkit/compat/sortBy';
|
||||
import { useAppSelector } from '../hooks';
|
||||
import { calculateCartesianTooltipPos, calculatePolarTooltipPos } from '../../util/ChartUtils';
|
||||
import { selectChartDataWithIndexes } from './dataSelectors';
|
||||
import { selectTooltipAxisDomain, selectTooltipAxisTicks, selectTooltipDisplayedData } from './tooltipSelectors';
|
||||
import { selectTooltipAxisDataKey } from './axisSelectors';
|
||||
import { selectChartName } from './rootPropsSelectors';
|
||||
import { selectChartLayout } from '../../context/chartLayoutContext';
|
||||
import { selectChartOffsetInternal } from './selectChartOffsetInternal';
|
||||
import { selectChartHeight, selectChartWidth } from './containerSelectors';
|
||||
import { combineActiveLabel } from './combiners/combineActiveLabel';
|
||||
import { combineTooltipInteractionState } from './combiners/combineTooltipInteractionState';
|
||||
import { combineActiveTooltipIndex } from './combiners/combineActiveTooltipIndex';
|
||||
import { combineCoordinateForDefaultIndex } from './combiners/combineCoordinateForDefaultIndex';
|
||||
import { combineTooltipPayloadConfigurations } from './combiners/combineTooltipPayloadConfigurations';
|
||||
import { selectTooltipPayloadSearcher } from './selectTooltipPayloadSearcher';
|
||||
import { selectTooltipState } from './selectTooltipState';
|
||||
import { combineTooltipPayload } from './combiners/combineTooltipPayload';
|
||||
import { calculateActiveTickIndex, getActiveCartesianCoordinate, getActivePolarCoordinate, isInCartesianRange } from '../../util/getActiveCoordinate';
|
||||
import { inRangeOfSector } from '../../util/PolarUtils';
|
||||
export var useChartName = () => {
|
||||
return useAppSelector(selectChartName);
|
||||
};
|
||||
var pickTooltipEventType = (_state, tooltipEventType) => tooltipEventType;
|
||||
var pickTrigger = (_state, _tooltipEventType, trigger) => trigger;
|
||||
var pickDefaultIndex = (_state, _tooltipEventType, _trigger, defaultIndex) => defaultIndex;
|
||||
export var selectOrderedTooltipTicks = createSelector(selectTooltipAxisTicks, ticks => sortBy(ticks, o => o.coordinate));
|
||||
export var selectTooltipInteractionState = createSelector([selectTooltipState, pickTooltipEventType, pickTrigger, pickDefaultIndex], combineTooltipInteractionState);
|
||||
export var selectActiveIndex = createSelector([selectTooltipInteractionState, selectTooltipDisplayedData, selectTooltipAxisDataKey, selectTooltipAxisDomain], combineActiveTooltipIndex);
|
||||
export var selectTooltipDataKey = (state, tooltipEventType, trigger) => {
|
||||
if (tooltipEventType == null) {
|
||||
return undefined;
|
||||
}
|
||||
var tooltipState = 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;
|
||||
};
|
||||
export var selectTooltipPayloadConfigurations = createSelector([selectTooltipState, pickTooltipEventType, pickTrigger, pickDefaultIndex], combineTooltipPayloadConfigurations);
|
||||
export var selectCoordinateForDefaultIndex = createSelector([selectChartWidth, selectChartHeight, selectChartLayout, selectChartOffsetInternal, selectTooltipAxisTicks, pickDefaultIndex, selectTooltipPayloadConfigurations], combineCoordinateForDefaultIndex);
|
||||
export var selectActiveCoordinate = createSelector([selectTooltipInteractionState, selectCoordinateForDefaultIndex], (tooltipInteractionState, defaultIndexCoordinate) => {
|
||||
var _tooltipInteractionSt;
|
||||
return (_tooltipInteractionSt = tooltipInteractionState.coordinate) !== null && _tooltipInteractionSt !== void 0 ? _tooltipInteractionSt : defaultIndexCoordinate;
|
||||
});
|
||||
export var selectActiveLabel = createSelector([selectTooltipAxisTicks, selectActiveIndex], combineActiveLabel);
|
||||
export var selectTooltipPayload = createSelector([selectTooltipPayloadConfigurations, selectActiveIndex, selectChartDataWithIndexes, selectTooltipAxisDataKey, selectActiveLabel, selectTooltipPayloadSearcher, pickTooltipEventType], combineTooltipPayload);
|
||||
export var selectIsTooltipActive = 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 (!isInCartesianRange(chartEvent, offset)) {
|
||||
return undefined;
|
||||
}
|
||||
var pos = calculateCartesianTooltipPos(chartEvent, layout);
|
||||
var activeIndex = calculateActiveTickIndex(pos, orderedTooltipTicks, tooltipTicks, tooltipAxisType, tooltipAxisRange);
|
||||
var activeCoordinate = 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 = inRangeOfSector(chartEvent, polarViewBox);
|
||||
if (!rangeObj) {
|
||||
return undefined;
|
||||
}
|
||||
var pos = calculatePolarTooltipPos(rangeObj, layout);
|
||||
var activeIndex = calculateActiveTickIndex(pos, orderedTooltipTicks, tooltipTicks, tooltipAxisType, tooltipAxisRange);
|
||||
var activeCoordinate = getActivePolarCoordinate(layout, tooltipTicks, activeIndex, rangeObj);
|
||||
return {
|
||||
activeIndex: String(activeIndex),
|
||||
activeCoordinate
|
||||
};
|
||||
};
|
||||
export 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);
|
||||
};
|
||||
182
frontend/node_modules/recharts/es6/state/selectors/tooltipSelectors.js
generated
vendored
Normal file
182
frontend/node_modules/recharts/es6/state/selectors/tooltipSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
import { createSelector } from 'reselect';
|
||||
import { combineAllAppliedValues, combineAreasDomain, combineAxisDomain, combineAxisDomainWithNiceTicks, combineCategoricalDomain, combineDisplayedData, combineDomainOfAllAppliedNumericalValuesIncludingErrorValues, combineDomainOfStackGroups, combineDotsDomain, combineDuplicateDomain, combineGraphicalItemsData, combineGraphicalItemsSettings, combineLinesDomain, combineNiceTicks, combineNumericalDomain, combineStackGroups, filterGraphicalNotStackedItems, filterReferenceElements, getDomainDefinition, itemAxisPredicate, mergeDomains, selectAllErrorBarSettings, selectAxisRange, selectHasBar, selectReferenceAreas, selectReferenceDots, selectReferenceLines, selectTooltipAxis, selectTooltipAxisDataKey } from './axisSelectors';
|
||||
import { selectChartLayout } from '../../context/chartLayoutContext';
|
||||
import { isCategoricalAxis } from '../../util/ChartUtils';
|
||||
import { selectChartDataWithIndexes, selectChartDataSliceWithIndexes } from './dataSelectors';
|
||||
import { selectChartName, selectReverseStackOrder, selectStackOffsetType } from './rootPropsSelectors';
|
||||
import { isNotNil, mathSign } from '../../util/DataUtils';
|
||||
import { combineAxisRangeWithReverse } from './combiners/combineAxisRangeWithReverse';
|
||||
import { combineTooltipEventType, selectDefaultTooltipEventType, selectValidateTooltipEventTypes } from './selectTooltipEventType';
|
||||
import { combineActiveLabel } from './combiners/combineActiveLabel';
|
||||
import { selectTooltipSettings } from './selectTooltipSettings';
|
||||
import { combineTooltipInteractionState } from './combiners/combineTooltipInteractionState';
|
||||
import { combineActiveTooltipIndex } from './combiners/combineActiveTooltipIndex';
|
||||
import { combineCoordinateForDefaultIndex } from './combiners/combineCoordinateForDefaultIndex';
|
||||
import { selectChartHeight, selectChartWidth } from './containerSelectors';
|
||||
import { selectChartOffsetInternal } from './selectChartOffsetInternal';
|
||||
import { combineTooltipPayloadConfigurations } from './combiners/combineTooltipPayloadConfigurations';
|
||||
import { selectTooltipPayloadSearcher } from './selectTooltipPayloadSearcher';
|
||||
import { selectTooltipState } from './selectTooltipState';
|
||||
import { combineTooltipPayload } from './combiners/combineTooltipPayload';
|
||||
import { selectTooltipAxisId } from './selectTooltipAxisId';
|
||||
import { selectTooltipAxisType } from './selectTooltipAxisType';
|
||||
import { combineDisplayedStackedData } from './combiners/combineDisplayedStackedData';
|
||||
import { isStacked } from '../types/StackedGraphicalItem';
|
||||
import { numericalDomainSpecifiedWithoutRequiringData } from '../../util/isDomainSpecifiedByUser';
|
||||
import { numberDomainEqualityCheck } from './numberDomainEqualityCheck';
|
||||
import { emptyArraysAreEqualCheck } from './arrayEqualityCheck';
|
||||
import { rechartsScaleFactory } from '../../util/scale/RechartsScale';
|
||||
import { isWellBehavedNumber } from '../../util/isWellBehavedNumber';
|
||||
import { combineRealScaleType } from './combiners/combineRealScaleType';
|
||||
import { combineConfiguredScale } from './combiners/combineConfiguredScale';
|
||||
export var selectTooltipAxisRealScaleType = createSelector([selectTooltipAxis, selectHasBar, selectChartName], combineRealScaleType);
|
||||
export var selectAllUnfilteredGraphicalItems = createSelector([state => state.graphicalItems.cartesianItems, state => state.graphicalItems.polarItems], (cartesianItems, polarItems) => [...cartesianItems, ...polarItems]);
|
||||
var selectTooltipAxisPredicate = createSelector([selectTooltipAxisType, selectTooltipAxisId], itemAxisPredicate);
|
||||
export var selectAllGraphicalItemsSettings = createSelector([selectAllUnfilteredGraphicalItems, selectTooltipAxis, selectTooltipAxisPredicate], combineGraphicalItemsSettings, {
|
||||
memoizeOptions: {
|
||||
resultEqualityCheck: emptyArraysAreEqualCheck
|
||||
}
|
||||
});
|
||||
var selectAllStackedGraphicalItemsSettings = createSelector([selectAllGraphicalItemsSettings], graphicalItems => graphicalItems.filter(isStacked));
|
||||
export var selectTooltipGraphicalItemsData = createSelector([selectAllGraphicalItemsSettings], combineGraphicalItemsData, {
|
||||
memoizeOptions: {
|
||||
resultEqualityCheck: emptyArraysAreEqualCheck
|
||||
}
|
||||
});
|
||||
var selectAnyTooltipItemUsesChartData = 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.
|
||||
*/
|
||||
export var selectTooltipDisplayedData = createSelector([selectTooltipGraphicalItemsData, selectChartDataWithIndexes], combineDisplayedData);
|
||||
var selectTooltipStackedData = createSelector([selectAllStackedGraphicalItemsSettings, selectChartDataWithIndexes, selectTooltipAxis], combineDisplayedStackedData);
|
||||
var selectAllTooltipAppliedValues = createSelector([selectTooltipDisplayedData, selectTooltipAxis, selectAllGraphicalItemsSettings, selectChartDataWithIndexes, selectAnyTooltipItemUsesChartData, selectTooltipGraphicalItemsData], combineAllAppliedValues);
|
||||
var selectTooltipAxisDomainDefinition = createSelector([selectTooltipAxis], getDomainDefinition);
|
||||
var selectTooltipDataOverflow = createSelector([selectTooltipAxis], axisSettings => axisSettings.allowDataOverflow);
|
||||
var selectTooltipDomainFromUserPreferences = createSelector([selectTooltipAxisDomainDefinition, selectTooltipDataOverflow], numericalDomainSpecifiedWithoutRequiringData);
|
||||
var selectAllStackedGraphicalItems = createSelector([selectAllGraphicalItemsSettings], graphicalItems => graphicalItems.filter(isStacked));
|
||||
var selectTooltipStackGroups = createSelector([selectTooltipStackedData, selectAllStackedGraphicalItems, selectStackOffsetType, selectReverseStackOrder], combineStackGroups);
|
||||
var selectTooltipDomainOfStackGroups = createSelector([selectTooltipStackGroups, selectChartDataWithIndexes, selectTooltipAxisType, selectTooltipDomainFromUserPreferences], combineDomainOfStackGroups);
|
||||
var selectTooltipItemsSettingsExceptStacked = createSelector([selectAllGraphicalItemsSettings], filterGraphicalNotStackedItems);
|
||||
var selectDomainOfAllAppliedNumericalValuesIncludingErrorValues = createSelector([selectTooltipDisplayedData, selectTooltipAxis, selectTooltipItemsSettingsExceptStacked, selectAllErrorBarSettings, selectTooltipAxisType, selectChartDataSliceWithIndexes], combineDomainOfAllAppliedNumericalValuesIncludingErrorValues, {
|
||||
memoizeOptions: {
|
||||
resultEqualityCheck: numberDomainEqualityCheck
|
||||
}
|
||||
});
|
||||
var selectReferenceDotsByTooltipAxis = createSelector([selectReferenceDots, selectTooltipAxisType, selectTooltipAxisId], filterReferenceElements);
|
||||
var selectTooltipReferenceDotsDomain = createSelector([selectReferenceDotsByTooltipAxis, selectTooltipAxisType], combineDotsDomain);
|
||||
var selectReferenceAreasByTooltipAxis = createSelector([selectReferenceAreas, selectTooltipAxisType, selectTooltipAxisId], filterReferenceElements);
|
||||
var selectTooltipReferenceAreasDomain = createSelector([selectReferenceAreasByTooltipAxis, selectTooltipAxisType], combineAreasDomain);
|
||||
var selectReferenceLinesByTooltipAxis = createSelector([selectReferenceLines, selectTooltipAxisType, selectTooltipAxisId], filterReferenceElements);
|
||||
var selectTooltipReferenceLinesDomain = createSelector([selectReferenceLinesByTooltipAxis, selectTooltipAxisType], combineLinesDomain);
|
||||
var selectTooltipReferenceElementsDomain = createSelector([selectTooltipReferenceDotsDomain, selectTooltipReferenceLinesDomain, selectTooltipReferenceAreasDomain], mergeDomains);
|
||||
var selectTooltipNumericalDomain = createSelector([selectTooltipAxis, selectTooltipAxisDomainDefinition, selectTooltipDomainFromUserPreferences, selectTooltipDomainOfStackGroups, selectDomainOfAllAppliedNumericalValuesIncludingErrorValues, selectTooltipReferenceElementsDomain, selectChartLayout, selectTooltipAxisType], combineNumericalDomain);
|
||||
export var selectTooltipAxisDomain = createSelector([selectTooltipAxis, selectChartLayout, selectTooltipDisplayedData, selectAllTooltipAppliedValues, selectStackOffsetType, selectTooltipAxisType, selectTooltipNumericalDomain], combineAxisDomain);
|
||||
var selectTooltipNiceTicks = createSelector([selectTooltipAxisDomain, selectTooltipAxis, selectTooltipAxisRealScaleType], combineNiceTicks);
|
||||
export var selectTooltipAxisDomainIncludingNiceTicks = createSelector([selectTooltipAxis, selectTooltipAxisDomain, selectTooltipNiceTicks, selectTooltipAxisType], combineAxisDomainWithNiceTicks);
|
||||
var selectTooltipAxisRange = state => {
|
||||
var axisType = selectTooltipAxisType(state);
|
||||
var axisId = selectTooltipAxisId(state);
|
||||
var isPanorama = false; // Tooltip never displays in panorama so this is safe to assume
|
||||
return selectAxisRange(state, axisType, axisId, isPanorama);
|
||||
};
|
||||
export var selectTooltipAxisRangeWithReverse = createSelector([selectTooltipAxis, selectTooltipAxisRange], combineAxisRangeWithReverse);
|
||||
var selectTooltipConfiguredScale = createSelector([selectTooltipAxis, selectTooltipAxisRealScaleType, selectTooltipAxisDomainIncludingNiceTicks, selectTooltipAxisRangeWithReverse], combineConfiguredScale);
|
||||
export var selectTooltipAxisScale = createSelector([selectTooltipConfiguredScale], rechartsScaleFactory);
|
||||
var selectTooltipDuplicateDomain = createSelector([selectChartLayout, selectAllTooltipAppliedValues, selectTooltipAxis, selectTooltipAxisType], combineDuplicateDomain);
|
||||
export var selectTooltipCategoricalDomain = createSelector([selectChartLayout, selectAllTooltipAppliedValues, selectTooltipAxis, selectTooltipAxisType], combineCategoricalDomain);
|
||||
var combineTicksOfTooltipAxis = (layout, axis, realScaleType, scale, range, duplicateDomain, categoricalDomain, axisType) => {
|
||||
if (!axis) {
|
||||
return undefined;
|
||||
}
|
||||
var type = axis.type;
|
||||
var isCategorical = 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 ? 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 (!isWellBehavedNumber(scaled)) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
coordinate: scaled + offset,
|
||||
value: entry,
|
||||
index,
|
||||
offset
|
||||
};
|
||||
}).filter(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 (!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(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}
|
||||
*/
|
||||
export var selectTooltipAxisTicks = createSelector([selectChartLayout, selectTooltipAxis, selectTooltipAxisRealScaleType, selectTooltipAxisScale, selectTooltipAxisRange, selectTooltipDuplicateDomain, selectTooltipCategoricalDomain, selectTooltipAxisType], combineTicksOfTooltipAxis);
|
||||
var selectTooltipEventType = createSelector([selectDefaultTooltipEventType, selectValidateTooltipEventTypes, selectTooltipSettings], (defaultTooltipEventType, validateTooltipEventType, settings) => combineTooltipEventType(settings.shared, defaultTooltipEventType, validateTooltipEventType));
|
||||
var selectTooltipTrigger = state => state.tooltip.settings.trigger;
|
||||
var selectDefaultIndex = state => state.tooltip.settings.defaultIndex;
|
||||
var selectTooltipInteractionState = createSelector([selectTooltipState, selectTooltipEventType, selectTooltipTrigger, selectDefaultIndex], combineTooltipInteractionState);
|
||||
export var selectActiveTooltipIndex = createSelector([selectTooltipInteractionState, selectTooltipDisplayedData, selectTooltipAxisDataKey, selectTooltipAxisDomain], combineActiveTooltipIndex);
|
||||
export var selectActiveLabel = createSelector([selectTooltipAxisTicks, selectActiveTooltipIndex], combineActiveLabel);
|
||||
export var selectActiveTooltipDataKey = createSelector([selectTooltipInteractionState], tooltipInteraction => {
|
||||
if (!tooltipInteraction) {
|
||||
return undefined;
|
||||
}
|
||||
return tooltipInteraction.dataKey;
|
||||
});
|
||||
export var selectActiveTooltipGraphicalItemId = createSelector([selectTooltipInteractionState], tooltipInteraction => {
|
||||
if (!tooltipInteraction) {
|
||||
return undefined;
|
||||
}
|
||||
return tooltipInteraction.graphicalItemId;
|
||||
});
|
||||
var selectTooltipPayloadConfigurations = createSelector([selectTooltipState, selectTooltipEventType, selectTooltipTrigger, selectDefaultIndex], combineTooltipPayloadConfigurations);
|
||||
var selectTooltipCoordinateForDefaultIndex = createSelector([selectChartWidth, selectChartHeight, selectChartLayout, selectChartOffsetInternal, selectTooltipAxisTicks, selectDefaultIndex, selectTooltipPayloadConfigurations], combineCoordinateForDefaultIndex);
|
||||
export var selectActiveTooltipCoordinate = createSelector([selectTooltipInteractionState, selectTooltipCoordinateForDefaultIndex], (tooltipInteractionState, defaultIndexCoordinate) => {
|
||||
if (tooltipInteractionState !== null && tooltipInteractionState !== void 0 && tooltipInteractionState.coordinate) {
|
||||
return tooltipInteractionState.coordinate;
|
||||
}
|
||||
return defaultIndexCoordinate;
|
||||
});
|
||||
export var selectIsTooltipActive = createSelector([selectTooltipInteractionState], tooltipInteractionState => {
|
||||
var _tooltipInteractionSt;
|
||||
return (_tooltipInteractionSt = tooltipInteractionState === null || tooltipInteractionState === void 0 ? void 0 : tooltipInteractionState.active) !== null && _tooltipInteractionSt !== void 0 ? _tooltipInteractionSt : false;
|
||||
});
|
||||
export var selectActiveTooltipPayload = createSelector([selectTooltipPayloadConfigurations, selectActiveTooltipIndex, selectChartDataWithIndexes, selectTooltipAxisDataKey, selectActiveLabel, selectTooltipPayloadSearcher, selectTooltipEventType], combineTooltipPayload);
|
||||
export var selectActiveTooltipDataPoints = 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));
|
||||
});
|
||||
19
frontend/node_modules/recharts/es6/state/selectors/touchSelectors.js
generated
vendored
Normal file
19
frontend/node_modules/recharts/es6/state/selectors/touchSelectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { createSelector } from 'reselect';
|
||||
import { selectTooltipState } from './selectTooltipState';
|
||||
var selectAllTooltipPayloadConfiguration = createSelector([selectTooltipState], tooltipState => tooltipState.tooltipItemPayloads);
|
||||
export var selectTooltipCoordinate = 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);
|
||||
});
|
||||
87
frontend/node_modules/recharts/es6/state/store.js
generated
vendored
Normal file
87
frontend/node_modules/recharts/es6/state/store.js
generated
vendored
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
import { autoBatchEnhancer, combineReducers, configureStore } from '@reduxjs/toolkit';
|
||||
import { optionsReducer } from './optionsSlice';
|
||||
import { tooltipReducer } from './tooltipSlice';
|
||||
import { chartDataReducer } from './chartDataSlice';
|
||||
import { chartLayoutReducer } from './layoutSlice';
|
||||
import { mouseClickMiddleware, mouseMoveMiddleware } from './mouseEventsMiddleware';
|
||||
import { reduxDevtoolsJsonStringifyReplacer } from './reduxDevtoolsJsonStringifyReplacer';
|
||||
import { cartesianAxisReducer } from './cartesianAxisSlice';
|
||||
import { graphicalItemsReducer } from './graphicalItemsSlice';
|
||||
import { referenceElementsReducer } from './referenceElementsSlice';
|
||||
import { brushReducer } from './brushSlice';
|
||||
import { legendReducer } from './legendSlice';
|
||||
import { rootPropsReducer } from './rootPropsSlice';
|
||||
import { polarAxisReducer } from './polarAxisSlice';
|
||||
import { polarOptionsReducer } from './polarOptionsSlice';
|
||||
import { keyboardEventsMiddleware } from './keyboardEventsMiddleware';
|
||||
import { externalEventsMiddleware } from './externalEventsMiddleware';
|
||||
import { touchEventMiddleware } from './touchEventsMiddleware';
|
||||
import { errorBarReducer } from './errorBarSlice';
|
||||
import { Global } from '../util/Global';
|
||||
import { zIndexReducer } from './zIndexSlice';
|
||||
import { eventSettingsReducer } from './eventSettingsSlice';
|
||||
import { renderedTicksReducer } from './renderedTicksSlice';
|
||||
var rootReducer = combineReducers({
|
||||
brush: brushReducer,
|
||||
cartesianAxis: cartesianAxisReducer,
|
||||
chartData: chartDataReducer,
|
||||
errorBars: errorBarReducer,
|
||||
eventSettings: eventSettingsReducer,
|
||||
graphicalItems: graphicalItemsReducer,
|
||||
layout: chartLayoutReducer,
|
||||
legend: legendReducer,
|
||||
options: optionsReducer,
|
||||
polarAxis: polarAxisReducer,
|
||||
polarOptions: polarOptionsReducer,
|
||||
referenceElements: referenceElementsReducer,
|
||||
renderedTicks: renderedTicksReducer,
|
||||
rootProps: rootPropsReducer,
|
||||
tooltip: tooltipReducer,
|
||||
zIndex: zIndexReducer
|
||||
});
|
||||
export var createRechartsStore = function createRechartsStore(preloadedState) {
|
||||
var chartName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'Chart';
|
||||
return configureStore({
|
||||
reducer: rootReducer,
|
||||
// redux-toolkit v1 types are unhappy with the preloadedState type. Remove the `as any` when bumping to v2
|
||||
preloadedState: preloadedState,
|
||||
// @ts-expect-error redux-toolkit v1 types are unhappy with the middleware array. Remove this comment when bumping to v2
|
||||
middleware: getDefaultMiddleware => {
|
||||
var _process$env$NODE_ENV;
|
||||
return getDefaultMiddleware({
|
||||
serializableCheck: false,
|
||||
immutableCheck: !['commonjs', 'es6', 'production'].includes((_process$env$NODE_ENV = "es6") !== null && _process$env$NODE_ENV !== void 0 ? _process$env$NODE_ENV : '')
|
||||
}).concat([mouseClickMiddleware.middleware, mouseMoveMiddleware.middleware, keyboardEventsMiddleware.middleware, externalEventsMiddleware.middleware, touchEventMiddleware.middleware]);
|
||||
},
|
||||
/*
|
||||
* I can't find out how to satisfy typescript here.
|
||||
* We return `EnhancerArray<[StoreEnhancer<{}, {}>, StoreEnhancer]>` from this function,
|
||||
* but the types say we should return `EnhancerArray<StoreEnhancer<{}, {}>`.
|
||||
* Looks like it's badly inferred generics, but it won't allow me to provide the correct type manually either.
|
||||
* So let's just ignore the error for now.
|
||||
*/
|
||||
// @ts-expect-error mismatched generics
|
||||
enhancers: getDefaultEnhancers => {
|
||||
var enhancers = getDefaultEnhancers;
|
||||
if (typeof getDefaultEnhancers === 'function') {
|
||||
/*
|
||||
* In RTK v2 this is always a function, but in v1 it is an array.
|
||||
* Because we have @types/redux-toolkit v1 as a dependency, typescript is going to flag this as an error.
|
||||
* We support both RTK v1 and v2, so we need to do this check.
|
||||
* https://redux-toolkit.js.org/usage/migrating-rtk-2#configurestoreenhancers-must-be-a-callback
|
||||
*/
|
||||
// @ts-expect-error RTK v2 behaviour on RTK v1 types
|
||||
enhancers = getDefaultEnhancers();
|
||||
}
|
||||
return enhancers.concat(autoBatchEnhancer({
|
||||
type: 'raf'
|
||||
}));
|
||||
},
|
||||
devTools: Global.devToolsEnabled && {
|
||||
serialize: {
|
||||
replacer: reduxDevtoolsJsonStringifyReplacer
|
||||
},
|
||||
name: "recharts-".concat(chartName)
|
||||
}
|
||||
});
|
||||
};
|
||||
222
frontend/node_modules/recharts/es6/state/tooltipSlice.js
generated
vendored
Normal file
222
frontend/node_modules/recharts/es6/state/tooltipSlice.js
generated
vendored
Normal file
|
|
@ -0,0 +1,222 @@
|
|||
import { createSlice, current, prepareAutoBatched } from '@reduxjs/toolkit';
|
||||
import { castDraft } from 'immer';
|
||||
|
||||
/**
|
||||
* One Tooltip can display multiple TooltipPayloadEntries at a time.
|
||||
*/
|
||||
|
||||
/**
|
||||
* So what happens is that the tooltip payload is decided based on the available data, and the dataKey.
|
||||
* The dataKey can either be defined on the graphical element (like Line, or Bar)
|
||||
* or on the tooltip itself.
|
||||
*
|
||||
* The data can be defined in the chart element, or in the graphical item.
|
||||
*
|
||||
* So this type is all the settings, other than the data + dataKey complications.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This is what Tooltip renders.
|
||||
*/
|
||||
|
||||
/**
|
||||
* null means no active index
|
||||
* string means: whichever index from the chart data it is.
|
||||
* Different charts have different requirements on data shapes,
|
||||
* and are also responsible for providing a function that will accept this index
|
||||
* and return data.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Different items have different data shapes so the state has no opinion on what the data shape should be;
|
||||
* the only requirement is that the chart also provides a searcher function
|
||||
* that accepts the data, and a key, and returns whatever the payload in Tooltip should be.
|
||||
*/
|
||||
|
||||
/**
|
||||
* So this informs the "tooltip event type". Tooltip event type can be either "axis" or "item"
|
||||
* and it is used for two things:
|
||||
* 1. Sets the active area
|
||||
* 2. Sets the background and cursor highlights
|
||||
*
|
||||
* Some charts only allow to have one type of tooltip event type, some allow both.
|
||||
* Those charts that allow both will have one default, and the "shared" prop will be used to switch between them.
|
||||
* Undefined means "use the chart default".
|
||||
*
|
||||
* Charts that only allow one tooltip event type, will ignore the shared prop.
|
||||
*/
|
||||
|
||||
/**
|
||||
* A generic state for user interaction with the chart.
|
||||
* User interaction can come through multiple channels: mouse events, keyboard events, or hardcoded in props, or synchronised from other charts.
|
||||
*
|
||||
* Each of the interaction states is represented as TooltipInteractionState,
|
||||
* and then the selectors and Tooltip will decide which of the interaction states to use.
|
||||
*/
|
||||
|
||||
export var noInteraction = {
|
||||
active: false,
|
||||
index: null,
|
||||
dataKey: undefined,
|
||||
graphicalItemId: undefined,
|
||||
coordinate: undefined
|
||||
};
|
||||
|
||||
/**
|
||||
* The tooltip interaction state stores:
|
||||
*
|
||||
* - Which graphical item is user interacting with at the moment,
|
||||
* - which axis (or, which part of chart background) is user interacting with at the moment
|
||||
* - The data that individual graphical items wish to be displayed in case the tooltip gets activated
|
||||
*/
|
||||
|
||||
export var initialState = {
|
||||
itemInteraction: {
|
||||
click: noInteraction,
|
||||
hover: noInteraction
|
||||
},
|
||||
axisInteraction: {
|
||||
click: noInteraction,
|
||||
hover: noInteraction
|
||||
},
|
||||
keyboardInteraction: noInteraction,
|
||||
syncInteraction: {
|
||||
active: false,
|
||||
index: null,
|
||||
dataKey: undefined,
|
||||
label: undefined,
|
||||
coordinate: undefined,
|
||||
sourceViewBox: undefined,
|
||||
graphicalItemId: undefined
|
||||
},
|
||||
tooltipItemPayloads: [],
|
||||
settings: {
|
||||
shared: undefined,
|
||||
trigger: 'hover',
|
||||
axisId: 0,
|
||||
active: false,
|
||||
defaultIndex: undefined
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* This is the event we get when user is interacting with a specific graphical item.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Keyboard interaction payload has no graphical item ID,
|
||||
* and no dataKey, because keyboard interaction is always
|
||||
* with the whole chart, not with a specific graphical item.
|
||||
*/
|
||||
|
||||
var tooltipSlice = createSlice({
|
||||
name: 'tooltip',
|
||||
initialState,
|
||||
reducers: {
|
||||
addTooltipEntrySettings: {
|
||||
reducer(state, action) {
|
||||
state.tooltipItemPayloads.push(castDraft(action.payload));
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
replaceTooltipEntrySettings: {
|
||||
reducer(state, action) {
|
||||
var _action$payload = action.payload,
|
||||
prev = _action$payload.prev,
|
||||
next = _action$payload.next;
|
||||
var index = current(state).tooltipItemPayloads.indexOf(castDraft(prev));
|
||||
if (index > -1) {
|
||||
state.tooltipItemPayloads[index] = castDraft(next);
|
||||
}
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
removeTooltipEntrySettings: {
|
||||
reducer(state, action) {
|
||||
var index = current(state).tooltipItemPayloads.indexOf(castDraft(action.payload));
|
||||
if (index > -1) {
|
||||
state.tooltipItemPayloads.splice(index, 1);
|
||||
}
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
setTooltipSettingsState(state, action) {
|
||||
state.settings = action.payload;
|
||||
},
|
||||
setActiveMouseOverItemIndex(state, action) {
|
||||
state.syncInteraction.active = false;
|
||||
state.syncInteraction.sourceViewBox = undefined;
|
||||
state.keyboardInteraction.active = false;
|
||||
state.itemInteraction.hover.active = true;
|
||||
state.itemInteraction.hover.index = action.payload.activeIndex;
|
||||
state.itemInteraction.hover.dataKey = action.payload.activeDataKey;
|
||||
state.itemInteraction.hover.graphicalItemId = action.payload.activeGraphicalItemId;
|
||||
state.itemInteraction.hover.coordinate = action.payload.activeCoordinate;
|
||||
},
|
||||
mouseLeaveChart(state) {
|
||||
/*
|
||||
* Clear only the active flags. Why?
|
||||
* 1. Keep Coordinate to preserve animation - next time the Tooltip appears, we want to render it from
|
||||
* the last place where it was when it disappeared.
|
||||
* 2. We want to keep all the properties anyway just in case the tooltip has `active=true` prop
|
||||
* and continues being visible even after the mouse has left the chart.
|
||||
*/
|
||||
state.itemInteraction.hover.active = false;
|
||||
state.axisInteraction.hover.active = false;
|
||||
},
|
||||
mouseLeaveItem(state) {
|
||||
state.itemInteraction.hover.active = false;
|
||||
},
|
||||
setActiveClickItemIndex(state, action) {
|
||||
state.syncInteraction.active = false;
|
||||
state.syncInteraction.sourceViewBox = undefined;
|
||||
state.itemInteraction.click.active = true;
|
||||
state.keyboardInteraction.active = false;
|
||||
state.itemInteraction.click.index = action.payload.activeIndex;
|
||||
state.itemInteraction.click.dataKey = action.payload.activeDataKey;
|
||||
state.itemInteraction.click.graphicalItemId = action.payload.activeGraphicalItemId;
|
||||
state.itemInteraction.click.coordinate = action.payload.activeCoordinate;
|
||||
},
|
||||
setMouseOverAxisIndex(state, action) {
|
||||
state.syncInteraction.active = false;
|
||||
state.syncInteraction.sourceViewBox = undefined;
|
||||
state.axisInteraction.hover.active = true;
|
||||
state.keyboardInteraction.active = false;
|
||||
state.axisInteraction.hover.index = action.payload.activeIndex;
|
||||
state.axisInteraction.hover.dataKey = action.payload.activeDataKey;
|
||||
state.axisInteraction.hover.coordinate = action.payload.activeCoordinate;
|
||||
},
|
||||
setMouseClickAxisIndex(state, action) {
|
||||
state.syncInteraction.active = false;
|
||||
state.syncInteraction.sourceViewBox = undefined;
|
||||
state.keyboardInteraction.active = false;
|
||||
state.axisInteraction.click.active = true;
|
||||
state.axisInteraction.click.index = action.payload.activeIndex;
|
||||
state.axisInteraction.click.dataKey = action.payload.activeDataKey;
|
||||
state.axisInteraction.click.coordinate = action.payload.activeCoordinate;
|
||||
},
|
||||
setSyncInteraction(state, action) {
|
||||
state.syncInteraction = action.payload;
|
||||
},
|
||||
setKeyboardInteraction(state, action) {
|
||||
state.keyboardInteraction.active = action.payload.active;
|
||||
state.keyboardInteraction.index = action.payload.activeIndex;
|
||||
state.keyboardInteraction.coordinate = action.payload.activeCoordinate;
|
||||
}
|
||||
}
|
||||
});
|
||||
var _tooltipSlice$actions = tooltipSlice.actions,
|
||||
addTooltipEntrySettings = _tooltipSlice$actions.addTooltipEntrySettings,
|
||||
replaceTooltipEntrySettings = _tooltipSlice$actions.replaceTooltipEntrySettings,
|
||||
removeTooltipEntrySettings = _tooltipSlice$actions.removeTooltipEntrySettings,
|
||||
setTooltipSettingsState = _tooltipSlice$actions.setTooltipSettingsState,
|
||||
setActiveMouseOverItemIndex = _tooltipSlice$actions.setActiveMouseOverItemIndex,
|
||||
mouseLeaveItem = _tooltipSlice$actions.mouseLeaveItem,
|
||||
mouseLeaveChart = _tooltipSlice$actions.mouseLeaveChart,
|
||||
setActiveClickItemIndex = _tooltipSlice$actions.setActiveClickItemIndex,
|
||||
setMouseOverAxisIndex = _tooltipSlice$actions.setMouseOverAxisIndex,
|
||||
setMouseClickAxisIndex = _tooltipSlice$actions.setMouseClickAxisIndex,
|
||||
setSyncInteraction = _tooltipSlice$actions.setSyncInteraction,
|
||||
setKeyboardInteraction = _tooltipSlice$actions.setKeyboardInteraction;
|
||||
export { addTooltipEntrySettings, replaceTooltipEntrySettings, removeTooltipEntrySettings, setTooltipSettingsState, setActiveMouseOverItemIndex, mouseLeaveItem, mouseLeaveChart, setActiveClickItemIndex, setMouseOverAxisIndex, setMouseClickAxisIndex, setSyncInteraction, setKeyboardInteraction };
|
||||
export var tooltipReducer = tooltipSlice.reducer;
|
||||
113
frontend/node_modules/recharts/es6/state/touchEventsMiddleware.js
generated
vendored
Normal file
113
frontend/node_modules/recharts/es6/state/touchEventsMiddleware.js
generated
vendored
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
import { createAction, createListenerMiddleware } from '@reduxjs/toolkit';
|
||||
import { setActiveMouseOverItemIndex, setMouseOverAxisIndex } from './tooltipSlice';
|
||||
import { selectActivePropsFromChartPointer } from './selectors/selectActivePropsFromChartPointer';
|
||||
import { getRelativeCoordinate } from '../util/getRelativeCoordinate';
|
||||
import { selectTooltipEventType } from './selectors/selectTooltipEventType';
|
||||
import { DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME, DATA_ITEM_INDEX_ATTRIBUTE_NAME } from '../util/Constants';
|
||||
import { selectTooltipCoordinate } from './selectors/touchSelectors';
|
||||
import { selectAllGraphicalItemsSettings } from './selectors/tooltipSelectors';
|
||||
import { createEventProxy } from '../util/createEventProxy';
|
||||
export var touchEventAction = createAction('touchMove');
|
||||
export var touchEventMiddleware = createListenerMiddleware();
|
||||
var rafId = null;
|
||||
var timeoutId = null;
|
||||
var latestChartPointers = null;
|
||||
var latestTouchEvent = null;
|
||||
touchEventMiddleware.startListening({
|
||||
actionCreator: touchEventAction,
|
||||
effect: (action, listenerApi) => {
|
||||
var touchEvent = action.payload;
|
||||
if (touchEvent.touches == null || touchEvent.touches.length === 0) {
|
||||
return;
|
||||
}
|
||||
latestTouchEvent = createEventProxy(touchEvent);
|
||||
var state = listenerApi.getState();
|
||||
var _state$eventSettings = state.eventSettings,
|
||||
throttleDelay = _state$eventSettings.throttleDelay,
|
||||
throttledEvents = _state$eventSettings.throttledEvents;
|
||||
var isThrottled = throttledEvents === 'all' || throttledEvents.includes('touchmove');
|
||||
if (rafId !== null) {
|
||||
cancelAnimationFrame(rafId);
|
||||
rafId = null;
|
||||
}
|
||||
if (timeoutId !== null && (typeof throttleDelay !== 'number' || !isThrottled)) {
|
||||
clearTimeout(timeoutId);
|
||||
timeoutId = null;
|
||||
}
|
||||
latestChartPointers = Array.from(touchEvent.touches).map(touch => getRelativeCoordinate({
|
||||
clientX: touch.clientX,
|
||||
clientY: touch.clientY,
|
||||
currentTarget: touchEvent.currentTarget
|
||||
}));
|
||||
var callback = () => {
|
||||
if (latestTouchEvent == null) {
|
||||
return;
|
||||
}
|
||||
var currentState = listenerApi.getState();
|
||||
var tooltipEventType = selectTooltipEventType(currentState, currentState.tooltip.settings.shared);
|
||||
if (tooltipEventType === 'axis') {
|
||||
var _latestChartPointers;
|
||||
var latestTouchPointer = (_latestChartPointers = latestChartPointers) === null || _latestChartPointers === void 0 ? void 0 : _latestChartPointers[0];
|
||||
if (latestTouchPointer == null) {
|
||||
rafId = null;
|
||||
timeoutId = null;
|
||||
return;
|
||||
}
|
||||
var activeProps = selectActivePropsFromChartPointer(currentState, latestTouchPointer);
|
||||
if ((activeProps === null || activeProps === void 0 ? void 0 : activeProps.activeIndex) != null) {
|
||||
listenerApi.dispatch(setMouseOverAxisIndex({
|
||||
activeIndex: activeProps.activeIndex,
|
||||
activeDataKey: undefined,
|
||||
activeCoordinate: activeProps.activeCoordinate
|
||||
}));
|
||||
}
|
||||
} else if (tooltipEventType === 'item') {
|
||||
var _target$getAttribute;
|
||||
var touch = latestTouchEvent.touches[0];
|
||||
if (document.elementFromPoint == null || touch == null) {
|
||||
return;
|
||||
}
|
||||
var target = document.elementFromPoint(touch.clientX, touch.clientY);
|
||||
if (!target || !target.getAttribute) {
|
||||
return;
|
||||
}
|
||||
var itemIndex = target.getAttribute(DATA_ITEM_INDEX_ATTRIBUTE_NAME);
|
||||
var graphicalItemId = (_target$getAttribute = target.getAttribute(DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME)) !== null && _target$getAttribute !== void 0 ? _target$getAttribute : undefined;
|
||||
var settings = selectAllGraphicalItemsSettings(currentState).find(item => item.id === graphicalItemId);
|
||||
if (itemIndex == null || settings == null || graphicalItemId == null) {
|
||||
return;
|
||||
}
|
||||
var dataKey = settings.dataKey;
|
||||
var coordinate = selectTooltipCoordinate(currentState, itemIndex, graphicalItemId);
|
||||
listenerApi.dispatch(setActiveMouseOverItemIndex({
|
||||
activeDataKey: dataKey,
|
||||
activeIndex: itemIndex,
|
||||
activeCoordinate: coordinate,
|
||||
activeGraphicalItemId: graphicalItemId
|
||||
}));
|
||||
}
|
||||
rafId = null;
|
||||
timeoutId = null;
|
||||
};
|
||||
if (!isThrottled) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
if (throttleDelay === 'raf') {
|
||||
rafId = requestAnimationFrame(callback);
|
||||
} else if (typeof throttleDelay === 'number') {
|
||||
if (timeoutId === null) {
|
||||
callback();
|
||||
latestTouchEvent = null;
|
||||
timeoutId = setTimeout(() => {
|
||||
if (latestTouchEvent) {
|
||||
callback();
|
||||
} else {
|
||||
timeoutId = null;
|
||||
rafId = null;
|
||||
}
|
||||
}, throttleDelay);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
1
frontend/node_modules/recharts/es6/state/types/AreaSettings.js
generated
vendored
Normal file
1
frontend/node_modules/recharts/es6/state/types/AreaSettings.js
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export {};
|
||||
1
frontend/node_modules/recharts/es6/state/types/BarSettings.js
generated
vendored
Normal file
1
frontend/node_modules/recharts/es6/state/types/BarSettings.js
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export {};
|
||||
1
frontend/node_modules/recharts/es6/state/types/LineSettings.js
generated
vendored
Normal file
1
frontend/node_modules/recharts/es6/state/types/LineSettings.js
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export {};
|
||||
1
frontend/node_modules/recharts/es6/state/types/PieSettings.js
generated
vendored
Normal file
1
frontend/node_modules/recharts/es6/state/types/PieSettings.js
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export {};
|
||||
1
frontend/node_modules/recharts/es6/state/types/RadarSettings.js
generated
vendored
Normal file
1
frontend/node_modules/recharts/es6/state/types/RadarSettings.js
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export {};
|
||||
1
frontend/node_modules/recharts/es6/state/types/RadialBarSettings.js
generated
vendored
Normal file
1
frontend/node_modules/recharts/es6/state/types/RadialBarSettings.js
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export {};
|
||||
1
frontend/node_modules/recharts/es6/state/types/ScatterSettings.js
generated
vendored
Normal file
1
frontend/node_modules/recharts/es6/state/types/ScatterSettings.js
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export {};
|
||||
14
frontend/node_modules/recharts/es6/state/types/StackedGraphicalItem.js
generated
vendored
Normal file
14
frontend/node_modules/recharts/es6/state/types/StackedGraphicalItem.js
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/**
|
||||
* Some graphical items allow data stacking. The stacks are optional,
|
||||
* so all props here are optional too.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Some graphical items allow data stacking.
|
||||
* This interface is used to represent the items that are stacked
|
||||
* because the user has provided the stackId and dataKey properties.
|
||||
*/
|
||||
|
||||
export function isStacked(graphicalItem) {
|
||||
return 'stackId' in graphicalItem && graphicalItem.stackId != null && graphicalItem.dataKey != null;
|
||||
}
|
||||
108
frontend/node_modules/recharts/es6/state/zIndexSlice.js
generated
vendored
Normal file
108
frontend/node_modules/recharts/es6/state/zIndexSlice.js
generated
vendored
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
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); }
|
||||
/**
|
||||
* This slice contains a registry of z-index values for various components.
|
||||
* The state is a map from z-index numbers to element references.
|
||||
*/
|
||||
import { createSlice, prepareAutoBatched } from '@reduxjs/toolkit';
|
||||
import { castDraft } from 'immer';
|
||||
import { DefaultZIndexes } from '../zIndex/DefaultZIndexes';
|
||||
var seed = {};
|
||||
var initialState = {
|
||||
zIndexMap: Object.values(DefaultZIndexes).reduce((acc, current) => _objectSpread(_objectSpread({}, acc), {}, {
|
||||
[current]: {
|
||||
element: undefined,
|
||||
panoramaElement: undefined,
|
||||
consumers: 0
|
||||
}
|
||||
}), seed)
|
||||
};
|
||||
var defaultZIndexSet = new Set(Object.values(DefaultZIndexes));
|
||||
function isDefaultZIndex(zIndex) {
|
||||
return defaultZIndexSet.has(zIndex);
|
||||
}
|
||||
var zIndexSlice = createSlice({
|
||||
name: 'zIndex',
|
||||
initialState,
|
||||
reducers: {
|
||||
registerZIndexPortal: {
|
||||
reducer: (state, action) => {
|
||||
var zIndex = action.payload.zIndex;
|
||||
if (state.zIndexMap[zIndex]) {
|
||||
state.zIndexMap[zIndex].consumers += 1;
|
||||
} else {
|
||||
state.zIndexMap[zIndex] = {
|
||||
consumers: 1,
|
||||
element: undefined,
|
||||
panoramaElement: undefined
|
||||
};
|
||||
}
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
unregisterZIndexPortal: {
|
||||
reducer: (state, action) => {
|
||||
var zIndex = action.payload.zIndex;
|
||||
if (state.zIndexMap[zIndex]) {
|
||||
state.zIndexMap[zIndex].consumers -= 1;
|
||||
/*
|
||||
* Garbage collect unused z-index entries, except for default z-indexes.
|
||||
* Default z-indexes are always rendered, regardless of whether there are consumers or not.
|
||||
* And because of that, even if we delete this entry, the ZIndexPortal provider will still be rendered
|
||||
* and React is not going to re-create it, and it won't re-register the element ID.
|
||||
* So let's not delete default z-index entries.
|
||||
*/
|
||||
if (state.zIndexMap[zIndex].consumers <= 0 && !isDefaultZIndex(zIndex)) {
|
||||
delete state.zIndexMap[zIndex];
|
||||
}
|
||||
}
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
registerZIndexPortalElement: {
|
||||
reducer: (state, action) => {
|
||||
var _action$payload = action.payload,
|
||||
zIndex = _action$payload.zIndex,
|
||||
element = _action$payload.element,
|
||||
isPanorama = _action$payload.isPanorama;
|
||||
if (state.zIndexMap[zIndex]) {
|
||||
if (isPanorama) {
|
||||
state.zIndexMap[zIndex].panoramaElement = castDraft(element);
|
||||
} else {
|
||||
state.zIndexMap[zIndex].element = castDraft(element);
|
||||
}
|
||||
} else {
|
||||
state.zIndexMap[zIndex] = {
|
||||
consumers: 0,
|
||||
element: isPanorama ? undefined : castDraft(element),
|
||||
panoramaElement: isPanorama ? castDraft(element) : undefined
|
||||
};
|
||||
}
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
},
|
||||
unregisterZIndexPortalElement: {
|
||||
reducer: (state, action) => {
|
||||
var zIndex = action.payload.zIndex;
|
||||
if (state.zIndexMap[zIndex]) {
|
||||
if (action.payload.isPanorama) {
|
||||
state.zIndexMap[zIndex].panoramaElement = undefined;
|
||||
} else {
|
||||
state.zIndexMap[zIndex].element = undefined;
|
||||
}
|
||||
}
|
||||
},
|
||||
prepare: prepareAutoBatched()
|
||||
}
|
||||
}
|
||||
});
|
||||
var _zIndexSlice$actions = zIndexSlice.actions,
|
||||
registerZIndexPortal = _zIndexSlice$actions.registerZIndexPortal,
|
||||
unregisterZIndexPortal = _zIndexSlice$actions.unregisterZIndexPortal,
|
||||
registerZIndexPortalElement = _zIndexSlice$actions.registerZIndexPortalElement,
|
||||
unregisterZIndexPortalElement = _zIndexSlice$actions.unregisterZIndexPortalElement;
|
||||
export { registerZIndexPortal, unregisterZIndexPortal, registerZIndexPortalElement, unregisterZIndexPortalElement };
|
||||
export var zIndexReducer = zIndexSlice.reducer;
|
||||
Loading…
Add table
Add a link
Reference in a new issue