vccs 0.1.0 → 0.3.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.
Files changed (273) hide show
  1. package/README.md +151 -0
  2. package/dist/animation/Animate.d.ts +1 -1
  3. package/dist/cartesian/area/type.d.ts +3 -3
  4. package/dist/cartesian/bar/type.d.ts +1 -13
  5. package/dist/cartesian/brush/components/Slide.d.ts +1 -1
  6. package/dist/cartesian/brush/components/TravellerLayer.d.ts +1 -1
  7. package/dist/cartesian/brush/type.d.ts +2 -1
  8. package/dist/cartesian/cartesian-axis/CartesianAxis.d.ts +2 -1
  9. package/dist/cartesian/funnel/Funnel.d.ts +2 -0
  10. package/dist/cartesian/funnel/index.d.ts +2 -0
  11. package/dist/cartesian/funnel/type.d.ts +74 -6
  12. package/dist/cartesian/index.d.ts +2 -0
  13. package/dist/cartesian/line/Line.d.ts +7 -13
  14. package/dist/cartesian/line/type.d.ts +4 -17
  15. package/dist/cartesian/reference-area/ReferenceArea.d.ts +16 -16
  16. package/dist/cartesian/reference-dot/ReferenceDot.d.ts +143 -0
  17. package/dist/cartesian/reference-dot/index.d.ts +2 -0
  18. package/dist/cartesian/reference-line/ReferenceLine.d.ts +8 -8
  19. package/dist/cartesian/scatter/Scatter.d.ts +1 -1
  20. package/dist/chart/FunnelChart.d.ts +1 -0
  21. package/dist/chart/RechartsWrapper.d.ts +7 -3
  22. package/dist/chart/Surface.d.ts +2 -1
  23. package/dist/chart/Treemap.d.ts +237 -0
  24. package/dist/chart/generateCategoricalChart.d.ts +2 -1
  25. package/dist/chart/index.d.ts +2 -0
  26. package/dist/chart/treemapUtils.d.ts +22 -0
  27. package/dist/components/Customized.d.ts +23 -0
  28. package/dist/components/Text.d.ts +4 -4
  29. package/dist/components/Tooltip.d.ts +1 -1
  30. package/dist/components/index.d.ts +2 -0
  31. package/dist/components/label/Label.d.ts +3 -3
  32. package/dist/components/label/types.d.ts +1 -1
  33. package/dist/container/Surface.d.ts +3 -2
  34. package/dist/es/animation/Animate.mjs +48 -22
  35. package/dist/es/cartesian/GraphicalItemClipPath.mjs +16 -15
  36. package/dist/es/cartesian/area/ActivePoints.mjs +44 -40
  37. package/dist/es/cartesian/area/Area.mjs +42 -31
  38. package/dist/es/cartesian/area/ClipRect.mjs +79 -58
  39. package/dist/es/cartesian/area/RenderArea.mjs +142 -108
  40. package/dist/es/cartesian/area/hooks/useArea.mjs +71 -47
  41. package/dist/es/cartesian/area/type.mjs +13 -15
  42. package/dist/es/cartesian/area/utils.mjs +69 -49
  43. package/dist/es/cartesian/axis/XAxis.mjs +87 -73
  44. package/dist/es/cartesian/axis/YAxis.mjs +67 -56
  45. package/dist/es/cartesian/bar/Bar.mjs +78 -71
  46. package/dist/es/cartesian/bar/components/BarBackground.mjs +22 -19
  47. package/dist/es/cartesian/bar/components/BarRectangles.mjs +117 -80
  48. package/dist/es/cartesian/bar/hooks/useBar.mjs +49 -37
  49. package/dist/es/cartesian/bar/type.mjs +11 -25
  50. package/dist/es/cartesian/bar/utils.mjs +97 -70
  51. package/dist/es/cartesian/cartesian-axis/CartesianAxis.mjs +165 -115
  52. package/dist/es/cartesian/cartesian-grid/Background.mjs +19 -16
  53. package/dist/es/cartesian/cartesian-grid/CartesianGrid.mjs +116 -97
  54. package/dist/es/cartesian/cartesian-grid/HorizontalGridLines.mjs +24 -23
  55. package/dist/es/cartesian/cartesian-grid/HorizontalStripes.mjs +24 -24
  56. package/dist/es/cartesian/cartesian-grid/VerticalGridLines.mjs +23 -22
  57. package/dist/es/cartesian/cartesian-grid/VerticalStripes.mjs +24 -24
  58. package/dist/es/cartesian/cartesian-grid/const.mjs +317 -10
  59. package/dist/es/cartesian/cartesian-grid/utils.mjs +18 -13
  60. package/dist/es/cartesian/error-bar/ErrorBar.mjs +111 -83
  61. package/dist/es/cartesian/error-bar/ErrorBarContext.mjs +13 -12
  62. package/dist/es/cartesian/funnel/Funnel.mjs +162 -0
  63. package/dist/es/cartesian/funnel/type.mjs +78 -0
  64. package/dist/es/cartesian/funnel/utils.mjs +102 -0
  65. package/dist/es/cartesian/line/ActivePoints.mjs +45 -41
  66. package/dist/es/cartesian/line/Line.mjs +41 -37
  67. package/dist/es/cartesian/line/StaticLine.mjs +191 -122
  68. package/dist/es/cartesian/line/hooks/useLine.mjs +60 -44
  69. package/dist/es/cartesian/line/type.mjs +13 -18
  70. package/dist/es/cartesian/line/utils.mjs +27 -26
  71. package/dist/es/cartesian/reference-area/ReferenceArea.mjs +79 -78
  72. package/dist/es/cartesian/reference-dot/ReferenceDot.mjs +134 -0
  73. package/dist/es/cartesian/reference-line/ReferenceLine.mjs +93 -84
  74. package/dist/es/cartesian/scatter/Scatter.mjs +168 -140
  75. package/dist/es/cartesian/scatter/hooks/useScatter.mjs +18 -14
  76. package/dist/es/cartesian/useNeedsClip.mjs +18 -9
  77. package/dist/es/cartesian/utils/get-ticks.mjs +103 -68
  78. package/dist/es/cartesian/z-axis/ZAxis.mjs +30 -28
  79. package/dist/es/chart/AreaChart.mjs +5 -5
  80. package/dist/es/chart/BarChart.mjs +5 -5
  81. package/dist/es/chart/ComposedChart.mjs +5 -5
  82. package/dist/es/chart/FunnelChart.mjs +11 -0
  83. package/dist/es/chart/LegendPortalContext.mjs +3 -3
  84. package/dist/es/chart/LineChart.mjs +5 -5
  85. package/dist/es/chart/PieChart.mjs +5 -5
  86. package/dist/es/chart/RadarChart.mjs +5 -5
  87. package/dist/es/chart/RadialBarChart.mjs +5 -5
  88. package/dist/es/chart/RechartsWrapper.mjs +113 -89
  89. package/dist/es/chart/ScatterChart.mjs +5 -5
  90. package/dist/es/chart/Surface.mjs +3 -3
  91. package/dist/es/chart/Surface.vue_vue_type_script_setup_true_lang.mjs +51 -45
  92. package/dist/es/chart/TooltipPortalContext.mjs +3 -3
  93. package/dist/es/chart/Treemap.mjs +379 -0
  94. package/dist/es/chart/const.mjs +2 -2
  95. package/dist/es/chart/generateCategoricalChart.mjs +99 -89
  96. package/dist/es/chart/provideClipPathId.mjs +12 -7
  97. package/dist/es/chart/treemapUtils.mjs +32 -0
  98. package/dist/es/components/Cell.mjs +16 -4
  99. package/dist/es/components/Customized.mjs +43 -0
  100. package/dist/es/components/Text.mjs +3 -3
  101. package/dist/es/components/Text.vue_vue_type_script_setup_true_lang.mjs +106 -69
  102. package/dist/es/components/Tooltip.mjs +274 -199
  103. package/dist/es/components/label/Label.mjs +30 -26
  104. package/dist/es/components/label/LabelList.mjs +45 -39
  105. package/dist/es/components/label/types.mjs +10 -6
  106. package/dist/es/components/label/utils.mjs +194 -162
  107. package/dist/es/components/legend/Legend.mjs +82 -71
  108. package/dist/es/components/legend/LegendSymbol.mjs +40 -38
  109. package/dist/es/components/legend/hooks/useLegend.mjs +71 -46
  110. package/dist/es/components/legend/hooks/useLegendContent.mjs +52 -31
  111. package/dist/es/components/legend/type.mjs +2 -2
  112. package/dist/es/components/legend/utils.mjs +19 -11
  113. package/dist/es/components/utils.mjs +35 -22
  114. package/dist/es/container/ClipPath.mjs +14 -14
  115. package/dist/es/container/Layer.mjs +9 -7
  116. package/dist/es/container/ResponsiveContainer.mjs +3 -3
  117. package/dist/es/container/ResponsiveContainer.vue_vue_type_script_setup_true_lang.mjs +109 -77
  118. package/dist/es/container/Surface.mjs +25 -23
  119. package/dist/es/container/useSizeContext.mjs +3 -3
  120. package/dist/es/context/ChartDataContextProvider.mjs +19 -13
  121. package/dist/es/context/PanoramaContextProvider.mjs +15 -10
  122. package/dist/es/context/accessibilityContext.mjs +3 -3
  123. package/dist/es/context/cartesianLabelListContext.mjs +3 -3
  124. package/dist/es/context/chartLayoutContext.mjs +33 -30
  125. package/dist/es/context/cursorLayerContext.mjs +3 -3
  126. package/dist/es/context/graphicalLayerContext.mjs +3 -3
  127. package/dist/es/context/labelLayerContext.mjs +3 -3
  128. package/dist/es/context/polarLabelViewBoxContext.mjs +5 -5
  129. package/dist/es/context/useTooltipAxis.mjs +14 -12
  130. package/dist/es/events/useChartSynchronisation.mjs +91 -66
  131. package/dist/es/hooks/publicHooks.mjs +207 -0
  132. package/dist/es/hooks/useIsAnimating.mjs +28 -0
  133. package/dist/es/hooks/useSetupGraphicalItem.mjs +52 -43
  134. package/dist/es/index.mjs +54 -42
  135. package/dist/es/polar/pie/Pie.mjs +131 -115
  136. package/dist/es/polar/pie/type.mjs +8 -10
  137. package/dist/es/polar/radar/PolarAngleAxis.mjs +103 -84
  138. package/dist/es/polar/radar/PolarGrid.mjs +72 -59
  139. package/dist/es/polar/radar/PolarRadiusAxis.mjs +90 -65
  140. package/dist/es/polar/radar/Radar.mjs +181 -145
  141. package/dist/es/polar/radial-bar/RadialBar.mjs +161 -140
  142. package/dist/es/polar/radial-bar/type.mjs +9 -9
  143. package/dist/es/shape/Cross.mjs +11 -10
  144. package/dist/es/shape/Curve.mjs +71 -44
  145. package/dist/es/shape/Dot.mjs +12 -11
  146. package/dist/es/shape/Polygon.mjs +19 -0
  147. package/dist/es/shape/Rectangle.mjs +41 -30
  148. package/dist/es/shape/Sector.mjs +105 -79
  149. package/dist/es/shape/Symbols.mjs +45 -34
  150. package/dist/es/shape/Trapezoid.mjs +50 -0
  151. package/dist/es/state/ReportChartProps.mjs +23 -24
  152. package/dist/es/state/ReportMainChartProps.mjs +26 -21
  153. package/dist/es/state/ReportPolarOptions.mjs +23 -22
  154. package/dist/es/state/SetGraphicalItem.mjs +42 -27
  155. package/dist/es/state/SetLegendPayload.mjs +17 -13
  156. package/dist/es/state/SetTooltipEntrySettings.mjs +14 -12
  157. package/dist/es/state/brushSlice.mjs +12 -8
  158. package/dist/es/state/cartesianAxisSlice.mjs +23 -17
  159. package/dist/es/state/chartDataSlice.mjs +18 -13
  160. package/dist/es/state/externalEventsMiddleware.mjs +25 -15
  161. package/dist/es/state/graphicalItemsSlice.mjs +29 -25
  162. package/dist/es/state/hooks.mjs +24 -3
  163. package/dist/es/state/keyboardEventsMiddleware.mjs +50 -42
  164. package/dist/es/state/layoutSlice.mjs +18 -12
  165. package/dist/es/state/legendSlice.mjs +19 -14
  166. package/dist/es/state/mouseEventsMiddleware.mjs +31 -24
  167. package/dist/es/state/optionsSlice.mjs +14 -11
  168. package/dist/es/state/polarAxisSlice.mjs +15 -13
  169. package/dist/es/state/polarOptionsSlice.mjs +8 -6
  170. package/dist/es/state/reduxDevtoolsJsonStringifyReplacer.mjs +5 -3
  171. package/dist/es/state/referenceElementsSlice.mjs +21 -19
  172. package/dist/es/state/rootPropsSlice.mjs +20 -9
  173. package/dist/es/state/selectors/areaSelectors.mjs +65 -55
  174. package/dist/es/state/selectors/axisSelectors.mjs +784 -569
  175. package/dist/es/state/selectors/barSelectors.mjs +225 -162
  176. package/dist/es/state/selectors/brushSelectors.mjs +15 -14
  177. package/dist/es/state/selectors/combiners/combineActiveLabel.mjs +6 -5
  178. package/dist/es/state/selectors/combiners/combineActiveTooltipIndex.mjs +36 -27
  179. package/dist/es/state/selectors/combiners/combineAxisRangeWithReverse.mjs +5 -3
  180. package/dist/es/state/selectors/combiners/combineCoordinateForDefaultIndex.mjs +13 -11
  181. package/dist/es/state/selectors/combiners/combineTooltipInteractionState.mjs +26 -21
  182. package/dist/es/state/selectors/combiners/combineTooltipPayloadConfigurations.mjs +10 -6
  183. package/dist/es/state/selectors/common.mjs +2 -2
  184. package/dist/es/state/selectors/containerSelectors.mjs +5 -2
  185. package/dist/es/state/selectors/dataSelectors.mjs +28 -9
  186. package/dist/es/state/selectors/funnelSelectors.mjs +38 -0
  187. package/dist/es/state/selectors/legendSelectors.mjs +7 -6
  188. package/dist/es/state/selectors/lineSelectors.mjs +54 -47
  189. package/dist/es/state/selectors/pickAxisId.mjs +2 -2
  190. package/dist/es/state/selectors/pickAxisType.mjs +2 -2
  191. package/dist/es/state/selectors/pieSelectors.mjs +116 -81
  192. package/dist/es/state/selectors/polarAxisSelectors.mjs +113 -94
  193. package/dist/es/state/selectors/polarGridSelectors.mjs +13 -11
  194. package/dist/es/state/selectors/polarScaleSelectors.mjs +49 -46
  195. package/dist/es/state/selectors/polarSelectors.mjs +79 -62
  196. package/dist/es/state/selectors/radarSelectors.mjs +111 -91
  197. package/dist/es/state/selectors/radialBarSelectors.mjs +230 -183
  198. package/dist/es/state/selectors/rootPropsSelectors.mjs +11 -5
  199. package/dist/es/state/selectors/scatterSelectors.mjs +111 -95
  200. package/dist/es/state/selectors/selectActivePropsFromChartPointer.mjs +19 -17
  201. package/dist/es/state/selectors/selectAllAxes.mjs +8 -3
  202. package/dist/es/state/selectors/selectChartOffset.mjs +59 -50
  203. package/dist/es/state/selectors/selectChartOffsetInternal.mjs +55 -44
  204. package/dist/es/state/selectors/selectTooltipEventType.mjs +15 -14
  205. package/dist/es/state/selectors/selectTooltipPayloadSearcher.mjs +3 -3
  206. package/dist/es/state/selectors/selectTooltipSettings.mjs +2 -2
  207. package/dist/es/state/selectors/selectTooltipState.mjs +2 -2
  208. package/dist/es/state/selectors/selectors.mjs +94 -75
  209. package/dist/es/state/selectors/tooltipSelectors.mjs +253 -204
  210. package/dist/es/state/selectors/touchSelectors.mjs +17 -14
  211. package/dist/es/state/store.mjs +46 -46
  212. package/dist/es/state/tooltipSlice.mjs +64 -37
  213. package/dist/es/state/touchEventsMiddleware.mjs +35 -29
  214. package/dist/es/state/utils/useReportScale.mjs +16 -13
  215. package/dist/es/synchronisation/syncSelectors.mjs +3 -3
  216. package/dist/es/synchronisation/useChartSynchronisation.mjs +33 -19
  217. package/dist/es/types/common.mjs +12 -0
  218. package/dist/es/types/event.mjs +164 -2
  219. package/dist/es/utils/ReduceCSSCalc.mjs +81 -49
  220. package/dist/es/utils/VueUtils.mjs +35 -14
  221. package/dist/es/utils/attrs.mjs +43 -26
  222. package/dist/es/utils/cartesian.mjs +47 -15
  223. package/dist/es/utils/cell.mjs +28 -0
  224. package/dist/es/utils/chart.mjs +298 -197
  225. package/dist/es/utils/const.mjs +30 -2
  226. package/dist/es/utils/createCategoricalInverse.mjs +46 -0
  227. package/dist/es/utils/createContext.mjs +28 -9
  228. package/dist/es/utils/data-utils.mjs +9 -8
  229. package/dist/es/utils/data.mjs +35 -21
  230. package/dist/es/utils/events.mjs +5 -3
  231. package/dist/es/utils/getLinearRegression.mjs +28 -11
  232. package/dist/es/utils/grid.mjs +20 -5
  233. package/dist/es/utils/isDomainSpecifiedByUser.mjs +105 -54
  234. package/dist/es/utils/legend.mjs +13 -12
  235. package/dist/es/utils/log.mjs +10 -7
  236. package/dist/es/utils/payload/getUniqPayload.mjs +6 -4
  237. package/dist/es/utils/polar.mjs +37 -30
  238. package/dist/es/utils/props.mjs +16 -10
  239. package/dist/es/utils/resolveDefaultProps.mjs +23 -4
  240. package/dist/es/utils/scale/getNiceTickValues.mjs +127 -49
  241. package/dist/es/utils/scale/utils/arithmetic.mjs +49 -19
  242. package/dist/es/utils/scale/utils/utils.mjs +43 -24
  243. package/dist/es/utils/scale.mjs +46 -0
  244. package/dist/es/utils/style.mjs +24 -13
  245. package/dist/es/utils/tick.mjs +34 -23
  246. package/dist/es/utils/tooltip/translate.mjs +63 -49
  247. package/dist/es/utils/validate.mjs +40 -29
  248. package/dist/hooks/publicHooks.d.ts +143 -0
  249. package/dist/hooks/useIsAnimating.d.ts +14 -0
  250. package/dist/index.d.ts +1 -0
  251. package/dist/polar/pie/type.d.ts +2 -2
  252. package/dist/polar/radar/Radar.d.ts +4 -4
  253. package/dist/shape/Curve.d.ts +2 -1
  254. package/dist/shape/Polygon.d.ts +9 -0
  255. package/dist/shape/Rectangle.d.ts +0 -4
  256. package/dist/shape/Sector.d.ts +2 -2
  257. package/dist/shape/Symbols.d.ts +2 -1
  258. package/dist/shape/Trapezoid.d.ts +30 -0
  259. package/dist/shape/index.d.ts +2 -0
  260. package/dist/shape/types.d.ts +4 -5
  261. package/dist/state/ReportChartProps.d.ts +3 -3
  262. package/dist/state/graphicalItemsSlice.d.ts +1 -1
  263. package/dist/state/rootPropsSlice.d.ts +2 -2
  264. package/dist/state/selectors/axisSelectors.d.ts +5 -0
  265. package/dist/types/axis.d.ts +2 -2
  266. package/dist/types/bar.d.ts +2 -6
  267. package/dist/types/categorical.d.ts +2 -2
  268. package/dist/types/common.d.ts +7 -1
  269. package/dist/types/tooltip.d.ts +2 -2
  270. package/dist/utils/cell.d.ts +11 -0
  271. package/dist/utils/createCategoricalInverse.d.ts +16 -0
  272. package/dist/utils/scale.d.ts +23 -0
  273. package/package.json +2 -1
@@ -1,176 +1,197 @@
1
- import { interpolate as e } from "../../utils/data-utils.mjs";
2
- import { mouseLeaveItem as t, setActiveMouseOverItemIndex as n } from "../../state/tooltipSlice.mjs";
3
- import { useAppDispatch as r, useAppSelector as i } from "../../state/hooks.mjs";
4
- import { Layer as a } from "../../container/Layer.mjs";
5
- import { provideCartesianLabelListData as o } from "../../context/cartesianLabelListContext.mjs";
6
- import { LabelList as s } from "../../components/label/LabelList.mjs";
7
- import { Animate as c } from "../../animation/Animate.mjs";
8
- import { SetPolarGraphicalItem as l } from "../../state/SetGraphicalItem.mjs";
9
- import { SetLegendPayload as u } from "../../state/SetLegendPayload.mjs";
10
- import { SetTooltipEntrySettings as d } from "../../state/SetTooltipEntrySettings.mjs";
11
- import { Sector as f } from "../../shape/Sector.mjs";
12
- import { selectRadialBarLegendPayload as p, selectRadialBarSectors as m } from "../../state/selectors/radialBarSelectors.mjs";
13
- import { RadialBarVueProps as h } from "./type.mjs";
14
- import { Fragment as g, computed as _, createVNode as v, defineComponent as y, mergeProps as b, ref as x } from "vue";
1
+ import { interpolate } from "../../utils/data-utils.mjs";
2
+ import { mouseLeaveItem, setActiveMouseOverItemIndex } from "../../state/tooltipSlice.mjs";
3
+ import { useAppDispatch, useAppSelector } from "../../state/hooks.mjs";
4
+ import { useIsAnimating } from "../../hooks/useIsAnimating.mjs";
5
+ import { Layer } from "../../container/Layer.mjs";
6
+ import { provideCartesianLabelListData } from "../../context/cartesianLabelListContext.mjs";
7
+ import { LabelList } from "../../components/label/LabelList.mjs";
8
+ import { Animate } from "../../animation/Animate.mjs";
9
+ import { SetPolarGraphicalItem } from "../../state/SetGraphicalItem.mjs";
10
+ import { SetLegendPayload } from "../../state/SetLegendPayload.mjs";
11
+ import { SetTooltipEntrySettings } from "../../state/SetTooltipEntrySettings.mjs";
12
+ import { Sector } from "../../shape/Sector.mjs";
13
+ import { selectRadialBarLegendPayload, selectRadialBarSectors } from "../../state/selectors/radialBarSelectors.mjs";
14
+ import { RadialBarVueProps } from "./type.mjs";
15
+ import { Fragment, computed, createVNode, defineComponent, mergeProps } from "vue";
15
16
  //#region src/polar/radial-bar/RadialBar.tsx
16
- function S(e, t) {
17
- return t;
17
+ function getLegendItemColor(stroke, fill) {
18
+ return fill;
18
19
  }
19
- var C = /* @__PURE__ */ y({
20
+ var RadialBar = /* @__PURE__ */ defineComponent({
20
21
  name: "RadialBar",
21
- props: h,
22
- inheritAttrs: !1,
23
- setup(h, { slots: y }) {
24
- let C = r(), w = _(() => ({
25
- dataKey: h.dataKey,
26
- minPointSize: h.minPointSize,
27
- stackId: h.stackId,
28
- maxBarSize: h.maxBarSize,
29
- barSize: h.barSize
22
+ props: RadialBarVueProps,
23
+ inheritAttrs: false,
24
+ setup(props, { slots }) {
25
+ const dispatch = useAppDispatch();
26
+ const radialBarSettings = computed(() => ({
27
+ dataKey: props.dataKey,
28
+ minPointSize: props.minPointSize,
29
+ stackId: props.stackId,
30
+ maxBarSize: props.maxBarSize,
31
+ barSize: props.barSize
30
32
  }));
31
- l(_(() => ({
33
+ SetPolarGraphicalItem(computed(() => ({
32
34
  type: "radialBar",
33
35
  data: void 0,
34
- dataKey: h.dataKey,
35
- hide: h.hide,
36
- angleAxisId: h.angleAxisId,
37
- radiusAxisId: h.radiusAxisId,
38
- barSize: h.barSize,
39
- stackId: h.stackId,
40
- minPointSize: h.minPointSize,
41
- maxBarSize: h.maxBarSize
36
+ dataKey: props.dataKey,
37
+ hide: props.hide,
38
+ angleAxisId: props.angleAxisId,
39
+ radiusAxisId: props.radiusAxisId,
40
+ barSize: props.barSize,
41
+ stackId: props.stackId,
42
+ minPointSize: props.minPointSize,
43
+ maxBarSize: props.maxBarSize
42
44
  })));
43
- let T = i((e) => p(e, h.legendType));
44
- u(_(() => T.value ?? []));
45
- let E = i((e) => m(e, h.radiusAxisId, h.angleAxisId, w.value));
46
- d({
47
- fn: (e) => e,
48
- args: _(() => ({
45
+ const legendPayload = useAppSelector((state) => selectRadialBarLegendPayload(state, props.legendType));
46
+ SetLegendPayload(computed(() => legendPayload.value ?? []));
47
+ const sectors = useAppSelector((state) => selectRadialBarSectors(state, props.radiusAxisId, props.angleAxisId, radialBarSettings.value));
48
+ SetTooltipEntrySettings({
49
+ fn: (v) => v,
50
+ args: computed(() => ({
49
51
  dataDefinedOnItem: void 0,
50
52
  positions: void 0,
51
53
  settings: {
52
- dataKey: h.dataKey,
54
+ dataKey: props.dataKey,
53
55
  nameKey: void 0,
54
- name: h.name ?? String(h.dataKey ?? ""),
55
- hide: h.hide,
56
- type: h.tooltipType,
57
- color: S(h.stroke, h.fill),
58
- fill: h.fill,
59
- stroke: h.stroke,
56
+ name: props.name ?? String(props.dataKey ?? ""),
57
+ hide: props.hide,
58
+ type: props.tooltipType,
59
+ color: getLegendItemColor(props.stroke, props.fill),
60
+ fill: props.fill,
61
+ stroke: props.stroke,
60
62
  unit: ""
61
63
  }
62
64
  }))
63
65
  });
64
- let D = x(h.isAnimationActive);
65
- o(_(() => {
66
- if (h.isAnimationActive && D.value) return;
67
- let e = E.value;
68
- if (!e) return;
69
- let t = h.fill;
70
- return e.map((e) => ({
71
- value: e.value ?? "",
72
- payload: e.payload,
66
+ const isAnimating = useIsAnimating(() => props.isAnimationActive);
67
+ provideCartesianLabelListData(computed(() => {
68
+ if (props.isAnimationActive && isAnimating.value) return void 0;
69
+ const data = sectors.value;
70
+ if (!data) return void 0;
71
+ const defaultFill = props.fill;
72
+ return data.map((sector) => ({
73
+ value: sector.value ?? "",
74
+ payload: sector.payload,
73
75
  parentViewBox: void 0,
74
- fill: e.fill ?? t,
75
- cx: e.cx,
76
- cy: e.cy,
77
- innerRadius: e.innerRadius,
78
- outerRadius: e.outerRadius,
79
- startAngle: e.startAngle,
80
- endAngle: e.endAngle,
81
- clockWise: !1
76
+ fill: sector.fill ?? defaultFill,
77
+ cx: sector.cx,
78
+ cy: sector.cy,
79
+ innerRadius: sector.innerRadius,
80
+ outerRadius: sector.outerRadius,
81
+ startAngle: sector.startAngle,
82
+ endAngle: sector.endAngle,
83
+ clockWise: false
82
84
  }));
83
85
  }));
84
- let O = null, k = 0, A, j = (e) => {
85
- let r = h.fill, i = h.stroke, o = !!h.background, s = typeof h.background == "object" ? h.background : {};
86
- return v(a, { class: "v-charts-radial-bar" }, { default: () => [o && e.map((e, t) => {
87
- if (!e.background) return null;
88
- let n = e.background;
89
- return v(f, b({
90
- key: `bg-${t}`,
91
- cx: n.cx,
92
- cy: n.cy,
93
- innerRadius: n.innerRadius,
94
- outerRadius: n.outerRadius,
95
- startAngle: n.startAngle,
96
- endAngle: n.endAngle,
97
- cornerRadius: h.cornerRadius,
98
- forceCornerRadius: h.forceCornerRadius,
99
- cornerIsExternal: h.cornerIsExternal,
100
- fill: "#eee",
86
+ let prevSectors = null;
87
+ let animationId = 0;
88
+ let lastSectors;
89
+ const renderSectors = (sectorData) => {
90
+ const defaultFill = props.fill;
91
+ const defaultStroke = props.stroke;
92
+ const showBackground = !!props.background;
93
+ const backgroundProps = typeof props.background === "object" ? props.background : {};
94
+ return createVNode(Layer, { "class": "v-charts-radial-bar" }, { default: () => [showBackground && sectorData.map((sector, i) => {
95
+ if (!sector.background) return null;
96
+ const bg = sector.background;
97
+ return createVNode(Sector, mergeProps({
98
+ "key": `bg-${i}`,
99
+ "cx": bg.cx,
100
+ "cy": bg.cy,
101
+ "innerRadius": bg.innerRadius,
102
+ "outerRadius": bg.outerRadius,
103
+ "startAngle": bg.startAngle,
104
+ "endAngle": bg.endAngle,
105
+ "cornerRadius": props.cornerRadius,
106
+ "forceCornerRadius": props.forceCornerRadius,
107
+ "cornerIsExternal": props.cornerIsExternal,
108
+ "fill": "#eee",
101
109
  "fill-opacity": .5
102
- }, s), null);
103
- }), e.map((e, a) => {
104
- if (e.innerRadius == null || e.outerRadius == null || e.startAngle == null || e.endAngle == null) return null;
105
- let o = e.fill ?? r, s = () => {
106
- C(n({
107
- activeIndex: String(a),
108
- activeDataKey: h.dataKey
110
+ }, backgroundProps), null);
111
+ }), sectorData.map((sector, i) => {
112
+ if (sector.innerRadius == null || sector.outerRadius == null || sector.startAngle == null || sector.endAngle == null) return null;
113
+ const sectorFill = sector.fill ?? defaultFill;
114
+ const onMouseenter = () => {
115
+ dispatch(setActiveMouseOverItemIndex({
116
+ activeIndex: String(i),
117
+ activeDataKey: props.dataKey
109
118
  }));
110
- }, c = () => {
111
- C(t());
112
119
  };
113
- return v(f, {
114
- key: `sector-${a}`,
115
- cx: e.cx,
116
- cy: e.cy,
117
- innerRadius: e.innerRadius,
118
- outerRadius: e.outerRadius,
119
- startAngle: e.startAngle,
120
- endAngle: e.endAngle,
121
- cornerRadius: h.cornerRadius,
122
- forceCornerRadius: h.forceCornerRadius,
123
- cornerIsExternal: h.cornerIsExternal,
124
- fill: o,
125
- "fill-opacity": h.fillOpacity,
126
- stroke: i ?? o,
127
- "stroke-width": h.strokeWidth,
128
- "stroke-dasharray": h.strokeDasharray,
129
- onMouseenter: s,
130
- onMouseleave: c
120
+ const onMouseleave = () => {
121
+ dispatch(mouseLeaveItem());
122
+ };
123
+ return createVNode(Sector, {
124
+ "key": `sector-${i}`,
125
+ "cx": sector.cx,
126
+ "cy": sector.cy,
127
+ "innerRadius": sector.innerRadius,
128
+ "outerRadius": sector.outerRadius,
129
+ "startAngle": sector.startAngle,
130
+ "endAngle": sector.endAngle,
131
+ "cornerRadius": props.cornerRadius,
132
+ "forceCornerRadius": props.forceCornerRadius,
133
+ "cornerIsExternal": props.cornerIsExternal,
134
+ "fill": sectorFill,
135
+ "fill-opacity": props.fillOpacity,
136
+ "stroke": defaultStroke ?? sectorFill,
137
+ "stroke-width": props.strokeWidth,
138
+ "stroke-dasharray": props.strokeDasharray,
139
+ "onMouseenter": onMouseenter,
140
+ "onMouseleave": onMouseleave
131
141
  }, null);
132
142
  })] });
133
143
  };
134
144
  return () => {
135
- if (h.hide) return null;
136
- let t = E.value;
137
- if (t == null || t.length === 0) return null;
138
- let n = t, r = !D.value && h.label ? v(s, typeof h.label == "object" ? h.label : {}, null) : null, i = D.value ? null : y.default?.();
139
- if (!h.isAnimationActive) return O = n, v(g, null, [
140
- j(n),
141
- r,
142
- i
143
- ]);
144
- let a = O;
145
- return t !== A && (k++, A = t), v(g, null, [
146
- v(c, {
147
- key: k,
148
- isActive: !0,
149
- onAnimationStart: () => {
150
- D.value = !0;
145
+ if (props.hide) return null;
146
+ const data = sectors.value;
147
+ if (data == null || data.length === 0) return null;
148
+ const sectorData = data;
149
+ const labelEl = !isAnimating.value && props.label ? createVNode(LabelList, typeof props.label === "object" ? props.label : {}, null) : null;
150
+ const slotChildren = !isAnimating.value ? slots.default?.() : null;
151
+ if (!props.isAnimationActive) {
152
+ prevSectors = sectorData;
153
+ return createVNode(Fragment, null, [
154
+ renderSectors(sectorData),
155
+ labelEl,
156
+ slotChildren
157
+ ]);
158
+ }
159
+ const prevSects = prevSectors;
160
+ if (data !== lastSectors) {
161
+ animationId++;
162
+ lastSectors = data;
163
+ }
164
+ return createVNode(Fragment, null, [
165
+ createVNode(Animate, {
166
+ "key": animationId,
167
+ "isActive": true,
168
+ "onAnimationStart": () => {
169
+ isAnimating.value = true;
151
170
  },
152
- onAnimationEnd: () => {
153
- D.value = !1;
171
+ "onAnimationEnd": () => {
172
+ isAnimating.value = false;
154
173
  }
155
174
  }, { default: (t) => {
156
- let r = t === 1 ? n : n.map((n, r) => {
157
- let i = a && a[r];
158
- return i ? {
159
- ...n,
160
- startAngle: i.startAngle != null && n.startAngle != null ? e(i.startAngle, n.startAngle, t) : n.startAngle,
161
- endAngle: e(i.endAngle ?? 0, n.endAngle, t)
162
- } : {
163
- ...n,
164
- endAngle: e(n.startAngle ?? 0, n.endAngle, t)
175
+ const stepSectors = t === 1 ? sectorData : sectorData.map((sector, i) => {
176
+ const prev = prevSects && prevSects[i];
177
+ if (!prev) return {
178
+ ...sector,
179
+ endAngle: interpolate(sector.startAngle ?? 0, sector.endAngle, t)
180
+ };
181
+ return {
182
+ ...sector,
183
+ startAngle: prev.startAngle != null && sector.startAngle != null ? interpolate(prev.startAngle, sector.startAngle, t) : sector.startAngle,
184
+ endAngle: interpolate(prev.endAngle ?? 0, sector.endAngle, t)
165
185
  };
166
186
  });
167
- return t > 0 && (O = r), j(r);
187
+ if (t > 0) prevSectors = stepSectors;
188
+ return renderSectors(stepSectors);
168
189
  } }),
169
- r,
170
- i
190
+ labelEl,
191
+ slotChildren
171
192
  ]);
172
193
  };
173
194
  }
174
195
  });
175
196
  //#endregion
176
- export { C as RadialBar };
197
+ export { RadialBar };
@@ -1,12 +1,12 @@
1
1
  //#region src/polar/radial-bar/type.ts
2
- var e = {
2
+ var RadialBarVueProps = {
3
3
  dataKey: {
4
4
  type: [
5
5
  String,
6
6
  Number,
7
7
  Function
8
8
  ],
9
- required: !0
9
+ required: true
10
10
  },
11
11
  name: {
12
12
  type: String,
@@ -42,7 +42,7 @@ var e = {
42
42
  },
43
43
  hide: {
44
44
  type: Boolean,
45
- default: !1
45
+ default: false
46
46
  },
47
47
  legendType: {
48
48
  type: String,
@@ -54,15 +54,15 @@ var e = {
54
54
  },
55
55
  background: {
56
56
  type: [Boolean, Object],
57
- default: !1
57
+ default: false
58
58
  },
59
59
  label: {
60
60
  type: [Boolean, Object],
61
- default: !1
61
+ default: false
62
62
  },
63
63
  isAnimationActive: {
64
64
  type: Boolean,
65
- default: !0
65
+ default: true
66
66
  },
67
67
  minPointSize: {
68
68
  type: Number,
@@ -86,12 +86,12 @@ var e = {
86
86
  },
87
87
  forceCornerRadius: {
88
88
  type: Boolean,
89
- default: !1
89
+ default: false
90
90
  },
91
91
  cornerIsExternal: {
92
92
  type: Boolean,
93
- default: !1
93
+ default: false
94
94
  }
95
95
  };
96
96
  //#endregion
97
- export { e as RadialBarVueProps };
97
+ export { RadialBarVueProps };
@@ -1,15 +1,16 @@
1
- import { isNumber as e } from "../utils/validate.mjs";
2
- import { createVNode as t, mergeProps as n } from "vue";
1
+ import { isNumber } from "../utils/validate.mjs";
2
+ import { createVNode, mergeProps } from "vue";
3
3
  //#region src/shape/Cross.tsx
4
- function r(e, t, n, r, i, a) {
5
- return `M${e},${i}v${r}M${a},${t}h${n}`;
4
+ function getCrossPath(x, y, width, height, top, left) {
5
+ return `M${x},${top}v${height}M${left},${y}h${width}`;
6
6
  }
7
- function i(i) {
8
- let { x: a = 0, y: o = 0, top: s = 0, left: c = 0, width: l = 0, height: u = 0, ...d } = i;
9
- return !e(a) || !e(o) || !e(l) || !e(u) || !e(s) || !e(c) ? null : t("path", n(d, {
10
- class: "v-charts-cross",
11
- d: r(a, o, l, u, s, c)
7
+ function Cross(props) {
8
+ const { x = 0, y = 0, top = 0, left = 0, width = 0, height = 0, ...rest } = props;
9
+ if (!isNumber(x) || !isNumber(y) || !isNumber(width) || !isNumber(height) || !isNumber(top) || !isNumber(left)) return null;
10
+ return createVNode("path", mergeProps(rest, {
11
+ "class": "v-charts-cross",
12
+ "d": getCrossPath(x, y, width, height, top, left)
12
13
  }), null);
13
14
  }
14
15
  //#endregion
15
- export { i as Cross };
16
+ export { Cross };
@@ -1,60 +1,87 @@
1
- import { isNumber as e } from "../utils/validate.mjs";
2
- import { computed as t, createVNode as n, defineComponent as r, mergeProps as i } from "vue";
3
- import { area as a, curveBasis as o, curveBasisClosed as s, curveBasisOpen as c, curveBumpX as l, curveBumpY as u, curveLinear as d, curveLinearClosed as f, curveMonotoneX as p, curveMonotoneY as m, curveNatural as h, curveStep as g, curveStepAfter as _, curveStepBefore as v, line as y } from "victory-vendor/d3-shape";
4
- import { upperFirst as b } from "es-toolkit/compat";
1
+ import { classProp } from "../types/common.mjs";
2
+ import { isNumber } from "../utils/validate.mjs";
3
+ import { computed, createVNode, defineComponent, mergeProps } from "vue";
4
+ import { area, curveBasis, curveBasisClosed, curveBasisOpen, curveBumpX, curveBumpY, curveLinear, curveLinearClosed, curveMonotoneX, curveMonotoneY, curveNatural, curveStep, curveStepAfter, curveStepBefore, line } from "victory-vendor/d3-shape";
5
+ import { upperFirst } from "es-toolkit/compat";
5
6
  //#region src/shape/Curve.tsx
6
- var x = {
7
- curveBasisClosed: s,
8
- curveBasisOpen: c,
9
- curveBasis: o,
10
- curveBumpX: l,
11
- curveBumpY: u,
12
- curveLinearClosed: f,
13
- curveLinear: d,
14
- curveMonotoneX: p,
15
- curveMonotoneY: m,
16
- curveNatural: h,
17
- curveStep: g,
18
- curveStepAfter: _,
19
- curveStepBefore: v
20
- }, S = (e) => e.x === +e.x && e.y === +e.y, C = (e) => e.x, w = (e) => e.y;
21
- function T(e, t) {
22
- if (typeof e == "function") return e;
23
- let n = `curve${b(e)}`;
24
- return (n === "curveMonotone" || n === "curveBump") && t ? x[`${n}${t === "vertical" ? "Y" : "X"}`] : x[n] || d;
7
+ /**
8
+ * @fileOverview Curve
9
+ */
10
+ var CURVE_FACTORIES = {
11
+ curveBasisClosed,
12
+ curveBasisOpen,
13
+ curveBasis,
14
+ curveBumpX,
15
+ curveBumpY,
16
+ curveLinearClosed,
17
+ curveLinear,
18
+ curveMonotoneX,
19
+ curveMonotoneY,
20
+ curveNatural,
21
+ curveStep,
22
+ curveStepAfter,
23
+ curveStepBefore
24
+ };
25
+ var defined = (p) => p.x === +p.x && p.y === +p.y;
26
+ var getX = (p) => p.x;
27
+ var getY = (p) => p.y;
28
+ function getCurveFactory(type, layout) {
29
+ if (typeof type === "function") return type;
30
+ const name = `curve${upperFirst(type)}`;
31
+ if ((name === "curveMonotone" || name === "curveBump") && layout) return CURVE_FACTORIES[`${name}${layout === "vertical" ? "Y" : "X"}`];
32
+ return CURVE_FACTORIES[name] || curveLinear;
25
33
  }
26
- function E({ type: t = "linear", points: n = [], baseLine: r, layout: i, connectNulls: o = !1 }) {
27
- let s = T(t, i), c = o ? n.filter((e) => S(e)) : n, l;
28
- if (Array.isArray(r)) {
29
- let e = o ? r.filter((e) => S(e)) : r, t = c.map((t, n) => ({
30
- ...t,
31
- base: e[n]
34
+ /**
35
+ * Calculate the path of curve. Returns null if points is an empty array.
36
+ * @return path or null
37
+ */
38
+ function getPath({ type = "linear", points = [], baseLine, layout, connectNulls = false }) {
39
+ const curveFactory = getCurveFactory(type, layout);
40
+ const formatPoints = connectNulls ? points.filter((entry) => defined(entry)) : points;
41
+ let lineFunction;
42
+ if (Array.isArray(baseLine)) {
43
+ const formatBaseLine = connectNulls ? baseLine.filter((base) => defined(base)) : baseLine;
44
+ const areaPoints = formatPoints.map((entry, index) => ({
45
+ ...entry,
46
+ base: formatBaseLine[index]
32
47
  }));
33
- return l = i === "vertical" ? a().y(w).x1(C).x0((e) => e.base.x) : a().x(C).y1(w).y0((e) => e.base.y), l.defined(S).curve(s), l(t);
48
+ if (layout === "vertical") lineFunction = area().y(getY).x1(getX).x0((d) => d.base.x);
49
+ else lineFunction = area().x(getX).y1(getY).y0((d) => d.base.y);
50
+ lineFunction.defined(defined).curve(curveFactory);
51
+ return lineFunction(areaPoints);
34
52
  }
35
- return l = i === "vertical" && e(r) ? a().y(w).x1(C).x0(r) : e(r) ? a().x(C).y1(w).y0(r) : y().x(C).y(w), l.defined(S).curve(s), l(c);
53
+ if (layout === "vertical" && isNumber(baseLine)) lineFunction = area().y(getY).x1(getX).x0(baseLine);
54
+ else if (isNumber(baseLine)) lineFunction = area().x(getX).y1(getY).y0(baseLine);
55
+ else lineFunction = line().x(getX).y(getY);
56
+ lineFunction.defined(defined).curve(curveFactory);
57
+ return lineFunction(formatPoints);
36
58
  }
37
- var D = {
59
+ var CurveVueProps = {
38
60
  type: { type: [String, Function] },
39
61
  layout: { type: String },
40
62
  baseLine: { type: [Number, Array] },
41
63
  points: { type: Array },
42
64
  connectNulls: { type: Boolean },
43
65
  path: { type: String },
44
- class: { type: [String, Array] }
45
- }, O = /* @__PURE__ */ r({
66
+ class: classProp
67
+ };
68
+ var Curve = /* @__PURE__ */ defineComponent({
46
69
  name: "Curve",
47
- props: D,
48
- inheritAttrs: !1,
49
- setup(e, { attrs: r }) {
50
- let a = t(() => {
51
- if (!((!e.points || !e.points.length) && !e.path)) return e.points && e.points.length ? E(e) : e.path;
70
+ props: CurveVueProps,
71
+ inheritAttrs: false,
72
+ setup(props, { attrs }) {
73
+ const realPath = computed(() => {
74
+ if ((!props.points || !props.points.length) && !props.path) return;
75
+ return props.points && props.points.length ? getPath(props) : props.path;
52
76
  });
53
- return () => a.value === null && !e.path ? null : n("path", i(r, {
54
- class: ["v-charts-curve", e.class],
55
- d: a.value
56
- }), null);
77
+ return () => {
78
+ if (realPath.value === null && !props.path) return null;
79
+ return createVNode("path", mergeProps(attrs, {
80
+ "class": ["v-charts-curve", props.class],
81
+ "d": realPath.value
82
+ }), null);
83
+ };
57
84
  }
58
85
  });
59
86
  //#endregion
60
- export { O as Curve, D as CurveVueProps, E as getPath };
87
+ export { Curve, CurveVueProps, getPath };
@@ -1,5 +1,5 @@
1
- import { createVNode as e, defineComponent as t } from "vue";
2
- var n = /* @__PURE__ */ t({
1
+ import { createVNode, defineComponent } from "vue";
2
+ var Dot = /* @__PURE__ */ defineComponent({
3
3
  name: "Dot",
4
4
  props: {
5
5
  cx: { type: [Number, String] },
@@ -7,17 +7,18 @@ var n = /* @__PURE__ */ t({
7
7
  r: { type: [Number, String] },
8
8
  clipDot: { type: Boolean }
9
9
  },
10
- setup(t) {
10
+ setup(props) {
11
11
  return () => {
12
- let { cx: n, cy: r, r: i } = t;
13
- return n === +n && r === +r && i === +i ? e("circle", {
14
- class: ["v-charts-dot", t.class],
15
- cx: n,
16
- cy: r,
17
- r: i
18
- }, null) : null;
12
+ const { cx, cy, r } = props;
13
+ if (cx === +cx && cy === +cy && r === +r) return createVNode("circle", {
14
+ "class": ["v-charts-dot", props.class],
15
+ "cx": cx,
16
+ "cy": cy,
17
+ "r": r
18
+ }, null);
19
+ return null;
19
20
  };
20
21
  }
21
22
  });
22
23
  //#endregion
23
- export { n as Dot };
24
+ export { Dot };
@@ -0,0 +1,19 @@
1
+ import { isNumber } from "../utils/validate.mjs";
2
+ import { createVNode, mergeProps } from "vue";
3
+ //#region src/shape/Polygon.tsx
4
+ function getPolygonPath(points) {
5
+ return points.reduce((path, point, i) => {
6
+ return `${path}${i === 0 ? "M" : "L"}${point.x},${point.y}`;
7
+ }, "") + "Z";
8
+ }
9
+ function Polygon(props) {
10
+ const { points = [], ...rest } = props;
11
+ if (!points || !points.length) return null;
12
+ if (!points.every((p) => isNumber(p.x) && isNumber(p.y))) return null;
13
+ return createVNode("path", mergeProps(rest, {
14
+ "class": "v-charts-polygon",
15
+ "d": getPolygonPath(points)
16
+ }), null);
17
+ }
18
+ //#endregion
19
+ export { Polygon };