@antv/gpt-vis 0.6.1 → 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (524) hide show
  1. package/README.md +185 -114
  2. package/README.zh-CN.md +187 -112
  3. package/dist/cjs/gpt-vis/index.d.ts +115 -0
  4. package/dist/cjs/gpt-vis/index.js +196 -0
  5. package/dist/cjs/index.d.ts +57 -13
  6. package/dist/cjs/index.js +85 -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 +82 -0
  10. package/dist/cjs/syntax/parser.js +348 -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/container.d.ts +5 -0
  14. package/dist/cjs/{utils/map/util.js → util/container.js} +18 -13
  15. package/dist/cjs/util/theme.d.ts +26 -0
  16. package/dist/cjs/{theme.js → util/theme.js} +70 -14
  17. package/dist/cjs/vis/area/index.d.ts +60 -0
  18. package/dist/cjs/vis/area/index.js +152 -0
  19. package/dist/cjs/vis/bar/index.d.ts +60 -0
  20. package/dist/cjs/vis/bar/index.js +123 -0
  21. package/dist/cjs/vis/boxplot/index.d.ts +59 -0
  22. package/dist/cjs/vis/boxplot/index.js +111 -0
  23. package/dist/cjs/vis/column/index.d.ts +60 -0
  24. package/dist/cjs/vis/column/index.js +122 -0
  25. package/dist/cjs/vis/dual-axes/index.d.ts +64 -0
  26. package/dist/cjs/vis/dual-axes/index.js +148 -0
  27. package/dist/cjs/vis/fishbone-diagram/index.d.ts +35 -0
  28. package/dist/cjs/vis/fishbone-diagram/index.js +183 -0
  29. package/dist/cjs/vis/flow-diagram/index.d.ts +27 -0
  30. package/dist/cjs/vis/flow-diagram/index.js +271 -0
  31. package/dist/cjs/vis/funnel/index.d.ts +54 -0
  32. package/dist/cjs/vis/funnel/index.js +190 -0
  33. package/dist/cjs/vis/histogram/index.d.ts +47 -0
  34. package/dist/cjs/vis/histogram/index.js +108 -0
  35. package/dist/cjs/vis/indented-tree/index.d.ts +40 -0
  36. package/dist/cjs/vis/indented-tree/index.js +375 -0
  37. package/dist/cjs/vis/line/index.d.ts +59 -0
  38. package/dist/cjs/vis/line/index.js +105 -0
  39. package/dist/cjs/vis/liquid/index.d.ts +44 -0
  40. package/dist/cjs/vis/liquid/index.js +88 -0
  41. package/dist/cjs/vis/mindmap/index.d.ts +32 -0
  42. package/dist/cjs/vis/mindmap/index.js +214 -0
  43. package/dist/cjs/vis/network-graph/index.d.ts +59 -0
  44. package/dist/cjs/vis/network-graph/index.js +166 -0
  45. package/dist/cjs/vis/organization-chart/index.d.ts +64 -0
  46. package/dist/cjs/vis/organization-chart/index.js +191 -0
  47. package/dist/cjs/vis/pie/index.d.ts +55 -0
  48. package/dist/cjs/vis/pie/index.js +108 -0
  49. package/dist/cjs/vis/radar/index.d.ts +58 -0
  50. package/dist/cjs/vis/radar/index.js +153 -0
  51. package/dist/cjs/vis/sankey/index.d.ts +56 -0
  52. package/dist/cjs/vis/sankey/index.js +94 -0
  53. package/dist/cjs/vis/scatter/index.d.ts +54 -0
  54. package/dist/cjs/vis/scatter/index.js +95 -0
  55. package/dist/cjs/vis/summary/index.d.ts +41 -0
  56. package/dist/cjs/vis/summary/index.js +71 -0
  57. package/dist/cjs/vis/table/index.d.ts +50 -0
  58. package/dist/cjs/vis/table/index.js +209 -0
  59. package/dist/cjs/vis/treemap/index.d.ts +68 -0
  60. package/dist/cjs/vis/treemap/index.js +106 -0
  61. package/dist/cjs/vis/venn/index.d.ts +55 -0
  62. package/dist/cjs/vis/venn/index.js +115 -0
  63. package/dist/cjs/vis/violin/index.d.ts +59 -0
  64. package/dist/cjs/vis/violin/index.js +156 -0
  65. package/dist/cjs/vis/waterfall/index.d.ts +64 -0
  66. package/dist/cjs/vis/waterfall/index.js +195 -0
  67. package/dist/cjs/vis/word-cloud/index.d.ts +53 -0
  68. package/dist/cjs/vis/word-cloud/index.js +90 -0
  69. package/dist/cjs/vis-wrapper/icons.d.ts +8 -0
  70. package/dist/cjs/vis-wrapper/icons.js +63 -0
  71. package/dist/cjs/vis-wrapper/index.d.ts +25 -0
  72. package/dist/cjs/vis-wrapper/index.js +242 -0
  73. package/dist/cjs/vis-wrapper/styles.d.ts +8 -0
  74. package/dist/cjs/vis-wrapper/styles.js +221 -0
  75. package/dist/esm/gpt-vis/index.d.ts +115 -0
  76. package/dist/esm/gpt-vis/index.js +245 -0
  77. package/dist/esm/index.d.ts +57 -13
  78. package/dist/esm/index.js +28 -15
  79. package/dist/esm/syntax/index.d.ts +2 -0
  80. package/dist/esm/syntax/index.js +1 -0
  81. package/dist/esm/syntax/parser.d.ts +82 -0
  82. package/dist/esm/syntax/parser.js +559 -0
  83. package/dist/esm/types/index.d.ts +33 -2
  84. package/dist/esm/types/index.js +0 -1
  85. package/dist/esm/util/container.d.ts +5 -0
  86. package/dist/esm/util/container.js +20 -0
  87. package/dist/esm/util/theme.d.ts +26 -0
  88. package/dist/esm/util/theme.js +150 -0
  89. package/dist/esm/vis/area/index.d.ts +60 -0
  90. package/dist/esm/vis/area/index.js +231 -0
  91. package/dist/esm/vis/bar/index.d.ts +60 -0
  92. package/dist/esm/vis/bar/index.js +204 -0
  93. package/dist/esm/vis/boxplot/index.d.ts +59 -0
  94. package/dist/esm/vis/boxplot/index.js +177 -0
  95. package/dist/esm/vis/column/index.d.ts +60 -0
  96. package/dist/esm/vis/column/index.js +199 -0
  97. package/dist/esm/vis/dual-axes/index.d.ts +64 -0
  98. package/dist/esm/vis/dual-axes/index.js +235 -0
  99. package/dist/esm/vis/fishbone-diagram/index.d.ts +35 -0
  100. package/dist/esm/vis/fishbone-diagram/index.js +218 -0
  101. package/dist/esm/vis/flow-diagram/index.d.ts +27 -0
  102. package/dist/esm/vis/flow-diagram/index.js +342 -0
  103. package/dist/esm/vis/funnel/index.d.ts +54 -0
  104. package/dist/esm/vis/funnel/index.js +247 -0
  105. package/dist/esm/vis/histogram/index.d.ts +47 -0
  106. package/dist/esm/vis/histogram/index.js +147 -0
  107. package/dist/esm/vis/indented-tree/index.d.ts +40 -0
  108. package/dist/esm/vis/indented-tree/index.js +564 -0
  109. package/dist/esm/vis/line/index.d.ts +59 -0
  110. package/dist/esm/vis/line/index.js +173 -0
  111. package/dist/esm/vis/liquid/index.d.ts +44 -0
  112. package/dist/esm/vis/liquid/index.js +131 -0
  113. package/dist/esm/vis/mindmap/index.d.ts +32 -0
  114. package/dist/esm/vis/mindmap/index.js +315 -0
  115. package/dist/esm/vis/network-graph/index.d.ts +59 -0
  116. package/dist/esm/vis/network-graph/index.js +240 -0
  117. package/dist/esm/vis/organization-chart/index.d.ts +64 -0
  118. package/dist/esm/vis/organization-chart/index.js +269 -0
  119. package/dist/esm/vis/pie/index.d.ts +55 -0
  120. package/dist/esm/vis/pie/index.js +164 -0
  121. package/dist/esm/vis/radar/index.d.ts +58 -0
  122. package/dist/esm/vis/radar/index.js +238 -0
  123. package/dist/esm/vis/sankey/index.d.ts +56 -0
  124. package/dist/esm/vis/sankey/index.js +136 -0
  125. package/dist/esm/vis/scatter/index.d.ts +54 -0
  126. package/dist/esm/vis/scatter/index.js +159 -0
  127. package/dist/esm/vis/summary/index.d.ts +41 -0
  128. package/dist/esm/vis/summary/index.js +101 -0
  129. package/dist/esm/vis/table/index.d.ts +50 -0
  130. package/dist/esm/vis/table/index.js +167 -0
  131. package/dist/esm/vis/treemap/index.d.ts +68 -0
  132. package/dist/esm/vis/treemap/index.js +159 -0
  133. package/dist/esm/vis/venn/index.d.ts +55 -0
  134. package/dist/esm/vis/venn/index.js +167 -0
  135. package/dist/esm/vis/violin/index.d.ts +59 -0
  136. package/dist/esm/vis/violin/index.js +246 -0
  137. package/dist/esm/vis/waterfall/index.d.ts +64 -0
  138. package/dist/esm/vis/waterfall/index.js +263 -0
  139. package/dist/esm/vis/word-cloud/index.d.ts +53 -0
  140. package/dist/esm/vis/word-cloud/index.js +129 -0
  141. package/dist/esm/vis-wrapper/icons.d.ts +8 -0
  142. package/dist/esm/vis-wrapper/icons.js +29 -0
  143. package/dist/esm/vis-wrapper/index.d.ts +25 -0
  144. package/dist/esm/vis-wrapper/index.js +242 -0
  145. package/dist/esm/vis-wrapper/styles.d.ts +8 -0
  146. package/dist/esm/vis-wrapper/styles.js +21 -0
  147. package/dist/umd/index.min.js +1 -1
  148. package/package.json +18 -59
  149. package/README.ja-JP.md +0 -164
  150. package/dist/cjs/Area/index.d.ts +0 -11
  151. package/dist/cjs/Area/index.js +0 -105
  152. package/dist/cjs/Bar/index.d.ts +0 -14
  153. package/dist/cjs/Bar/index.js +0 -101
  154. package/dist/cjs/Boxplot/index.d.ts +0 -11
  155. package/dist/cjs/Boxplot/index.js +0 -88
  156. package/dist/cjs/ChartCodeRender/Loading.d.ts +0 -6
  157. package/dist/cjs/ChartCodeRender/Loading.js +0 -54
  158. package/dist/cjs/ChartCodeRender/VisChart.d.ts +0 -19
  159. package/dist/cjs/ChartCodeRender/VisChart.js +0 -338
  160. package/dist/cjs/ChartCodeRender/icon.d.ts +0 -10
  161. package/dist/cjs/ChartCodeRender/icon.js +0 -162
  162. package/dist/cjs/ChartCodeRender/index.d.ts +0 -8
  163. package/dist/cjs/ChartCodeRender/index.js +0 -113
  164. package/dist/cjs/ChartCodeRender/styles.d.ts +0 -19
  165. package/dist/cjs/ChartCodeRender/styles.js +0 -232
  166. package/dist/cjs/ChartCodeRender/type.d.ts +0 -176
  167. package/dist/cjs/ChartCodeRender/type.js +0 -17
  168. package/dist/cjs/ChartCodeRender/utils.d.ts +0 -1
  169. package/dist/cjs/ChartCodeRender/utils.js +0 -51
  170. package/dist/cjs/Column/index.d.ts +0 -14
  171. package/dist/cjs/Column/index.js +0 -102
  172. package/dist/cjs/ConfigProvider/context.d.ts +0 -3
  173. package/dist/cjs/ConfigProvider/context.js +0 -41
  174. package/dist/cjs/ConfigProvider/hooks/index.d.ts +0 -1
  175. package/dist/cjs/ConfigProvider/hooks/index.js +0 -23
  176. package/dist/cjs/ConfigProvider/hooks/useConfig.d.ts +0 -13
  177. package/dist/cjs/ConfigProvider/hooks/useConfig.js +0 -109
  178. package/dist/cjs/ConfigProvider/index.d.ts +0 -7
  179. package/dist/cjs/ConfigProvider/index.js +0 -43
  180. package/dist/cjs/DualAxes/index.d.ts +0 -20
  181. package/dist/cjs/DualAxes/index.js +0 -84
  182. package/dist/cjs/DualAxes/util.d.ts +0 -9
  183. package/dist/cjs/DualAxes/util.js +0 -77
  184. package/dist/cjs/FishboneDiagram/index.d.ts +0 -7
  185. package/dist/cjs/FishboneDiagram/index.js +0 -66
  186. package/dist/cjs/FlowDiagram/helper.d.ts +0 -7
  187. package/dist/cjs/FlowDiagram/helper.js +0 -83
  188. package/dist/cjs/FlowDiagram/index.d.ts +0 -6
  189. package/dist/cjs/FlowDiagram/index.js +0 -107
  190. package/dist/cjs/Funnel/index.d.ts +0 -12
  191. package/dist/cjs/Funnel/index.js +0 -173
  192. package/dist/cjs/GPTVis/Lite.d.ts +0 -19
  193. package/dist/cjs/GPTVis/Lite.js +0 -81
  194. package/dist/cjs/GPTVis/hooks/useContext.d.ts +0 -8
  195. package/dist/cjs/GPTVis/hooks/useContext.js +0 -49
  196. package/dist/cjs/GPTVis/hooks/useEvent.d.ts +0 -1
  197. package/dist/cjs/GPTVis/hooks/useEvent.js +0 -33
  198. package/dist/cjs/GPTVis/index.d.ts +0 -6
  199. package/dist/cjs/GPTVis/index.js +0 -42
  200. package/dist/cjs/HeatMap/index.d.ts +0 -12
  201. package/dist/cjs/HeatMap/index.js +0 -67
  202. package/dist/cjs/Histogram/index.d.ts +0 -8
  203. package/dist/cjs/Histogram/index.js +0 -79
  204. package/dist/cjs/IndentedTree/index.d.ts +0 -7
  205. package/dist/cjs/IndentedTree/index.js +0 -78
  206. package/dist/cjs/Line/index.d.ts +0 -11
  207. package/dist/cjs/Line/index.js +0 -94
  208. package/dist/cjs/Liquid/index.d.ts +0 -11
  209. package/dist/cjs/Liquid/index.js +0 -85
  210. package/dist/cjs/Map/Component/MapView.d.ts +0 -3
  211. package/dist/cjs/Map/Component/MapView.js +0 -40
  212. package/dist/cjs/Map/Component/Marker.d.ts +0 -3
  213. package/dist/cjs/Map/Component/Marker.js +0 -53
  214. package/dist/cjs/Map/Component/Polyline.d.ts +0 -3
  215. package/dist/cjs/Map/Component/Polyline.js +0 -50
  216. package/dist/cjs/Map/Component/index.d.ts +0 -4
  217. package/dist/cjs/Map/Component/index.js +0 -45
  218. package/dist/cjs/Map/data.json +0 -305
  219. package/dist/cjs/Map/index.d.ts +0 -5
  220. package/dist/cjs/Map/index.js +0 -61
  221. package/dist/cjs/MindMap/index.d.ts +0 -7
  222. package/dist/cjs/MindMap/index.js +0 -75
  223. package/dist/cjs/NetworkGraph/index.d.ts +0 -6
  224. package/dist/cjs/NetworkGraph/index.js +0 -75
  225. package/dist/cjs/OrganizationChart/index.d.ts +0 -6
  226. package/dist/cjs/OrganizationChart/index.js +0 -95
  227. package/dist/cjs/PathMap/index.d.ts +0 -6
  228. package/dist/cjs/PathMap/index.js +0 -58
  229. package/dist/cjs/Pie/index.d.ts +0 -23
  230. package/dist/cjs/Pie/index.js +0 -94
  231. package/dist/cjs/PinMap/index.d.ts +0 -6
  232. package/dist/cjs/PinMap/index.js +0 -44
  233. package/dist/cjs/PinMap/maker.svg +0 -1
  234. package/dist/cjs/Radar/index.d.ts +0 -13
  235. package/dist/cjs/Radar/index.js +0 -153
  236. package/dist/cjs/Sankey/index.d.ts +0 -14
  237. package/dist/cjs/Sankey/index.js +0 -110
  238. package/dist/cjs/Scatter/index.d.ts +0 -13
  239. package/dist/cjs/Scatter/index.js +0 -103
  240. package/dist/cjs/Spreadsheet/index.d.ts +0 -28
  241. package/dist/cjs/Spreadsheet/index.js +0 -113
  242. package/dist/cjs/Table/index.d.ts +0 -9
  243. package/dist/cjs/Table/index.js +0 -91
  244. package/dist/cjs/Text/VisText.d.ts +0 -4
  245. package/dist/cjs/Text/VisText.js +0 -82
  246. package/dist/cjs/Text/config.d.ts +0 -18
  247. package/dist/cjs/Text/config.js +0 -91
  248. package/dist/cjs/Text/custom-icons/index.d.ts +0 -3
  249. package/dist/cjs/Text/custom-icons/index.js +0 -66
  250. package/dist/cjs/Text/index.d.ts +0 -3
  251. package/dist/cjs/Text/index.js +0 -42
  252. package/dist/cjs/Text/mini-charts/hooks/getElementFontSize.d.ts +0 -1
  253. package/dist/cjs/Text/mini-charts/hooks/getElementFontSize.js +0 -65
  254. package/dist/cjs/Text/mini-charts/hooks/index.d.ts +0 -1
  255. package/dist/cjs/Text/mini-charts/hooks/useSvgWrapper.d.ts +0 -5
  256. package/dist/cjs/Text/mini-charts/hooks/useSvgWrapper.js +0 -65
  257. package/dist/cjs/Text/mini-charts/index.d.ts +0 -2
  258. package/dist/cjs/Text/mini-charts/index.js +0 -25
  259. package/dist/cjs/Text/mini-charts/line/SingleLineChart.d.ts +0 -3
  260. package/dist/cjs/Text/mini-charts/line/SingleLineChart.js +0 -63
  261. package/dist/cjs/Text/mini-charts/line/index.d.ts +0 -1
  262. package/dist/cjs/Text/mini-charts/line/index.js +0 -29
  263. package/dist/cjs/Text/mini-charts/line/scaleLinear.d.ts +0 -4
  264. package/dist/cjs/Text/mini-charts/line/scaleLinear.js +0 -35
  265. package/dist/cjs/Text/mini-charts/line/useLineCompute.d.ts +0 -6
  266. package/dist/cjs/Text/mini-charts/line/useLineCompute.js +0 -103
  267. package/dist/cjs/Text/mini-charts/proportion/getArcPath.d.ts +0 -1
  268. package/dist/cjs/Text/mini-charts/proportion/getArcPath.js +0 -51
  269. package/dist/cjs/Text/mini-charts/proportion/index.d.ts +0 -3
  270. package/dist/cjs/Text/mini-charts/proportion/index.js +0 -71
  271. package/dist/cjs/Text/theme.d.ts +0 -24
  272. package/dist/cjs/Text/theme.js +0 -52
  273. package/dist/cjs/Text/types.d.ts +0 -20
  274. package/dist/cjs/Text/types.js +0 -17
  275. package/dist/cjs/Text/utils/getThemeColor.d.ts +0 -11
  276. package/dist/cjs/Text/utils/getThemeColor.js +0 -46
  277. package/dist/cjs/Text/utils/index.d.ts +0 -2
  278. package/dist/cjs/Text/utils/index.js +0 -25
  279. package/dist/cjs/Text/utils/useAntdDarkAlgorithm.d.ts +0 -2
  280. package/dist/cjs/Text/utils/useAntdDarkAlgorithm.js +0 -40
  281. package/dist/cjs/Treemap/index.d.ts +0 -10
  282. package/dist/cjs/Treemap/index.js +0 -93
  283. package/dist/cjs/Venn/index.d.ts +0 -32
  284. package/dist/cjs/Venn/index.js +0 -87
  285. package/dist/cjs/Violin/index.d.ts +0 -10
  286. package/dist/cjs/Violin/index.js +0 -190
  287. package/dist/cjs/Waterfall/index.d.ts +0 -25
  288. package/dist/cjs/Waterfall/index.js +0 -184
  289. package/dist/cjs/WordCloud/index.d.ts +0 -9
  290. package/dist/cjs/WordCloud/index.js +0 -76
  291. package/dist/cjs/constants/index.d.ts +0 -2
  292. package/dist/cjs/constants/index.js +0 -35
  293. package/dist/cjs/export-map.browser.d.ts +0 -4
  294. package/dist/cjs/export-map.browser.js +0 -48
  295. package/dist/cjs/export-map.d.ts +0 -10
  296. package/dist/cjs/export-map.js +0 -41
  297. package/dist/cjs/export.d.ts +0 -76
  298. package/dist/cjs/export.js +0 -159
  299. package/dist/cjs/render.d.ts +0 -2
  300. package/dist/cjs/render.js +0 -67
  301. package/dist/cjs/theme.d.ts +0 -2
  302. package/dist/cjs/types/chart.d.ts +0 -88
  303. package/dist/cjs/types/chart.js +0 -61
  304. package/dist/cjs/types/config.d.ts +0 -25
  305. package/dist/cjs/types/config.js +0 -17
  306. package/dist/cjs/types/map.d.ts +0 -242
  307. package/dist/cjs/types/map.js +0 -17
  308. package/dist/cjs/utils/config.d.ts +0 -5
  309. package/dist/cjs/utils/config.js +0 -76
  310. package/dist/cjs/utils/graph.d.ts +0 -18
  311. package/dist/cjs/utils/graph.js +0 -64
  312. package/dist/cjs/utils/index.d.ts +0 -1
  313. package/dist/cjs/utils/index.js +0 -23
  314. package/dist/cjs/utils/map/context.d.ts +0 -3
  315. package/dist/cjs/utils/map/context.js +0 -45
  316. package/dist/cjs/utils/map/controls.d.ts +0 -0
  317. package/dist/cjs/utils/map/controls.js +0 -0
  318. package/dist/cjs/utils/map/index.d.ts +0 -6
  319. package/dist/cjs/utils/map/index.js +0 -33
  320. package/dist/cjs/utils/map/markers.d.ts +0 -2
  321. package/dist/cjs/utils/map/markers.js +0 -88
  322. package/dist/cjs/utils/map/polyline.d.ts +0 -2
  323. package/dist/cjs/utils/map/polyline.js +0 -52
  324. package/dist/cjs/utils/map/style.d.ts +0 -45
  325. package/dist/cjs/utils/map/style.js +0 -112
  326. package/dist/cjs/utils/map/util.d.ts +0 -1
  327. package/dist/cjs/utils/map/view.d.ts +0 -5
  328. package/dist/cjs/utils/map/view.js +0 -100
  329. package/dist/cjs/utils/palette.d.ts +0 -2
  330. package/dist/cjs/utils/palette.js +0 -54
  331. package/dist/cjs/utils/plot.d.ts +0 -5
  332. package/dist/cjs/utils/plot.js +0 -90
  333. package/dist/cjs/version.d.ts +0 -2
  334. package/dist/cjs/version.js +0 -25
  335. package/dist/esm/Area/index.d.ts +0 -11
  336. package/dist/esm/Area/index.js +0 -108
  337. package/dist/esm/Bar/index.d.ts +0 -14
  338. package/dist/esm/Bar/index.js +0 -92
  339. package/dist/esm/Boxplot/index.d.ts +0 -11
  340. package/dist/esm/Boxplot/index.js +0 -86
  341. package/dist/esm/ChartCodeRender/Loading.d.ts +0 -6
  342. package/dist/esm/ChartCodeRender/Loading.js +0 -21
  343. package/dist/esm/ChartCodeRender/VisChart.d.ts +0 -19
  344. package/dist/esm/ChartCodeRender/VisChart.js +0 -450
  345. package/dist/esm/ChartCodeRender/icon.d.ts +0 -10
  346. package/dist/esm/ChartCodeRender/icon.js +0 -103
  347. package/dist/esm/ChartCodeRender/index.d.ts +0 -8
  348. package/dist/esm/ChartCodeRender/index.js +0 -99
  349. package/dist/esm/ChartCodeRender/styles.d.ts +0 -19
  350. package/dist/esm/ChartCodeRender/styles.js +0 -61
  351. package/dist/esm/ChartCodeRender/type.d.ts +0 -176
  352. package/dist/esm/ChartCodeRender/type.js +0 -1
  353. package/dist/esm/ChartCodeRender/utils.d.ts +0 -1
  354. package/dist/esm/ChartCodeRender/utils.js +0 -37
  355. package/dist/esm/Column/index.d.ts +0 -14
  356. package/dist/esm/Column/index.js +0 -93
  357. package/dist/esm/ConfigProvider/context.d.ts +0 -3
  358. package/dist/esm/ConfigProvider/context.js +0 -3
  359. package/dist/esm/ConfigProvider/hooks/index.d.ts +0 -1
  360. package/dist/esm/ConfigProvider/hooks/index.js +0 -1
  361. package/dist/esm/ConfigProvider/hooks/useConfig.d.ts +0 -13
  362. package/dist/esm/ConfigProvider/hooks/useConfig.js +0 -71
  363. package/dist/esm/ConfigProvider/index.d.ts +0 -7
  364. package/dist/esm/ConfigProvider/index.js +0 -17
  365. package/dist/esm/DualAxes/index.d.ts +0 -20
  366. package/dist/esm/DualAxes/index.js +0 -77
  367. package/dist/esm/DualAxes/util.d.ts +0 -9
  368. package/dist/esm/DualAxes/util.js +0 -77
  369. package/dist/esm/FishboneDiagram/index.d.ts +0 -7
  370. package/dist/esm/FishboneDiagram/index.js +0 -43
  371. package/dist/esm/FlowDiagram/helper.d.ts +0 -7
  372. package/dist/esm/FlowDiagram/helper.js +0 -76
  373. package/dist/esm/FlowDiagram/index.d.ts +0 -6
  374. package/dist/esm/FlowDiagram/index.js +0 -72
  375. package/dist/esm/Funnel/index.d.ts +0 -12
  376. package/dist/esm/Funnel/index.js +0 -171
  377. package/dist/esm/GPTVis/Lite.d.ts +0 -19
  378. package/dist/esm/GPTVis/Lite.js +0 -57
  379. package/dist/esm/GPTVis/hooks/useContext.d.ts +0 -8
  380. package/dist/esm/GPTVis/hooks/useContext.js +0 -9
  381. package/dist/esm/GPTVis/hooks/useEvent.d.ts +0 -1
  382. package/dist/esm/GPTVis/hooks/useEvent.js +0 -6
  383. package/dist/esm/GPTVis/index.d.ts +0 -6
  384. package/dist/esm/GPTVis/index.js +0 -25
  385. package/dist/esm/HeatMap/index.d.ts +0 -12
  386. package/dist/esm/HeatMap/index.js +0 -45
  387. package/dist/esm/Histogram/index.d.ts +0 -8
  388. package/dist/esm/Histogram/index.js +0 -75
  389. package/dist/esm/IndentedTree/index.d.ts +0 -7
  390. package/dist/esm/IndentedTree/index.js +0 -68
  391. package/dist/esm/Line/index.d.ts +0 -11
  392. package/dist/esm/Line/index.js +0 -92
  393. package/dist/esm/Liquid/index.d.ts +0 -11
  394. package/dist/esm/Liquid/index.js +0 -100
  395. package/dist/esm/Map/Component/MapView.d.ts +0 -3
  396. package/dist/esm/Map/Component/MapView.js +0 -18
  397. package/dist/esm/Map/Component/Marker.d.ts +0 -3
  398. package/dist/esm/Map/Component/Marker.js +0 -40
  399. package/dist/esm/Map/Component/Polyline.d.ts +0 -3
  400. package/dist/esm/Map/Component/Polyline.js +0 -35
  401. package/dist/esm/Map/Component/index.d.ts +0 -4
  402. package/dist/esm/Map/Component/index.js +0 -4
  403. package/dist/esm/Map/data.json +0 -305
  404. package/dist/esm/Map/index.d.ts +0 -5
  405. package/dist/esm/Map/index.js +0 -50
  406. package/dist/esm/MindMap/index.d.ts +0 -7
  407. package/dist/esm/MindMap/index.js +0 -69
  408. package/dist/esm/NetworkGraph/index.d.ts +0 -6
  409. package/dist/esm/NetworkGraph/index.js +0 -64
  410. package/dist/esm/OrganizationChart/index.d.ts +0 -6
  411. package/dist/esm/OrganizationChart/index.js +0 -75
  412. package/dist/esm/PathMap/index.d.ts +0 -6
  413. package/dist/esm/PathMap/index.js +0 -41
  414. package/dist/esm/Pie/index.d.ts +0 -23
  415. package/dist/esm/Pie/index.js +0 -96
  416. package/dist/esm/PinMap/index.d.ts +0 -6
  417. package/dist/esm/PinMap/index.js +0 -22
  418. package/dist/esm/PinMap/maker.svg +0 -1
  419. package/dist/esm/Radar/index.d.ts +0 -13
  420. package/dist/esm/Radar/index.js +0 -150
  421. package/dist/esm/Sankey/index.d.ts +0 -14
  422. package/dist/esm/Sankey/index.js +0 -98
  423. package/dist/esm/Scatter/index.d.ts +0 -13
  424. package/dist/esm/Scatter/index.js +0 -95
  425. package/dist/esm/Spreadsheet/index.d.ts +0 -28
  426. package/dist/esm/Spreadsheet/index.js +0 -129
  427. package/dist/esm/Table/index.d.ts +0 -9
  428. package/dist/esm/Table/index.js +0 -30
  429. package/dist/esm/Text/VisText.d.ts +0 -4
  430. package/dist/esm/Text/VisText.js +0 -55
  431. package/dist/esm/Text/config.d.ts +0 -18
  432. package/dist/esm/Text/config.js +0 -82
  433. package/dist/esm/Text/custom-icons/index.d.ts +0 -3
  434. package/dist/esm/Text/custom-icons/index.js +0 -37
  435. package/dist/esm/Text/index.d.ts +0 -3
  436. package/dist/esm/Text/index.js +0 -2
  437. package/dist/esm/Text/mini-charts/hooks/getElementFontSize.d.ts +0 -1
  438. package/dist/esm/Text/mini-charts/hooks/getElementFontSize.js +0 -32
  439. package/dist/esm/Text/mini-charts/hooks/index.d.ts +0 -1
  440. package/dist/esm/Text/mini-charts/hooks/index.js +0 -1
  441. package/dist/esm/Text/mini-charts/hooks/useSvgWrapper.d.ts +0 -5
  442. package/dist/esm/Text/mini-charts/hooks/useSvgWrapper.js +0 -37
  443. package/dist/esm/Text/mini-charts/index.d.ts +0 -2
  444. package/dist/esm/Text/mini-charts/index.js +0 -2
  445. package/dist/esm/Text/mini-charts/line/SingleLineChart.d.ts +0 -3
  446. package/dist/esm/Text/mini-charts/line/SingleLineChart.js +0 -62
  447. package/dist/esm/Text/mini-charts/line/index.d.ts +0 -1
  448. package/dist/esm/Text/mini-charts/line/index.js +0 -1
  449. package/dist/esm/Text/mini-charts/line/scaleLinear.d.ts +0 -4
  450. package/dist/esm/Text/mini-charts/line/scaleLinear.js +0 -19
  451. package/dist/esm/Text/mini-charts/line/useLineCompute.d.ts +0 -6
  452. package/dist/esm/Text/mini-charts/line/useLineCompute.js +0 -118
  453. package/dist/esm/Text/mini-charts/proportion/getArcPath.d.ts +0 -1
  454. package/dist/esm/Text/mini-charts/proportion/getArcPath.js +0 -19
  455. package/dist/esm/Text/mini-charts/proportion/index.d.ts +0 -3
  456. package/dist/esm/Text/mini-charts/proportion/index.js +0 -64
  457. package/dist/esm/Text/theme.d.ts +0 -24
  458. package/dist/esm/Text/theme.js +0 -24
  459. package/dist/esm/Text/types.d.ts +0 -20
  460. package/dist/esm/Text/types.js +0 -1
  461. package/dist/esm/Text/utils/getThemeColor.d.ts +0 -11
  462. package/dist/esm/Text/utils/getThemeColor.js +0 -29
  463. package/dist/esm/Text/utils/index.d.ts +0 -2
  464. package/dist/esm/Text/utils/index.js +0 -2
  465. package/dist/esm/Text/utils/useAntdDarkAlgorithm.d.ts +0 -2
  466. package/dist/esm/Text/utils/useAntdDarkAlgorithm.js +0 -14
  467. package/dist/esm/Treemap/index.d.ts +0 -10
  468. package/dist/esm/Treemap/index.js +0 -88
  469. package/dist/esm/Venn/index.d.ts +0 -32
  470. package/dist/esm/Venn/index.js +0 -69
  471. package/dist/esm/Violin/index.d.ts +0 -10
  472. package/dist/esm/Violin/index.js +0 -199
  473. package/dist/esm/Waterfall/index.d.ts +0 -25
  474. package/dist/esm/Waterfall/index.js +0 -185
  475. package/dist/esm/WordCloud/index.d.ts +0 -9
  476. package/dist/esm/WordCloud/index.js +0 -59
  477. package/dist/esm/constants/index.d.ts +0 -2
  478. package/dist/esm/constants/index.js +0 -9
  479. package/dist/esm/export-map.browser.d.ts +0 -4
  480. package/dist/esm/export-map.browser.js +0 -5
  481. package/dist/esm/export-map.d.ts +0 -10
  482. package/dist/esm/export-map.js +0 -9
  483. package/dist/esm/export.d.ts +0 -76
  484. package/dist/esm/export.js +0 -51
  485. package/dist/esm/render.d.ts +0 -2
  486. package/dist/esm/render.js +0 -32
  487. package/dist/esm/theme.d.ts +0 -2
  488. package/dist/esm/theme.js +0 -103
  489. package/dist/esm/types/chart.d.ts +0 -88
  490. package/dist/esm/types/chart.js +0 -33
  491. package/dist/esm/types/config.d.ts +0 -25
  492. package/dist/esm/types/config.js +0 -1
  493. package/dist/esm/types/map.d.ts +0 -242
  494. package/dist/esm/types/map.js +0 -1
  495. package/dist/esm/utils/config.d.ts +0 -5
  496. package/dist/esm/utils/config.js +0 -53
  497. package/dist/esm/utils/graph.d.ts +0 -18
  498. package/dist/esm/utils/graph.js +0 -55
  499. package/dist/esm/utils/index.d.ts +0 -1
  500. package/dist/esm/utils/index.js +0 -1
  501. package/dist/esm/utils/map/context.d.ts +0 -3
  502. package/dist/esm/utils/map/context.js +0 -42
  503. package/dist/esm/utils/map/controls.d.ts +0 -0
  504. package/dist/esm/utils/map/controls.js +0 -0
  505. package/dist/esm/utils/map/index.d.ts +0 -6
  506. package/dist/esm/utils/map/index.js +0 -6
  507. package/dist/esm/utils/map/markers.d.ts +0 -2
  508. package/dist/esm/utils/map/markers.js +0 -69
  509. package/dist/esm/utils/map/polyline.d.ts +0 -2
  510. package/dist/esm/utils/map/polyline.js +0 -31
  511. package/dist/esm/utils/map/style.d.ts +0 -45
  512. package/dist/esm/utils/map/style.js +0 -80
  513. package/dist/esm/utils/map/util.d.ts +0 -1
  514. package/dist/esm/utils/map/util.js +0 -11
  515. package/dist/esm/utils/map/view.d.ts +0 -5
  516. package/dist/esm/utils/map/view.js +0 -83
  517. package/dist/esm/utils/palette.d.ts +0 -2
  518. package/dist/esm/utils/palette.js +0 -2
  519. package/dist/esm/utils/plot.d.ts +0 -5
  520. package/dist/esm/utils/plot.js +0 -86
  521. package/dist/esm/version.d.ts +0 -2
  522. package/dist/esm/version.js +0 -1
  523. package/dist/umd/376.async.js +0 -1
  524. package/dist/umd/index.min.css +0 -1
@@ -0,0 +1,342 @@
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 _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
3
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
+ 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); }
6
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
7
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
8
+ 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; }
9
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
11
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
13
+ 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); }
14
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
15
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
16
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
17
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
18
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
19
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
20
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
21
+ import { ExtensionCategory, Graph, HoverActivate, idOf, register } from '@antv/g6';
22
+ import { getBackgroundColor, normalizePalette } from "../../util/theme";
23
+
24
+ /**
25
+ * FlowDiagramConfig defines the configuration for rendering the flow diagram.
26
+ */
27
+
28
+ /**
29
+ * FlowDiagramInstance represents a flow diagram instance with render and destroy methods.
30
+ */
31
+
32
+ var ACTIVE_COLOR = '#f6c523';
33
+ var DEFAULT_NODE_WIDTH = 200;
34
+ var DEFAULT_NODE_HEIGHT = 80;
35
+ var HoverElement = /*#__PURE__*/function (_HoverActivate) {
36
+ _inherits(HoverElement, _HoverActivate);
37
+ var _super = _createSuper(HoverElement);
38
+ function HoverElement() {
39
+ _classCallCheck(this, HoverElement);
40
+ return _super.apply(this, arguments);
41
+ }
42
+ _createClass(HoverElement, [{
43
+ key: "getActiveIds",
44
+ value: function getActiveIds(event) {
45
+ var _this$context = this.context,
46
+ model = _this$context.model,
47
+ graph = _this$context.graph;
48
+ var targetType = event.targetType,
49
+ target = event.target;
50
+ var targetId = target.id;
51
+ var ids = [targetId];
52
+ if (targetType === 'edge') {
53
+ var edge = model.getEdgeDatum(targetId);
54
+ ids.push(edge.source, edge.target);
55
+ } else if (targetType === 'node') {
56
+ ids.push.apply(ids, _toConsumableArray(model.getRelatedEdgesData(targetId).map(idOf)));
57
+ }
58
+ graph.frontElement(ids);
59
+ return ids;
60
+ }
61
+ }]);
62
+ return HoverElement;
63
+ }(HoverActivate);
64
+ var behaviorRegistered = false;
65
+ function ensureBehaviorRegistered() {
66
+ if (!behaviorRegistered) {
67
+ register(ExtensionCategory.BEHAVIOR, 'hover-element', HoverElement);
68
+ behaviorRegistered = true;
69
+ }
70
+ }
71
+ function escapeHtml() {
72
+ var str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
73
+ return str.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#39;');
74
+ }
75
+ function createNodeHTML(d, color) {
76
+ var _d$data, _d$states, _d$states2;
77
+ var selectedBorderColor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '#000';
78
+ var text = escapeHtml(((_d$data = d.data) === null || _d$data === void 0 ? void 0 : _d$data.text) || '');
79
+ var isHovered = (_d$states = d.states) === null || _d$states === void 0 ? void 0 : _d$states.includes('active');
80
+ var isSelected = (_d$states2 = d.states) === null || _d$states2 === void 0 ? void 0 : _d$states2.includes('selected');
81
+ var nodeColor = isHovered ? ACTIVE_COLOR : color;
82
+ return "\n <div\n data-node-key=\"".concat(escapeHtml(String(d.id)), "\"\n style=\"\n box-sizing: border-box;\n width: ").concat(DEFAULT_NODE_WIDTH, "px;\n min-height: ").concat(DEFAULT_NODE_HEIGHT, "px;\n padding: 16px;\n background: ").concat(nodeColor, ";\n border: 3px solid ").concat(isSelected ? selectedBorderColor : nodeColor, ";\n border-radius: 16px;\n color: #fff;\n font-size: 16px;\n font-weight: 600;\n line-height: 22px;\n text-align: center;\n white-space: normal;\n word-break: break-word;\n overflow-wrap: anywhere;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n \"\n >\n <div style=\"width: 100%;\">\n ").concat(text, "\n </div>\n </div>\n ");
83
+ }
84
+ function measureAndUpdateNodeSizes(graph, container, nodeColorMap, selectedBorderColor) {
85
+ var nodes = graph.getNodeData();
86
+ var updatedNodes = nodes.map(function (node) {
87
+ var dom = container.querySelector("[data-node-key=\"".concat(CSS.escape(String(node.id)), "\"]"));
88
+ var height = DEFAULT_NODE_HEIGHT;
89
+ if (dom) {
90
+ height = Math.max(DEFAULT_NODE_HEIGHT, Math.ceil(dom.getBoundingClientRect().height));
91
+ }
92
+ return {
93
+ id: node.id,
94
+ style: {
95
+ size: [DEFAULT_NODE_WIDTH, height],
96
+ dx: -DEFAULT_NODE_WIDTH / 2,
97
+ dy: -height / 2,
98
+ innerHTML: createNodeHTML(node, nodeColorMap.get(String(node.id)) || '#1783FF', selectedBorderColor)
99
+ }
100
+ };
101
+ });
102
+ graph.updateNodeData(updatedNodes);
103
+ graph.render();
104
+ }
105
+
106
+ /**
107
+ * FlowDiagram chart component using G6 5.0 with dagre layout.
108
+ */
109
+ export var FlowDiagram = function FlowDiagram(options) {
110
+ var container = options.container,
111
+ width = options.width,
112
+ height = options.height,
113
+ _options$theme = options.theme,
114
+ chartTheme = _options$theme === void 0 ? 'default' : _options$theme;
115
+ var graph = null;
116
+ var render = function render(config) {
117
+ var data = config.data,
118
+ title = config.title,
119
+ _config$theme = config.theme,
120
+ theme = _config$theme === void 0 ? chartTheme : _config$theme,
121
+ _config$style = config.style,
122
+ style = _config$style === void 0 ? {} : _config$style;
123
+ if (graph) {
124
+ graph.destroy();
125
+ graph = null;
126
+ }
127
+ ensureBehaviorRegistered();
128
+ var colors = normalizePalette(style.palette, theme);
129
+ var backgroundColor = style.backgroundColor || getBackgroundColor(theme);
130
+
131
+ // Resolve container element
132
+ var containerEl;
133
+ if (typeof container === 'string') {
134
+ var el = document.getElementById(container.replace(/^#/, ''));
135
+ if (!el) throw new Error("Container element \"".concat(container, "\" not found"));
136
+ containerEl = el;
137
+ } else {
138
+ containerEl = container;
139
+ }
140
+ containerEl.style.backgroundColor = backgroundColor;
141
+
142
+ // Compute node ranks (BFS layers) for color assignment by row
143
+ var nodeRankMap = new Map();
144
+ var incomingTargets = new Set(data.edges.map(function (e) {
145
+ return e.target;
146
+ }));
147
+ var childrenMap = new Map();
148
+ var _iterator = _createForOfIteratorHelper(data.edges),
149
+ _step;
150
+ try {
151
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
152
+ var edge = _step.value;
153
+ var list = childrenMap.get(edge.source) || [];
154
+ list.push(edge.target);
155
+ childrenMap.set(edge.source, list);
156
+ }
157
+ } catch (err) {
158
+ _iterator.e(err);
159
+ } finally {
160
+ _iterator.f();
161
+ }
162
+ var roots = data.nodes.filter(function (n) {
163
+ return !incomingTargets.has(n.name);
164
+ }).map(function (n) {
165
+ return n.name;
166
+ });
167
+ var queue = roots.map(function (name) {
168
+ return {
169
+ name: name,
170
+ rank: 0
171
+ };
172
+ });
173
+ var head = 0;
174
+ while (head < queue.length) {
175
+ var _queue$head = queue[head++],
176
+ name = _queue$head.name,
177
+ rank = _queue$head.rank;
178
+ if (nodeRankMap.has(name)) continue;
179
+ nodeRankMap.set(name, rank);
180
+ var _iterator2 = _createForOfIteratorHelper(childrenMap.get(name) || []),
181
+ _step2;
182
+ try {
183
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
184
+ var child = _step2.value;
185
+ if (!nodeRankMap.has(child)) {
186
+ queue.push({
187
+ name: child,
188
+ rank: rank + 1
189
+ });
190
+ }
191
+ }
192
+ } catch (err) {
193
+ _iterator2.e(err);
194
+ } finally {
195
+ _iterator2.f();
196
+ }
197
+ }
198
+
199
+ // Convert GraphData (name-based) to G6 format (id-based), color by rank
200
+ var nodeColorMap = new Map();
201
+ var g6Nodes = data.nodes.map(function (node) {
202
+ var rank = nodeRankMap.get(node.name) || 0;
203
+ var color = colors[rank % colors.length];
204
+ nodeColorMap.set(node.name, color);
205
+ return {
206
+ id: node.name,
207
+ data: {
208
+ text: node.name
209
+ }
210
+ };
211
+ });
212
+ var nodeNames = new Set(data.nodes.map(function (n) {
213
+ return n.name;
214
+ }));
215
+ var g6Edges = data.edges.filter(function (edge) {
216
+ return nodeNames.has(edge.source) && nodeNames.has(edge.target);
217
+ }).map(function (edge, index) {
218
+ return {
219
+ id: "edge-".concat(index),
220
+ source: edge.source,
221
+ target: edge.target,
222
+ data: {
223
+ text: edge.name || ''
224
+ }
225
+ };
226
+ });
227
+ var isDark = theme === 'dark';
228
+ var edgeStroke = isDark ? '#5a6b7f' : '#8b9baf';
229
+ var labelFill = isDark ? '#aab4c0' : '#8b9baf';
230
+ var labelBgFill = isDark ? '#1a1a2e' : '#f8f8f8';
231
+ var labelBgStroke = isDark ? '#5a6b7f' : '#8b9baf';
232
+ var selectedBorder = isDark ? '#fff' : '#000';
233
+ graph = new Graph({
234
+ animation: false,
235
+ container: containerEl,
236
+ width: width,
237
+ height: height,
238
+ theme: theme,
239
+ data: {
240
+ nodes: g6Nodes,
241
+ edges: g6Edges
242
+ },
243
+ autoFit: 'view',
244
+ autoResize: true,
245
+ padding: 20,
246
+ plugins: title ? [{
247
+ key: 'title',
248
+ type: 'title',
249
+ title: title,
250
+ titleFill: isDark ? '#e0e6ed' : '#1a1a2e'
251
+ }] : [],
252
+ node: {
253
+ type: 'html',
254
+ style: function style(d) {
255
+ var color = nodeColorMap.get(String(d.id)) || colors[0];
256
+ return {
257
+ size: [DEFAULT_NODE_WIDTH, DEFAULT_NODE_HEIGHT],
258
+ dx: -DEFAULT_NODE_WIDTH / 2,
259
+ dy: -DEFAULT_NODE_HEIGHT / 2,
260
+ innerHTML: createNodeHTML(d, color, selectedBorder),
261
+ ports: [{
262
+ placement: 'top'
263
+ }, {
264
+ placement: 'bottom'
265
+ }]
266
+ };
267
+ },
268
+ state: {
269
+ active: {
270
+ halo: false
271
+ },
272
+ selected: {
273
+ halo: false
274
+ }
275
+ }
276
+ },
277
+ edge: {
278
+ type: 'polyline',
279
+ style: {
280
+ lineWidth: 3,
281
+ radius: 20,
282
+ stroke: edgeStroke,
283
+ endArrow: true,
284
+ labelText: function labelText(d) {
285
+ var _d$data2;
286
+ return ((_d$data2 = d.data) === null || _d$data2 === void 0 ? void 0 : _d$data2.text) || '';
287
+ },
288
+ labelFill: labelFill,
289
+ labelFontWeight: 600,
290
+ labelBackground: true,
291
+ labelBackgroundFill: labelBgFill,
292
+ labelBackgroundOpacity: 1,
293
+ labelBackgroundLineWidth: 3,
294
+ labelBackgroundStroke: labelBgStroke,
295
+ labelPadding: [1, 10],
296
+ labelBackgroundRadius: 4,
297
+ router: {
298
+ type: 'orth',
299
+ padding: 40
300
+ }
301
+ },
302
+ state: {
303
+ active: {
304
+ stroke: ACTIVE_COLOR,
305
+ labelBackgroundStroke: ACTIVE_COLOR,
306
+ halo: false
307
+ }
308
+ }
309
+ },
310
+ layout: {
311
+ type: 'antv-dagre'
312
+ },
313
+ behaviors: ['drag-canvas', 'hover-element', 'click-select']
314
+ });
315
+ graph.render();
316
+
317
+ // Measure real node heights after initial render
318
+ graph.once('afterrender', function () {
319
+ if (graph) {
320
+ measureAndUpdateNodeSizes(graph, containerEl, nodeColorMap, selectedBorder);
321
+ }
322
+ });
323
+ };
324
+ var destroy = function destroy() {
325
+ if (graph) {
326
+ graph.destroy();
327
+ graph = null;
328
+ }
329
+ };
330
+ return {
331
+ render: render,
332
+ destroy: destroy,
333
+ zoomTo: function zoomTo(zoom) {
334
+ var _graph;
335
+ return (_graph = graph) === null || _graph === void 0 ? void 0 : _graph.zoomTo(zoom);
336
+ },
337
+ getZoom: function getZoom() {
338
+ var _graph2;
339
+ return (_graph2 = graph) === null || _graph2 === void 0 ? void 0 : _graph2.getZoom();
340
+ }
341
+ };
342
+ };
@@ -0,0 +1,54 @@
1
+ import type { VisualizationOptions } from '../../types';
2
+ /**
3
+ * FunnelDataItem is the type for each data item in the funnel chart.
4
+ */
5
+ export type FunnelDataItem = {
6
+ category: string;
7
+ value: number;
8
+ };
9
+ /**
10
+ * FunnelConfig defines the configuration for rendering the funnel chart.
11
+ */
12
+ export interface FunnelConfig {
13
+ type?: 'funnel';
14
+ data: FunnelDataItem[];
15
+ theme?: 'default' | 'academy' | 'dark';
16
+ title?: string;
17
+ style?: {
18
+ backgroundColor?: string;
19
+ palette?: string[];
20
+ };
21
+ }
22
+ /**
23
+ * FunnelInstance represents a funnel chart instance with render and destroy methods.
24
+ */
25
+ export interface FunnelInstance {
26
+ render: (config: FunnelConfig) => void;
27
+ destroy: () => void;
28
+ }
29
+ /**
30
+ * Funnel chart component using G2 5.0.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const funnel = Funnel({
35
+ * container: '#container',
36
+ * width: 600,
37
+ * height: 400,
38
+ * });
39
+ *
40
+ * funnel.render({
41
+ * type: 'funnel',
42
+ * data: [
43
+ * { category: '访问', value: 1000 },
44
+ * { category: '咨询', value: 600 },
45
+ * { category: '下单', value: 300 },
46
+ * { category: '成交', value: 120 },
47
+ * ],
48
+ * theme: 'academy'
49
+ * });
50
+ *
51
+ * funnel.destroy();
52
+ * ```
53
+ */
54
+ export declare const Funnel: (options: VisualizationOptions) => FunnelInstance;
@@ -0,0 +1,247 @@
1
+ import { Chart } from '@antv/g2';
2
+ import { getBackgroundColor, getThemeObject, normalizePalette } from "../../util/theme";
3
+
4
+ /**
5
+ * FunnelDataItem is the type for each data item in the funnel chart.
6
+ */
7
+
8
+ /**
9
+ * FunnelConfig defines the configuration for rendering the funnel chart.
10
+ */
11
+
12
+ /**
13
+ * FunnelInstance represents a funnel chart instance with render and destroy methods.
14
+ */
15
+
16
+ /**
17
+ * Funnel chart component using G2 5.0.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const funnel = Funnel({
22
+ * container: '#container',
23
+ * width: 600,
24
+ * height: 400,
25
+ * });
26
+ *
27
+ * funnel.render({
28
+ * type: 'funnel',
29
+ * data: [
30
+ * { category: '访问', value: 1000 },
31
+ * { category: '咨询', value: 600 },
32
+ * { category: '下单', value: 300 },
33
+ * { category: '成交', value: 120 },
34
+ * ],
35
+ * theme: 'academy'
36
+ * });
37
+ *
38
+ * funnel.destroy();
39
+ * ```
40
+ */
41
+ export var Funnel = function Funnel(options) {
42
+ var container = options.container,
43
+ width = options.width,
44
+ height = options.height,
45
+ _options$theme = options.theme,
46
+ chartTheme = _options$theme === void 0 ? 'default' : _options$theme;
47
+ var chart = null;
48
+
49
+ /**
50
+ * Render the funnel chart with the given configuration.
51
+ */
52
+ var render = function render(config) {
53
+ var _data$, _data, _data$2, _data2, _data$3, _data3;
54
+ var _config$data = config.data,
55
+ data = _config$data === void 0 ? [] : _config$data,
56
+ _config$theme = config.theme,
57
+ theme = _config$theme === void 0 ? chartTheme : _config$theme,
58
+ title = config.title,
59
+ _config$style = config.style,
60
+ style = _config$style === void 0 ? {} : _config$style;
61
+
62
+ // Clean up previous chart if exists
63
+ if (chart) {
64
+ chart.destroy();
65
+ }
66
+
67
+ // Get colors from style.palette or theme defaults
68
+ var colors = normalizePalette(style.palette, theme);
69
+ var backgroundColor = style.backgroundColor || getBackgroundColor(theme);
70
+
71
+ // Helper function to calculate conversion rate
72
+ var conversionRate = function conversionRate(start, end) {
73
+ return "".concat((end / start * 100).toFixed(2), " %");
74
+ };
75
+
76
+ // Create chart
77
+ chart = new Chart({
78
+ container: container,
79
+ width: width,
80
+ height: height,
81
+ autoFit: true,
82
+ paddingLeft: 40,
83
+ paddingRight: 68
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
+ animate: false,
91
+ type: 'view',
92
+ data: data,
93
+ title: title !== null && title !== void 0 ? title : '',
94
+ children: [{
95
+ type: 'interval',
96
+ data: data,
97
+ encode: {
98
+ x: 'category',
99
+ y: 'value',
100
+ color: 'category',
101
+ shape: 'funnel' // Use funnel shape for proper funnel visualization
102
+ },
103
+ transform: [{
104
+ type: 'symmetryY'
105
+ }],
106
+ coordinate: {
107
+ transform: [{
108
+ type: 'transpose'
109
+ }]
110
+ },
111
+ scale: {
112
+ x: {
113
+ padding: 0
114
+ },
115
+ color: {
116
+ range: colors
117
+ }
118
+ },
119
+ legend: {
120
+ color: {
121
+ position: 'top',
122
+ layout: {
123
+ justifyContent: 'center'
124
+ }
125
+ }
126
+ },
127
+ labels: [
128
+ // Inside label showing category and value
129
+ {
130
+ text: function text(d) {
131
+ return "".concat(d.category, "\n").concat(d.value);
132
+ },
133
+ position: 'inside',
134
+ transform: [{
135
+ type: 'contrastReverse'
136
+ }]
137
+ },
138
+ // Connecting line for conversion rate
139
+ {
140
+ text: function text(d, i) {
141
+ return i !== 0 ? '———' : '';
142
+ },
143
+ style: {
144
+ 'font-size': '1px',
145
+ color: '#666',
146
+ 'letter-spacing': '0px'
147
+ },
148
+ position: 'top-right',
149
+ fill: '#666',
150
+ dx: 35,
151
+ dy: -8
152
+ },
153
+ // Conversion rate label text
154
+ {
155
+ text: function text(d, i) {
156
+ return i !== 0 ? '转化率' : '';
157
+ },
158
+ position: 'top-right',
159
+ textAlign: 'left',
160
+ textBaseline: 'middle',
161
+ fill: '#666',
162
+ dx: 40
163
+ },
164
+ // Conversion rate percentage
165
+ {
166
+ text: function text(d, i, dataArray) {
167
+ return i !== 0 ? conversionRate(dataArray[i - 1].value, dataArray[i].value) : '';
168
+ },
169
+ position: 'top-right',
170
+ textAlign: 'left',
171
+ textBaseline: 'middle',
172
+ dx: 80
173
+ }],
174
+ viewStyle: {
175
+ viewFill: backgroundColor
176
+ }
177
+ },
178
+ // Overall conversion rate connector
179
+ {
180
+ type: 'connector',
181
+ data: [{
182
+ startX: (_data$ = data[0]) === null || _data$ === void 0 ? void 0 : _data$.category,
183
+ startY: (_data = data[data.length - 1]) === null || _data === void 0 ? void 0 : _data.category,
184
+ endX: 0,
185
+ endY: (((_data$2 = data[0]) === null || _data$2 === void 0 ? void 0 : _data$2.value) - ((_data2 = data[data.length - 1]) === null || _data2 === void 0 ? void 0 : _data2.value)) / 2
186
+ }],
187
+ encode: {
188
+ x: 'startX',
189
+ x1: 'startY',
190
+ y: 'endX',
191
+ y1: 'endY'
192
+ },
193
+ style: {
194
+ stroke: '#666',
195
+ markerEnd: false,
196
+ connectLength1: -12,
197
+ offset2: -20,
198
+ connectorStroke: '#0649f2',
199
+ lineDash: [12, 2]
200
+ },
201
+ labels: [{
202
+ text: '转化率',
203
+ position: 'left',
204
+ textAlign: 'start',
205
+ textBaseline: 'middle',
206
+ fill: '#666',
207
+ dx: 10
208
+ }, {
209
+ text: conversionRate((_data$3 = data[0]) === null || _data$3 === void 0 ? void 0 : _data$3.value, (_data3 = data[data.length - 1]) === null || _data3 === void 0 ? void 0 : _data3.value),
210
+ position: 'left',
211
+ textAlign: 'start',
212
+ dx: 50,
213
+ fill: '#000'
214
+ }]
215
+ }],
216
+ axis: false,
217
+ tooltip: {
218
+ items: [function (d) {
219
+ return {
220
+ name: d.category,
221
+ value: d.value
222
+ };
223
+ }]
224
+ },
225
+ viewStyle: {
226
+ viewFill: backgroundColor
227
+ },
228
+ theme: getThemeObject(theme)
229
+ };
230
+ chart.options(chartOptions);
231
+ chart.render();
232
+ };
233
+
234
+ /**
235
+ * Destroy the chart instance and clean up resources.
236
+ */
237
+ var destroy = function destroy() {
238
+ if (chart) {
239
+ chart.destroy();
240
+ chart = null;
241
+ }
242
+ };
243
+ return {
244
+ render: render,
245
+ destroy: destroy
246
+ };
247
+ };
@@ -0,0 +1,47 @@
1
+ import type { VisualizationOptions } from '../../types';
2
+ /**
3
+ * HistogramConfig defines the configuration for rendering the histogram chart.
4
+ */
5
+ export interface HistogramConfig {
6
+ type?: 'histogram';
7
+ data: number[];
8
+ binNumber?: number;
9
+ title?: string;
10
+ axisXTitle?: string;
11
+ axisYTitle?: string;
12
+ theme?: 'default' | 'academy' | 'dark';
13
+ style?: {
14
+ backgroundColor?: string;
15
+ palette?: string[];
16
+ };
17
+ }
18
+ /**
19
+ * HistogramInstance represents a histogram chart instance with render and destroy methods.
20
+ */
21
+ export interface HistogramInstance {
22
+ render: (config: HistogramConfig) => void;
23
+ destroy: () => void;
24
+ }
25
+ /**
26
+ * Histogram chart component using G2 5.0.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const histogram = Histogram({
31
+ * container: '#container',
32
+ * width: 600,
33
+ * height: 400,
34
+ * });
35
+ *
36
+ * histogram.render({
37
+ * type: 'histogram',
38
+ * data: [78, 88, 60, 100, 95],
39
+ * binNumber: 5,
40
+ * title: '成绩分布',
41
+ * theme: 'academy'
42
+ * });
43
+ *
44
+ * histogram.destroy();
45
+ * ```
46
+ */
47
+ export declare const Histogram: (options: VisualizationOptions) => HistogramInstance;