@octanejs/recharts 0.1.51 → 0.1.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/animation/AnimationController.ts +1 -1
- package/src/animation/AnimationControllerImpl.ts +2 -2
- package/src/animation/AnimationHandle.ts +1 -1
- package/src/animation/CSSTransitionAnimate.tsrx +1 -1
- package/src/animation/matchBy.ts +1 -1
- package/src/animation/useAnimationController.ts +1 -1
- package/src/cartesian/Area.tsrx +23 -19
- package/src/cartesian/AreaRevealShape.tsrx +2 -2
- package/src/cartesian/Bar.tsrx +2 -2
- package/src/cartesian/BarStack.tsrx +2 -2
- package/src/cartesian/CartesianGrid.tsrx +6 -6
- package/src/cartesian/ErrorBar.tsrx +5 -5
- package/src/cartesian/Funnel.tsrx +34 -31
- package/src/cartesian/ReferenceLine.tsrx +10 -7
- package/src/cartesian/Scatter.tsrx +44 -36
- package/src/cartesian/ZAxis.tsrx +4 -4
- package/src/cartesian/getCartesianPosition.ts +2 -2
- package/src/cartesian/getEquidistantTicks.ts +2 -2
- package/src/cartesian/getTicks.ts +2 -2
- package/src/chart/AreaChart.tsrx +1 -1
- package/src/chart/ComposedChart.tsrx +1 -1
- package/src/chart/FunnelChart.tsrx +1 -1
- package/src/chart/PieChart.tsrx +1 -1
- package/src/chart/PolarChart.tsrx +3 -3
- package/src/chart/RadarChart.tsrx +1 -1
- package/src/chart/RadialBarChart.tsrx +1 -1
- package/src/chart/RechartsWrapper.tsrx +4 -4
- package/src/chart/Sankey.tsrx +11 -11
- package/src/chart/ScatterChart.tsrx +1 -1
- package/src/chart/SunburstChart.tsrx +16 -10
- package/src/component/Cursor.tsrx +7 -7
- package/src/component/DefaultLegendContent.tsrx +5 -5
- package/src/component/DefaultTooltipContent.tsrx +2 -2
- package/src/component/Label.tsrx +2 -2
- package/src/component/LabelList.tsrx +2 -2
- package/src/component/Legend.tsrx +8 -8
- package/src/component/ResponsiveContainer.tsrx +1 -1
- package/src/component/Tooltip.tsrx +12 -12
- package/src/component/TooltipBoundingBox.tsrx +2 -2
- package/src/container/ClipPathProvider.tsrx +2 -2
- package/src/context/CellsContext.ts +1 -1
- package/src/context/ErrorBarContext.tsrx +1 -1
- package/src/context/RegisterGraphicalItemId.tsrx +1 -3
- package/src/context/legendPayloadContext.tsrx +1 -1
- package/src/context/tooltipContext.ts +2 -2
- package/src/context/useTooltipAxis.ts +1 -1
- package/src/hooks.ts +6 -6
- package/src/polar/Pie.tsrx +32 -32
- package/src/polar/PolarAngleAxis.tsrx +16 -16
- package/src/polar/PolarGrid.tsrx +3 -3
- package/src/polar/PolarRadiusAxis.tsrx +17 -17
- package/src/polar/Radar.tsrx +10 -10
- package/src/polar/RadialBar.tsrx +31 -31
- package/src/polar/defaultPolarAngleAxisProps.ts +1 -1
- package/src/polar/defaultPolarRadiusAxisProps.ts +1 -1
- package/src/state/ReportPolarOptions.tsrx +1 -1
- package/src/state/brushSlice.ts +2 -2
- package/src/state/cartesianAxisSlice.ts +4 -4
- package/src/state/chartDataSlice.ts +2 -2
- package/src/state/errorBarSlice.ts +4 -4
- package/src/state/eventSettingsSlice.ts +2 -2
- package/src/state/externalEventsMiddleware.ts +5 -5
- package/src/state/graphicalItemsSlice.ts +11 -11
- package/src/state/keyboardEventsMiddleware.ts +3 -3
- package/src/state/layoutSlice.ts +2 -2
- package/src/state/legendSlice.ts +3 -3
- package/src/state/mouseEventsMiddleware.ts +4 -4
- package/src/state/optionsSlice.ts +2 -2
- package/src/state/polarAxisSlice.ts +2 -2
- package/src/state/polarOptionsSlice.ts +1 -1
- package/src/state/referenceElementsSlice.ts +5 -5
- package/src/state/renderedTicksSlice.ts +4 -4
- package/src/state/rootPropsSlice.ts +4 -4
- package/src/state/selectors/areaSelectors.ts +7 -7
- package/src/state/selectors/axisSelectors.ts +22 -18
- package/src/state/selectors/barSelectors.ts +11 -11
- package/src/state/selectors/brushSelectors.ts +2 -2
- package/src/state/selectors/combiners/combineActiveLabel.ts +3 -3
- package/src/state/selectors/combiners/combineActiveTooltipIndex.ts +3 -3
- package/src/state/selectors/combiners/combineAllBarPositions.ts +3 -3
- package/src/state/selectors/combiners/combineAxisRangeWithReverse.ts +2 -2
- package/src/state/selectors/combiners/combineBarPosition.ts +3 -3
- package/src/state/selectors/combiners/combineBarSizeList.ts +5 -5
- package/src/state/selectors/combiners/combineCheckedDomain.ts +1 -1
- package/src/state/selectors/combiners/combineConfiguredScale.ts +4 -4
- package/src/state/selectors/combiners/combineCoordinateForDefaultIndex.ts +2 -2
- package/src/state/selectors/combiners/combineDisplayedStackedData.ts +4 -4
- package/src/state/selectors/combiners/combineInverseScaleFunction.ts +2 -2
- package/src/state/selectors/combiners/combineRealScaleType.ts +2 -2
- package/src/state/selectors/combiners/combineStackedData.ts +2 -2
- package/src/state/selectors/combiners/combineTooltipInteractionState.ts +5 -5
- package/src/state/selectors/combiners/combineTooltipPayload.ts +4 -4
- package/src/state/selectors/combiners/combineTooltipPayloadConfigurations.ts +4 -4
- package/src/state/selectors/containerSelectors.ts +2 -2
- package/src/state/selectors/dataSelectors.ts +2 -2
- package/src/state/selectors/funnelSelectors.ts +5 -5
- package/src/state/selectors/graphicalItemSelectors.ts +3 -3
- package/src/state/selectors/legendSelectors.ts +4 -4
- package/src/state/selectors/lineSelectors.ts +6 -6
- package/src/state/selectors/numberDomainEqualityCheck.ts +1 -1
- package/src/state/selectors/pickAxisId.ts +2 -2
- package/src/state/selectors/pickAxisType.ts +1 -1
- package/src/state/selectors/pieSelectors.ts +5 -5
- package/src/state/selectors/polarAxisSelectors.ts +6 -6
- package/src/state/selectors/polarGridSelectors.ts +3 -3
- package/src/state/selectors/polarScaleSelectors.ts +4 -4
- package/src/state/selectors/polarSelectors.ts +6 -6
- package/src/state/selectors/radarSelectors.ts +11 -11
- package/src/state/selectors/radialBarSelectors.ts +16 -16
- package/src/state/selectors/rootPropsSelectors.ts +4 -4
- package/src/state/selectors/scatterSelectors.ts +8 -8
- package/src/state/selectors/selectActivePropsFromChartPointer.ts +3 -3
- package/src/state/selectors/selectAllAxes.ts +2 -2
- package/src/state/selectors/selectChartOffset.ts +2 -2
- package/src/state/selectors/selectChartOffsetInternal.ts +4 -4
- package/src/state/selectors/selectTooltipAxisId.ts +2 -2
- package/src/state/selectors/selectTooltipAxisType.ts +1 -1
- package/src/state/selectors/selectTooltipEventType.ts +3 -3
- package/src/state/selectors/selectTooltipPayloadSearcher.ts +2 -2
- package/src/state/selectors/selectTooltipSettings.ts +2 -2
- package/src/state/selectors/selectTooltipState.ts +2 -2
- package/src/state/selectors/selectors.ts +5 -5
- package/src/state/selectors/tooltipSelectors.ts +16 -16
- package/src/state/selectors/touchSelectors.ts +4 -4
- package/src/state/store.ts +3 -3
- package/src/state/tooltipSlice.ts +5 -5
- package/src/state/touchEventsMiddleware.ts +4 -4
- package/src/state/types/AreaSettings.ts +5 -5
- package/src/state/types/BarSettings.ts +3 -3
- package/src/state/types/LineSettings.ts +3 -3
- package/src/state/types/PieSettings.ts +5 -5
- package/src/state/types/RadarSettings.ts +1 -1
- package/src/state/types/RadialBarSettings.ts +2 -2
- package/src/state/types/ScatterSettings.ts +4 -4
- package/src/state/types/StackedGraphicalItem.ts +3 -3
- package/src/state/zIndexSlice.ts +1 -1
- package/src/synchronisation/syncSelectors.ts +2 -2
- package/src/synchronisation/types.ts +2 -2
- package/src/util/CartesianUtils.ts +1 -1
- package/src/util/ChartUtils.ts +8 -8
- package/src/util/DOMUtils.ts +1 -1
- package/src/util/DataUtils.ts +1 -1
- package/src/util/Events.ts +3 -3
- package/src/util/FunnelUtils.tsrx +2 -2
- package/src/util/PolarUtils.ts +1 -1
- package/src/util/RadialBarUtils.tsrx +2 -2
- package/src/util/ScatterUtils.tsrx +4 -4
- package/src/util/TickUtils.ts +1 -1
- package/src/util/axisPropsAreEqual.ts +3 -3
- package/src/util/cursor/getCursorPoints.ts +6 -6
- package/src/util/cursor/getCursorRectangle.ts +1 -1
- package/src/util/cursor/getRadialCursorPoints.ts +1 -1
- package/src/util/getActiveCoordinate.ts +2 -2
- package/src/util/getAxisTypeBasedOnLayout.ts +1 -1
- package/src/util/getRadiusAndStrokeWidthFromDot.ts +1 -1
- package/src/util/getRelativeCoordinate.ts +1 -1
- package/src/util/isDomainSpecifiedByUser.ts +1 -1
- package/src/util/scale/CartesianScaleHelper.ts +2 -2
- package/src/util/scale/CustomScaleDefinition.ts +1 -1
- package/src/util/scale/RechartsScale.ts +2 -2
- package/src/util/scale/createCategoricalInverse.ts +2 -2
- package/src/util/scale/getNiceTickValues.ts +2 -2
- package/src/util/stacks/getStackSeriesIdentifier.ts +2 -2
- package/src/util/stacks/stackTypes.ts +4 -4
- package/src/util/tooltip/translate.ts +1 -1
- package/src/util/types.ts +12 -12
- package/src/zIndex/zIndexSelectors.ts +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
|
-
import { BaseValue } from '../../cartesian/Area.tsrx';
|
|
3
|
-
import { DataKey } from '../../util/types';
|
|
4
|
-
import { ChartData } from '../chartDataSlice';
|
|
5
|
-
import { MaybeStackedGraphicalItem } from './StackedGraphicalItem';
|
|
6
|
-
import { BaseCartesianGraphicalItemSettings } from '../graphicalItemsSlice';
|
|
2
|
+
import type { BaseValue } from '../../cartesian/Area.tsrx';
|
|
3
|
+
import type { DataKey } from '../../util/types';
|
|
4
|
+
import type { ChartData } from '../chartDataSlice';
|
|
5
|
+
import type { MaybeStackedGraphicalItem } from './StackedGraphicalItem';
|
|
6
|
+
import type { BaseCartesianGraphicalItemSettings } from '../graphicalItemsSlice';
|
|
7
7
|
|
|
8
8
|
export type AreaSettings = BaseCartesianGraphicalItemSettings &
|
|
9
9
|
MaybeStackedGraphicalItem & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
|
-
import { MinPointSize } from '../../util/BarUtils.tsrx';
|
|
3
|
-
import { MaybeStackedGraphicalItem } from './StackedGraphicalItem';
|
|
4
|
-
import { BaseCartesianGraphicalItemSettings } from '../graphicalItemsSlice';
|
|
2
|
+
import type { MinPointSize } from '../../util/BarUtils.tsrx';
|
|
3
|
+
import type { MaybeStackedGraphicalItem } from './StackedGraphicalItem';
|
|
4
|
+
import type { BaseCartesianGraphicalItemSettings } from '../graphicalItemsSlice';
|
|
5
5
|
|
|
6
6
|
export type BarSettings = BaseCartesianGraphicalItemSettings &
|
|
7
7
|
MaybeStackedGraphicalItem & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
|
-
import { ChartData } from '../chartDataSlice';
|
|
3
|
-
import { DataKey } from '../../util/types';
|
|
4
|
-
import { BaseCartesianGraphicalItemSettings } from '../graphicalItemsSlice';
|
|
2
|
+
import type { ChartData } from '../chartDataSlice';
|
|
3
|
+
import type { DataKey } from '../../util/types';
|
|
4
|
+
import type { BaseCartesianGraphicalItemSettings } from '../graphicalItemsSlice';
|
|
5
5
|
|
|
6
6
|
export type LineSettings = BaseCartesianGraphicalItemSettings & {
|
|
7
7
|
type: 'line';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
2
|
import type { SVGProps } from '../../util/OctaneTypes';
|
|
3
3
|
|
|
4
|
-
import { BasePolarGraphicalItemSettings } from '../graphicalItemsSlice';
|
|
5
|
-
import { DataKey, LegendType } from '../../util/types';
|
|
6
|
-
import { TooltipType } from '../../component/DefaultTooltipContent.tsrx';
|
|
7
|
-
import { SVGPropsNoEvents } from '../../util/svgPropertiesNoEvents';
|
|
8
|
-
import { WithoutId } from '../../util/useUniqueId';
|
|
4
|
+
import type { BasePolarGraphicalItemSettings } from '../graphicalItemsSlice';
|
|
5
|
+
import type { DataKey, LegendType } from '../../util/types';
|
|
6
|
+
import type { TooltipType } from '../../component/DefaultTooltipContent.tsrx';
|
|
7
|
+
import type { SVGPropsNoEvents } from '../../util/svgPropertiesNoEvents';
|
|
8
|
+
import type { WithoutId } from '../../util/useUniqueId';
|
|
9
9
|
|
|
10
10
|
export type PiePresentationProps = SVGPropsNoEvents<WithoutId<SVGProps<SVGPathElement>>>;
|
|
11
11
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
|
-
import { BasePolarGraphicalItemSettings } from '../graphicalItemsSlice';
|
|
2
|
+
import type { BasePolarGraphicalItemSettings } from '../graphicalItemsSlice';
|
|
3
3
|
|
|
4
4
|
export interface RadarSettings extends BasePolarGraphicalItemSettings {
|
|
5
5
|
type: 'radar';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
|
-
import { MaybeStackedGraphicalItem } from './StackedGraphicalItem';
|
|
3
|
-
import { BasePolarGraphicalItemSettings } from '../graphicalItemsSlice';
|
|
2
|
+
import type { MaybeStackedGraphicalItem } from './StackedGraphicalItem';
|
|
3
|
+
import type { BasePolarGraphicalItemSettings } from '../graphicalItemsSlice';
|
|
4
4
|
|
|
5
5
|
export interface RadialBarSettings
|
|
6
6
|
extends BasePolarGraphicalItemSettings, MaybeStackedGraphicalItem {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
|
-
import { ChartData } from '../chartDataSlice';
|
|
3
|
-
import { DataKey } from '../../util/types';
|
|
4
|
-
import { TooltipType } from '../../component/DefaultTooltipContent.tsrx';
|
|
5
|
-
import { BaseCartesianGraphicalItemSettings } from '../graphicalItemsSlice';
|
|
2
|
+
import type { ChartData } from '../chartDataSlice';
|
|
3
|
+
import type { DataKey } from '../../util/types';
|
|
4
|
+
import type { TooltipType } from '../../component/DefaultTooltipContent.tsrx';
|
|
5
|
+
import type { BaseCartesianGraphicalItemSettings } from '../graphicalItemsSlice';
|
|
6
6
|
|
|
7
7
|
export type ScatterSettings = BaseCartesianGraphicalItemSettings & {
|
|
8
8
|
type: 'scatter';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
|
-
import { GraphicalItemSettings } from '../graphicalItemsSlice';
|
|
3
|
-
import { NormalizedStackId } from '../../util/ChartUtils';
|
|
4
|
-
import { DataKey } from '../../util/types';
|
|
2
|
+
import type { GraphicalItemSettings } from '../graphicalItemsSlice';
|
|
3
|
+
import type { NormalizedStackId } from '../../util/ChartUtils';
|
|
4
|
+
import type { DataKey } from '../../util/types';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Some graphical items allow data stacking. The stacks are optional,
|
package/src/state/zIndexSlice.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* This slice contains a registry of z-index values for various components.
|
|
4
4
|
* The state is a map from z-index numbers to element references.
|
|
5
5
|
*/
|
|
6
|
-
import { createSlice, PayloadAction, prepareAutoBatched } from '@reduxjs/toolkit';
|
|
6
|
+
import { createSlice, type PayloadAction, prepareAutoBatched } from '@reduxjs/toolkit';
|
|
7
7
|
import { castDraft } from 'immer';
|
|
8
8
|
|
|
9
9
|
import { DefaultZIndexes } from '../zIndex/DefaultZIndexes';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
|
-
import { RechartsRootState } from '../state/store';
|
|
3
|
-
import { TooltipSyncState } from '../state/tooltipSlice';
|
|
2
|
+
import type { RechartsRootState } from '../state/store';
|
|
3
|
+
import type { TooltipSyncState } from '../state/tooltipSlice';
|
|
4
4
|
|
|
5
5
|
export function selectSynchronisedTooltipState(state: RechartsRootState): TooltipSyncState {
|
|
6
6
|
return state.tooltip.syncInteraction;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
|
-
import { Coordinate, DataKey, TickItem } from '../util/types';
|
|
3
|
-
import { TooltipIndex } from '../state/tooltipSlice';
|
|
2
|
+
import type { Coordinate, DataKey, TickItem } from '../util/types';
|
|
3
|
+
import type { TooltipIndex } from '../state/tooltipSlice';
|
|
4
4
|
|
|
5
5
|
export type ActiveLabel = string | number | undefined;
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
|
-
import { Coordinate, RectangleCoordinate, RectanglePosition, Size } from './types';
|
|
2
|
+
import type { Coordinate, RectangleCoordinate, RectanglePosition, Size } from './types';
|
|
3
3
|
|
|
4
4
|
export const rectWithPoints = (
|
|
5
5
|
{ x: x1, y: y1 }: Coordinate,
|
package/src/util/ChartUtils.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { sortBy } from 'es-toolkit/compat';
|
|
|
3
3
|
import { get } from 'es-toolkit/compat';
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
Series,
|
|
6
|
+
type Series,
|
|
7
7
|
type SeriesPoint,
|
|
8
8
|
stack as shapeStack,
|
|
9
9
|
stackOffsetExpand,
|
|
@@ -23,8 +23,8 @@ import {
|
|
|
23
23
|
mathSign,
|
|
24
24
|
} from './DataUtils';
|
|
25
25
|
|
|
26
|
-
import { TooltipEntrySettings, TooltipPayloadEntry } from '../state/tooltipSlice';
|
|
27
|
-
import {
|
|
26
|
+
import type { TooltipEntrySettings, TooltipPayloadEntry } from '../state/tooltipSlice';
|
|
27
|
+
import type {
|
|
28
28
|
AxisTick,
|
|
29
29
|
AxisType,
|
|
30
30
|
CartesianLayout,
|
|
@@ -42,13 +42,13 @@ import {
|
|
|
42
42
|
TickItem,
|
|
43
43
|
AxisDomainTypeInput,
|
|
44
44
|
} from './types';
|
|
45
|
-
import { ValueType } from '../component/DefaultTooltipContent.tsrx';
|
|
46
|
-
import { LegendSettings } from '../state/legendSlice';
|
|
47
|
-
import { AxisRange, BaseAxisWithScale } from '../state/selectors/axisSelectors';
|
|
48
|
-
import { StackGroup } from './stacks/stackTypes';
|
|
45
|
+
import type { ValueType } from '../component/DefaultTooltipContent.tsrx';
|
|
46
|
+
import type { LegendSettings } from '../state/legendSlice';
|
|
47
|
+
import type { AxisRange, BaseAxisWithScale } from '../state/selectors/axisSelectors';
|
|
48
|
+
import type { StackGroup } from './stacks/stackTypes';
|
|
49
49
|
import { getSliced } from './getSliced';
|
|
50
50
|
import { isWellBehavedNumber } from './isWellBehavedNumber';
|
|
51
|
-
import { RechartsScale } from './scale/RechartsScale';
|
|
51
|
+
import type { RechartsScale } from './scale/RechartsScale';
|
|
52
52
|
|
|
53
53
|
export function getValueByDataKey<DataPointType, DataValueType>(
|
|
54
54
|
obj: DataPointType | null | undefined,
|
package/src/util/DOMUtils.ts
CHANGED
package/src/util/DataUtils.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
2
|
import { get } from 'es-toolkit/compat';
|
|
3
|
-
import { NonEmptyArray, Percent } from './types';
|
|
3
|
+
import type { NonEmptyArray, Percent } from './types';
|
|
4
4
|
import { round } from './round';
|
|
5
5
|
|
|
6
6
|
export const mathSign = (value: number) => {
|
package/src/util/Events.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
2
|
import EventEmitter from 'eventemitter3';
|
|
3
|
-
import { PayloadAction } from '@reduxjs/toolkit';
|
|
4
|
-
import { TooltipSyncState } from '../state/tooltipSlice';
|
|
5
|
-
import { BrushStartEndIndex } from '../context/brushUpdateContext';
|
|
3
|
+
import type { PayloadAction } from '@reduxjs/toolkit';
|
|
4
|
+
import type { TooltipSyncState } from '../state/tooltipSlice';
|
|
5
|
+
import type { BrushStartEndIndex } from '../context/brushUpdateContext';
|
|
6
6
|
|
|
7
7
|
const eventCenter: EventEmitter<EventTypes> = new EventEmitter();
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'octane';
|
|
2
|
-
import { Props as FunnelProps, FunnelTrapezoidItem } from '../cartesian/Funnel.tsrx';
|
|
2
|
+
import type { Props as FunnelProps, FunnelTrapezoidItem } from '../cartesian/Funnel.tsrx';
|
|
3
3
|
import { Trapezoid } from '../shape/Trapezoid.tsrx';
|
|
4
|
-
import { ShapeAnimationProps } from './types';
|
|
4
|
+
import type { ShapeAnimationProps } from './types';
|
|
5
5
|
import { Shape } from './ActiveShapeUtils.tsrx';
|
|
6
6
|
|
|
7
7
|
export const defaultFunnelShape = Trapezoid;
|
package/src/util/PolarUtils.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'octane';
|
|
2
|
-
import { RadialBarDataItem, RadialBarProps } from '../polar/RadialBar.tsrx';
|
|
2
|
+
import type { RadialBarDataItem, RadialBarProps } from '../polar/RadialBar.tsrx';
|
|
3
3
|
import { Sector } from '../shape/Sector.tsrx';
|
|
4
|
-
import { ShapeAnimationProps } from './types';
|
|
4
|
+
import type { ShapeAnimationProps } from './types';
|
|
5
5
|
import { Shape } from './ActiveShapeUtils.tsrx';
|
|
6
6
|
|
|
7
7
|
export const defaultRadialBarShape = Sector;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'octane';
|
|
2
|
-
import { ActiveShape, ShapeAnimationProps, SymbolType } from './types';
|
|
3
|
-
import { ScatterPointItem } from '../cartesian/Scatter.tsrx';
|
|
4
|
-
import { InnerSymbolsProp, Symbols } from '../shape/Symbols.tsrx';
|
|
2
|
+
import type { ActiveShape, ShapeAnimationProps, SymbolType } from './types';
|
|
3
|
+
import type { ScatterPointItem } from '../cartesian/Scatter.tsrx';
|
|
4
|
+
import { type InnerSymbolsProp, Symbols } from '../shape/Symbols.tsrx';
|
|
5
5
|
import { Shape } from './ActiveShapeUtils.tsrx';
|
|
6
6
|
import { DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME } from './Constants';
|
|
7
|
-
import { GraphicalItemId } from '../state/graphicalItemsSlice';
|
|
7
|
+
import type { GraphicalItemId } from '../state/graphicalItemsSlice';
|
|
8
8
|
|
|
9
9
|
export type ScatterShapeProps =
|
|
10
10
|
ScatterPointItem & ShapeAnimationProps & {
|
package/src/util/TickUtils.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
2
|
import { getAngledRectangleWidth } from './CartesianUtils';
|
|
3
3
|
import { getEveryNth } from './getEveryNth';
|
|
4
|
-
import { Size, CartesianTickItem, CartesianViewBoxRequired } from './types';
|
|
4
|
+
import type { Size, CartesianTickItem, CartesianViewBoxRequired } from './types';
|
|
5
5
|
|
|
6
6
|
export function getAngledTickWidth(contentSize: Size, unitSize: Size, angle: number | undefined) {
|
|
7
7
|
const size = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
|
-
import { XAxisProps, YAxisProps } from '../index';
|
|
3
|
-
import { AxisDomain } from './types';
|
|
4
|
-
import { AxisRange } from '../state/selectors/axisSelectors';
|
|
2
|
+
import type { XAxisProps, YAxisProps } from '../index';
|
|
3
|
+
import type { AxisDomain } from './types';
|
|
4
|
+
import type { AxisRange } from '../state/selectors/axisSelectors';
|
|
5
5
|
import { propsAreEqual } from './propsAreEqual';
|
|
6
6
|
|
|
7
7
|
function shortArraysAreEqual(
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { polarToCartesian } from '../PolarUtils';
|
|
2
2
|
import {
|
|
3
|
-
Coordinate,
|
|
4
|
-
ChartOffsetInternal,
|
|
5
|
-
PolarCoordinate,
|
|
3
|
+
type Coordinate,
|
|
4
|
+
type ChartOffsetInternal,
|
|
5
|
+
type PolarCoordinate,
|
|
6
6
|
isPolarCoordinate,
|
|
7
|
-
CartesianLayout,
|
|
8
|
-
PolarLayout,
|
|
7
|
+
type CartesianLayout,
|
|
8
|
+
type PolarLayout,
|
|
9
9
|
} from '../types';
|
|
10
|
-
import { RadialCursorPoints, getRadialCursorPoints } from './getRadialCursorPoints';
|
|
10
|
+
import { type RadialCursorPoints, getRadialCursorPoints } from './getRadialCursorPoints';
|
|
11
11
|
|
|
12
12
|
export function getCursorPoints(
|
|
13
13
|
layout: CartesianLayout | PolarLayout,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
|
-
import {
|
|
2
|
+
import type {
|
|
3
3
|
AxisType,
|
|
4
4
|
CartesianLayout,
|
|
5
5
|
ChartOffsetInternal,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
TickItem,
|
|
12
12
|
} from './types';
|
|
13
13
|
import { polarToCartesian } from './PolarUtils';
|
|
14
|
-
import { AxisRange } from '../state/selectors/axisSelectors';
|
|
14
|
+
import type { AxisRange } from '../state/selectors/axisSelectors';
|
|
15
15
|
import { mathSign } from './DataUtils';
|
|
16
16
|
|
|
17
17
|
export const getActiveCartesianCoordinate = (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
|
-
import { AxisDomainTypeInput, AxisType, EvaluatedAxisDomainType, LayoutType } from './types';
|
|
2
|
+
import type { AxisDomainTypeInput, AxisType, EvaluatedAxisDomainType, LayoutType } from './types';
|
|
3
3
|
import { isCategoricalAxis } from './ChartUtils';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
|
-
import { ActiveDotType, DotType } from './types';
|
|
2
|
+
import type { ActiveDotType, DotType } from './types';
|
|
3
3
|
import { svgPropertiesNoEventsFromUnknown } from './svgPropertiesNoEvents';
|
|
4
4
|
|
|
5
5
|
export function getRadiusAndStrokeWidthFromDot(dot: ActiveDotType | DotType): {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
2
|
import { MAX_VALUE_REG, MIN_VALUE_REG } from './ChartUtils';
|
|
3
3
|
import { isNumber } from './DataUtils';
|
|
4
|
-
import { AxisDomain, NumberDomain } from './types';
|
|
4
|
+
import type { AxisDomain, NumberDomain } from './types';
|
|
5
5
|
import { isWellBehavedNumber } from './isWellBehavedNumber';
|
|
6
6
|
|
|
7
7
|
export function isWellFormedNumberDomain(v: unknown): v is NumberDomain {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BandPosition, RechartsScale } from './RechartsScale';
|
|
2
|
-
import { CategoricalDomainItem, Coordinate, NullableCoordinate } from '../types';
|
|
1
|
+
import type { BandPosition, RechartsScale } from './RechartsScale';
|
|
2
|
+
import type { CategoricalDomainItem, Coordinate, NullableCoordinate } from '../types';
|
|
3
3
|
|
|
4
4
|
export interface CartesianScaleHelper<
|
|
5
5
|
XDomain extends CategoricalDomainItem = CategoricalDomainItem,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
|
-
import { CustomScaleDefinition } from './CustomScaleDefinition';
|
|
3
|
-
import { CategoricalDomainItem } from '../types';
|
|
2
|
+
import type { CustomScaleDefinition } from './CustomScaleDefinition';
|
|
3
|
+
import type { CategoricalDomainItem } from '../types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* This is internal representation of scale used in Recharts.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
|
-
import { InverseScaleFunction } from '../../hooks';
|
|
3
|
-
import { CustomScaleDefinition } from './CustomScaleDefinition';
|
|
2
|
+
import type { InverseScaleFunction } from '../../hooks';
|
|
3
|
+
import type { CustomScaleDefinition } from './CustomScaleDefinition';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Binary search to find the index where x would fit in array a.
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import Decimal from 'decimal.js-light';
|
|
8
8
|
import { getDigitCount, rangeStep } from './util/arithmetic';
|
|
9
|
-
import { NumberDomain } from '../types';
|
|
10
|
-
import { NiceTicksAlgorithm } from '../../state/cartesianAxisSlice';
|
|
9
|
+
import type { NumberDomain } from '../types';
|
|
10
|
+
import type { NiceTicksAlgorithm } from '../../state/cartesianAxisSlice';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Calculate a interval of a minimum value and a maximum value
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
|
-
import { StackSeriesIdentifier } from './stackTypes';
|
|
3
|
-
import { MaybeStackedGraphicalItem } from '../../state/types/StackedGraphicalItem';
|
|
2
|
+
import type { StackSeriesIdentifier } from './stackTypes';
|
|
3
|
+
import type { MaybeStackedGraphicalItem } from '../../state/types/StackedGraphicalItem';
|
|
4
4
|
|
|
5
5
|
export function getStackSeriesIdentifier(
|
|
6
6
|
graphicalItem: MaybeStackedGraphicalItem,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
|
-
import { Series } from 'victory-vendor/d3-shape';
|
|
3
|
-
import { StackId } from '../ChartUtils';
|
|
4
|
-
import { GraphicalItemId } from '../../state/graphicalItemsSlice';
|
|
5
|
-
import { MaybeStackedGraphicalItem } from '../../state/types/StackedGraphicalItem';
|
|
2
|
+
import type { Series } from 'victory-vendor/d3-shape';
|
|
3
|
+
import type { StackId } from '../ChartUtils';
|
|
4
|
+
import type { GraphicalItemId } from '../../state/graphicalItemsSlice';
|
|
5
|
+
import type { MaybeStackedGraphicalItem } from '../../state/types/StackedGraphicalItem';
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
* So chart stacks come in layers:
|
|
@@ -2,7 +2,7 @@ import type { CSSProperties } from '../OctaneTypes';
|
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
|
|
4
4
|
import { isNumber } from '../DataUtils';
|
|
5
|
-
import { Coordinate, CartesianViewBox, AllowInDimension } from '../types';
|
|
5
|
+
import type { Coordinate, CartesianViewBox, AllowInDimension } from '../types';
|
|
6
6
|
|
|
7
7
|
export type Dimension2D = 'x' | 'y';
|
|
8
8
|
|
package/src/util/types.ts
CHANGED
|
@@ -10,26 +10,26 @@ import type {
|
|
|
10
10
|
import { isValidElement } from 'octane';
|
|
11
11
|
import type * as d3Scales from 'victory-vendor/d3-scale';
|
|
12
12
|
import type { Props as DotProps } from '../shape/Dot.tsrx';
|
|
13
|
-
import { AxisRange } from '../state/selectors/axisSelectors';
|
|
14
|
-
import { ExternalMouseEvents } from '../chart/types';
|
|
15
|
-
import { SyncMethod } from '../synchronisation/types';
|
|
13
|
+
import type { AxisRange } from '../state/selectors/axisSelectors';
|
|
14
|
+
import type { ExternalMouseEvents } from '../chart/types';
|
|
15
|
+
import type { SyncMethod } from '../synchronisation/types';
|
|
16
16
|
import { isEventKey, type EventKeysType } from './excludeEventProps';
|
|
17
|
-
import { DotPoint } from '../component/Dots.tsrx';
|
|
18
|
-
import { SVGPropsNoEvents } from './svgPropertiesNoEvents';
|
|
19
|
-
import { BaseValue } from '../cartesian/Area.tsrx';
|
|
20
|
-
import { ImplicitLabelType } from '../component/Label.tsrx';
|
|
21
|
-
import { CustomScaleDefinition } from './scale/CustomScaleDefinition';
|
|
22
|
-
import { ChartData } from '../state/chartDataSlice';
|
|
23
|
-
import {
|
|
17
|
+
import type { DotPoint } from '../component/Dots.tsrx';
|
|
18
|
+
import type { SVGPropsNoEvents } from './svgPropertiesNoEvents';
|
|
19
|
+
import type { BaseValue } from '../cartesian/Area.tsrx';
|
|
20
|
+
import type { ImplicitLabelType } from '../component/Label.tsrx';
|
|
21
|
+
import type { CustomScaleDefinition } from './scale/CustomScaleDefinition';
|
|
22
|
+
import type { ChartData } from '../state/chartDataSlice';
|
|
23
|
+
import type {
|
|
24
24
|
XAxisOrientation,
|
|
25
25
|
XAxisPadding,
|
|
26
26
|
YAxisOrientation,
|
|
27
27
|
YAxisPadding,
|
|
28
28
|
} from '../state/cartesianAxisSlice';
|
|
29
|
-
import { TextAnchor, TextVerticalAnchor } from '../component/Text.tsrx';
|
|
29
|
+
import type { TextAnchor, TextVerticalAnchor } from '../component/Text.tsrx';
|
|
30
30
|
import type { TickFormatter } from '../cartesian/CartesianAxis.tsrx';
|
|
31
31
|
import type { Props as TextProps } from '../component/Text.tsrx';
|
|
32
|
-
import { TypedDataKey } from './typedDataKey';
|
|
32
|
+
import type { TypedDataKey } from './typedDataKey';
|
|
33
33
|
import type { EasingInput } from '../animation/easing';
|
|
34
34
|
|
|
35
35
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
|
|
2
2
|
import { createSelector } from 'reselect';
|
|
3
|
-
import { RechartsRootState } from '../state/store';
|
|
3
|
+
import type { RechartsRootState } from '../state/store';
|
|
4
4
|
import { arrayContentsAreEqualCheck } from '../state/selectors/arrayEqualityCheck';
|
|
5
5
|
|
|
6
6
|
import { DefaultZIndexes } from './DefaultZIndexes';
|