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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (547) hide show
  1. package/README.md +183 -114
  2. package/README.zh-CN.md +185 -112
  3. package/dist/cjs/gpt-vis/index.d.ts +108 -0
  4. package/dist/cjs/gpt-vis/index.js +173 -0
  5. package/dist/cjs/index.d.ts +44 -13
  6. package/dist/cjs/index.js +65 -35
  7. package/dist/cjs/syntax/index.d.ts +2 -0
  8. package/dist/cjs/{Text/mini-charts/hooks → syntax}/index.js +9 -7
  9. package/dist/cjs/syntax/parser.d.ts +67 -0
  10. package/dist/cjs/syntax/parser.js +235 -0
  11. package/dist/cjs/types/index.d.ts +33 -2
  12. package/dist/cjs/types/index.js +0 -6
  13. package/dist/cjs/util/theme.d.ts +21 -0
  14. package/dist/cjs/{theme.js → util/theme.js} +63 -14
  15. package/dist/cjs/vis/area/index.d.ts +60 -0
  16. package/dist/cjs/vis/area/index.js +151 -0
  17. package/dist/cjs/vis/bar/index.d.ts +60 -0
  18. package/dist/cjs/vis/bar/index.js +122 -0
  19. package/dist/cjs/vis/boxplot/index.d.ts +59 -0
  20. package/dist/cjs/vis/boxplot/index.js +106 -0
  21. package/dist/cjs/vis/column/index.d.ts +60 -0
  22. package/dist/cjs/vis/column/index.js +121 -0
  23. package/dist/cjs/vis/dual-axes/index.d.ts +64 -0
  24. package/dist/cjs/vis/dual-axes/index.js +147 -0
  25. package/dist/cjs/vis/funnel/index.d.ts +54 -0
  26. package/dist/cjs/vis/funnel/index.js +189 -0
  27. package/dist/cjs/vis/histogram/index.d.ts +47 -0
  28. package/dist/cjs/vis/histogram/index.js +112 -0
  29. package/dist/cjs/vis/line/index.d.ts +59 -0
  30. package/dist/cjs/vis/line/index.js +104 -0
  31. package/dist/cjs/vis/liquid/index.d.ts +44 -0
  32. package/dist/cjs/vis/liquid/index.js +87 -0
  33. package/dist/cjs/vis/pie/index.d.ts +55 -0
  34. package/dist/cjs/vis/pie/index.js +108 -0
  35. package/dist/cjs/vis/radar/index.d.ts +57 -0
  36. package/dist/cjs/vis/radar/index.js +152 -0
  37. package/dist/cjs/vis/sankey/index.d.ts +56 -0
  38. package/dist/cjs/vis/sankey/index.js +93 -0
  39. package/dist/cjs/vis/scatter/index.d.ts +54 -0
  40. package/dist/cjs/vis/scatter/index.js +94 -0
  41. package/dist/cjs/vis/summary/index.d.ts +41 -0
  42. package/dist/cjs/{Text/utils/getThemeColor.js → vis/summary/index.js} +33 -22
  43. package/dist/cjs/vis/table/index.d.ts +49 -0
  44. package/dist/cjs/vis/table/index.js +173 -0
  45. package/dist/cjs/vis/treemap/index.d.ts +68 -0
  46. package/dist/cjs/vis/treemap/index.js +105 -0
  47. package/dist/cjs/vis/venn/index.d.ts +54 -0
  48. package/dist/cjs/vis/venn/index.js +100 -0
  49. package/dist/cjs/vis/violin/index.d.ts +59 -0
  50. package/dist/cjs/vis/violin/index.js +155 -0
  51. package/dist/cjs/vis/waterfall/index.d.ts +67 -0
  52. package/dist/cjs/vis/waterfall/index.js +172 -0
  53. package/dist/cjs/vis/word-cloud/index.d.ts +53 -0
  54. package/dist/cjs/vis/word-cloud/index.js +89 -0
  55. package/dist/cjs/vis-wrapper/icons.d.ts +8 -0
  56. package/dist/cjs/vis-wrapper/icons.js +63 -0
  57. package/dist/cjs/vis-wrapper/index.d.ts +24 -0
  58. package/dist/cjs/vis-wrapper/index.js +231 -0
  59. package/dist/cjs/vis-wrapper/styles.d.ts +8 -0
  60. package/dist/cjs/vis-wrapper/styles.js +214 -0
  61. package/dist/esm/gpt-vis/index.d.ts +108 -0
  62. package/dist/esm/gpt-vis/index.js +224 -0
  63. package/dist/esm/index.d.ts +44 -13
  64. package/dist/esm/index.js +22 -15
  65. package/dist/esm/syntax/index.d.ts +2 -0
  66. package/dist/esm/syntax/index.js +1 -0
  67. package/dist/esm/syntax/parser.d.ts +67 -0
  68. package/dist/esm/syntax/parser.js +401 -0
  69. package/dist/esm/types/index.d.ts +33 -2
  70. package/dist/esm/types/index.js +0 -1
  71. package/dist/esm/util/theme.d.ts +21 -0
  72. package/dist/esm/util/theme.js +141 -0
  73. package/dist/esm/vis/area/index.d.ts +60 -0
  74. package/dist/esm/vis/area/index.js +230 -0
  75. package/dist/esm/vis/bar/index.d.ts +60 -0
  76. package/dist/esm/vis/bar/index.js +203 -0
  77. package/dist/esm/vis/boxplot/index.d.ts +59 -0
  78. package/dist/esm/vis/boxplot/index.js +164 -0
  79. package/dist/esm/vis/column/index.d.ts +60 -0
  80. package/dist/esm/vis/column/index.js +198 -0
  81. package/dist/esm/vis/dual-axes/index.d.ts +64 -0
  82. package/dist/esm/vis/dual-axes/index.js +234 -0
  83. package/dist/esm/vis/funnel/index.d.ts +54 -0
  84. package/dist/esm/vis/funnel/index.js +246 -0
  85. package/dist/esm/vis/histogram/index.d.ts +47 -0
  86. package/dist/esm/vis/histogram/index.js +148 -0
  87. package/dist/esm/vis/line/index.d.ts +59 -0
  88. package/dist/esm/vis/line/index.js +172 -0
  89. package/dist/esm/vis/liquid/index.d.ts +44 -0
  90. package/dist/esm/vis/liquid/index.js +130 -0
  91. package/dist/esm/vis/pie/index.d.ts +55 -0
  92. package/dist/esm/vis/pie/index.js +168 -0
  93. package/dist/esm/vis/radar/index.d.ts +57 -0
  94. package/dist/esm/vis/radar/index.js +222 -0
  95. package/dist/esm/vis/sankey/index.d.ts +56 -0
  96. package/dist/esm/vis/sankey/index.js +135 -0
  97. package/dist/esm/vis/scatter/index.d.ts +54 -0
  98. package/dist/esm/vis/scatter/index.js +158 -0
  99. package/dist/esm/vis/summary/index.d.ts +41 -0
  100. package/dist/esm/vis/summary/index.js +80 -0
  101. package/dist/esm/vis/table/index.d.ts +49 -0
  102. package/dist/esm/vis/table/index.js +160 -0
  103. package/dist/esm/vis/treemap/index.d.ts +68 -0
  104. package/dist/esm/vis/treemap/index.js +158 -0
  105. package/dist/esm/vis/venn/index.d.ts +54 -0
  106. package/dist/esm/vis/venn/index.js +142 -0
  107. package/dist/esm/vis/violin/index.d.ts +59 -0
  108. package/dist/esm/vis/violin/index.js +245 -0
  109. package/dist/esm/vis/waterfall/index.d.ts +67 -0
  110. package/dist/esm/vis/waterfall/index.js +245 -0
  111. package/dist/esm/vis/word-cloud/index.d.ts +53 -0
  112. package/dist/esm/vis/word-cloud/index.js +128 -0
  113. package/dist/esm/vis-wrapper/icons.d.ts +8 -0
  114. package/dist/esm/vis-wrapper/icons.js +29 -0
  115. package/dist/esm/vis-wrapper/index.d.ts +24 -0
  116. package/dist/esm/vis-wrapper/index.js +237 -0
  117. package/dist/esm/vis-wrapper/styles.d.ts +8 -0
  118. package/dist/esm/vis-wrapper/styles.js +21 -0
  119. package/dist/umd/index.min.js +1 -1
  120. package/package.json +26 -67
  121. package/src/gpt-vis/index.ts +283 -0
  122. package/src/index.ts +44 -0
  123. package/src/readme.md +37 -0
  124. package/src/syntax/index.ts +2 -0
  125. package/src/syntax/parser.ts +411 -0
  126. package/src/types/index.ts +29 -0
  127. package/src/util/theme.ts +167 -0
  128. package/src/vis/area/README.md +143 -0
  129. package/src/vis/area/index.ts +212 -0
  130. package/src/vis/bar/README.md +158 -0
  131. package/src/vis/bar/index.ts +186 -0
  132. package/src/vis/boxplot/README.md +168 -0
  133. package/src/vis/boxplot/index.ts +162 -0
  134. package/src/vis/column/README.md +158 -0
  135. package/src/vis/column/index.ts +185 -0
  136. package/src/vis/dual-axes/README.md +191 -0
  137. package/src/vis/dual-axes/index.ts +218 -0
  138. package/src/vis/funnel/README.md +143 -0
  139. package/src/vis/funnel/index.ts +238 -0
  140. package/src/vis/histogram/README.md +130 -0
  141. package/src/vis/histogram/index.ts +153 -0
  142. package/src/vis/line/README.md +138 -0
  143. package/src/vis/line/index.ts +159 -0
  144. package/src/vis/liquid/README.md +150 -0
  145. package/src/vis/liquid/index.ts +130 -0
  146. package/src/vis/pie/README.md +127 -0
  147. package/src/vis/pie/index.ts +163 -0
  148. package/src/vis/radar/README.md +184 -0
  149. package/src/vis/radar/index.ts +214 -0
  150. package/src/vis/sankey/README.md +144 -0
  151. package/src/vis/sankey/index.ts +144 -0
  152. package/src/vis/scatter/README.md +145 -0
  153. package/src/vis/scatter/index.ts +147 -0
  154. package/src/vis/summary/README.md +272 -0
  155. package/src/vis/summary/index.ts +91 -0
  156. package/src/vis/table/README.md +174 -0
  157. package/src/vis/table/index.ts +241 -0
  158. package/src/vis/treemap/README.md +199 -0
  159. package/src/vis/treemap/index.ts +167 -0
  160. package/src/vis/venn/README.md +153 -0
  161. package/src/vis/venn/index.ts +149 -0
  162. package/src/vis/violin/README.md +168 -0
  163. package/src/vis/violin/index.ts +216 -0
  164. package/src/vis/waterfall/README.md +178 -0
  165. package/src/vis/waterfall/index.ts +258 -0
  166. package/src/vis/word-cloud/README.md +137 -0
  167. package/src/vis/word-cloud/index.ts +137 -0
  168. package/src/vis-wrapper/README.md +159 -0
  169. package/src/vis-wrapper/icons.ts +35 -0
  170. package/src/vis-wrapper/index.ts +276 -0
  171. package/src/vis-wrapper/styles.ts +195 -0
  172. package/README.ja-JP.md +0 -164
  173. package/dist/cjs/Area/index.d.ts +0 -11
  174. package/dist/cjs/Area/index.js +0 -105
  175. package/dist/cjs/Bar/index.d.ts +0 -14
  176. package/dist/cjs/Bar/index.js +0 -101
  177. package/dist/cjs/Boxplot/index.d.ts +0 -11
  178. package/dist/cjs/Boxplot/index.js +0 -88
  179. package/dist/cjs/ChartCodeRender/Loading.d.ts +0 -6
  180. package/dist/cjs/ChartCodeRender/Loading.js +0 -54
  181. package/dist/cjs/ChartCodeRender/VisChart.d.ts +0 -19
  182. package/dist/cjs/ChartCodeRender/VisChart.js +0 -338
  183. package/dist/cjs/ChartCodeRender/icon.d.ts +0 -10
  184. package/dist/cjs/ChartCodeRender/icon.js +0 -162
  185. package/dist/cjs/ChartCodeRender/index.d.ts +0 -8
  186. package/dist/cjs/ChartCodeRender/index.js +0 -113
  187. package/dist/cjs/ChartCodeRender/styles.d.ts +0 -19
  188. package/dist/cjs/ChartCodeRender/styles.js +0 -232
  189. package/dist/cjs/ChartCodeRender/type.d.ts +0 -176
  190. package/dist/cjs/ChartCodeRender/type.js +0 -17
  191. package/dist/cjs/ChartCodeRender/utils.d.ts +0 -1
  192. package/dist/cjs/ChartCodeRender/utils.js +0 -51
  193. package/dist/cjs/Column/index.d.ts +0 -14
  194. package/dist/cjs/Column/index.js +0 -102
  195. package/dist/cjs/ConfigProvider/context.d.ts +0 -3
  196. package/dist/cjs/ConfigProvider/context.js +0 -41
  197. package/dist/cjs/ConfigProvider/hooks/index.d.ts +0 -1
  198. package/dist/cjs/ConfigProvider/hooks/index.js +0 -23
  199. package/dist/cjs/ConfigProvider/hooks/useConfig.d.ts +0 -13
  200. package/dist/cjs/ConfigProvider/hooks/useConfig.js +0 -109
  201. package/dist/cjs/ConfigProvider/index.d.ts +0 -7
  202. package/dist/cjs/ConfigProvider/index.js +0 -43
  203. package/dist/cjs/DualAxes/index.d.ts +0 -20
  204. package/dist/cjs/DualAxes/index.js +0 -84
  205. package/dist/cjs/DualAxes/util.d.ts +0 -9
  206. package/dist/cjs/DualAxes/util.js +0 -77
  207. package/dist/cjs/FishboneDiagram/index.d.ts +0 -7
  208. package/dist/cjs/FishboneDiagram/index.js +0 -66
  209. package/dist/cjs/FlowDiagram/helper.d.ts +0 -7
  210. package/dist/cjs/FlowDiagram/helper.js +0 -83
  211. package/dist/cjs/FlowDiagram/index.d.ts +0 -6
  212. package/dist/cjs/FlowDiagram/index.js +0 -107
  213. package/dist/cjs/Funnel/index.d.ts +0 -12
  214. package/dist/cjs/Funnel/index.js +0 -173
  215. package/dist/cjs/GPTVis/Lite.d.ts +0 -19
  216. package/dist/cjs/GPTVis/Lite.js +0 -81
  217. package/dist/cjs/GPTVis/hooks/useContext.d.ts +0 -8
  218. package/dist/cjs/GPTVis/hooks/useContext.js +0 -49
  219. package/dist/cjs/GPTVis/hooks/useEvent.d.ts +0 -1
  220. package/dist/cjs/GPTVis/hooks/useEvent.js +0 -33
  221. package/dist/cjs/GPTVis/index.d.ts +0 -6
  222. package/dist/cjs/GPTVis/index.js +0 -42
  223. package/dist/cjs/HeatMap/index.d.ts +0 -12
  224. package/dist/cjs/HeatMap/index.js +0 -67
  225. package/dist/cjs/Histogram/index.d.ts +0 -8
  226. package/dist/cjs/Histogram/index.js +0 -79
  227. package/dist/cjs/IndentedTree/index.d.ts +0 -7
  228. package/dist/cjs/IndentedTree/index.js +0 -78
  229. package/dist/cjs/Line/index.d.ts +0 -11
  230. package/dist/cjs/Line/index.js +0 -94
  231. package/dist/cjs/Liquid/index.d.ts +0 -11
  232. package/dist/cjs/Liquid/index.js +0 -85
  233. package/dist/cjs/Map/Component/MapView.d.ts +0 -3
  234. package/dist/cjs/Map/Component/MapView.js +0 -40
  235. package/dist/cjs/Map/Component/Marker.d.ts +0 -3
  236. package/dist/cjs/Map/Component/Marker.js +0 -53
  237. package/dist/cjs/Map/Component/Polyline.d.ts +0 -3
  238. package/dist/cjs/Map/Component/Polyline.js +0 -50
  239. package/dist/cjs/Map/Component/index.d.ts +0 -4
  240. package/dist/cjs/Map/Component/index.js +0 -45
  241. package/dist/cjs/Map/data.json +0 -305
  242. package/dist/cjs/Map/index.d.ts +0 -5
  243. package/dist/cjs/Map/index.js +0 -61
  244. package/dist/cjs/MindMap/index.d.ts +0 -7
  245. package/dist/cjs/MindMap/index.js +0 -75
  246. package/dist/cjs/NetworkGraph/index.d.ts +0 -6
  247. package/dist/cjs/NetworkGraph/index.js +0 -75
  248. package/dist/cjs/OrganizationChart/index.d.ts +0 -6
  249. package/dist/cjs/OrganizationChart/index.js +0 -95
  250. package/dist/cjs/PathMap/index.d.ts +0 -6
  251. package/dist/cjs/PathMap/index.js +0 -58
  252. package/dist/cjs/Pie/index.d.ts +0 -23
  253. package/dist/cjs/Pie/index.js +0 -94
  254. package/dist/cjs/PinMap/index.d.ts +0 -6
  255. package/dist/cjs/PinMap/index.js +0 -44
  256. package/dist/cjs/PinMap/maker.svg +0 -1
  257. package/dist/cjs/Radar/index.d.ts +0 -13
  258. package/dist/cjs/Radar/index.js +0 -153
  259. package/dist/cjs/Sankey/index.d.ts +0 -14
  260. package/dist/cjs/Sankey/index.js +0 -110
  261. package/dist/cjs/Scatter/index.d.ts +0 -13
  262. package/dist/cjs/Scatter/index.js +0 -103
  263. package/dist/cjs/Spreadsheet/index.d.ts +0 -28
  264. package/dist/cjs/Spreadsheet/index.js +0 -113
  265. package/dist/cjs/Table/index.d.ts +0 -9
  266. package/dist/cjs/Table/index.js +0 -91
  267. package/dist/cjs/Text/VisText.d.ts +0 -4
  268. package/dist/cjs/Text/VisText.js +0 -82
  269. package/dist/cjs/Text/config.d.ts +0 -18
  270. package/dist/cjs/Text/config.js +0 -91
  271. package/dist/cjs/Text/custom-icons/index.d.ts +0 -3
  272. package/dist/cjs/Text/custom-icons/index.js +0 -66
  273. package/dist/cjs/Text/index.d.ts +0 -3
  274. package/dist/cjs/Text/index.js +0 -42
  275. package/dist/cjs/Text/mini-charts/hooks/getElementFontSize.d.ts +0 -1
  276. package/dist/cjs/Text/mini-charts/hooks/getElementFontSize.js +0 -65
  277. package/dist/cjs/Text/mini-charts/hooks/index.d.ts +0 -1
  278. package/dist/cjs/Text/mini-charts/hooks/useSvgWrapper.d.ts +0 -5
  279. package/dist/cjs/Text/mini-charts/hooks/useSvgWrapper.js +0 -65
  280. package/dist/cjs/Text/mini-charts/index.d.ts +0 -2
  281. package/dist/cjs/Text/mini-charts/index.js +0 -25
  282. package/dist/cjs/Text/mini-charts/line/SingleLineChart.d.ts +0 -3
  283. package/dist/cjs/Text/mini-charts/line/SingleLineChart.js +0 -63
  284. package/dist/cjs/Text/mini-charts/line/index.d.ts +0 -1
  285. package/dist/cjs/Text/mini-charts/line/index.js +0 -29
  286. package/dist/cjs/Text/mini-charts/line/scaleLinear.d.ts +0 -4
  287. package/dist/cjs/Text/mini-charts/line/scaleLinear.js +0 -35
  288. package/dist/cjs/Text/mini-charts/line/useLineCompute.d.ts +0 -6
  289. package/dist/cjs/Text/mini-charts/line/useLineCompute.js +0 -103
  290. package/dist/cjs/Text/mini-charts/proportion/getArcPath.d.ts +0 -1
  291. package/dist/cjs/Text/mini-charts/proportion/getArcPath.js +0 -51
  292. package/dist/cjs/Text/mini-charts/proportion/index.d.ts +0 -3
  293. package/dist/cjs/Text/mini-charts/proportion/index.js +0 -71
  294. package/dist/cjs/Text/theme.d.ts +0 -24
  295. package/dist/cjs/Text/theme.js +0 -52
  296. package/dist/cjs/Text/types.d.ts +0 -20
  297. package/dist/cjs/Text/types.js +0 -17
  298. package/dist/cjs/Text/utils/getThemeColor.d.ts +0 -11
  299. package/dist/cjs/Text/utils/index.d.ts +0 -2
  300. package/dist/cjs/Text/utils/index.js +0 -25
  301. package/dist/cjs/Text/utils/useAntdDarkAlgorithm.d.ts +0 -2
  302. package/dist/cjs/Text/utils/useAntdDarkAlgorithm.js +0 -40
  303. package/dist/cjs/Treemap/index.d.ts +0 -10
  304. package/dist/cjs/Treemap/index.js +0 -93
  305. package/dist/cjs/Venn/index.d.ts +0 -32
  306. package/dist/cjs/Venn/index.js +0 -87
  307. package/dist/cjs/Violin/index.d.ts +0 -10
  308. package/dist/cjs/Violin/index.js +0 -190
  309. package/dist/cjs/Waterfall/index.d.ts +0 -25
  310. package/dist/cjs/Waterfall/index.js +0 -184
  311. package/dist/cjs/WordCloud/index.d.ts +0 -9
  312. package/dist/cjs/WordCloud/index.js +0 -76
  313. package/dist/cjs/constants/index.d.ts +0 -2
  314. package/dist/cjs/constants/index.js +0 -35
  315. package/dist/cjs/export-map.browser.d.ts +0 -4
  316. package/dist/cjs/export-map.browser.js +0 -48
  317. package/dist/cjs/export-map.d.ts +0 -10
  318. package/dist/cjs/export-map.js +0 -41
  319. package/dist/cjs/export.d.ts +0 -76
  320. package/dist/cjs/export.js +0 -159
  321. package/dist/cjs/render.d.ts +0 -2
  322. package/dist/cjs/render.js +0 -67
  323. package/dist/cjs/theme.d.ts +0 -2
  324. package/dist/cjs/types/chart.d.ts +0 -88
  325. package/dist/cjs/types/chart.js +0 -61
  326. package/dist/cjs/types/config.d.ts +0 -25
  327. package/dist/cjs/types/config.js +0 -17
  328. package/dist/cjs/types/map.d.ts +0 -242
  329. package/dist/cjs/types/map.js +0 -17
  330. package/dist/cjs/utils/config.d.ts +0 -5
  331. package/dist/cjs/utils/config.js +0 -76
  332. package/dist/cjs/utils/graph.d.ts +0 -18
  333. package/dist/cjs/utils/graph.js +0 -64
  334. package/dist/cjs/utils/index.d.ts +0 -1
  335. package/dist/cjs/utils/index.js +0 -23
  336. package/dist/cjs/utils/map/context.d.ts +0 -3
  337. package/dist/cjs/utils/map/context.js +0 -45
  338. package/dist/cjs/utils/map/controls.d.ts +0 -0
  339. package/dist/cjs/utils/map/controls.js +0 -0
  340. package/dist/cjs/utils/map/index.d.ts +0 -6
  341. package/dist/cjs/utils/map/index.js +0 -33
  342. package/dist/cjs/utils/map/markers.d.ts +0 -2
  343. package/dist/cjs/utils/map/markers.js +0 -88
  344. package/dist/cjs/utils/map/polyline.d.ts +0 -2
  345. package/dist/cjs/utils/map/polyline.js +0 -52
  346. package/dist/cjs/utils/map/style.d.ts +0 -45
  347. package/dist/cjs/utils/map/style.js +0 -112
  348. package/dist/cjs/utils/map/util.d.ts +0 -1
  349. package/dist/cjs/utils/map/util.js +0 -38
  350. package/dist/cjs/utils/map/view.d.ts +0 -5
  351. package/dist/cjs/utils/map/view.js +0 -100
  352. package/dist/cjs/utils/palette.d.ts +0 -2
  353. package/dist/cjs/utils/palette.js +0 -54
  354. package/dist/cjs/utils/plot.d.ts +0 -5
  355. package/dist/cjs/utils/plot.js +0 -90
  356. package/dist/cjs/version.d.ts +0 -2
  357. package/dist/cjs/version.js +0 -25
  358. package/dist/esm/Area/index.d.ts +0 -11
  359. package/dist/esm/Area/index.js +0 -108
  360. package/dist/esm/Bar/index.d.ts +0 -14
  361. package/dist/esm/Bar/index.js +0 -92
  362. package/dist/esm/Boxplot/index.d.ts +0 -11
  363. package/dist/esm/Boxplot/index.js +0 -86
  364. package/dist/esm/ChartCodeRender/Loading.d.ts +0 -6
  365. package/dist/esm/ChartCodeRender/Loading.js +0 -21
  366. package/dist/esm/ChartCodeRender/VisChart.d.ts +0 -19
  367. package/dist/esm/ChartCodeRender/VisChart.js +0 -450
  368. package/dist/esm/ChartCodeRender/icon.d.ts +0 -10
  369. package/dist/esm/ChartCodeRender/icon.js +0 -103
  370. package/dist/esm/ChartCodeRender/index.d.ts +0 -8
  371. package/dist/esm/ChartCodeRender/index.js +0 -99
  372. package/dist/esm/ChartCodeRender/styles.d.ts +0 -19
  373. package/dist/esm/ChartCodeRender/styles.js +0 -61
  374. package/dist/esm/ChartCodeRender/type.d.ts +0 -176
  375. package/dist/esm/ChartCodeRender/type.js +0 -1
  376. package/dist/esm/ChartCodeRender/utils.d.ts +0 -1
  377. package/dist/esm/ChartCodeRender/utils.js +0 -37
  378. package/dist/esm/Column/index.d.ts +0 -14
  379. package/dist/esm/Column/index.js +0 -93
  380. package/dist/esm/ConfigProvider/context.d.ts +0 -3
  381. package/dist/esm/ConfigProvider/context.js +0 -3
  382. package/dist/esm/ConfigProvider/hooks/index.d.ts +0 -1
  383. package/dist/esm/ConfigProvider/hooks/index.js +0 -1
  384. package/dist/esm/ConfigProvider/hooks/useConfig.d.ts +0 -13
  385. package/dist/esm/ConfigProvider/hooks/useConfig.js +0 -71
  386. package/dist/esm/ConfigProvider/index.d.ts +0 -7
  387. package/dist/esm/ConfigProvider/index.js +0 -17
  388. package/dist/esm/DualAxes/index.d.ts +0 -20
  389. package/dist/esm/DualAxes/index.js +0 -77
  390. package/dist/esm/DualAxes/util.d.ts +0 -9
  391. package/dist/esm/DualAxes/util.js +0 -77
  392. package/dist/esm/FishboneDiagram/index.d.ts +0 -7
  393. package/dist/esm/FishboneDiagram/index.js +0 -43
  394. package/dist/esm/FlowDiagram/helper.d.ts +0 -7
  395. package/dist/esm/FlowDiagram/helper.js +0 -76
  396. package/dist/esm/FlowDiagram/index.d.ts +0 -6
  397. package/dist/esm/FlowDiagram/index.js +0 -72
  398. package/dist/esm/Funnel/index.d.ts +0 -12
  399. package/dist/esm/Funnel/index.js +0 -171
  400. package/dist/esm/GPTVis/Lite.d.ts +0 -19
  401. package/dist/esm/GPTVis/Lite.js +0 -57
  402. package/dist/esm/GPTVis/hooks/useContext.d.ts +0 -8
  403. package/dist/esm/GPTVis/hooks/useContext.js +0 -9
  404. package/dist/esm/GPTVis/hooks/useEvent.d.ts +0 -1
  405. package/dist/esm/GPTVis/hooks/useEvent.js +0 -6
  406. package/dist/esm/GPTVis/index.d.ts +0 -6
  407. package/dist/esm/GPTVis/index.js +0 -25
  408. package/dist/esm/HeatMap/index.d.ts +0 -12
  409. package/dist/esm/HeatMap/index.js +0 -45
  410. package/dist/esm/Histogram/index.d.ts +0 -8
  411. package/dist/esm/Histogram/index.js +0 -75
  412. package/dist/esm/IndentedTree/index.d.ts +0 -7
  413. package/dist/esm/IndentedTree/index.js +0 -68
  414. package/dist/esm/Line/index.d.ts +0 -11
  415. package/dist/esm/Line/index.js +0 -92
  416. package/dist/esm/Liquid/index.d.ts +0 -11
  417. package/dist/esm/Liquid/index.js +0 -100
  418. package/dist/esm/Map/Component/MapView.d.ts +0 -3
  419. package/dist/esm/Map/Component/MapView.js +0 -18
  420. package/dist/esm/Map/Component/Marker.d.ts +0 -3
  421. package/dist/esm/Map/Component/Marker.js +0 -40
  422. package/dist/esm/Map/Component/Polyline.d.ts +0 -3
  423. package/dist/esm/Map/Component/Polyline.js +0 -35
  424. package/dist/esm/Map/Component/index.d.ts +0 -4
  425. package/dist/esm/Map/Component/index.js +0 -4
  426. package/dist/esm/Map/data.json +0 -305
  427. package/dist/esm/Map/index.d.ts +0 -5
  428. package/dist/esm/Map/index.js +0 -50
  429. package/dist/esm/MindMap/index.d.ts +0 -7
  430. package/dist/esm/MindMap/index.js +0 -69
  431. package/dist/esm/NetworkGraph/index.d.ts +0 -6
  432. package/dist/esm/NetworkGraph/index.js +0 -64
  433. package/dist/esm/OrganizationChart/index.d.ts +0 -6
  434. package/dist/esm/OrganizationChart/index.js +0 -75
  435. package/dist/esm/PathMap/index.d.ts +0 -6
  436. package/dist/esm/PathMap/index.js +0 -41
  437. package/dist/esm/Pie/index.d.ts +0 -23
  438. package/dist/esm/Pie/index.js +0 -96
  439. package/dist/esm/PinMap/index.d.ts +0 -6
  440. package/dist/esm/PinMap/index.js +0 -22
  441. package/dist/esm/PinMap/maker.svg +0 -1
  442. package/dist/esm/Radar/index.d.ts +0 -13
  443. package/dist/esm/Radar/index.js +0 -150
  444. package/dist/esm/Sankey/index.d.ts +0 -14
  445. package/dist/esm/Sankey/index.js +0 -98
  446. package/dist/esm/Scatter/index.d.ts +0 -13
  447. package/dist/esm/Scatter/index.js +0 -95
  448. package/dist/esm/Spreadsheet/index.d.ts +0 -28
  449. package/dist/esm/Spreadsheet/index.js +0 -129
  450. package/dist/esm/Table/index.d.ts +0 -9
  451. package/dist/esm/Table/index.js +0 -30
  452. package/dist/esm/Text/VisText.d.ts +0 -4
  453. package/dist/esm/Text/VisText.js +0 -55
  454. package/dist/esm/Text/config.d.ts +0 -18
  455. package/dist/esm/Text/config.js +0 -82
  456. package/dist/esm/Text/custom-icons/index.d.ts +0 -3
  457. package/dist/esm/Text/custom-icons/index.js +0 -37
  458. package/dist/esm/Text/index.d.ts +0 -3
  459. package/dist/esm/Text/index.js +0 -2
  460. package/dist/esm/Text/mini-charts/hooks/getElementFontSize.d.ts +0 -1
  461. package/dist/esm/Text/mini-charts/hooks/getElementFontSize.js +0 -32
  462. package/dist/esm/Text/mini-charts/hooks/index.d.ts +0 -1
  463. package/dist/esm/Text/mini-charts/hooks/index.js +0 -1
  464. package/dist/esm/Text/mini-charts/hooks/useSvgWrapper.d.ts +0 -5
  465. package/dist/esm/Text/mini-charts/hooks/useSvgWrapper.js +0 -37
  466. package/dist/esm/Text/mini-charts/index.d.ts +0 -2
  467. package/dist/esm/Text/mini-charts/index.js +0 -2
  468. package/dist/esm/Text/mini-charts/line/SingleLineChart.d.ts +0 -3
  469. package/dist/esm/Text/mini-charts/line/SingleLineChart.js +0 -62
  470. package/dist/esm/Text/mini-charts/line/index.d.ts +0 -1
  471. package/dist/esm/Text/mini-charts/line/index.js +0 -1
  472. package/dist/esm/Text/mini-charts/line/scaleLinear.d.ts +0 -4
  473. package/dist/esm/Text/mini-charts/line/scaleLinear.js +0 -19
  474. package/dist/esm/Text/mini-charts/line/useLineCompute.d.ts +0 -6
  475. package/dist/esm/Text/mini-charts/line/useLineCompute.js +0 -118
  476. package/dist/esm/Text/mini-charts/proportion/getArcPath.d.ts +0 -1
  477. package/dist/esm/Text/mini-charts/proportion/getArcPath.js +0 -19
  478. package/dist/esm/Text/mini-charts/proportion/index.d.ts +0 -3
  479. package/dist/esm/Text/mini-charts/proportion/index.js +0 -64
  480. package/dist/esm/Text/theme.d.ts +0 -24
  481. package/dist/esm/Text/theme.js +0 -24
  482. package/dist/esm/Text/types.d.ts +0 -20
  483. package/dist/esm/Text/types.js +0 -1
  484. package/dist/esm/Text/utils/getThemeColor.d.ts +0 -11
  485. package/dist/esm/Text/utils/getThemeColor.js +0 -29
  486. package/dist/esm/Text/utils/index.d.ts +0 -2
  487. package/dist/esm/Text/utils/index.js +0 -2
  488. package/dist/esm/Text/utils/useAntdDarkAlgorithm.d.ts +0 -2
  489. package/dist/esm/Text/utils/useAntdDarkAlgorithm.js +0 -14
  490. package/dist/esm/Treemap/index.d.ts +0 -10
  491. package/dist/esm/Treemap/index.js +0 -88
  492. package/dist/esm/Venn/index.d.ts +0 -32
  493. package/dist/esm/Venn/index.js +0 -69
  494. package/dist/esm/Violin/index.d.ts +0 -10
  495. package/dist/esm/Violin/index.js +0 -199
  496. package/dist/esm/Waterfall/index.d.ts +0 -25
  497. package/dist/esm/Waterfall/index.js +0 -185
  498. package/dist/esm/WordCloud/index.d.ts +0 -9
  499. package/dist/esm/WordCloud/index.js +0 -59
  500. package/dist/esm/constants/index.d.ts +0 -2
  501. package/dist/esm/constants/index.js +0 -9
  502. package/dist/esm/export-map.browser.d.ts +0 -4
  503. package/dist/esm/export-map.browser.js +0 -5
  504. package/dist/esm/export-map.d.ts +0 -10
  505. package/dist/esm/export-map.js +0 -9
  506. package/dist/esm/export.d.ts +0 -76
  507. package/dist/esm/export.js +0 -51
  508. package/dist/esm/render.d.ts +0 -2
  509. package/dist/esm/render.js +0 -32
  510. package/dist/esm/theme.d.ts +0 -2
  511. package/dist/esm/theme.js +0 -103
  512. package/dist/esm/types/chart.d.ts +0 -88
  513. package/dist/esm/types/chart.js +0 -33
  514. package/dist/esm/types/config.d.ts +0 -25
  515. package/dist/esm/types/config.js +0 -1
  516. package/dist/esm/types/map.d.ts +0 -242
  517. package/dist/esm/types/map.js +0 -1
  518. package/dist/esm/utils/config.d.ts +0 -5
  519. package/dist/esm/utils/config.js +0 -53
  520. package/dist/esm/utils/graph.d.ts +0 -18
  521. package/dist/esm/utils/graph.js +0 -55
  522. package/dist/esm/utils/index.d.ts +0 -1
  523. package/dist/esm/utils/index.js +0 -1
  524. package/dist/esm/utils/map/context.d.ts +0 -3
  525. package/dist/esm/utils/map/context.js +0 -42
  526. package/dist/esm/utils/map/controls.d.ts +0 -0
  527. package/dist/esm/utils/map/controls.js +0 -0
  528. package/dist/esm/utils/map/index.d.ts +0 -6
  529. package/dist/esm/utils/map/index.js +0 -6
  530. package/dist/esm/utils/map/markers.d.ts +0 -2
  531. package/dist/esm/utils/map/markers.js +0 -69
  532. package/dist/esm/utils/map/polyline.d.ts +0 -2
  533. package/dist/esm/utils/map/polyline.js +0 -31
  534. package/dist/esm/utils/map/style.d.ts +0 -45
  535. package/dist/esm/utils/map/style.js +0 -80
  536. package/dist/esm/utils/map/util.d.ts +0 -1
  537. package/dist/esm/utils/map/util.js +0 -11
  538. package/dist/esm/utils/map/view.d.ts +0 -5
  539. package/dist/esm/utils/map/view.js +0 -83
  540. package/dist/esm/utils/palette.d.ts +0 -2
  541. package/dist/esm/utils/palette.js +0 -2
  542. package/dist/esm/utils/plot.d.ts +0 -5
  543. package/dist/esm/utils/plot.js +0 -86
  544. package/dist/esm/version.d.ts +0 -2
  545. package/dist/esm/version.js +0 -1
  546. package/dist/umd/737.async.js +0 -1
  547. package/dist/umd/index.min.css +0 -1
@@ -1,13 +1,44 @@
1
- /********** export chart **********/
2
- export * from './export';
3
- /********** export types **********/
4
- export * from './types';
5
- /********** export render **********/
6
- export * from './render';
7
- /********** export GPTVis **********/
8
- export { withChartCode, withDefaultChartCode } from './ChartCodeRender';
9
- export type { CodeBlockComponent, ErrorRender, WithChartCodeOptions } from './ChartCodeRender/type';
10
- export { default as ConfigProvider, type ConfigProviderProps } from './ConfigProvider';
11
- export { default as GPTVis, type GPTVisProps } from './GPTVis';
12
- export { default as GPTVisLite, useEventPublish, type GPTVisLiteProps } from './GPTVis/Lite';
13
- export { default as version } from './version';
1
+ export { GPTVis } from './gpt-vis';
2
+ export type { GPTVisConfig } from './gpt-vis';
3
+ export { isVisSyntax } from './syntax';
4
+ export type { VisualizationOptions } from './types';
5
+ export { Area } from './vis/area';
6
+ export type { AreaConfig, AreaDataItem } from './vis/area';
7
+ export { Bar } from './vis/bar';
8
+ export type { BarConfig, BarDataItem } from './vis/bar';
9
+ export { Boxplot } from './vis/boxplot';
10
+ export type { BoxplotConfig, BoxplotDataItem } from './vis/boxplot';
11
+ export { Column } from './vis/column';
12
+ export type { ColumnConfig, ColumnDataItem } from './vis/column';
13
+ export { DualAxes } from './vis/dual-axes';
14
+ export type { DualAxesConfig, DualAxesSeriesItem } from './vis/dual-axes';
15
+ export { Funnel } from './vis/funnel';
16
+ export type { FunnelConfig, FunnelDataItem } from './vis/funnel';
17
+ export { Histogram } from './vis/histogram';
18
+ export type { HistogramConfig } from './vis/histogram';
19
+ export { Line } from './vis/line';
20
+ export type { LineConfig, LineDataItem } from './vis/line';
21
+ export { Liquid } from './vis/liquid';
22
+ export type { LiquidConfig } from './vis/liquid';
23
+ export { Pie } from './vis/pie';
24
+ export type { PieConfig } from './vis/pie';
25
+ export { Radar } from './vis/radar';
26
+ export type { RadarConfig, RadarDataItem } from './vis/radar';
27
+ export { Sankey } from './vis/sankey';
28
+ export type { SankeyConfig, SankeyDataItem } from './vis/sankey';
29
+ export { Scatter } from './vis/scatter';
30
+ export type { ScatterConfig, ScatterDataItem } from './vis/scatter';
31
+ export { Summary } from './vis/summary';
32
+ export type { SummaryConfig } from './vis/summary';
33
+ export { Table } from './vis/table';
34
+ export type { TableConfig } from './vis/table';
35
+ export { Treemap } from './vis/treemap';
36
+ export type { TreemapConfig, TreemapDataItem } from './vis/treemap';
37
+ export { Venn } from './vis/venn';
38
+ export type { VennConfig, VennDataItem } from './vis/venn';
39
+ export { Violin } from './vis/violin';
40
+ export type { ViolinConfig, ViolinDataItem } from './vis/violin';
41
+ export { Waterfall } from './vis/waterfall';
42
+ export type { WaterfallConfig, WaterfallDataItem, WaterfallPalette } from './vis/waterfall';
43
+ export { WordCloud } from './vis/word-cloud';
44
+ export type { WordCloudConfig, WordCloudDataItem } from './vis/word-cloud';
package/dist/cjs/index.js CHANGED
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __export = (target, all) => {
8
6
  for (var name in all)
@@ -16,47 +14,79 @@ var __copyProps = (to, from, except, desc) => {
16
14
  }
17
15
  return to;
18
16
  };
19
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
18
 
30
19
  // src/index.ts
31
20
  var src_exports = {};
32
21
  __export(src_exports, {
33
- ConfigProvider: () => import_ConfigProvider.default,
34
- GPTVis: () => import_GPTVis.default,
35
- GPTVisLite: () => import_Lite.default,
36
- useEventPublish: () => import_Lite.useEventPublish,
37
- version: () => import_version.default,
38
- withChartCode: () => import_ChartCodeRender.withChartCode,
39
- withDefaultChartCode: () => import_ChartCodeRender.withDefaultChartCode
22
+ Area: () => import_area.Area,
23
+ Bar: () => import_bar.Bar,
24
+ Boxplot: () => import_boxplot.Boxplot,
25
+ Column: () => import_column.Column,
26
+ DualAxes: () => import_dual_axes.DualAxes,
27
+ Funnel: () => import_funnel.Funnel,
28
+ GPTVis: () => import_gpt_vis.GPTVis,
29
+ Histogram: () => import_histogram.Histogram,
30
+ Line: () => import_line.Line,
31
+ Liquid: () => import_liquid.Liquid,
32
+ Pie: () => import_pie.Pie,
33
+ Radar: () => import_radar.Radar,
34
+ Sankey: () => import_sankey.Sankey,
35
+ Scatter: () => import_scatter.Scatter,
36
+ Summary: () => import_summary.Summary,
37
+ Table: () => import_table.Table,
38
+ Treemap: () => import_treemap.Treemap,
39
+ Venn: () => import_venn.Venn,
40
+ Violin: () => import_violin.Violin,
41
+ Waterfall: () => import_waterfall.Waterfall,
42
+ WordCloud: () => import_word_cloud.WordCloud,
43
+ isVisSyntax: () => import_syntax.isVisSyntax
40
44
  });
41
45
  module.exports = __toCommonJS(src_exports);
42
- __reExport(src_exports, require("./export"), module.exports);
43
- __reExport(src_exports, require("./types"), module.exports);
44
- __reExport(src_exports, require("./render"), module.exports);
45
- var import_ChartCodeRender = require("./ChartCodeRender");
46
- var import_ConfigProvider = __toESM(require("./ConfigProvider"));
47
- var import_GPTVis = __toESM(require("./GPTVis"));
48
- var import_Lite = __toESM(require("./GPTVis/Lite"));
49
- var import_version = __toESM(require("./version"));
46
+ var import_gpt_vis = require("./gpt-vis");
47
+ var import_syntax = require("./syntax");
48
+ var import_area = require("./vis/area");
49
+ var import_bar = require("./vis/bar");
50
+ var import_boxplot = require("./vis/boxplot");
51
+ var import_column = require("./vis/column");
52
+ var import_dual_axes = require("./vis/dual-axes");
53
+ var import_funnel = require("./vis/funnel");
54
+ var import_histogram = require("./vis/histogram");
55
+ var import_line = require("./vis/line");
56
+ var import_liquid = require("./vis/liquid");
57
+ var import_pie = require("./vis/pie");
58
+ var import_radar = require("./vis/radar");
59
+ var import_sankey = require("./vis/sankey");
60
+ var import_scatter = require("./vis/scatter");
61
+ var import_summary = require("./vis/summary");
62
+ var import_table = require("./vis/table");
63
+ var import_treemap = require("./vis/treemap");
64
+ var import_venn = require("./vis/venn");
65
+ var import_violin = require("./vis/violin");
66
+ var import_waterfall = require("./vis/waterfall");
67
+ var import_word_cloud = require("./vis/word-cloud");
50
68
  // Annotate the CommonJS export names for ESM import in node:
51
69
  0 && (module.exports = {
52
- ConfigProvider,
70
+ Area,
71
+ Bar,
72
+ Boxplot,
73
+ Column,
74
+ DualAxes,
75
+ Funnel,
53
76
  GPTVis,
54
- GPTVisLite,
55
- useEventPublish,
56
- version,
57
- withChartCode,
58
- withDefaultChartCode,
59
- ...require("./export"),
60
- ...require("./types"),
61
- ...require("./render")
77
+ Histogram,
78
+ Line,
79
+ Liquid,
80
+ Pie,
81
+ Radar,
82
+ Sankey,
83
+ Scatter,
84
+ Summary,
85
+ Table,
86
+ Treemap,
87
+ Venn,
88
+ Violin,
89
+ Waterfall,
90
+ WordCloud,
91
+ isVisSyntax
62
92
  });
@@ -0,0 +1,2 @@
1
+ export { isVisSyntax, parse } from './parser';
2
+ export type { ParsedConfig } from './parser';
@@ -16,14 +16,16 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // src/Text/mini-charts/hooks/index.ts
20
- var hooks_exports = {};
21
- __export(hooks_exports, {
22
- useSvgWrapper: () => import_useSvgWrapper.useSvgWrapper
19
+ // src/syntax/index.ts
20
+ var syntax_exports = {};
21
+ __export(syntax_exports, {
22
+ isVisSyntax: () => import_parser.isVisSyntax,
23
+ parse: () => import_parser.parse
23
24
  });
24
- module.exports = __toCommonJS(hooks_exports);
25
- var import_useSvgWrapper = require("./useSvgWrapper");
25
+ module.exports = __toCommonJS(syntax_exports);
26
+ var import_parser = require("./parser");
26
27
  // Annotate the CommonJS export names for ESM import in node:
27
28
  0 && (module.exports = {
28
- useSvgWrapper
29
+ isVisSyntax,
30
+ parse
29
31
  });
@@ -0,0 +1,67 @@
1
+ /**
2
+ * GPT-Vis Syntax Parser
3
+ *
4
+ * Parses a markdown-like syntax for visualization configurations.
5
+ *
6
+ * Syntax rules:
7
+ * - `vis [chartType]` - Defines the chart type (required first line)
8
+ * - `data` - Starts a data array section
9
+ * - ` - key value` - Array item with key-value pairs
10
+ * - ` - value` - Simple array item (for flat arrays like histogram data)
11
+ * - `key: value` or `key value` - Top-level key-value pair
12
+ * - `style` - Starts a style object section
13
+ * - Multiple values separated by spaces become arrays (e.g., `palette #ff5a5f #1fb6ff`)
14
+ * - `children` - Nested array for hierarchical data (mind-map, treemap, etc.)
15
+ *
16
+ * @example
17
+ * ```
18
+ * vis pie
19
+ * data
20
+ * - category 分类一
21
+ * value 27
22
+ * - category 分类二
23
+ * value 25
24
+ * innerRadius: 0.6
25
+ * style
26
+ * backgroundColor #333
27
+ * palette #ff5a5f #1fb6ff #13ce66
28
+ * ```
29
+ *
30
+ * @example Simple array (histogram)
31
+ * ```
32
+ * vis histogram
33
+ * data
34
+ * - 78
35
+ * - 88
36
+ * - 60
37
+ * binNumber 5
38
+ * ```
39
+ *
40
+ * @example Hierarchical data (mind-map)
41
+ * ```
42
+ * vis mind-map
43
+ * data
44
+ * - name 项目计划
45
+ * children
46
+ * - name 研究阶段
47
+ * children
48
+ * - name 市场调研
49
+ * - name 技术可行性分析
50
+ * - name 开发阶段
51
+ * ```
52
+ */
53
+ /**
54
+ * Parsed chart configuration result
55
+ */
56
+ export interface ParsedConfig {
57
+ type: string;
58
+ [key: string]: unknown;
59
+ }
60
+ /**
61
+ * Parse the visualization syntax string into a configuration object
62
+ */
63
+ export declare function parse(syntax: string): ParsedConfig;
64
+ /**
65
+ * Check if a val is a valid visualization syntax
66
+ */
67
+ export declare function isVisSyntax(input: any): boolean;
@@ -0,0 +1,235 @@
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/syntax/parser.ts
20
+ var parser_exports = {};
21
+ __export(parser_exports, {
22
+ isVisSyntax: () => isVisSyntax,
23
+ parse: () => parse
24
+ });
25
+ module.exports = __toCommonJS(parser_exports);
26
+ var ARRAY_SECTIONS = /* @__PURE__ */ new Set(["data", "categories", "series", "children"]);
27
+ var OBJECT_SECTIONS = /* @__PURE__ */ new Set(["style"]);
28
+ function parseValue(value) {
29
+ const trimmed = value.trim();
30
+ if (trimmed === "") {
31
+ return "";
32
+ }
33
+ if (trimmed === "true")
34
+ return true;
35
+ if (trimmed === "false")
36
+ return false;
37
+ const num = Number(trimmed);
38
+ if (!isNaN(num) && trimmed !== "") {
39
+ return num;
40
+ }
41
+ return trimmed;
42
+ }
43
+ function parseMultipleValues(values) {
44
+ const trimmed = values.trim();
45
+ const parts = trimmed.split(/\s+/).filter((p) => p.length > 0);
46
+ if (parts.length === 0) {
47
+ return "";
48
+ }
49
+ if (parts.length === 1) {
50
+ return parseValue(parts[0]);
51
+ }
52
+ return parts.map(parseValue);
53
+ }
54
+ function parseKeyValue(line) {
55
+ const trimmed = line.trim();
56
+ const colonMatch = trimmed.match(/^([a-zA-Z_][a-zA-Z0-9_-]*)\s*:\s*(.*)$/);
57
+ if (colonMatch) {
58
+ return { key: colonMatch[1], value: colonMatch[2] };
59
+ }
60
+ const spaceMatch = trimmed.match(/^([a-zA-Z_][a-zA-Z0-9_-]*)\s+(.+)$/);
61
+ if (spaceMatch) {
62
+ return { key: spaceMatch[1], value: spaceMatch[2] };
63
+ }
64
+ const singleKey = trimmed.match(/^([a-zA-Z_][a-zA-Z0-9_-]*)$/);
65
+ if (singleKey) {
66
+ return { key: singleKey[1], value: "" };
67
+ }
68
+ return null;
69
+ }
70
+ function isSimpleValue(line) {
71
+ const trimmed = line.trim();
72
+ const hasKeyValue = parseKeyValue(trimmed);
73
+ if (hasKeyValue && hasKeyValue.value !== "") {
74
+ return false;
75
+ }
76
+ return true;
77
+ }
78
+ function getIndentLevel(line) {
79
+ const match = line.match(/^(\s*)/);
80
+ return match ? match[1].length : 0;
81
+ }
82
+ function isArrayItemLine(line) {
83
+ return line.trim().startsWith("-");
84
+ }
85
+ function parseArrayItemLine(line) {
86
+ return line.trim().replace(/^-\s*/, "");
87
+ }
88
+ function isKnownSection(key) {
89
+ return ARRAY_SECTIONS.has(key) || OBJECT_SECTIONS.has(key);
90
+ }
91
+ function parseLines(syntax) {
92
+ const lines = syntax.split("\n");
93
+ const result = [];
94
+ for (let i = 0; i < lines.length; i++) {
95
+ const line = lines[i];
96
+ const trimmed = line.trim();
97
+ if (trimmed === "") {
98
+ continue;
99
+ }
100
+ result.push({
101
+ line,
102
+ trimmed,
103
+ indent: getIndentLevel(line),
104
+ lineNumber: i
105
+ });
106
+ }
107
+ return result;
108
+ }
109
+ function parseArraySection(lines, startIndex, baseIndent) {
110
+ const items = [];
111
+ let currentItem = null;
112
+ let isSimpleArray = false;
113
+ let i = startIndex;
114
+ let firstItemIndent = -1;
115
+ while (i < lines.length) {
116
+ const { trimmed, indent } = lines[i];
117
+ if (indent <= baseIndent && !isArrayItemLine(trimmed)) {
118
+ break;
119
+ }
120
+ if (isArrayItemLine(trimmed) && indent <= baseIndent) {
121
+ break;
122
+ }
123
+ const isThisLevelItem = isArrayItemLine(trimmed) && (firstItemIndent === -1 || indent === firstItemIndent);
124
+ if (isThisLevelItem) {
125
+ if (firstItemIndent === -1) {
126
+ firstItemIndent = indent;
127
+ }
128
+ if (currentItem !== null && !isSimpleArray) {
129
+ items.push(currentItem);
130
+ }
131
+ const itemContent = parseArrayItemLine(trimmed);
132
+ if (itemContent) {
133
+ if (isSimpleValue(itemContent)) {
134
+ isSimpleArray = true;
135
+ items.push(parseValue(itemContent));
136
+ currentItem = null;
137
+ } else {
138
+ currentItem = {};
139
+ const kv = parseKeyValue(itemContent);
140
+ if (kv) {
141
+ currentItem[kv.key] = parseValue(kv.value);
142
+ }
143
+ }
144
+ } else {
145
+ currentItem = {};
146
+ }
147
+ i++;
148
+ continue;
149
+ }
150
+ if (isArrayItemLine(trimmed) && firstItemIndent !== -1 && indent !== firstItemIndent) {
151
+ i++;
152
+ continue;
153
+ }
154
+ if (currentItem !== null && !isSimpleArray) {
155
+ const kv = parseKeyValue(trimmed);
156
+ if (kv) {
157
+ if (kv.key === "children" && kv.value === "") {
158
+ const { items: childItems, nextIndex } = parseArraySection(lines, i + 1, indent);
159
+ currentItem.children = childItems;
160
+ i = nextIndex;
161
+ continue;
162
+ } else {
163
+ currentItem[kv.key] = parseValue(kv.value);
164
+ }
165
+ }
166
+ }
167
+ i++;
168
+ }
169
+ if (currentItem !== null && !isSimpleArray) {
170
+ items.push(currentItem);
171
+ }
172
+ return { items, nextIndex: i };
173
+ }
174
+ function parse(syntax) {
175
+ const lines = parseLines(syntax);
176
+ const result = { type: "" };
177
+ let i = 0;
178
+ while (i < lines.length) {
179
+ const { trimmed, indent } = lines[i];
180
+ if (trimmed.startsWith("vis ")) {
181
+ const chartType = trimmed.substring(4).trim();
182
+ result.type = chartType;
183
+ i++;
184
+ continue;
185
+ }
186
+ const isSectionHeader = /^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(trimmed) && indent === 0 && isKnownSection(trimmed);
187
+ if (isSectionHeader) {
188
+ if (ARRAY_SECTIONS.has(trimmed)) {
189
+ const { items, nextIndex } = parseArraySection(lines, i + 1, indent);
190
+ if (items.length > 0) {
191
+ result[trimmed] = items;
192
+ }
193
+ i = nextIndex;
194
+ continue;
195
+ } else if (OBJECT_SECTIONS.has(trimmed)) {
196
+ const sectionName = trimmed;
197
+ result[sectionName] = {};
198
+ i++;
199
+ while (i < lines.length) {
200
+ const { trimmed: innerTrimmed, indent: innerIndent } = lines[i];
201
+ if (innerIndent === 0) {
202
+ break;
203
+ }
204
+ const kv = parseKeyValue(innerTrimmed);
205
+ if (kv) {
206
+ result[sectionName][kv.key] = parseMultipleValues(
207
+ kv.value
208
+ );
209
+ }
210
+ i++;
211
+ }
212
+ continue;
213
+ }
214
+ }
215
+ if (indent === 0) {
216
+ const kv = parseKeyValue(trimmed);
217
+ if (kv) {
218
+ result[kv.key] = parseValue(kv.value);
219
+ }
220
+ }
221
+ i++;
222
+ }
223
+ return result;
224
+ }
225
+ function isVisSyntax(input) {
226
+ if (typeof input !== "string")
227
+ return false;
228
+ const trimmed = input.trim();
229
+ return trimmed.startsWith("vis ");
230
+ }
231
+ // Annotate the CommonJS export names for ESM import in node:
232
+ 0 && (module.exports = {
233
+ isVisSyntax,
234
+ parse
235
+ });
@@ -1,2 +1,33 @@
1
- export * from './chart';
2
- export type { GlobalConfig } from './config';
1
+ /**
2
+ * Common visualization options for all chart components.
3
+ * Defines the container and dimensions for rendering visualizations.
4
+ */
5
+ export interface VisualizationOptions {
6
+ container: string | HTMLElement;
7
+ width?: number;
8
+ height?: number;
9
+ theme?: 'default' | 'light' | 'dark' | 'academy';
10
+ wrapper?: boolean;
11
+ locale?: string;
12
+ }
13
+ /**
14
+ * Tree graph data structure
15
+ */
16
+ export interface TreeGraphData {
17
+ name: string;
18
+ description?: string;
19
+ children?: TreeGraphData[];
20
+ }
21
+ /**
22
+ * Network graph data structure
23
+ */
24
+ export interface GraphData {
25
+ nodes: {
26
+ name: string;
27
+ }[];
28
+ edges: {
29
+ source: string;
30
+ target: string;
31
+ name?: string;
32
+ }[];
33
+ }
@@ -10,14 +10,8 @@ var __copyProps = (to, from, except, desc) => {
10
10
  }
11
11
  return to;
12
12
  };
13
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
13
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
14
 
16
15
  // src/types/index.ts
17
16
  var types_exports = {};
18
17
  module.exports = __toCommonJS(types_exports);
19
- __reExport(types_exports, require("./chart"), module.exports);
20
- // Annotate the CommonJS export names for ESM import in node:
21
- 0 && (module.exports = {
22
- ...require("./chart")
23
- });
@@ -0,0 +1,21 @@
1
+ export declare const DEFAULT_COLOR_PALETTE: string[];
2
+ export declare const ACADEMY_COLOR_PALETTE: string[];
3
+ export declare const THEME_MAP: Record<string, any>;
4
+ /**
5
+ * Get normalized theme name for G2.
6
+ * Converts 'default' to 'light' for G2 compatibility.
7
+ */
8
+ export declare const getTheme: (theme: string) => string;
9
+ /**
10
+ * Get theme object from THEME_MAP.
11
+ * This should be used for visualization components to properly support dark theme with multiple marks.
12
+ */
13
+ export declare const getThemeObject: (theme: string) => any;
14
+ /**
15
+ * Get theme color palette based on theme name.
16
+ */
17
+ export declare const getThemeColors: (theme: string) => string[];
18
+ /**
19
+ * Get background color based on theme.
20
+ */
21
+ export declare const getBackgroundColor: (theme: string) => string;
@@ -16,14 +16,42 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // src/theme.ts
19
+ // src/util/theme.ts
20
20
  var theme_exports = {};
21
21
  __export(theme_exports, {
22
- G6THEME_MAP: () => G6THEME_MAP,
23
- THEME_MAP: () => THEME_MAP
22
+ ACADEMY_COLOR_PALETTE: () => ACADEMY_COLOR_PALETTE,
23
+ DEFAULT_COLOR_PALETTE: () => DEFAULT_COLOR_PALETTE,
24
+ THEME_MAP: () => THEME_MAP,
25
+ getBackgroundColor: () => getBackgroundColor,
26
+ getTheme: () => getTheme,
27
+ getThemeColors: () => getThemeColors,
28
+ getThemeObject: () => getThemeObject
24
29
  });
25
30
  module.exports = __toCommonJS(theme_exports);
26
- var import_palette = require("./utils/palette");
31
+ var DEFAULT_COLOR_PALETTE = [
32
+ "#1783FF",
33
+ "#F08F56",
34
+ "#D580FF",
35
+ "#00C9C9",
36
+ "#7863FF",
37
+ "#DB9D0D",
38
+ "#60C42D",
39
+ "#FF80CA",
40
+ "#2491B3",
41
+ "#17C76F"
42
+ ];
43
+ var ACADEMY_COLOR_PALETTE = [
44
+ "#4e79a7",
45
+ "#f28e2c",
46
+ "#e15759",
47
+ "#76b7b2",
48
+ "#59a14f",
49
+ "#edc949",
50
+ "#af7aa1",
51
+ "#ff9da7",
52
+ "#9c755f",
53
+ "#bab0ab"
54
+ ];
27
55
  var DEFAULT_THEME = {
28
56
  type: "light",
29
57
  view: {
@@ -116,18 +144,39 @@ var THEME_MAP = {
116
144
  academy: ACADEMY_THEME,
117
145
  dark: DARK_THEME
118
146
  };
119
- var G6THEME_MAP = {
120
- default: {
121
- type: "assign-color-by-branch",
122
- colors: import_palette.DEFAULT_COLOR_PALETTE
123
- },
124
- academy: {
125
- type: "assign-color-by-branch",
126
- colors: import_palette.ACADEMY_COLOR_PALETTE
147
+ var getTheme = (theme) => {
148
+ return theme === "default" ? "light" : theme;
149
+ };
150
+ var getThemeObject = (theme) => {
151
+ return THEME_MAP[theme] || THEME_MAP.default;
152
+ };
153
+ var getThemeColors = (theme) => {
154
+ switch (theme) {
155
+ case "academy":
156
+ return ACADEMY_COLOR_PALETTE;
157
+ case "dark":
158
+ case "default":
159
+ default:
160
+ return DEFAULT_COLOR_PALETTE;
161
+ }
162
+ };
163
+ var getBackgroundColor = (theme) => {
164
+ switch (theme) {
165
+ case "dark":
166
+ return "#000";
167
+ case "academy":
168
+ case "default":
169
+ default:
170
+ return "#FFF";
127
171
  }
128
172
  };
129
173
  // Annotate the CommonJS export names for ESM import in node:
130
174
  0 && (module.exports = {
131
- G6THEME_MAP,
132
- THEME_MAP
175
+ ACADEMY_COLOR_PALETTE,
176
+ DEFAULT_COLOR_PALETTE,
177
+ THEME_MAP,
178
+ getBackgroundColor,
179
+ getTheme,
180
+ getThemeColors,
181
+ getThemeObject
133
182
  });