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
package/README.md ADDED
@@ -0,0 +1,151 @@
1
+ <h1 align="center">Vue Charts (vccs)</h1>
2
+
3
+ <p align="center">
4
+ <strong>Composable charting components for Vue 3</strong>
5
+ </p>
6
+
7
+ <p align="center">
8
+ An unofficial Vue.js port of <a href="https://recharts.org">Recharts</a>, bringing React's most popular charting library to the Vue ecosystem.
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/vccs"><img src="https://img.shields.io/npm/v/vccs.svg" alt="npm version"></a>
13
+ </p>
14
+
15
+ ---
16
+
17
+ > **Work in Progress**: This library is under active development. APIs may change.
18
+
19
+ ## Install
20
+
21
+ ```bash
22
+ # pnpm
23
+ pnpm add vccs
24
+
25
+ # npm
26
+ npm install vccs
27
+
28
+ # yarn
29
+ yarn add vccs
30
+ ```
31
+
32
+ **Peer dependency**: `vue >= 3.0.0`
33
+
34
+ ## Quick Start
35
+
36
+ ```vue
37
+ <script setup>
38
+ import { Bar, BarChart, CartesianGrid, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'vccs'
39
+
40
+ const data = [
41
+ { name: 'Page A', uv: 4000, pv: 2400 },
42
+ { name: 'Page B', uv: 3000, pv: 1398 },
43
+ { name: 'Page C', uv: 2000, pv: 9800 },
44
+ { name: 'Page D', uv: 2780, pv: 3908 },
45
+ { name: 'Page E', uv: 1890, pv: 4800 },
46
+ { name: 'Page F', uv: 2390, pv: 3800 },
47
+ ]
48
+ </script>
49
+
50
+ <template>
51
+ <ResponsiveContainer
52
+ width="100%"
53
+ :height="300"
54
+ >
55
+ <BarChart :data="data">
56
+ <CartesianGrid stroke-dasharray="3 3" />
57
+ <XAxis data-key="name" />
58
+ <YAxis />
59
+ <Tooltip />
60
+ <Bar
61
+ data-key="pv"
62
+ fill="#8884d8"
63
+ />
64
+ <Bar
65
+ data-key="uv"
66
+ fill="#82ca9d"
67
+ />
68
+ </BarChart>
69
+ </ResponsiveContainer>
70
+ </template>
71
+ ```
72
+
73
+ ## Chart Types
74
+
75
+ | Chart | Component | Description |
76
+ |-------|-----------|-------------|
77
+ | Area | `<AreaChart>` + `<Area>` | Filled area charts with stacking & gradients |
78
+ | Bar | `<BarChart>` + `<Bar>` | Vertical/horizontal bar charts |
79
+ | Line | `<LineChart>` + `<Line>` | Line charts with multiple curve types |
80
+ | Scatter | `<ScatterChart>` + `<Scatter>` | X-Y scatter plots |
81
+ | Composed | `<ComposedChart>` | Mix Area, Bar, Line in one chart |
82
+ | Pie | `<PieChart>` + `<Pie>` | Pie and donut charts |
83
+ | Radar | `<RadarChart>` + `<Radar>` | Radar/spider charts |
84
+ | Radial Bar | `<RadialBarChart>` + `<RadialBar>` | Circular bar charts |
85
+ | Funnel | `<FunnelChart>` + `<Funnel>` | Funnel/pipeline charts |
86
+ | Treemap | `<Treemap>` | Not yet supported |
87
+ | Sankey | `<Sankey>` | Not yet supported |
88
+ | Sunburst | `<SunburstChart>` | Not yet supported |
89
+
90
+ ## Components
91
+
92
+ **Cartesian**: `XAxis`, `YAxis`, `ZAxis`, `CartesianGrid`, `ReferenceLine`, `ReferenceArea`, `ErrorBar`, `Brush`
93
+
94
+ **Polar**: `PolarGrid`, `PolarAngleAxis`, `PolarRadiusAxis`
95
+
96
+ **General**: `Tooltip`, `Legend`, `Label`, `LabelList`, `Cell`, `ResponsiveContainer`
97
+
98
+ **Shapes**: `Rectangle`, `Dot`, `Sector`, `Symbols`
99
+
100
+ ## Features
101
+
102
+ - **Vue 3 Native** — Composition API + JSX, full TypeScript support
103
+ - **Recharts API** — Same intuitive composable component design
104
+ - **Animated** — Smooth transitions powered by [Motion for Vue](https://motion.dev/docs/vue)
105
+ - **Interactive** — Tooltip, legend, brush, and click/hover events
106
+ - **Responsive** — `<ResponsiveContainer>` adapts to parent width
107
+ - **Customizable** — Named slots for shapes, ticks, tooltip content, legend, and more
108
+
109
+ ## Architecture
110
+
111
+ - **State**: Redux Toolkit via [@reduxjs/vue-redux](https://github.com/nicepkg/reduxjs-vue-redux) — one store per chart
112
+ - **Math**: D3 scales and shapes via [victory-vendor](https://github.com/FormidableLabs/victory)
113
+ - **Animation**: [Motion for Vue](https://motion.dev/docs/vue)
114
+
115
+ ## Project Structure
116
+
117
+ ```
118
+ packages/vue/src/ # Library source (published as vccs)
119
+ playground/nuxt/ # Nuxt 3 playground for manual testing
120
+ docs/ # Documentation site (Nuxt 3 + Docus)
121
+ ```
122
+
123
+ ## Development
124
+
125
+ ```bash
126
+ pnpm install # Install dependencies
127
+ pnpm dev # Watch mode (library)
128
+ pnpm test # Run tests
129
+ pnpm test:coverage # Tests with coverage
130
+ pnpm storybook # Storybook
131
+ pnpm play # Nuxt playground
132
+ pnpm docs # Documentation site
133
+ ```
134
+
135
+ ## License
136
+
137
+ [MIT](LICENSE)
138
+
139
+ ## Credits
140
+
141
+ - **[Recharts](https://recharts.org)** — Original React charting library this project ports from
142
+ - **[Victory Vendor](https://github.com/FormidableLabs/victory)** — D3 math utilities
143
+ - **[Motion for Vue](https://motion.dev/docs/vue)** — Animation engine
144
+ - **[Redux Toolkit](https://redux-toolkit.js.org/)** — State management
145
+ - **[VueUse](https://vueuse.org/)** — Vue composition utilities
146
+
147
+ ---
148
+
149
+ <p align="center">
150
+ <em>This is an unofficial port and is not affiliated with the original Recharts team.</em>
151
+ </p>
@@ -62,9 +62,9 @@ declare const Animate: import('vue').DefineComponent<import('vue').ExtractPropTy
62
62
  };
63
63
  }>> & Readonly<{}>, {
64
64
  from: number;
65
- to: number;
66
65
  onUpdate: (latest: any) => void;
67
66
  transition: AnimationOptions;
67
+ to: number;
68
68
  onAnimationStart: () => void;
69
69
  onAnimationEnd: () => void;
70
70
  isActive: boolean;
@@ -1,5 +1,5 @@
1
1
  import { ChartData } from '../../state/chartDataSlice';
2
- import { DataKey, TooltipType, VuePropsToType, WithSVGProps } from '../../types';
2
+ import { DataKey, TooltipType, VueClassValue, VuePropsToType, WithSVGProps } from '../../types';
3
3
  import { AnimationOptions } from 'motion-v';
4
4
  import { BaseValue } from '../../types/area';
5
5
  import { AxisId } from '../../types/axis';
@@ -139,7 +139,7 @@ export declare const AreaVueProps: {
139
139
  type: PropType<string | number>;
140
140
  };
141
141
  class: {
142
- type: StringConstructor;
142
+ type: PropType<VueClassValue>;
143
143
  default: any;
144
144
  };
145
145
  type: {
@@ -169,5 +169,5 @@ export interface AreaDotSlotProps {
169
169
  strokeWidth?: number;
170
170
  fillOpacity?: number;
171
171
  clipDot?: boolean;
172
- class?: string;
172
+ class?: VueClassValue;
173
173
  }
@@ -23,7 +23,7 @@ export type BarRectangleItem = {
23
23
  };
24
24
  export declare const BarVueProps: {
25
25
  class: {
26
- type: StringConstructor;
26
+ type: PropType<import('../../types').VueClassValue>;
27
27
  default: any;
28
28
  };
29
29
  barSize: {
@@ -119,18 +119,6 @@ export declare const BarVueProps: {
119
119
  type: PropType<AxisId>;
120
120
  default: number;
121
121
  };
122
- animationBegin: {
123
- type: NumberConstructor;
124
- default: number;
125
- };
126
- animationDuration: {
127
- type: NumberConstructor;
128
- default: number;
129
- };
130
- animationEasing: {
131
- type: StringConstructor;
132
- default: string;
133
- };
134
122
  transition: {
135
123
  type: PropType<AnimationOptions>;
136
124
  default: {
@@ -5,7 +5,7 @@ export declare const Slide: import('vue').DefineComponent<import('vue').ExtractP
5
5
  travellerWidth: NumberConstructor;
6
6
  startX: NumberConstructor;
7
7
  endX: NumberConstructor;
8
- }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("mousedown" | "mouseenter" | "mouseleave" | "touchstart")[], "mousedown" | "mouseenter" | "mouseleave" | "touchstart", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
8
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("mouseenter" | "mouseleave" | "mousedown" | "touchstart")[], "mouseenter" | "mouseleave" | "mousedown" | "touchstart", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
9
9
  y: NumberConstructor;
10
10
  height: NumberConstructor;
11
11
  stroke: StringConstructor;
@@ -5,7 +5,7 @@ export declare const TravellerLayer: import('vue').DefineComponent<import('vue')
5
5
  otherProps: () => BrushProps & {
6
6
  y: number;
7
7
  };
8
- }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("focus" | "blur" | "mousedown" | "mouseenter" | "mouseleave" | "touchstart" | "traveller-move-keyboard")[], "focus" | "blur" | "mousedown" | "mouseenter" | "mouseleave" | "touchstart" | "traveller-move-keyboard", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
8
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("focus" | "blur" | "mouseenter" | "mouseleave" | "mousedown" | "touchstart" | "traveller-move-keyboard")[], "focus" | "blur" | "mouseenter" | "mouseleave" | "mousedown" | "touchstart" | "traveller-move-keyboard", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
9
9
  id: StringConstructor;
10
10
  travellerX: NumberConstructor;
11
11
  otherProps: () => BrushProps & {
@@ -56,7 +56,8 @@ export declare const BrushVueProps: {
56
56
  type: StringConstructor;
57
57
  };
58
58
  class: {
59
- type: StringConstructor;
59
+ type: PropType<import('../../types').VueClassValue>;
60
+ default: any;
60
61
  };
61
62
  data: {
62
63
  type: PropType<any[]>;
@@ -1,4 +1,5 @@
1
1
  import { CartesianViewBox } from '../type';
2
+ import { VueClassValue } from '../../types/common';
2
3
  import { AxisInterval } from '../../types/axis';
3
4
  import { RechartsScale } from '../../types/scale';
4
5
  import { CartesianTickItem } from '../../types/tick';
@@ -10,7 +11,7 @@ export type Unit = string | number;
10
11
  /** The formatter function of tick */
11
12
  export type TickFormatter = (value: any, index: number) => string;
12
13
  export interface CartesianAxisProps {
13
- class?: string;
14
+ class?: VueClassValue;
14
15
  x?: number;
15
16
  y?: number;
16
17
  width?: number;
@@ -0,0 +1,2 @@
1
+ import { FunnelPropsWithSVG } from './type';
2
+ export declare const Funnel: import('vue').DefineComponent<FunnelPropsWithSVG, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<FunnelPropsWithSVG> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,2 @@
1
+ export * from './Funnel';
2
+ export * from './type';
@@ -1,7 +1,8 @@
1
+ import { AnimationOptions } from 'motion-v';
2
+ import { PropType } from 'vue';
1
3
  import { ViewBox } from '../type';
2
4
  import { TrapezoidProps } from '../../shape';
3
- import { Coordinate, DataKey, TooltipType } from '../../types';
4
- import { AnimationEasing } from '../../types/bar';
5
+ import { Coordinate, DataKey, TooltipType, WithSVGProps } from '../../types';
5
6
  import { LegendType } from '../../types/legend';
6
7
  export interface FunnelTrapezoidItem extends TrapezoidProps {
7
8
  value?: number | string;
@@ -12,15 +13,12 @@ export interface FunnelTrapezoidItem extends TrapezoidProps {
12
13
  labelViewBox?: ViewBox;
13
14
  }
14
15
  export interface FunnelProps {
15
- animationBegin?: number;
16
- animationDuration?: number;
17
- animationEasing?: AnimationEasing;
18
- className?: string;
19
16
  data?: any[];
20
17
  dataKey: DataKey<any>;
21
18
  hide?: boolean;
22
19
  id?: string;
23
20
  isAnimationActive?: boolean;
21
+ transition?: AnimationOptions;
24
22
  lastShapeType?: 'triangle' | 'rectangle';
25
23
  legendType?: LegendType;
26
24
  nameKey?: DataKey<any>;
@@ -29,6 +27,76 @@ export interface FunnelProps {
29
27
  reversed?: boolean;
30
28
  tooltipType?: TooltipType;
31
29
  }
30
+ export declare const FunnelVueProps: {
31
+ data: {
32
+ type: PropType<Array<Record<string, unknown>>>;
33
+ default: any;
34
+ };
35
+ dataKey: {
36
+ type: PropType<DataKey<any>>;
37
+ required: true;
38
+ };
39
+ nameKey: {
40
+ type: PropType<DataKey<any>>;
41
+ default: string;
42
+ };
43
+ lastShapeType: {
44
+ type: PropType<"triangle" | "rectangle">;
45
+ default: string;
46
+ };
47
+ reversed: {
48
+ type: BooleanConstructor;
49
+ default: boolean;
50
+ };
51
+ fill: {
52
+ type: StringConstructor;
53
+ default: string;
54
+ };
55
+ stroke: {
56
+ type: StringConstructor;
57
+ default: string;
58
+ };
59
+ legendType: {
60
+ type: PropType<LegendType>;
61
+ default: string;
62
+ };
63
+ tooltipType: {
64
+ type: PropType<TooltipType>;
65
+ default: any;
66
+ };
67
+ hide: {
68
+ type: BooleanConstructor;
69
+ default: boolean;
70
+ };
71
+ isAnimationActive: {
72
+ type: BooleanConstructor;
73
+ default: boolean;
74
+ };
75
+ transition: {
76
+ type: PropType<AnimationOptions>;
77
+ default: () => {
78
+ duration: number;
79
+ ease: string;
80
+ };
81
+ };
82
+ onAnimationStart: {
83
+ type: PropType<() => void>;
84
+ default: any;
85
+ };
86
+ onAnimationEnd: {
87
+ type: PropType<() => void>;
88
+ default: any;
89
+ };
90
+ width: {
91
+ type: PropType<number | string>;
92
+ default: any;
93
+ };
94
+ class: {
95
+ type: PropType<import('../../types').VueClassValue>;
96
+ default: any;
97
+ };
98
+ };
99
+ export type FunnelPropsWithSVG = WithSVGProps<typeof FunnelVueProps>;
32
100
  type RealFunnelData = any;
33
101
  export type FunnelComposedData = {
34
102
  trapezoids: ReadonlyArray<FunnelTrapezoidItem>;
@@ -6,6 +6,8 @@ export * from './cartesian-grid';
6
6
  export * from './error-bar';
7
7
  export * from './line';
8
8
  export * from './reference-area';
9
+ export * from './reference-dot';
9
10
  export * from './reference-line';
10
11
  export * from './scatter';
11
12
  export * from './z-axis';
13
+ export * from './funnel';
@@ -3,11 +3,8 @@ import { ActivePointsSlots } from './ActivePoints';
3
3
  export declare const Line: import('vue').DefineComponent<{
4
4
  activeDot?: any;
5
5
  animateNewValues?: boolean;
6
- animationBegin?: number;
7
- animationDuration?: import('../../types').AnimationDuration;
8
- animationEasing?: import('../../types/bar').AnimationEasing;
9
6
  animationId?: string;
10
- className?: string;
7
+ class?: import('../../types').VueClassValue;
11
8
  connectNulls?: boolean;
12
9
  data?: any[];
13
10
  dataKey: import('../../types').DataKey<any>;
@@ -24,7 +21,7 @@ export declare const Line: import('vue').DefineComponent<{
24
21
  stroke?: string;
25
22
  strokeWidth?: number;
26
23
  tooltipType?: import('../../types').TooltipType;
27
- transition?: import('motion-v/es').AnimationOptions;
24
+ transition?: import('motion-v').AnimationOptions;
28
25
  type?: import('../..').CurveType;
29
26
  unit?: string | number;
30
27
  xAxisId?: import('../../types/axis').AxisId;
@@ -33,11 +30,8 @@ export declare const Line: import('vue').DefineComponent<{
33
30
  }, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
34
31
  activeDot?: any;
35
32
  animateNewValues?: boolean;
36
- animationBegin?: number;
37
- animationDuration?: import('../../types').AnimationDuration;
38
- animationEasing?: import('../../types/bar').AnimationEasing;
39
33
  animationId?: string;
40
- className?: string;
34
+ class?: import('../../types').VueClassValue;
41
35
  connectNulls?: boolean;
42
36
  data?: any[];
43
37
  dataKey: import('../../types').DataKey<any>;
@@ -54,7 +48,7 @@ export declare const Line: import('vue').DefineComponent<{
54
48
  stroke?: string;
55
49
  strokeWidth?: number;
56
50
  tooltipType?: import('../../types').TooltipType;
57
- transition?: import('motion-v/es').AnimationOptions;
51
+ transition?: import('motion-v').AnimationOptions;
58
52
  type?: import('../..').CurveType;
59
53
  unit?: string | number;
60
54
  xAxisId?: import('../../types/axis').AxisId;
@@ -67,15 +61,15 @@ export declare const Line: import('vue').DefineComponent<{
67
61
  height: number;
68
62
  yAxisId: import('../../types/axis').AxisId;
69
63
  xAxisId: import('../../types/axis').AxisId;
64
+ class: import('../../types').VueClassValue;
70
65
  stroke: string;
66
+ strokeWidth: number;
67
+ transition: import('motion-v').AnimationOptions;
71
68
  data: unknown[];
72
69
  connectNulls: boolean;
73
- strokeWidth: number;
74
70
  hide: boolean;
75
- transition: import('motion-v/es').AnimationOptions;
76
71
  legendType: import('../../types/legend').LegendType;
77
72
  isAnimationActive: boolean;
78
- animationBegin: number;
79
73
  needClip: boolean;
80
74
  activeDot: boolean | Function | Record<string, any>;
81
75
  dot: boolean | Function | Record<string, any>;
@@ -1,6 +1,5 @@
1
- import { AnimationDuration, DataKey, LayoutType, TooltipType, VuePropsToType, WithSVGProps } from '../../types';
1
+ import { DataKey, LayoutType, TooltipType, VueClassValue, VuePropsToType, WithSVGProps } from '../../types';
2
2
  import { AxisId } from '../../types/axis';
3
- import { AnimationEasing } from '../../types/bar';
4
3
  import { AnimationOptions } from 'motion-v';
5
4
  import { LegendType } from '../../types/legend';
6
5
  import { CurveFactory } from 'victory-vendor/d3-shape';
@@ -13,11 +12,8 @@ export interface LinePointItem extends Point {
13
12
  export interface LineProps {
14
13
  activeDot?: any;
15
14
  animateNewValues?: boolean;
16
- animationBegin?: number;
17
- animationDuration?: AnimationDuration;
18
- animationEasing?: AnimationEasing;
19
15
  animationId?: string;
20
- className?: string;
16
+ class?: VueClassValue;
21
17
  connectNulls?: boolean;
22
18
  data?: any[];
23
19
  dataKey: DataKey<any>;
@@ -46,16 +42,6 @@ export declare const LineVueProps: {
46
42
  type: (ObjectConstructor | FunctionConstructor | BooleanConstructor)[];
47
43
  default: boolean;
48
44
  };
49
- animationDuration: {
50
- type: NumberConstructor;
51
- };
52
- animationEasing: {
53
- type: StringConstructor;
54
- };
55
- animationBegin: {
56
- type: NumberConstructor;
57
- default: number;
58
- };
59
45
  animationId: {
60
46
  type: StringConstructor;
61
47
  };
@@ -161,7 +147,8 @@ export declare const LineVueProps: {
161
147
  type: (NumberConstructor | StringConstructor)[];
162
148
  };
163
149
  class: {
164
- type: StringConstructor;
150
+ type: PropType<VueClassValue>;
151
+ default: any;
165
152
  };
166
153
  layout: {
167
154
  type: PropType<LayoutType>;
@@ -50,14 +50,14 @@ export declare const ReferenceAreaVueProps: {
50
50
  type: PropType<IfOverflow>;
51
51
  default: string;
52
52
  };
53
- className: {
54
- type: StringConstructor;
55
- default: any;
56
- };
57
53
  radius: {
58
54
  type: PropType<number | [number, number, number, number]>;
59
55
  default: number;
60
56
  };
57
+ class: {
58
+ type: PropType<import('../../types').VueClassValue>;
59
+ default: any;
60
+ };
61
61
  };
62
62
  export declare const ReferenceArea: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
63
63
  x1: {
@@ -108,14 +108,14 @@ export declare const ReferenceArea: import('vue').DefineComponent<import('vue').
108
108
  type: PropType<IfOverflow>;
109
109
  default: string;
110
110
  };
111
- className: {
112
- type: StringConstructor;
113
- default: any;
114
- };
115
111
  radius: {
116
112
  type: PropType<number | [number, number, number, number]>;
117
113
  default: number;
118
114
  };
115
+ class: {
116
+ type: PropType<import('../../types').VueClassValue>;
117
+ default: any;
118
+ };
119
119
  }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
120
120
  x1: {
121
121
  type: PropType<number | string>;
@@ -165,14 +165,14 @@ export declare const ReferenceArea: import('vue').DefineComponent<import('vue').
165
165
  type: PropType<IfOverflow>;
166
166
  default: string;
167
167
  };
168
- className: {
169
- type: StringConstructor;
170
- default: any;
171
- };
172
168
  radius: {
173
169
  type: PropType<number | [number, number, number, number]>;
174
170
  default: number;
175
171
  };
172
+ class: {
173
+ type: PropType<import('../../types').VueClassValue>;
174
+ default: any;
175
+ };
176
176
  }>> & Readonly<{}>, {
177
177
  fill: string;
178
178
  yAxisId: AxisId;
@@ -182,10 +182,10 @@ export declare const ReferenceArea: import('vue').DefineComponent<import('vue').
182
182
  x2: string | number;
183
183
  y1: string | number;
184
184
  y2: string | number;
185
- radius: number | [number, number, number, number];
185
+ class: import('../../types').VueClassValue;
186
+ fillOpacity: number;
186
187
  stroke: string;
187
- label: string | number | boolean | Record<string, any>;
188
- className: string;
189
188
  strokeWidth: string | number;
190
- fillOpacity: number;
189
+ radius: number | [number, number, number, number];
190
+ label: string | number | boolean | Record<string, any>;
191
191
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;