vccs 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/dist/cartesian/funnel/Funnel.d.ts +2 -0
  2. package/dist/cartesian/funnel/index.d.ts +2 -0
  3. package/dist/cartesian/funnel/type.d.ts +74 -5
  4. package/dist/cartesian/index.d.ts +1 -0
  5. package/dist/chart/FunnelChart.d.ts +1 -0
  6. package/dist/chart/index.d.ts +1 -0
  7. package/dist/es/animation/Animate.mjs +48 -22
  8. package/dist/es/cartesian/GraphicalItemClipPath.mjs +16 -15
  9. package/dist/es/cartesian/area/ActivePoints.mjs +44 -40
  10. package/dist/es/cartesian/area/Area.mjs +42 -31
  11. package/dist/es/cartesian/area/ClipRect.mjs +79 -58
  12. package/dist/es/cartesian/area/RenderArea.mjs +142 -108
  13. package/dist/es/cartesian/area/hooks/useArea.mjs +71 -47
  14. package/dist/es/cartesian/area/type.mjs +11 -11
  15. package/dist/es/cartesian/area/utils.mjs +69 -49
  16. package/dist/es/cartesian/axis/XAxis.mjs +87 -73
  17. package/dist/es/cartesian/axis/YAxis.mjs +67 -56
  18. package/dist/es/cartesian/bar/Bar.mjs +93 -71
  19. package/dist/es/cartesian/bar/components/BarBackground.mjs +22 -19
  20. package/dist/es/cartesian/bar/components/BarRectangles.mjs +117 -80
  21. package/dist/es/cartesian/bar/hooks/useBar.mjs +49 -37
  22. package/dist/es/cartesian/bar/type.mjs +9 -9
  23. package/dist/es/cartesian/bar/utils.mjs +97 -70
  24. package/dist/es/cartesian/cartesian-axis/CartesianAxis.mjs +165 -115
  25. package/dist/es/cartesian/cartesian-grid/Background.mjs +19 -16
  26. package/dist/es/cartesian/cartesian-grid/CartesianGrid.mjs +116 -97
  27. package/dist/es/cartesian/cartesian-grid/HorizontalGridLines.mjs +24 -23
  28. package/dist/es/cartesian/cartesian-grid/HorizontalStripes.mjs +24 -24
  29. package/dist/es/cartesian/cartesian-grid/VerticalGridLines.mjs +23 -22
  30. package/dist/es/cartesian/cartesian-grid/VerticalStripes.mjs +24 -24
  31. package/dist/es/cartesian/cartesian-grid/const.mjs +317 -10
  32. package/dist/es/cartesian/cartesian-grid/utils.mjs +18 -13
  33. package/dist/es/cartesian/error-bar/ErrorBar.mjs +111 -83
  34. package/dist/es/cartesian/error-bar/ErrorBarContext.mjs +13 -12
  35. package/dist/es/cartesian/funnel/Funnel.mjs +177 -0
  36. package/dist/es/cartesian/funnel/type.mjs +80 -0
  37. package/dist/es/cartesian/funnel/utils.mjs +102 -0
  38. package/dist/es/cartesian/line/ActivePoints.mjs +45 -41
  39. package/dist/es/cartesian/line/Line.mjs +41 -37
  40. package/dist/es/cartesian/line/StaticLine.mjs +191 -122
  41. package/dist/es/cartesian/line/hooks/useLine.mjs +60 -44
  42. package/dist/es/cartesian/line/type.mjs +11 -11
  43. package/dist/es/cartesian/line/utils.mjs +27 -26
  44. package/dist/es/cartesian/reference-area/ReferenceArea.mjs +86 -69
  45. package/dist/es/cartesian/reference-line/ReferenceLine.mjs +99 -77
  46. package/dist/es/cartesian/scatter/Scatter.mjs +168 -140
  47. package/dist/es/cartesian/scatter/hooks/useScatter.mjs +18 -14
  48. package/dist/es/cartesian/useNeedsClip.mjs +18 -9
  49. package/dist/es/cartesian/utils/get-ticks.mjs +103 -68
  50. package/dist/es/cartesian/z-axis/ZAxis.mjs +30 -28
  51. package/dist/es/chart/AreaChart.mjs +5 -5
  52. package/dist/es/chart/BarChart.mjs +5 -5
  53. package/dist/es/chart/ComposedChart.mjs +5 -5
  54. package/dist/es/chart/FunnelChart.mjs +11 -0
  55. package/dist/es/chart/LegendPortalContext.mjs +3 -3
  56. package/dist/es/chart/LineChart.mjs +5 -5
  57. package/dist/es/chart/PieChart.mjs +5 -5
  58. package/dist/es/chart/RadarChart.mjs +5 -5
  59. package/dist/es/chart/RadialBarChart.mjs +5 -5
  60. package/dist/es/chart/RechartsWrapper.mjs +111 -88
  61. package/dist/es/chart/ScatterChart.mjs +5 -5
  62. package/dist/es/chart/Surface.mjs +3 -3
  63. package/dist/es/chart/Surface.vue_vue_type_script_setup_true_lang.mjs +51 -45
  64. package/dist/es/chart/TooltipPortalContext.mjs +3 -3
  65. package/dist/es/chart/const.mjs +2 -2
  66. package/dist/es/chart/generateCategoricalChart.mjs +97 -88
  67. package/dist/es/chart/provideClipPathId.mjs +12 -7
  68. package/dist/es/components/Cell.mjs +16 -4
  69. package/dist/es/components/Text.mjs +3 -3
  70. package/dist/es/components/Text.vue_vue_type_script_setup_true_lang.mjs +106 -69
  71. package/dist/es/components/Tooltip.mjs +274 -199
  72. package/dist/es/components/label/Label.mjs +30 -26
  73. package/dist/es/components/label/LabelList.mjs +45 -39
  74. package/dist/es/components/label/types.mjs +8 -5
  75. package/dist/es/components/label/utils.mjs +194 -162
  76. package/dist/es/components/legend/Legend.mjs +82 -71
  77. package/dist/es/components/legend/LegendSymbol.mjs +40 -38
  78. package/dist/es/components/legend/hooks/useLegend.mjs +66 -46
  79. package/dist/es/components/legend/hooks/useLegendContent.mjs +52 -31
  80. package/dist/es/components/legend/type.mjs +2 -2
  81. package/dist/es/components/legend/utils.mjs +19 -11
  82. package/dist/es/components/utils.mjs +35 -22
  83. package/dist/es/container/ClipPath.mjs +14 -14
  84. package/dist/es/container/Layer.mjs +9 -7
  85. package/dist/es/container/ResponsiveContainer.mjs +3 -3
  86. package/dist/es/container/ResponsiveContainer.vue_vue_type_script_setup_true_lang.mjs +109 -77
  87. package/dist/es/container/Surface.mjs +23 -19
  88. package/dist/es/container/useSizeContext.mjs +3 -3
  89. package/dist/es/context/ChartDataContextProvider.mjs +19 -13
  90. package/dist/es/context/PanoramaContextProvider.mjs +15 -10
  91. package/dist/es/context/accessibilityContext.mjs +3 -3
  92. package/dist/es/context/cartesianLabelListContext.mjs +3 -3
  93. package/dist/es/context/chartLayoutContext.mjs +33 -30
  94. package/dist/es/context/cursorLayerContext.mjs +3 -3
  95. package/dist/es/context/graphicalLayerContext.mjs +3 -3
  96. package/dist/es/context/labelLayerContext.mjs +3 -3
  97. package/dist/es/context/polarLabelViewBoxContext.mjs +5 -5
  98. package/dist/es/context/useTooltipAxis.mjs +14 -12
  99. package/dist/es/events/useChartSynchronisation.mjs +91 -66
  100. package/dist/es/hooks/useIsAnimating.mjs +28 -0
  101. package/dist/es/hooks/useSetupGraphicalItem.mjs +52 -43
  102. package/dist/es/index.mjs +46 -42
  103. package/dist/es/polar/pie/Pie.mjs +131 -115
  104. package/dist/es/polar/pie/type.mjs +6 -6
  105. package/dist/es/polar/radar/PolarAngleAxis.mjs +103 -84
  106. package/dist/es/polar/radar/PolarGrid.mjs +72 -59
  107. package/dist/es/polar/radar/PolarRadiusAxis.mjs +90 -65
  108. package/dist/es/polar/radar/Radar.mjs +181 -145
  109. package/dist/es/polar/radial-bar/RadialBar.mjs +161 -140
  110. package/dist/es/polar/radial-bar/type.mjs +9 -9
  111. package/dist/es/shape/Cross.mjs +11 -10
  112. package/dist/es/shape/Curve.mjs +69 -43
  113. package/dist/es/shape/Dot.mjs +12 -11
  114. package/dist/es/shape/Rectangle.mjs +41 -26
  115. package/dist/es/shape/Sector.mjs +103 -75
  116. package/dist/es/shape/Symbols.mjs +45 -34
  117. package/dist/es/shape/Trapezoid.mjs +52 -0
  118. package/dist/es/state/ReportChartProps.mjs +21 -20
  119. package/dist/es/state/ReportMainChartProps.mjs +26 -21
  120. package/dist/es/state/ReportPolarOptions.mjs +23 -22
  121. package/dist/es/state/SetGraphicalItem.mjs +42 -27
  122. package/dist/es/state/SetLegendPayload.mjs +17 -13
  123. package/dist/es/state/SetTooltipEntrySettings.mjs +14 -12
  124. package/dist/es/state/brushSlice.mjs +12 -8
  125. package/dist/es/state/cartesianAxisSlice.mjs +23 -17
  126. package/dist/es/state/chartDataSlice.mjs +18 -13
  127. package/dist/es/state/externalEventsMiddleware.mjs +25 -15
  128. package/dist/es/state/graphicalItemsSlice.mjs +29 -25
  129. package/dist/es/state/hooks.mjs +4 -3
  130. package/dist/es/state/keyboardEventsMiddleware.mjs +50 -42
  131. package/dist/es/state/layoutSlice.mjs +18 -12
  132. package/dist/es/state/legendSlice.mjs +19 -14
  133. package/dist/es/state/mouseEventsMiddleware.mjs +31 -24
  134. package/dist/es/state/optionsSlice.mjs +14 -11
  135. package/dist/es/state/polarAxisSlice.mjs +15 -13
  136. package/dist/es/state/polarOptionsSlice.mjs +8 -6
  137. package/dist/es/state/reduxDevtoolsJsonStringifyReplacer.mjs +5 -3
  138. package/dist/es/state/referenceElementsSlice.mjs +21 -19
  139. package/dist/es/state/rootPropsSlice.mjs +20 -9
  140. package/dist/es/state/selectors/areaSelectors.mjs +65 -55
  141. package/dist/es/state/selectors/axisSelectors.mjs +755 -569
  142. package/dist/es/state/selectors/barSelectors.mjs +225 -162
  143. package/dist/es/state/selectors/brushSelectors.mjs +15 -14
  144. package/dist/es/state/selectors/combiners/combineActiveLabel.mjs +6 -5
  145. package/dist/es/state/selectors/combiners/combineActiveTooltipIndex.mjs +36 -27
  146. package/dist/es/state/selectors/combiners/combineAxisRangeWithReverse.mjs +5 -3
  147. package/dist/es/state/selectors/combiners/combineCoordinateForDefaultIndex.mjs +13 -11
  148. package/dist/es/state/selectors/combiners/combineTooltipInteractionState.mjs +26 -21
  149. package/dist/es/state/selectors/combiners/combineTooltipPayloadConfigurations.mjs +10 -6
  150. package/dist/es/state/selectors/common.mjs +2 -2
  151. package/dist/es/state/selectors/containerSelectors.mjs +5 -2
  152. package/dist/es/state/selectors/dataSelectors.mjs +28 -9
  153. package/dist/es/state/selectors/funnelSelectors.mjs +38 -0
  154. package/dist/es/state/selectors/legendSelectors.mjs +7 -6
  155. package/dist/es/state/selectors/lineSelectors.mjs +54 -47
  156. package/dist/es/state/selectors/pickAxisId.mjs +2 -2
  157. package/dist/es/state/selectors/pickAxisType.mjs +2 -2
  158. package/dist/es/state/selectors/pieSelectors.mjs +116 -81
  159. package/dist/es/state/selectors/polarAxisSelectors.mjs +113 -94
  160. package/dist/es/state/selectors/polarGridSelectors.mjs +13 -11
  161. package/dist/es/state/selectors/polarScaleSelectors.mjs +49 -46
  162. package/dist/es/state/selectors/polarSelectors.mjs +79 -62
  163. package/dist/es/state/selectors/radarSelectors.mjs +111 -91
  164. package/dist/es/state/selectors/radialBarSelectors.mjs +230 -183
  165. package/dist/es/state/selectors/rootPropsSelectors.mjs +11 -5
  166. package/dist/es/state/selectors/scatterSelectors.mjs +111 -95
  167. package/dist/es/state/selectors/selectActivePropsFromChartPointer.mjs +19 -17
  168. package/dist/es/state/selectors/selectAllAxes.mjs +8 -3
  169. package/dist/es/state/selectors/selectChartOffset.mjs +59 -50
  170. package/dist/es/state/selectors/selectChartOffsetInternal.mjs +55 -44
  171. package/dist/es/state/selectors/selectTooltipEventType.mjs +15 -14
  172. package/dist/es/state/selectors/selectTooltipPayloadSearcher.mjs +3 -3
  173. package/dist/es/state/selectors/selectTooltipSettings.mjs +2 -2
  174. package/dist/es/state/selectors/selectTooltipState.mjs +2 -2
  175. package/dist/es/state/selectors/selectors.mjs +94 -75
  176. package/dist/es/state/selectors/tooltipSelectors.mjs +253 -204
  177. package/dist/es/state/selectors/touchSelectors.mjs +17 -14
  178. package/dist/es/state/store.mjs +46 -46
  179. package/dist/es/state/tooltipSlice.mjs +64 -37
  180. package/dist/es/state/touchEventsMiddleware.mjs +35 -29
  181. package/dist/es/state/utils/useReportScale.mjs +16 -13
  182. package/dist/es/synchronisation/syncSelectors.mjs +3 -3
  183. package/dist/es/synchronisation/useChartSynchronisation.mjs +33 -19
  184. package/dist/es/types/event.mjs +164 -2
  185. package/dist/es/utils/ReduceCSSCalc.mjs +81 -49
  186. package/dist/es/utils/VueUtils.mjs +35 -14
  187. package/dist/es/utils/attrs.mjs +43 -26
  188. package/dist/es/utils/cartesian.mjs +47 -15
  189. package/dist/es/utils/chart.mjs +298 -197
  190. package/dist/es/utils/const.mjs +30 -2
  191. package/dist/es/utils/createContext.mjs +28 -9
  192. package/dist/es/utils/data-utils.mjs +9 -8
  193. package/dist/es/utils/data.mjs +35 -21
  194. package/dist/es/utils/events.mjs +5 -3
  195. package/dist/es/utils/getLinearRegression.mjs +28 -11
  196. package/dist/es/utils/grid.mjs +20 -5
  197. package/dist/es/utils/isDomainSpecifiedByUser.mjs +105 -54
  198. package/dist/es/utils/legend.mjs +13 -12
  199. package/dist/es/utils/log.mjs +10 -7
  200. package/dist/es/utils/payload/getUniqPayload.mjs +6 -4
  201. package/dist/es/utils/polar.mjs +37 -30
  202. package/dist/es/utils/props.mjs +16 -10
  203. package/dist/es/utils/resolveDefaultProps.mjs +23 -4
  204. package/dist/es/utils/scale/getNiceTickValues.mjs +127 -49
  205. package/dist/es/utils/scale/utils/arithmetic.mjs +49 -19
  206. package/dist/es/utils/scale/utils/utils.mjs +43 -24
  207. package/dist/es/utils/style.mjs +24 -13
  208. package/dist/es/utils/tick.mjs +34 -23
  209. package/dist/es/utils/tooltip/translate.mjs +63 -49
  210. package/dist/es/utils/validate.mjs +40 -29
  211. package/dist/hooks/useIsAnimating.d.ts +14 -0
  212. package/dist/shape/Trapezoid.d.ts +31 -0
  213. package/dist/shape/index.d.ts +1 -0
  214. package/dist/state/graphicalItemsSlice.d.ts +1 -1
  215. package/package.json +1 -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,23 @@
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 { getChartPointer } from "../utils/chart.mjs";
2
+ import { mouseLeaveChart } from "../state/tooltipSlice.mjs";
3
+ import { useAppDispatch } from "../state/hooks.mjs";
4
+ import { mouseClickAction, mouseMoveAction } from "../state/mouseEventsMiddleware.mjs";
5
+ import { focusAction, keyDownAction } from "../state/keyboardEventsMiddleware.mjs";
6
+ import { externalEventAction } from "../state/externalEventsMiddleware.mjs";
7
+ import { touchEventAction } from "../state/touchEventsMiddleware.mjs";
8
+ import { useSynchronisedEventsFromOtherCharts } from "../events/useChartSynchronisation.mjs";
9
+ import { useReportScale } from "../state/utils/useReportScale.mjs";
10
+ import { providePortalRaw } from "./TooltipPortalContext.mjs";
11
+ import { provideLegendPortalRaw } from "./LegendPortalContext.mjs";
12
+ import { createVNode, defineComponent, ref } from "vue";
13
13
  //#region src/chart/RechartsWrapper.tsx
14
- var g = /* @__PURE__ */ m({
14
+ var RechartsWrapper = /* @__PURE__ */ defineComponent({
15
15
  name: "RechartsWrapper",
16
16
  props: {
17
17
  class: { type: String },
18
18
  height: {
19
19
  type: Number,
20
- required: !0
20
+ required: true
21
21
  },
22
22
  onClick: { type: Function },
23
23
  onContextMenu: { type: Function },
@@ -33,105 +33,128 @@ var g = /* @__PURE__ */ m({
33
33
  style: { type: Object },
34
34
  width: {
35
35
  type: Number,
36
- required: !0
36
+ required: true
37
37
  }
38
38
  },
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
39
+ setup(props, { slots }) {
40
+ const dispatch = useAppDispatch();
41
+ useSynchronisedEventsFromOtherCharts();
42
+ const scaleRef = useReportScale();
43
+ const tooltipPortal = ref(null);
44
+ const legendPortal = ref(null);
45
+ providePortalRaw(tooltipPortal);
46
+ provideLegendPortalRaw(legendPortal);
47
+ const innerRef = (node) => {
48
+ scaleRef.value = node;
49
+ tooltipPortal.value = node;
50
+ legendPortal.value = node;
51
+ };
52
+ const myOnClick = (e) => {
53
+ const chartPointer = getChartPointer(e);
54
+ if (chartPointer) dispatch(mouseClickAction(chartPointer));
55
+ dispatch(externalEventAction({
56
+ handler: props.onClick,
57
+ event: e
51
58
  }));
52
- }, C = (t) => {
53
- let n = e(t);
54
- n && _(i(n)), _(s({
55
- handler: m.onMouseEnter,
56
- event: t
59
+ };
60
+ const myOnMouseEnter = (e) => {
61
+ const chartPointer = getChartPointer(e);
62
+ if (chartPointer) dispatch(mouseMoveAction(chartPointer));
63
+ dispatch(externalEventAction({
64
+ handler: props.onMouseEnter,
65
+ event: e
57
66
  }));
58
- }, w = (e) => {
59
- _(t()), _(s({
60
- handler: m.onMouseLeave,
67
+ };
68
+ const myOnMouseLeave = (e) => {
69
+ dispatch(mouseLeaveChart());
70
+ dispatch(externalEventAction({
71
+ handler: props.onMouseLeave,
61
72
  event: e
62
73
  }));
63
- }, T = (t) => {
64
- let n = e(t);
65
- n && _(i(n)), _(s({
66
- handler: m.onMouseMove,
67
- event: t
74
+ };
75
+ const myOnMouseMove = (e) => {
76
+ const chartPointer = getChartPointer(e);
77
+ if (chartPointer) dispatch(mouseMoveAction(chartPointer));
78
+ dispatch(externalEventAction({
79
+ handler: props.onMouseMove,
80
+ event: e
68
81
  }));
69
- }, E = () => {
70
- _(a());
71
- }, D = (e) => {
72
- _(o(e.key));
73
- }, O = (e) => {
74
- _(s({
75
- handler: m.onContextMenu,
82
+ };
83
+ const onFocus = () => {
84
+ dispatch(focusAction());
85
+ };
86
+ const onKeyDown = (e) => {
87
+ dispatch(keyDownAction(e.key));
88
+ };
89
+ const myOnContextMenu = (e) => {
90
+ dispatch(externalEventAction({
91
+ handler: props.onContextMenu,
76
92
  event: e
77
93
  }));
78
- }, k = (e) => {
79
- _(s({
80
- handler: m.onDoubleClick,
94
+ };
95
+ const myOnDoubleClick = (e) => {
96
+ dispatch(externalEventAction({
97
+ handler: props.onDoubleClick,
81
98
  event: e
82
99
  }));
83
- }, A = (e) => {
84
- _(s({
85
- handler: m.onMouseDown,
100
+ };
101
+ const myOnMouseDown = (e) => {
102
+ dispatch(externalEventAction({
103
+ handler: props.onMouseDown,
86
104
  event: e
87
105
  }));
88
- }, j = (e) => {
89
- _(s({
90
- handler: m.onMouseUp,
106
+ };
107
+ const myOnMouseUp = (e) => {
108
+ dispatch(externalEventAction({
109
+ handler: props.onMouseUp,
91
110
  event: e
92
111
  }));
93
- }, M = (e) => {
94
- _(s({
95
- handler: m.onTouchStart,
112
+ };
113
+ const myOnTouchStart = (e) => {
114
+ dispatch(externalEventAction({
115
+ handler: props.onTouchStart,
96
116
  event: e
97
117
  }));
98
- }, N = (e) => {
99
- _(c(e)), _(s({
100
- handler: m.onTouchMove,
118
+ };
119
+ const myOnTouchMove = (e) => {
120
+ dispatch(touchEventAction(e));
121
+ dispatch(externalEventAction({
122
+ handler: props.onTouchMove,
101
123
  event: e
102
124
  }));
103
- }, P = (e) => {
104
- _(s({
105
- handler: m.onTouchEnd,
125
+ };
126
+ const myOnTouchEnd = (e) => {
127
+ dispatch(externalEventAction({
128
+ handler: props.onTouchEnd,
106
129
  event: e
107
130
  }));
108
131
  };
109
- return () => p("div", {
110
- class: ["v-charts-wrapper", m.class],
111
- style: {
132
+ return () => createVNode("div", {
133
+ "class": ["v-charts-wrapper", props.class],
134
+ "style": {
112
135
  position: "relative",
113
136
  cursor: "default",
114
- width: `${m.width}px`,
115
- height: `${m.height}px`,
116
- ...m.style
137
+ width: `${props.width}px`,
138
+ height: `${props.height}px`,
139
+ ...props.style
117
140
  },
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?.()]);
141
+ "role": "application",
142
+ "onClick": myOnClick,
143
+ "onContextmenu": myOnContextMenu,
144
+ "onDblclick": myOnDoubleClick,
145
+ "onFocus": onFocus,
146
+ "onKeydown": onKeyDown,
147
+ "onMousedown": myOnMouseDown,
148
+ "onMouseenter": myOnMouseEnter,
149
+ "onMouseleave": myOnMouseLeave,
150
+ "onMousemove": myOnMouseMove,
151
+ "onMouseup": myOnMouseUp,
152
+ "onTouchend": myOnTouchEnd,
153
+ "onTouchmove": myOnTouchMove,
154
+ "onTouchstart": myOnTouchStart,
155
+ "ref": innerRef
156
+ }, [slots.default?.()]);
134
157
  }
135
158
  });
136
159
  //#endregion
137
- export { g as RechartsWrapper };
160
+ 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 };
@@ -1,7 +1,7 @@
1
1
  //#region src/chart/const.ts
2
- var e = {
2
+ var FULL_WIDTH_AND_HEIGHT = {
3
3
  width: "100%",
4
4
  height: "100%"
5
5
  };
6
6
  //#endregion
7
- export { e as FULL_WIDTH_AND_HEIGHT };
7
+ export { FULL_WIDTH_AND_HEIGHT };