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,9 +1,9 @@
1
- import { implicitZAxis as e } from "../../state/selectors/axisSelectors.mjs";
2
- import { useAppDispatch as t } from "../../state/hooks.mjs";
3
- import { addZAxis as n, removeZAxis as r } from "../../state/cartesianAxisSlice.mjs";
4
- import { defineComponent as i, watchEffect as a } from "vue";
1
+ import { implicitZAxis } from "../../state/selectors/axisSelectors.mjs";
2
+ import { useAppDispatch } from "../../state/hooks.mjs";
3
+ import { addZAxis, removeZAxis } from "../../state/cartesianAxisSlice.mjs";
4
+ import { defineComponent, watchEffect } from "vue";
5
5
  //#region src/cartesian/z-axis/ZAxis.tsx
6
- var o = /* @__PURE__ */ i({
6
+ var ZAxis = /* @__PURE__ */ defineComponent({
7
7
  name: "ZAxis",
8
8
  props: {
9
9
  zAxisId: {
@@ -20,11 +20,11 @@ var o = /* @__PURE__ */ i({
20
20
  },
21
21
  type: {
22
22
  type: String,
23
- default: e.type
23
+ default: implicitZAxis.type
24
24
  },
25
25
  range: {
26
26
  type: Array,
27
- default: () => e.range
27
+ default: () => implicitZAxis.range
28
28
  },
29
29
  domain: {
30
30
  type: [Array, String],
@@ -32,7 +32,7 @@ var o = /* @__PURE__ */ i({
32
32
  },
33
33
  scale: {
34
34
  type: [String, Function],
35
- default: e.scale
35
+ default: implicitZAxis.scale
36
36
  },
37
37
  name: {
38
38
  type: String,
@@ -43,28 +43,30 @@ var o = /* @__PURE__ */ i({
43
43
  default: void 0
44
44
  }
45
45
  },
46
- setup(i) {
47
- let o = t();
48
- return a((t) => {
49
- let a = {
50
- id: i.zAxisId,
51
- dataKey: i.dataKey,
52
- type: i.type,
53
- range: i.range,
54
- domain: i.domain,
55
- scale: i.scale,
56
- name: i.name,
57
- unit: i.unit,
58
- allowDuplicatedCategory: e.allowDuplicatedCategory,
59
- allowDataOverflow: e.allowDataOverflow,
60
- reversed: e.reversed,
61
- includeHidden: e.includeHidden
46
+ setup(props) {
47
+ const dispatch = useAppDispatch();
48
+ watchEffect((onCleanup) => {
49
+ const settings = {
50
+ id: props.zAxisId,
51
+ dataKey: props.dataKey,
52
+ type: props.type,
53
+ range: props.range,
54
+ domain: props.domain,
55
+ scale: props.scale,
56
+ name: props.name,
57
+ unit: props.unit,
58
+ allowDuplicatedCategory: implicitZAxis.allowDuplicatedCategory,
59
+ allowDataOverflow: implicitZAxis.allowDataOverflow,
60
+ reversed: implicitZAxis.reversed,
61
+ includeHidden: implicitZAxis.includeHidden
62
62
  };
63
- o(n(a)), t(() => {
64
- o(r(a));
63
+ dispatch(addZAxis(settings));
64
+ onCleanup(() => {
65
+ dispatch(removeZAxis(settings));
65
66
  });
66
- }), () => null;
67
+ });
68
+ return () => null;
67
69
  }
68
70
  });
69
71
  //#endregion
70
- export { o as ZAxis };
72
+ export { ZAxis };
@@ -1,9 +1,9 @@
1
- import { arrayTooltipSearcher as e } from "../state/optionsSlice.mjs";
2
- import { generateCategoricalChart as t } from "./generateCategoricalChart.mjs";
1
+ import { arrayTooltipSearcher } from "../state/optionsSlice.mjs";
2
+ import { generateCategoricalChart } from "./generateCategoricalChart.mjs";
3
3
  //#region src/chart/AreaChart.ts
4
- var n = t({
4
+ var AreaChart = generateCategoricalChart({
5
5
  chartName: "AreaChart",
6
- tooltipPayloadSearcher: e
6
+ tooltipPayloadSearcher: arrayTooltipSearcher
7
7
  });
8
8
  //#endregion
9
- export { n as AreaChart };
9
+ export { AreaChart };
@@ -1,10 +1,10 @@
1
- import { arrayTooltipSearcher as e } from "../state/optionsSlice.mjs";
2
- import { generateCategoricalChart as t } from "./generateCategoricalChart.mjs";
3
- var n = t({
1
+ import { arrayTooltipSearcher } from "../state/optionsSlice.mjs";
2
+ import { generateCategoricalChart } from "./generateCategoricalChart.mjs";
3
+ var BarChart = generateCategoricalChart({
4
4
  chartName: "BarChart",
5
5
  defaultTooltipEventType: "axis",
6
- tooltipPayloadSearcher: e,
6
+ tooltipPayloadSearcher: arrayTooltipSearcher,
7
7
  validateTooltipEventTypes: ["axis", "item"]
8
8
  });
9
9
  //#endregion
10
- export { n as BarChart };
10
+ export { BarChart };
@@ -1,10 +1,10 @@
1
- import { arrayTooltipSearcher as e } from "../state/optionsSlice.mjs";
2
- import { generateCategoricalChart as t } from "./generateCategoricalChart.mjs";
3
- var n = t({
1
+ import { arrayTooltipSearcher } from "../state/optionsSlice.mjs";
2
+ import { generateCategoricalChart } from "./generateCategoricalChart.mjs";
3
+ var ComposedChart = generateCategoricalChart({
4
4
  chartName: "ComposedChart",
5
5
  defaultTooltipEventType: "axis",
6
- tooltipPayloadSearcher: e,
6
+ tooltipPayloadSearcher: arrayTooltipSearcher,
7
7
  validateTooltipEventTypes: ["axis"]
8
8
  });
9
9
  //#endregion
10
- export { n as ComposedChart };
10
+ export { ComposedChart };
@@ -0,0 +1,11 @@
1
+ import { arrayTooltipSearcher } from "../state/optionsSlice.mjs";
2
+ import { generateCategoricalChart } from "./generateCategoricalChart.mjs";
3
+ //#region src/chart/FunnelChart.ts
4
+ var FunnelChart = generateCategoricalChart({
5
+ chartName: "FunnelChart",
6
+ defaultTooltipEventType: "item",
7
+ validateTooltipEventTypes: ["item"],
8
+ tooltipPayloadSearcher: arrayTooltipSearcher
9
+ });
10
+ //#endregion
11
+ export { FunnelChart };
@@ -1,5 +1,5 @@
1
- import { createContext as e } from "../utils/createContext.mjs";
1
+ import { createContext } from "../utils/createContext.mjs";
2
2
  //#region src/chart/LegendPortalContext.ts
3
- var [t, n] = e("LegendPortalContext");
3
+ var [useLegendPortal, provideLegendPortalRaw] = createContext("LegendPortalContext");
4
4
  //#endregion
5
- export { n as provideLegendPortalRaw, t as useLegendPortal };
5
+ export { provideLegendPortalRaw, useLegendPortal };
@@ -1,10 +1,10 @@
1
- import { arrayTooltipSearcher as e } from "../state/optionsSlice.mjs";
2
- import { generateCategoricalChart as t } from "./generateCategoricalChart.mjs";
3
- var n = t({
1
+ import { arrayTooltipSearcher } from "../state/optionsSlice.mjs";
2
+ import { generateCategoricalChart } from "./generateCategoricalChart.mjs";
3
+ var LineChart = generateCategoricalChart({
4
4
  chartName: "LineChart",
5
5
  defaultTooltipEventType: "axis",
6
- tooltipPayloadSearcher: e,
6
+ tooltipPayloadSearcher: arrayTooltipSearcher,
7
7
  validateTooltipEventTypes: ["axis", "item"]
8
8
  });
9
9
  //#endregion
10
- export { n as LineChart };
10
+ export { LineChart };
@@ -1,7 +1,7 @@
1
- import { arrayTooltipSearcher as e } from "../state/optionsSlice.mjs";
2
- import { generateCategoricalChart as t } from "./generateCategoricalChart.mjs";
1
+ import { arrayTooltipSearcher } from "../state/optionsSlice.mjs";
2
+ import { generateCategoricalChart } from "./generateCategoricalChart.mjs";
3
3
  //#region src/chart/PieChart.ts
4
- var n = t({
4
+ var PieChart = generateCategoricalChart({
5
5
  chartName: "PieChart",
6
6
  defaultProps: {
7
7
  layout: "centric",
@@ -10,7 +10,7 @@ var n = t({
10
10
  },
11
11
  defaultTooltipEventType: "item",
12
12
  validateTooltipEventTypes: ["item"],
13
- tooltipPayloadSearcher: e
13
+ tooltipPayloadSearcher: arrayTooltipSearcher
14
14
  });
15
15
  //#endregion
16
- export { n as PieChart };
16
+ export { PieChart };
@@ -1,7 +1,7 @@
1
- import { arrayTooltipSearcher as e } from "../state/optionsSlice.mjs";
2
- import { generateCategoricalChart as t } from "./generateCategoricalChart.mjs";
1
+ import { arrayTooltipSearcher } from "../state/optionsSlice.mjs";
2
+ import { generateCategoricalChart } from "./generateCategoricalChart.mjs";
3
3
  //#region src/chart/RadarChart.ts
4
- var n = t({
4
+ var RadarChart = generateCategoricalChart({
5
5
  chartName: "RadarChart",
6
6
  defaultProps: {
7
7
  layout: "centric",
@@ -10,7 +10,7 @@ var n = t({
10
10
  },
11
11
  defaultTooltipEventType: "axis",
12
12
  validateTooltipEventTypes: ["axis"],
13
- tooltipPayloadSearcher: e
13
+ tooltipPayloadSearcher: arrayTooltipSearcher
14
14
  });
15
15
  //#endregion
16
- export { n as RadarChart };
16
+ export { RadarChart };
@@ -1,7 +1,7 @@
1
- import { arrayTooltipSearcher as e } from "../state/optionsSlice.mjs";
2
- import { generateCategoricalChart as t } from "./generateCategoricalChart.mjs";
1
+ import { arrayTooltipSearcher } from "../state/optionsSlice.mjs";
2
+ import { generateCategoricalChart } from "./generateCategoricalChart.mjs";
3
3
  //#region src/chart/RadialBarChart.ts
4
- var n = t({
4
+ var RadialBarChart = generateCategoricalChart({
5
5
  chartName: "RadialBarChart",
6
6
  defaultProps: {
7
7
  layout: "radial",
@@ -10,7 +10,7 @@ var n = t({
10
10
  },
11
11
  defaultTooltipEventType: "axis",
12
12
  validateTooltipEventTypes: ["axis", "item"],
13
- tooltipPayloadSearcher: e
13
+ tooltipPayloadSearcher: arrayTooltipSearcher
14
14
  });
15
15
  //#endregion
16
- export { n as RadialBarChart };
16
+ export { RadialBarChart };
@@ -1,23 +1,24 @@
1
- import { getChartPointer as e } from "../utils/chart.mjs";
2
- import { mouseLeaveChart as t } from "../state/tooltipSlice.mjs";
3
- import { useAppDispatch as n } from "../state/hooks.mjs";
4
- import { mouseClickAction as r, mouseMoveAction as i } from "../state/mouseEventsMiddleware.mjs";
5
- import { focusAction as a, keyDownAction as o } from "../state/keyboardEventsMiddleware.mjs";
6
- import { externalEventAction as s } from "../state/externalEventsMiddleware.mjs";
7
- import { touchEventAction as c } from "../state/touchEventsMiddleware.mjs";
8
- import { useSynchronisedEventsFromOtherCharts as l } from "../events/useChartSynchronisation.mjs";
9
- import { useReportScale as u } from "../state/utils/useReportScale.mjs";
10
- import { providePortalRaw as d } from "./TooltipPortalContext.mjs";
11
- import { provideLegendPortalRaw as f } from "./LegendPortalContext.mjs";
12
- import { createVNode as p, defineComponent as m, ref as h } from "vue";
1
+ import { classProp } from "../types/common.mjs";
2
+ import { getChartPointer } from "../utils/chart.mjs";
3
+ import { mouseLeaveChart } from "../state/tooltipSlice.mjs";
4
+ import { useAppDispatch } from "../state/hooks.mjs";
5
+ import { mouseClickAction, mouseMoveAction } from "../state/mouseEventsMiddleware.mjs";
6
+ import { focusAction, keyDownAction } from "../state/keyboardEventsMiddleware.mjs";
7
+ import { externalEventAction } from "../state/externalEventsMiddleware.mjs";
8
+ import { touchEventAction } from "../state/touchEventsMiddleware.mjs";
9
+ import { useSynchronisedEventsFromOtherCharts } from "../events/useChartSynchronisation.mjs";
10
+ import { useReportScale } from "../state/utils/useReportScale.mjs";
11
+ import { providePortalRaw } from "./TooltipPortalContext.mjs";
12
+ import { provideLegendPortalRaw } from "./LegendPortalContext.mjs";
13
+ import { createVNode, defineComponent, ref } from "vue";
13
14
  //#region src/chart/RechartsWrapper.tsx
14
- var g = /* @__PURE__ */ m({
15
+ var RechartsWrapper = /* @__PURE__ */ defineComponent({
15
16
  name: "RechartsWrapper",
16
17
  props: {
17
- class: { type: String },
18
+ class: classProp,
18
19
  height: {
19
20
  type: Number,
20
- required: !0
21
+ required: true
21
22
  },
22
23
  onClick: { type: Function },
23
24
  onContextMenu: { type: Function },
@@ -33,105 +34,128 @@ var g = /* @__PURE__ */ m({
33
34
  style: { type: Object },
34
35
  width: {
35
36
  type: Number,
36
- required: !0
37
+ required: true
37
38
  }
38
39
  },
39
- setup(m, { slots: g }) {
40
- let _ = n();
41
- l();
42
- let v = u(), y = h(null), b = h(null);
43
- d(y), f(b);
44
- let x = (e) => {
45
- v.value = e, y.value = e, b.value = e;
46
- }, S = (t) => {
47
- let n = e(t);
48
- n && _(r(n)), _(s({
49
- handler: m.onClick,
50
- event: t
40
+ setup(props, { slots }) {
41
+ const dispatch = useAppDispatch();
42
+ useSynchronisedEventsFromOtherCharts();
43
+ const scaleRef = useReportScale();
44
+ const tooltipPortal = ref(null);
45
+ const legendPortal = ref(null);
46
+ providePortalRaw(tooltipPortal);
47
+ provideLegendPortalRaw(legendPortal);
48
+ const innerRef = (node) => {
49
+ scaleRef.value = node;
50
+ tooltipPortal.value = node;
51
+ legendPortal.value = node;
52
+ };
53
+ const myOnClick = (e) => {
54
+ const chartPointer = getChartPointer(e);
55
+ if (chartPointer) dispatch(mouseClickAction(chartPointer));
56
+ dispatch(externalEventAction({
57
+ handler: props.onClick,
58
+ event: e
51
59
  }));
52
- }, C = (t) => {
53
- let n = e(t);
54
- n && _(i(n)), _(s({
55
- handler: m.onMouseEnter,
56
- event: t
60
+ };
61
+ const myOnMouseEnter = (e) => {
62
+ const chartPointer = getChartPointer(e);
63
+ if (chartPointer) dispatch(mouseMoveAction(chartPointer));
64
+ dispatch(externalEventAction({
65
+ handler: props.onMouseEnter,
66
+ event: e
57
67
  }));
58
- }, w = (e) => {
59
- _(t()), _(s({
60
- handler: m.onMouseLeave,
68
+ };
69
+ const myOnMouseLeave = (e) => {
70
+ dispatch(mouseLeaveChart());
71
+ dispatch(externalEventAction({
72
+ handler: props.onMouseLeave,
61
73
  event: e
62
74
  }));
63
- }, T = (t) => {
64
- let n = e(t);
65
- n && _(i(n)), _(s({
66
- handler: m.onMouseMove,
67
- event: t
75
+ };
76
+ const myOnMouseMove = (e) => {
77
+ const chartPointer = getChartPointer(e);
78
+ if (chartPointer) dispatch(mouseMoveAction(chartPointer));
79
+ dispatch(externalEventAction({
80
+ handler: props.onMouseMove,
81
+ event: e
68
82
  }));
69
- }, E = () => {
70
- _(a());
71
- }, D = (e) => {
72
- _(o(e.key));
73
- }, O = (e) => {
74
- _(s({
75
- handler: m.onContextMenu,
83
+ };
84
+ const onFocus = () => {
85
+ dispatch(focusAction());
86
+ };
87
+ const onKeyDown = (e) => {
88
+ dispatch(keyDownAction(e.key));
89
+ };
90
+ const myOnContextMenu = (e) => {
91
+ dispatch(externalEventAction({
92
+ handler: props.onContextMenu,
76
93
  event: e
77
94
  }));
78
- }, k = (e) => {
79
- _(s({
80
- handler: m.onDoubleClick,
95
+ };
96
+ const myOnDoubleClick = (e) => {
97
+ dispatch(externalEventAction({
98
+ handler: props.onDoubleClick,
81
99
  event: e
82
100
  }));
83
- }, A = (e) => {
84
- _(s({
85
- handler: m.onMouseDown,
101
+ };
102
+ const myOnMouseDown = (e) => {
103
+ dispatch(externalEventAction({
104
+ handler: props.onMouseDown,
86
105
  event: e
87
106
  }));
88
- }, j = (e) => {
89
- _(s({
90
- handler: m.onMouseUp,
107
+ };
108
+ const myOnMouseUp = (e) => {
109
+ dispatch(externalEventAction({
110
+ handler: props.onMouseUp,
91
111
  event: e
92
112
  }));
93
- }, M = (e) => {
94
- _(s({
95
- handler: m.onTouchStart,
113
+ };
114
+ const myOnTouchStart = (e) => {
115
+ dispatch(externalEventAction({
116
+ handler: props.onTouchStart,
96
117
  event: e
97
118
  }));
98
- }, N = (e) => {
99
- _(c(e)), _(s({
100
- handler: m.onTouchMove,
119
+ };
120
+ const myOnTouchMove = (e) => {
121
+ dispatch(touchEventAction(e));
122
+ dispatch(externalEventAction({
123
+ handler: props.onTouchMove,
101
124
  event: e
102
125
  }));
103
- }, P = (e) => {
104
- _(s({
105
- handler: m.onTouchEnd,
126
+ };
127
+ const myOnTouchEnd = (e) => {
128
+ dispatch(externalEventAction({
129
+ handler: props.onTouchEnd,
106
130
  event: e
107
131
  }));
108
132
  };
109
- return () => p("div", {
110
- class: ["v-charts-wrapper", m.class],
111
- style: {
133
+ return () => createVNode("div", {
134
+ "class": ["v-charts-wrapper", props.class],
135
+ "style": {
112
136
  position: "relative",
113
137
  cursor: "default",
114
- width: `${m.width}px`,
115
- height: `${m.height}px`,
116
- ...m.style
138
+ width: `${props.width}px`,
139
+ height: `${props.height}px`,
140
+ ...props.style
117
141
  },
118
- role: "application",
119
- onClick: S,
120
- onContextmenu: O,
121
- onDblclick: k,
122
- onFocus: E,
123
- onKeydown: D,
124
- onMousedown: A,
125
- onMouseenter: C,
126
- onMouseleave: w,
127
- onMousemove: T,
128
- onMouseup: j,
129
- onTouchend: P,
130
- onTouchmove: N,
131
- onTouchstart: M,
132
- ref: x
133
- }, [g.default?.()]);
142
+ "role": "application",
143
+ "onClick": myOnClick,
144
+ "onContextmenu": myOnContextMenu,
145
+ "onDblclick": myOnDoubleClick,
146
+ "onFocus": onFocus,
147
+ "onKeydown": onKeyDown,
148
+ "onMousedown": myOnMouseDown,
149
+ "onMouseenter": myOnMouseEnter,
150
+ "onMouseleave": myOnMouseLeave,
151
+ "onMousemove": myOnMouseMove,
152
+ "onMouseup": myOnMouseUp,
153
+ "onTouchend": myOnTouchEnd,
154
+ "onTouchmove": myOnTouchMove,
155
+ "onTouchstart": myOnTouchStart,
156
+ "ref": innerRef
157
+ }, [slots.default?.()]);
134
158
  }
135
159
  });
136
160
  //#endregion
137
- export { g as RechartsWrapper };
161
+ export { RechartsWrapper };
@@ -1,10 +1,10 @@
1
- import { arrayTooltipSearcher as e } from "../state/optionsSlice.mjs";
2
- import { generateCategoricalChart as t } from "./generateCategoricalChart.mjs";
3
- var n = t({
1
+ import { arrayTooltipSearcher } from "../state/optionsSlice.mjs";
2
+ import { generateCategoricalChart } from "./generateCategoricalChart.mjs";
3
+ var ScatterChart = generateCategoricalChart({
4
4
  chartName: "ScatterChart",
5
5
  defaultTooltipEventType: "item",
6
- tooltipPayloadSearcher: e,
6
+ tooltipPayloadSearcher: arrayTooltipSearcher,
7
7
  validateTooltipEventTypes: ["axis", "item"]
8
8
  });
9
9
  //#endregion
10
- export { n as ScatterChart };
10
+ export { ScatterChart };
@@ -1,5 +1,5 @@
1
- import e from "./Surface.vue_vue_type_script_setup_true_lang.mjs";
1
+ import Surface_vue_vue_type_script_setup_true_lang_default from "./Surface.vue_vue_type_script_setup_true_lang.mjs";
2
2
  //#region src/chart/Surface.vue
3
- var t = e;
3
+ var Surface_default = Surface_vue_vue_type_script_setup_true_lang_default;
4
4
  //#endregion
5
- export { t as default };
5
+ export { Surface_default as default };
@@ -1,15 +1,16 @@
1
- import { provideLabelLayerRef as e } from "../context/labelLayerContext.mjs";
2
- import { provideGraphicalLayerRef as t } from "../context/graphicalLayerContext.mjs";
3
- import { provideCursorLayerRef as n } from "../context/cursorLayerContext.mjs";
4
- import { computed as r, createElementBlock as i, createElementVNode as a, defineComponent as o, mergeProps as s, openBlock as c, ref as l, renderSlot as u, toDisplayString as d } from "vue";
1
+ import { provideLabelLayerRef } from "../context/labelLayerContext.mjs";
2
+ import { provideGraphicalLayerRef } from "../context/graphicalLayerContext.mjs";
3
+ import { provideCursorLayerRef } from "../context/cursorLayerContext.mjs";
4
+ import { computed, createElementBlock, createElementVNode, defineComponent, mergeProps, openBlock, ref, renderSlot, toDisplayString } from "vue";
5
5
  //#region src/chart/Surface.vue?vue&type=script&setup=true&lang.ts
6
- var f = [
6
+ var _hoisted_1 = [
7
7
  "width",
8
8
  "height",
9
9
  "viewBox"
10
- ], p = /* @__PURE__ */ o({
10
+ ];
11
+ var Surface_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
11
12
  name: "ChartsSurface",
12
- inheritAttrs: !1,
13
+ inheritAttrs: false,
13
14
  __name: "Surface",
14
15
  props: {
15
16
  width: {},
@@ -20,47 +21,52 @@ var f = [
20
21
  title: {},
21
22
  desc: {}
22
23
  },
23
- setup(o) {
24
- let p = o, m = r(() => {
25
- let e = p.viewBox || {
26
- width: p.width,
27
- height: p.height,
24
+ setup(__props) {
25
+ const props = __props;
26
+ const svgViewBox = computed(() => {
27
+ const svgView = props.viewBox || {
28
+ width: props.width,
29
+ height: props.height,
28
30
  x: 0,
29
31
  y: 0
30
32
  };
31
- return `${e.x} ${e.y} ${e.width} ${e.height}`;
32
- }), h = l(null);
33
- n(h);
34
- let g = l(null);
35
- t(g);
36
- let _ = l(null);
37
- return e(_), (e, t) => (c(), i("svg", s(e.$attrs, {
38
- class: ["vcharts-surface", [p.class]],
39
- width: e.width,
40
- height: e.height,
41
- style: e.style,
42
- viewBox: m.value
43
- }), [
44
- a("title", null, d(e.title), 1),
45
- a("desc", null, d(e.desc), 1),
46
- u(e.$slots, "default"),
47
- a("g", {
48
- ref_key: "cursorLayerRef",
49
- ref: h,
50
- class: "v-charts-cursor-layer"
51
- }, null, 512),
52
- a("g", {
53
- ref_key: "graphicalLayerRef",
54
- ref: g,
55
- class: "v-charts-graphical-layer"
56
- }, null, 512),
57
- a("g", {
58
- ref_key: "labelLayerRef",
59
- ref: _,
60
- class: "v-charts-label-layer"
61
- }, null, 512)
62
- ], 16, f));
33
+ return `${svgView.x} ${svgView.y} ${svgView.width} ${svgView.height}`;
34
+ });
35
+ const cursorLayerRef = ref(null);
36
+ provideCursorLayerRef(cursorLayerRef);
37
+ const graphicalLayerRef = ref(null);
38
+ provideGraphicalLayerRef(graphicalLayerRef);
39
+ const labelLayerRef = ref(null);
40
+ provideLabelLayerRef(labelLayerRef);
41
+ return (_ctx, _cache) => {
42
+ return openBlock(), createElementBlock("svg", mergeProps(_ctx.$attrs, {
43
+ class: ["vcharts-surface", [props.class]],
44
+ width: _ctx.width,
45
+ height: _ctx.height,
46
+ style: _ctx.style,
47
+ viewBox: svgViewBox.value
48
+ }), [
49
+ createElementVNode("title", null, toDisplayString(_ctx.title), 1),
50
+ createElementVNode("desc", null, toDisplayString(_ctx.desc), 1),
51
+ renderSlot(_ctx.$slots, "default"),
52
+ createElementVNode("g", {
53
+ ref_key: "cursorLayerRef",
54
+ ref: cursorLayerRef,
55
+ class: "v-charts-cursor-layer"
56
+ }, null, 512),
57
+ createElementVNode("g", {
58
+ ref_key: "graphicalLayerRef",
59
+ ref: graphicalLayerRef,
60
+ class: "v-charts-graphical-layer"
61
+ }, null, 512),
62
+ createElementVNode("g", {
63
+ ref_key: "labelLayerRef",
64
+ ref: labelLayerRef,
65
+ class: "v-charts-label-layer"
66
+ }, null, 512)
67
+ ], 16, _hoisted_1);
68
+ };
63
69
  }
64
70
  });
65
71
  //#endregion
66
- export { p as default };
72
+ export { Surface_vue_vue_type_script_setup_true_lang_default as default };
@@ -1,5 +1,5 @@
1
- import { createContext as e } from "../utils/createContext.mjs";
1
+ import { createContext } from "../utils/createContext.mjs";
2
2
  //#region src/chart/TooltipPortalContext.ts
3
- var [t, n] = e("PortalContext");
3
+ var [usePortal, providePortalRaw] = createContext("PortalContext");
4
4
  //#endregion
5
- export { n as providePortalRaw, t as usePortal };
5
+ export { providePortalRaw, usePortal };