@visactor/react-vchart 0.0.1-alpha.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 (320) hide show
  1. package/README.md +23 -0
  2. package/cjs/VChart.d.ts +3 -0
  3. package/cjs/VChart.js +9 -0
  4. package/cjs/VChart.js.map +1 -0
  5. package/cjs/charts/AreaChart.d.ts +5 -0
  6. package/cjs/charts/AreaChart.js +10 -0
  7. package/cjs/charts/AreaChart.js.map +1 -0
  8. package/cjs/charts/BarChart.d.ts +5 -0
  9. package/cjs/charts/BarChart.js +10 -0
  10. package/cjs/charts/BarChart.js.map +1 -0
  11. package/cjs/charts/BaseChart.d.ts +18 -0
  12. package/cjs/charts/BaseChart.js +94 -0
  13. package/cjs/charts/BaseChart.js.map +1 -0
  14. package/cjs/charts/BoxPlotChart.d.ts +5 -0
  15. package/cjs/charts/BoxPlotChart.js +10 -0
  16. package/cjs/charts/BoxPlotChart.js.map +1 -0
  17. package/cjs/charts/CircularProgressChart.d.ts +5 -0
  18. package/cjs/charts/CircularProgressChart.js +10 -0
  19. package/cjs/charts/CircularProgressChart.js.map +1 -0
  20. package/cjs/charts/CommonChart.d.ts +5 -0
  21. package/cjs/charts/CommonChart.js +10 -0
  22. package/cjs/charts/CommonChart.js.map +1 -0
  23. package/cjs/charts/FunnelChart.d.ts +5 -0
  24. package/cjs/charts/FunnelChart.js +10 -0
  25. package/cjs/charts/FunnelChart.js.map +1 -0
  26. package/cjs/charts/HistogramChart.d.ts +5 -0
  27. package/cjs/charts/HistogramChart.js +10 -0
  28. package/cjs/charts/HistogramChart.js.map +1 -0
  29. package/cjs/charts/LineChart.d.ts +5 -0
  30. package/cjs/charts/LineChart.js +10 -0
  31. package/cjs/charts/LineChart.js.map +1 -0
  32. package/cjs/charts/LinearProgressChart.d.ts +5 -0
  33. package/cjs/charts/LinearProgressChart.js +9 -0
  34. package/cjs/charts/LinearProgressChart.js.map +1 -0
  35. package/cjs/charts/MapChart.d.ts +5 -0
  36. package/cjs/charts/MapChart.js +10 -0
  37. package/cjs/charts/MapChart.js.map +1 -0
  38. package/cjs/charts/PieChart.d.ts +5 -0
  39. package/cjs/charts/PieChart.js +10 -0
  40. package/cjs/charts/PieChart.js.map +1 -0
  41. package/cjs/charts/RadarChart.d.ts +5 -0
  42. package/cjs/charts/RadarChart.js +10 -0
  43. package/cjs/charts/RadarChart.js.map +1 -0
  44. package/cjs/charts/RangeColumnChart.d.ts +5 -0
  45. package/cjs/charts/RangeColumnChart.js +10 -0
  46. package/cjs/charts/RangeColumnChart.js.map +1 -0
  47. package/cjs/charts/RoseChart.d.ts +5 -0
  48. package/cjs/charts/RoseChart.js +10 -0
  49. package/cjs/charts/RoseChart.js.map +1 -0
  50. package/cjs/charts/ScatterChart.d.ts +5 -0
  51. package/cjs/charts/ScatterChart.js +10 -0
  52. package/cjs/charts/ScatterChart.js.map +1 -0
  53. package/cjs/charts/SequenceChart.d.ts +5 -0
  54. package/cjs/charts/SequenceChart.js +10 -0
  55. package/cjs/charts/SequenceChart.js.map +1 -0
  56. package/cjs/charts/WordCloudChart.d.ts +5 -0
  57. package/cjs/charts/WordCloudChart.js +10 -0
  58. package/cjs/charts/WordCloudChart.js.map +1 -0
  59. package/cjs/charts/index.d.ts +16 -0
  60. package/cjs/charts/index.js +150 -0
  61. package/cjs/charts/index.js.map +1 -0
  62. package/cjs/components/Axis.d.ts +5 -0
  63. package/cjs/components/Axis.js +10 -0
  64. package/cjs/components/Axis.js.map +1 -0
  65. package/cjs/components/BaseComponent.d.ts +9 -0
  66. package/cjs/components/BaseComponent.js +76 -0
  67. package/cjs/components/BaseComponent.js.map +1 -0
  68. package/cjs/components/Legend.d.ts +9 -0
  69. package/cjs/components/Legend.js +10 -0
  70. package/cjs/components/Legend.js.map +1 -0
  71. package/cjs/components/Mark.d.ts +14 -0
  72. package/cjs/components/Mark.js +68 -0
  73. package/cjs/components/Mark.js.map +1 -0
  74. package/cjs/components/Region.d.ts +5 -0
  75. package/cjs/components/Region.js +10 -0
  76. package/cjs/components/Region.js.map +1 -0
  77. package/cjs/components/index.d.ts +4 -0
  78. package/cjs/components/index.js +22 -0
  79. package/cjs/components/index.js.map +1 -0
  80. package/cjs/constants.d.ts +1 -0
  81. package/cjs/constants.js +6 -0
  82. package/cjs/constants.js.map +1 -0
  83. package/cjs/containers/withContainer.d.ts +8 -0
  84. package/cjs/containers/withContainer.js +64 -0
  85. package/cjs/containers/withContainer.js.map +1 -0
  86. package/cjs/context/chart.d.ts +10 -0
  87. package/cjs/context/chart.js +25 -0
  88. package/cjs/context/chart.js.map +1 -0
  89. package/cjs/context/stage.d.ts +4 -0
  90. package/cjs/context/stage.js +24 -0
  91. package/cjs/context/stage.js.map +1 -0
  92. package/cjs/context/view.d.ts +5 -0
  93. package/cjs/context/view.js +24 -0
  94. package/cjs/context/view.js.map +1 -0
  95. package/cjs/eventsUtils.d.ts +155 -0
  96. package/cjs/eventsUtils.js +84 -0
  97. package/cjs/eventsUtils.js.map +1 -0
  98. package/cjs/index.d.ts +6 -0
  99. package/cjs/index.js +38 -0
  100. package/cjs/index.js.map +1 -0
  101. package/cjs/series/Area.d.ts +6 -0
  102. package/cjs/series/Area.js +10 -0
  103. package/cjs/series/Area.js.map +1 -0
  104. package/cjs/series/Bar.d.ts +6 -0
  105. package/cjs/series/Bar.js +10 -0
  106. package/cjs/series/Bar.js.map +1 -0
  107. package/cjs/series/BaseSeries.d.ts +8 -0
  108. package/cjs/series/BaseSeries.js +77 -0
  109. package/cjs/series/BaseSeries.js.map +1 -0
  110. package/cjs/series/BoxPlot.d.ts +6 -0
  111. package/cjs/series/BoxPlot.js +10 -0
  112. package/cjs/series/BoxPlot.js.map +1 -0
  113. package/cjs/series/CircularProgress.d.ts +6 -0
  114. package/cjs/series/CircularProgress.js +10 -0
  115. package/cjs/series/CircularProgress.js.map +1 -0
  116. package/cjs/series/Dot.d.ts +6 -0
  117. package/cjs/series/Dot.js +10 -0
  118. package/cjs/series/Dot.js.map +1 -0
  119. package/cjs/series/Funnel.d.ts +6 -0
  120. package/cjs/series/Funnel.js +10 -0
  121. package/cjs/series/Funnel.js.map +1 -0
  122. package/cjs/series/Line.d.ts +6 -0
  123. package/cjs/series/Line.js +9 -0
  124. package/cjs/series/Line.js.map +1 -0
  125. package/cjs/series/LinearProgress.d.ts +6 -0
  126. package/cjs/series/LinearProgress.js +10 -0
  127. package/cjs/series/LinearProgress.js.map +1 -0
  128. package/cjs/series/Link.d.ts +6 -0
  129. package/cjs/series/Link.js +10 -0
  130. package/cjs/series/Link.js.map +1 -0
  131. package/cjs/series/Map.d.ts +6 -0
  132. package/cjs/series/Map.js +10 -0
  133. package/cjs/series/Map.js.map +1 -0
  134. package/cjs/series/Pie.d.ts +6 -0
  135. package/cjs/series/Pie.js +10 -0
  136. package/cjs/series/Pie.js.map +1 -0
  137. package/cjs/series/Radar.d.ts +6 -0
  138. package/cjs/series/Radar.js +10 -0
  139. package/cjs/series/Radar.js.map +1 -0
  140. package/cjs/series/RangeColumn.d.ts +6 -0
  141. package/cjs/series/RangeColumn.js +10 -0
  142. package/cjs/series/RangeColumn.js.map +1 -0
  143. package/cjs/series/Rose.d.ts +6 -0
  144. package/cjs/series/Rose.js +10 -0
  145. package/cjs/series/Rose.js.map +1 -0
  146. package/cjs/series/Scatter.d.ts +6 -0
  147. package/cjs/series/Scatter.js +10 -0
  148. package/cjs/series/Scatter.js.map +1 -0
  149. package/cjs/series/Series.d.ts +7 -0
  150. package/cjs/series/Series.js +10 -0
  151. package/cjs/series/Series.js.map +1 -0
  152. package/cjs/series/WordCloud.d.ts +6 -0
  153. package/cjs/series/WordCloud.js +10 -0
  154. package/cjs/series/WordCloud.js.map +1 -0
  155. package/cjs/series/index.d.ts +17 -0
  156. package/cjs/series/index.js +29 -0
  157. package/cjs/series/index.js.map +1 -0
  158. package/cjs/util.d.ts +7 -0
  159. package/cjs/util.js +57 -0
  160. package/cjs/util.js.map +1 -0
  161. package/esm/VChart.d.ts +3 -0
  162. package/esm/VChart.js +3 -0
  163. package/esm/VChart.js.map +1 -0
  164. package/esm/charts/AreaChart.d.ts +5 -0
  165. package/esm/charts/AreaChart.js +4 -0
  166. package/esm/charts/AreaChart.js.map +1 -0
  167. package/esm/charts/BarChart.d.ts +5 -0
  168. package/esm/charts/BarChart.js +4 -0
  169. package/esm/charts/BarChart.js.map +1 -0
  170. package/esm/charts/BaseChart.d.ts +18 -0
  171. package/esm/charts/BaseChart.js +75 -0
  172. package/esm/charts/BaseChart.js.map +1 -0
  173. package/esm/charts/BoxPlotChart.d.ts +5 -0
  174. package/esm/charts/BoxPlotChart.js +4 -0
  175. package/esm/charts/BoxPlotChart.js.map +1 -0
  176. package/esm/charts/CircularProgressChart.d.ts +5 -0
  177. package/esm/charts/CircularProgressChart.js +4 -0
  178. package/esm/charts/CircularProgressChart.js.map +1 -0
  179. package/esm/charts/CommonChart.d.ts +5 -0
  180. package/esm/charts/CommonChart.js +4 -0
  181. package/esm/charts/CommonChart.js.map +1 -0
  182. package/esm/charts/FunnelChart.d.ts +5 -0
  183. package/esm/charts/FunnelChart.js +4 -0
  184. package/esm/charts/FunnelChart.js.map +1 -0
  185. package/esm/charts/HistogramChart.d.ts +5 -0
  186. package/esm/charts/HistogramChart.js +4 -0
  187. package/esm/charts/HistogramChart.js.map +1 -0
  188. package/esm/charts/LineChart.d.ts +5 -0
  189. package/esm/charts/LineChart.js +4 -0
  190. package/esm/charts/LineChart.js.map +1 -0
  191. package/esm/charts/LinearProgressChart.d.ts +5 -0
  192. package/esm/charts/LinearProgressChart.js +3 -0
  193. package/esm/charts/LinearProgressChart.js.map +1 -0
  194. package/esm/charts/MapChart.d.ts +5 -0
  195. package/esm/charts/MapChart.js +4 -0
  196. package/esm/charts/MapChart.js.map +1 -0
  197. package/esm/charts/PieChart.d.ts +5 -0
  198. package/esm/charts/PieChart.js +4 -0
  199. package/esm/charts/PieChart.js.map +1 -0
  200. package/esm/charts/RadarChart.d.ts +5 -0
  201. package/esm/charts/RadarChart.js +4 -0
  202. package/esm/charts/RadarChart.js.map +1 -0
  203. package/esm/charts/RangeColumnChart.d.ts +5 -0
  204. package/esm/charts/RangeColumnChart.js +4 -0
  205. package/esm/charts/RangeColumnChart.js.map +1 -0
  206. package/esm/charts/RoseChart.d.ts +5 -0
  207. package/esm/charts/RoseChart.js +4 -0
  208. package/esm/charts/RoseChart.js.map +1 -0
  209. package/esm/charts/ScatterChart.d.ts +5 -0
  210. package/esm/charts/ScatterChart.js +4 -0
  211. package/esm/charts/ScatterChart.js.map +1 -0
  212. package/esm/charts/SequenceChart.d.ts +5 -0
  213. package/esm/charts/SequenceChart.js +4 -0
  214. package/esm/charts/SequenceChart.js.map +1 -0
  215. package/esm/charts/WordCloudChart.d.ts +5 -0
  216. package/esm/charts/WordCloudChart.js +4 -0
  217. package/esm/charts/WordCloudChart.js.map +1 -0
  218. package/esm/charts/index.d.ts +16 -0
  219. package/esm/charts/index.js +32 -0
  220. package/esm/charts/index.js.map +1 -0
  221. package/esm/components/Axis.d.ts +5 -0
  222. package/esm/components/Axis.js +4 -0
  223. package/esm/components/Axis.js.map +1 -0
  224. package/esm/components/BaseComponent.d.ts +9 -0
  225. package/esm/components/BaseComponent.js +47 -0
  226. package/esm/components/BaseComponent.js.map +1 -0
  227. package/esm/components/Legend.d.ts +9 -0
  228. package/esm/components/Legend.js +6 -0
  229. package/esm/components/Legend.js.map +1 -0
  230. package/esm/components/Mark.d.ts +14 -0
  231. package/esm/components/Mark.js +40 -0
  232. package/esm/components/Mark.js.map +1 -0
  233. package/esm/components/Region.d.ts +5 -0
  234. package/esm/components/Region.js +4 -0
  235. package/esm/components/Region.js.map +1 -0
  236. package/esm/components/index.d.ts +4 -0
  237. package/esm/components/index.js +8 -0
  238. package/esm/components/index.js.map +1 -0
  239. package/esm/constants.d.ts +1 -0
  240. package/esm/constants.js +2 -0
  241. package/esm/constants.js.map +1 -0
  242. package/esm/containers/withContainer.d.ts +8 -0
  243. package/esm/containers/withContainer.js +33 -0
  244. package/esm/containers/withContainer.js.map +1 -0
  245. package/esm/context/chart.d.ts +10 -0
  246. package/esm/context/chart.js +16 -0
  247. package/esm/context/chart.js.map +1 -0
  248. package/esm/context/stage.d.ts +4 -0
  249. package/esm/context/stage.js +16 -0
  250. package/esm/context/stage.js.map +1 -0
  251. package/esm/context/view.d.ts +5 -0
  252. package/esm/context/view.js +16 -0
  253. package/esm/context/view.js.map +1 -0
  254. package/esm/eventsUtils.d.ts +155 -0
  255. package/esm/eventsUtils.js +82 -0
  256. package/esm/eventsUtils.js.map +1 -0
  257. package/esm/index.d.ts +6 -0
  258. package/esm/index.js +11 -0
  259. package/esm/index.js.map +1 -0
  260. package/esm/series/Area.d.ts +6 -0
  261. package/esm/series/Area.js +4 -0
  262. package/esm/series/Area.js.map +1 -0
  263. package/esm/series/Bar.d.ts +6 -0
  264. package/esm/series/Bar.js +4 -0
  265. package/esm/series/Bar.js.map +1 -0
  266. package/esm/series/BaseSeries.d.ts +8 -0
  267. package/esm/series/BaseSeries.js +72 -0
  268. package/esm/series/BaseSeries.js.map +1 -0
  269. package/esm/series/BoxPlot.d.ts +6 -0
  270. package/esm/series/BoxPlot.js +4 -0
  271. package/esm/series/BoxPlot.js.map +1 -0
  272. package/esm/series/CircularProgress.d.ts +6 -0
  273. package/esm/series/CircularProgress.js +4 -0
  274. package/esm/series/CircularProgress.js.map +1 -0
  275. package/esm/series/Dot.d.ts +6 -0
  276. package/esm/series/Dot.js +4 -0
  277. package/esm/series/Dot.js.map +1 -0
  278. package/esm/series/Funnel.d.ts +6 -0
  279. package/esm/series/Funnel.js +4 -0
  280. package/esm/series/Funnel.js.map +1 -0
  281. package/esm/series/Line.d.ts +6 -0
  282. package/esm/series/Line.js +3 -0
  283. package/esm/series/Line.js.map +1 -0
  284. package/esm/series/LinearProgress.d.ts +6 -0
  285. package/esm/series/LinearProgress.js +4 -0
  286. package/esm/series/LinearProgress.js.map +1 -0
  287. package/esm/series/Link.d.ts +6 -0
  288. package/esm/series/Link.js +4 -0
  289. package/esm/series/Link.js.map +1 -0
  290. package/esm/series/Map.d.ts +6 -0
  291. package/esm/series/Map.js +4 -0
  292. package/esm/series/Map.js.map +1 -0
  293. package/esm/series/Pie.d.ts +6 -0
  294. package/esm/series/Pie.js +4 -0
  295. package/esm/series/Pie.js.map +1 -0
  296. package/esm/series/Radar.d.ts +6 -0
  297. package/esm/series/Radar.js +4 -0
  298. package/esm/series/Radar.js.map +1 -0
  299. package/esm/series/RangeColumn.d.ts +6 -0
  300. package/esm/series/RangeColumn.js +4 -0
  301. package/esm/series/RangeColumn.js.map +1 -0
  302. package/esm/series/Rose.d.ts +6 -0
  303. package/esm/series/Rose.js +4 -0
  304. package/esm/series/Rose.js.map +1 -0
  305. package/esm/series/Scatter.d.ts +6 -0
  306. package/esm/series/Scatter.js +4 -0
  307. package/esm/series/Scatter.js.map +1 -0
  308. package/esm/series/Series.d.ts +7 -0
  309. package/esm/series/Series.js +4 -0
  310. package/esm/series/Series.js.map +1 -0
  311. package/esm/series/WordCloud.d.ts +6 -0
  312. package/esm/series/WordCloud.js +4 -0
  313. package/esm/series/WordCloud.js.map +1 -0
  314. package/esm/series/index.d.ts +17 -0
  315. package/esm/series/index.js +34 -0
  316. package/esm/series/index.js.map +1 -0
  317. package/esm/util.d.ts +7 -0
  318. package/esm/util.js +36 -0
  319. package/esm/util.js.map +1 -0
  320. package/package.json +79 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["charts/HistogramChart.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAsB,gBAAgB,EAAE,WAAW,CAAC,CAAC","file":"HistogramChart.js","sourcesContent":["import { IHistogramChartSpec } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface HistogramChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IHistogramChartSpec, 'type'> {}\n\nexport const HistogramChart = createChart<HistogramChartProps>('HistogramChart', 'histogram');\n"]}
@@ -0,0 +1,5 @@
1
+ import { ILineChartSpec } from '@visactor/vchart';
2
+ import { BaseChartProps } from './BaseChart';
3
+ export interface LineChartProps extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>, Omit<ILineChartSpec, 'type'> {
4
+ }
5
+ export declare const LineChart: import("react").ForwardRefExoticComponent<import("../containers/withContainer").ContainerProps & import("react").RefAttributes<any>>;
@@ -0,0 +1,4 @@
1
+ import { createChart } from "./BaseChart";
2
+
3
+ export const LineChart = createChart("LineChart", "line");
4
+ //# sourceMappingURL=LineChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["charts/LineChart.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAiB,WAAW,EAAE,MAAM,CAAC,CAAC","file":"LineChart.js","sourcesContent":["import { ILineChartSpec } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface LineChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<ILineChartSpec, 'type'> {}\n\nexport const LineChart = createChart<LineChartProps>('LineChart', 'line');\n"]}
@@ -0,0 +1,5 @@
1
+ import { ILinearProgressChartSpec } from '@visactor/vchart';
2
+ import { BaseChartProps } from './BaseChart';
3
+ export interface LinearProgressChartProps extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>, Omit<ILinearProgressChartSpec, 'type'> {
4
+ }
5
+ export declare const LinearProgressChart: import("react").ForwardRefExoticComponent<import("../containers/withContainer").ContainerProps & import("react").RefAttributes<any>>;
@@ -0,0 +1,3 @@
1
+ import { createChart } from "./BaseChart";
2
+
3
+ export const LinearProgressChart = createChart("LinearProgressChart", "linearProgress");
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["charts/LinearProgressChart.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAA2B,qBAAqB,EAAE,gBAAgB,CAAC,CAAC","file":"LinearProgressChart.js","sourcesContent":["import { ILinearProgressChartSpec } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface LinearProgressChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<ILinearProgressChartSpec, 'type'> {}\n\nexport const LinearProgressChart = createChart<LinearProgressChartProps>('LinearProgressChart', 'linearProgress');\n"]}
@@ -0,0 +1,5 @@
1
+ import { IMapChartSpec } from '@visactor/vchart';
2
+ import { BaseChartProps } from './BaseChart';
3
+ export interface MapChartProps extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>, Omit<IMapChartSpec, 'type'> {
4
+ }
5
+ export declare const MapChart: import("react").ForwardRefExoticComponent<import("../containers/withContainer").ContainerProps & import("react").RefAttributes<any>>;
@@ -0,0 +1,4 @@
1
+ import { createChart } from "./BaseChart";
2
+
3
+ export const MapChart = createChart("MapChart", "map");
4
+ //# sourceMappingURL=MapChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["charts/MapChart.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,QAAQ,GAAG,WAAW,CAAgB,UAAU,EAAE,KAAK,CAAC,CAAC","file":"MapChart.js","sourcesContent":["import { IMapChartSpec } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface MapChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IMapChartSpec, 'type'> {}\n\nexport const MapChart = createChart<MapChartProps>('MapChart', 'map');\n"]}
@@ -0,0 +1,5 @@
1
+ import { IPieChartSpec } from '@visactor/vchart';
2
+ import { BaseChartProps } from './BaseChart';
3
+ export interface PieChartProps extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>, Omit<IPieChartSpec, 'type'> {
4
+ }
5
+ export declare const PieChart: import("react").ForwardRefExoticComponent<import("../containers/withContainer").ContainerProps & import("react").RefAttributes<any>>;
@@ -0,0 +1,4 @@
1
+ import { createChart } from "./BaseChart";
2
+
3
+ export const PieChart = createChart("PieChart", "pie");
4
+ //# sourceMappingURL=PieChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["charts/PieChart.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,QAAQ,GAAG,WAAW,CAAgB,UAAU,EAAE,KAAK,CAAC,CAAC","file":"PieChart.js","sourcesContent":["import { IPieChartSpec } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface PieChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IPieChartSpec, 'type'> {}\n\nexport const PieChart = createChart<PieChartProps>('PieChart', 'pie');\n"]}
@@ -0,0 +1,5 @@
1
+ import { IRadarChartSpec } from '@visactor/vchart';
2
+ import { BaseChartProps } from './BaseChart';
3
+ export interface RadarChartProps extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>, Omit<IRadarChartSpec, 'type'> {
4
+ }
5
+ export declare const RadarChart: import("react").ForwardRefExoticComponent<import("../containers/withContainer").ContainerProps & import("react").RefAttributes<any>>;
@@ -0,0 +1,4 @@
1
+ import { createChart } from "./BaseChart";
2
+
3
+ export const RadarChart = createChart("RadarChart", "radar");
4
+ //# sourceMappingURL=RadarChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["charts/RadarChart.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,CAAkB,YAAY,EAAE,OAAO,CAAC,CAAC","file":"RadarChart.js","sourcesContent":["import { IRadarChartSpec } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface RadarChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IRadarChartSpec, 'type'> {}\n\nexport const RadarChart = createChart<RadarChartProps>('RadarChart', 'radar');\n"]}
@@ -0,0 +1,5 @@
1
+ import { IRangeColumnChartSpec } from '@visactor/vchart';
2
+ import { BaseChartProps } from './BaseChart';
3
+ export interface RangeColumnChartProps extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>, Omit<IRangeColumnChartSpec, 'type'> {
4
+ }
5
+ export declare const RangeColumnChart: import("react").ForwardRefExoticComponent<import("../containers/withContainer").ContainerProps & import("react").RefAttributes<any>>;
@@ -0,0 +1,4 @@
1
+ import { createChart } from "./BaseChart";
2
+
3
+ export const RangeColumnChart = createChart("RangeColumnChart", "rangeColumn");
4
+ //# sourceMappingURL=RangeColumnChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["charts/RangeColumnChart.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAwB,kBAAkB,EAAE,aAAa,CAAC,CAAC","file":"RangeColumnChart.js","sourcesContent":["import { IRangeColumnChartSpec } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface RangeColumnChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IRangeColumnChartSpec, 'type'> {}\n\nexport const RangeColumnChart = createChart<RangeColumnChartProps>('RangeColumnChart', 'rangeColumn');\n"]}
@@ -0,0 +1,5 @@
1
+ import { IRoseChartSpec } from '@visactor/vchart';
2
+ import { BaseChartProps } from './BaseChart';
3
+ export interface RoseChartProps extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>, Omit<IRoseChartSpec, 'type'> {
4
+ }
5
+ export declare const RoseChart: import("react").ForwardRefExoticComponent<import("../containers/withContainer").ContainerProps & import("react").RefAttributes<any>>;
@@ -0,0 +1,4 @@
1
+ import { createChart } from "./BaseChart";
2
+
3
+ export const RoseChart = createChart("RoseChart", "rose");
4
+ //# sourceMappingURL=RoseChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["charts/RoseChart.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAiB,WAAW,EAAE,MAAM,CAAC,CAAC","file":"RoseChart.js","sourcesContent":["import { IRoseChartSpec } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface RoseChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IRoseChartSpec, 'type'> {}\n\nexport const RoseChart = createChart<RoseChartProps>('RoseChart', 'rose');\n"]}
@@ -0,0 +1,5 @@
1
+ import { IScatterChartSpec } from '@visactor/vchart';
2
+ import { BaseChartProps } from './BaseChart';
3
+ export interface ScatterChartProps extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>, Omit<IScatterChartSpec, 'type'> {
4
+ }
5
+ export declare const ScatterChart: import("react").ForwardRefExoticComponent<import("../containers/withContainer").ContainerProps & import("react").RefAttributes<any>>;
@@ -0,0 +1,4 @@
1
+ import { createChart } from "./BaseChart";
2
+
3
+ export const ScatterChart = createChart("ScatterChart", "scatter");
4
+ //# sourceMappingURL=ScatterChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["charts/ScatterChart.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAoB,cAAc,EAAE,SAAS,CAAC,CAAC","file":"ScatterChart.js","sourcesContent":["import { IScatterChartSpec } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface ScatterChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IScatterChartSpec, 'type'> {}\n\nexport const ScatterChart = createChart<ScatterChartProps>('ScatterChart', 'scatter');\n"]}
@@ -0,0 +1,5 @@
1
+ import { ISequenceChartSpec } from '@visactor/vchart';
2
+ import { BaseChartProps } from './BaseChart';
3
+ export interface SequenceChartProps extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>, Omit<ISequenceChartSpec, 'type'> {
4
+ }
5
+ export declare const SequenceChart: import("react").ForwardRefExoticComponent<import("../containers/withContainer").ContainerProps & import("react").RefAttributes<any>>;
@@ -0,0 +1,4 @@
1
+ import { createChart } from "./BaseChart";
2
+
3
+ export const SequenceChart = createChart("SequenceChart", "sequence");
4
+ //# sourceMappingURL=SequenceChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["charts/SequenceChart.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAqB,eAAe,EAAE,UAAU,CAAC,CAAC","file":"SequenceChart.js","sourcesContent":["import { ISequenceChartSpec } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface SequenceChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<ISequenceChartSpec, 'type'> {}\n\nexport const SequenceChart = createChart<SequenceChartProps>('SequenceChart', 'sequence');\n"]}
@@ -0,0 +1,5 @@
1
+ import { IWordCloudChartSpec } from '@visactor/vchart';
2
+ import { BaseChartProps } from './BaseChart';
3
+ export interface WordCloudChartProps extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>, Omit<IWordCloudChartSpec, 'type'> {
4
+ }
5
+ export declare const WordCloudChart: import("react").ForwardRefExoticComponent<import("../containers/withContainer").ContainerProps & import("react").RefAttributes<any>>;
@@ -0,0 +1,4 @@
1
+ import { createChart } from "./BaseChart";
2
+
3
+ export const WordCloudChart = createChart("WordCloudChart", "wordCloud");
4
+ //# sourceMappingURL=WordCloudChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["charts/WordCloudChart.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAsB,gBAAgB,EAAE,WAAW,CAAC,CAAC","file":"WordCloudChart.js","sourcesContent":["import { IWordCloudChartSpec } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface WordCloudChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IWordCloudChartSpec, 'type'> {}\n\nexport const WordCloudChart = createChart<WordCloudChartProps>('WordCloudChart', 'wordCloud');\n"]}
@@ -0,0 +1,16 @@
1
+ export { AreaChart } from './AreaChart';
2
+ export { BarChart } from './BarChart';
3
+ export { LineChart } from './LineChart';
4
+ export { ScatterChart } from './ScatterChart';
5
+ export { PieChart } from './PieChart';
6
+ export { RoseChart } from './RoseChart';
7
+ export { RadarChart } from './RadarChart';
8
+ export { MapChart } from './MapChart';
9
+ export { HistogramChart } from './HistogramChart';
10
+ export { WordCloudChart } from './WordCloudChart';
11
+ export { FunnelChart } from './FunnelChart';
12
+ export { BoxPlotChart } from './BoxPlotChart';
13
+ export { CircularProgressChart } from './CircularProgressChart';
14
+ export { LinearProgressChart } from './LinearProgressChart';
15
+ export { RangeColumnChart } from './RangeColumnChart';
16
+ export { CommonChart } from './CommonChart';
@@ -0,0 +1,32 @@
1
+ export { AreaChart } from "./AreaChart";
2
+
3
+ export { BarChart } from "./BarChart";
4
+
5
+ export { LineChart } from "./LineChart";
6
+
7
+ export { ScatterChart } from "./ScatterChart";
8
+
9
+ export { PieChart } from "./PieChart";
10
+
11
+ export { RoseChart } from "./RoseChart";
12
+
13
+ export { RadarChart } from "./RadarChart";
14
+
15
+ export { MapChart } from "./MapChart";
16
+
17
+ export { HistogramChart } from "./HistogramChart";
18
+
19
+ export { WordCloudChart } from "./WordCloudChart";
20
+
21
+ export { FunnelChart } from "./FunnelChart";
22
+
23
+ export { BoxPlotChart } from "./BoxPlotChart";
24
+
25
+ export { CircularProgressChart } from "./CircularProgressChart";
26
+
27
+ export { LinearProgressChart } from "./LinearProgressChart";
28
+
29
+ export { RangeColumnChart } from "./RangeColumnChart";
30
+
31
+ export { CommonChart } from "./CommonChart";
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["charts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA","file":"index.js","sourcesContent":["export { AreaChart } from './AreaChart'\nexport { BarChart } from './BarChart'\nexport { LineChart } from './LineChart'\nexport { ScatterChart } from './ScatterChart'\n\nexport { PieChart } from './PieChart'\nexport { RoseChart } from './RoseChart'\n\nexport { RadarChart } from './RadarChart'\n\nexport { MapChart } from './MapChart'\nexport { HistogramChart } from './HistogramChart'\nexport { WordCloudChart } from './WordCloudChart'\nexport { FunnelChart } from './FunnelChart'\nexport { BoxPlotChart } from './BoxPlotChart'\n\nexport { CircularProgressChart } from './CircularProgressChart'\nexport { LinearProgressChart } from './LinearProgressChart'\nexport { RangeColumnChart } from './RangeColumnChart'\n\nexport { CommonChart } from './CommonChart'"]}
@@ -0,0 +1,5 @@
1
+ export interface AxisProps {
2
+ }
3
+ export declare const Axis: import("react").FC<import("./BaseComponent").BaseComponentProps & {
4
+ updateId?: number;
5
+ }>;
@@ -0,0 +1,4 @@
1
+ import { createComponent } from "./BaseComponent";
2
+
3
+ export const Axis = createComponent("Axis", "axes");
4
+ //# sourceMappingURL=Axis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/Axis.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAMlD,MAAM,CAAC,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC","file":"Axis.js","sourcesContent":["import { createComponent } from \"./BaseComponent\";\n\nexport interface AxisProps {\n //\n}\n\nexport const Axis = createComponent(\"Axis\", \"axes\");\n"]}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ export interface BaseComponentProps {
3
+ id?: string | number;
4
+ }
5
+ type ComponentProps = BaseComponentProps & {
6
+ updateId?: number;
7
+ };
8
+ export declare const createComponent: <T extends ComponentProps>(componentName: string, specName: string, supportedEvents?: Record<string, string> | null, isSingle?: boolean) => React.FC<T>;
9
+ export {};
@@ -0,0 +1,47 @@
1
+ import React, { useContext, useEffect } from "react";
2
+
3
+ import { isNil, pickWithout } from "@visactor/vutils";
4
+
5
+ import RootChartContext from "../context/chart";
6
+
7
+ import { bindEventsToChart } from "../eventsUtils";
8
+
9
+ import { uid } from "../util";
10
+
11
+ export const createComponent = (componentName, specName, supportedEvents, isSingle) => {
12
+ const ignoreKeys = [ "id", "updateId" ], notSpecKeys = supportedEvents ? Object.keys(supportedEvents).concat(ignoreKeys) : ignoreKeys, Comp = props => {
13
+ const context = useContext(RootChartContext), id = React.useRef(isNil(props.id) ? uid(specName) : props.id), eventsBinded = React.useRef(null), updateId = React.useRef(props.updateId), componentSpec = pickWithout(props, notSpecKeys);
14
+ return !!supportedEvents && bindEventsToChart(context.chart, props, eventsBinded.current, supportedEvents) && (eventsBinded.current = props),
15
+ props.updateId !== updateId.current ? updateId.current = props.updateId : updateToContext(context, id.current, specName, isSingle, componentSpec),
16
+ useEffect((() => () => {
17
+ supportedEvents && bindEventsToChart(context.chart, null, eventsBinded.current, supportedEvents),
18
+ deleteToContext(context, id.current, specName, isSingle);
19
+ }), []), null;
20
+ };
21
+ return Comp.displayName = componentName, Comp;
22
+ };
23
+
24
+ const updateToContext = (context, id, specName, isSingle, props) => {
25
+ if (context.specFromChildren) {
26
+ if (isSingle) context.specFromChildren[specName] = Object.assign({}, props); else {
27
+ context.specFromChildren[specName] || (context.specFromChildren[specName] = []);
28
+ const comps = context.specFromChildren[specName], index = comps.findIndex((entry => entry.id === id));
29
+ index >= 0 ? comps[index] = Object.assign({
30
+ id: id
31
+ }, props) : context.specFromChildren[specName].push(Object.assign({
32
+ id: id
33
+ }, props));
34
+ }
35
+ context.isChildrenUpdated = !0;
36
+ }
37
+ }, deleteToContext = (context, id, specName, isSingle) => {
38
+ var _a;
39
+ if (context.specFromChildren) if (isSingle) context.specFromChildren[specName] = null; else {
40
+ const comps = null !== (_a = context.specFromChildren[specName]) && void 0 !== _a ? _a : [], index = comps.findIndex((entry => entry.id === id));
41
+ if (index >= 0) {
42
+ const newComps = comps.slice(0, index - 1).concat(comps.slice(index + 1));
43
+ context.specFromChildren[specName] = newComps, context.isChildrenUpdated = !0;
44
+ }
45
+ }
46
+ };
47
+ //# sourceMappingURL=BaseComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/BaseComponent.tsx"],"names":[],"mappings":"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","file":"BaseComponent.js","sourcesContent":["import React, { useContext, useEffect } from \"react\";\nimport { isNil, pickWithout } from \"@visactor/vutils\";\n\nimport RootChartContext, { ChartContextType } from \"../context/chart\";\nimport { bindEventsToChart } from \"../eventsUtils\";\nimport { uid } from \"../util\";\n\nexport interface BaseComponentProps {\n id?: string | number;\n}\n\ntype ComponentProps = BaseComponentProps & { updateId?: number };\n\nexport const createComponent = <T extends ComponentProps>(\n componentName: string,\n specName: string,\n supportedEvents?: Record<string, string> | null,\n isSingle?: boolean\n) => {\n const ignoreKeys = [\"id\", \"updateId\"];\n const notSpecKeys = supportedEvents\n ? Object.keys(supportedEvents).concat(ignoreKeys)\n : ignoreKeys;\n\n const Comp: React.FC<T> = (props: T) => {\n const context = useContext(RootChartContext);\n const id = React.useRef<string | number>(\n isNil(props.id) ? uid(specName) : props.id\n );\n\n const eventsBinded = React.useRef<T>(null);\n const updateId = React.useRef<number>(props.updateId);\n\n const componentSpec: Partial<T> = pickWithout<T>(props, notSpecKeys);\n const hasPrevEventsBinded =\n !!supportedEvents &&\n bindEventsToChart(\n context.chart,\n props,\n eventsBinded.current,\n supportedEvents\n );\n if (hasPrevEventsBinded) {\n eventsBinded.current = props;\n }\n\n if (props.updateId !== updateId.current) {\n updateId.current = props.updateId;\n } else {\n updateToContext(context, id.current, specName, isSingle, componentSpec);\n }\n\n useEffect(() => {\n return () => {\n !!supportedEvents &&\n bindEventsToChart(\n context.chart,\n null,\n eventsBinded.current,\n supportedEvents\n );\n deleteToContext(context, id.current, specName, isSingle);\n };\n }, []);\n\n return null;\n };\n\n Comp.displayName = componentName;\n return Comp;\n};\n\nconst updateToContext = (\n context: ChartContextType,\n id: string | number,\n specName: string,\n isSingle: boolean,\n props: Partial<ComponentProps>\n) => {\n if (!context.specFromChildren) {\n return;\n }\n\n if (isSingle) {\n context.specFromChildren[specName] = { ...props };\n } else {\n if (!context.specFromChildren[specName]) {\n context.specFromChildren[specName] = [];\n }\n\n const comps = context.specFromChildren[specName];\n const index = comps.findIndex((entry: any) => entry.id === id);\n\n if (index >= 0) {\n comps[index] = {\n id,\n ...props,\n };\n } else {\n context.specFromChildren[specName].push({\n id,\n ...props,\n });\n }\n }\n context.isChildrenUpdated = true;\n};\n\nconst deleteToContext = (\n context: ChartContextType,\n id: string | number,\n specName: string,\n isSingle: boolean\n) => {\n if (!context.specFromChildren) {\n return;\n }\n\n if (isSingle) {\n context.specFromChildren[specName] = null;\n } else {\n const comps = context.specFromChildren[specName] ?? [];\n const index = comps.findIndex((entry: any) => entry.id === id);\n\n if (index >= 0) {\n const newComps = comps.slice(0, index - 1).concat(comps.slice(index + 1));\n\n context.specFromChildren[specName] = newComps;\n context.isChildrenUpdated = true;\n }\n }\n};\n"]}
@@ -0,0 +1,9 @@
1
+ import { BaseComponentProps } from './BaseComponent';
2
+ export interface LegendProps extends BaseComponentProps {
3
+ onLegendItemHover: (e: any) => void;
4
+ onLegendItemUnHover: (e: any) => void;
5
+ onLegendItemClick: (e: any) => void;
6
+ }
7
+ export declare const Legend: import("react").FC<BaseComponentProps & {
8
+ updateId?: number;
9
+ }>;
@@ -0,0 +1,6 @@
1
+ import { LEGEND_CUSTOMIZED_EVENTS } from "../eventsUtils";
2
+
3
+ import { createComponent } from "./BaseComponent";
4
+
5
+ export const Legend = createComponent("Legend", "legends", LEGEND_CUSTOMIZED_EVENTS);
6
+ //# sourceMappingURL=Legend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/Legend.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAsB,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAQtE,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC,QAAQ,EAAE,SAAS,EAAE,wBAAwB,CAAC,CAAC","file":"Legend.js","sourcesContent":["// import type { IDiscreteLegendSpec } from '@visactor/vchart'\nimport { LEGEND_CUSTOMIZED_EVENTS } from '../eventsUtils';\nimport { BaseComponentProps, createComponent } from './BaseComponent';\n\nexport interface LegendProps extends BaseComponentProps {\n onLegendItemHover: (e: any) => void;\n onLegendItemUnHover: (e: any) => void;\n onLegendItemClick: (e: any) => void;\n}\n\nexport const Legend = createComponent('Legend', 'legends', LEGEND_CUSTOMIZED_EVENTS);\n"]}
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import type { MarkSpec } from '@visactor/vgrammar';
3
+ export interface MarkProps extends Omit<MarkSpec, 'name'> {
4
+ id?: string | number;
5
+ glyphType?: string;
6
+ }
7
+ export interface IMarkElement extends React.ReactElement<Props, React.JSXElementConstructor<Props>> {
8
+ id: string | number;
9
+ }
10
+ type Props = MarkProps & {
11
+ updateId: number;
12
+ };
13
+ export declare const Mark: React.FC<Props>;
14
+ export {};
@@ -0,0 +1,40 @@
1
+ var __rest = this && this.__rest || function(s, e) {
2
+ var t = {};
3
+ for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
4
+ if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
5
+ var i = 0;
6
+ for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
7
+ }
8
+ return t;
9
+ };
10
+
11
+ import React, { useContext, useEffect } from "react";
12
+
13
+ import { isNil } from "@visactor/vutils";
14
+
15
+ import ViewContext from "../context/view";
16
+
17
+ import { uid } from "../util";
18
+
19
+ export const Mark = props => {
20
+ const context = useContext(ViewContext), id = React.useRef(isNil(props.id) ? uid("mark") : props.id);
21
+ return context && addOrUpdateMark(context, id.current, props), useEffect((() => () => {
22
+ context && removeMark(context, id.current);
23
+ }), []), null;
24
+ };
25
+
26
+ const addOrUpdateMark = (view, id, props) => {
27
+ var _a;
28
+ if (!view.renderer) return;
29
+ let mark = view.getMarkById(id);
30
+ const {group: group, glyphType: glyphType, updateId: updateId} = props, others = __rest(props, [ "group", "glyphType", "updateId" ]);
31
+ mark || (mark = view.mark(props.type, null !== (_a = props.group) && void 0 !== _a ? _a : view.rootMark, props.glyphType ? {
32
+ glyphType: props.glyphType
33
+ } : null).name(id)), mark.parse(others), view.runAsync();
34
+ }, removeMark = (view, id) => {
35
+ if (view.renderer) {
36
+ view.getMarkById(id);
37
+ view.removeGrammar(id);
38
+ }
39
+ };
40
+ //# sourceMappingURL=Mark.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/Mark.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGzC,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAa9B,MAAM,CAAC,MAAM,IAAI,GAAoB,CAAC,KAAY,EAAE,EAAE;IACpD,MAAM,OAAO,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IACxC,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAkB,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAEnF,IAAI,OAAO,EAAE;QACX,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC,OAAiB,EAAE,KAAK,CAAC,CAAC;KACvD;IAED,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,GAAG,EAAE;YACV,IAAI,OAAO,EAAE;gBACX,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,OAAiB,CAAC,CAAC;aAC3C;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,IAAW,EAAE,EAAU,EAAE,KAAY,EAAE,EAAE;;IAChE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;QAElB,OAAO;KACR;IAED,IAAI,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IAChC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,KAAgB,KAAK,EAAhB,MAAM,UAAK,KAAK,EAAjD,kCAAyC,CAAQ,CAAC;IACxD,IAAI,CAAC,IAAI,EAAE;QACT,IAAI,GAAI,IAAY;aACjB,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,MAAA,KAAK,CAAC,KAAK,mCAAI,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;aACvG,IAAI,CAAC,EAAE,CAAC,CAAC;KACb;IAED,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACnB,IAAI,CAAC,QAAQ,EAAE,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,IAAW,EAAE,EAAU,EAAE,EAAE;IAC7C,IAAI,IAAI,CAAC,QAAQ,EAAE;QACjB,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QACjC,IAAY,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;KACjC;AACH,CAAC,CAAC","file":"Mark.js","sourcesContent":["import React, { useContext, useEffect } from 'react';\nimport { isNil } from '@visactor/vutils';\nimport type { IView, MarkSpec } from '@visactor/vgrammar';\n\nimport ViewContext from '../context/view';\nimport { uid } from '../util';\n\nexport interface MarkProps extends Omit<MarkSpec, 'name'> {\n id?: string | number;\n glyphType?: string;\n}\n\nexport interface IMarkElement extends React.ReactElement<Props, React.JSXElementConstructor<Props>> {\n id: string | number;\n}\n\ntype Props = MarkProps & { updateId: number };\n\nexport const Mark: React.FC<Props> = (props: Props) => {\n const context = useContext(ViewContext);\n const id = React.useRef<string | number>(isNil(props.id) ? uid('mark') : props.id);\n\n if (context) {\n addOrUpdateMark(context, id.current as string, props);\n }\n\n useEffect(() => {\n return () => {\n if (context) {\n removeMark(context, id.current as string);\n }\n };\n }, []);\n\n return null;\n};\n\nconst addOrUpdateMark = (view: IView, id: string, props: Props) => {\n if (!view.renderer) {\n // view has been released\n return;\n }\n\n let mark = view.getMarkById(id);\n const { group, glyphType, updateId, ...others } = props;\n if (!mark) {\n mark = (view as any)\n .mark(props.type, props.group ?? view.rootMark, props.glyphType ? { glyphType: props.glyphType } : null)\n .name(id);\n }\n\n mark.parse(others);\n view.runAsync();\n};\n\nconst removeMark = (view: IView, id: string) => {\n if (view.renderer) {\n const mark = view.getMarkById(id);\n (view as any).removeGrammar(id);\n }\n};\n"]}
@@ -0,0 +1,5 @@
1
+ export interface RegionProps {
2
+ }
3
+ export declare const Region: import("react").FC<import("./BaseComponent").BaseComponentProps & {
4
+ updateId?: number;
5
+ }>;
@@ -0,0 +1,4 @@
1
+ import { createComponent } from "./BaseComponent";
2
+
3
+ export const Region = createComponent("Region", "region");
4
+ //# sourceMappingURL=Region.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/Region.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAMlD,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC","file":"Region.js","sourcesContent":["// import type { IRegionSpec } from '@visactor/vchart'\nimport { createComponent } from './BaseComponent';\n\nexport interface RegionProps {\n //\n}\n\nexport const Region = createComponent('Region', 'region');\n"]}
@@ -0,0 +1,4 @@
1
+ export * from './Axis';
2
+ export * from './Mark';
3
+ export * from './Region';
4
+ export * from './Legend';
@@ -0,0 +1,8 @@
1
+ export * from "./Axis";
2
+
3
+ export * from "./Mark";
4
+
5
+ export * from "./Region";
6
+
7
+ export * from "./Legend";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC","file":"index.js","sourcesContent":["export * from './Axis';\nexport * from './Mark';\nexport * from './Region';\nexport * from './Legend';"]}
@@ -0,0 +1 @@
1
+ export declare const REACT_PRIVATE_PROPS: string[];
@@ -0,0 +1,2 @@
1
+ export const REACT_PRIVATE_PROPS = [ "children", "hooks", "ref" ];
2
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC","file":"constants.js","sourcesContent":["export const REACT_PRIVATE_PROPS = [\"children\", \"hooks\", \"ref\"];\n\n"]}
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ export interface ContainerProps {
3
+ style?: React.CSSProperties;
4
+ className?: string;
5
+ width?: number | string;
6
+ height?: number | string;
7
+ }
8
+ export default function withContainer<Props extends ContainerProps, CompProps>(Comp: typeof React.Component<any, CompProps>, name?: string, getProps?: (props: any) => CompProps): React.ForwardRefExoticComponent<React.PropsWithoutRef<Props> & React.RefAttributes<any>>;
@@ -0,0 +1,33 @@
1
+ var __rest = this && this.__rest || function(s, e) {
2
+ var t = {};
3
+ for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
4
+ if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
5
+ var i = 0;
6
+ for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
7
+ }
8
+ return t;
9
+ };
10
+
11
+ import React, { useRef, useState, useLayoutEffect } from "react";
12
+
13
+ export default function withContainer(Comp, name = "ChartContainer", getProps) {
14
+ const Cls = React.forwardRef(((props, ref) => {
15
+ const container = useRef(), [inited, setInited] = useState(!1), {className: className, style: style, width: width} = props, options = __rest(props, [ "className", "style", "width" ]);
16
+ return useLayoutEffect((() => {
17
+ setInited(!0);
18
+ }), []), React.createElement("div", {
19
+ ref: container,
20
+ className: className,
21
+ style: Object.assign({
22
+ position: "relative",
23
+ height: props.height || "100%",
24
+ width: props.width || "100%"
25
+ }, style)
26
+ }, inited ? React.createElement(Comp, Object.assign({
27
+ ref: ref,
28
+ container: container.current
29
+ }, getProps ? getProps(options) : options)) : React.createElement(React.Fragment, null));
30
+ }));
31
+ return Cls.displayName = name || Comp.name, Cls;
32
+ }
33
+ //# sourceMappingURL=withContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["containers/withContainer.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AASjE,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,IAA4C,EAC5C,OAAe,gBAAgB,EAC/B,QAAoC;IAEpC,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAa,CAAC,KAAY,EAAE,GAAG,EAAE,EAAE;QAC7D,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC;QAC3B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC5C,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,KAAiB,KAAK,EAAjB,OAAO,UAAK,KAAK,EAA/C,+BAAuC,CAAQ,CAAC;QAEtD,eAAe,CAAC,GAAG,EAAE;YACnB,SAAS,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC,EAAE,EAAE,CAAC,CAAC;QAEP,OAAO,CACL,6BACE,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,SAAS,EACpB,KAAK,kBACH,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,MAAM,EAC9B,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,MAAM,IACzB,KAAK,KAGT,MAAM,CAAC,CAAC,CAAC,CACR,oBAAC,IAAI,kBACH,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,CAAC,OAAO,IACxB,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,OAAqB,CAAC,EAC3D,CACH,CAAC,CAAC,CAAC,CACF,yCAAK,CACN,CACG,CACP,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,WAAW,GAAG,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC;IACpC,OAAO,GAAG,CAAC;AACb,CAAC","file":"withContainer.js","sourcesContent":["import React, { useRef, useState, useLayoutEffect } from \"react\";\n\nexport interface ContainerProps {\n style?: React.CSSProperties;\n className?: string;\n width?: number | string;\n height?: number | string;\n}\n\nexport default function withContainer<Props extends ContainerProps, CompProps>(\n Comp: typeof React.Component<any, CompProps>,\n name: string = \"ChartContainer\",\n getProps?: (props: any) => CompProps\n) {\n const Cls = React.forwardRef<any, Props>((props: Props, ref) => {\n const container = useRef();\n const [inited, setInited] = useState(false);\n const { className, style, width, ...options } = props;\n\n useLayoutEffect(() => {\n setInited(true);\n }, []);\n\n return (\n <div\n ref={container}\n className={className}\n style={{\n position: \"relative\",\n height: props.height || \"100%\",\n width: props.width || \"100%\",\n ...style,\n }}\n >\n {inited ? (\n <Comp\n ref={ref}\n container={container.current}\n {...(getProps ? getProps(options) : (options as CompProps))}\n />\n ) : (\n <></>\n )}\n </div>\n );\n });\n Cls.displayName = name || Comp.name;\n return Cls;\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type VChart from '@visactor/vchart';
3
+ export interface ChartContextType {
4
+ chart?: VChart;
5
+ specFromChildren: any;
6
+ isChildrenUpdated?: boolean;
7
+ }
8
+ declare const ChartContext: React.Context<ChartContextType>;
9
+ export declare function withChartInstance<T>(Component: typeof React.Component): React.ForwardRefExoticComponent<React.PropsWithoutRef<T> & React.RefAttributes<any>>;
10
+ export default ChartContext;
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+
3
+ const ChartContext = React.createContext(null);
4
+
5
+ ChartContext.displayName = "ChartContext";
6
+
7
+ export function withChartInstance(Component) {
8
+ const Com = React.forwardRef(((props, ref) => React.createElement(ChartContext.Consumer, null, (ctx => React.createElement(Component, Object.assign({
9
+ ref: ref,
10
+ chart: ctx.chart
11
+ }, props))))));
12
+ return Com.displayName = Component.name, Com;
13
+ }
14
+
15
+ export default ChartContext;
16
+ //# sourceMappingURL=chart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["context/chart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,MAAM,YAAY,GAAG,KAAK,CAAC,aAAa,CAAmB,IAAI,CAAC,CAAC;AACjE,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAE1C,MAAM,UAAU,iBAAiB,CAAI,SAAiC;IACpE,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAS,CAAC,KAAQ,EAAE,GAAG,EAAE,EAAE;QACrD,OAAO,CACL,oBAAC,YAAY,CAAC,QAAQ,QACnB,CAAC,GAAqB,EAAE,EAAE,CAAC,oBAAC,SAAS,kBAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,IAAM,KAAK,EAAI,CAC1D,CACzB,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC;IACjC,OAAO,GAAG,CAAC;AACb,CAAC;AAED,eAAe,YAAY,CAAC","file":"chart.js","sourcesContent":["import React from 'react';\nimport type VChart from '@visactor/vchart';\n\nexport interface ChartContextType {\n chart?: VChart;\n specFromChildren: any;\n isChildrenUpdated?: boolean;\n}\n\nconst ChartContext = React.createContext<ChartContextType>(null);\nChartContext.displayName = 'ChartContext';\n\nexport function withChartInstance<T>(Component: typeof React.Component) {\n const Com = React.forwardRef<any, T>((props: T, ref) => {\n return (\n <ChartContext.Consumer>\n {(ctx: ChartContextType) => <Component ref={ref} chart={ctx.chart} {...props} />}\n </ChartContext.Consumer>\n );\n });\n Com.displayName = Component.name;\n return Com;\n}\n\nexport default ChartContext;\n"]}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const StageContext: React.Context<Stage>;
3
+ export declare function withStage<T>(Component: typeof React.Component): React.ForwardRefExoticComponent<React.PropsWithoutRef<T> & React.RefAttributes<any>>;
4
+ export default StageContext;
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+
3
+ const StageContext = React.createContext(null);
4
+
5
+ StageContext.displayName = "StageContext";
6
+
7
+ export function withStage(Component) {
8
+ const Com = React.forwardRef(((props, ref) => React.createElement(StageContext.Consumer, null, (ctx => React.createElement(Component, Object.assign({
9
+ ref: ref,
10
+ stage: ctx
11
+ }, props))))));
12
+ return Com.displayName = Component.name, Com;
13
+ }
14
+
15
+ export default StageContext;
16
+ //# sourceMappingURL=stage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["context/stage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,YAAY,GAAG,KAAK,CAAC,aAAa,CAAQ,IAAI,CAAC,CAAC;AACtD,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAE1C,MAAM,UAAU,SAAS,CAAI,SAAiC;IAC5D,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAS,CAAC,KAAQ,EAAE,GAAG,EAAE,EAAE;QACrD,OAAO,oBAAC,YAAY,CAAC,QAAQ,QAAE,GAAG,CAAC,EAAE,CAAC,oBAAC,SAAS,kBAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,IAAM,KAAK,EAAI,CAAyB,CAAC;IAChH,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC;IACjC,OAAO,GAAG,CAAC;AACb,CAAC;AAED,eAAe,YAAY,CAAC","file":"stage.js","sourcesContent":["import React from 'react';\nimport type { Stage } from '@visactor/vrender';\n\nconst StageContext = React.createContext<Stage>(null);\nStageContext.displayName = 'StageContext';\n\nexport function withStage<T>(Component: typeof React.Component) {\n const Com = React.forwardRef<any, T>((props: T, ref) => {\n return <StageContext.Consumer>{ctx => <Component ref={ref} stage={ctx} {...props} />}</StageContext.Consumer>;\n });\n Com.displayName = Component.name;\n return Com;\n}\n\nexport default StageContext;\n"]}
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import type { IView } from "@visactor/vgrammar";
3
+ declare const ViewContext: React.Context<IView>;
4
+ export declare function withView<T>(Component: typeof React.Component): React.ForwardRefExoticComponent<React.PropsWithoutRef<T> & React.RefAttributes<any>>;
5
+ export default ViewContext;