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,10 +1,9 @@
1
- import { createVNode as e, defineComponent as t, mergeProps as n } from "vue";
1
+ import { createVNode, defineComponent, mergeProps } from "vue";
2
2
  //#region src/shape/Rectangle.tsx
3
- var r = {
4
- className: {
5
- type: String,
6
- default: void 0
7
- },
3
+ /**
4
+ * @fileOverview Rectangle
5
+ */
6
+ var RectangleVueProps = {
8
7
  x: {
9
8
  type: Number,
10
9
  default: 0
@@ -26,43 +25,55 @@ var r = {
26
25
  default: void 0
27
26
  }
28
27
  };
29
- function i(e, t, n, r, i) {
30
- let a = Math.min(Math.abs(n) / 2, Math.abs(r) / 2), o = r >= 0 ? 1 : -1, s = n >= 0 ? 1 : -1, c = r >= 0 && n >= 0 || r < 0 && n < 0 ? 1 : 0;
31
- if (a > 0 && Array.isArray(i)) {
32
- let l = [
28
+ function getRectanglePath(x, y, width, height, radius) {
29
+ const maxRadius = Math.min(Math.abs(width) / 2, Math.abs(height) / 2);
30
+ const ySign = height >= 0 ? 1 : -1;
31
+ const xSign = width >= 0 ? 1 : -1;
32
+ const clockWise = height >= 0 && width >= 0 || height < 0 && width < 0 ? 1 : 0;
33
+ if (maxRadius > 0 && Array.isArray(radius)) {
34
+ const newRadius = [
33
35
  0,
34
36
  0,
35
37
  0,
36
38
  0
37
39
  ];
38
- for (let e = 0; e < 4; e++) {
39
- let t = i[e] ?? 0;
40
- l[e] = t > a ? a : t;
40
+ for (let i = 0; i < 4; i++) {
41
+ const r = radius[i] ?? 0;
42
+ newRadius[i] = r > maxRadius ? maxRadius : r;
41
43
  }
42
- let u = `M${e},${t + o * l[0]}`;
43
- return l[0] > 0 && (u += `A ${l[0]},${l[0]},0,0,${c},${e + s * l[0]},${t}`), u += `L ${e + n - s * l[1]},${t}`, l[1] > 0 && (u += `A ${l[1]},${l[1]},0,0,${c},${e + n},${t + o * l[1]}`), u += `L ${e + n},${t + r - o * l[2]}`, l[2] > 0 && (u += `A ${l[2]},${l[2]},0,0,${c},${e + n - s * l[2]},${t + r}`), u += `L ${e + s * l[3]},${t + r}`, l[3] > 0 && (u += `A ${l[3]},${l[3]},0,0,${c},${e},${t + r - o * l[3]}`), u += "Z", u;
44
+ let path = `M${x},${y + ySign * newRadius[0]}`;
45
+ if (newRadius[0] > 0) path += `A ${newRadius[0]},${newRadius[0]},0,0,${clockWise},${x + xSign * newRadius[0]},${y}`;
46
+ path += `L ${x + width - xSign * newRadius[1]},${y}`;
47
+ if (newRadius[1] > 0) path += `A ${newRadius[1]},${newRadius[1]},0,0,${clockWise},${x + width},${y + ySign * newRadius[1]}`;
48
+ path += `L ${x + width},${y + height - ySign * newRadius[2]}`;
49
+ if (newRadius[2] > 0) path += `A ${newRadius[2]},${newRadius[2]},0,0,${clockWise},${x + width - xSign * newRadius[2]},${y + height}`;
50
+ path += `L ${x + xSign * newRadius[3]},${y + height}`;
51
+ if (newRadius[3] > 0) path += `A ${newRadius[3]},${newRadius[3]},0,0,${clockWise},${x},${y + height - ySign * newRadius[3]}`;
52
+ path += "Z";
53
+ return path;
44
54
  }
45
- if (a > 0 && typeof i == "number" && i > 0) {
46
- let l = Math.min(a, i);
47
- return `M ${e},${t + o * l}A ${l},${l},0,0,${c},${e + s * l},${t}L ${e + n - s * l},${t}A ${l},${l},0,0,${c},${e + n},${t + o * l}L ${e + n},${t + r - o * l}A ${l},${l},0,0,${c},${e + n - s * l},${t + r}L ${e + s * l},${t + r}A ${l},${l},0,0,${c},${e},${t + r - o * l} Z`;
55
+ if (maxRadius > 0 && typeof radius === "number" && radius > 0) {
56
+ const r = Math.min(maxRadius, radius);
57
+ return `M ${x},${y + ySign * r}A ${r},${r},0,0,${clockWise},${x + xSign * r},${y}L ${x + width - xSign * r},${y}A ${r},${r},0,0,${clockWise},${x + width},${y + ySign * r}L ${x + width},${y + height - ySign * r}A ${r},${r},0,0,${clockWise},${x + width - xSign * r},${y + height}L ${x + xSign * r},${y + height}A ${r},${r},0,0,${clockWise},${x},${y + height - ySign * r} Z`;
48
58
  }
49
- return `M ${e},${t} h ${n} v ${r} h ${-n} Z`;
59
+ return `M ${x},${y} h ${width} v ${height} h ${-width} Z`;
50
60
  }
51
- var a = /* @__PURE__ */ t({
61
+ var Rectangle = /* @__PURE__ */ defineComponent({
52
62
  name: "Rectangle",
53
- props: r,
54
- setup(t, { attrs: r }) {
63
+ props: RectangleVueProps,
64
+ setup(props, { attrs }) {
55
65
  return () => {
56
- let { x: a, y: o, width: s, height: c, radius: l } = t;
57
- return a !== +a || o !== +o || s !== +s || c !== +c || s === 0 || c === 0 ? null : e("path", n(r, {
58
- x: a,
59
- y: o,
60
- width: s,
61
- height: c,
62
- d: i(a, o, s, c, l)
66
+ const { x, y, width, height, radius } = props;
67
+ if (x !== +x || y !== +y || width !== +width || height !== +height || width === 0 || height === 0) return null;
68
+ return createVNode("path", mergeProps(attrs, {
69
+ "x": x,
70
+ "y": y,
71
+ "width": width,
72
+ "height": height,
73
+ "d": getRectanglePath(x, y, width, height, radius)
63
74
  }), null);
64
75
  };
65
76
  }
66
77
  });
67
78
  //#endregion
68
- export { a as Rectangle };
79
+ export { Rectangle };
@@ -1,8 +1,12 @@
1
- import { RADIAN as e, polarToCartesian as t } from "../utils/polar.mjs";
2
- import { getPercentValue as n, mathSign as r } from "../utils/data.mjs";
3
- import { createVNode as i, defineComponent as a, mergeProps as o } from "vue";
1
+ import { classProp } from "../types/common.mjs";
2
+ import { RADIAN, polarToCartesian } from "../utils/polar.mjs";
3
+ import { getPercentValue, mathSign } from "../utils/data.mjs";
4
+ import { createVNode, defineComponent, mergeProps } from "vue";
4
5
  //#region src/shape/Sector.tsx
5
- var s = {
6
+ /**
7
+ * @fileOverview Sector - SVG arc path shape for pie/donut chart segments
8
+ */
9
+ var SectorVueProps = {
6
10
  cx: {
7
11
  type: Number,
8
12
  default: 0
@@ -33,96 +37,118 @@ var s = {
33
37
  },
34
38
  forceCornerRadius: {
35
39
  type: Boolean,
36
- default: !1
40
+ default: false
37
41
  },
38
42
  cornerIsExternal: {
39
43
  type: Boolean,
40
- default: !1
44
+ default: false
41
45
  },
42
- className: {
43
- type: String,
44
- default: void 0
45
- }
46
+ class: classProp
46
47
  };
47
- function c(e, t) {
48
- return r(t - e) * Math.min(Math.abs(t - e), 359.999);
48
+ function getDeltaAngle(startAngle, endAngle) {
49
+ return mathSign(endAngle - startAngle) * Math.min(Math.abs(endAngle - startAngle), 359.999);
49
50
  }
50
- function l({ cx: n, cy: r, radius: i, angle: a, sign: o, isExternal: s, cornerRadius: c, cornerIsExternal: l }) {
51
- let u = c * (s ? 1 : -1) + i, d = Math.asin(c / u) / e, f = l ? a : a + o * d, p = t(n, r, u, f), m = t(n, r, i, f), h = l ? a - o * d : a;
51
+ function getTangentCircle({ cx, cy, radius, angle, sign, isExternal, cornerRadius, cornerIsExternal }) {
52
+ const centerRadius = cornerRadius * (isExternal ? 1 : -1) + radius;
53
+ const theta = Math.asin(cornerRadius / centerRadius) / RADIAN;
54
+ const centerAngle = cornerIsExternal ? angle : angle + sign * theta;
55
+ const center = polarToCartesian(cx, cy, centerRadius, centerAngle);
56
+ const circleTangency = polarToCartesian(cx, cy, radius, centerAngle);
57
+ const lineTangencyAngle = cornerIsExternal ? angle - sign * theta : angle;
52
58
  return {
53
- center: p,
54
- circleTangency: m,
55
- lineTangency: t(n, r, u * Math.cos(d * e), h),
56
- theta: d
59
+ center,
60
+ circleTangency,
61
+ lineTangency: polarToCartesian(cx, cy, centerRadius * Math.cos(theta * RADIAN), lineTangencyAngle),
62
+ theta
57
63
  };
58
64
  }
59
- function u(e, n, r, i, a, o) {
60
- let s = c(a, o), l = a + s, u = t(e, n, i, a), d = t(e, n, i, l), f = +(Math.abs(s) > 180), p = +(a > l), m = `M ${u.x},${u.y} A ${i},${i},0,${f},${p},${d.x},${d.y}`;
61
- if (r > 0) {
62
- let i = t(e, n, r, a), o = t(e, n, r, l), s = +(a <= l);
63
- m += ` L ${o.x},${o.y} A ${r},${r},0,${f},${s},${i.x},${i.y} Z`;
64
- } else m += ` L ${e},${n} Z`;
65
- return m;
65
+ function getSectorPath(cx, cy, innerRadius, outerRadius, startAngle, endAngle) {
66
+ const angle = getDeltaAngle(startAngle, endAngle);
67
+ const tempEndAngle = startAngle + angle;
68
+ const outerStart = polarToCartesian(cx, cy, outerRadius, startAngle);
69
+ const outerEnd = polarToCartesian(cx, cy, outerRadius, tempEndAngle);
70
+ const largeArcFlag = +(Math.abs(angle) > 180);
71
+ const sweepOuter = +(startAngle > tempEndAngle);
72
+ let path = `M ${outerStart.x},${outerStart.y} A ${outerRadius},${outerRadius},0,${largeArcFlag},${sweepOuter},${outerEnd.x},${outerEnd.y}`;
73
+ if (innerRadius > 0) {
74
+ const innerStart = polarToCartesian(cx, cy, innerRadius, startAngle);
75
+ const innerEnd = polarToCartesian(cx, cy, innerRadius, tempEndAngle);
76
+ const sweepInner = +(startAngle <= tempEndAngle);
77
+ path += ` L ${innerEnd.x},${innerEnd.y} A ${innerRadius},${innerRadius},0,${largeArcFlag},${sweepInner},${innerStart.x},${innerStart.y} Z`;
78
+ } else path += ` L ${cx},${cy} Z`;
79
+ return path;
66
80
  }
67
- function d(e, t, n, i, a, o, s, c, d) {
68
- let f = r(d - c), { circleTangency: p, lineTangency: m, theta: h } = l({
69
- cx: e,
70
- cy: t,
71
- radius: i,
72
- angle: c,
73
- sign: f,
74
- cornerRadius: a,
75
- cornerIsExternal: s
76
- }), { circleTangency: g, lineTangency: _, theta: v } = l({
77
- cx: e,
78
- cy: t,
79
- radius: i,
80
- angle: d,
81
- sign: -f,
82
- cornerRadius: a,
83
- cornerIsExternal: s
84
- }), y = s ? Math.abs(c - d) : Math.abs(c - d) - h - v;
85
- if (y < 0) return o ? `M ${m.x},${m.y} a${a},${a},0,0,1,${a * 2},0 a${a},${a},0,0,1,${-a * 2},0` : u(e, t, n, i, c, d);
86
- let b = `M ${m.x},${m.y} A${a},${a},0,0,${+(f < 0)},${p.x},${p.y} A${i},${i},0,${+(y > 180)},${+(f < 0)},${g.x},${g.y} A${a},${a},0,0,${+(f < 0)},${_.x},${_.y}`;
87
- if (n > 0) {
88
- let { circleTangency: r, lineTangency: i, theta: o } = l({
89
- cx: e,
90
- cy: t,
91
- radius: n,
92
- angle: c,
93
- sign: f,
94
- isExternal: !0,
95
- cornerRadius: a,
96
- cornerIsExternal: s
97
- }), { circleTangency: u, lineTangency: p, theta: m } = l({
98
- cx: e,
99
- cy: t,
100
- radius: n,
101
- angle: d,
102
- sign: -f,
103
- isExternal: !0,
104
- cornerRadius: a,
105
- cornerIsExternal: s
106
- }), h = s ? Math.abs(c - d) : Math.abs(c - d) - o - m;
107
- if (h < 0 && a === 0) return `${b}L${e},${t}Z`;
108
- b += `L${p.x},${p.y} A${a},${a},0,0,${+(f < 0)},${u.x},${u.y} A${n},${n},0,${+(h > 180)},${+(f > 0)},${r.x},${r.y} A${a},${a},0,0,${+(f < 0)},${i.x},${i.y}Z`;
109
- } else b += `L${e},${t}Z`;
110
- return b;
81
+ function getSectorWithCorner(cx, cy, innerRadius, outerRadius, cornerRadius, forceCornerRadius, cornerIsExternal, startAngle, endAngle) {
82
+ const sign = mathSign(endAngle - startAngle);
83
+ const { circleTangency: soct, lineTangency: solt, theta: sot } = getTangentCircle({
84
+ cx,
85
+ cy,
86
+ radius: outerRadius,
87
+ angle: startAngle,
88
+ sign,
89
+ cornerRadius,
90
+ cornerIsExternal
91
+ });
92
+ const { circleTangency: eoct, lineTangency: eolt, theta: eot } = getTangentCircle({
93
+ cx,
94
+ cy,
95
+ radius: outerRadius,
96
+ angle: endAngle,
97
+ sign: -sign,
98
+ cornerRadius,
99
+ cornerIsExternal
100
+ });
101
+ const outerArcAngle = cornerIsExternal ? Math.abs(startAngle - endAngle) : Math.abs(startAngle - endAngle) - sot - eot;
102
+ if (outerArcAngle < 0) {
103
+ if (forceCornerRadius) return `M ${solt.x},${solt.y} a${cornerRadius},${cornerRadius},0,0,1,${cornerRadius * 2},0 a${cornerRadius},${cornerRadius},0,0,1,${-cornerRadius * 2},0`;
104
+ return getSectorPath(cx, cy, innerRadius, outerRadius, startAngle, endAngle);
105
+ }
106
+ let path = `M ${solt.x},${solt.y} A${cornerRadius},${cornerRadius},0,0,${+(sign < 0)},${soct.x},${soct.y} A${outerRadius},${outerRadius},0,${+(outerArcAngle > 180)},${+(sign < 0)},${eoct.x},${eoct.y} A${cornerRadius},${cornerRadius},0,0,${+(sign < 0)},${eolt.x},${eolt.y}`;
107
+ if (innerRadius > 0) {
108
+ const { circleTangency: sict, lineTangency: silt, theta: sit } = getTangentCircle({
109
+ cx,
110
+ cy,
111
+ radius: innerRadius,
112
+ angle: startAngle,
113
+ sign,
114
+ isExternal: true,
115
+ cornerRadius,
116
+ cornerIsExternal
117
+ });
118
+ const { circleTangency: eict, lineTangency: eilt, theta: eit } = getTangentCircle({
119
+ cx,
120
+ cy,
121
+ radius: innerRadius,
122
+ angle: endAngle,
123
+ sign: -sign,
124
+ isExternal: true,
125
+ cornerRadius,
126
+ cornerIsExternal
127
+ });
128
+ const innerArcAngle = cornerIsExternal ? Math.abs(startAngle - endAngle) : Math.abs(startAngle - endAngle) - sit - eit;
129
+ if (innerArcAngle < 0 && cornerRadius === 0) return `${path}L${cx},${cy}Z`;
130
+ path += `L${eilt.x},${eilt.y} A${cornerRadius},${cornerRadius},0,0,${+(sign < 0)},${eict.x},${eict.y} A${innerRadius},${innerRadius},0,${+(innerArcAngle > 180)},${+(sign > 0)},${sict.x},${sict.y} A${cornerRadius},${cornerRadius},0,0,${+(sign < 0)},${silt.x},${silt.y}Z`;
131
+ } else path += `L${cx},${cy}Z`;
132
+ return path;
111
133
  }
112
- var f = /* @__PURE__ */ a({
134
+ var Sector = /* @__PURE__ */ defineComponent({
113
135
  name: "Sector",
114
- props: s,
115
- setup(e, { attrs: t }) {
136
+ props: SectorVueProps,
137
+ setup(props, { attrs }) {
116
138
  return () => {
117
- let { cx: r, cy: a, innerRadius: s, outerRadius: c, startAngle: l, endAngle: f, cornerRadius: p, forceCornerRadius: m, cornerIsExternal: h, className: g } = e;
118
- if (c <= 0 || c < s || l === f) return null;
119
- let _ = c - s, v = n(p, _, 0, !0), y;
120
- return y = v > 0 && Math.abs(l - f) < 360 ? d(r, a, s, c, Math.min(v, _ / 2), m, h, l, f) : u(r, a, s, c, l, f), i("path", o(t, {
121
- class: ["v-charts-sector", g],
122
- d: y
139
+ const { cx, cy, innerRadius, outerRadius, startAngle, endAngle, cornerRadius, forceCornerRadius, cornerIsExternal } = props;
140
+ if (outerRadius <= 0 || outerRadius < innerRadius || startAngle === endAngle) return null;
141
+ const deltaRadius = outerRadius - innerRadius;
142
+ const cr = getPercentValue(cornerRadius, deltaRadius, 0, true);
143
+ let path;
144
+ if (cr > 0 && Math.abs(startAngle - endAngle) < 360) path = getSectorWithCorner(cx, cy, innerRadius, outerRadius, Math.min(cr, deltaRadius / 2), forceCornerRadius, cornerIsExternal, startAngle, endAngle);
145
+ else path = getSectorPath(cx, cy, innerRadius, outerRadius, startAngle, endAngle);
146
+ return createVNode("path", mergeProps(attrs, {
147
+ "class": ["v-charts-sector", props.class],
148
+ "d": path
123
149
  }), null);
124
150
  };
125
151
  }
126
152
  });
127
153
  //#endregion
128
- export { f as Sector };
154
+ export { Sector };
@@ -1,41 +1,52 @@
1
- import { isNumber as e } from "../utils/validate.mjs";
2
- import { createVNode as t, mergeProps as n } from "vue";
3
- import { symbol as r, symbolCircle as i, symbolCross as a, symbolDiamond as o, symbolSquare as s, symbolStar as c, symbolTriangle as l, symbolWye as u } from "victory-vendor/d3-shape";
4
- import { upperFirst as d } from "es-toolkit/compat";
1
+ import { isNumber } from "../utils/validate.mjs";
2
+ import { createVNode, mergeProps } from "vue";
3
+ import { symbol, symbolCircle, symbolCross, symbolDiamond, symbolSquare, symbolStar, symbolTriangle, symbolWye } from "victory-vendor/d3-shape";
4
+ import { upperFirst } from "es-toolkit/compat";
5
5
  //#region src/shape/Symbols.tsx
6
- var f = {
7
- symbolCircle: i,
8
- symbolCross: a,
9
- symbolDiamond: o,
10
- symbolSquare: s,
11
- symbolStar: c,
12
- symbolTriangle: l,
13
- symbolWye: u
14
- }, p = Math.PI / 180, m = (e) => f[`symbol${d(e)}`] || i, h = (e, t, n) => {
15
- if (t === "area") return e;
16
- switch (n) {
17
- case "cross": return 5 * e * e / 9;
18
- case "diamond": return .5 * e * e / Math.sqrt(3);
19
- case "square": return e * e;
6
+ var symbolFactories = {
7
+ symbolCircle,
8
+ symbolCross,
9
+ symbolDiamond,
10
+ symbolSquare,
11
+ symbolStar,
12
+ symbolTriangle,
13
+ symbolWye
14
+ };
15
+ var RADIAN = Math.PI / 180;
16
+ var getSymbolFactory = (type) => {
17
+ return symbolFactories[`symbol${upperFirst(type)}`] || symbolCircle;
18
+ };
19
+ var calculateAreaSize = (size, sizeType, type) => {
20
+ if (sizeType === "area") return size;
21
+ switch (type) {
22
+ case "cross": return 5 * size * size / 9;
23
+ case "diamond": return .5 * size * size / Math.sqrt(3);
24
+ case "square": return size * size;
20
25
  case "star": {
21
- let t = 18 * p;
22
- return 1.25 * e * e * (Math.tan(t) - Math.tan(t * 2) * Math.tan(t) ** 2);
26
+ const angle = 18 * RADIAN;
27
+ return 1.25 * size * size * (Math.tan(angle) - Math.tan(angle * 2) * Math.tan(angle) ** 2);
23
28
  }
24
- case "triangle": return Math.sqrt(3) * e * e / 4;
25
- case "wye": return (21 - 10 * Math.sqrt(3)) * e * e / 8;
26
- default: return Math.PI * e * e / 4;
29
+ case "triangle": return Math.sqrt(3) * size * size / 4;
30
+ case "wye": return (21 - 10 * Math.sqrt(3)) * size * size / 8;
31
+ default: return Math.PI * size * size / 4;
27
32
  }
28
33
  };
29
- function g(i) {
30
- let { type: a = "circle", size: o = 64, sizeType: s = "area", cx: c, cy: l, className: u, ...d } = i, f = "circle";
31
- return typeof a == "string" && (f = a), e(c) && e(l) && e(o) ? t("path", n(d, {
32
- class: ["v-charts-symbols", u].filter(Boolean).join(" "),
33
- transform: `translate(${c}, ${l})`,
34
- d: (() => {
35
- let e = m(f), t = r().type(e).size(h(o, s, f))();
36
- if (t !== null) return t;
37
- })()
38
- }), null) : null;
34
+ function Symbols(props) {
35
+ const { type = "circle", size = 64, sizeType = "area", cx, cy, class: className, ...rest } = props;
36
+ let realType = "circle";
37
+ if (typeof type === "string") realType = type;
38
+ const getPath = () => {
39
+ const symbolFactory = getSymbolFactory(realType);
40
+ const s = symbol().type(symbolFactory).size(calculateAreaSize(size, sizeType, realType))();
41
+ if (s === null) return;
42
+ return s;
43
+ };
44
+ if (isNumber(cx) && isNumber(cy) && isNumber(size)) return createVNode("path", mergeProps(rest, {
45
+ "class": ["v-charts-symbols", className].filter(Boolean).join(" "),
46
+ "transform": `translate(${cx}, ${cy})`,
47
+ "d": getPath()
48
+ }), null);
49
+ return null;
39
50
  }
40
51
  //#endregion
41
- export { g as Symbols };
52
+ export { Symbols };
@@ -0,0 +1,50 @@
1
+ import { classProp } from "../types/common.mjs";
2
+ import { createVNode, defineComponent, mergeProps } from "vue";
3
+ //#region src/shape/Trapezoid.tsx
4
+ var TrapezoidVueProps = {
5
+ x: {
6
+ type: Number,
7
+ default: 0
8
+ },
9
+ y: {
10
+ type: Number,
11
+ default: 0
12
+ },
13
+ upperWidth: {
14
+ type: Number,
15
+ default: 0
16
+ },
17
+ lowerWidth: {
18
+ type: Number,
19
+ default: 0
20
+ },
21
+ height: {
22
+ type: Number,
23
+ default: 0
24
+ },
25
+ class: classProp
26
+ };
27
+ function getTrapezoidPath(x, y, upperWidth, lowerWidth, height) {
28
+ const upperLeft = x;
29
+ const upperRight = x + upperWidth;
30
+ const lowerLeft = x + (upperWidth - lowerWidth) / 2;
31
+ const lowerRight = x + (upperWidth + lowerWidth) / 2;
32
+ const bottom = y + height;
33
+ return `M ${upperLeft},${y} L ${upperRight},${y} L ${lowerRight},${bottom} L ${lowerLeft},${bottom} Z`;
34
+ }
35
+ var Trapezoid = /* @__PURE__ */ defineComponent({
36
+ name: "Trapezoid",
37
+ props: TrapezoidVueProps,
38
+ setup(props, { attrs }) {
39
+ return () => {
40
+ const { x, y, upperWidth, lowerWidth, height } = props;
41
+ if (x !== +x || y !== +y || upperWidth !== +upperWidth || lowerWidth !== +lowerWidth || height !== +height || height === 0) return null;
42
+ return createVNode("path", mergeProps(attrs, {
43
+ "class": ["v-charts-trapezoid", props.class],
44
+ "d": getTrapezoidPath(x, y, upperWidth, lowerWidth, height)
45
+ }), null);
46
+ };
47
+ }
48
+ });
49
+ //#endregion
50
+ export { Trapezoid };
@@ -1,13 +1,14 @@
1
- import { useAppDispatch as e } from "./hooks.mjs";
2
- import { updateOptions as t } from "./rootPropsSlice.mjs";
3
- import { defineComponent as n, watchEffect as r } from "vue";
1
+ import { classProp } from "../types/common.mjs";
2
+ import { useAppDispatch } from "./hooks.mjs";
3
+ import { updateOptions } from "./rootPropsSlice.mjs";
4
+ import { defineComponent, watchEffect } from "vue";
4
5
  //#region src/state/ReportChartProps.tsx
5
- var i = /* @__PURE__ */ n({
6
+ var ReportChartProps_default = /* @__PURE__ */ defineComponent({
6
7
  name: "ReportChartProps",
7
8
  props: {
8
9
  accessibilityLayer: {
9
10
  type: Boolean,
10
- default: !0
11
+ default: true
11
12
  },
12
13
  barCategoryGap: {
13
14
  type: [Number, String],
@@ -21,10 +22,7 @@ var i = /* @__PURE__ */ n({
21
22
  type: [String, Number],
22
23
  default: void 0
23
24
  },
24
- class: {
25
- type: String,
26
- default: void 0
27
- },
25
+ class: classProp,
28
26
  maxBarSize: {
29
27
  type: Number,
30
28
  default: void 0
@@ -42,22 +40,23 @@ var i = /* @__PURE__ */ n({
42
40
  default: "index"
43
41
  }
44
42
  },
45
- setup(n) {
46
- let i = e();
47
- return r(() => {
48
- i(t({
49
- accessibilityLayer: n.accessibilityLayer,
50
- barCategoryGap: n.barCategoryGap,
51
- barGap: n.barGap,
52
- barSize: n.barSize,
53
- class: n.class,
54
- maxBarSize: n.maxBarSize,
55
- stackOffset: n.stackOffset,
56
- syncId: n.syncId,
57
- syncMethod: n.syncMethod
43
+ setup(props) {
44
+ const dispatch = useAppDispatch();
45
+ watchEffect(() => {
46
+ dispatch(updateOptions({
47
+ accessibilityLayer: props.accessibilityLayer,
48
+ barCategoryGap: props.barCategoryGap,
49
+ barGap: props.barGap,
50
+ barSize: props.barSize,
51
+ class: props.class,
52
+ maxBarSize: props.maxBarSize,
53
+ stackOffset: props.stackOffset,
54
+ syncId: props.syncId,
55
+ syncMethod: props.syncMethod
58
56
  }));
59
- }), () => null;
57
+ });
58
+ return () => null;
60
59
  }
61
60
  });
62
61
  //#endregion
63
- export { i as default };
62
+ export { ReportChartProps_default as default };
@@ -1,41 +1,46 @@
1
- import { useAppDispatch as e } from "./hooks.mjs";
2
- import { setChartSize as t, setLayout as n, setMargin as r } from "./layoutSlice.mjs";
3
- import { defineComponent as i, watch as a } from "vue";
1
+ import { useAppDispatch } from "./hooks.mjs";
2
+ import { setChartSize, setLayout, setMargin } from "./layoutSlice.mjs";
3
+ import { defineComponent, watch } from "vue";
4
4
  //#region src/state/ReportMainChartProps.ts
5
- var o = i({
5
+ var ReportMainChartProps = defineComponent({
6
6
  name: "ReportMainChartProps",
7
7
  props: {
8
8
  width: {
9
9
  type: Number,
10
- required: !0
10
+ required: true
11
11
  },
12
12
  height: {
13
13
  type: Number,
14
- required: !0
14
+ required: true
15
15
  },
16
16
  layout: {
17
17
  type: String,
18
- required: !0
18
+ required: true
19
19
  },
20
20
  margin: {
21
21
  type: Object,
22
- required: !0
22
+ required: true
23
23
  }
24
24
  },
25
- setup(i) {
26
- let o = e();
27
- return a([
28
- () => i.width,
29
- () => i.height,
30
- () => i.layout,
31
- () => i.margin
25
+ setup(props) {
26
+ const dispatch = useAppDispatch();
27
+ watch([
28
+ () => props.width,
29
+ () => props.height,
30
+ () => props.layout,
31
+ () => props.margin
32
32
  ], () => {
33
- o(n(i.layout)), o(t({
34
- width: i.width,
35
- height: i.height
36
- })), o(r(i.margin));
37
- }, { immediate: !0 }), () => null;
33
+ dispatch(setLayout(props.layout));
34
+ dispatch(setChartSize({
35
+ width: props.width,
36
+ height: props.height
37
+ }));
38
+ dispatch(setMargin(props.margin));
39
+ }, { immediate: true });
40
+ return () => {
41
+ return null;
42
+ };
38
43
  }
39
44
  });
40
45
  //#endregion
41
- export { o as ReportMainChartProps };
46
+ export { ReportMainChartProps };
@@ -1,8 +1,8 @@
1
- import { useAppDispatch as e } from "./hooks.mjs";
2
- import { updatePolarOptions as t } from "./polarOptionsSlice.mjs";
3
- import { defineComponent as n, watch as r } from "vue";
1
+ import { useAppDispatch } from "./hooks.mjs";
2
+ import { updatePolarOptions } from "./polarOptionsSlice.mjs";
3
+ import { defineComponent, watch } from "vue";
4
4
  //#region src/state/ReportPolarOptions.tsx
5
- var i = /* @__PURE__ */ n({
5
+ var ReportPolarOptions = /* @__PURE__ */ defineComponent({
6
6
  name: "ReportPolarOptions",
7
7
  props: {
8
8
  cx: {
@@ -30,26 +30,27 @@ var i = /* @__PURE__ */ n({
30
30
  default: "80%"
31
31
  }
32
32
  },
33
- setup(n) {
34
- let i = e();
35
- return r([
36
- () => n.cx,
37
- () => n.cy,
38
- () => n.startAngle,
39
- () => n.endAngle,
40
- () => n.innerRadius,
41
- () => n.outerRadius
33
+ setup(props) {
34
+ const dispatch = useAppDispatch();
35
+ watch([
36
+ () => props.cx,
37
+ () => props.cy,
38
+ () => props.startAngle,
39
+ () => props.endAngle,
40
+ () => props.innerRadius,
41
+ () => props.outerRadius
42
42
  ], () => {
43
- i(t({
44
- cx: n.cx,
45
- cy: n.cy,
46
- startAngle: n.startAngle,
47
- endAngle: n.endAngle,
48
- innerRadius: n.innerRadius,
49
- outerRadius: n.outerRadius
43
+ dispatch(updatePolarOptions({
44
+ cx: props.cx,
45
+ cy: props.cy,
46
+ startAngle: props.startAngle,
47
+ endAngle: props.endAngle,
48
+ innerRadius: props.innerRadius,
49
+ outerRadius: props.outerRadius
50
50
  }));
51
- }, { immediate: !0 }), () => null;
51
+ }, { immediate: true });
52
+ return () => null;
52
53
  }
53
54
  });
54
55
  //#endregion
55
- export { i as ReportPolarOptions };
56
+ export { ReportPolarOptions };