@antv/gpt-vis 0.6.0 → 1.0.0-beta.1

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 (547) hide show
  1. package/README.md +183 -114
  2. package/README.zh-CN.md +185 -112
  3. package/dist/cjs/gpt-vis/index.d.ts +108 -0
  4. package/dist/cjs/gpt-vis/index.js +173 -0
  5. package/dist/cjs/index.d.ts +44 -13
  6. package/dist/cjs/index.js +65 -35
  7. package/dist/cjs/syntax/index.d.ts +2 -0
  8. package/dist/cjs/{Text/mini-charts/hooks → syntax}/index.js +9 -7
  9. package/dist/cjs/syntax/parser.d.ts +67 -0
  10. package/dist/cjs/syntax/parser.js +235 -0
  11. package/dist/cjs/types/index.d.ts +33 -2
  12. package/dist/cjs/types/index.js +0 -6
  13. package/dist/cjs/util/theme.d.ts +21 -0
  14. package/dist/cjs/{theme.js → util/theme.js} +63 -14
  15. package/dist/cjs/vis/area/index.d.ts +60 -0
  16. package/dist/cjs/vis/area/index.js +151 -0
  17. package/dist/cjs/vis/bar/index.d.ts +60 -0
  18. package/dist/cjs/vis/bar/index.js +122 -0
  19. package/dist/cjs/vis/boxplot/index.d.ts +59 -0
  20. package/dist/cjs/vis/boxplot/index.js +106 -0
  21. package/dist/cjs/vis/column/index.d.ts +60 -0
  22. package/dist/cjs/vis/column/index.js +121 -0
  23. package/dist/cjs/vis/dual-axes/index.d.ts +64 -0
  24. package/dist/cjs/vis/dual-axes/index.js +147 -0
  25. package/dist/cjs/vis/funnel/index.d.ts +54 -0
  26. package/dist/cjs/vis/funnel/index.js +189 -0
  27. package/dist/cjs/vis/histogram/index.d.ts +47 -0
  28. package/dist/cjs/vis/histogram/index.js +112 -0
  29. package/dist/cjs/vis/line/index.d.ts +59 -0
  30. package/dist/cjs/vis/line/index.js +104 -0
  31. package/dist/cjs/vis/liquid/index.d.ts +44 -0
  32. package/dist/cjs/vis/liquid/index.js +87 -0
  33. package/dist/cjs/vis/pie/index.d.ts +55 -0
  34. package/dist/cjs/vis/pie/index.js +108 -0
  35. package/dist/cjs/vis/radar/index.d.ts +57 -0
  36. package/dist/cjs/vis/radar/index.js +152 -0
  37. package/dist/cjs/vis/sankey/index.d.ts +56 -0
  38. package/dist/cjs/vis/sankey/index.js +93 -0
  39. package/dist/cjs/vis/scatter/index.d.ts +54 -0
  40. package/dist/cjs/vis/scatter/index.js +94 -0
  41. package/dist/cjs/vis/summary/index.d.ts +41 -0
  42. package/dist/cjs/{Text/utils/getThemeColor.js → vis/summary/index.js} +33 -22
  43. package/dist/cjs/vis/table/index.d.ts +49 -0
  44. package/dist/cjs/vis/table/index.js +173 -0
  45. package/dist/cjs/vis/treemap/index.d.ts +68 -0
  46. package/dist/cjs/vis/treemap/index.js +105 -0
  47. package/dist/cjs/vis/venn/index.d.ts +54 -0
  48. package/dist/cjs/vis/venn/index.js +100 -0
  49. package/dist/cjs/vis/violin/index.d.ts +59 -0
  50. package/dist/cjs/vis/violin/index.js +155 -0
  51. package/dist/cjs/vis/waterfall/index.d.ts +67 -0
  52. package/dist/cjs/vis/waterfall/index.js +172 -0
  53. package/dist/cjs/vis/word-cloud/index.d.ts +53 -0
  54. package/dist/cjs/vis/word-cloud/index.js +89 -0
  55. package/dist/cjs/vis-wrapper/icons.d.ts +8 -0
  56. package/dist/cjs/vis-wrapper/icons.js +63 -0
  57. package/dist/cjs/vis-wrapper/index.d.ts +24 -0
  58. package/dist/cjs/vis-wrapper/index.js +231 -0
  59. package/dist/cjs/vis-wrapper/styles.d.ts +8 -0
  60. package/dist/cjs/vis-wrapper/styles.js +214 -0
  61. package/dist/esm/gpt-vis/index.d.ts +108 -0
  62. package/dist/esm/gpt-vis/index.js +224 -0
  63. package/dist/esm/index.d.ts +44 -13
  64. package/dist/esm/index.js +22 -15
  65. package/dist/esm/syntax/index.d.ts +2 -0
  66. package/dist/esm/syntax/index.js +1 -0
  67. package/dist/esm/syntax/parser.d.ts +67 -0
  68. package/dist/esm/syntax/parser.js +401 -0
  69. package/dist/esm/types/index.d.ts +33 -2
  70. package/dist/esm/types/index.js +0 -1
  71. package/dist/esm/util/theme.d.ts +21 -0
  72. package/dist/esm/util/theme.js +141 -0
  73. package/dist/esm/vis/area/index.d.ts +60 -0
  74. package/dist/esm/vis/area/index.js +230 -0
  75. package/dist/esm/vis/bar/index.d.ts +60 -0
  76. package/dist/esm/vis/bar/index.js +203 -0
  77. package/dist/esm/vis/boxplot/index.d.ts +59 -0
  78. package/dist/esm/vis/boxplot/index.js +164 -0
  79. package/dist/esm/vis/column/index.d.ts +60 -0
  80. package/dist/esm/vis/column/index.js +198 -0
  81. package/dist/esm/vis/dual-axes/index.d.ts +64 -0
  82. package/dist/esm/vis/dual-axes/index.js +234 -0
  83. package/dist/esm/vis/funnel/index.d.ts +54 -0
  84. package/dist/esm/vis/funnel/index.js +246 -0
  85. package/dist/esm/vis/histogram/index.d.ts +47 -0
  86. package/dist/esm/vis/histogram/index.js +148 -0
  87. package/dist/esm/vis/line/index.d.ts +59 -0
  88. package/dist/esm/vis/line/index.js +172 -0
  89. package/dist/esm/vis/liquid/index.d.ts +44 -0
  90. package/dist/esm/vis/liquid/index.js +130 -0
  91. package/dist/esm/vis/pie/index.d.ts +55 -0
  92. package/dist/esm/vis/pie/index.js +168 -0
  93. package/dist/esm/vis/radar/index.d.ts +57 -0
  94. package/dist/esm/vis/radar/index.js +222 -0
  95. package/dist/esm/vis/sankey/index.d.ts +56 -0
  96. package/dist/esm/vis/sankey/index.js +135 -0
  97. package/dist/esm/vis/scatter/index.d.ts +54 -0
  98. package/dist/esm/vis/scatter/index.js +158 -0
  99. package/dist/esm/vis/summary/index.d.ts +41 -0
  100. package/dist/esm/vis/summary/index.js +80 -0
  101. package/dist/esm/vis/table/index.d.ts +49 -0
  102. package/dist/esm/vis/table/index.js +160 -0
  103. package/dist/esm/vis/treemap/index.d.ts +68 -0
  104. package/dist/esm/vis/treemap/index.js +158 -0
  105. package/dist/esm/vis/venn/index.d.ts +54 -0
  106. package/dist/esm/vis/venn/index.js +142 -0
  107. package/dist/esm/vis/violin/index.d.ts +59 -0
  108. package/dist/esm/vis/violin/index.js +245 -0
  109. package/dist/esm/vis/waterfall/index.d.ts +67 -0
  110. package/dist/esm/vis/waterfall/index.js +245 -0
  111. package/dist/esm/vis/word-cloud/index.d.ts +53 -0
  112. package/dist/esm/vis/word-cloud/index.js +128 -0
  113. package/dist/esm/vis-wrapper/icons.d.ts +8 -0
  114. package/dist/esm/vis-wrapper/icons.js +29 -0
  115. package/dist/esm/vis-wrapper/index.d.ts +24 -0
  116. package/dist/esm/vis-wrapper/index.js +237 -0
  117. package/dist/esm/vis-wrapper/styles.d.ts +8 -0
  118. package/dist/esm/vis-wrapper/styles.js +21 -0
  119. package/dist/umd/index.min.js +1 -1
  120. package/package.json +26 -67
  121. package/src/gpt-vis/index.ts +283 -0
  122. package/src/index.ts +44 -0
  123. package/src/readme.md +37 -0
  124. package/src/syntax/index.ts +2 -0
  125. package/src/syntax/parser.ts +411 -0
  126. package/src/types/index.ts +29 -0
  127. package/src/util/theme.ts +167 -0
  128. package/src/vis/area/README.md +143 -0
  129. package/src/vis/area/index.ts +212 -0
  130. package/src/vis/bar/README.md +158 -0
  131. package/src/vis/bar/index.ts +186 -0
  132. package/src/vis/boxplot/README.md +168 -0
  133. package/src/vis/boxplot/index.ts +162 -0
  134. package/src/vis/column/README.md +158 -0
  135. package/src/vis/column/index.ts +185 -0
  136. package/src/vis/dual-axes/README.md +191 -0
  137. package/src/vis/dual-axes/index.ts +218 -0
  138. package/src/vis/funnel/README.md +143 -0
  139. package/src/vis/funnel/index.ts +238 -0
  140. package/src/vis/histogram/README.md +130 -0
  141. package/src/vis/histogram/index.ts +153 -0
  142. package/src/vis/line/README.md +138 -0
  143. package/src/vis/line/index.ts +159 -0
  144. package/src/vis/liquid/README.md +150 -0
  145. package/src/vis/liquid/index.ts +130 -0
  146. package/src/vis/pie/README.md +127 -0
  147. package/src/vis/pie/index.ts +163 -0
  148. package/src/vis/radar/README.md +184 -0
  149. package/src/vis/radar/index.ts +214 -0
  150. package/src/vis/sankey/README.md +144 -0
  151. package/src/vis/sankey/index.ts +144 -0
  152. package/src/vis/scatter/README.md +145 -0
  153. package/src/vis/scatter/index.ts +147 -0
  154. package/src/vis/summary/README.md +272 -0
  155. package/src/vis/summary/index.ts +91 -0
  156. package/src/vis/table/README.md +174 -0
  157. package/src/vis/table/index.ts +241 -0
  158. package/src/vis/treemap/README.md +199 -0
  159. package/src/vis/treemap/index.ts +167 -0
  160. package/src/vis/venn/README.md +153 -0
  161. package/src/vis/venn/index.ts +149 -0
  162. package/src/vis/violin/README.md +168 -0
  163. package/src/vis/violin/index.ts +216 -0
  164. package/src/vis/waterfall/README.md +178 -0
  165. package/src/vis/waterfall/index.ts +258 -0
  166. package/src/vis/word-cloud/README.md +137 -0
  167. package/src/vis/word-cloud/index.ts +137 -0
  168. package/src/vis-wrapper/README.md +159 -0
  169. package/src/vis-wrapper/icons.ts +35 -0
  170. package/src/vis-wrapper/index.ts +276 -0
  171. package/src/vis-wrapper/styles.ts +195 -0
  172. package/README.ja-JP.md +0 -164
  173. package/dist/cjs/Area/index.d.ts +0 -11
  174. package/dist/cjs/Area/index.js +0 -105
  175. package/dist/cjs/Bar/index.d.ts +0 -14
  176. package/dist/cjs/Bar/index.js +0 -101
  177. package/dist/cjs/Boxplot/index.d.ts +0 -11
  178. package/dist/cjs/Boxplot/index.js +0 -88
  179. package/dist/cjs/ChartCodeRender/Loading.d.ts +0 -6
  180. package/dist/cjs/ChartCodeRender/Loading.js +0 -54
  181. package/dist/cjs/ChartCodeRender/VisChart.d.ts +0 -19
  182. package/dist/cjs/ChartCodeRender/VisChart.js +0 -338
  183. package/dist/cjs/ChartCodeRender/icon.d.ts +0 -10
  184. package/dist/cjs/ChartCodeRender/icon.js +0 -162
  185. package/dist/cjs/ChartCodeRender/index.d.ts +0 -8
  186. package/dist/cjs/ChartCodeRender/index.js +0 -113
  187. package/dist/cjs/ChartCodeRender/styles.d.ts +0 -19
  188. package/dist/cjs/ChartCodeRender/styles.js +0 -232
  189. package/dist/cjs/ChartCodeRender/type.d.ts +0 -176
  190. package/dist/cjs/ChartCodeRender/type.js +0 -17
  191. package/dist/cjs/ChartCodeRender/utils.d.ts +0 -1
  192. package/dist/cjs/ChartCodeRender/utils.js +0 -51
  193. package/dist/cjs/Column/index.d.ts +0 -14
  194. package/dist/cjs/Column/index.js +0 -102
  195. package/dist/cjs/ConfigProvider/context.d.ts +0 -3
  196. package/dist/cjs/ConfigProvider/context.js +0 -41
  197. package/dist/cjs/ConfigProvider/hooks/index.d.ts +0 -1
  198. package/dist/cjs/ConfigProvider/hooks/index.js +0 -23
  199. package/dist/cjs/ConfigProvider/hooks/useConfig.d.ts +0 -13
  200. package/dist/cjs/ConfigProvider/hooks/useConfig.js +0 -109
  201. package/dist/cjs/ConfigProvider/index.d.ts +0 -7
  202. package/dist/cjs/ConfigProvider/index.js +0 -43
  203. package/dist/cjs/DualAxes/index.d.ts +0 -20
  204. package/dist/cjs/DualAxes/index.js +0 -84
  205. package/dist/cjs/DualAxes/util.d.ts +0 -9
  206. package/dist/cjs/DualAxes/util.js +0 -77
  207. package/dist/cjs/FishboneDiagram/index.d.ts +0 -7
  208. package/dist/cjs/FishboneDiagram/index.js +0 -66
  209. package/dist/cjs/FlowDiagram/helper.d.ts +0 -7
  210. package/dist/cjs/FlowDiagram/helper.js +0 -83
  211. package/dist/cjs/FlowDiagram/index.d.ts +0 -6
  212. package/dist/cjs/FlowDiagram/index.js +0 -107
  213. package/dist/cjs/Funnel/index.d.ts +0 -12
  214. package/dist/cjs/Funnel/index.js +0 -173
  215. package/dist/cjs/GPTVis/Lite.d.ts +0 -19
  216. package/dist/cjs/GPTVis/Lite.js +0 -81
  217. package/dist/cjs/GPTVis/hooks/useContext.d.ts +0 -8
  218. package/dist/cjs/GPTVis/hooks/useContext.js +0 -49
  219. package/dist/cjs/GPTVis/hooks/useEvent.d.ts +0 -1
  220. package/dist/cjs/GPTVis/hooks/useEvent.js +0 -33
  221. package/dist/cjs/GPTVis/index.d.ts +0 -6
  222. package/dist/cjs/GPTVis/index.js +0 -42
  223. package/dist/cjs/HeatMap/index.d.ts +0 -12
  224. package/dist/cjs/HeatMap/index.js +0 -67
  225. package/dist/cjs/Histogram/index.d.ts +0 -8
  226. package/dist/cjs/Histogram/index.js +0 -79
  227. package/dist/cjs/IndentedTree/index.d.ts +0 -7
  228. package/dist/cjs/IndentedTree/index.js +0 -78
  229. package/dist/cjs/Line/index.d.ts +0 -11
  230. package/dist/cjs/Line/index.js +0 -94
  231. package/dist/cjs/Liquid/index.d.ts +0 -11
  232. package/dist/cjs/Liquid/index.js +0 -85
  233. package/dist/cjs/Map/Component/MapView.d.ts +0 -3
  234. package/dist/cjs/Map/Component/MapView.js +0 -40
  235. package/dist/cjs/Map/Component/Marker.d.ts +0 -3
  236. package/dist/cjs/Map/Component/Marker.js +0 -53
  237. package/dist/cjs/Map/Component/Polyline.d.ts +0 -3
  238. package/dist/cjs/Map/Component/Polyline.js +0 -50
  239. package/dist/cjs/Map/Component/index.d.ts +0 -4
  240. package/dist/cjs/Map/Component/index.js +0 -45
  241. package/dist/cjs/Map/data.json +0 -305
  242. package/dist/cjs/Map/index.d.ts +0 -5
  243. package/dist/cjs/Map/index.js +0 -61
  244. package/dist/cjs/MindMap/index.d.ts +0 -7
  245. package/dist/cjs/MindMap/index.js +0 -75
  246. package/dist/cjs/NetworkGraph/index.d.ts +0 -6
  247. package/dist/cjs/NetworkGraph/index.js +0 -75
  248. package/dist/cjs/OrganizationChart/index.d.ts +0 -6
  249. package/dist/cjs/OrganizationChart/index.js +0 -95
  250. package/dist/cjs/PathMap/index.d.ts +0 -6
  251. package/dist/cjs/PathMap/index.js +0 -58
  252. package/dist/cjs/Pie/index.d.ts +0 -23
  253. package/dist/cjs/Pie/index.js +0 -94
  254. package/dist/cjs/PinMap/index.d.ts +0 -6
  255. package/dist/cjs/PinMap/index.js +0 -44
  256. package/dist/cjs/PinMap/maker.svg +0 -1
  257. package/dist/cjs/Radar/index.d.ts +0 -13
  258. package/dist/cjs/Radar/index.js +0 -153
  259. package/dist/cjs/Sankey/index.d.ts +0 -14
  260. package/dist/cjs/Sankey/index.js +0 -110
  261. package/dist/cjs/Scatter/index.d.ts +0 -13
  262. package/dist/cjs/Scatter/index.js +0 -103
  263. package/dist/cjs/Spreadsheet/index.d.ts +0 -28
  264. package/dist/cjs/Spreadsheet/index.js +0 -113
  265. package/dist/cjs/Table/index.d.ts +0 -9
  266. package/dist/cjs/Table/index.js +0 -91
  267. package/dist/cjs/Text/VisText.d.ts +0 -4
  268. package/dist/cjs/Text/VisText.js +0 -82
  269. package/dist/cjs/Text/config.d.ts +0 -18
  270. package/dist/cjs/Text/config.js +0 -91
  271. package/dist/cjs/Text/custom-icons/index.d.ts +0 -3
  272. package/dist/cjs/Text/custom-icons/index.js +0 -66
  273. package/dist/cjs/Text/index.d.ts +0 -3
  274. package/dist/cjs/Text/index.js +0 -42
  275. package/dist/cjs/Text/mini-charts/hooks/getElementFontSize.d.ts +0 -1
  276. package/dist/cjs/Text/mini-charts/hooks/getElementFontSize.js +0 -65
  277. package/dist/cjs/Text/mini-charts/hooks/index.d.ts +0 -1
  278. package/dist/cjs/Text/mini-charts/hooks/useSvgWrapper.d.ts +0 -5
  279. package/dist/cjs/Text/mini-charts/hooks/useSvgWrapper.js +0 -65
  280. package/dist/cjs/Text/mini-charts/index.d.ts +0 -2
  281. package/dist/cjs/Text/mini-charts/index.js +0 -25
  282. package/dist/cjs/Text/mini-charts/line/SingleLineChart.d.ts +0 -3
  283. package/dist/cjs/Text/mini-charts/line/SingleLineChart.js +0 -63
  284. package/dist/cjs/Text/mini-charts/line/index.d.ts +0 -1
  285. package/dist/cjs/Text/mini-charts/line/index.js +0 -29
  286. package/dist/cjs/Text/mini-charts/line/scaleLinear.d.ts +0 -4
  287. package/dist/cjs/Text/mini-charts/line/scaleLinear.js +0 -35
  288. package/dist/cjs/Text/mini-charts/line/useLineCompute.d.ts +0 -6
  289. package/dist/cjs/Text/mini-charts/line/useLineCompute.js +0 -103
  290. package/dist/cjs/Text/mini-charts/proportion/getArcPath.d.ts +0 -1
  291. package/dist/cjs/Text/mini-charts/proportion/getArcPath.js +0 -51
  292. package/dist/cjs/Text/mini-charts/proportion/index.d.ts +0 -3
  293. package/dist/cjs/Text/mini-charts/proportion/index.js +0 -71
  294. package/dist/cjs/Text/theme.d.ts +0 -24
  295. package/dist/cjs/Text/theme.js +0 -52
  296. package/dist/cjs/Text/types.d.ts +0 -20
  297. package/dist/cjs/Text/types.js +0 -17
  298. package/dist/cjs/Text/utils/getThemeColor.d.ts +0 -11
  299. package/dist/cjs/Text/utils/index.d.ts +0 -2
  300. package/dist/cjs/Text/utils/index.js +0 -25
  301. package/dist/cjs/Text/utils/useAntdDarkAlgorithm.d.ts +0 -2
  302. package/dist/cjs/Text/utils/useAntdDarkAlgorithm.js +0 -40
  303. package/dist/cjs/Treemap/index.d.ts +0 -10
  304. package/dist/cjs/Treemap/index.js +0 -93
  305. package/dist/cjs/Venn/index.d.ts +0 -32
  306. package/dist/cjs/Venn/index.js +0 -87
  307. package/dist/cjs/Violin/index.d.ts +0 -10
  308. package/dist/cjs/Violin/index.js +0 -190
  309. package/dist/cjs/Waterfall/index.d.ts +0 -25
  310. package/dist/cjs/Waterfall/index.js +0 -184
  311. package/dist/cjs/WordCloud/index.d.ts +0 -9
  312. package/dist/cjs/WordCloud/index.js +0 -76
  313. package/dist/cjs/constants/index.d.ts +0 -2
  314. package/dist/cjs/constants/index.js +0 -35
  315. package/dist/cjs/export-map.browser.d.ts +0 -4
  316. package/dist/cjs/export-map.browser.js +0 -48
  317. package/dist/cjs/export-map.d.ts +0 -10
  318. package/dist/cjs/export-map.js +0 -41
  319. package/dist/cjs/export.d.ts +0 -76
  320. package/dist/cjs/export.js +0 -159
  321. package/dist/cjs/render.d.ts +0 -2
  322. package/dist/cjs/render.js +0 -67
  323. package/dist/cjs/theme.d.ts +0 -2
  324. package/dist/cjs/types/chart.d.ts +0 -88
  325. package/dist/cjs/types/chart.js +0 -61
  326. package/dist/cjs/types/config.d.ts +0 -25
  327. package/dist/cjs/types/config.js +0 -17
  328. package/dist/cjs/types/map.d.ts +0 -242
  329. package/dist/cjs/types/map.js +0 -17
  330. package/dist/cjs/utils/config.d.ts +0 -5
  331. package/dist/cjs/utils/config.js +0 -76
  332. package/dist/cjs/utils/graph.d.ts +0 -18
  333. package/dist/cjs/utils/graph.js +0 -64
  334. package/dist/cjs/utils/index.d.ts +0 -1
  335. package/dist/cjs/utils/index.js +0 -23
  336. package/dist/cjs/utils/map/context.d.ts +0 -3
  337. package/dist/cjs/utils/map/context.js +0 -45
  338. package/dist/cjs/utils/map/controls.d.ts +0 -0
  339. package/dist/cjs/utils/map/controls.js +0 -0
  340. package/dist/cjs/utils/map/index.d.ts +0 -6
  341. package/dist/cjs/utils/map/index.js +0 -33
  342. package/dist/cjs/utils/map/markers.d.ts +0 -2
  343. package/dist/cjs/utils/map/markers.js +0 -88
  344. package/dist/cjs/utils/map/polyline.d.ts +0 -2
  345. package/dist/cjs/utils/map/polyline.js +0 -52
  346. package/dist/cjs/utils/map/style.d.ts +0 -45
  347. package/dist/cjs/utils/map/style.js +0 -112
  348. package/dist/cjs/utils/map/util.d.ts +0 -1
  349. package/dist/cjs/utils/map/util.js +0 -38
  350. package/dist/cjs/utils/map/view.d.ts +0 -5
  351. package/dist/cjs/utils/map/view.js +0 -100
  352. package/dist/cjs/utils/palette.d.ts +0 -2
  353. package/dist/cjs/utils/palette.js +0 -54
  354. package/dist/cjs/utils/plot.d.ts +0 -5
  355. package/dist/cjs/utils/plot.js +0 -90
  356. package/dist/cjs/version.d.ts +0 -2
  357. package/dist/cjs/version.js +0 -25
  358. package/dist/esm/Area/index.d.ts +0 -11
  359. package/dist/esm/Area/index.js +0 -108
  360. package/dist/esm/Bar/index.d.ts +0 -14
  361. package/dist/esm/Bar/index.js +0 -92
  362. package/dist/esm/Boxplot/index.d.ts +0 -11
  363. package/dist/esm/Boxplot/index.js +0 -86
  364. package/dist/esm/ChartCodeRender/Loading.d.ts +0 -6
  365. package/dist/esm/ChartCodeRender/Loading.js +0 -21
  366. package/dist/esm/ChartCodeRender/VisChart.d.ts +0 -19
  367. package/dist/esm/ChartCodeRender/VisChart.js +0 -450
  368. package/dist/esm/ChartCodeRender/icon.d.ts +0 -10
  369. package/dist/esm/ChartCodeRender/icon.js +0 -103
  370. package/dist/esm/ChartCodeRender/index.d.ts +0 -8
  371. package/dist/esm/ChartCodeRender/index.js +0 -99
  372. package/dist/esm/ChartCodeRender/styles.d.ts +0 -19
  373. package/dist/esm/ChartCodeRender/styles.js +0 -61
  374. package/dist/esm/ChartCodeRender/type.d.ts +0 -176
  375. package/dist/esm/ChartCodeRender/type.js +0 -1
  376. package/dist/esm/ChartCodeRender/utils.d.ts +0 -1
  377. package/dist/esm/ChartCodeRender/utils.js +0 -37
  378. package/dist/esm/Column/index.d.ts +0 -14
  379. package/dist/esm/Column/index.js +0 -93
  380. package/dist/esm/ConfigProvider/context.d.ts +0 -3
  381. package/dist/esm/ConfigProvider/context.js +0 -3
  382. package/dist/esm/ConfigProvider/hooks/index.d.ts +0 -1
  383. package/dist/esm/ConfigProvider/hooks/index.js +0 -1
  384. package/dist/esm/ConfigProvider/hooks/useConfig.d.ts +0 -13
  385. package/dist/esm/ConfigProvider/hooks/useConfig.js +0 -71
  386. package/dist/esm/ConfigProvider/index.d.ts +0 -7
  387. package/dist/esm/ConfigProvider/index.js +0 -17
  388. package/dist/esm/DualAxes/index.d.ts +0 -20
  389. package/dist/esm/DualAxes/index.js +0 -77
  390. package/dist/esm/DualAxes/util.d.ts +0 -9
  391. package/dist/esm/DualAxes/util.js +0 -77
  392. package/dist/esm/FishboneDiagram/index.d.ts +0 -7
  393. package/dist/esm/FishboneDiagram/index.js +0 -43
  394. package/dist/esm/FlowDiagram/helper.d.ts +0 -7
  395. package/dist/esm/FlowDiagram/helper.js +0 -76
  396. package/dist/esm/FlowDiagram/index.d.ts +0 -6
  397. package/dist/esm/FlowDiagram/index.js +0 -72
  398. package/dist/esm/Funnel/index.d.ts +0 -12
  399. package/dist/esm/Funnel/index.js +0 -171
  400. package/dist/esm/GPTVis/Lite.d.ts +0 -19
  401. package/dist/esm/GPTVis/Lite.js +0 -57
  402. package/dist/esm/GPTVis/hooks/useContext.d.ts +0 -8
  403. package/dist/esm/GPTVis/hooks/useContext.js +0 -9
  404. package/dist/esm/GPTVis/hooks/useEvent.d.ts +0 -1
  405. package/dist/esm/GPTVis/hooks/useEvent.js +0 -6
  406. package/dist/esm/GPTVis/index.d.ts +0 -6
  407. package/dist/esm/GPTVis/index.js +0 -25
  408. package/dist/esm/HeatMap/index.d.ts +0 -12
  409. package/dist/esm/HeatMap/index.js +0 -45
  410. package/dist/esm/Histogram/index.d.ts +0 -8
  411. package/dist/esm/Histogram/index.js +0 -75
  412. package/dist/esm/IndentedTree/index.d.ts +0 -7
  413. package/dist/esm/IndentedTree/index.js +0 -68
  414. package/dist/esm/Line/index.d.ts +0 -11
  415. package/dist/esm/Line/index.js +0 -92
  416. package/dist/esm/Liquid/index.d.ts +0 -11
  417. package/dist/esm/Liquid/index.js +0 -100
  418. package/dist/esm/Map/Component/MapView.d.ts +0 -3
  419. package/dist/esm/Map/Component/MapView.js +0 -18
  420. package/dist/esm/Map/Component/Marker.d.ts +0 -3
  421. package/dist/esm/Map/Component/Marker.js +0 -40
  422. package/dist/esm/Map/Component/Polyline.d.ts +0 -3
  423. package/dist/esm/Map/Component/Polyline.js +0 -35
  424. package/dist/esm/Map/Component/index.d.ts +0 -4
  425. package/dist/esm/Map/Component/index.js +0 -4
  426. package/dist/esm/Map/data.json +0 -305
  427. package/dist/esm/Map/index.d.ts +0 -5
  428. package/dist/esm/Map/index.js +0 -50
  429. package/dist/esm/MindMap/index.d.ts +0 -7
  430. package/dist/esm/MindMap/index.js +0 -69
  431. package/dist/esm/NetworkGraph/index.d.ts +0 -6
  432. package/dist/esm/NetworkGraph/index.js +0 -64
  433. package/dist/esm/OrganizationChart/index.d.ts +0 -6
  434. package/dist/esm/OrganizationChart/index.js +0 -75
  435. package/dist/esm/PathMap/index.d.ts +0 -6
  436. package/dist/esm/PathMap/index.js +0 -41
  437. package/dist/esm/Pie/index.d.ts +0 -23
  438. package/dist/esm/Pie/index.js +0 -96
  439. package/dist/esm/PinMap/index.d.ts +0 -6
  440. package/dist/esm/PinMap/index.js +0 -22
  441. package/dist/esm/PinMap/maker.svg +0 -1
  442. package/dist/esm/Radar/index.d.ts +0 -13
  443. package/dist/esm/Radar/index.js +0 -150
  444. package/dist/esm/Sankey/index.d.ts +0 -14
  445. package/dist/esm/Sankey/index.js +0 -98
  446. package/dist/esm/Scatter/index.d.ts +0 -13
  447. package/dist/esm/Scatter/index.js +0 -95
  448. package/dist/esm/Spreadsheet/index.d.ts +0 -28
  449. package/dist/esm/Spreadsheet/index.js +0 -129
  450. package/dist/esm/Table/index.d.ts +0 -9
  451. package/dist/esm/Table/index.js +0 -30
  452. package/dist/esm/Text/VisText.d.ts +0 -4
  453. package/dist/esm/Text/VisText.js +0 -55
  454. package/dist/esm/Text/config.d.ts +0 -18
  455. package/dist/esm/Text/config.js +0 -82
  456. package/dist/esm/Text/custom-icons/index.d.ts +0 -3
  457. package/dist/esm/Text/custom-icons/index.js +0 -37
  458. package/dist/esm/Text/index.d.ts +0 -3
  459. package/dist/esm/Text/index.js +0 -2
  460. package/dist/esm/Text/mini-charts/hooks/getElementFontSize.d.ts +0 -1
  461. package/dist/esm/Text/mini-charts/hooks/getElementFontSize.js +0 -32
  462. package/dist/esm/Text/mini-charts/hooks/index.d.ts +0 -1
  463. package/dist/esm/Text/mini-charts/hooks/index.js +0 -1
  464. package/dist/esm/Text/mini-charts/hooks/useSvgWrapper.d.ts +0 -5
  465. package/dist/esm/Text/mini-charts/hooks/useSvgWrapper.js +0 -37
  466. package/dist/esm/Text/mini-charts/index.d.ts +0 -2
  467. package/dist/esm/Text/mini-charts/index.js +0 -2
  468. package/dist/esm/Text/mini-charts/line/SingleLineChart.d.ts +0 -3
  469. package/dist/esm/Text/mini-charts/line/SingleLineChart.js +0 -62
  470. package/dist/esm/Text/mini-charts/line/index.d.ts +0 -1
  471. package/dist/esm/Text/mini-charts/line/index.js +0 -1
  472. package/dist/esm/Text/mini-charts/line/scaleLinear.d.ts +0 -4
  473. package/dist/esm/Text/mini-charts/line/scaleLinear.js +0 -19
  474. package/dist/esm/Text/mini-charts/line/useLineCompute.d.ts +0 -6
  475. package/dist/esm/Text/mini-charts/line/useLineCompute.js +0 -118
  476. package/dist/esm/Text/mini-charts/proportion/getArcPath.d.ts +0 -1
  477. package/dist/esm/Text/mini-charts/proportion/getArcPath.js +0 -19
  478. package/dist/esm/Text/mini-charts/proportion/index.d.ts +0 -3
  479. package/dist/esm/Text/mini-charts/proportion/index.js +0 -64
  480. package/dist/esm/Text/theme.d.ts +0 -24
  481. package/dist/esm/Text/theme.js +0 -24
  482. package/dist/esm/Text/types.d.ts +0 -20
  483. package/dist/esm/Text/types.js +0 -1
  484. package/dist/esm/Text/utils/getThemeColor.d.ts +0 -11
  485. package/dist/esm/Text/utils/getThemeColor.js +0 -29
  486. package/dist/esm/Text/utils/index.d.ts +0 -2
  487. package/dist/esm/Text/utils/index.js +0 -2
  488. package/dist/esm/Text/utils/useAntdDarkAlgorithm.d.ts +0 -2
  489. package/dist/esm/Text/utils/useAntdDarkAlgorithm.js +0 -14
  490. package/dist/esm/Treemap/index.d.ts +0 -10
  491. package/dist/esm/Treemap/index.js +0 -88
  492. package/dist/esm/Venn/index.d.ts +0 -32
  493. package/dist/esm/Venn/index.js +0 -69
  494. package/dist/esm/Violin/index.d.ts +0 -10
  495. package/dist/esm/Violin/index.js +0 -199
  496. package/dist/esm/Waterfall/index.d.ts +0 -25
  497. package/dist/esm/Waterfall/index.js +0 -185
  498. package/dist/esm/WordCloud/index.d.ts +0 -9
  499. package/dist/esm/WordCloud/index.js +0 -59
  500. package/dist/esm/constants/index.d.ts +0 -2
  501. package/dist/esm/constants/index.js +0 -9
  502. package/dist/esm/export-map.browser.d.ts +0 -4
  503. package/dist/esm/export-map.browser.js +0 -5
  504. package/dist/esm/export-map.d.ts +0 -10
  505. package/dist/esm/export-map.js +0 -9
  506. package/dist/esm/export.d.ts +0 -76
  507. package/dist/esm/export.js +0 -51
  508. package/dist/esm/render.d.ts +0 -2
  509. package/dist/esm/render.js +0 -32
  510. package/dist/esm/theme.d.ts +0 -2
  511. package/dist/esm/theme.js +0 -103
  512. package/dist/esm/types/chart.d.ts +0 -88
  513. package/dist/esm/types/chart.js +0 -33
  514. package/dist/esm/types/config.d.ts +0 -25
  515. package/dist/esm/types/config.js +0 -1
  516. package/dist/esm/types/map.d.ts +0 -242
  517. package/dist/esm/types/map.js +0 -1
  518. package/dist/esm/utils/config.d.ts +0 -5
  519. package/dist/esm/utils/config.js +0 -53
  520. package/dist/esm/utils/graph.d.ts +0 -18
  521. package/dist/esm/utils/graph.js +0 -55
  522. package/dist/esm/utils/index.d.ts +0 -1
  523. package/dist/esm/utils/index.js +0 -1
  524. package/dist/esm/utils/map/context.d.ts +0 -3
  525. package/dist/esm/utils/map/context.js +0 -42
  526. package/dist/esm/utils/map/controls.d.ts +0 -0
  527. package/dist/esm/utils/map/controls.js +0 -0
  528. package/dist/esm/utils/map/index.d.ts +0 -6
  529. package/dist/esm/utils/map/index.js +0 -6
  530. package/dist/esm/utils/map/markers.d.ts +0 -2
  531. package/dist/esm/utils/map/markers.js +0 -69
  532. package/dist/esm/utils/map/polyline.d.ts +0 -2
  533. package/dist/esm/utils/map/polyline.js +0 -31
  534. package/dist/esm/utils/map/style.d.ts +0 -45
  535. package/dist/esm/utils/map/style.js +0 -80
  536. package/dist/esm/utils/map/util.d.ts +0 -1
  537. package/dist/esm/utils/map/util.js +0 -11
  538. package/dist/esm/utils/map/view.d.ts +0 -5
  539. package/dist/esm/utils/map/view.js +0 -83
  540. package/dist/esm/utils/palette.d.ts +0 -2
  541. package/dist/esm/utils/palette.js +0 -2
  542. package/dist/esm/utils/plot.d.ts +0 -5
  543. package/dist/esm/utils/plot.js +0 -86
  544. package/dist/esm/version.d.ts +0 -2
  545. package/dist/esm/version.js +0 -1
  546. package/dist/umd/737.async.js +0 -1
  547. package/dist/umd/index.min.css +0 -1
@@ -0,0 +1,44 @@
1
+ import type { VisualizationOptions } from '../../types';
2
+ /**
3
+ * LiquidConfig defines the configuration for rendering the liquid chart.
4
+ */
5
+ export interface LiquidConfig {
6
+ type?: 'liquid';
7
+ percent: number;
8
+ shape?: 'rect' | 'circle' | 'pin' | 'triangle';
9
+ theme?: 'default' | 'academy' | 'dark';
10
+ title?: string;
11
+ style?: {
12
+ backgroundColor?: string;
13
+ palette?: string[];
14
+ };
15
+ }
16
+ /**
17
+ * LiquidInstance represents a liquid chart instance with render and destroy methods.
18
+ */
19
+ export interface LiquidInstance {
20
+ render: (config: LiquidConfig) => void;
21
+ destroy: () => void;
22
+ }
23
+ /**
24
+ * Liquid chart component using G2 5.0.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const liquid = Liquid({
29
+ * container: '#container',
30
+ * width: 600,
31
+ * height: 400,
32
+ * });
33
+ *
34
+ * liquid.render({
35
+ * type: 'liquid',
36
+ * percent: 0.75,
37
+ * shape: 'circle',
38
+ * theme: 'academy'
39
+ * });
40
+ *
41
+ * liquid.destroy();
42
+ * ```
43
+ */
44
+ export declare const Liquid: (options: VisualizationOptions) => LiquidInstance;
@@ -0,0 +1,130 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import { Chart } from '@antv/g2';
8
+ import { getBackgroundColor, getThemeColors, getThemeObject } from "../../util/theme";
9
+
10
+ // Default dimensions used for font size calculation when not explicitly provided
11
+ var DEFAULT_WIDTH = 640;
12
+ var DEFAULT_HEIGHT = 480;
13
+
14
+ /**
15
+ * LiquidConfig defines the configuration for rendering the liquid chart.
16
+ */
17
+
18
+ /**
19
+ * LiquidInstance represents a liquid chart instance with render and destroy methods.
20
+ */
21
+
22
+ /**
23
+ * Liquid chart component using G2 5.0.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const liquid = Liquid({
28
+ * container: '#container',
29
+ * width: 600,
30
+ * height: 400,
31
+ * });
32
+ *
33
+ * liquid.render({
34
+ * type: 'liquid',
35
+ * percent: 0.75,
36
+ * shape: 'circle',
37
+ * theme: 'academy'
38
+ * });
39
+ *
40
+ * liquid.destroy();
41
+ * ```
42
+ */
43
+ export var Liquid = function Liquid(options) {
44
+ var container = options.container,
45
+ width = options.width,
46
+ height = options.height,
47
+ _options$theme = options.theme,
48
+ chartTheme = _options$theme === void 0 ? 'default' : _options$theme;
49
+ var chart = null;
50
+
51
+ /**
52
+ * Render the liquid chart with the given configuration.
53
+ */
54
+ var render = function render(config) {
55
+ var percent = config.percent,
56
+ _config$shape = config.shape,
57
+ shape = _config$shape === void 0 ? 'circle' : _config$shape,
58
+ _config$theme = config.theme,
59
+ theme = _config$theme === void 0 ? chartTheme : _config$theme,
60
+ title = config.title,
61
+ _config$style = config.style,
62
+ style = _config$style === void 0 ? {} : _config$style;
63
+
64
+ // Clean up previous chart if exists
65
+ if (chart) {
66
+ chart.destroy();
67
+ }
68
+
69
+ // Get colors from style.palette or theme defaults
70
+ var colors = style.palette || getThemeColors(theme);
71
+ var backgroundColor = style.backgroundColor || getBackgroundColor(theme);
72
+
73
+ // Calculate dynamic font size based on chart dimensions
74
+ // Use default dimensions for font size calculation when not provided
75
+ var inferFontSize = Math.min(width !== null && width !== void 0 ? width : DEFAULT_WIDTH, height !== null && height !== void 0 ? height : DEFAULT_HEIGHT) / 10;
76
+ var fontSize = Math.min(Math.max(inferFontSize, 24), 64);
77
+
78
+ // Create chart
79
+ chart = new Chart({
80
+ container: container,
81
+ width: width,
82
+ height: height,
83
+ autoFit: true
84
+ });
85
+
86
+ // Configure chart options
87
+ // Note: Using 'any' type due to G2's complex type system with transformations
88
+ // This is consistent with how G2 5.0 is used elsewhere in the codebase
89
+ var chartOptions = {
90
+ type: 'liquid',
91
+ data: percent,
92
+ title: title !== null && title !== void 0 ? title : '',
93
+ style: _objectSpread({
94
+ shape: shape,
95
+ contentFontSize: fontSize,
96
+ contentFill: '#000',
97
+ contentStroke: '#fff',
98
+ contentLineWidth: 2,
99
+ outlineBorder: 4,
100
+ outlineDistance: 4,
101
+ waveLength: 128,
102
+ contentPointerEvents: 'none'
103
+ }, colors[0] ? {
104
+ fill: colors[0],
105
+ outlineStroke: colors[0]
106
+ } : {}),
107
+ viewStyle: {
108
+ viewFill: backgroundColor
109
+ },
110
+ theme: getThemeObject(theme),
111
+ tooltip: false
112
+ };
113
+ chart.options(chartOptions);
114
+ chart.render();
115
+ };
116
+
117
+ /**
118
+ * Destroy the chart instance and clean up resources.
119
+ */
120
+ var destroy = function destroy() {
121
+ if (chart) {
122
+ chart.destroy();
123
+ chart = null;
124
+ }
125
+ };
126
+ return {
127
+ render: render,
128
+ destroy: destroy
129
+ };
130
+ };
@@ -0,0 +1,55 @@
1
+ import type { VisualizationOptions } from '../../types';
2
+ /**
3
+ * PieDataItem is the type for each data item in the pie chart.
4
+ */
5
+ type PieDataItem = {
6
+ category: string;
7
+ value: number;
8
+ };
9
+ /**
10
+ * PieConfig defines the configuration for rendering the pie chart.
11
+ */
12
+ export interface PieConfig {
13
+ type?: 'pie';
14
+ data: PieDataItem[];
15
+ innerRadius?: number;
16
+ theme?: 'default' | 'academy' | 'dark';
17
+ title?: string;
18
+ style?: {
19
+ backgroundColor?: string;
20
+ palette?: string[];
21
+ };
22
+ }
23
+ /**
24
+ * PieInstance represents a pie chart instance with render and destroy methods.
25
+ */
26
+ export interface PieInstance {
27
+ render: (config: PieConfig) => void;
28
+ destroy: () => void;
29
+ }
30
+ /**
31
+ * Pie chart component using G2 5.0.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const pie = Pie({
36
+ * container: '#container',
37
+ * width: 600,
38
+ * height: 400,
39
+ * });
40
+ *
41
+ * pie.render({
42
+ * type: 'pie',
43
+ * data: [
44
+ * { category: '分类一', value: 27 },
45
+ * { category: '分类二', value: 25 },
46
+ * ],
47
+ * innerRadius: 0.6,
48
+ * theme: 'academy'
49
+ * });
50
+ *
51
+ * pie.destroy();
52
+ * ```
53
+ */
54
+ export declare const Pie: (options: VisualizationOptions) => PieInstance;
55
+ export {};
@@ -0,0 +1,168 @@
1
+ import { Chart } from '@antv/g2';
2
+ import { getBackgroundColor, getThemeColors, getThemeObject } from "../../util/theme";
3
+
4
+ /**
5
+ * PieDataItem is the type for each data item in the pie chart.
6
+ */
7
+
8
+ /**
9
+ * PieConfig defines the configuration for rendering the pie chart.
10
+ */
11
+
12
+ /**
13
+ * PieInstance represents a pie chart instance with render and destroy methods.
14
+ */
15
+
16
+ /**
17
+ * Pie chart component using G2 5.0.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const pie = Pie({
22
+ * container: '#container',
23
+ * width: 600,
24
+ * height: 400,
25
+ * });
26
+ *
27
+ * pie.render({
28
+ * type: 'pie',
29
+ * data: [
30
+ * { category: '分类一', value: 27 },
31
+ * { category: '分类二', value: 25 },
32
+ * ],
33
+ * innerRadius: 0.6,
34
+ * theme: 'academy'
35
+ * });
36
+ *
37
+ * pie.destroy();
38
+ * ```
39
+ */
40
+ export var Pie = function Pie(options) {
41
+ var container = options.container,
42
+ width = options.width,
43
+ height = options.height,
44
+ _options$theme = options.theme,
45
+ chartTheme = _options$theme === void 0 ? 'default' : _options$theme;
46
+ var chart = null;
47
+
48
+ // Precision multiplier for rounding percentages to 4 decimal places
49
+ var PERCENTAGE_PRECISION_MULTIPLIER = 10000;
50
+
51
+ /**
52
+ * Render the pie chart with the given configuration.
53
+ */
54
+ var render = function render(config) {
55
+ var _config$data = config.data,
56
+ data = _config$data === void 0 ? [] : _config$data,
57
+ _config$innerRadius = config.innerRadius,
58
+ innerRadius = _config$innerRadius === void 0 ? 0 : _config$innerRadius,
59
+ _config$theme = config.theme,
60
+ theme = _config$theme === void 0 ? chartTheme : _config$theme,
61
+ title = config.title,
62
+ _config$style = config.style,
63
+ style = _config$style === void 0 ? {} : _config$style;
64
+
65
+ // Clean up previous chart if exists
66
+ if (chart) {
67
+ chart.destroy();
68
+ }
69
+
70
+ // Get colors from style.palette or theme defaults
71
+ var colors = style.palette || getThemeColors(theme);
72
+ var backgroundColor = style.backgroundColor || getBackgroundColor(theme);
73
+
74
+ // Calculate sum for percentage labels
75
+ var sumValue = data.reduce(function (sum, item) {
76
+ return sum + item.value;
77
+ }, 0);
78
+
79
+ // Create chart
80
+ chart = new Chart({
81
+ container: container,
82
+ width: width,
83
+ height: height,
84
+ autoFit: true
85
+ });
86
+
87
+ // Configure chart options
88
+ // Note: Using 'any' type due to G2's complex type system with transformations
89
+ // This is consistent with how G2 5.0 is used elsewhere in the codebase (e.g., Radar component)
90
+ var chartOptions = {
91
+ type: 'interval',
92
+ data: data,
93
+ title: title !== null && title !== void 0 ? title : '',
94
+ encode: {
95
+ y: 'value',
96
+ color: 'category'
97
+ },
98
+ transform: [{
99
+ type: 'stackY'
100
+ }],
101
+ coordinate: {
102
+ type: 'theta',
103
+ innerRadius: Math.max(0, Math.min(1, innerRadius))
104
+ },
105
+ scale: {
106
+ color: {
107
+ range: colors
108
+ }
109
+ },
110
+ legend: {
111
+ color: {
112
+ position: 'top'
113
+ }
114
+ },
115
+ labels: [{
116
+ text: function text(d) {
117
+ var percentage = Math.round(d.value / sumValue * 100 * PERCENTAGE_PRECISION_MULTIPLIER) / PERCENTAGE_PRECISION_MULTIPLIER;
118
+ return "".concat(d.category, ": ").concat(percentage, "%");
119
+ },
120
+ position: 'outside',
121
+ transform: [{
122
+ type: 'overlapHide'
123
+ }]
124
+ }],
125
+ tooltip: {
126
+ items: [function (d) {
127
+ return {
128
+ name: d.category,
129
+ value: d.value
130
+ };
131
+ }]
132
+ },
133
+ interaction: {
134
+ elementSelect: {
135
+ single: true
136
+ }
137
+ },
138
+ style: {
139
+ fillOpacity: 0.8
140
+ },
141
+ viewStyle: {
142
+ viewFill: backgroundColor
143
+ },
144
+ theme: getThemeObject(theme),
145
+ animate: {
146
+ enter: {
147
+ type: 'waveIn'
148
+ }
149
+ }
150
+ };
151
+ chart.options(chartOptions);
152
+ chart.render();
153
+ };
154
+
155
+ /**
156
+ * Destroy the chart instance and clean up resources.
157
+ */
158
+ var destroy = function destroy() {
159
+ if (chart) {
160
+ chart.destroy();
161
+ chart = null;
162
+ }
163
+ };
164
+ return {
165
+ render: render,
166
+ destroy: destroy
167
+ };
168
+ };
@@ -0,0 +1,57 @@
1
+ import type { VisualizationOptions } from '../../types';
2
+ /**
3
+ * RadarDataItem is the type for each data item in the radar chart.
4
+ */
5
+ export type RadarDataItem = {
6
+ name: string;
7
+ value: number;
8
+ group?: string;
9
+ };
10
+ /**
11
+ * RadarConfig defines the configuration for rendering the radar chart.
12
+ */
13
+ export interface RadarConfig {
14
+ type?: 'radar';
15
+ data: RadarDataItem[];
16
+ title?: string;
17
+ theme?: 'default' | 'academy' | 'dark';
18
+ style?: {
19
+ backgroundColor?: string;
20
+ palette?: string[];
21
+ lineWidth?: number;
22
+ };
23
+ }
24
+ /**
25
+ * RadarInstance represents a radar chart instance with render and destroy methods.
26
+ */
27
+ export interface RadarInstance {
28
+ render: (config: RadarConfig) => void;
29
+ destroy: () => void;
30
+ }
31
+ /**
32
+ * Radar chart component using G2 5.0.
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * const radar = Radar({
37
+ * container: '#container',
38
+ * width: 600,
39
+ * height: 400,
40
+ * });
41
+ *
42
+ * radar.render({
43
+ * type: 'radar',
44
+ * data: [
45
+ * { name: '沟通能力', value: 2 },
46
+ * { name: '协作能力', value: 3 },
47
+ * { name: '领导能力', value: 2 },
48
+ * { name: '学习能力', value: 5 },
49
+ * { name: '创新能力', value: 6 },
50
+ * { name: '技术能力', value: 9 },
51
+ * ],
52
+ * });
53
+ *
54
+ * radar.destroy();
55
+ * ```
56
+ */
57
+ export declare const Radar: (options: VisualizationOptions) => RadarInstance;
@@ -0,0 +1,222 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ import { Chart } from '@antv/g2';
14
+ import { getBackgroundColor, getThemeColors, getThemeObject } from "../../util/theme";
15
+
16
+ /**
17
+ * RadarDataItem is the type for each data item in the radar chart.
18
+ */
19
+
20
+ /**
21
+ * RadarConfig defines the configuration for rendering the radar chart.
22
+ */
23
+
24
+ /**
25
+ * RadarInstance represents a radar chart instance with render and destroy methods.
26
+ */
27
+
28
+ /**
29
+ * Transform radar data to parallel coordinates format.
30
+ * Groups data by group field and converts to position-based encoding.
31
+ */
32
+ function transformRadarToParallel(data) {
33
+ if (!data || data.length === 0) {
34
+ return [];
35
+ }
36
+
37
+ // Group data by group field
38
+ var groups = {};
39
+ data.forEach(function (item) {
40
+ var groupKey = item.group || '';
41
+ if (!groups[groupKey]) {
42
+ groups[groupKey] = [];
43
+ }
44
+ groups[groupKey].push(item);
45
+ });
46
+
47
+ // Transform to parallel format
48
+ return Object.entries(groups).map(function (_ref) {
49
+ var _ref2 = _slicedToArray(_ref, 2),
50
+ group = _ref2[0],
51
+ values = _ref2[1];
52
+ var parallelValues = {};
53
+ values.forEach(function (_ref3) {
54
+ var name = _ref3.name,
55
+ value = _ref3.value;
56
+ parallelValues[name] = value;
57
+ });
58
+ return _objectSpread(_objectSpread({}, parallelValues), {}, {
59
+ group: group
60
+ });
61
+ });
62
+ }
63
+
64
+ /**
65
+ * Radar chart component using G2 5.0.
66
+ *
67
+ * @example
68
+ * ```ts
69
+ * const radar = Radar({
70
+ * container: '#container',
71
+ * width: 600,
72
+ * height: 400,
73
+ * });
74
+ *
75
+ * radar.render({
76
+ * type: 'radar',
77
+ * data: [
78
+ * { name: '沟通能力', value: 2 },
79
+ * { name: '协作能力', value: 3 },
80
+ * { name: '领导能力', value: 2 },
81
+ * { name: '学习能力', value: 5 },
82
+ * { name: '创新能力', value: 6 },
83
+ * { name: '技术能力', value: 9 },
84
+ * ],
85
+ * });
86
+ *
87
+ * radar.destroy();
88
+ * ```
89
+ */
90
+ export var Radar = function Radar(options) {
91
+ var container = options.container,
92
+ width = options.width,
93
+ height = options.height,
94
+ _options$theme = options.theme,
95
+ chartTheme = _options$theme === void 0 ? 'default' : _options$theme;
96
+ var chart = null;
97
+
98
+ /**
99
+ * Render the radar chart with the given configuration.
100
+ */
101
+ var render = function render(config) {
102
+ var _config$data = config.data,
103
+ data = _config$data === void 0 ? [] : _config$data,
104
+ _config$theme = config.theme,
105
+ theme = _config$theme === void 0 ? chartTheme : _config$theme,
106
+ title = config.title,
107
+ _config$style = config.style,
108
+ style = _config$style === void 0 ? {} : _config$style;
109
+
110
+ // Clean up previous chart if exists
111
+ if (chart) {
112
+ chart.destroy();
113
+ }
114
+ var _style$lineWidth = style.lineWidth,
115
+ lineWidth = _style$lineWidth === void 0 ? 2 : _style$lineWidth;
116
+ var colors = style.palette || getThemeColors(theme);
117
+ var backgroundColor = style.backgroundColor || getBackgroundColor(theme);
118
+
119
+ // Transform data to parallel format
120
+ var parallelData = transformRadarToParallel(data);
121
+ var position = Object.keys(parallelData[0] || {}).filter(function (key) {
122
+ return key !== 'group';
123
+ });
124
+
125
+ // Create chart
126
+ chart = new Chart({
127
+ container: container,
128
+ width: width,
129
+ height: height,
130
+ autoFit: true
131
+ });
132
+
133
+ // Configure chart options
134
+ // Note: Using 'any' type due to G2's complex type system with transformations
135
+ // This is consistent with how G2 5.0 is used elsewhere in the codebase
136
+ var chartOptions = {
137
+ type: 'line',
138
+ data: parallelData,
139
+ title: title !== null && title !== void 0 ? title : '',
140
+ coordinate: {
141
+ type: 'radar'
142
+ },
143
+ inset: 18,
144
+ encode: {
145
+ position: position,
146
+ color: 'group'
147
+ },
148
+ scale: _objectSpread(_objectSpread({}, Object.fromEntries(Array.from({
149
+ length: position.length
150
+ }, function (_, i) {
151
+ return ["position".concat(i === 0 ? '' : i), {
152
+ domainMin: 0,
153
+ nice: true
154
+ }];
155
+ }))), {}, {
156
+ color: {
157
+ range: colors
158
+ }
159
+ }),
160
+ axis: Object.fromEntries(Array.from({
161
+ length: position.length
162
+ }, function (_, i) {
163
+ return ["position".concat(i === 0 ? '' : i), {
164
+ zIndex: 1,
165
+ titleFontSize: 10,
166
+ titleSpacing: 8,
167
+ label: true,
168
+ labelFill: theme === 'dark' ? '#fff' : '#000',
169
+ labelOpacity: 0.45,
170
+ labelFontSize: 10,
171
+ line: true,
172
+ lineFill: '#000',
173
+ lineStrokeOpacity: 0.25,
174
+ tickFilter: function tickFilter(_, idx) {
175
+ return !(i !== 0 && idx === 0);
176
+ },
177
+ tickCount: 4,
178
+ gridStrokeOpacity: 0.45,
179
+ gridStroke: theme === 'dark' ? '#fff' : '#000',
180
+ gridLineWidth: 1,
181
+ gridLineDash: [4, 4]
182
+ }];
183
+ })),
184
+ style: {
185
+ lineWidth: lineWidth,
186
+ lineCap: 'round',
187
+ lineJoin: 'round'
188
+ },
189
+ legend: parallelData.length > 1 ? {
190
+ color: {
191
+ position: 'top',
192
+ itemMarker: 'point'
193
+ }
194
+ } : false,
195
+ interaction: {
196
+ tooltip: {
197
+ series: false
198
+ }
199
+ },
200
+ viewStyle: {
201
+ viewFill: backgroundColor
202
+ },
203
+ theme: getThemeObject(theme)
204
+ };
205
+ chart.options(chartOptions);
206
+ chart.render();
207
+ };
208
+
209
+ /**
210
+ * Destroy the chart instance and clean up resources.
211
+ */
212
+ var destroy = function destroy() {
213
+ if (chart) {
214
+ chart.destroy();
215
+ chart = null;
216
+ }
217
+ };
218
+ return {
219
+ render: render,
220
+ destroy: destroy
221
+ };
222
+ };