vccs 0.1.0 → 0.2.0
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/dist/cartesian/funnel/Funnel.d.ts +2 -0
- package/dist/cartesian/funnel/index.d.ts +2 -0
- package/dist/cartesian/funnel/type.d.ts +74 -5
- package/dist/cartesian/index.d.ts +1 -0
- package/dist/chart/FunnelChart.d.ts +1 -0
- package/dist/chart/index.d.ts +1 -0
- package/dist/es/animation/Animate.mjs +48 -22
- package/dist/es/cartesian/GraphicalItemClipPath.mjs +16 -15
- package/dist/es/cartesian/area/ActivePoints.mjs +44 -40
- package/dist/es/cartesian/area/Area.mjs +42 -31
- package/dist/es/cartesian/area/ClipRect.mjs +79 -58
- package/dist/es/cartesian/area/RenderArea.mjs +142 -108
- package/dist/es/cartesian/area/hooks/useArea.mjs +71 -47
- package/dist/es/cartesian/area/type.mjs +11 -11
- package/dist/es/cartesian/area/utils.mjs +69 -49
- package/dist/es/cartesian/axis/XAxis.mjs +87 -73
- package/dist/es/cartesian/axis/YAxis.mjs +67 -56
- package/dist/es/cartesian/bar/Bar.mjs +93 -71
- package/dist/es/cartesian/bar/components/BarBackground.mjs +22 -19
- package/dist/es/cartesian/bar/components/BarRectangles.mjs +117 -80
- package/dist/es/cartesian/bar/hooks/useBar.mjs +49 -37
- package/dist/es/cartesian/bar/type.mjs +9 -9
- package/dist/es/cartesian/bar/utils.mjs +97 -70
- package/dist/es/cartesian/cartesian-axis/CartesianAxis.mjs +165 -115
- package/dist/es/cartesian/cartesian-grid/Background.mjs +19 -16
- package/dist/es/cartesian/cartesian-grid/CartesianGrid.mjs +116 -97
- package/dist/es/cartesian/cartesian-grid/HorizontalGridLines.mjs +24 -23
- package/dist/es/cartesian/cartesian-grid/HorizontalStripes.mjs +24 -24
- package/dist/es/cartesian/cartesian-grid/VerticalGridLines.mjs +23 -22
- package/dist/es/cartesian/cartesian-grid/VerticalStripes.mjs +24 -24
- package/dist/es/cartesian/cartesian-grid/const.mjs +317 -10
- package/dist/es/cartesian/cartesian-grid/utils.mjs +18 -13
- package/dist/es/cartesian/error-bar/ErrorBar.mjs +111 -83
- package/dist/es/cartesian/error-bar/ErrorBarContext.mjs +13 -12
- package/dist/es/cartesian/funnel/Funnel.mjs +177 -0
- package/dist/es/cartesian/funnel/type.mjs +80 -0
- package/dist/es/cartesian/funnel/utils.mjs +102 -0
- package/dist/es/cartesian/line/ActivePoints.mjs +45 -41
- package/dist/es/cartesian/line/Line.mjs +41 -37
- package/dist/es/cartesian/line/StaticLine.mjs +191 -122
- package/dist/es/cartesian/line/hooks/useLine.mjs +60 -44
- package/dist/es/cartesian/line/type.mjs +11 -11
- package/dist/es/cartesian/line/utils.mjs +27 -26
- package/dist/es/cartesian/reference-area/ReferenceArea.mjs +86 -69
- package/dist/es/cartesian/reference-line/ReferenceLine.mjs +99 -77
- package/dist/es/cartesian/scatter/Scatter.mjs +168 -140
- package/dist/es/cartesian/scatter/hooks/useScatter.mjs +18 -14
- package/dist/es/cartesian/useNeedsClip.mjs +18 -9
- package/dist/es/cartesian/utils/get-ticks.mjs +103 -68
- package/dist/es/cartesian/z-axis/ZAxis.mjs +30 -28
- package/dist/es/chart/AreaChart.mjs +5 -5
- package/dist/es/chart/BarChart.mjs +5 -5
- package/dist/es/chart/ComposedChart.mjs +5 -5
- package/dist/es/chart/FunnelChart.mjs +11 -0
- package/dist/es/chart/LegendPortalContext.mjs +3 -3
- package/dist/es/chart/LineChart.mjs +5 -5
- package/dist/es/chart/PieChart.mjs +5 -5
- package/dist/es/chart/RadarChart.mjs +5 -5
- package/dist/es/chart/RadialBarChart.mjs +5 -5
- package/dist/es/chart/RechartsWrapper.mjs +111 -88
- package/dist/es/chart/ScatterChart.mjs +5 -5
- package/dist/es/chart/Surface.mjs +3 -3
- package/dist/es/chart/Surface.vue_vue_type_script_setup_true_lang.mjs +51 -45
- package/dist/es/chart/TooltipPortalContext.mjs +3 -3
- package/dist/es/chart/const.mjs +2 -2
- package/dist/es/chart/generateCategoricalChart.mjs +97 -88
- package/dist/es/chart/provideClipPathId.mjs +12 -7
- package/dist/es/components/Cell.mjs +16 -4
- package/dist/es/components/Text.mjs +3 -3
- package/dist/es/components/Text.vue_vue_type_script_setup_true_lang.mjs +106 -69
- package/dist/es/components/Tooltip.mjs +274 -199
- package/dist/es/components/label/Label.mjs +30 -26
- package/dist/es/components/label/LabelList.mjs +45 -39
- package/dist/es/components/label/types.mjs +8 -5
- package/dist/es/components/label/utils.mjs +194 -162
- package/dist/es/components/legend/Legend.mjs +82 -71
- package/dist/es/components/legend/LegendSymbol.mjs +40 -38
- package/dist/es/components/legend/hooks/useLegend.mjs +66 -46
- package/dist/es/components/legend/hooks/useLegendContent.mjs +52 -31
- package/dist/es/components/legend/type.mjs +2 -2
- package/dist/es/components/legend/utils.mjs +19 -11
- package/dist/es/components/utils.mjs +35 -22
- package/dist/es/container/ClipPath.mjs +14 -14
- package/dist/es/container/Layer.mjs +9 -7
- package/dist/es/container/ResponsiveContainer.mjs +3 -3
- package/dist/es/container/ResponsiveContainer.vue_vue_type_script_setup_true_lang.mjs +109 -77
- package/dist/es/container/Surface.mjs +23 -19
- package/dist/es/container/useSizeContext.mjs +3 -3
- package/dist/es/context/ChartDataContextProvider.mjs +19 -13
- package/dist/es/context/PanoramaContextProvider.mjs +15 -10
- package/dist/es/context/accessibilityContext.mjs +3 -3
- package/dist/es/context/cartesianLabelListContext.mjs +3 -3
- package/dist/es/context/chartLayoutContext.mjs +33 -30
- package/dist/es/context/cursorLayerContext.mjs +3 -3
- package/dist/es/context/graphicalLayerContext.mjs +3 -3
- package/dist/es/context/labelLayerContext.mjs +3 -3
- package/dist/es/context/polarLabelViewBoxContext.mjs +5 -5
- package/dist/es/context/useTooltipAxis.mjs +14 -12
- package/dist/es/events/useChartSynchronisation.mjs +91 -66
- package/dist/es/hooks/useIsAnimating.mjs +28 -0
- package/dist/es/hooks/useSetupGraphicalItem.mjs +52 -43
- package/dist/es/index.mjs +46 -42
- package/dist/es/polar/pie/Pie.mjs +131 -115
- package/dist/es/polar/pie/type.mjs +6 -6
- package/dist/es/polar/radar/PolarAngleAxis.mjs +103 -84
- package/dist/es/polar/radar/PolarGrid.mjs +72 -59
- package/dist/es/polar/radar/PolarRadiusAxis.mjs +90 -65
- package/dist/es/polar/radar/Radar.mjs +181 -145
- package/dist/es/polar/radial-bar/RadialBar.mjs +161 -140
- package/dist/es/polar/radial-bar/type.mjs +9 -9
- package/dist/es/shape/Cross.mjs +11 -10
- package/dist/es/shape/Curve.mjs +69 -43
- package/dist/es/shape/Dot.mjs +12 -11
- package/dist/es/shape/Rectangle.mjs +41 -26
- package/dist/es/shape/Sector.mjs +103 -75
- package/dist/es/shape/Symbols.mjs +45 -34
- package/dist/es/shape/Trapezoid.mjs +52 -0
- package/dist/es/state/ReportChartProps.mjs +21 -20
- package/dist/es/state/ReportMainChartProps.mjs +26 -21
- package/dist/es/state/ReportPolarOptions.mjs +23 -22
- package/dist/es/state/SetGraphicalItem.mjs +42 -27
- package/dist/es/state/SetLegendPayload.mjs +17 -13
- package/dist/es/state/SetTooltipEntrySettings.mjs +14 -12
- package/dist/es/state/brushSlice.mjs +12 -8
- package/dist/es/state/cartesianAxisSlice.mjs +23 -17
- package/dist/es/state/chartDataSlice.mjs +18 -13
- package/dist/es/state/externalEventsMiddleware.mjs +25 -15
- package/dist/es/state/graphicalItemsSlice.mjs +29 -25
- package/dist/es/state/hooks.mjs +4 -3
- package/dist/es/state/keyboardEventsMiddleware.mjs +50 -42
- package/dist/es/state/layoutSlice.mjs +18 -12
- package/dist/es/state/legendSlice.mjs +19 -14
- package/dist/es/state/mouseEventsMiddleware.mjs +31 -24
- package/dist/es/state/optionsSlice.mjs +14 -11
- package/dist/es/state/polarAxisSlice.mjs +15 -13
- package/dist/es/state/polarOptionsSlice.mjs +8 -6
- package/dist/es/state/reduxDevtoolsJsonStringifyReplacer.mjs +5 -3
- package/dist/es/state/referenceElementsSlice.mjs +21 -19
- package/dist/es/state/rootPropsSlice.mjs +20 -9
- package/dist/es/state/selectors/areaSelectors.mjs +65 -55
- package/dist/es/state/selectors/axisSelectors.mjs +755 -569
- package/dist/es/state/selectors/barSelectors.mjs +225 -162
- package/dist/es/state/selectors/brushSelectors.mjs +15 -14
- package/dist/es/state/selectors/combiners/combineActiveLabel.mjs +6 -5
- package/dist/es/state/selectors/combiners/combineActiveTooltipIndex.mjs +36 -27
- package/dist/es/state/selectors/combiners/combineAxisRangeWithReverse.mjs +5 -3
- package/dist/es/state/selectors/combiners/combineCoordinateForDefaultIndex.mjs +13 -11
- package/dist/es/state/selectors/combiners/combineTooltipInteractionState.mjs +26 -21
- package/dist/es/state/selectors/combiners/combineTooltipPayloadConfigurations.mjs +10 -6
- package/dist/es/state/selectors/common.mjs +2 -2
- package/dist/es/state/selectors/containerSelectors.mjs +5 -2
- package/dist/es/state/selectors/dataSelectors.mjs +28 -9
- package/dist/es/state/selectors/funnelSelectors.mjs +38 -0
- package/dist/es/state/selectors/legendSelectors.mjs +7 -6
- package/dist/es/state/selectors/lineSelectors.mjs +54 -47
- package/dist/es/state/selectors/pickAxisId.mjs +2 -2
- package/dist/es/state/selectors/pickAxisType.mjs +2 -2
- package/dist/es/state/selectors/pieSelectors.mjs +116 -81
- package/dist/es/state/selectors/polarAxisSelectors.mjs +113 -94
- package/dist/es/state/selectors/polarGridSelectors.mjs +13 -11
- package/dist/es/state/selectors/polarScaleSelectors.mjs +49 -46
- package/dist/es/state/selectors/polarSelectors.mjs +79 -62
- package/dist/es/state/selectors/radarSelectors.mjs +111 -91
- package/dist/es/state/selectors/radialBarSelectors.mjs +230 -183
- package/dist/es/state/selectors/rootPropsSelectors.mjs +11 -5
- package/dist/es/state/selectors/scatterSelectors.mjs +111 -95
- package/dist/es/state/selectors/selectActivePropsFromChartPointer.mjs +19 -17
- package/dist/es/state/selectors/selectAllAxes.mjs +8 -3
- package/dist/es/state/selectors/selectChartOffset.mjs +59 -50
- package/dist/es/state/selectors/selectChartOffsetInternal.mjs +55 -44
- package/dist/es/state/selectors/selectTooltipEventType.mjs +15 -14
- package/dist/es/state/selectors/selectTooltipPayloadSearcher.mjs +3 -3
- package/dist/es/state/selectors/selectTooltipSettings.mjs +2 -2
- package/dist/es/state/selectors/selectTooltipState.mjs +2 -2
- package/dist/es/state/selectors/selectors.mjs +94 -75
- package/dist/es/state/selectors/tooltipSelectors.mjs +253 -204
- package/dist/es/state/selectors/touchSelectors.mjs +17 -14
- package/dist/es/state/store.mjs +46 -46
- package/dist/es/state/tooltipSlice.mjs +64 -37
- package/dist/es/state/touchEventsMiddleware.mjs +35 -29
- package/dist/es/state/utils/useReportScale.mjs +16 -13
- package/dist/es/synchronisation/syncSelectors.mjs +3 -3
- package/dist/es/synchronisation/useChartSynchronisation.mjs +33 -19
- package/dist/es/types/event.mjs +164 -2
- package/dist/es/utils/ReduceCSSCalc.mjs +81 -49
- package/dist/es/utils/VueUtils.mjs +35 -14
- package/dist/es/utils/attrs.mjs +43 -26
- package/dist/es/utils/cartesian.mjs +47 -15
- package/dist/es/utils/chart.mjs +298 -197
- package/dist/es/utils/const.mjs +30 -2
- package/dist/es/utils/createContext.mjs +28 -9
- package/dist/es/utils/data-utils.mjs +9 -8
- package/dist/es/utils/data.mjs +35 -21
- package/dist/es/utils/events.mjs +5 -3
- package/dist/es/utils/getLinearRegression.mjs +28 -11
- package/dist/es/utils/grid.mjs +20 -5
- package/dist/es/utils/isDomainSpecifiedByUser.mjs +105 -54
- package/dist/es/utils/legend.mjs +13 -12
- package/dist/es/utils/log.mjs +10 -7
- package/dist/es/utils/payload/getUniqPayload.mjs +6 -4
- package/dist/es/utils/polar.mjs +37 -30
- package/dist/es/utils/props.mjs +16 -10
- package/dist/es/utils/resolveDefaultProps.mjs +23 -4
- package/dist/es/utils/scale/getNiceTickValues.mjs +127 -49
- package/dist/es/utils/scale/utils/arithmetic.mjs +49 -19
- package/dist/es/utils/scale/utils/utils.mjs +43 -24
- package/dist/es/utils/style.mjs +24 -13
- package/dist/es/utils/tick.mjs +34 -23
- package/dist/es/utils/tooltip/translate.mjs +63 -49
- package/dist/es/utils/validate.mjs +40 -29
- package/dist/hooks/useIsAnimating.d.ts +14 -0
- package/dist/shape/Trapezoid.d.ts +31 -0
- package/dist/shape/index.d.ts +1 -0
- package/dist/state/graphicalItemsSlice.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,148 +1,167 @@
|
|
|
1
|
-
import { selectChartHeight
|
|
2
|
-
import { selectChartOffset
|
|
3
|
-
import { combineAxisRangeWithReverse
|
|
4
|
-
import { getMaxRadius
|
|
5
|
-
import { getPercentValue
|
|
6
|
-
import { selectChartLayout
|
|
7
|
-
import { createSelector
|
|
1
|
+
import { selectChartHeight, selectChartWidth } from "./containerSelectors.mjs";
|
|
2
|
+
import { selectChartOffset } from "./selectChartOffset.mjs";
|
|
3
|
+
import { combineAxisRangeWithReverse } from "./combiners/combineAxisRangeWithReverse.mjs";
|
|
4
|
+
import { getMaxRadius } from "../../utils/polar.mjs";
|
|
5
|
+
import { getPercentValue } from "../../utils/data.mjs";
|
|
6
|
+
import { selectChartLayout } from "./common.mjs";
|
|
7
|
+
import { createSelector } from "@reduxjs/toolkit";
|
|
8
8
|
//#region src/state/selectors/polarAxisSelectors.ts
|
|
9
|
-
var
|
|
10
|
-
allowDuplicatedCategory:
|
|
9
|
+
var defaultPolarAngleAxisProps = {
|
|
10
|
+
allowDuplicatedCategory: true,
|
|
11
11
|
angleAxisId: 0,
|
|
12
|
-
axisLine:
|
|
12
|
+
axisLine: true,
|
|
13
13
|
cx: 0,
|
|
14
14
|
cy: 0,
|
|
15
15
|
orientation: "outer",
|
|
16
|
-
reversed:
|
|
16
|
+
reversed: false,
|
|
17
17
|
scale: "auto",
|
|
18
|
-
tick:
|
|
19
|
-
tickLine:
|
|
18
|
+
tick: true,
|
|
19
|
+
tickLine: true,
|
|
20
20
|
tickSize: 8,
|
|
21
21
|
type: "category"
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
};
|
|
23
|
+
var implicitAngleAxis = {
|
|
24
|
+
allowDataOverflow: false,
|
|
25
|
+
allowDecimals: false,
|
|
26
|
+
allowDuplicatedCategory: false,
|
|
26
27
|
dataKey: void 0,
|
|
27
28
|
domain: void 0,
|
|
28
29
|
id: void 0,
|
|
29
|
-
includeHidden:
|
|
30
|
+
includeHidden: false,
|
|
30
31
|
name: void 0,
|
|
31
|
-
reversed:
|
|
32
|
-
scale:
|
|
33
|
-
tick:
|
|
32
|
+
reversed: defaultPolarAngleAxisProps.reversed,
|
|
33
|
+
scale: defaultPolarAngleAxisProps.scale,
|
|
34
|
+
tick: defaultPolarAngleAxisProps.tick,
|
|
34
35
|
tickCount: void 0,
|
|
35
36
|
ticks: void 0,
|
|
36
|
-
type:
|
|
37
|
+
type: defaultPolarAngleAxisProps.type,
|
|
37
38
|
unit: void 0
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
};
|
|
40
|
+
var defaultPolarRadiusAxisProps = {
|
|
41
|
+
allowDataOverflow: false,
|
|
42
|
+
allowDuplicatedCategory: true,
|
|
41
43
|
angle: 0,
|
|
42
|
-
axisLine:
|
|
44
|
+
axisLine: true,
|
|
43
45
|
cx: 0,
|
|
44
46
|
cy: 0,
|
|
45
47
|
orientation: "right",
|
|
46
48
|
radiusAxisId: 0,
|
|
47
49
|
scale: "auto",
|
|
48
50
|
stroke: "#ccc",
|
|
49
|
-
tick:
|
|
51
|
+
tick: true,
|
|
50
52
|
tickCount: 5,
|
|
51
53
|
type: "number"
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
};
|
|
55
|
+
var implicitRadiusAxis = {
|
|
56
|
+
allowDataOverflow: defaultPolarRadiusAxisProps.allowDataOverflow,
|
|
57
|
+
allowDecimals: false,
|
|
58
|
+
allowDuplicatedCategory: defaultPolarRadiusAxisProps.allowDuplicatedCategory,
|
|
56
59
|
dataKey: void 0,
|
|
57
60
|
domain: void 0,
|
|
58
61
|
id: void 0,
|
|
59
|
-
includeHidden:
|
|
62
|
+
includeHidden: false,
|
|
60
63
|
name: void 0,
|
|
61
|
-
reversed:
|
|
62
|
-
scale:
|
|
63
|
-
tick:
|
|
64
|
-
tickCount:
|
|
64
|
+
reversed: false,
|
|
65
|
+
scale: defaultPolarRadiusAxisProps.scale,
|
|
66
|
+
tick: defaultPolarRadiusAxisProps.tick,
|
|
67
|
+
tickCount: defaultPolarRadiusAxisProps.tickCount,
|
|
65
68
|
ticks: void 0,
|
|
66
|
-
type:
|
|
69
|
+
type: defaultPolarRadiusAxisProps.type,
|
|
67
70
|
unit: void 0
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
};
|
|
72
|
+
var implicitRadialBarAngleAxis = {
|
|
73
|
+
allowDataOverflow: false,
|
|
74
|
+
allowDecimals: false,
|
|
75
|
+
allowDuplicatedCategory: defaultPolarAngleAxisProps.allowDuplicatedCategory,
|
|
72
76
|
dataKey: void 0,
|
|
73
77
|
domain: void 0,
|
|
74
78
|
id: void 0,
|
|
75
|
-
includeHidden:
|
|
79
|
+
includeHidden: false,
|
|
76
80
|
name: void 0,
|
|
77
|
-
reversed:
|
|
78
|
-
scale:
|
|
79
|
-
tick:
|
|
81
|
+
reversed: false,
|
|
82
|
+
scale: defaultPolarAngleAxisProps.scale,
|
|
83
|
+
tick: defaultPolarAngleAxisProps.tick,
|
|
80
84
|
tickCount: void 0,
|
|
81
85
|
ticks: void 0,
|
|
82
86
|
type: "number",
|
|
83
87
|
unit: void 0
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
};
|
|
89
|
+
var implicitRadialBarRadiusAxis = {
|
|
90
|
+
allowDataOverflow: defaultPolarRadiusAxisProps.allowDataOverflow,
|
|
91
|
+
allowDecimals: false,
|
|
92
|
+
allowDuplicatedCategory: defaultPolarRadiusAxisProps.allowDuplicatedCategory,
|
|
88
93
|
dataKey: void 0,
|
|
89
94
|
domain: void 0,
|
|
90
95
|
id: void 0,
|
|
91
|
-
includeHidden:
|
|
96
|
+
includeHidden: false,
|
|
92
97
|
name: void 0,
|
|
93
|
-
reversed:
|
|
94
|
-
scale:
|
|
95
|
-
tick:
|
|
96
|
-
tickCount:
|
|
98
|
+
reversed: false,
|
|
99
|
+
scale: defaultPolarRadiusAxisProps.scale,
|
|
100
|
+
tick: defaultPolarRadiusAxisProps.tick,
|
|
101
|
+
tickCount: defaultPolarRadiusAxisProps.tickCount,
|
|
97
102
|
ticks: void 0,
|
|
98
103
|
type: "category",
|
|
99
104
|
unit: void 0
|
|
100
105
|
};
|
|
101
|
-
function
|
|
102
|
-
|
|
106
|
+
function selectAngleAxis(state, angleAxisId) {
|
|
107
|
+
if (state.polarAxis.angleAxis[angleAxisId] != null) return state.polarAxis.angleAxis[angleAxisId];
|
|
108
|
+
if (state.layout.layoutType === "radial") return implicitRadialBarAngleAxis;
|
|
109
|
+
return implicitAngleAxis;
|
|
103
110
|
}
|
|
104
|
-
function
|
|
105
|
-
|
|
111
|
+
function selectRadiusAxis(state, radiusAxisId) {
|
|
112
|
+
if (state.polarAxis.radiusAxis[radiusAxisId] != null) return state.polarAxis.radiusAxis[radiusAxisId];
|
|
113
|
+
if (state.layout.layoutType === "radial") return implicitRadialBarRadiusAxis;
|
|
114
|
+
return implicitRadiusAxis;
|
|
106
115
|
}
|
|
107
|
-
var
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
if (
|
|
116
|
+
var selectPolarOptions = (state) => state.polarOptions;
|
|
117
|
+
var selectMaxRadius = createSelector([
|
|
118
|
+
selectChartWidth,
|
|
119
|
+
selectChartHeight,
|
|
120
|
+
selectChartOffset
|
|
121
|
+
], getMaxRadius);
|
|
122
|
+
var selectInnerRadius = createSelector([selectPolarOptions, selectMaxRadius], (polarChartOptions, maxRadius) => {
|
|
123
|
+
if (polarChartOptions == null) return;
|
|
124
|
+
return getPercentValue(polarChartOptions.innerRadius, maxRadius, 0);
|
|
125
|
+
});
|
|
126
|
+
var selectOuterRadius = createSelector([selectPolarOptions, selectMaxRadius], (polarChartOptions, maxRadius) => {
|
|
127
|
+
if (polarChartOptions == null) return;
|
|
128
|
+
return getPercentValue(polarChartOptions.outerRadius, maxRadius, maxRadius * .8);
|
|
115
129
|
});
|
|
116
|
-
function
|
|
117
|
-
if (
|
|
118
|
-
|
|
119
|
-
return [
|
|
130
|
+
function combineAngleAxisRange(polarOptions) {
|
|
131
|
+
if (polarOptions == null) return [0, 0];
|
|
132
|
+
const { startAngle, endAngle } = polarOptions;
|
|
133
|
+
return [startAngle, endAngle];
|
|
120
134
|
}
|
|
121
|
-
var
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
var selectAngleAxisRange = createSelector([selectPolarOptions], combineAngleAxisRange);
|
|
136
|
+
var selectAngleAxisRangeWithReversed = createSelector([selectAngleAxis, selectAngleAxisRange], combineAxisRangeWithReverse);
|
|
137
|
+
var selectRadiusAxisRange = createSelector([
|
|
138
|
+
selectMaxRadius,
|
|
139
|
+
selectInnerRadius,
|
|
140
|
+
selectOuterRadius
|
|
141
|
+
], (maxRadius, innerRadius, outerRadius) => {
|
|
142
|
+
if (maxRadius == null || innerRadius == null || outerRadius == null) return;
|
|
143
|
+
return [innerRadius, outerRadius];
|
|
144
|
+
});
|
|
145
|
+
var selectRadiusAxisRangeWithReversed = createSelector([selectRadiusAxis, selectRadiusAxisRange], combineAxisRangeWithReverse);
|
|
146
|
+
var selectPolarViewBox = createSelector([
|
|
147
|
+
selectChartLayout,
|
|
148
|
+
selectPolarOptions,
|
|
149
|
+
selectInnerRadius,
|
|
150
|
+
selectOuterRadius,
|
|
151
|
+
selectChartWidth,
|
|
152
|
+
selectChartHeight
|
|
153
|
+
], (layout, polarOptions, innerRadius, outerRadius, width, height) => {
|
|
154
|
+
if (layout !== "centric" && layout !== "radial" || polarOptions == null || innerRadius == null || outerRadius == null) return;
|
|
155
|
+
const { cx, cy, startAngle, endAngle } = polarOptions;
|
|
137
156
|
return {
|
|
138
|
-
cx:
|
|
139
|
-
cy:
|
|
140
|
-
innerRadius
|
|
141
|
-
outerRadius
|
|
142
|
-
startAngle
|
|
143
|
-
endAngle
|
|
144
|
-
clockWise:
|
|
157
|
+
cx: getPercentValue(cx, width, width / 2),
|
|
158
|
+
cy: getPercentValue(cy, height, height / 2),
|
|
159
|
+
innerRadius,
|
|
160
|
+
outerRadius,
|
|
161
|
+
startAngle,
|
|
162
|
+
endAngle,
|
|
163
|
+
clockWise: false
|
|
145
164
|
};
|
|
146
165
|
});
|
|
147
166
|
//#endregion
|
|
148
|
-
export {
|
|
167
|
+
export { selectAngleAxis, selectAngleAxisRange, selectAngleAxisRangeWithReversed, selectPolarViewBox, selectRadiusAxis, selectRadiusAxisRange, selectRadiusAxisRangeWithReversed };
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { selectPolarAxisTicks
|
|
2
|
-
import { createSelector
|
|
1
|
+
import { selectPolarAxisTicks } from "./polarScaleSelectors.mjs";
|
|
2
|
+
import { createSelector } from "@reduxjs/toolkit";
|
|
3
3
|
//#region src/state/selectors/polarGridSelectors.ts
|
|
4
|
-
function
|
|
5
|
-
return
|
|
4
|
+
function selectAngleAxisTicks(state, anglexisId) {
|
|
5
|
+
return selectPolarAxisTicks(state, "angleAxis", anglexisId, false);
|
|
6
6
|
}
|
|
7
|
-
var
|
|
8
|
-
if (
|
|
7
|
+
var selectPolarGridAngles = createSelector([selectAngleAxisTicks], (ticks) => {
|
|
8
|
+
if (!ticks) return;
|
|
9
|
+
return ticks.map((tick) => tick.coordinate);
|
|
9
10
|
});
|
|
10
|
-
function
|
|
11
|
-
return
|
|
11
|
+
function selectRadiusAxisTicks(state, radiusAxisId) {
|
|
12
|
+
return selectPolarAxisTicks(state, "radiusAxis", radiusAxisId, false);
|
|
12
13
|
}
|
|
13
|
-
var
|
|
14
|
-
if (
|
|
14
|
+
var selectPolarGridRadii = createSelector([selectRadiusAxisTicks], (ticks) => {
|
|
15
|
+
if (!ticks) return;
|
|
16
|
+
return ticks.map((tick) => tick.coordinate);
|
|
15
17
|
});
|
|
16
18
|
//#endregion
|
|
17
|
-
export {
|
|
19
|
+
export { selectPolarGridAngles, selectPolarGridRadii };
|
|
@@ -1,52 +1,55 @@
|
|
|
1
|
-
import { selectChartLayout
|
|
2
|
-
import { selectAngleAxis
|
|
3
|
-
import { pickAxisType
|
|
4
|
-
import { combineAxisTicks
|
|
5
|
-
import { selectPolarAppliedValues
|
|
6
|
-
import { createSelector
|
|
1
|
+
import { selectChartLayout } from "./common.mjs";
|
|
2
|
+
import { selectAngleAxis, selectAngleAxisRangeWithReversed, selectRadiusAxis, selectRadiusAxisRangeWithReversed } from "./polarAxisSelectors.mjs";
|
|
3
|
+
import { pickAxisType } from "./pickAxisType.mjs";
|
|
4
|
+
import { combineAxisTicks, combineCategoricalDomain, combineGraphicalItemTicks, combineScaleFunction, selectAxisSettings, selectDuplicateDomain, selectRealScaleType } from "./axisSelectors.mjs";
|
|
5
|
+
import { selectPolarAppliedValues, selectPolarAxisDomainIncludingNiceTicks, selectPolarNiceTicks } from "./polarSelectors.mjs";
|
|
6
|
+
import { createSelector } from "@reduxjs/toolkit";
|
|
7
7
|
//#region src/state/selectors/polarScaleSelectors.ts
|
|
8
|
-
function
|
|
9
|
-
switch (
|
|
10
|
-
case "angleAxis": return
|
|
11
|
-
case "radiusAxis": return
|
|
12
|
-
default: throw Error(`Unexpected axis type: ${
|
|
8
|
+
function selectPolarAxis(state, axisType, axisId) {
|
|
9
|
+
switch (axisType) {
|
|
10
|
+
case "angleAxis": return selectAngleAxis(state, axisId);
|
|
11
|
+
case "radiusAxis": return selectRadiusAxis(state, axisId);
|
|
12
|
+
default: throw new Error(`Unexpected axis type: ${axisType}`);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
switch (
|
|
17
|
-
case "angleAxis": return
|
|
18
|
-
case "radiusAxis": return
|
|
19
|
-
default: throw Error(`Unexpected axis type: ${
|
|
15
|
+
function selectPolarAxisRangeWithReversed(state, axisType, axisId) {
|
|
16
|
+
switch (axisType) {
|
|
17
|
+
case "angleAxis": return selectAngleAxisRangeWithReversed(state, axisId);
|
|
18
|
+
case "radiusAxis": return selectRadiusAxisRangeWithReversed(state, axisId);
|
|
19
|
+
default: throw new Error(`Unexpected axis type: ${axisType}`);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
],
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
22
|
+
var selectPolarAxisScale = createSelector([
|
|
23
|
+
selectPolarAxis,
|
|
24
|
+
selectRealScaleType,
|
|
25
|
+
selectPolarAxisDomainIncludingNiceTicks,
|
|
26
|
+
selectPolarAxisRangeWithReversed
|
|
27
|
+
], combineScaleFunction);
|
|
28
|
+
var selectPolarCategoricalDomain = createSelector([
|
|
29
|
+
selectChartLayout,
|
|
30
|
+
selectPolarAppliedValues,
|
|
31
|
+
selectAxisSettings,
|
|
32
|
+
pickAxisType
|
|
33
|
+
], combineCategoricalDomain);
|
|
34
|
+
var selectPolarAxisTicks = createSelector([
|
|
35
|
+
selectChartLayout,
|
|
36
|
+
selectPolarAxis,
|
|
37
|
+
selectRealScaleType,
|
|
38
|
+
selectPolarAxisScale,
|
|
39
|
+
selectPolarNiceTicks,
|
|
40
|
+
selectPolarAxisRangeWithReversed,
|
|
41
|
+
selectDuplicateDomain,
|
|
42
|
+
selectPolarCategoricalDomain,
|
|
43
|
+
pickAxisType
|
|
44
|
+
], combineAxisTicks);
|
|
45
|
+
var selectPolarGraphicalItemAxisTicks = createSelector([
|
|
46
|
+
selectChartLayout,
|
|
47
|
+
selectPolarAxis,
|
|
48
|
+
selectPolarAxisScale,
|
|
49
|
+
selectPolarAxisRangeWithReversed,
|
|
50
|
+
selectDuplicateDomain,
|
|
51
|
+
selectPolarCategoricalDomain,
|
|
52
|
+
pickAxisType
|
|
53
|
+
], combineGraphicalItemTicks);
|
|
51
54
|
//#endregion
|
|
52
|
-
export {
|
|
55
|
+
export { selectPolarAxisScale, selectPolarAxisTicks, selectPolarGraphicalItemAxisTicks };
|
|
@@ -1,64 +1,81 @@
|
|
|
1
|
-
import { selectChartDataAndAlwaysIgnoreIndexes
|
|
2
|
-
import { selectStackOffsetType
|
|
3
|
-
import { selectChartLayout
|
|
4
|
-
import { pickAxisType
|
|
5
|
-
import { pickAxisId
|
|
6
|
-
import { getValueByDataKey
|
|
7
|
-
import { combineAppliedValues
|
|
8
|
-
import { createSelector
|
|
1
|
+
import { selectChartDataAndAlwaysIgnoreIndexes, selectChartDataWithIndexes } from "./dataSelectors.mjs";
|
|
2
|
+
import { selectStackOffsetType } from "./rootPropsSelectors.mjs";
|
|
3
|
+
import { selectChartLayout } from "./common.mjs";
|
|
4
|
+
import { pickAxisType } from "./pickAxisType.mjs";
|
|
5
|
+
import { pickAxisId } from "./pickAxisId.mjs";
|
|
6
|
+
import { getValueByDataKey } from "../../utils/chart.mjs";
|
|
7
|
+
import { combineAppliedValues, combineAxisDomain, combineAxisDomainWithNiceTicks, combineDisplayedData, combineDomainOfStackGroups, combineGraphicalItemsData, combineGraphicalItemsSettings, combineNiceTicks, combineNumericalDomain, combineStackGroups, itemAxisPredicate, selectBaseAxis, selectDomainDefinition, selectRealScaleType } from "./axisSelectors.mjs";
|
|
8
|
+
import { createSelector } from "@reduxjs/toolkit";
|
|
9
9
|
//#region src/state/selectors/polarSelectors.ts
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
10
|
+
var selectUnfilteredPolarItems = (state) => state.graphicalItems.polarItems;
|
|
11
|
+
var selectPolarItemsSettings = createSelector([
|
|
12
|
+
selectUnfilteredPolarItems,
|
|
13
|
+
selectBaseAxis,
|
|
14
|
+
createSelector([pickAxisType, pickAxisId], itemAxisPredicate)
|
|
15
|
+
], combineGraphicalItemsSettings);
|
|
16
|
+
var selectPolarDisplayedData = createSelector([createSelector([selectPolarItemsSettings], combineGraphicalItemsData), selectChartDataAndAlwaysIgnoreIndexes], combineDisplayedData);
|
|
17
|
+
var selectPolarAppliedValues = createSelector([
|
|
18
|
+
selectPolarDisplayedData,
|
|
19
|
+
selectBaseAxis,
|
|
20
|
+
selectPolarItemsSettings
|
|
21
|
+
], combineAppliedValues);
|
|
22
|
+
var selectAllPolarAppliedNumericalValues = createSelector([
|
|
23
|
+
selectPolarDisplayedData,
|
|
24
|
+
selectBaseAxis,
|
|
25
|
+
selectPolarItemsSettings
|
|
26
|
+
], (data, axisSettings, items) => {
|
|
27
|
+
if (items.length > 0) return data.flatMap((entry) => {
|
|
28
|
+
return items.flatMap((item) => {
|
|
29
|
+
return {
|
|
30
|
+
value: getValueByDataKey(entry, axisSettings.dataKey ?? item.dataKey),
|
|
31
|
+
errorDomain: []
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
}).filter(Boolean);
|
|
35
|
+
if (axisSettings?.dataKey != null) return data.map((item) => ({
|
|
36
|
+
value: getValueByDataKey(item, axisSettings.dataKey),
|
|
37
|
+
errorDomain: []
|
|
38
|
+
}));
|
|
39
|
+
return data.map((entry) => ({
|
|
40
|
+
value: entry,
|
|
41
|
+
errorDomain: []
|
|
42
|
+
}));
|
|
43
|
+
});
|
|
44
|
+
var selectPolarDomainOfStackGroups = createSelector([
|
|
45
|
+
createSelector([
|
|
46
|
+
selectPolarDisplayedData,
|
|
47
|
+
selectPolarItemsSettings,
|
|
48
|
+
selectStackOffsetType
|
|
49
|
+
], combineStackGroups),
|
|
50
|
+
selectChartDataWithIndexes,
|
|
51
|
+
pickAxisType
|
|
52
|
+
], combineDomainOfStackGroups);
|
|
53
|
+
var unsupportedInPolarChart = () => void 0;
|
|
54
|
+
var selectPolarAxisDomain = createSelector([
|
|
55
|
+
selectBaseAxis,
|
|
56
|
+
selectChartLayout,
|
|
57
|
+
selectPolarDisplayedData,
|
|
58
|
+
selectPolarAppliedValues,
|
|
59
|
+
selectStackOffsetType,
|
|
60
|
+
pickAxisType,
|
|
61
|
+
createSelector([
|
|
62
|
+
selectBaseAxis,
|
|
63
|
+
selectDomainDefinition,
|
|
64
|
+
selectPolarDomainOfStackGroups,
|
|
65
|
+
selectAllPolarAppliedNumericalValues,
|
|
66
|
+
unsupportedInPolarChart
|
|
67
|
+
], combineNumericalDomain)
|
|
68
|
+
], combineAxisDomain);
|
|
69
|
+
var selectPolarNiceTicks = createSelector([
|
|
70
|
+
selectPolarAxisDomain,
|
|
71
|
+
selectBaseAxis,
|
|
72
|
+
selectRealScaleType
|
|
73
|
+
], combineNiceTicks);
|
|
74
|
+
var selectPolarAxisDomainIncludingNiceTicks = createSelector([
|
|
75
|
+
selectBaseAxis,
|
|
76
|
+
selectPolarAxisDomain,
|
|
77
|
+
selectPolarNiceTicks,
|
|
78
|
+
pickAxisType
|
|
79
|
+
], combineAxisDomainWithNiceTicks);
|
|
63
80
|
//#endregion
|
|
64
|
-
export {
|
|
81
|
+
export { selectPolarAppliedValues, selectPolarAxisDomainIncludingNiceTicks, selectPolarDisplayedData, selectPolarItemsSettings, selectPolarNiceTicks, selectUnfilteredPolarItems };
|