@visactor/react-vchart 1.8.3-alpha.0 → 1.8.3

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 (267) hide show
  1. package/cjs/VChart.d.ts +3 -1
  2. package/cjs/VChart.js +11 -3
  3. package/cjs/VChart.js.map +1 -1
  4. package/cjs/VChartSimple.d.ts +6 -0
  5. package/cjs/VChartSimple.js +10 -0
  6. package/cjs/VChartSimple.js.map +1 -0
  7. package/cjs/charts/AreaChart.d.ts +3 -1
  8. package/cjs/charts/AreaChart.js +11 -2
  9. package/cjs/charts/AreaChart.js.map +1 -1
  10. package/cjs/charts/BarChart.d.ts +3 -1
  11. package/cjs/charts/BarChart.js +11 -2
  12. package/cjs/charts/BarChart.js.map +1 -1
  13. package/cjs/charts/BaseChart.d.ts +5 -3
  14. package/cjs/charts/BaseChart.js +35 -39
  15. package/cjs/charts/BaseChart.js.map +1 -1
  16. package/cjs/charts/BoxPlotChart.d.ts +2 -0
  17. package/cjs/charts/BoxPlotChart.js +11 -2
  18. package/cjs/charts/BoxPlotChart.js.map +1 -1
  19. package/cjs/charts/CircularProgressChart.d.ts +2 -0
  20. package/cjs/charts/CircularProgressChart.js +11 -2
  21. package/cjs/charts/CircularProgressChart.js.map +1 -1
  22. package/cjs/charts/CommonChart.d.ts +2 -0
  23. package/cjs/charts/CommonChart.js +11 -2
  24. package/cjs/charts/CommonChart.js.map +1 -1
  25. package/cjs/charts/FunnelChart.d.ts +2 -0
  26. package/cjs/charts/FunnelChart.js +11 -2
  27. package/cjs/charts/FunnelChart.js.map +1 -1
  28. package/cjs/charts/HistogramChart.d.ts +2 -0
  29. package/cjs/charts/HistogramChart.js +11 -2
  30. package/cjs/charts/HistogramChart.js.map +1 -1
  31. package/cjs/charts/LineChart.d.ts +3 -1
  32. package/cjs/charts/LineChart.js +11 -2
  33. package/cjs/charts/LineChart.js.map +1 -1
  34. package/cjs/charts/LinearProgressChart.d.ts +2 -0
  35. package/cjs/charts/LinearProgressChart.js +11 -2
  36. package/cjs/charts/LinearProgressChart.js.map +1 -1
  37. package/cjs/charts/MapChart.d.ts +3 -1
  38. package/cjs/charts/MapChart.js +11 -2
  39. package/cjs/charts/MapChart.js.map +1 -1
  40. package/cjs/charts/PieChart.d.ts +3 -1
  41. package/cjs/charts/PieChart.js +11 -2
  42. package/cjs/charts/PieChart.js.map +1 -1
  43. package/cjs/charts/RadarChart.d.ts +3 -1
  44. package/cjs/charts/RadarChart.js +11 -2
  45. package/cjs/charts/RadarChart.js.map +1 -1
  46. package/cjs/charts/RangeColumnChart.d.ts +3 -1
  47. package/cjs/charts/RangeColumnChart.js +11 -2
  48. package/cjs/charts/RangeColumnChart.js.map +1 -1
  49. package/cjs/charts/RoseChart.d.ts +3 -1
  50. package/cjs/charts/RoseChart.js +11 -3
  51. package/cjs/charts/RoseChart.js.map +1 -1
  52. package/cjs/charts/ScatterChart.d.ts +3 -1
  53. package/cjs/charts/ScatterChart.js +12 -2
  54. package/cjs/charts/ScatterChart.js.map +1 -1
  55. package/cjs/charts/SequenceChart.d.ts +3 -1
  56. package/cjs/charts/SequenceChart.js +11 -2
  57. package/cjs/charts/SequenceChart.js.map +1 -1
  58. package/cjs/charts/WordCloudChart.d.ts +3 -1
  59. package/cjs/charts/WordCloudChart.js +11 -2
  60. package/cjs/charts/WordCloudChart.js.map +1 -1
  61. package/cjs/charts/index.js.map +1 -1
  62. package/cjs/components/Axis.js.map +1 -1
  63. package/cjs/components/BaseComponent.js.map +1 -1
  64. package/cjs/components/Brush.js.map +1 -1
  65. package/cjs/components/Crosshair.js.map +1 -1
  66. package/cjs/components/DataZoom.js.map +1 -1
  67. package/cjs/components/Indicator.js.map +1 -1
  68. package/cjs/components/Legend.js.map +1 -1
  69. package/cjs/components/Mark.js.map +1 -1
  70. package/cjs/components/MarkArea.js.map +1 -1
  71. package/cjs/components/MarkLine.js.map +1 -1
  72. package/cjs/components/MarkPoint.js.map +1 -1
  73. package/cjs/components/Player.js.map +1 -1
  74. package/cjs/components/Region.js +1 -2
  75. package/cjs/components/Region.js.map +1 -1
  76. package/cjs/components/ScrollBar.js +2 -1
  77. package/cjs/components/ScrollBar.js.map +1 -1
  78. package/cjs/components/Title.js.map +1 -1
  79. package/cjs/components/Tooltip.js.map +1 -1
  80. package/cjs/components/index.js.map +1 -1
  81. package/cjs/constants.js.map +1 -1
  82. package/cjs/containers/withContainer.js.map +1 -1
  83. package/cjs/context/chart.d.ts +2 -2
  84. package/cjs/context/chart.js.map +1 -1
  85. package/cjs/context/stage.d.ts +2 -2
  86. package/cjs/context/stage.js.map +1 -1
  87. package/cjs/context/view.js.map +1 -1
  88. package/cjs/eventsUtils.d.ts +2 -0
  89. package/cjs/eventsUtils.js +2 -1
  90. package/cjs/eventsUtils.js.map +1 -1
  91. package/cjs/index.d.ts +2 -2
  92. package/cjs/index.js +3 -10
  93. package/cjs/index.js.map +1 -1
  94. package/cjs/series/Area.d.ts +1 -1
  95. package/cjs/series/Area.js.map +1 -1
  96. package/cjs/series/Bar.d.ts +1 -1
  97. package/cjs/series/Bar.js.map +1 -1
  98. package/cjs/series/BaseSeries.js.map +1 -1
  99. package/cjs/series/BoxPlot.d.ts +1 -1
  100. package/cjs/series/BoxPlot.js.map +1 -1
  101. package/cjs/series/CircularProgress.d.ts +1 -1
  102. package/cjs/series/CircularProgress.js.map +1 -1
  103. package/cjs/series/Dot.d.ts +1 -1
  104. package/cjs/series/Dot.js.map +1 -1
  105. package/cjs/series/Funnel.d.ts +1 -1
  106. package/cjs/series/Funnel.js.map +1 -1
  107. package/cjs/series/Line.d.ts +1 -1
  108. package/cjs/series/Line.js.map +1 -1
  109. package/cjs/series/LinearProgress.d.ts +1 -1
  110. package/cjs/series/LinearProgress.js +1 -2
  111. package/cjs/series/LinearProgress.js.map +1 -1
  112. package/cjs/series/Link.d.ts +1 -1
  113. package/cjs/series/Link.js +2 -1
  114. package/cjs/series/Link.js.map +1 -1
  115. package/cjs/series/Map.d.ts +1 -1
  116. package/cjs/series/Map.js.map +1 -1
  117. package/cjs/series/Pie.d.ts +1 -1
  118. package/cjs/series/Pie.js.map +1 -1
  119. package/cjs/series/Radar.d.ts +1 -1
  120. package/cjs/series/Radar.js.map +1 -1
  121. package/cjs/series/RangeColumn.d.ts +1 -1
  122. package/cjs/series/RangeColumn.js.map +1 -1
  123. package/cjs/series/Rose.d.ts +1 -1
  124. package/cjs/series/Rose.js.map +1 -1
  125. package/cjs/series/Scatter.d.ts +1 -1
  126. package/cjs/series/Scatter.js.map +1 -1
  127. package/cjs/series/Series.d.ts +1 -1
  128. package/cjs/series/Series.js +1 -1
  129. package/cjs/series/Series.js.map +1 -1
  130. package/cjs/series/WordCloud.d.ts +1 -1
  131. package/cjs/series/WordCloud.js.map +1 -1
  132. package/cjs/series/index.js.map +1 -1
  133. package/cjs/util.js.map +1 -1
  134. package/esm/VChart.d.ts +3 -1
  135. package/esm/VChart.js +7 -1
  136. package/esm/VChart.js.map +1 -1
  137. package/esm/VChartSimple.d.ts +6 -0
  138. package/esm/VChartSimple.js +4 -0
  139. package/esm/VChartSimple.js.map +1 -0
  140. package/esm/charts/AreaChart.d.ts +3 -1
  141. package/esm/charts/AreaChart.js +6 -1
  142. package/esm/charts/AreaChart.js.map +1 -1
  143. package/esm/charts/BarChart.d.ts +3 -1
  144. package/esm/charts/BarChart.js +6 -1
  145. package/esm/charts/BarChart.js.map +1 -1
  146. package/esm/charts/BaseChart.d.ts +5 -3
  147. package/esm/charts/BaseChart.js +34 -41
  148. package/esm/charts/BaseChart.js.map +1 -1
  149. package/esm/charts/BoxPlotChart.d.ts +2 -0
  150. package/esm/charts/BoxPlotChart.js +6 -1
  151. package/esm/charts/BoxPlotChart.js.map +1 -1
  152. package/esm/charts/CircularProgressChart.d.ts +2 -0
  153. package/esm/charts/CircularProgressChart.js +6 -1
  154. package/esm/charts/CircularProgressChart.js.map +1 -1
  155. package/esm/charts/CommonChart.d.ts +2 -0
  156. package/esm/charts/CommonChart.js +6 -1
  157. package/esm/charts/CommonChart.js.map +1 -1
  158. package/esm/charts/FunnelChart.d.ts +2 -0
  159. package/esm/charts/FunnelChart.js +6 -1
  160. package/esm/charts/FunnelChart.js.map +1 -1
  161. package/esm/charts/HistogramChart.d.ts +2 -0
  162. package/esm/charts/HistogramChart.js +6 -1
  163. package/esm/charts/HistogramChart.js.map +1 -1
  164. package/esm/charts/LineChart.d.ts +3 -1
  165. package/esm/charts/LineChart.js +6 -1
  166. package/esm/charts/LineChart.js.map +1 -1
  167. package/esm/charts/LinearProgressChart.d.ts +2 -0
  168. package/esm/charts/LinearProgressChart.js +6 -1
  169. package/esm/charts/LinearProgressChart.js.map +1 -1
  170. package/esm/charts/MapChart.d.ts +3 -1
  171. package/esm/charts/MapChart.js +6 -1
  172. package/esm/charts/MapChart.js.map +1 -1
  173. package/esm/charts/PieChart.d.ts +3 -1
  174. package/esm/charts/PieChart.js +6 -1
  175. package/esm/charts/PieChart.js.map +1 -1
  176. package/esm/charts/RadarChart.d.ts +3 -1
  177. package/esm/charts/RadarChart.js +6 -1
  178. package/esm/charts/RadarChart.js.map +1 -1
  179. package/esm/charts/RangeColumnChart.d.ts +3 -1
  180. package/esm/charts/RangeColumnChart.js +6 -1
  181. package/esm/charts/RangeColumnChart.js.map +1 -1
  182. package/esm/charts/RoseChart.d.ts +3 -1
  183. package/esm/charts/RoseChart.js +6 -2
  184. package/esm/charts/RoseChart.js.map +1 -1
  185. package/esm/charts/ScatterChart.d.ts +3 -1
  186. package/esm/charts/ScatterChart.js +7 -1
  187. package/esm/charts/ScatterChart.js.map +1 -1
  188. package/esm/charts/SequenceChart.d.ts +3 -1
  189. package/esm/charts/SequenceChart.js +6 -1
  190. package/esm/charts/SequenceChart.js.map +1 -1
  191. package/esm/charts/WordCloudChart.d.ts +3 -1
  192. package/esm/charts/WordCloudChart.js +6 -1
  193. package/esm/charts/WordCloudChart.js.map +1 -1
  194. package/esm/charts/index.js.map +1 -1
  195. package/esm/components/Axis.js.map +1 -1
  196. package/esm/components/BaseComponent.js.map +1 -1
  197. package/esm/components/Brush.js.map +1 -1
  198. package/esm/components/Crosshair.js.map +1 -1
  199. package/esm/components/DataZoom.js.map +1 -1
  200. package/esm/components/Indicator.js.map +1 -1
  201. package/esm/components/Legend.js.map +1 -1
  202. package/esm/components/Mark.js.map +1 -1
  203. package/esm/components/MarkArea.js.map +1 -1
  204. package/esm/components/MarkLine.js.map +1 -1
  205. package/esm/components/MarkPoint.js.map +1 -1
  206. package/esm/components/Player.js.map +1 -1
  207. package/esm/components/Region.js +1 -2
  208. package/esm/components/Region.js.map +1 -1
  209. package/esm/components/ScrollBar.js +2 -1
  210. package/esm/components/ScrollBar.js.map +1 -1
  211. package/esm/components/Title.js.map +1 -1
  212. package/esm/components/Tooltip.js.map +1 -1
  213. package/esm/components/index.js.map +1 -1
  214. package/esm/constants.js.map +1 -1
  215. package/esm/containers/withContainer.js.map +1 -1
  216. package/esm/context/chart.d.ts +2 -2
  217. package/esm/context/chart.js.map +1 -1
  218. package/esm/context/stage.d.ts +2 -2
  219. package/esm/context/stage.js.map +1 -1
  220. package/esm/context/view.js.map +1 -1
  221. package/esm/eventsUtils.d.ts +2 -0
  222. package/esm/eventsUtils.js +2 -1
  223. package/esm/eventsUtils.js.map +1 -1
  224. package/esm/index.d.ts +2 -2
  225. package/esm/index.js +2 -2
  226. package/esm/index.js.map +1 -1
  227. package/esm/series/Area.d.ts +1 -1
  228. package/esm/series/Area.js.map +1 -1
  229. package/esm/series/Bar.d.ts +1 -1
  230. package/esm/series/Bar.js.map +1 -1
  231. package/esm/series/BaseSeries.js.map +1 -1
  232. package/esm/series/BoxPlot.d.ts +1 -1
  233. package/esm/series/BoxPlot.js.map +1 -1
  234. package/esm/series/CircularProgress.d.ts +1 -1
  235. package/esm/series/CircularProgress.js.map +1 -1
  236. package/esm/series/Dot.d.ts +1 -1
  237. package/esm/series/Dot.js.map +1 -1
  238. package/esm/series/Funnel.d.ts +1 -1
  239. package/esm/series/Funnel.js.map +1 -1
  240. package/esm/series/Line.d.ts +1 -1
  241. package/esm/series/Line.js.map +1 -1
  242. package/esm/series/LinearProgress.d.ts +1 -1
  243. package/esm/series/LinearProgress.js +1 -2
  244. package/esm/series/LinearProgress.js.map +1 -1
  245. package/esm/series/Link.d.ts +1 -1
  246. package/esm/series/Link.js +2 -1
  247. package/esm/series/Link.js.map +1 -1
  248. package/esm/series/Map.d.ts +1 -1
  249. package/esm/series/Map.js.map +1 -1
  250. package/esm/series/Pie.d.ts +1 -1
  251. package/esm/series/Pie.js.map +1 -1
  252. package/esm/series/Radar.d.ts +1 -1
  253. package/esm/series/Radar.js.map +1 -1
  254. package/esm/series/RangeColumn.d.ts +1 -1
  255. package/esm/series/RangeColumn.js.map +1 -1
  256. package/esm/series/Rose.d.ts +1 -1
  257. package/esm/series/Rose.js.map +1 -1
  258. package/esm/series/Scatter.d.ts +1 -1
  259. package/esm/series/Scatter.js.map +1 -1
  260. package/esm/series/Series.d.ts +1 -1
  261. package/esm/series/Series.js +1 -1
  262. package/esm/series/Series.js.map +1 -1
  263. package/esm/series/WordCloud.d.ts +1 -1
  264. package/esm/series/WordCloud.js.map +1 -1
  265. package/esm/series/index.js.map +1 -1
  266. package/esm/util.js.map +1 -1
  267. package/package.json +6 -6
package/esm/VChart.js CHANGED
@@ -1,3 +1,9 @@
1
1
  import { createChart } from "./charts/BaseChart";
2
2
 
3
- export const VChart = createChart("VChart");
3
+ import VChartCore from "@visactor/vchart";
4
+
5
+ export { VChartCore };
6
+
7
+ export const VChart = createChart("VChart", {
8
+ vchartConstrouctor: VChartCore
9
+ });
package/esm/VChart.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["VChart.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAIjE,MAAM,CAAC,MAAM,MAAM,GAAG,WAAW,CAAc,QAAQ,CAAC,CAAC","file":"VChart.js","sourcesContent":["import { BaseChartProps, createChart } from './charts/BaseChart';\n\nexport type VChartProps = Omit<BaseChartProps, 'container' | 'data' | 'width' | 'height'>;\n\nexport const VChart = createChart<VChartProps>('VChart');\n"]}
1
+ {"version":3,"sources":["../src/VChart.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAItB,MAAM,CAAC,MAAM,MAAM,GAAG,WAAW,CAAc,QAAQ,EAAE;IACvD,kBAAkB,EAAE,UAAU;CAC/B,CAAC,CAAC","file":"VChart.js","sourcesContent":["import { BaseChartProps, createChart } from './charts/BaseChart';\nimport type { IVChartConstructor } from '@visactor/vchart';\nimport VChartCore from '@visactor/vchart';\nexport { VChartCore };\n\nexport type VChartProps = Omit<BaseChartProps, 'container' | 'data' | 'width' | 'height' | 'type'>;\n\nexport const VChart = createChart<VChartProps>('VChart', {\n vchartConstrouctor: VChartCore\n});\n"]}
@@ -0,0 +1,6 @@
1
+ import type { IVChartConstructor } from '@visactor/vchart';
2
+ import { BaseChartProps } from './charts/BaseChart';
3
+ export type VChartSimpleProps = Omit<BaseChartProps, 'container' | 'data' | 'width' | 'height' | 'vchartConstrouctor'>;
4
+ export declare const VChartSimple: import("react").ForwardRefExoticComponent<VChartSimpleProps & {
5
+ vchartConstrouctor: IVChartConstructor;
6
+ } & import("./containers/withContainer").ContainerProps & import("react").RefAttributes<any>>;
@@ -0,0 +1,4 @@
1
+ import { createChart } from "./charts/BaseChart";
2
+
3
+ export const VChartSimple = createChart("VChartSimple");
4
+ //# sourceMappingURL=VChartSimple.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/VChartSimple.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAIjE,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAiE,cAAc,CAAC,CAAC","file":"VChartSimple.js","sourcesContent":["import type { IVChartConstructor } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './charts/BaseChart';\n\nexport type VChartSimpleProps = Omit<BaseChartProps, 'container' | 'data' | 'width' | 'height' | 'vchartConstrouctor'>;\n\nexport const VChartSimple = createChart<VChartSimpleProps & { vchartConstrouctor: IVChartConstructor }>('VChartSimple');\n"]}
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
- import { IAreaChartSpec } from '@visactor/vchart';
2
+ import type { IAreaChartSpec } from '@visactor/vchart';
3
3
  import { BaseChartProps } from './BaseChart';
4
4
  export interface AreaChartProps extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>, Omit<IAreaChartSpec, 'type'> {
5
5
  }
6
6
  export declare const AreaChart: React.ForwardRefExoticComponent<AreaChartProps & {
7
7
  children?: React.ReactNode;
8
+ } & {
9
+ type: 'area';
8
10
  } & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
@@ -1,4 +1,9 @@
1
+ import { default as VChart } from "@visactor/vchart";
2
+
1
3
  import { createChart } from "./BaseChart";
2
4
 
3
- export const AreaChart = createChart("AreaChart", "area");
5
+ export const AreaChart = createChart("AreaChart", {
6
+ type: "area",
7
+ vchartConstrouctor: VChart
8
+ });
4
9
  //# sourceMappingURL=AreaChart.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["charts/AreaChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAA0C,WAAW,EAAE,MAAM,CAAC,CAAC","file":"AreaChart.js","sourcesContent":["import React from 'react';\nimport { IAreaChartSpec } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface AreaChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IAreaChartSpec, 'type'> {}\n\nexport const AreaChart = createChart<React.PropsWithChildren<AreaChartProps>>('AreaChart', 'area');\n"]}
1
+ {"version":3,"sources":["../src/charts/AreaChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAA6D,WAAW,EAAE;IAC5G,IAAI,EAAE,MAAM;IACZ,kBAAkB,EAAE,MAAM;CAC3B,CAAC,CAAC","file":"AreaChart.js","sourcesContent":["import React from 'react';\nimport type { IAreaChartSpec } from '@visactor/vchart';\nimport { default as VChart } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface AreaChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IAreaChartSpec, 'type'> {}\n\nexport const AreaChart = createChart<React.PropsWithChildren<AreaChartProps> & { type: 'area' }>('AreaChart', {\n type: 'area',\n vchartConstrouctor: VChart\n});\n"]}
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
- import { IBarChartSpec } from '@visactor/vchart';
2
+ import type { IBarChartSpec } from '@visactor/vchart';
3
3
  import { BaseChartProps } from './BaseChart';
4
4
  export interface BarChartProps extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>, Omit<IBarChartSpec, 'type'> {
5
5
  }
6
6
  export declare const BarChart: React.ForwardRefExoticComponent<BarChartProps & {
7
7
  children?: React.ReactNode;
8
+ } & {
9
+ type: 'bar';
8
10
  } & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
@@ -1,4 +1,9 @@
1
+ import { default as VChart } from "@visactor/vchart";
2
+
1
3
  import { createChart } from "./BaseChart";
2
4
 
3
- export const BarChart = createChart("BarChart", "bar");
5
+ export const BarChart = createChart("BarChart", {
6
+ type: "bar",
7
+ vchartConstrouctor: VChart
8
+ });
4
9
  //# sourceMappingURL=BarChart.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["charts/BarChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAQ1D,MAAM,CAAC,MAAM,QAAQ,GAAG,WAAW,CAAyC,UAAU,EAAE,KAAK,CAAC,CAAC","file":"BarChart.js","sourcesContent":["import React from 'react';\nimport { IBarChartSpec } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface BarChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IBarChartSpec, 'type'> {\n //\n}\n\nexport const BarChart = createChart<React.PropsWithChildren<BarChartProps>>('BarChart', 'bar');\n"]}
1
+ {"version":3,"sources":["../src/charts/BarChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAQ1D,MAAM,CAAC,MAAM,QAAQ,GAAG,WAAW,CAA2D,UAAU,EAAE;IACxG,IAAI,EAAE,KAAK;IACX,kBAAkB,EAAE,MAAM;CAC3B,CAAC,CAAC","file":"BarChart.js","sourcesContent":["import React from 'react';\nimport type { IBarChartSpec } from '@visactor/vchart';\nimport { default as VChart } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface BarChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IBarChartSpec, 'type'> {\n //\n}\n\nexport const BarChart = createChart<React.PropsWithChildren<BarChartProps> & { type: 'bar' }>('BarChart', {\n type: 'bar',\n vchartConstrouctor: VChart\n});\n"]}
@@ -1,9 +1,10 @@
1
- import VChart, { IData, IInitOption, ISpec } from '@visactor/vchart';
1
+ import type { IVChart, IData, IInitOption, ISpec, IVChartConstructor } from '@visactor/vchart';
2
2
  import React from 'react';
3
3
  import { ContainerProps } from '../containers/withContainer';
4
4
  import { EventsProps, LegendEventProps, ScrollBarEventProps, BrushEventProps, DataZoomEventProps, PlayerEventProps, DimensionEventProps, HierarchyEventProps, ChartLifeCycleEventProps } from '../eventsUtils';
5
5
  export type ChartOptions = Omit<IInitOption, 'dom'>;
6
6
  export interface BaseChartProps extends EventsProps, LegendEventProps, ScrollBarEventProps, BrushEventProps, DataZoomEventProps, PlayerEventProps, DimensionEventProps, HierarchyEventProps, ChartLifeCycleEventProps {
7
+ vchartConstrouctor?: IVChartConstructor;
7
8
  type?: string;
8
9
  container?: HTMLDivElement;
9
10
  spec?: ISpec;
@@ -12,9 +13,10 @@ export interface BaseChartProps extends EventsProps, LegendEventProps, ScrollBar
12
13
  height?: number;
13
14
  options?: ChartOptions;
14
15
  skipFunctionDiff?: boolean;
15
- onReady?: (instance: VChart, isInitial: boolean) => void;
16
+ onReady?: (instance: IVChart, isInitial: boolean) => void;
16
17
  onError?: (err: Error) => void;
18
+ useSyncRender?: boolean;
17
19
  }
18
20
  type Props = React.PropsWithChildren<BaseChartProps>;
19
- export declare const createChart: <T extends Props>(componentName: string, type?: string, callback?: (props: T) => T) => React.ForwardRefExoticComponent<React.PropsWithoutRef<T & ContainerProps> & React.RefAttributes<any>>;
21
+ export declare const createChart: <T extends Props>(componentName: string, defaultProps?: Partial<T>, callback?: (props: T, defaultProps?: Partial<T>) => T) => React.ForwardRefExoticComponent<React.PropsWithoutRef<T & ContainerProps> & React.RefAttributes<any>>;
20
22
  export {};
@@ -1,5 +1,3 @@
1
- import VChart from "@visactor/vchart";
2
-
3
1
  import React, { useState, useEffect, useRef, useImperativeHandle } from "react";
4
2
 
5
3
  import withContainer from "../containers/withContainer";
@@ -20,56 +18,54 @@ const notSpecKeys = [ ...REACT_PRIVATE_PROPS, ...CHART_EVENTS_KEYS, "skipFunctio
20
18
  const [updateId, setUpdateId] = useState(0), chartContext = useRef({
21
19
  specFromChildren: {}
22
20
  });
23
- useImperativeHandle(ref, (() => chartContext.current.chart));
24
- const hasSpec = !!props.spec, [view, setView] = useState(null), isUnmount = useRef(!1), prevSpec = useRef(pickWithout(props, notSpecKeys)), eventsBinded = React.useRef(null), skipFunctionDiff = !!props.skipFunctionDiff, parseSpec = props => hasSpec && props.spec ? props.spec : Object.assign(Object.assign({}, prevSpec.current), chartContext.current.specFromChildren), handleChartRender = () => {
21
+ useImperativeHandle(ref, (() => {
22
+ var _a;
23
+ return null === (_a = chartContext.current) || void 0 === _a ? void 0 : _a.chart;
24
+ }));
25
+ const hasSpec = !!props.spec, [view, setView] = useState(null), isUnmount = useRef(!1), prevSpec = useRef(pickWithout(props, notSpecKeys)), eventsBinded = React.useRef(null), skipFunctionDiff = !!props.skipFunctionDiff, useSyncRender = !!props.useSyncRender, parseSpec = props => {
26
+ var _a;
27
+ return hasSpec && props.spec ? props.spec : Object.assign(Object.assign({}, prevSpec.current), null === (_a = chartContext.current) || void 0 === _a ? void 0 : _a.specFromChildren);
28
+ }, handleChartRender = () => {
25
29
  bindEventsToChart(chartContext.current.chart, props, eventsBinded.current, CHART_EVENTS);
26
30
  const newView = chartContext.current.chart.getCompiler().getVGrammarView();
27
31
  isUnmount.current || (setUpdateId(updateId + 1), props.onReady && props.onReady(chartContext.current.chart, 0 === updateId)),
28
32
  setView(newView);
29
33
  };
30
34
  return useEffect((() => {
31
- if (!chartContext.current.chart) return (props => {
32
- const cs = new VChart(parseSpec(props), Object.assign(Object.assign({}, props.options), {
35
+ var _a;
36
+ if (!(null === (_a = chartContext.current) || void 0 === _a ? void 0 : _a.chart)) return (props => {
37
+ const cs = new props.vchartConstrouctor(parseSpec(props), Object.assign(Object.assign({}, props.options), {
38
+ onError: props.onError,
33
39
  autoFit: !0,
34
40
  dom: props.container
35
41
  }));
36
42
  chartContext.current = Object.assign(Object.assign({}, chartContext.current), {
37
43
  chart: cs
38
44
  });
39
- })(props), (() => {
40
- if (chartContext.current.chart) {
41
- const renderPromise = chartContext.current.chart.renderAsync().then(handleChartRender);
42
- props.onError && renderPromise.catch(props.onError);
43
- }
44
- })(), bindEventsToChart(chartContext.current.chart, props, null, CHART_EVENTS),
45
- chartContext.current = Object.assign(Object.assign({}, chartContext.current), {
45
+ })(props), chartContext.current.chart && (useSyncRender ? (chartContext.current.chart.renderSync(),
46
+ handleChartRender()) : chartContext.current.chart.renderAsync().then(handleChartRender)),
47
+ bindEventsToChart(chartContext.current.chart, props, null, CHART_EVENTS), chartContext.current = Object.assign(Object.assign({}, chartContext.current), {
46
48
  isChildrenUpdated: !1
47
49
  }), void (eventsBinded.current = props);
48
- if (hasSpec) {
49
- if (!isEqual(eventsBinded.current.spec, props.spec, {
50
- skipFunction: skipFunctionDiff
51
- })) {
52
- eventsBinded.current = props;
53
- const updatePromise = chartContext.current.chart.updateSpec(parseSpec(props), void 0, {
54
- morph: !1,
55
- enableExitAnimation: !1
56
- }).then(handleChartRender);
57
- props.onError && updatePromise.catch(props.onError);
58
- }
59
- return;
60
- }
50
+ if (hasSpec) return void (isEqual(eventsBinded.current.spec, props.spec, {
51
+ skipFunction: skipFunctionDiff
52
+ }) || (eventsBinded.current = props, useSyncRender ? (chartContext.current.chart.updateSpecSync(parseSpec(props), void 0, {
53
+ morph: !1,
54
+ enableExitAnimation: !1
55
+ }), handleChartRender()) : chartContext.current.chart.updateSpec(parseSpec(props), void 0, {
56
+ morph: !1,
57
+ enableExitAnimation: !1
58
+ }).then(handleChartRender)));
61
59
  const newSpec = pickWithout(props, notSpecKeys);
62
- if (!isEqual(newSpec, prevSpec.current, {
60
+ isEqual(newSpec, prevSpec.current, {
63
61
  skipFunction: skipFunctionDiff
64
- }) || chartContext.current.isChildrenUpdated) {
65
- prevSpec.current = newSpec;
66
- const updatePromise = chartContext.current.chart.updateSpec(parseSpec(props), void 0, {
67
- morph: !1,
68
- enableExitAnimation: !1
69
- }).then(handleChartRender);
70
- props.onError && updatePromise.catch(props.onError);
71
- }
72
- chartContext.current = Object.assign(Object.assign({}, chartContext.current), {
62
+ }) && !chartContext.current.isChildrenUpdated || (prevSpec.current = newSpec, useSyncRender ? (chartContext.current.chart.updateSpecSync(parseSpec(props), void 0, {
63
+ morph: !1,
64
+ enableExitAnimation: !1
65
+ }), handleChartRender()) : chartContext.current.chart.updateSpec(parseSpec(props), void 0, {
66
+ morph: !1,
67
+ enableExitAnimation: !1
68
+ }).then(handleChartRender)), chartContext.current = Object.assign(Object.assign({}, chartContext.current), {
73
69
  isChildrenUpdated: !1
74
70
  });
75
71
  }), [ props ]), useEffect((() => () => {
@@ -89,11 +85,8 @@ const notSpecKeys = [ ...REACT_PRIVATE_PROPS, ...CHART_EVENTS_KEYS, "skipFunctio
89
85
  }))));
90
86
  }));
91
87
 
92
- export const createChart = (componentName, type, callback) => {
93
- const Com = withContainer(BaseChart, componentName, (props => (props.type = type,
94
- callback ? callback(props) : type ? Object.assign(Object.assign({}, props), {
95
- type: type
96
- }) : props)));
88
+ export const createChart = (componentName, defaultProps, callback) => {
89
+ const Com = withContainer(BaseChart, componentName, (props => callback ? callback(props, defaultProps) : defaultProps ? Object.assign(props, defaultProps) : props));
97
90
  return Com.displayName = componentName, Com;
98
91
  };
99
92
  //# sourceMappingURL=BaseChart.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["charts/BaseChart.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAqC,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAChF,OAAO,aAAiC,MAAM,6BAA6B,CAAC;AAC5E,OAAO,gBAAsC,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EACL,iBAAiB,EAEjB,iBAAiB,EACjB,YAAY,EASb,MAAM,gBAAgB,CAAC;AAuCxB,MAAM,WAAW,GAAG;IAClB,GAAG,mBAAmB;IACtB,GAAG,i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Aa,EAAE,QAA0B,EAAE,EAAE;IAC/G,MAAM,GAAG,GAAG,aAAa,CAAoB,SAAgB,EAAE,aAAa,EAAE,CAAC,KAAQ,EAAE,EAAE;QACzF,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;QAElB,IAAI,QAAQ,EAAE;YACZ,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;SACxB;QAED,IAAI,IAAI,EAAE;YACR,uCAAY,KAAK,KAAE,IAAI,IAAG;SAC3B;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,WAAW,GAAG,aAAa,CAAC;IAChC,OAAO,GAAG,CAAC;AACb,CAAC,CAAC","file":"BaseChart.js","sourcesContent":["import VChart, { IData, IInitOption, ISpec } from '@visactor/vchart';\nimport React, { useState, useEffect, useRef, useImperativeHandle } from 'react';\nimport withContainer, { ContainerProps } from '../containers/withContainer';\nimport RootChartContext, { ChartContextType } from '../context/chart';\nimport type { IView } from '@visactor/vgrammar-core';\nimport { isEqual, pickWithout } from '@visactor/vutils';\nimport ViewContext from '../context/view';\nimport { toArray } from '../util';\nimport { REACT_PRIVATE_PROPS } from '../constants';\nimport { IMarkElement } from '../components';\nimport {\n bindEventsToChart,\n EventsProps,\n CHART_EVENTS_KEYS,\n CHART_EVENTS,\n LegendEventProps,\n ScrollBarEventProps,\n BrushEventProps,\n DataZoomEventProps,\n PlayerEventProps,\n DimensionEventProps,\n HierarchyEventProps,\n ChartLifeCycleEventProps\n} from '../eventsUtils';\n\nexport type ChartOptions = Omit<IInitOption, 'dom'>;\n\nexport interface BaseChartProps\n extends EventsProps,\n LegendEventProps,\n ScrollBarEventProps,\n BrushEventProps,\n DataZoomEventProps,\n PlayerEventProps,\n DimensionEventProps,\n HierarchyEventProps,\n ChartLifeCycleEventProps {\n type?: string;\n /** 上层container */\n container?: HTMLDivElement;\n /**\n * used only by <VChart />\n */\n spec?: ISpec;\n /** 数据 */\n data?: IData;\n /** 画布宽度 */\n width?: number;\n /** 画布高度 */\n height?: number;\n /** 图表配置 */\n options?: ChartOptions;\n /** skip function diff when component update */\n skipFunctionDiff?: boolean;\n /** 图表渲染完成事件 */\n onReady?: (instance: VChart, isInitial: boolean) => void;\n /** throw error when chart run into an error */\n onError?: (err: Error) => void;\n}\n\ntype Props = React.PropsWithChildren<BaseChartProps>;\n\nconst notSpecKeys = [\n ...REACT_PRIVATE_PROPS,\n ...CHART_EVENTS_KEYS,\n 'skipFunctionDiff',\n 'onError',\n 'onReady',\n 'spec',\n 'container',\n 'options'\n];\n\nconst BaseChart: React.FC<Props> = React.forwardRef((props, ref) => {\n const [updateId, setUpdateId] = useState<number>(0);\n const chartContext = useRef<ChartContextType>({\n specFromChildren: {}\n });\n useImperativeHandle(ref, () => chartContext.current.chart);\n const hasSpec = !!props.spec;\n const [view, setView] = useState<IView>(null);\n const isUnmount = useRef<boolean>(false);\n const prevSpec = useRef(pickWithout(props, notSpecKeys));\n const eventsBinded = React.useRef<BaseChartProps>(null);\n const skipFunctionDiff = !!props.skipFunctionDiff;\n\n const parseSpec = (props: Props) => {\n if (hasSpec && props.spec) {\n return props.spec;\n }\n\n return {\n ...prevSpec.current,\n ...chartContext.current.specFromChildren\n };\n };\n\n const createChart = (props: Props) => {\n const cs = new VChart(parseSpec(props), {\n ...props.options,\n autoFit: true,\n dom: props.container\n });\n chartContext.current = { ...chartContext.current, chart: cs };\n };\n\n const handleChartRender = () => {\n // rebind events after render\n bindEventsToChart(chartContext.current.chart, props, eventsBinded.current, CHART_EVENTS);\n\n const newView = chartContext.current.chart.getCompiler().getVGrammarView();\n if (!isUnmount.current) {\n setUpdateId(updateId + 1);\n if (props.onReady) {\n props.onReady(chartContext.current.chart, updateId === 0);\n }\n }\n setView(newView);\n };\n\n const renderChart = () => {\n if (chartContext.current.chart) {\n // eslint-disable-next-line promise/catch-or-return\n const renderPromise = chartContext.current.chart.renderAsync().then(handleChartRender);\n\n if (props.onError) {\n renderPromise.catch(props.onError);\n }\n }\n };\n\n useEffect(() => {\n if (!chartContext.current.chart) {\n createChart(props);\n renderChart();\n bindEventsToChart(chartContext.current.chart, props, null, CHART_EVENTS);\n chartContext.current = {\n ...chartContext.current,\n isChildrenUpdated: false\n };\n eventsBinded.current = props;\n return;\n }\n\n if (hasSpec) {\n if (!isEqual(eventsBinded.current.spec, props.spec, { skipFunction: skipFunctionDiff })) {\n eventsBinded.current = props;\n // eslint-disable-next-line promise/catch-or-return\n const updatePromise = chartContext.current.chart\n .updateSpec(parseSpec(props), undefined, { morph: false, enableExitAnimation: false }) // morph临时关掉\n .then(handleChartRender);\n\n if (props.onError) {\n updatePromise.catch(props.onError);\n }\n }\n return;\n }\n\n const newSpec = pickWithout(props, notSpecKeys);\n\n if (\n !isEqual(newSpec, prevSpec.current, { skipFunction: skipFunctionDiff }) ||\n chartContext.current.isChildrenUpdated\n ) {\n prevSpec.current = newSpec;\n // eslint-disable-next-line promise/catch-or-return\n const updatePromise = chartContext.current.chart\n .updateSpec(parseSpec(props), undefined, { morph: false, enableExitAnimation: false }) // morph临时关掉\n .then(handleChartRender);\n\n if (props.onError) {\n updatePromise.catch(props.onError);\n }\n }\n chartContext.current = {\n ...chartContext.current,\n isChildrenUpdated: false\n };\n }, [props]);\n\n useEffect(() => {\n return () => {\n if (chartContext) {\n if (chartContext.current.chart) {\n chartContext.current.chart.release();\n }\n chartContext.current = null;\n }\n isUnmount.current = true;\n };\n }, []);\n\n return (\n <RootChartContext.Provider value={chartContext.current}>\n <ViewContext.Provider value={view}>\n {toArray(props.children).map((child, index) => {\n return (\n <React.Fragment key={(child as any)?.props?.id ?? (child as any)?.id ?? `child-${index}`}>\n {React.cloneElement(child as IMarkElement, {\n updateId: updateId\n })}\n </React.Fragment>\n );\n })}\n </ViewContext.Provider>\n </RootChartContext.Provider>\n );\n});\n\nexport const createChart = <T extends Props>(componentName: string, type?: string, callback?: (props: T) => T) => {\n const Com = withContainer<ContainerProps, T>(BaseChart as any, componentName, (props: T) => {\n props.type = type;\n\n if (callback) {\n return callback(props);\n }\n\n if (type) {\n return { ...props, type };\n }\n return props;\n });\n Com.displayName = componentName;\n return Com;\n};\n"]}
1
+ {"version":3,"sources":["../src/charts/BaseChart.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAChF,OAAO,aAAiC,MAAM,6BAA6B,CAAC;AAC5E,OAAO,gBAAsC,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EACL,iBAAiB,EAEjB,iBAAiB,EACjB,YAAY,EASb,MAAM,gBAAgB,CAAC;AA8CxB,MAAM,WAAW,GAAG;IAClB,GAAG,mBAAmB;IACtB,GAAG,iBAAiB;IACpB,kBAAkB;IAClB,SAAS;IACT,SAAS;IACT,MAAM;IACN,WAAW;IACX,SAAS;CACV,CAAC;AAEF,MAAM,SAAS,GAAoB,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACjE,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAS,CAAC,CAAC,CAAC;IACpD,MAAM,YAAY,GAAG,MAAM,CAAmB;QAC5C,gBAAgB,EAAE,EAAE;KACrB,CAAC,CAAC;IACH,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,WAAC,OAAA,MAAA,YAAY,CAAC,OAAO,0CAAE,KAAK,CAAA,EAAA,CAAC,CAAC;IAC5D,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;IAC7B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ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AQ,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;SACtC;QAED,IAAI,YAAY,EAAE;YAChB,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;SAC3C;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,WAAW,GAAG,aAAa,CAAC;IAChC,OAAO,GAAG,CAAC;AACb,CAAC,CAAC","file":"BaseChart.js","sourcesContent":["import type { IVChart, IData, IInitOption, ISpec, IVChartConstructor } from '@visactor/vchart';\nimport React, { useState, useEffect, useRef, useImperativeHandle } from 'react';\nimport withContainer, { ContainerProps } from '../containers/withContainer';\nimport RootChartContext, { ChartContextType } from '../context/chart';\nimport type { IView } from '@visactor/vgrammar-core';\nimport { isEqual, pickWithout } from '@visactor/vutils';\nimport ViewContext from '../context/view';\nimport { toArray } from '../util';\nimport { REACT_PRIVATE_PROPS } from '../constants';\nimport { IMarkElement } from '../components';\nimport {\n bindEventsToChart,\n EventsProps,\n CHART_EVENTS_KEYS,\n CHART_EVENTS,\n LegendEventProps,\n ScrollBarEventProps,\n BrushEventProps,\n DataZoomEventProps,\n PlayerEventProps,\n DimensionEventProps,\n HierarchyEventProps,\n ChartLifeCycleEventProps\n} from '../eventsUtils';\n\nexport type ChartOptions = Omit<IInitOption, 'dom'>;\n\nexport interface BaseChartProps\n extends EventsProps,\n LegendEventProps,\n ScrollBarEventProps,\n BrushEventProps,\n DataZoomEventProps,\n PlayerEventProps,\n DimensionEventProps,\n HierarchyEventProps,\n ChartLifeCycleEventProps {\n vchartConstrouctor?: IVChartConstructor;\n type?: string;\n /** 上层container */\n container?: HTMLDivElement;\n /**\n * used only by <VChart />\n */\n spec?: ISpec;\n /** 数据 */\n data?: IData;\n /** 画布宽度 */\n width?: number;\n /** 画布高度 */\n height?: number;\n /** 图表配置 */\n options?: ChartOptions;\n /** skip function diff when component update */\n skipFunctionDiff?: boolean;\n /** 图表渲染完成事件 */\n onReady?: (instance: IVChart, isInitial: boolean) => void;\n /** throw error when chart run into an error */\n onError?: (err: Error) => void;\n /**\n * use sync render\n *\n * @since 1.8.3\n **/\n useSyncRender?: boolean;\n}\n\ntype Props = React.PropsWithChildren<BaseChartProps>;\n\nconst notSpecKeys = [\n ...REACT_PRIVATE_PROPS,\n ...CHART_EVENTS_KEYS,\n 'skipFunctionDiff',\n 'onError',\n 'onReady',\n 'spec',\n 'container',\n 'options'\n];\n\nconst BaseChart: React.FC<Props> = React.forwardRef((props, ref) => {\n const [updateId, setUpdateId] = useState<number>(0);\n const chartContext = useRef<ChartContextType>({\n specFromChildren: {}\n });\n useImperativeHandle(ref, () => chartContext.current?.chart);\n const hasSpec = !!props.spec;\n const [view, setView] = useState<IView>(null);\n const isUnmount = useRef<boolean>(false);\n const prevSpec = useRef(pickWithout(props, notSpecKeys));\n const eventsBinded = React.useRef<BaseChartProps>(null);\n const skipFunctionDiff = !!props.skipFunctionDiff;\n const useSyncRender = !!props.useSyncRender;\n\n const parseSpec = (props: Props) => {\n if (hasSpec && props.spec) {\n return props.spec;\n }\n\n return {\n ...prevSpec.current,\n ...chartContext.current?.specFromChildren\n };\n };\n\n const createChart = (props: Props) => {\n const cs = new props.vchartConstrouctor(parseSpec(props), {\n ...props.options,\n onError: props.onError,\n autoFit: true,\n dom: props.container\n });\n chartContext.current = { ...chartContext.current, chart: cs };\n };\n\n const handleChartRender = () => {\n // rebind events after render\n bindEventsToChart(chartContext.current.chart, props, eventsBinded.current, CHART_EVENTS);\n\n const newView = chartContext.current.chart.getCompiler().getVGrammarView();\n if (!isUnmount.current) {\n setUpdateId(updateId + 1);\n if (props.onReady) {\n props.onReady(chartContext.current.chart, updateId === 0);\n }\n }\n setView(newView);\n };\n\n const renderChart = () => {\n if (chartContext.current.chart) {\n if (useSyncRender) {\n chartContext.current.chart.renderSync();\n handleChartRender();\n } else {\n // eslint-disable-next-line promise/catch-or-return\n chartContext.current.chart.renderAsync().then(handleChartRender);\n }\n }\n };\n\n useEffect(() => {\n if (!chartContext.current?.chart) {\n createChart(props);\n renderChart();\n bindEventsToChart(chartContext.current.chart, props, null, CHART_EVENTS);\n chartContext.current = {\n ...chartContext.current,\n isChildrenUpdated: false\n };\n eventsBinded.current = props;\n return;\n }\n\n if (hasSpec) {\n if (!isEqual(eventsBinded.current.spec, props.spec, { skipFunction: skipFunctionDiff })) {\n eventsBinded.current = props;\n if (useSyncRender) {\n chartContext.current.chart.updateSpecSync(parseSpec(props), undefined, {\n morph: false,\n enableExitAnimation: false\n });\n handleChartRender();\n } else {\n // eslint-disable-next-line promise/catch-or-return\n chartContext.current.chart\n .updateSpec(parseSpec(props), undefined, { morph: false, enableExitAnimation: false }) // morph临时关掉\n .then(handleChartRender);\n }\n }\n return;\n }\n\n const newSpec = pickWithout(props, notSpecKeys);\n\n if (\n !isEqual(newSpec, prevSpec.current, { skipFunction: skipFunctionDiff }) ||\n chartContext.current.isChildrenUpdated\n ) {\n prevSpec.current = newSpec;\n\n if (useSyncRender) {\n chartContext.current.chart.updateSpecSync(parseSpec(props), undefined, {\n morph: false,\n enableExitAnimation: false\n });\n handleChartRender();\n } else {\n // eslint-disable-next-line promise/catch-or-return\n chartContext.current.chart\n .updateSpec(parseSpec(props), undefined, { morph: false, enableExitAnimation: false }) // morph临时关掉\n .then(handleChartRender);\n }\n }\n chartContext.current = {\n ...chartContext.current,\n isChildrenUpdated: false\n };\n }, [props]);\n\n useEffect(() => {\n return () => {\n if (chartContext) {\n if (chartContext.current.chart) {\n chartContext.current.chart.release();\n }\n chartContext.current = null;\n }\n isUnmount.current = true;\n };\n }, []);\n\n return (\n <RootChartContext.Provider value={chartContext.current}>\n <ViewContext.Provider value={view}>\n {toArray(props.children).map((child, index) => {\n return (\n <React.Fragment key={(child as any)?.props?.id ?? (child as any)?.id ?? `child-${index}`}>\n {React.cloneElement(child as IMarkElement, {\n updateId: updateId\n })}\n </React.Fragment>\n );\n })}\n </ViewContext.Provider>\n </RootChartContext.Provider>\n );\n});\n\nexport const createChart = <T extends Props>(\n componentName: string,\n defaultProps?: Partial<T>,\n callback?: (props: T, defaultProps?: Partial<T>) => T\n) => {\n const Com = withContainer<ContainerProps, T>(BaseChart as any, componentName, (props: T) => {\n if (callback) {\n return callback(props, defaultProps);\n }\n\n if (defaultProps) {\n return Object.assign(props, defaultProps);\n }\n return props;\n });\n Com.displayName = componentName;\n return Com;\n};\n"]}
@@ -5,4 +5,6 @@ export interface BoxPlotChartProps extends Omit<BaseChartProps, 'spec' | 'contai
5
5
  }
6
6
  export declare const BoxPlotChart: React.ForwardRefExoticComponent<BoxPlotChartProps & {
7
7
  children?: React.ReactNode;
8
+ } & {
9
+ type: 'boxPlot';
8
10
  } & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
@@ -1,4 +1,9 @@
1
+ import { default as VChart } from "@visactor/vchart";
2
+
1
3
  import { createChart } from "./BaseChart";
2
4
 
3
- export const BoxPlotChart = createChart("BoxPlotChart", "boxPlot");
5
+ export const BoxPlotChart = createChart("BoxPlotChart", {
6
+ type: "boxPlot",
7
+ vchartConstrouctor: VChart
8
+ });
4
9
  //# sourceMappingURL=BoxPlotChart.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["charts/BoxPlotChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAA6C,cAAc,EAAE,SAAS,CAAC,CAAC","file":"BoxPlotChart.js","sourcesContent":["import React from 'react';\nimport { IBoxPlotChartSpec } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface BoxPlotChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IBoxPlotChartSpec, 'type'> {}\n\nexport const BoxPlotChart = createChart<React.PropsWithChildren<BoxPlotChartProps>>('BoxPlotChart', 'boxPlot');\n"]}
1
+ {"version":3,"sources":["../src/charts/BoxPlotChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CACrC,cAAc,EACd;IACE,IAAI,EAAE,SAAS;IACf,kBAAkB,EAAE,MAAM;CAC3B,CACF,CAAC","file":"BoxPlotChart.js","sourcesContent":["import React from 'react';\nimport { IBoxPlotChartSpec } from '@visactor/vchart';\nimport { default as VChart } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface BoxPlotChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IBoxPlotChartSpec, 'type'> {}\n\nexport const BoxPlotChart = createChart<React.PropsWithChildren<BoxPlotChartProps> & { type: 'boxPlot' }>(\n 'BoxPlotChart',\n {\n type: 'boxPlot',\n vchartConstrouctor: VChart\n }\n);\n"]}
@@ -5,4 +5,6 @@ export interface CircularProgressChartProps extends Omit<BaseChartProps, 'spec'
5
5
  }
6
6
  export declare const CircularProgressChart: React.ForwardRefExoticComponent<CircularProgressChartProps & {
7
7
  children?: React.ReactNode;
8
+ } & {
9
+ type: 'circularProgress';
8
10
  } & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
@@ -1,4 +1,9 @@
1
+ import { default as VChart } from "@visactor/vchart";
2
+
1
3
  import { createChart } from "./BaseChart";
2
4
 
3
- export const CircularProgressChart = createChart("CircularProgressChart", "circularProgress");
5
+ export const CircularProgressChart = createChart("CircularProgressChart", {
6
+ type: "circularProgress",
7
+ vchartConstrouctor: VChart
8
+ });
4
9
  //# sourceMappingURL=CircularProgressChart.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["charts/CircularProgressChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAC9C,uBAAuB,EACvB,kBAAkB,CACnB,CAAC","file":"CircularProgressChart.js","sourcesContent":["import React from 'react';\nimport { ICircularProgressChartSpec } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface CircularProgressChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<ICircularProgressChartSpec, 'type'> {}\n\nexport const CircularProgressChart = createChart<React.PropsWithChildren<CircularProgressChartProps>>(\n 'CircularProgressChart',\n 'circularProgress'\n);\n"]}
1
+ {"version":3,"sources":["../src/charts/CircularProgressChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAE9C,uBAAuB,EAAE;IACzB,IAAI,EAAE,kBAAkB;IACxB,kBAAkB,EAAE,MAAM;CAC3B,CAAC,CAAC","file":"CircularProgressChart.js","sourcesContent":["import React from 'react';\nimport { ICircularProgressChartSpec } from '@visactor/vchart';\nimport { default as VChart } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface CircularProgressChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<ICircularProgressChartSpec, 'type'> {}\n\nexport const CircularProgressChart = createChart<\n React.PropsWithChildren<CircularProgressChartProps> & { type: 'circularProgress' }\n>('CircularProgressChart', {\n type: 'circularProgress',\n vchartConstrouctor: VChart\n});\n"]}
@@ -5,4 +5,6 @@ export interface CommonChartProps extends Omit<BaseChartProps, 'spec' | 'contain
5
5
  }
6
6
  export declare const CommonChart: React.ForwardRefExoticComponent<CommonChartProps & {
7
7
  children?: React.ReactNode;
8
+ } & {
9
+ type: 'common';
8
10
  } & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
@@ -1,4 +1,9 @@
1
+ import { default as VChart } from "@visactor/vchart";
2
+
1
3
  import { createChart } from "./BaseChart";
2
4
 
3
- export const CommonChart = createChart("CommonChart", "common");
5
+ export const CommonChart = createChart("CommonChart", {
6
+ type: "common",
7
+ vchartConstrouctor: VChart
8
+ });
4
9
  //# sourceMappingURL=CommonChart.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["charts/CommonChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAA4C,aAAa,EAAE,QAAQ,CAAC,CAAC","file":"CommonChart.js","sourcesContent":["import React from 'react';\nimport { ICommonChartSpec } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface CommonChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<ICommonChartSpec, 'type'> {}\n\nexport const CommonChart = createChart<React.PropsWithChildren<CommonChartProps>>('CommonChart', 'common');\n"]}
1
+ {"version":3,"sources":["../src/charts/CommonChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAiE,aAAa,EAAE;IACpH,IAAI,EAAE,QAAQ;IACd,kBAAkB,EAAE,MAAM;CAC3B,CAAC,CAAC","file":"CommonChart.js","sourcesContent":["import React from 'react';\nimport { ICommonChartSpec } from '@visactor/vchart';\nimport { default as VChart } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface CommonChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<ICommonChartSpec, 'type'> {}\n\nexport const CommonChart = createChart<React.PropsWithChildren<CommonChartProps> & { type: 'common' }>('CommonChart', {\n type: 'common',\n vchartConstrouctor: VChart\n});\n"]}
@@ -5,4 +5,6 @@ export interface FunnelChartProps extends Omit<BaseChartProps, 'spec' | 'contain
5
5
  }
6
6
  export declare const FunnelChart: React.ForwardRefExoticComponent<FunnelChartProps & {
7
7
  children?: React.ReactNode;
8
+ } & {
9
+ type: 'funnel';
8
10
  } & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
@@ -1,4 +1,9 @@
1
+ import { default as VChart } from "@visactor/vchart";
2
+
1
3
  import { createChart } from "./BaseChart";
2
4
 
3
- export const FunnelChart = createChart("FunnelChart", "funnel");
5
+ export const FunnelChart = createChart("FunnelChart", {
6
+ type: "funnel",
7
+ vchartConstrouctor: VChart
8
+ });
4
9
  //# sourceMappingURL=FunnelChart.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["charts/FunnelChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAA4C,aAAa,EAAE,QAAQ,CAAC,CAAC","file":"FunnelChart.js","sourcesContent":["import React from 'react';\nimport { IFunnelChartSpec } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface FunnelChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IFunnelChartSpec, 'type'> {}\n\nexport const FunnelChart = createChart<React.PropsWithChildren<FunnelChartProps>>('FunnelChart', 'funnel');\n"]}
1
+ {"version":3,"sources":["../src/charts/FunnelChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAiE,aAAa,EAAE;IACpH,IAAI,EAAE,QAAQ;IACd,kBAAkB,EAAE,MAAM;CAC3B,CAAC,CAAC","file":"FunnelChart.js","sourcesContent":["import React from 'react';\nimport { IFunnelChartSpec } from '@visactor/vchart';\nimport { default as VChart } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface FunnelChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IFunnelChartSpec, 'type'> {}\n\nexport const FunnelChart = createChart<React.PropsWithChildren<FunnelChartProps> & { type: 'funnel' }>('FunnelChart', {\n type: 'funnel',\n vchartConstrouctor: VChart\n});\n"]}
@@ -5,4 +5,6 @@ export interface HistogramChartProps extends Omit<BaseChartProps, 'spec' | 'cont
5
5
  }
6
6
  export declare const HistogramChart: React.ForwardRefExoticComponent<HistogramChartProps & {
7
7
  children?: React.ReactNode;
8
+ } & {
9
+ type: 'histogram';
8
10
  } & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
@@ -1,4 +1,9 @@
1
+ import { default as VChart } from "@visactor/vchart";
2
+
1
3
  import { createChart } from "./BaseChart";
2
4
 
3
- export const HistogramChart = createChart("HistogramChart", "histogram");
5
+ export const HistogramChart = createChart("HistogramChart", {
6
+ type: "histogram",
7
+ vchartConstrouctor: VChart
8
+ });
4
9
  //# sourceMappingURL=HistogramChart.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["charts/HistogramChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAA+C,gBAAgB,EAAE,WAAW,CAAC,CAAC","file":"HistogramChart.js","sourcesContent":["import React from 'react';\nimport { 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<React.PropsWithChildren<HistogramChartProps>>('HistogramChart', 'histogram');\n"]}
1
+ {"version":3,"sources":["../src/charts/HistogramChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CACvC,gBAAgB,EAChB;IACE,IAAI,EAAE,WAAW;IACjB,kBAAkB,EAAE,MAAM;CAC3B,CACF,CAAC","file":"HistogramChart.js","sourcesContent":["import React from 'react';\nimport { IHistogramChartSpec } from '@visactor/vchart';\nimport { default as VChart } 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<React.PropsWithChildren<HistogramChartProps> & { type: 'histogram' }>(\n 'HistogramChart',\n {\n type: 'histogram',\n vchartConstrouctor: VChart\n }\n);\n"]}
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
- import { ILineChartSpec } from '@visactor/vchart';
2
+ import type { ILineChartSpec } from '@visactor/vchart';
3
3
  import { BaseChartProps } from './BaseChart';
4
4
  export interface LineChartProps extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>, Omit<ILineChartSpec, 'type'> {
5
5
  }
6
6
  export declare const LineChart: React.ForwardRefExoticComponent<LineChartProps & {
7
7
  children?: React.ReactNode;
8
+ } & {
9
+ type: 'line';
8
10
  } & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
@@ -1,4 +1,9 @@
1
+ import { default as VChart } from "@visactor/vchart";
2
+
1
3
  import { createChart } from "./BaseChart";
2
4
 
3
- export const LineChart = createChart("LineChart", "line");
5
+ export const LineChart = createChart("LineChart", {
6
+ type: "line",
7
+ vchartConstrouctor: VChart
8
+ });
4
9
  //# sourceMappingURL=LineChart.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["charts/LineChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAA0C,WAAW,EAAE,MAAM,CAAC,CAAC","file":"LineChart.js","sourcesContent":["import React from 'react';\nimport { 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<React.PropsWithChildren<LineChartProps>>('LineChart', 'line');\n"]}
1
+ {"version":3,"sources":["../src/charts/LineChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAA6D,WAAW,EAAE;IAC5G,IAAI,EAAE,MAAM;IACZ,kBAAkB,EAAE,MAAM;CAC3B,CAAC,CAAC","file":"LineChart.js","sourcesContent":["import React from 'react';\nimport type { ILineChartSpec } from '@visactor/vchart';\nimport { default as VChart } 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<React.PropsWithChildren<LineChartProps> & { type: 'line' }>('LineChart', {\n type: 'line',\n vchartConstrouctor: VChart\n});\n"]}
@@ -5,4 +5,6 @@ export interface LinearProgressChartProps extends Omit<BaseChartProps, 'spec' |
5
5
  }
6
6
  export declare const LinearProgressChart: React.ForwardRefExoticComponent<LinearProgressChartProps & {
7
7
  children?: React.ReactNode;
8
+ } & {
9
+ type: 'linearProgress';
8
10
  } & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
@@ -1,4 +1,9 @@
1
+ import { default as VChart } from "@visactor/vchart";
2
+
1
3
  import { createChart } from "./BaseChart";
2
4
 
3
- export const LinearProgressChart = createChart("LinearProgressChart", "linearProgress");
5
+ export const LinearProgressChart = createChart("LinearProgressChart", {
6
+ type: "linearProgress",
7
+ vchartConstrouctor: VChart
8
+ });
4
9
  //# sourceMappingURL=LinearProgressChart.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["charts/LinearProgressChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAC5C,qBAAqB,EACrB,gBAAgB,CACjB,CAAC","file":"LinearProgressChart.js","sourcesContent":["import React from 'react';\nimport { 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<React.PropsWithChildren<LinearProgressChartProps>>(\n 'LinearProgressChart',\n 'linearProgress'\n);\n"]}
1
+ {"version":3,"sources":["../src/charts/LinearProgressChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAE5C,qBAAqB,EAAE;IACvB,IAAI,EAAE,gBAAgB;IACtB,kBAAkB,EAAE,MAAM;CAC3B,CAAC,CAAC","file":"LinearProgressChart.js","sourcesContent":["import React from 'react';\nimport { ILinearProgressChartSpec } from '@visactor/vchart';\nimport { default as VChart } 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<\n React.PropsWithChildren<LinearProgressChartProps> & { type: 'linearProgress' }\n>('LinearProgressChart', {\n type: 'linearProgress',\n vchartConstrouctor: VChart\n});\n"]}
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
- import { IMapChartSpec } from '@visactor/vchart';
2
+ import type { IMapChartSpec } from '@visactor/vchart';
3
3
  import { BaseChartProps } from './BaseChart';
4
4
  export interface MapChartProps extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>, Omit<IMapChartSpec, 'type'> {
5
5
  }
6
6
  export declare const MapChart: React.ForwardRefExoticComponent<MapChartProps & {
7
7
  children?: React.ReactNode;
8
+ } & {
9
+ type: 'map';
8
10
  } & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
@@ -1,4 +1,9 @@
1
+ import { default as VChart } from "@visactor/vchart";
2
+
1
3
  import { createChart } from "./BaseChart";
2
4
 
3
- export const MapChart = createChart("MapChart", "map");
5
+ export const MapChart = createChart("MapChart", {
6
+ type: "map",
7
+ vchartConstrouctor: VChart
8
+ });
4
9
  //# sourceMappingURL=MapChart.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["charts/MapChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,QAAQ,GAAG,WAAW,CAAyC,UAAU,EAAE,KAAK,CAAC,CAAC","file":"MapChart.js","sourcesContent":["import React from 'react';\nimport { 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<React.PropsWithChildren<MapChartProps>>('MapChart', 'map');\n"]}
1
+ {"version":3,"sources":["../src/charts/MapChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,QAAQ,GAAG,WAAW,CAA2D,UAAU,EAAE;IACxG,IAAI,EAAE,KAAK;IACX,kBAAkB,EAAE,MAAM;CAC3B,CAAC,CAAC","file":"MapChart.js","sourcesContent":["import React from 'react';\nimport type { IMapChartSpec } from '@visactor/vchart';\nimport { default as VChart } 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<React.PropsWithChildren<MapChartProps> & { type: 'map' }>('MapChart', {\n type: 'map',\n vchartConstrouctor: VChart\n});\n"]}
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
- import { IPieChartSpec } from '@visactor/vchart';
2
+ import type { IPieChartSpec } from '@visactor/vchart';
3
3
  import { BaseChartProps } from './BaseChart';
4
4
  export interface PieChartProps extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>, Omit<IPieChartSpec, 'type'> {
5
5
  }
6
6
  export declare const PieChart: React.ForwardRefExoticComponent<PieChartProps & {
7
7
  children?: React.ReactNode;
8
+ } & {
9
+ type: 'pie';
8
10
  } & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
@@ -1,4 +1,9 @@
1
+ import { default as VChart } from "@visactor/vchart";
2
+
1
3
  import { createChart } from "./BaseChart";
2
4
 
3
- export const PieChart = createChart("PieChart", "pie");
5
+ export const PieChart = createChart("PieChart", {
6
+ type: "pie",
7
+ vchartConstrouctor: VChart
8
+ });
4
9
  //# sourceMappingURL=PieChart.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["charts/PieChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,QAAQ,GAAG,WAAW,CAAyC,UAAU,EAAE,KAAK,CAAC,CAAC","file":"PieChart.js","sourcesContent":["import React from 'react';\nimport { 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<React.PropsWithChildren<PieChartProps>>('PieChart', 'pie');\n"]}
1
+ {"version":3,"sources":["../src/charts/PieChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1D,MAAM,CAAC,MAAM,QAAQ,GAAG,WAAW,CAA2D,UAAU,EAAE;IACxG,IAAI,EAAE,KAAK;IACX,kBAAkB,EAAE,MAAM;CAC3B,CAAC,CAAC","file":"PieChart.js","sourcesContent":["import React from 'react';\nimport type { IPieChartSpec } from '@visactor/vchart';\nimport { default as VChart } 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<React.PropsWithChildren<PieChartProps> & { type: 'pie' }>('PieChart', {\n type: 'pie',\n vchartConstrouctor: VChart\n});\n"]}
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
- import { IRadarChartSpec } from '@visactor/vchart';
2
+ import type { IRadarChartSpec } from '@visactor/vchart';
3
3
  import { BaseChartProps } from './BaseChart';
4
4
  export interface RadarChartProps extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>, Omit<IRadarChartSpec, 'type'> {
5
5
  }
6
6
  export declare const RadarChart: React.ForwardRefExoticComponent<RadarChartProps & {
7
7
  children?: React.ReactNode;
8
+ } & {
9
+ type: 'radar';
8
10
  } & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
@@ -1,4 +1,9 @@
1
+ import { default as VChart } from "@visactor/vchart";
2
+
1
3
  import { createChart } from "./BaseChart";
2
4
 
3
- export const RadarChart = createChart("RadarChart", "radar");
5
+ export const RadarChart = createChart("RadarChart", {
6
+ type: "radar",
7
+ vchartConstrouctor: VChart
8
+ });
4
9
  //# sourceMappingURL=RadarChart.js.map