@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,90 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/vis/word-cloud/index.ts
20
+ var word_cloud_exports = {};
21
+ __export(word_cloud_exports, {
22
+ WordCloud: () => WordCloud
23
+ });
24
+ module.exports = __toCommonJS(word_cloud_exports);
25
+ var import_g2 = require("@antv/g2");
26
+ var import_theme = require("../../util/theme");
27
+ var WordCloud = (options) => {
28
+ const { container, width, height, theme: chartTheme = "default" } = options;
29
+ let chart = null;
30
+ const render = (config) => {
31
+ const { data = [], theme = chartTheme, title, style = {} } = config;
32
+ if (chart) {
33
+ chart.destroy();
34
+ }
35
+ const colors = (0, import_theme.normalizePalette)(style.palette, theme);
36
+ const backgroundColor = style.backgroundColor || (0, import_theme.getBackgroundColor)(theme);
37
+ chart = new import_g2.Chart({
38
+ container,
39
+ width,
40
+ height,
41
+ autoFit: true
42
+ });
43
+ const chartOptions = {
44
+ animate: false,
45
+ type: "wordCloud",
46
+ data,
47
+ title: title ?? "",
48
+ layout: {
49
+ fontSize: [8, 42]
50
+ },
51
+ encode: {
52
+ text: "text",
53
+ color: "text",
54
+ value: "value"
55
+ },
56
+ scale: {
57
+ color: { range: colors }
58
+ },
59
+ legend: false,
60
+ tooltip: {
61
+ items: [
62
+ (d) => ({
63
+ name: d.text,
64
+ value: d.value
65
+ })
66
+ ]
67
+ },
68
+ viewStyle: {
69
+ viewFill: backgroundColor
70
+ },
71
+ theme: (0, import_theme.getThemeObject)(theme)
72
+ };
73
+ chart.options(chartOptions);
74
+ chart.render();
75
+ };
76
+ const destroy = () => {
77
+ if (chart) {
78
+ chart.destroy();
79
+ chart = null;
80
+ }
81
+ };
82
+ return {
83
+ render,
84
+ destroy
85
+ };
86
+ };
87
+ // Annotate the CommonJS export names for ESM import in node:
88
+ 0 && (module.exports = {
89
+ WordCloud
90
+ });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Create SVG icon elements for the wrapper UI
3
+ */
4
+ export declare function createCopyIcon(size?: number, fill?: string): string;
5
+ export declare function createCheckIcon(size?: number, fill?: string): string;
6
+ export declare function createDownloadIcon(size?: number, fill?: string): string;
7
+ export declare function createZoomInIcon(size?: number, fill?: string): string;
8
+ export declare function createZoomOutIcon(size?: number, fill?: string): string;
@@ -0,0 +1,63 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/vis-wrapper/icons.ts
20
+ var icons_exports = {};
21
+ __export(icons_exports, {
22
+ createCheckIcon: () => createCheckIcon,
23
+ createCopyIcon: () => createCopyIcon,
24
+ createDownloadIcon: () => createDownloadIcon,
25
+ createZoomInIcon: () => createZoomInIcon,
26
+ createZoomOutIcon: () => createZoomOutIcon
27
+ });
28
+ module.exports = __toCommonJS(icons_exports);
29
+ function createCopyIcon(size = 14, fill = "#707070") {
30
+ return `<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" fill="${fill}">
31
+ <path d="M768 682.666667V170.666667a85.333333 85.333333 0 0 0-85.333333-85.333334H170.666667a85.333333 85.333333 0 0 0-85.333334 85.333334v512a85.333333 85.333333 0 0 0 85.333334 85.333333h512a85.333333 85.333333 0 0 0 85.333333-85.333333zM170.666667 170.666667h512v512H170.666667z m682.666666 85.333333v512a85.333333 85.333333 0 0 1-85.333333 85.333333H256a85.333333 85.333333 0 0 0 85.333333 85.333334h426.666667a170.666667 170.666667 0 0 0 170.666667-170.666667V341.333333a85.333333 85.333333 0 0 0-85.333334-85.333333z"></path>
32
+ </svg>`;
33
+ }
34
+ function createCheckIcon(size = 14, fill = "#707070") {
35
+ return `<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" fill="${fill}">
36
+ <path d="M380.416 822.144c-10.432 0-20.864-3.968-28.8-11.968L75.968 534.592c-15.936-15.936-15.936-41.664 0-57.6 15.872-15.872 41.664-15.872 57.536 0L380.416 723.84l510.08-510.016c15.872-15.936 41.664-15.936 57.536 0 15.936 15.936 15.936 41.664 0 57.6L409.216 810.24c-7.936 7.936-18.368 11.904-28.8 11.904z"></path>
37
+ </svg>`;
38
+ }
39
+ function createDownloadIcon(size = 14, fill = "#707070") {
40
+ return `<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" fill="${fill}">
41
+ <path d="M512 165.93q13.645 0 23.31 9.666t9.665 23.31V580.77L653.37 472.103q9.517-9.517 23.434-9.517 14.164 0 23.558 9.394t9.393 23.557q0 13.917-9.517 23.434L535.434 683.774q-9.517 9.517-23.434 9.517t-23.434-9.517L323.763 518.971q-9.517-10.036-9.517-23.434 0-13.645 9.665-23.31t23.31-9.665q13.917 0 23.434 9.516L479.05 580.744V198.881q0-13.645 9.665-23.31t23.31-9.665z m329.582 461.435q13.645 0 23.31 9.665t9.665 23.31v131.828q0 41.207-28.575 69.782-29.095 29.095-69.536 29.095H248.32q-40.416 0-70.03-28.848-28.847-29.613-28.847-70.03V660.34q0-13.645 9.665-23.31t23.31-9.665 23.31 9.665 9.666 23.31v131.828q0 13.645 9.665 23.31t23.31 9.665h528.127q13.398 0 22.791-9.665t9.393-23.31V660.34q0-13.645 9.666-23.31t23.31-9.665z"></path>
42
+ </svg>`;
43
+ }
44
+ function createZoomInIcon(size = 18, fill = "#707070") {
45
+ return `<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" fill="${fill}">
46
+ <path d="M889.5 852.7l-220-219.9c45-53.4 72.1-122.3 72.1-197.5 0-169.4-137.8-307.3-307.3-307.3S127.1 265.8 127.1 435.3s137.8 307.3 307.3 307.3c76.1 0 145.7-27.8 199.4-73.8l219.8 219.8c4.9 5 11.4 7.4 17.9 7.4s13-2.5 17.9-7.4c10-9.9 10-26 0.1-35.9zM434.4 691.8c-141.4 0-256.5-115.1-256.5-256.5 0-141.5 115.1-256.5 256.5-256.5s256.5 115.1 256.5 256.5-115.1 256.5-256.5 256.5z"></path>
47
+ <path d="M555 418.3h-99.8v-99.8c0-14-11.4-25.4-25.4-25.4s-25.4 11.4-25.4 25.4v99.8h-99.8c-14 0-25.4 11.4-25.4 25.4s11.4 25.4 25.4 25.4h99.8v99.8c0 14 11.4 25.4 25.4 25.4s25.4-11.4 25.4-25.4v-99.8H555c14 0 25.4-11.4 25.4-25.4S569 418.3 555 418.3z"></path>
48
+ </svg>`;
49
+ }
50
+ function createZoomOutIcon(size = 18, fill = "#707070") {
51
+ return `<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" fill="${fill}">
52
+ <path d="M889.5 852.7l-220-219.9c45-53.4 72.1-122.3 72.1-197.5 0-169.4-137.8-307.3-307.3-307.3S127.1 265.8 127.1 435.3s137.8 307.3 307.3 307.3c76.1 0 145.7-27.8 199.4-73.8l219.8 219.8c4.9 5 11.4 7.4 17.9 7.4s13-2.5 17.9-7.4c10-9.9 10-26 0.1-35.9zM434.4 691.8c-141.4 0-256.5-115.1-256.5-256.5 0-141.5 115.1-256.5 256.5-256.5s256.5 115.1 256.5 256.5-115.1 256.5-256.5 256.5z"></path>
53
+ <path d="M555 418.3H304.7c-14 0-25.4 11.4-25.4 25.4s11.4 25.4 25.4 25.4H555c14 0 25.4-11.4 25.4-25.4S569 418.3 555 418.3z"></path>
54
+ </svg>`;
55
+ }
56
+ // Annotate the CommonJS export names for ESM import in node:
57
+ 0 && (module.exports = {
58
+ createCheckIcon,
59
+ createCopyIcon,
60
+ createDownloadIcon,
61
+ createZoomInIcon,
62
+ createZoomOutIcon
63
+ });
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Wrapper configuration options
3
+ */
4
+ export interface WrapperConfig {
5
+ chartType?: string;
6
+ syntax?: string | object;
7
+ locale?: string;
8
+ onChartReady?: (chart: any) => void;
9
+ }
10
+ /**
11
+ * Wrapper instance that provides control over the wrapper UI
12
+ */
13
+ export interface WrapperInstance {
14
+ chartContainer: HTMLElement;
15
+ destroy: () => void;
16
+ setChartRef: (chart: any) => void;
17
+ update: (syntax: string | object) => void;
18
+ }
19
+ /**
20
+ * Create a wrapper container with tabs, buttons, and controls
21
+ * @param container - The parent container element or selector
22
+ * @param config - Wrapper configuration options
23
+ * @returns A wrapper instance with the chart container and controls
24
+ */
25
+ export declare function createVisWrapper(container: string | HTMLElement, config?: WrapperConfig): WrapperInstance;
@@ -0,0 +1,242 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/vis-wrapper/index.ts
20
+ var vis_wrapper_exports = {};
21
+ __export(vis_wrapper_exports, {
22
+ createVisWrapper: () => createVisWrapper
23
+ });
24
+ module.exports = __toCommonJS(vis_wrapper_exports);
25
+ var import_snapdom = require("@zumer/snapdom");
26
+ var import_icons = require("./icons");
27
+ var import_styles = require("./styles");
28
+ var DEFAULT_LABELS = {
29
+ "zh-CN": {
30
+ chartTab: "图表",
31
+ codeTab: "代码",
32
+ download: "下载",
33
+ copy: "复制",
34
+ copied: "完成"
35
+ },
36
+ "en-US": {
37
+ chartTab: "Chart",
38
+ codeTab: "Code",
39
+ download: "Download",
40
+ copy: "Copy",
41
+ copied: "Copied"
42
+ }
43
+ };
44
+ function createVisWrapper(container, config = {}) {
45
+ (0, import_styles.injectWrapperStyles)();
46
+ const containerElement = typeof container === "string" ? document.querySelector(container) : container;
47
+ if (!containerElement) {
48
+ throw new Error("Container element not found");
49
+ }
50
+ const { chartType = "", syntax = "", locale = "zh-CN" } = config;
51
+ const syntaxString = typeof syntax === "string" ? syntax : JSON.stringify(syntax, null, 2);
52
+ const labels = DEFAULT_LABELS[locale] || DEFAULT_LABELS["en-US"];
53
+ let chartRef = null;
54
+ let copyTimeout;
55
+ const zoomButtonsHTML = `
56
+ <button class="gpt-vis-wrapper-text-button gpt-vis-wrapper-zoom-button gpt-vis-wrapper-tab-hide"
57
+ data-action="zoom-out"
58
+ aria-label="Zoom out"
59
+ title="Zoom out">
60
+ ${(0, import_icons.createZoomOutIcon)(18)}
61
+ </button>
62
+ <button class="gpt-vis-wrapper-text-button gpt-vis-wrapper-zoom-button gpt-vis-wrapper-tab-hide"
63
+ data-action="zoom-in"
64
+ aria-label="Zoom in"
65
+ title="Zoom in">
66
+ ${(0, import_icons.createZoomInIcon)(18)}
67
+ </button>
68
+ <div class="gpt-vis-wrapper-divider gpt-vis-wrapper-tab-hide"></div>
69
+ `;
70
+ const wrapperHTML = `
71
+ <div class="gpt-vis-wrapper-container">
72
+ <div class="gpt-vis-wrapper-header">
73
+ <div class="gpt-vis-wrapper-tab-left">
74
+ <button class="gpt-vis-wrapper-tab-button active"
75
+ data-tab="chart"
76
+ role="tab"
77
+ aria-selected="true"
78
+ aria-controls="chart-panel">
79
+ ${labels.chartTab}
80
+ </button>
81
+ <button class="gpt-vis-wrapper-tab-button"
82
+ data-tab="code"
83
+ role="tab"
84
+ aria-selected="false"
85
+ aria-controls="code-panel">
86
+ ${labels.codeTab}
87
+ </button>
88
+ </div>
89
+ <div class="gpt-vis-wrapper-tab-right">
90
+ ${zoomButtonsHTML}
91
+ <button class="gpt-vis-wrapper-text-button"
92
+ data-action="download"
93
+ aria-label="${labels.download}">
94
+ ${(0, import_icons.createDownloadIcon)(16)} <span>${labels.download}</span>
95
+ </button>
96
+ <button class="gpt-vis-wrapper-text-button gpt-vis-wrapper-tab-hide"
97
+ data-action="copy"
98
+ aria-label="${labels.copy}">
99
+ ${(0, import_icons.createCopyIcon)()} <span>${labels.copy}</span>
100
+ </button>
101
+ </div>
102
+ </div>
103
+ <div class="gpt-vis-wrapper-content">
104
+ <div class="gpt-vis-wrapper-chart">
105
+ <div class="gpt-vis-wrapper-chart-container"></div>
106
+ </div>
107
+ <div class="gpt-vis-wrapper-code gpt-vis-wrapper-tab-hide">${syntaxString}</div>
108
+ </div>
109
+ </div>
110
+ `;
111
+ containerElement.innerHTML = wrapperHTML;
112
+ const wrapperContainer = containerElement.querySelector(".gpt-vis-wrapper-container");
113
+ const chartTabButton = wrapperContainer.querySelector('[data-tab="chart"]');
114
+ const codeTabButton = wrapperContainer.querySelector('[data-tab="code"]');
115
+ const chartWrapper = wrapperContainer.querySelector(".gpt-vis-wrapper-chart");
116
+ const codeContainer = wrapperContainer.querySelector(".gpt-vis-wrapper-code");
117
+ const chartContainer = wrapperContainer.querySelector(
118
+ ".gpt-vis-wrapper-chart-container"
119
+ );
120
+ const downloadButton = wrapperContainer.querySelector(
121
+ '[data-action="download"]'
122
+ );
123
+ const copyButton = wrapperContainer.querySelector('[data-action="copy"]');
124
+ const zoomInButton = wrapperContainer.querySelector(
125
+ '[data-action="zoom-in"]'
126
+ );
127
+ const zoomOutButton = wrapperContainer.querySelector(
128
+ '[data-action="zoom-out"]'
129
+ );
130
+ const divider = wrapperContainer.querySelector(".gpt-vis-wrapper-divider");
131
+ function switchTab(tab) {
132
+ const hasZoomSupport = chartRef && typeof chartRef.zoomTo === "function";
133
+ if (tab === "chart") {
134
+ chartTabButton.classList.add("active");
135
+ chartTabButton.setAttribute("aria-selected", "true");
136
+ codeTabButton.classList.remove("active");
137
+ codeTabButton.setAttribute("aria-selected", "false");
138
+ chartWrapper.classList.remove("gpt-vis-wrapper-tab-hide");
139
+ codeContainer.classList.add("gpt-vis-wrapper-tab-hide");
140
+ downloadButton.classList.remove("gpt-vis-wrapper-tab-hide");
141
+ copyButton.classList.add("gpt-vis-wrapper-tab-hide");
142
+ if (hasZoomSupport && zoomInButton && zoomOutButton && divider) {
143
+ zoomInButton.classList.remove("gpt-vis-wrapper-tab-hide");
144
+ zoomOutButton.classList.remove("gpt-vis-wrapper-tab-hide");
145
+ divider.classList.remove("gpt-vis-wrapper-tab-hide");
146
+ }
147
+ } else {
148
+ chartTabButton.classList.remove("active");
149
+ chartTabButton.setAttribute("aria-selected", "false");
150
+ codeTabButton.classList.add("active");
151
+ codeTabButton.setAttribute("aria-selected", "true");
152
+ chartWrapper.classList.add("gpt-vis-wrapper-tab-hide");
153
+ codeContainer.classList.remove("gpt-vis-wrapper-tab-hide");
154
+ downloadButton.classList.add("gpt-vis-wrapper-tab-hide");
155
+ copyButton.classList.remove("gpt-vis-wrapper-tab-hide");
156
+ if (hasZoomSupport && zoomInButton && zoomOutButton && divider) {
157
+ zoomInButton.classList.add("gpt-vis-wrapper-tab-hide");
158
+ zoomOutButton.classList.add("gpt-vis-wrapper-tab-hide");
159
+ divider.classList.add("gpt-vis-wrapper-tab-hide");
160
+ }
161
+ }
162
+ }
163
+ function handleZoomIn() {
164
+ var _a;
165
+ if (chartRef && typeof chartRef.zoomTo === "function") {
166
+ const currentZoom = ((_a = chartRef.getZoom) == null ? void 0 : _a.call(chartRef)) || 1;
167
+ const newZoom = Math.min(currentZoom * 1.15, 5);
168
+ chartRef.zoomTo(newZoom);
169
+ }
170
+ }
171
+ function handleZoomOut() {
172
+ var _a;
173
+ if (chartRef && typeof chartRef.zoomTo === "function") {
174
+ const currentZoom = ((_a = chartRef.getZoom) == null ? void 0 : _a.call(chartRef)) || 1;
175
+ const newZoom = Math.max(currentZoom / 1.15, 0.1);
176
+ chartRef.zoomTo(newZoom);
177
+ }
178
+ }
179
+ async function handleDownload() {
180
+ try {
181
+ if (chartContainer) {
182
+ const result = await (0, import_snapdom.snapdom)(chartContainer, { scale: 2 });
183
+ await result.download({
184
+ format: "png",
185
+ filename: `chart-${chartType}-${Date.now()}`
186
+ });
187
+ }
188
+ } catch (error) {
189
+ console.error("Download image failed:", error);
190
+ }
191
+ }
192
+ async function handleCopy() {
193
+ try {
194
+ await navigator.clipboard.writeText(syntaxString);
195
+ copyButton.innerHTML = `${(0, import_icons.createCheckIcon)()} <span>${labels.copied}</span>`;
196
+ if (copyTimeout) {
197
+ clearTimeout(copyTimeout);
198
+ }
199
+ copyTimeout = window.setTimeout(() => {
200
+ copyButton.innerHTML = `${(0, import_icons.createCopyIcon)()} <span>${labels.copy}</span>`;
201
+ }, 1e3);
202
+ } catch (error) {
203
+ console.error("Copy failed:", error);
204
+ }
205
+ }
206
+ chartTabButton.onclick = () => switchTab("chart");
207
+ codeTabButton.onclick = () => switchTab("code");
208
+ downloadButton.onclick = handleDownload;
209
+ copyButton.onclick = handleCopy;
210
+ if (zoomInButton)
211
+ zoomInButton.onclick = handleZoomIn;
212
+ if (zoomOutButton)
213
+ zoomOutButton.onclick = handleZoomOut;
214
+ return {
215
+ chartContainer,
216
+ update: (newSyntax) => {
217
+ const newSyntaxString = typeof newSyntax === "string" ? newSyntax : JSON.stringify(newSyntax, null, 2);
218
+ codeContainer.textContent = newSyntaxString;
219
+ },
220
+ setChartRef: (chart) => {
221
+ chartRef = chart;
222
+ if (chart && typeof chart.zoomTo === "function") {
223
+ if (zoomInButton)
224
+ zoomInButton.classList.remove("gpt-vis-wrapper-tab-hide");
225
+ if (zoomOutButton)
226
+ zoomOutButton.classList.remove("gpt-vis-wrapper-tab-hide");
227
+ if (divider)
228
+ divider.classList.remove("gpt-vis-wrapper-tab-hide");
229
+ }
230
+ },
231
+ destroy: () => {
232
+ if (copyTimeout) {
233
+ clearTimeout(copyTimeout);
234
+ }
235
+ containerElement.innerHTML = "";
236
+ }
237
+ };
238
+ }
239
+ // Annotate the CommonJS export names for ESM import in node:
240
+ 0 && (module.exports = {
241
+ createVisWrapper
242
+ });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * CSS styles for the wrapper component
3
+ */
4
+ export declare const wrapperStyles = "\n.gpt-vis-wrapper-container {\n border-radius: 8px;\n overflow: hidden;\n}\n\n.gpt-vis-wrapper-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n background: #f5f5f5;\n padding: 6px 14px 6px 6px;\n gap: 2px;\n position: relative;\n z-index: 10;\n}\n\n.gpt-vis-wrapper-tab-left {\n display: flex;\n gap: 2px;\n}\n\n.gpt-vis-wrapper-tab-right {\n display: flex;\n gap: 4px;\n align-items: center;\n}\n\n.gpt-vis-wrapper-tab-button {\n border: none;\n box-shadow: none;\n background: transparent;\n color: #494949;\n border-radius: 8px;\n height: 26px;\n width: 52px;\n font-size: 12px;\n transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n transform: scale(1);\n cursor: pointer;\n outline: none;\n font-family: inherit;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n\n.gpt-vis-wrapper-tab-button.active {\n background: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);\n}\n\n.gpt-vis-wrapper-tab-button:hover,\n.gpt-vis-wrapper-tab-button:focus {\n color: #494949;\n transform: scale(1.02);\n}\n\n.gpt-vis-wrapper-tab-button:not(.active):hover,\n.gpt-vis-wrapper-tab-button:not(.active):focus {\n background: #f0f0f0;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);\n}\n\n.gpt-vis-wrapper-tab-button.active:hover,\n.gpt-vis-wrapper-tab-button.active:focus {\n background: #fff;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);\n}\n\n.gpt-vis-wrapper-tab-button:active {\n transform: scale(0.96);\n transition: all 0.1s cubic-bezier(0.645, 0.045, 0.355, 1);\n}\n\n.gpt-vis-wrapper-tab-button.active:active {\n background: #fff;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n}\n\n.gpt-vis-wrapper-tab-button:not(.active):active {\n background: #e8e8e8;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);\n}\n\n.gpt-vis-wrapper-text-button {\n border: none;\n box-shadow: none;\n background: transparent;\n color: #494949;\n height: 26px;\n padding: 0 8px;\n font-size: 12px;\n transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n transform: scale(1);\n border-radius: 8px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n cursor: pointer;\n outline: none;\n font-family: inherit;\n}\n\n.gpt-vis-wrapper-text-button:hover,\n.gpt-vis-wrapper-text-button:focus {\n color: #666;\n background: #e8e8e8;\n transform: scale(1.02);\n}\n\n.gpt-vis-wrapper-text-button:active {\n background: #e8e8e8;\n transform: scale(0.98);\n}\n\n.gpt-vis-wrapper-zoom-button {\n width: 24px;\n height: 24px;\n padding: 0;\n}\n\n.gpt-vis-wrapper-divider {\n width: 1px;\n height: 16px;\n background-color: #d9d9d9;\n margin: 0 8px;\n flex-shrink: 0;\n}\n\n.gpt-vis-wrapper-content {\n overflow: hidden;\n position: relative;\n background: #fafafa;\n}\n\n.gpt-vis-wrapper-chart {\n min-width: 300px;\n max-width: 100%;\n overflow: hidden;\n position: relative;\n}\n\n.gpt-vis-wrapper-chart--g6 {\n min-height: 400px;\n}\n\n.gpt-vis-wrapper-chart-container {\n width: 100%;\n height: 100%;\n overflow: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n}\n\n.gpt-vis-wrapper-chart--g6 .gpt-vis-wrapper-chart-container {\n min-height: 360px;\n}\n\n.gpt-vis-wrapper-chart-container::-webkit-scrollbar {\n display: none;\n}\n\n.gpt-vis-wrapper-code {\n max-height: 500px;\n overflow: auto;\n padding: 16px;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;\n font-size: 12px;\n line-height: 1.6;\n color: #333;\n background: #fafafa;\n white-space: pre-wrap;\n word-wrap: break-word;\n}\n\n.gpt-vis-wrapper-tab-hide {\n display: none;\n}\n";
5
+ /**
6
+ * Inject styles into the document head
7
+ */
8
+ export declare function injectWrapperStyles(): void;
@@ -0,0 +1,221 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/vis-wrapper/styles.ts
20
+ var styles_exports = {};
21
+ __export(styles_exports, {
22
+ injectWrapperStyles: () => injectWrapperStyles,
23
+ wrapperStyles: () => wrapperStyles
24
+ });
25
+ module.exports = __toCommonJS(styles_exports);
26
+ var wrapperStyles = `
27
+ .gpt-vis-wrapper-container {
28
+ border-radius: 8px;
29
+ overflow: hidden;
30
+ }
31
+
32
+ .gpt-vis-wrapper-header {
33
+ display: flex;
34
+ justify-content: space-between;
35
+ align-items: center;
36
+ background: #f5f5f5;
37
+ padding: 6px 14px 6px 6px;
38
+ gap: 2px;
39
+ position: relative;
40
+ z-index: 10;
41
+ }
42
+
43
+ .gpt-vis-wrapper-tab-left {
44
+ display: flex;
45
+ gap: 2px;
46
+ }
47
+
48
+ .gpt-vis-wrapper-tab-right {
49
+ display: flex;
50
+ gap: 4px;
51
+ align-items: center;
52
+ }
53
+
54
+ .gpt-vis-wrapper-tab-button {
55
+ border: none;
56
+ box-shadow: none;
57
+ background: transparent;
58
+ color: #494949;
59
+ border-radius: 8px;
60
+ height: 26px;
61
+ width: 52px;
62
+ font-size: 12px;
63
+ transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
64
+ transform: scale(1);
65
+ cursor: pointer;
66
+ outline: none;
67
+ font-family: inherit;
68
+ display: inline-flex;
69
+ align-items: center;
70
+ justify-content: center;
71
+ }
72
+
73
+ .gpt-vis-wrapper-tab-button.active {
74
+ background: #fff;
75
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
76
+ }
77
+
78
+ .gpt-vis-wrapper-tab-button:hover,
79
+ .gpt-vis-wrapper-tab-button:focus {
80
+ color: #494949;
81
+ transform: scale(1.02);
82
+ }
83
+
84
+ .gpt-vis-wrapper-tab-button:not(.active):hover,
85
+ .gpt-vis-wrapper-tab-button:not(.active):focus {
86
+ background: #f0f0f0;
87
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
88
+ }
89
+
90
+ .gpt-vis-wrapper-tab-button.active:hover,
91
+ .gpt-vis-wrapper-tab-button.active:focus {
92
+ background: #fff;
93
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
94
+ }
95
+
96
+ .gpt-vis-wrapper-tab-button:active {
97
+ transform: scale(0.96);
98
+ transition: all 0.1s cubic-bezier(0.645, 0.045, 0.355, 1);
99
+ }
100
+
101
+ .gpt-vis-wrapper-tab-button.active:active {
102
+ background: #fff;
103
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
104
+ }
105
+
106
+ .gpt-vis-wrapper-tab-button:not(.active):active {
107
+ background: #e8e8e8;
108
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
109
+ }
110
+
111
+ .gpt-vis-wrapper-text-button {
112
+ border: none;
113
+ box-shadow: none;
114
+ background: transparent;
115
+ color: #494949;
116
+ height: 26px;
117
+ padding: 0 8px;
118
+ font-size: 12px;
119
+ transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
120
+ transform: scale(1);
121
+ border-radius: 8px;
122
+ display: inline-flex;
123
+ align-items: center;
124
+ justify-content: center;
125
+ gap: 4px;
126
+ cursor: pointer;
127
+ outline: none;
128
+ font-family: inherit;
129
+ }
130
+
131
+ .gpt-vis-wrapper-text-button:hover,
132
+ .gpt-vis-wrapper-text-button:focus {
133
+ color: #666;
134
+ background: #e8e8e8;
135
+ transform: scale(1.02);
136
+ }
137
+
138
+ .gpt-vis-wrapper-text-button:active {
139
+ background: #e8e8e8;
140
+ transform: scale(0.98);
141
+ }
142
+
143
+ .gpt-vis-wrapper-zoom-button {
144
+ width: 24px;
145
+ height: 24px;
146
+ padding: 0;
147
+ }
148
+
149
+ .gpt-vis-wrapper-divider {
150
+ width: 1px;
151
+ height: 16px;
152
+ background-color: #d9d9d9;
153
+ margin: 0 8px;
154
+ flex-shrink: 0;
155
+ }
156
+
157
+ .gpt-vis-wrapper-content {
158
+ overflow: hidden;
159
+ position: relative;
160
+ background: #fafafa;
161
+ }
162
+
163
+ .gpt-vis-wrapper-chart {
164
+ min-width: 300px;
165
+ max-width: 100%;
166
+ overflow: hidden;
167
+ position: relative;
168
+ }
169
+
170
+ .gpt-vis-wrapper-chart--g6 {
171
+ min-height: 400px;
172
+ }
173
+
174
+ .gpt-vis-wrapper-chart-container {
175
+ width: 100%;
176
+ height: 100%;
177
+ overflow: auto;
178
+ scrollbar-width: none;
179
+ -ms-overflow-style: none;
180
+ }
181
+
182
+ .gpt-vis-wrapper-chart--g6 .gpt-vis-wrapper-chart-container {
183
+ min-height: 360px;
184
+ }
185
+
186
+ .gpt-vis-wrapper-chart-container::-webkit-scrollbar {
187
+ display: none;
188
+ }
189
+
190
+ .gpt-vis-wrapper-code {
191
+ max-height: 500px;
192
+ overflow: auto;
193
+ padding: 16px;
194
+ font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
195
+ font-size: 12px;
196
+ line-height: 1.6;
197
+ color: #333;
198
+ background: #fafafa;
199
+ white-space: pre-wrap;
200
+ word-wrap: break-word;
201
+ }
202
+
203
+ .gpt-vis-wrapper-tab-hide {
204
+ display: none;
205
+ }
206
+ `;
207
+ function injectWrapperStyles() {
208
+ const styleId = "gpt-vis-wrapper-styles";
209
+ if (document.getElementById(styleId)) {
210
+ return;
211
+ }
212
+ const styleElement = document.createElement("style");
213
+ styleElement.id = styleId;
214
+ styleElement.textContent = wrapperStyles;
215
+ document.head.appendChild(styleElement);
216
+ }
217
+ // Annotate the CommonJS export names for ESM import in node:
218
+ 0 && (module.exports = {
219
+ injectWrapperStyles,
220
+ wrapperStyles
221
+ });