@visactor/openinula-vchart 1.10.2-alpha.2

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 (308) hide show
  1. package/README.md +54 -0
  2. package/cjs/VChart.js +17 -0
  3. package/cjs/VChart.js.map +1 -0
  4. package/cjs/VChartSimple.js +10 -0
  5. package/cjs/VChartSimple.js.map +1 -0
  6. package/cjs/charts/AreaChart.js +19 -0
  7. package/cjs/charts/AreaChart.js.map +1 -0
  8. package/cjs/charts/BarChart.js +19 -0
  9. package/cjs/charts/BarChart.js.map +1 -0
  10. package/cjs/charts/BaseChart.d.ts +26 -0
  11. package/cjs/charts/BaseChart.js +125 -0
  12. package/cjs/charts/BaseChart.js.map +1 -0
  13. package/cjs/charts/BoxPlotChart.js +19 -0
  14. package/cjs/charts/BoxPlotChart.js.map +1 -0
  15. package/cjs/charts/CircularProgressChart.js +19 -0
  16. package/cjs/charts/CircularProgressChart.js.map +1 -0
  17. package/cjs/charts/CommonChart.js +19 -0
  18. package/cjs/charts/CommonChart.js.map +1 -0
  19. package/cjs/charts/FunnelChart.js +19 -0
  20. package/cjs/charts/FunnelChart.js.map +1 -0
  21. package/cjs/charts/HistogramChart.js +19 -0
  22. package/cjs/charts/HistogramChart.js.map +1 -0
  23. package/cjs/charts/LineChart.js +19 -0
  24. package/cjs/charts/LineChart.js.map +1 -0
  25. package/cjs/charts/LinearProgressChart.js +19 -0
  26. package/cjs/charts/LinearProgressChart.js.map +1 -0
  27. package/cjs/charts/MapChart.js +19 -0
  28. package/cjs/charts/MapChart.js.map +1 -0
  29. package/cjs/charts/PieChart.js +19 -0
  30. package/cjs/charts/PieChart.js.map +1 -0
  31. package/cjs/charts/RadarChart.js +19 -0
  32. package/cjs/charts/RadarChart.js.map +1 -0
  33. package/cjs/charts/RangeColumnChart.js +19 -0
  34. package/cjs/charts/RangeColumnChart.js.map +1 -0
  35. package/cjs/charts/RoseChart.js +18 -0
  36. package/cjs/charts/RoseChart.js.map +1 -0
  37. package/cjs/charts/ScatterChart.js +19 -0
  38. package/cjs/charts/ScatterChart.js.map +1 -0
  39. package/cjs/charts/SequenceChart.js +19 -0
  40. package/cjs/charts/SequenceChart.js.map +1 -0
  41. package/cjs/charts/WordCloudChart.js +19 -0
  42. package/cjs/charts/WordCloudChart.js.map +1 -0
  43. package/cjs/charts/index.d.ts +18 -0
  44. package/cjs/charts/index.js +28 -0
  45. package/cjs/charts/index.js.map +1 -0
  46. package/cjs/components/Axis.js +10 -0
  47. package/cjs/components/Axis.js.map +1 -0
  48. package/cjs/components/BaseComponent.js +55 -0
  49. package/cjs/components/BaseComponent.js.map +1 -0
  50. package/cjs/components/Brush.js +10 -0
  51. package/cjs/components/Brush.js.map +1 -0
  52. package/cjs/components/Crosshair.js +10 -0
  53. package/cjs/components/Crosshair.js.map +1 -0
  54. package/cjs/components/DataZoom.js +10 -0
  55. package/cjs/components/DataZoom.js.map +1 -0
  56. package/cjs/components/Indicator.js +10 -0
  57. package/cjs/components/Indicator.js.map +1 -0
  58. package/cjs/components/Legend.js +10 -0
  59. package/cjs/components/Legend.js.map +1 -0
  60. package/cjs/components/Mark.js +10 -0
  61. package/cjs/components/Mark.js.map +1 -0
  62. package/cjs/components/MarkArea.js +10 -0
  63. package/cjs/components/MarkArea.js.map +1 -0
  64. package/cjs/components/MarkLine.js +10 -0
  65. package/cjs/components/MarkLine.js.map +1 -0
  66. package/cjs/components/MarkPoint.js +10 -0
  67. package/cjs/components/MarkPoint.js.map +1 -0
  68. package/cjs/components/Player.js +10 -0
  69. package/cjs/components/Player.js.map +1 -0
  70. package/cjs/components/Region.js +9 -0
  71. package/cjs/components/Region.js.map +1 -0
  72. package/cjs/components/ScrollBar.js +10 -0
  73. package/cjs/components/ScrollBar.js.map +1 -0
  74. package/cjs/components/Title.js +10 -0
  75. package/cjs/components/Title.js.map +1 -0
  76. package/cjs/components/index.d.ts +15 -0
  77. package/cjs/components/index.js +28 -0
  78. package/cjs/components/index.js.map +1 -0
  79. package/cjs/components/tooltip/Tooltip.js +10 -0
  80. package/cjs/components/tooltip/Tooltip.js.map +1 -0
  81. package/cjs/components/tooltip/constant.d.ts +1 -0
  82. package/cjs/components/tooltip/constant.js +10 -0
  83. package/cjs/components/tooltip/constant.js.map +1 -0
  84. package/cjs/components/tooltip/index.d.ts +3 -0
  85. package/cjs/components/tooltip/index.js +22 -0
  86. package/cjs/components/tooltip/index.js.map +1 -0
  87. package/cjs/components/tooltip/interface.d.ts +14 -0
  88. package/cjs/components/tooltip/interface.js +6 -0
  89. package/cjs/components/tooltip/interface.js.map +1 -0
  90. package/cjs/components/tooltip/util.d.ts +4 -0
  91. package/cjs/components/tooltip/util.js +47 -0
  92. package/cjs/components/tooltip/util.js.map +1 -0
  93. package/cjs/constants.d.ts +1 -0
  94. package/cjs/constants.js +6 -0
  95. package/cjs/constants.js.map +1 -0
  96. package/cjs/containers/withContainer.d.ts +11 -0
  97. package/cjs/containers/withContainer.js +64 -0
  98. package/cjs/containers/withContainer.js.map +1 -0
  99. package/cjs/context/chart.d.ts +13 -0
  100. package/cjs/context/chart.js +25 -0
  101. package/cjs/context/chart.js.map +1 -0
  102. package/cjs/context/stage.d.ts +9 -0
  103. package/cjs/context/stage.js +24 -0
  104. package/cjs/context/stage.js.map +1 -0
  105. package/cjs/context/view.d.ts +9 -0
  106. package/cjs/context/view.js +24 -0
  107. package/cjs/context/view.js.map +1 -0
  108. package/cjs/eventsUtils.d.ts +256 -0
  109. package/cjs/eventsUtils.js +114 -0
  110. package/cjs/eventsUtils.js.map +1 -0
  111. package/cjs/index.d.ts +7 -0
  112. package/cjs/index.js +23 -0
  113. package/cjs/index.js.map +1 -0
  114. package/cjs/series/Area.js +10 -0
  115. package/cjs/series/Area.js.map +1 -0
  116. package/cjs/series/Bar.js +10 -0
  117. package/cjs/series/Bar.js.map +1 -0
  118. package/cjs/series/BaseSeries.js +51 -0
  119. package/cjs/series/BaseSeries.js.map +1 -0
  120. package/cjs/series/BoxPlot.js +10 -0
  121. package/cjs/series/BoxPlot.js.map +1 -0
  122. package/cjs/series/CircularProgress.js +10 -0
  123. package/cjs/series/CircularProgress.js.map +1 -0
  124. package/cjs/series/Dot.js +10 -0
  125. package/cjs/series/Dot.js.map +1 -0
  126. package/cjs/series/Funnel.js +10 -0
  127. package/cjs/series/Funnel.js.map +1 -0
  128. package/cjs/series/Line.js +10 -0
  129. package/cjs/series/Line.js.map +1 -0
  130. package/cjs/series/LinearProgress.js +10 -0
  131. package/cjs/series/LinearProgress.js.map +1 -0
  132. package/cjs/series/Link.js +9 -0
  133. package/cjs/series/Link.js.map +1 -0
  134. package/cjs/series/Map.js +10 -0
  135. package/cjs/series/Map.js.map +1 -0
  136. package/cjs/series/Pie.js +10 -0
  137. package/cjs/series/Pie.js.map +1 -0
  138. package/cjs/series/Radar.js +10 -0
  139. package/cjs/series/Radar.js.map +1 -0
  140. package/cjs/series/RangeColumn.js +10 -0
  141. package/cjs/series/RangeColumn.js.map +1 -0
  142. package/cjs/series/Rose.js +10 -0
  143. package/cjs/series/Rose.js.map +1 -0
  144. package/cjs/series/Scatter.js +10 -0
  145. package/cjs/series/Scatter.js.map +1 -0
  146. package/cjs/series/Series.js +10 -0
  147. package/cjs/series/Series.js.map +1 -0
  148. package/cjs/series/WordCloud.js +10 -0
  149. package/cjs/series/WordCloud.js.map +1 -0
  150. package/cjs/series/index.d.ts +17 -0
  151. package/cjs/series/index.js +29 -0
  152. package/cjs/series/index.js.map +1 -0
  153. package/cjs/util.js +57 -0
  154. package/cjs/util.js.map +1 -0
  155. package/esm/VChart.js +9 -0
  156. package/esm/VChart.js.map +1 -0
  157. package/esm/VChartSimple.js +4 -0
  158. package/esm/VChartSimple.js.map +1 -0
  159. package/esm/charts/AreaChart.js +9 -0
  160. package/esm/charts/AreaChart.js.map +1 -0
  161. package/esm/charts/BarChart.js +9 -0
  162. package/esm/charts/BarChart.js.map +1 -0
  163. package/esm/charts/BaseChart.d.ts +26 -0
  164. package/esm/charts/BaseChart.js +104 -0
  165. package/esm/charts/BaseChart.js.map +1 -0
  166. package/esm/charts/BoxPlotChart.js +9 -0
  167. package/esm/charts/BoxPlotChart.js.map +1 -0
  168. package/esm/charts/CircularProgressChart.js +9 -0
  169. package/esm/charts/CircularProgressChart.js.map +1 -0
  170. package/esm/charts/CommonChart.js +9 -0
  171. package/esm/charts/CommonChart.js.map +1 -0
  172. package/esm/charts/FunnelChart.js +9 -0
  173. package/esm/charts/FunnelChart.js.map +1 -0
  174. package/esm/charts/HistogramChart.js +9 -0
  175. package/esm/charts/HistogramChart.js.map +1 -0
  176. package/esm/charts/LineChart.js +9 -0
  177. package/esm/charts/LineChart.js.map +1 -0
  178. package/esm/charts/LinearProgressChart.js +9 -0
  179. package/esm/charts/LinearProgressChart.js.map +1 -0
  180. package/esm/charts/MapChart.js +9 -0
  181. package/esm/charts/MapChart.js.map +1 -0
  182. package/esm/charts/PieChart.js +9 -0
  183. package/esm/charts/PieChart.js.map +1 -0
  184. package/esm/charts/RadarChart.js +9 -0
  185. package/esm/charts/RadarChart.js.map +1 -0
  186. package/esm/charts/RangeColumnChart.js +9 -0
  187. package/esm/charts/RangeColumnChart.js.map +1 -0
  188. package/esm/charts/RoseChart.js +8 -0
  189. package/esm/charts/RoseChart.js.map +1 -0
  190. package/esm/charts/ScatterChart.js +9 -0
  191. package/esm/charts/ScatterChart.js.map +1 -0
  192. package/esm/charts/SequenceChart.js +9 -0
  193. package/esm/charts/SequenceChart.js.map +1 -0
  194. package/esm/charts/WordCloudChart.js +9 -0
  195. package/esm/charts/WordCloudChart.js.map +1 -0
  196. package/esm/charts/index.d.ts +18 -0
  197. package/esm/charts/index.js +32 -0
  198. package/esm/charts/index.js.map +1 -0
  199. package/esm/components/Axis.js +4 -0
  200. package/esm/components/Axis.js.map +1 -0
  201. package/esm/components/BaseComponent.js +26 -0
  202. package/esm/components/BaseComponent.js.map +1 -0
  203. package/esm/components/Brush.js +6 -0
  204. package/esm/components/Brush.js.map +1 -0
  205. package/esm/components/Crosshair.js +4 -0
  206. package/esm/components/Crosshair.js.map +1 -0
  207. package/esm/components/DataZoom.js +6 -0
  208. package/esm/components/DataZoom.js.map +1 -0
  209. package/esm/components/Indicator.js +4 -0
  210. package/esm/components/Indicator.js.map +1 -0
  211. package/esm/components/Legend.js +6 -0
  212. package/esm/components/Legend.js.map +1 -0
  213. package/esm/components/Mark.js +4 -0
  214. package/esm/components/Mark.js.map +1 -0
  215. package/esm/components/MarkArea.js +4 -0
  216. package/esm/components/MarkArea.js.map +1 -0
  217. package/esm/components/MarkLine.js +4 -0
  218. package/esm/components/MarkLine.js.map +1 -0
  219. package/esm/components/MarkPoint.js +4 -0
  220. package/esm/components/MarkPoint.js.map +1 -0
  221. package/esm/components/Player.js +6 -0
  222. package/esm/components/Player.js.map +1 -0
  223. package/esm/components/Region.js +3 -0
  224. package/esm/components/Region.js.map +1 -0
  225. package/esm/components/ScrollBar.js +6 -0
  226. package/esm/components/ScrollBar.js.map +1 -0
  227. package/esm/components/Title.js +4 -0
  228. package/esm/components/Title.js.map +1 -0
  229. package/esm/components/index.d.ts +15 -0
  230. package/esm/components/index.js +30 -0
  231. package/esm/components/index.js.map +1 -0
  232. package/esm/components/tooltip/Tooltip.js +4 -0
  233. package/esm/components/tooltip/Tooltip.js.map +1 -0
  234. package/esm/components/tooltip/constant.d.ts +1 -0
  235. package/esm/components/tooltip/constant.js +4 -0
  236. package/esm/components/tooltip/constant.js.map +1 -0
  237. package/esm/components/tooltip/index.d.ts +3 -0
  238. package/esm/components/tooltip/index.js +6 -0
  239. package/esm/components/tooltip/index.js.map +1 -0
  240. package/esm/components/tooltip/interface.d.ts +14 -0
  241. package/esm/components/tooltip/interface.js +2 -0
  242. package/esm/components/tooltip/interface.js.map +1 -0
  243. package/esm/components/tooltip/util.d.ts +4 -0
  244. package/esm/components/tooltip/util.js +40 -0
  245. package/esm/components/tooltip/util.js.map +1 -0
  246. package/esm/constants.d.ts +1 -0
  247. package/esm/constants.js +2 -0
  248. package/esm/constants.js.map +1 -0
  249. package/esm/containers/withContainer.d.ts +11 -0
  250. package/esm/containers/withContainer.js +33 -0
  251. package/esm/containers/withContainer.js.map +1 -0
  252. package/esm/context/chart.d.ts +13 -0
  253. package/esm/context/chart.js +16 -0
  254. package/esm/context/chart.js.map +1 -0
  255. package/esm/context/stage.d.ts +9 -0
  256. package/esm/context/stage.js +16 -0
  257. package/esm/context/stage.js.map +1 -0
  258. package/esm/context/view.d.ts +9 -0
  259. package/esm/context/view.js +16 -0
  260. package/esm/context/view.js.map +1 -0
  261. package/esm/eventsUtils.d.ts +256 -0
  262. package/esm/eventsUtils.js +126 -0
  263. package/esm/eventsUtils.js.map +1 -0
  264. package/esm/index.d.ts +7 -0
  265. package/esm/index.js +12 -0
  266. package/esm/index.js.map +1 -0
  267. package/esm/series/Area.js +4 -0
  268. package/esm/series/Area.js.map +1 -0
  269. package/esm/series/Bar.js +4 -0
  270. package/esm/series/Bar.js.map +1 -0
  271. package/esm/series/BaseSeries.js +45 -0
  272. package/esm/series/BaseSeries.js.map +1 -0
  273. package/esm/series/BoxPlot.js +4 -0
  274. package/esm/series/BoxPlot.js.map +1 -0
  275. package/esm/series/CircularProgress.js +4 -0
  276. package/esm/series/CircularProgress.js.map +1 -0
  277. package/esm/series/Dot.js +4 -0
  278. package/esm/series/Dot.js.map +1 -0
  279. package/esm/series/Funnel.js +4 -0
  280. package/esm/series/Funnel.js.map +1 -0
  281. package/esm/series/Line.js +4 -0
  282. package/esm/series/Line.js.map +1 -0
  283. package/esm/series/LinearProgress.js +4 -0
  284. package/esm/series/LinearProgress.js.map +1 -0
  285. package/esm/series/Link.js +3 -0
  286. package/esm/series/Link.js.map +1 -0
  287. package/esm/series/Map.js +4 -0
  288. package/esm/series/Map.js.map +1 -0
  289. package/esm/series/Pie.js +4 -0
  290. package/esm/series/Pie.js.map +1 -0
  291. package/esm/series/Radar.js +4 -0
  292. package/esm/series/Radar.js.map +1 -0
  293. package/esm/series/RangeColumn.js +4 -0
  294. package/esm/series/RangeColumn.js.map +1 -0
  295. package/esm/series/Rose.js +4 -0
  296. package/esm/series/Rose.js.map +1 -0
  297. package/esm/series/Scatter.js +4 -0
  298. package/esm/series/Scatter.js.map +1 -0
  299. package/esm/series/Series.js +4 -0
  300. package/esm/series/Series.js.map +1 -0
  301. package/esm/series/WordCloud.js +4 -0
  302. package/esm/series/WordCloud.js.map +1 -0
  303. package/esm/series/index.d.ts +17 -0
  304. package/esm/series/index.js +34 -0
  305. package/esm/series/index.js.map +1 -0
  306. package/esm/util.js +36 -0
  307. package/esm/util.js.map +1 -0
  308. package/package.json +82 -0
@@ -0,0 +1,256 @@
1
+ import type { IVChart, EventCallback, EventParamsDefinition } from '@visactor/vchart';
2
+ export interface LegendEventProps {
3
+ onLegendItemHover?: (e: any) => void;
4
+ onLegendItemUnHover?: (e: any) => void;
5
+ onLegendItemClick?: (e: any) => void;
6
+ onLegendFilter?: (e: any) => void;
7
+ onLegendSelectedDataChange?: (e: any) => void;
8
+ }
9
+ export interface BrushEventProps {
10
+ onBrushStart?: (e: any) => void;
11
+ onBrushChange?: (e: any) => void;
12
+ onBrushEnd?: (e: any) => void;
13
+ }
14
+ export interface DataZoomEventProps {
15
+ onDataZoomChange?: (e: any) => void;
16
+ }
17
+ export interface PlayerEventProps {
18
+ onPlayerPlay?: (e: any) => void;
19
+ onPlayerPause?: (e: any) => void;
20
+ onPlayerEnd?: (e: any) => void;
21
+ onPlayerChange?: (e: any) => void;
22
+ onPlayerForward?: (e: any) => void;
23
+ onPlayerBackward?: (e: any) => void;
24
+ }
25
+ export interface ScrollBarEventProps {
26
+ onScrollBarChange?: (e: any) => void;
27
+ }
28
+ export interface DimensionEventProps {
29
+ onDimensionHover?: (e: any) => void;
30
+ onDimensionClick?: (e: any) => void;
31
+ }
32
+ export interface HierarchyEventProps {
33
+ onDrill?: (e: any) => void;
34
+ }
35
+ export interface ChartLifeCycleEventProps {
36
+ onInitialized?: (e: any) => void;
37
+ onRendered?: (e: any) => void;
38
+ onRenderFinished?: (e: any) => void;
39
+ onAnimationFinished?: (e: any) => void;
40
+ onLayoutStart?: (e: any) => void;
41
+ onLayoutEnd?: (e: any) => void;
42
+ }
43
+ export interface EventsProps {
44
+ onPointerDown?: EventCallback<EventParamsDefinition['pointerdown']>;
45
+ onPointerUp?: EventCallback<EventParamsDefinition['pointerup']>;
46
+ onPointerUpOutside?: EventCallback<EventParamsDefinition['pointerupoutside']>;
47
+ onPointerTap?: EventCallback<EventParamsDefinition['pointertap']>;
48
+ onPointerOver?: EventCallback<EventParamsDefinition['pointerover']>;
49
+ onPointerMove?: EventCallback<EventParamsDefinition['pointermove']>;
50
+ onPointerEnter?: EventCallback<EventParamsDefinition['pointerenter']>;
51
+ onPointerLeave?: EventCallback<EventParamsDefinition['pointerleave']>;
52
+ onPointerOut?: EventCallback<EventParamsDefinition['pointerout']>;
53
+ onMouseDown?: EventCallback<EventParamsDefinition['mousedown']>;
54
+ onMouseUp?: EventCallback<EventParamsDefinition['mouseup']>;
55
+ onMouseUpOutside?: EventCallback<EventParamsDefinition['mouseupoutside']>;
56
+ onMouseMove?: EventCallback<EventParamsDefinition['mousemove']>;
57
+ onMouseOver?: EventCallback<EventParamsDefinition['mouseover']>;
58
+ onMouseOut?: EventCallback<EventParamsDefinition['mouseout']>;
59
+ onMouseEnter?: EventCallback<EventParamsDefinition['mouseenter']>;
60
+ onMouseLeave?: EventCallback<EventParamsDefinition['mouseleave']>;
61
+ onPinch?: EventCallback<EventParamsDefinition['pinch']>;
62
+ onPinchStart?: EventCallback<EventParamsDefinition['pinchstart']>;
63
+ onPinchEnd?: EventCallback<EventParamsDefinition['pinchend']>;
64
+ onPan?: EventCallback<EventParamsDefinition['pan']>;
65
+ onPanStart?: EventCallback<EventParamsDefinition['panstart']>;
66
+ onPanEnd?: EventCallback<EventParamsDefinition['panend']>;
67
+ onDrag?: EventCallback<EventParamsDefinition['drag']>;
68
+ onDragStart?: EventCallback<EventParamsDefinition['dragstart']>;
69
+ onDragEnter?: EventCallback<EventParamsDefinition['dragenter']>;
70
+ onDragLeave?: EventCallback<EventParamsDefinition['dragleave']>;
71
+ onDragOver?: EventCallback<EventParamsDefinition['dragover']>;
72
+ onDragEnd?: EventCallback<EventParamsDefinition['dragend']>;
73
+ onRightDown?: EventCallback<EventParamsDefinition['rightdown']>;
74
+ onRightUp?: EventCallback<EventParamsDefinition['rightup']>;
75
+ onRightUpOutside?: EventCallback<EventParamsDefinition['rightupoutside']>;
76
+ onTouchStart?: EventCallback<EventParamsDefinition['touchstart']>;
77
+ onTouchEnd?: EventCallback<EventParamsDefinition['touchend']>;
78
+ onTouchEndOutside?: EventCallback<EventParamsDefinition['touchendoutside']>;
79
+ onTouchMove?: EventCallback<EventParamsDefinition['touchmove']>;
80
+ onTouchCancel?: EventCallback<EventParamsDefinition['touchcancel']>;
81
+ onPress?: EventCallback<EventParamsDefinition['press']>;
82
+ onPressUp?: EventCallback<EventParamsDefinition['pressup']>;
83
+ onPressEnd?: EventCallback<EventParamsDefinition['pressend']>;
84
+ onSwipe?: EventCallback<EventParamsDefinition['swipe']>;
85
+ onDrop?: EventCallback<EventParamsDefinition['drop']>;
86
+ onWeel?: EventCallback<EventParamsDefinition['weel']>;
87
+ onClick?: EventCallback<EventParamsDefinition['click']>;
88
+ onDblClick?: EventCallback<EventParamsDefinition['dblclick']>;
89
+ }
90
+ export declare const REACT_TO_VCHART_EVENTS: {
91
+ onPointerDown: string;
92
+ onPointerUp: string;
93
+ onPointerUpOutside: string;
94
+ onPointerTap: string;
95
+ onPointerOver: string;
96
+ onPointerMove: string;
97
+ onPointerEnter: string;
98
+ onPointerLeave: string;
99
+ onPointerOut: string;
100
+ onMouseDown: string;
101
+ onMouseUp: string;
102
+ onMouseUpOutside: string;
103
+ onMouseMove: string;
104
+ onMouseOver: string;
105
+ onMouseOut: string;
106
+ onMouseEnter: string;
107
+ onMouseLeave: string;
108
+ onPinch: string;
109
+ onPinchStart: string;
110
+ onPinchEnd: string;
111
+ onPan: string;
112
+ onPanStart: string;
113
+ onPanEnd: string;
114
+ onDrag: string;
115
+ onDragStart: string;
116
+ onDragEnter: string;
117
+ onDragLeave: string;
118
+ onDragOver: string;
119
+ onDragEnd: string;
120
+ onRightDown: string;
121
+ onRightUp: string;
122
+ onRightUpOutside: string;
123
+ onTouchStart: string;
124
+ onTouchEnd: string;
125
+ onTouchEndOutside: string;
126
+ onTouchMove: string;
127
+ onTouchCancel: string;
128
+ onPress: string;
129
+ onPressUp: string;
130
+ onPressEnd: string;
131
+ onSwipe: string;
132
+ onDrop: string;
133
+ onWeel: string;
134
+ onClick: string;
135
+ onDblClick: string;
136
+ };
137
+ export declare const LEGEND_CUSTOMIZED_EVENTS: {
138
+ onLegendItemHover: string;
139
+ onLegendItemUnHover: string;
140
+ onLegendItemClick: string;
141
+ onLegendFilter: string;
142
+ onLegendSelectedDataChange: string;
143
+ };
144
+ export declare const BRUSH_CUSTOMIZED_EVENTS: {
145
+ onBrushStart: string;
146
+ onBrushChange: string;
147
+ onBrushEnd: string;
148
+ onBrushClear: string;
149
+ };
150
+ export declare const DATAZOOM_CUSTOMIZED_EVENTS: {
151
+ onDataZoomChange: string;
152
+ };
153
+ export declare const PLAYER_CUSTOMIZED_EVENTS: {
154
+ onPlayerPlay: string;
155
+ onPlayerPause: string;
156
+ onPlayerEnd: string;
157
+ onPlayerChange: string;
158
+ onPlayerForward: string;
159
+ onPlayerBackward: string;
160
+ };
161
+ export declare const SCROLLBAR_CUSTOMIZED_EVENTS: {
162
+ onScrollBarChange: string;
163
+ };
164
+ export declare const DIMENSION_EVENTS: {
165
+ onDimensionHover: string;
166
+ onDimensionClick: string;
167
+ };
168
+ export declare const HIERARCHY_EVENTS: {
169
+ onDrill: string;
170
+ };
171
+ export declare const CHART_LIFECYCLE_EVENTS: {
172
+ onInitialized: string;
173
+ onRendered: string;
174
+ onRenderFinished: string;
175
+ onAnimationFinished: string;
176
+ onLayoutStart: string;
177
+ onLayoutEnd: string;
178
+ };
179
+ export declare const CHART_EVENTS: {
180
+ onPointerDown: string;
181
+ onPointerUp: string;
182
+ onPointerUpOutside: string;
183
+ onPointerTap: string;
184
+ onPointerOver: string;
185
+ onPointerMove: string;
186
+ onPointerEnter: string;
187
+ onPointerLeave: string;
188
+ onPointerOut: string;
189
+ onMouseDown: string;
190
+ onMouseUp: string;
191
+ onMouseUpOutside: string;
192
+ onMouseMove: string;
193
+ onMouseOver: string;
194
+ onMouseOut: string;
195
+ onMouseEnter: string;
196
+ onMouseLeave: string;
197
+ onPinch: string;
198
+ onPinchStart: string;
199
+ onPinchEnd: string;
200
+ onPan: string;
201
+ onPanStart: string;
202
+ onPanEnd: string;
203
+ onDrag: string;
204
+ onDragStart: string;
205
+ onDragEnter: string;
206
+ onDragLeave: string;
207
+ onDragOver: string;
208
+ onDragEnd: string;
209
+ onRightDown: string;
210
+ onRightUp: string;
211
+ onRightUpOutside: string;
212
+ onTouchStart: string;
213
+ onTouchEnd: string;
214
+ onTouchEndOutside: string;
215
+ onTouchMove: string;
216
+ onTouchCancel: string;
217
+ onPress: string;
218
+ onPressUp: string;
219
+ onPressEnd: string;
220
+ onSwipe: string;
221
+ onDrop: string;
222
+ onWeel: string;
223
+ onClick: string;
224
+ onDblClick: string;
225
+ onDrill: string;
226
+ onInitialized: string;
227
+ onRendered: string;
228
+ onRenderFinished: string;
229
+ onAnimationFinished: string;
230
+ onLayoutStart: string;
231
+ onLayoutEnd: string;
232
+ onDimensionHover: string;
233
+ onDimensionClick: string;
234
+ onScrollBarChange: string;
235
+ onDataZoomChange: string;
236
+ onPlayerPlay: string;
237
+ onPlayerPause: string;
238
+ onPlayerEnd: string;
239
+ onPlayerChange: string;
240
+ onPlayerForward: string;
241
+ onPlayerBackward: string;
242
+ onBrushStart: string;
243
+ onBrushChange: string;
244
+ onBrushEnd: string;
245
+ onBrushClear: string;
246
+ onLegendItemHover: string;
247
+ onLegendItemUnHover: string;
248
+ onLegendItemClick: string;
249
+ onLegendFilter: string;
250
+ onLegendSelectedDataChange: string;
251
+ };
252
+ export declare const CHART_EVENTS_KEYS: string[];
253
+ export declare const COMMON_EVENTK_KEYS: string[];
254
+ export declare const VCHART_TO_REACT_EVENTS: {};
255
+ export declare const findEventProps: <T extends EventsProps>(props: T, supportedEvents?: Record<string, string>) => EventsProps;
256
+ export declare const bindEventsToChart: <T>(chart: IVChart, newProps?: T, prevProps?: T, supportedEvents?: Record<string, string>) => boolean;
@@ -0,0 +1,126 @@
1
+ export const REACT_TO_VCHART_EVENTS = {
2
+ onPointerDown: "pointerdown",
3
+ onPointerUp: "pointerup",
4
+ onPointerUpOutside: "pointerupoutside",
5
+ onPointerTap: "pointertap",
6
+ onPointerOver: "pointerover",
7
+ onPointerMove: "pointermove",
8
+ onPointerEnter: "pointerenter",
9
+ onPointerLeave: "pointerleave",
10
+ onPointerOut: "pointerout",
11
+ onMouseDown: "mousedown",
12
+ onMouseUp: "mouseup",
13
+ onMouseUpOutside: "mouseupoutside",
14
+ onMouseMove: "mousemove",
15
+ onMouseOver: "mouseover",
16
+ onMouseOut: "mouseout",
17
+ onMouseEnter: "mouseenter",
18
+ onMouseLeave: "mouseleave",
19
+ onPinch: "pinch",
20
+ onPinchStart: "pinchstart",
21
+ onPinchEnd: "pinchend",
22
+ onPan: "pan",
23
+ onPanStart: "panstart",
24
+ onPanEnd: "panend",
25
+ onDrag: "drag",
26
+ onDragStart: "dragstart",
27
+ onDragEnter: "dragenter",
28
+ onDragLeave: "dragleave",
29
+ onDragOver: "dragover",
30
+ onDragEnd: "dragend",
31
+ onRightDown: "rightdown",
32
+ onRightUp: "rightup",
33
+ onRightUpOutside: "rightupoutside",
34
+ onTouchStart: "touchstart",
35
+ onTouchEnd: "touchend",
36
+ onTouchEndOutside: "touchendoutside",
37
+ onTouchMove: "touchmove",
38
+ onTouchCancel: "touchcancel",
39
+ onPress: "press",
40
+ onPressUp: "pressup",
41
+ onPressEnd: "pressend",
42
+ onSwipe: "swipe",
43
+ onDrop: "drop",
44
+ onWeel: "wheel",
45
+ onClick: "click",
46
+ onDblClick: "dblclick"
47
+ };
48
+
49
+ export const LEGEND_CUSTOMIZED_EVENTS = {
50
+ onLegendItemHover: "legendItemHover",
51
+ onLegendItemUnHover: "legendItemUnHover",
52
+ onLegendItemClick: "legendItemClick",
53
+ onLegendFilter: "legendFilter",
54
+ onLegendSelectedDataChange: "legendSelectedDataChange"
55
+ };
56
+
57
+ export const BRUSH_CUSTOMIZED_EVENTS = {
58
+ onBrushStart: "brushStart",
59
+ onBrushChange: "brushChange",
60
+ onBrushEnd: "brushEnd",
61
+ onBrushClear: "brushClear"
62
+ };
63
+
64
+ export const DATAZOOM_CUSTOMIZED_EVENTS = {
65
+ onDataZoomChange: "dataZoomChange"
66
+ };
67
+
68
+ export const PLAYER_CUSTOMIZED_EVENTS = {
69
+ onPlayerPlay: "playerPlay",
70
+ onPlayerPause: "playerPause",
71
+ onPlayerEnd: "playerEnd",
72
+ onPlayerChange: "playerChange",
73
+ onPlayerForward: "playerForward",
74
+ onPlayerBackward: "playerBackward"
75
+ };
76
+
77
+ export const SCROLLBAR_CUSTOMIZED_EVENTS = {
78
+ onScrollBarChange: "scrollBarChange"
79
+ };
80
+
81
+ export const DIMENSION_EVENTS = {
82
+ onDimensionHover: "dimensionHover",
83
+ onDimensionClick: "dimensionClick"
84
+ };
85
+
86
+ export const HIERARCHY_EVENTS = {
87
+ onDrill: "drill"
88
+ };
89
+
90
+ export const CHART_LIFECYCLE_EVENTS = {
91
+ onInitialized: "initialized",
92
+ onRendered: "rendered",
93
+ onRenderFinished: "renderFinished",
94
+ onAnimationFinished: "animationFinished",
95
+ onLayoutStart: "layoutStart",
96
+ onLayoutEnd: "layoutEnd"
97
+ };
98
+
99
+ export const CHART_EVENTS = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, LEGEND_CUSTOMIZED_EVENTS), BRUSH_CUSTOMIZED_EVENTS), PLAYER_CUSTOMIZED_EVENTS), DATAZOOM_CUSTOMIZED_EVENTS), SCROLLBAR_CUSTOMIZED_EVENTS), DIMENSION_EVENTS), CHART_LIFECYCLE_EVENTS), HIERARCHY_EVENTS), REACT_TO_VCHART_EVENTS);
100
+
101
+ export const CHART_EVENTS_KEYS = Object.keys(CHART_EVENTS);
102
+
103
+ export const COMMON_EVENTK_KEYS = Object.keys(REACT_TO_VCHART_EVENTS);
104
+
105
+ export const VCHART_TO_REACT_EVENTS = Object.keys(REACT_TO_VCHART_EVENTS).reduce(((res, key) => (res[REACT_TO_VCHART_EVENTS[key]] = key,
106
+ res)), {});
107
+
108
+ export const findEventProps = (props, supportedEvents = REACT_TO_VCHART_EVENTS) => {
109
+ const result = {};
110
+ return Object.keys(props).forEach((key => {
111
+ supportedEvents[key] && props[key] && (result[key] = props[key]);
112
+ })), result;
113
+ };
114
+
115
+ export const bindEventsToChart = (chart, newProps, prevProps, supportedEvents = REACT_TO_VCHART_EVENTS) => {
116
+ if (!newProps && !prevProps || !chart) return !1;
117
+ const prevEventProps = prevProps ? findEventProps(prevProps, supportedEvents) : null, newEventProps = newProps ? findEventProps(newProps, supportedEvents) : null;
118
+ return prevEventProps && Object.keys(prevEventProps).forEach((eventKey => {
119
+ if (!newEventProps || !newEventProps[eventKey] || newEventProps[eventKey] !== prevEventProps[eventKey]) {
120
+ chart.off(supportedEvents[eventKey], prevProps[eventKey]);
121
+ }
122
+ })), newEventProps && Object.keys(newEventProps).forEach((eventKey => {
123
+ prevEventProps && prevEventProps[eventKey] && prevEventProps[eventKey] === newEventProps[eventKey] || chart.on(supportedEvents[eventKey], newEventProps[eventKey]);
124
+ })), !0;
125
+ };
126
+ //# sourceMappingURL=eventsUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/eventsUtils.ts"],"names":[],"mappings":"AAmGA,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,aAAa,EAAE,aAAa;IAC5B,WAAW,EAAE,WAAW;IACxB,kBAAkB,EAAE,kBAAkB;IACtC,YAAY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AAE;YAC7C,IAAI,CAAC,aAAa,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,aAAa,CAAC,QAAQ,CAAC,KAAK,cAAc,CAAC,QAAQ,CAAC,EAAE;gBACtG,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;aACvE;QACH,CAAC,CAAC,CAAC;KACJ;IAED,IAAI,aAAa,EAAE;QACjB,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAC5C,IAAI,CAAC,cAAc,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,cAAc,CAAC,QAAQ,CAAC,KAAK,aAAa,CAAC,QAAQ,CAAC,EAAE;gBACxG,KAAK,CAAC,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;aAC9D;QACH,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","file":"eventsUtils.js","sourcesContent":["import type { IVChart, EventCallback, EventParamsDefinition } from '@visactor/vchart';\n\nexport interface LegendEventProps {\n onLegendItemHover?: (e: any) => void;\n onLegendItemUnHover?: (e: any) => void;\n onLegendItemClick?: (e: any) => void;\n onLegendFilter?: (e: any) => void;\n onLegendSelectedDataChange?: (e: any) => void;\n}\n\nexport interface BrushEventProps {\n onBrushStart?: (e: any) => void;\n onBrushChange?: (e: any) => void;\n onBrushEnd?: (e: any) => void;\n}\n\nexport interface DataZoomEventProps {\n onDataZoomChange?: (e: any) => void;\n}\n\nexport interface PlayerEventProps {\n onPlayerPlay?: (e: any) => void;\n onPlayerPause?: (e: any) => void;\n onPlayerEnd?: (e: any) => void;\n onPlayerChange?: (e: any) => void;\n onPlayerForward?: (e: any) => void;\n onPlayerBackward?: (e: any) => void;\n}\n\nexport interface ScrollBarEventProps {\n onScrollBarChange?: (e: any) => void;\n}\n\nexport interface DimensionEventProps {\n onDimensionHover?: (e: any) => void;\n onDimensionClick?: (e: any) => void;\n}\n\nexport interface HierarchyEventProps {\n onDrill?: (e: any) => void;\n}\n\nexport interface ChartLifeCycleEventProps {\n onInitialized?: (e: any) => void;\n onRendered?: (e: any) => void;\n onRenderFinished?: (e: any) => void;\n onAnimationFinished?: (e: any) => void;\n onLayoutStart?: (e: any) => void;\n onLayoutEnd?: (e: any) => void;\n}\n\nexport interface EventsProps {\n onPointerDown?: EventCallback<EventParamsDefinition['pointerdown']>;\n onPointerUp?: EventCallback<EventParamsDefinition['pointerup']>;\n onPointerUpOutside?: EventCallback<EventParamsDefinition['pointerupoutside']>;\n onPointerTap?: EventCallback<EventParamsDefinition['pointertap']>;\n onPointerOver?: EventCallback<EventParamsDefinition['pointerover']>;\n onPointerMove?: EventCallback<EventParamsDefinition['pointermove']>;\n onPointerEnter?: EventCallback<EventParamsDefinition['pointerenter']>;\n onPointerLeave?: EventCallback<EventParamsDefinition['pointerleave']>;\n onPointerOut?: EventCallback<EventParamsDefinition['pointerout']>;\n onMouseDown?: EventCallback<EventParamsDefinition['mousedown']>;\n onMouseUp?: EventCallback<EventParamsDefinition['mouseup']>;\n onMouseUpOutside?: EventCallback<EventParamsDefinition['mouseupoutside']>;\n onMouseMove?: EventCallback<EventParamsDefinition['mousemove']>;\n onMouseOver?: EventCallback<EventParamsDefinition['mouseover']>;\n onMouseOut?: EventCallback<EventParamsDefinition['mouseout']>;\n onMouseEnter?: EventCallback<EventParamsDefinition['mouseenter']>;\n onMouseLeave?: EventCallback<EventParamsDefinition['mouseleave']>;\n onPinch?: EventCallback<EventParamsDefinition['pinch']>;\n onPinchStart?: EventCallback<EventParamsDefinition['pinchstart']>;\n onPinchEnd?: EventCallback<EventParamsDefinition['pinchend']>;\n onPan?: EventCallback<EventParamsDefinition['pan']>;\n onPanStart?: EventCallback<EventParamsDefinition['panstart']>;\n onPanEnd?: EventCallback<EventParamsDefinition['panend']>;\n onDrag?: EventCallback<EventParamsDefinition['drag']>;\n onDragStart?: EventCallback<EventParamsDefinition['dragstart']>;\n onDragEnter?: EventCallback<EventParamsDefinition['dragenter']>;\n onDragLeave?: EventCallback<EventParamsDefinition['dragleave']>;\n onDragOver?: EventCallback<EventParamsDefinition['dragover']>;\n onDragEnd?: EventCallback<EventParamsDefinition['dragend']>;\n onRightDown?: EventCallback<EventParamsDefinition['rightdown']>;\n onRightUp?: EventCallback<EventParamsDefinition['rightup']>;\n onRightUpOutside?: EventCallback<EventParamsDefinition['rightupoutside']>;\n onTouchStart?: EventCallback<EventParamsDefinition['touchstart']>;\n onTouchEnd?: EventCallback<EventParamsDefinition['touchend']>;\n onTouchEndOutside?: EventCallback<EventParamsDefinition['touchendoutside']>;\n onTouchMove?: EventCallback<EventParamsDefinition['touchmove']>;\n onTouchCancel?: EventCallback<EventParamsDefinition['touchcancel']>;\n onPress?: EventCallback<EventParamsDefinition['press']>;\n onPressUp?: EventCallback<EventParamsDefinition['pressup']>;\n onPressEnd?: EventCallback<EventParamsDefinition['pressend']>;\n onSwipe?: EventCallback<EventParamsDefinition['swipe']>;\n onDrop?: EventCallback<EventParamsDefinition['drop']>;\n onWeel?: EventCallback<EventParamsDefinition['weel']>;\n onClick?: EventCallback<EventParamsDefinition['click']>;\n onDblClick?: EventCallback<EventParamsDefinition['dblclick']>;\n}\n\nexport const REACT_TO_VCHART_EVENTS = {\n onPointerDown: 'pointerdown',\n onPointerUp: 'pointerup',\n onPointerUpOutside: 'pointerupoutside',\n onPointerTap: 'pointertap',\n onPointerOver: 'pointerover',\n onPointerMove: 'pointermove',\n onPointerEnter: 'pointerenter',\n onPointerLeave: 'pointerleave',\n onPointerOut: 'pointerout',\n onMouseDown: 'mousedown',\n onMouseUp: 'mouseup',\n onMouseUpOutside: 'mouseupoutside',\n onMouseMove: 'mousemove',\n onMouseOver: 'mouseover',\n onMouseOut: 'mouseout',\n onMouseEnter: 'mouseenter',\n onMouseLeave: 'mouseleave',\n onPinch: 'pinch',\n onPinchStart: 'pinchstart',\n onPinchEnd: 'pinchend',\n onPan: 'pan',\n onPanStart: 'panstart',\n onPanEnd: 'panend',\n onDrag: 'drag',\n onDragStart: 'dragstart',\n onDragEnter: 'dragenter',\n onDragLeave: 'dragleave',\n onDragOver: 'dragover',\n onDragEnd: 'dragend',\n onRightDown: 'rightdown',\n onRightUp: 'rightup',\n onRightUpOutside: 'rightupoutside',\n onTouchStart: 'touchstart',\n onTouchEnd: 'touchend',\n onTouchEndOutside: 'touchendoutside',\n onTouchMove: 'touchmove',\n onTouchCancel: 'touchcancel',\n onPress: 'press',\n onPressUp: 'pressup',\n onPressEnd: 'pressend',\n onSwipe: 'swipe',\n onDrop: 'drop',\n onWeel: 'wheel',\n onClick: 'click',\n onDblClick: 'dblclick'\n};\n\nexport const LEGEND_CUSTOMIZED_EVENTS = {\n onLegendItemHover: 'legendItemHover',\n onLegendItemUnHover: 'legendItemUnHover',\n onLegendItemClick: 'legendItemClick',\n onLegendFilter: 'legendFilter',\n onLegendSelectedDataChange: 'legendSelectedDataChange'\n};\nexport const BRUSH_CUSTOMIZED_EVENTS = {\n onBrushStart: 'brushStart',\n onBrushChange: 'brushChange',\n onBrushEnd: 'brushEnd',\n onBrushClear: 'brushClear'\n};\n\nexport const DATAZOOM_CUSTOMIZED_EVENTS = {\n onDataZoomChange: 'dataZoomChange'\n};\n\nexport const PLAYER_CUSTOMIZED_EVENTS = {\n onPlayerPlay: 'playerPlay',\n onPlayerPause: 'playerPause',\n onPlayerEnd: 'playerEnd',\n onPlayerChange: 'playerChange',\n onPlayerForward: 'playerForward',\n onPlayerBackward: 'playerBackward'\n};\n\nexport const SCROLLBAR_CUSTOMIZED_EVENTS = {\n onScrollBarChange: 'scrollBarChange'\n};\n\nexport const DIMENSION_EVENTS = {\n onDimensionHover: 'dimensionHover',\n onDimensionClick: 'dimensionClick'\n};\n\nexport const HIERARCHY_EVENTS = {\n onDrill: 'drill'\n};\n\nexport const CHART_LIFECYCLE_EVENTS = {\n onInitialized: 'initialized',\n onRendered: 'rendered',\n onRenderFinished: 'renderFinished',\n onAnimationFinished: 'animationFinished',\n onLayoutStart: 'layoutStart',\n onLayoutEnd: 'layoutEnd'\n};\n\nexport const CHART_EVENTS = {\n ...LEGEND_CUSTOMIZED_EVENTS,\n ...BRUSH_CUSTOMIZED_EVENTS,\n ...PLAYER_CUSTOMIZED_EVENTS,\n ...DATAZOOM_CUSTOMIZED_EVENTS,\n ...SCROLLBAR_CUSTOMIZED_EVENTS,\n ...DIMENSION_EVENTS,\n ...CHART_LIFECYCLE_EVENTS,\n ...HIERARCHY_EVENTS,\n ...REACT_TO_VCHART_EVENTS\n};\n\nexport const CHART_EVENTS_KEYS = Object.keys(CHART_EVENTS);\n\nexport const COMMON_EVENTK_KEYS = Object.keys(REACT_TO_VCHART_EVENTS);\n\nexport const VCHART_TO_REACT_EVENTS = Object.keys(REACT_TO_VCHART_EVENTS).reduce((res, key) => {\n res[REACT_TO_VCHART_EVENTS[key]] = key;\n\n return res;\n}, {});\n\nexport const findEventProps = <T extends EventsProps>(\n props: T,\n supportedEvents: Record<string, string> = REACT_TO_VCHART_EVENTS\n): EventsProps => {\n const result: EventsProps = {};\n\n Object.keys(props).forEach(key => {\n if (supportedEvents[key] && props[key]) {\n result[key] = props[key];\n }\n });\n\n return result;\n};\n\nexport const bindEventsToChart = <T>(\n chart: IVChart,\n newProps?: T | null,\n prevProps?: T | null,\n supportedEvents: Record<string, string> = REACT_TO_VCHART_EVENTS\n) => {\n if ((!newProps && !prevProps) || !chart) {\n return false;\n }\n\n const prevEventProps = prevProps ? findEventProps(prevProps, supportedEvents) : null;\n const newEventProps = newProps ? findEventProps(newProps, supportedEvents) : null;\n\n if (prevEventProps) {\n Object.keys(prevEventProps).forEach(eventKey => {\n if (!newEventProps || !newEventProps[eventKey] || newEventProps[eventKey] !== prevEventProps[eventKey]) {\n const res = chart.off(supportedEvents[eventKey], prevProps[eventKey]);\n }\n });\n }\n\n if (newEventProps) {\n Object.keys(newEventProps).forEach(eventKey => {\n if (!prevEventProps || !prevEventProps[eventKey] || prevEventProps[eventKey] !== newEventProps[eventKey]) {\n chart.on(supportedEvents[eventKey], newEventProps[eventKey]);\n }\n });\n }\n\n return true;\n};\n"]}
package/esm/index.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export * from './charts';
2
+ export * from './series';
3
+ export * from './components';
4
+ export * from './VChart';
5
+ export * from './VChartSimple';
6
+ export declare const version = "1.10.2-alpha.2";
7
+ export type { IAreaChartSpec, IBarChartSpec, IBar3dChartSpec, IBoxPlotChartSpec, ICirclePackingChartSpec, ICommonChartSpec, IFunnelChartSpec, IFunnel3dChartSpec, IGaugeChartSpec, IHeatmapChartSpec, IHistogramChartSpec, IHistogram3dChartSpec, ILineChartSpec, IMapChartSpec, IPieChartSpec, IPie3dChartSpec, ICircularProgressChartSpec, ILinearProgressChartSpec, IRadarChartSpec, IRangeColumnChartSpec, IRangeColumn3dChartSpec, IRangeAreaChartSpec, IRoseChartSpec, IScatterChartSpec, ISankeyChartSpec, ISequenceChartSpec, ISunburstChartSpec, ITreemapChartSpec, IWaterfallChartSpec, ICorrelationChartSpec, ILiquidChartSpec, IWordCloud3dChartSpec, IWordCloudChartSpec, IPolarChartSpec, ICartesianChartSpec, ITheme, IInitOption, ISpec, IVChart } from '@visactor/vchart';
package/esm/index.js ADDED
@@ -0,0 +1,12 @@
1
+ export * from "./charts";
2
+
3
+ export * from "./series";
4
+
5
+ export * from "./components";
6
+
7
+ export * from "./VChart";
8
+
9
+ export * from "./VChartSimple";
10
+
11
+ export const version = "1.10.2-alpha.2";
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAG/B,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC","file":"index.js","sourcesContent":["export * from './charts';\nexport * from './series';\nexport * from './components';\nexport * from './VChart';\nexport * from './VChartSimple';\n\n// export the version, since @1.8.3\nexport const version = \"1.10.2-alpha.2\";\n\nexport type {\n IAreaChartSpec,\n IBarChartSpec,\n IBar3dChartSpec,\n IBoxPlotChartSpec,\n ICirclePackingChartSpec,\n ICommonChartSpec,\n IFunnelChartSpec,\n IFunnel3dChartSpec,\n IGaugeChartSpec,\n IHeatmapChartSpec,\n IHistogramChartSpec,\n IHistogram3dChartSpec,\n ILineChartSpec,\n IMapChartSpec,\n IPieChartSpec,\n IPie3dChartSpec,\n ICircularProgressChartSpec,\n ILinearProgressChartSpec,\n IRadarChartSpec,\n IRangeColumnChartSpec,\n IRangeColumn3dChartSpec,\n IRangeAreaChartSpec,\n IRoseChartSpec,\n IScatterChartSpec,\n ISankeyChartSpec,\n ISequenceChartSpec,\n ISunburstChartSpec,\n ITreemapChartSpec,\n IWaterfallChartSpec,\n ICorrelationChartSpec,\n ILiquidChartSpec,\n IWordCloud3dChartSpec,\n IWordCloudChartSpec,\n IPolarChartSpec,\n ICartesianChartSpec,\n ITheme,\n IInitOption,\n ISpec,\n IVChart\n} from '@visactor/vchart';\n"]}
@@ -0,0 +1,4 @@
1
+ import { createSeries } from "./BaseSeries";
2
+
3
+ export const Area = createSeries("Area", [ "area" ], "area");
4
+ //# sourceMappingURL=Area.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/series/Area.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAE,MAAM,cAAc,CAAC;AAI7D,MAAM,CAAC,MAAM,IAAI,GAAG,YAAY,CAAY,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC","file":"Area.js","sourcesContent":["import { BaseSeriesProps, createSeries } from './BaseSeries';\nimport type { IAreaSeriesSpec } from '@visactor/vchart';\n\nexport type AreaProps = BaseSeriesProps & Omit<IAreaSeriesSpec, 'type'>;\nexport const Area = createSeries<AreaProps>('Area', ['area'], 'area');\n"]}
@@ -0,0 +1,4 @@
1
+ import { createSeries } from "./BaseSeries";
2
+
3
+ export const Bar = createSeries("Bar", [ "bar" ], "bar");
4
+ //# sourceMappingURL=Bar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/series/Bar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAE,MAAM,cAAc,CAAC;AAM7D,MAAM,CAAC,MAAM,GAAG,GAAG,YAAY,CAAW,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC","file":"Bar.js","sourcesContent":["import { BaseSeriesProps, createSeries } from './BaseSeries';\n\nimport type { IBarSeriesSpec } from '@visactor/vchart';\n\nexport type BarProps = BaseSeriesProps & Omit<IBarSeriesSpec, 'type'>;\n\nexport const Bar = createSeries<BarProps>('Bar', ['bar'], 'bar');\n"]}
@@ -0,0 +1,45 @@
1
+ import React from "openinula";
2
+
3
+ import { isNil, pickWithout } from "@visactor/vutils";
4
+
5
+ import RootChartContext from "../context/chart";
6
+
7
+ import { REACT_TO_VCHART_EVENTS, findEventProps, COMMON_EVENTK_KEYS, VCHART_TO_REACT_EVENTS } from "../eventsUtils";
8
+
9
+ export const createSeries = (componentName, markNames, type) => {
10
+ const notSpecKeys = COMMON_EVENTK_KEYS.concat([ "id", "updateId", "componentId" ]), Comp = props => {
11
+ var _a;
12
+ const context = React.useContext(RootChartContext), id = null !== (_a = props.id) && void 0 !== _a ? _a : props.componentId, bindedEvents = React.useRef({}), handleEvent = e => {
13
+ const markIds = markNames.map((markName => `${id}-${markName}`));
14
+ (null == e ? void 0 : e.mark) && markIds.includes(e.mark.getUserId()) && props[VCHART_TO_REACT_EVENTS[e.event.type]](e);
15
+ }, addMarkEvent = events => {
16
+ events && context.chart && (bindedEvents.current && Object.keys(bindedEvents.current).forEach((eventKey => {
17
+ context.chart.off(REACT_TO_VCHART_EVENTS[eventKey], bindedEvents.current[eventKey]),
18
+ bindedEvents.current[eventKey] = null;
19
+ })), events && Object.keys(events).forEach((eventKey => {
20
+ var _a;
21
+ (null === (_a = bindedEvents.current) || void 0 === _a ? void 0 : _a[eventKey]) || (context.chart.on(REACT_TO_VCHART_EVENTS[eventKey], handleEvent),
22
+ bindedEvents.current || (bindedEvents.current = {}), bindedEvents.current[eventKey] = handleEvent);
23
+ })));
24
+ };
25
+ return addMarkEvent(findEventProps(props)), React.useEffect((() => () => {
26
+ addMarkEvent({}), bindedEvents.current = {};
27
+ }), []), null;
28
+ };
29
+ return Comp.displayName = componentName, Comp.parseSpec = compProps => {
30
+ var _a;
31
+ const newSeriesSpec = pickWithout(compProps, notSpecKeys);
32
+ var spec, seriesId;
33
+ return spec = newSeriesSpec, seriesId = null !== (_a = compProps.id) && void 0 !== _a ? _a : compProps.componentId,
34
+ markNames.forEach((markName => {
35
+ const defaultMarkId = `${seriesId}-${markName}`;
36
+ isNil(spec[markName]) ? spec[markName] = {
37
+ id: defaultMarkId
38
+ } : isNil(spec[markName].id) && (spec[markName].id = defaultMarkId);
39
+ })), isNil(type) || (newSeriesSpec.type = type), {
40
+ spec: newSeriesSpec,
41
+ specName: "series"
42
+ };
43
+ }, Comp;
44
+ };
45
+ //# sourceMappingURL=BaseSeries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/series/BaseSeries.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,WAAW,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,gBAAgB,MAAM,kBAAkB,CAAC;AAChD,OAAO,EACL,sBAAsB,EAEtB,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,gBAAgB,CAAC;AAKxB,MAAM,CAAC,MAAM,YAAY,GAAG,CAA4B,aAAqB,EAAE,SAAmB,EAAE,IAAa,EAAE,EAAE;IACnH,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G,EAAE;YACnB,OAAO,GAAG,EAAE;gBACV,eAAe,EAAE,CAAC;gBAClB,YAAY,CAAC,OAAO,GAAG,EAAE,CAAC;YAC5B,CAAC,CAAC;QACJ,CAAC,EAAE,EAAE,CAAC,CAAC;QAEP,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,IAAI,CAAC,WAAW,GAAG,aAAa,CAAC;IAChC,IAAY,CAAC,SAAS,GAAG,CAAC,SAA0D,EAAE,EAAE;;QACvF,MAAM,aAAa,GAAG,WAAW,CAAI,SAAS,EAAE,WAAW,CAAC,CAAC;QAE7D,SAAS,CAAC,aAAa,EAAE,MAAA,SAAS,CAAC,EAAE,mCAAI,SAAS,CAAC,WAAW,CAAC,CAAC;QAEhE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;YACf,aAAqB,CAAC,IAAI,GAAG,IAAI,CAAC;SACpC;QAED,OAAO;YACL,IAAI,EAAE,aAAa;YACnB,QAAQ,EAAE,QAAQ;SACnB,CAAC;IACJ,CAAC,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","file":"BaseSeries.js","sourcesContent":["import React from 'openinula';\nimport { isNil, pickWithout } from '@visactor/vutils';\nimport RootChartContext from '../context/chart';\nimport {\n REACT_TO_VCHART_EVENTS,\n EventsProps,\n findEventProps,\n COMMON_EVENTK_KEYS,\n VCHART_TO_REACT_EVENTS\n} from '../eventsUtils';\nexport interface BaseSeriesProps extends EventsProps {\n id?: string | number;\n}\n\nexport const createSeries = <T extends BaseSeriesProps>(componentName: string, markNames: string[], type?: string) => {\n const ignoreKeys = ['id', 'updateId', 'componentId'];\n const notSpecKeys = COMMON_EVENTK_KEYS.concat(ignoreKeys);\n\n const addMarkId = (spec: any, seriesId: string | number) => {\n markNames.forEach(markName => {\n const defaultMarkId = `${seriesId}-${markName}`;\n\n if (isNil(spec[markName])) {\n spec[markName] = { id: defaultMarkId };\n } else if (isNil(spec[markName].id)) {\n spec[markName].id = defaultMarkId;\n }\n });\n };\n\n const Comp: React.FC<T & { updateId?: number; componentId?: string }> = props => {\n const context = React.useContext(RootChartContext);\n\n const id = props.id ?? props.componentId;\n const bindedEvents = React.useRef<Record<string, (e: any) => void>>({});\n\n const handleEvent = (e: any) => {\n const markIds = markNames.map(markName => `${id}-${markName}`);\n if (e?.mark && markIds.includes(e.mark.getUserId())) {\n props[VCHART_TO_REACT_EVENTS[e.event.type]](e);\n }\n };\n\n const addMarkEvent = (events: EventsProps) => {\n if (!events || !context.chart) {\n return;\n }\n\n if (bindedEvents.current) {\n Object.keys(bindedEvents.current).forEach(eventKey => {\n context.chart.off(REACT_TO_VCHART_EVENTS[eventKey], bindedEvents.current[eventKey]);\n bindedEvents.current[eventKey] = null;\n });\n }\n\n events &&\n Object.keys(events).forEach(eventKey => {\n if (!bindedEvents.current?.[eventKey]) {\n context.chart.on(REACT_TO_VCHART_EVENTS[eventKey], handleEvent);\n\n if (!bindedEvents.current) {\n bindedEvents.current = {};\n }\n bindedEvents.current[eventKey] = handleEvent;\n }\n });\n };\n\n const removeMarkEvent = () => {\n addMarkEvent({});\n };\n\n addMarkEvent(findEventProps(props));\n\n React.useEffect(() => {\n return () => {\n removeMarkEvent();\n bindedEvents.current = {};\n };\n }, []);\n\n return null;\n };\n\n Comp.displayName = componentName;\n (Comp as any).parseSpec = (compProps: T & { updateId?: number; componentId?: string }) => {\n const newSeriesSpec = pickWithout<T>(compProps, notSpecKeys);\n\n addMarkId(newSeriesSpec, compProps.id ?? compProps.componentId);\n\n if (!isNil(type)) {\n (newSeriesSpec as any).type = type;\n }\n\n return {\n spec: newSeriesSpec,\n specName: 'series'\n };\n };\n return Comp;\n};\n"]}
@@ -0,0 +1,4 @@
1
+ import { createSeries } from "./BaseSeries";
2
+
3
+ export const BoxPlot = createSeries("BoxPlot", [ "boxPlot" ], "boxPlot");
4
+ //# sourceMappingURL=BoxPlot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/series/BoxPlot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAE,MAAM,cAAc,CAAC;AAK7D,MAAM,CAAC,MAAM,OAAO,GAAG,YAAY,CAAe,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC","file":"BoxPlot.js","sourcesContent":["import { BaseSeriesProps, createSeries } from './BaseSeries';\nimport type { IBoxPlotSeriesSpec } from '@visactor/vchart';\n\nexport type BoxPlotProps = BaseSeriesProps & Omit<IBoxPlotSeriesSpec, 'type'>;\n\nexport const BoxPlot = createSeries<BoxPlotProps>('BoxPlot', ['boxPlot'], 'boxPlot');\n"]}
@@ -0,0 +1,4 @@
1
+ import { createSeries } from "./BaseSeries";
2
+
3
+ export const CircularProgress = createSeries("CircularProgress", [ "circularProgress" ], "circularProgress");
4
+ //# sourceMappingURL=CircularProgress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/series/CircularProgress.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAE,MAAM,cAAc,CAAC;AAK7D,MAAM,CAAC,MAAM,gBAAgB,GAAG,YAAY,CAC1C,kBAAkB,EAClB,CAAC,kBAAkB,CAAC,EACpB,kBAAkB,CACnB,CAAC","file":"CircularProgress.js","sourcesContent":["import { BaseSeriesProps, createSeries } from './BaseSeries';\nimport type { ICircularProgressSeriesSpec } from '@visactor/vchart';\n\nexport type CircularProgressProps = BaseSeriesProps & Omit<ICircularProgressSeriesSpec, 'type'>;\n\nexport const CircularProgress = createSeries<CircularProgressProps>(\n 'CircularProgress',\n ['circularProgress'],\n 'circularProgress'\n);\n"]}
@@ -0,0 +1,4 @@
1
+ import { createSeries } from "./BaseSeries";
2
+
3
+ export const Dot = createSeries("Dot", [ "dot" ], "dot");
4
+ //# sourceMappingURL=Dot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/series/Dot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAE,MAAM,cAAc,CAAC;AAK7D,MAAM,CAAC,MAAM,GAAG,GAAG,YAAY,CAAW,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC","file":"Dot.js","sourcesContent":["import { BaseSeriesProps, createSeries } from './BaseSeries';\nimport type { IDotSeriesSpec } from '@visactor/vchart';\n\nexport type DotProps = BaseSeriesProps & Omit<IDotSeriesSpec, 'type'>;\n\nexport const Dot = createSeries<DotProps>('Dot', ['dot'], 'dot');\n"]}
@@ -0,0 +1,4 @@
1
+ import { createSeries } from "./BaseSeries";
2
+
3
+ export const Funnel = createSeries("Funnel", [ "funnel" ], "funnel");
4
+ //# sourceMappingURL=Funnel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/series/Funnel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAE,MAAM,cAAc,CAAC;AAK7D,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAc,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC","file":"Funnel.js","sourcesContent":["import { BaseSeriesProps, createSeries } from './BaseSeries';\nimport type { IFunnelSeriesSpec } from '@visactor/vchart';\n\nexport type FunnelProps = BaseSeriesProps & Omit<IFunnelSeriesSpec, 'type'>;\n\nexport const Funnel = createSeries<FunnelProps>('Funnel', ['funnel'], 'funnel');\n"]}
@@ -0,0 +1,4 @@
1
+ import { createSeries } from "./BaseSeries";
2
+
3
+ export const Line = createSeries("Line", [ "line" ], "line");
4
+ //# sourceMappingURL=Line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/series/Line.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAE,MAAM,cAAc,CAAC;AAK7D,MAAM,CAAC,MAAM,IAAI,GAAG,YAAY,CAAY,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC","file":"Line.js","sourcesContent":["import { BaseSeriesProps, createSeries } from './BaseSeries';\nimport type { ILineSeriesSpec } from '@visactor/vchart';\n\nexport type LineProps = BaseSeriesProps & Omit<ILineSeriesSpec, 'type'>;\n\nexport const Line = createSeries<LineProps>('Line', ['line'], 'line');\n"]}
@@ -0,0 +1,4 @@
1
+ import { createSeries } from "./BaseSeries";
2
+
3
+ export const LinearProgress = createSeries("LinearProgress", [ "linearProgress" ], "linearProgress");
4
+ //# sourceMappingURL=LinearProgress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/series/LinearProgress.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAE,MAAM,cAAc,CAAC;AAK7D,MAAM,CAAC,MAAM,cAAc,GAAG,YAAY,CAAsB,gBAAgB,EAAE,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,CAAC","file":"LinearProgress.js","sourcesContent":["import { BaseSeriesProps, createSeries } from './BaseSeries';\nimport type { ILinearProgressSeriesSpec } from '@visactor/vchart';\n\nexport type LinearProgressProps = BaseSeriesProps & Omit<ILinearProgressSeriesSpec, 'type'>;\n\nexport const LinearProgress = createSeries<LinearProgressProps>('LinearProgress', ['linearProgress'], 'linearProgress');\n"]}
@@ -0,0 +1,3 @@
1
+ import { createSeries } from "./BaseSeries";
2
+
3
+ export const Link = createSeries("Link", [ "link" ], "link");
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/series/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAE,MAAM,cAAc,CAAC;AAK7D,MAAM,CAAC,MAAM,IAAI,GAAG,YAAY,CAAY,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC","file":"Link.js","sourcesContent":["import { BaseSeriesProps, createSeries } from './BaseSeries';\nimport type { ILinkSeriesSpec } from '@visactor/vchart';\n\nexport type LinkProps = BaseSeriesProps & Omit<ILinkSeriesSpec, 'type'>;\n\nexport const Link = createSeries<LinkProps>('Link', ['link'], 'link');\n"]}
@@ -0,0 +1,4 @@
1
+ import { createSeries } from "./BaseSeries";
2
+
3
+ export const Map = createSeries("Map", [ "map" ], "map");
4
+ //# sourceMappingURL=Map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/series/Map.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAE,MAAM,cAAc,CAAC;AAK7D,MAAM,CAAC,MAAM,GAAG,GAAG,YAAY,CAAW,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC","file":"Map.js","sourcesContent":["import { BaseSeriesProps, createSeries } from './BaseSeries';\nimport type { IMapSeriesSpec } from '@visactor/vchart';\n\nexport type MapProps = BaseSeriesProps & Omit<IMapSeriesSpec, 'type'>;\n\nexport const Map = createSeries<MapProps>('Map', ['map'], 'map');\n"]}
@@ -0,0 +1,4 @@
1
+ import { createSeries } from "./BaseSeries";
2
+
3
+ export const Pie = createSeries("Pie", [ "pie" ], "pie");
4
+ //# sourceMappingURL=Pie.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/series/Pie.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAE,MAAM,cAAc,CAAC;AAK7D,MAAM,CAAC,MAAM,GAAG,GAAG,YAAY,CAAW,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC","file":"Pie.js","sourcesContent":["import { BaseSeriesProps, createSeries } from './BaseSeries';\nimport type { IPieSeriesSpec } from '@visactor/vchart';\n\nexport type PieProps = BaseSeriesProps & Omit<IPieSeriesSpec, 'type'>;\n\nexport const Pie = createSeries<PieProps>('Pie', ['pie'], 'pie');\n"]}
@@ -0,0 +1,4 @@
1
+ import { createSeries } from "./BaseSeries";
2
+
3
+ export const Radar = createSeries("Radar", [ "radar" ], "radar");
4
+ //# sourceMappingURL=Radar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/series/Radar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAE,MAAM,cAAc,CAAC;AAK7D,MAAM,CAAC,MAAM,KAAK,GAAG,YAAY,CAAa,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC","file":"Radar.js","sourcesContent":["import { BaseSeriesProps, createSeries } from './BaseSeries';\nimport type { IRadarSeriesSpec } from '@visactor/vchart';\n\nexport type RadarProps = BaseSeriesProps & Omit<IRadarSeriesSpec, 'type'>;\n\nexport const Radar = createSeries<RadarProps>('Radar', ['radar'], 'radar');\n"]}
@@ -0,0 +1,4 @@
1
+ import { createSeries } from "./BaseSeries";
2
+
3
+ export const RangeColumn = createSeries("RangeColumn", [ "rangeColumn" ], "rangeColumn");
4
+ //# sourceMappingURL=RangeColumn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/series/RangeColumn.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAE,MAAM,cAAc,CAAC;AAK7D,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAmB,aAAa,EAAE,CAAC,aAAa,CAAC,EAAE,aAAa,CAAC,CAAC","file":"RangeColumn.js","sourcesContent":["import { BaseSeriesProps, createSeries } from './BaseSeries';\nimport type { IRangeColumnSeriesSpec } from '@visactor/vchart';\n\nexport type RangeColumnProps = BaseSeriesProps & Omit<IRangeColumnSeriesSpec, 'type'>;\n\nexport const RangeColumn = createSeries<RangeColumnProps>('RangeColumn', ['rangeColumn'], 'rangeColumn');\n"]}