@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
@@ -1,62 +0,0 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import { isArray, isString, size } from 'lodash';
8
- import React, { useMemo } from 'react';
9
- import { TEXT_THEME } from "../../theme";
10
- import { useSvgWrapper } from "../hooks";
11
- import { useLineCompute } from "./useLineCompute";
12
- var LINEAR_FILL_COLOR_ID = 'wsc-line-fill';
13
- function getLineChartData(origin) {
14
- if (isArray(origin)) return origin;
15
- if (isString(origin)) {
16
- try {
17
- var data = JSON.parse(origin);
18
- if (isArray(data)) return data;
19
- } catch (e) {
20
- console.warn(e, "".concat(origin, " is not a valid json string"));
21
- }
22
- }
23
- }
24
- export var SingleLineChart = function SingleLineChart(_ref) {
25
- var origin = _ref.origin;
26
- var _useSvgWrapper = useSvgWrapper(),
27
- _useSvgWrapper2 = _slicedToArray(_useSvgWrapper, 2),
28
- Svg = _useSvgWrapper2[0],
29
- fontSize = _useSvgWrapper2[1];
30
- var data = useMemo(function () {
31
- return getLineChartData(origin);
32
- }, [origin]);
33
- var _useLineCompute = useLineCompute(fontSize, data),
34
- width = _useLineCompute.width,
35
- height = _useLineCompute.height,
36
- linePath = _useLineCompute.linePath,
37
- polygonPath = _useLineCompute.polygonPath;
38
- return size(data) > 0 && /*#__PURE__*/React.createElement(Svg, {
39
- width: width,
40
- height: height
41
- }, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
42
- x1: "50%",
43
- y1: "0%",
44
- x2: "50%",
45
- y2: "122.389541%",
46
- id: LINEAR_FILL_COLOR_ID
47
- }, /*#__PURE__*/React.createElement("stop", {
48
- stopColor: TEXT_THEME.chart.lineStrokeColor,
49
- offset: "0%"
50
- }), /*#__PURE__*/React.createElement("stop", {
51
- stopColor: "#FFFFFF",
52
- stopOpacity: "0",
53
- offset: "100%"
54
- }))), linePath && /*#__PURE__*/React.createElement("path", {
55
- d: linePath,
56
- stroke: TEXT_THEME.chart.lineStrokeColor,
57
- fill: "transparent"
58
- }), polygonPath && /*#__PURE__*/React.createElement("polygon", {
59
- points: polygonPath,
60
- fill: "url(#".concat(LINEAR_FILL_COLOR_ID, ")")
61
- }));
62
- };
@@ -1 +0,0 @@
1
- export { SingleLineChart } from './SingleLineChart';
@@ -1 +0,0 @@
1
- export { SingleLineChart } from "./SingleLineChart";
@@ -1,4 +0,0 @@
1
- export type Domain = [number, number];
2
- export type Range = [number, number];
3
- export type Scale = (n: number) => number;
4
- export declare const scaleLinear: (domain: Domain, range: Range) => Scale;
@@ -1,19 +0,0 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- export var scaleLinear = function scaleLinear(domain, range) {
8
- return function (n) {
9
- var _domain = _slicedToArray(domain, 2),
10
- d1 = _domain[0],
11
- d2 = _domain[1];
12
- var _range = _slicedToArray(range, 2),
13
- r1 = _range[0],
14
- r2 = _range[1];
15
- // Returns the intermediate value when the range is zero.
16
- if (r1 === r2) return (d2 - d1) / 2;
17
- return n / (r2 - r1) * (d2 - d1);
18
- };
19
- };
@@ -1,6 +0,0 @@
1
- export declare const useLineCompute: (size: number, data: undefined | number[]) => {
2
- width: number;
3
- height: number;
4
- linePath: string | null;
5
- polygonPath: string | null;
6
- };
@@ -1,118 +0,0 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
5
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
6
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
7
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
8
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
9
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
10
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
11
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
12
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
13
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
14
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
15
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
16
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
17
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
18
- import { useEffect, useState } from 'react';
19
- import { TEXT_THEME } from "../../theme";
20
- import { scaleLinear } from "./scaleLinear";
21
-
22
- // adjust to draw line width
23
- var SCALE_ADJUST = 2;
24
- var Line = /*#__PURE__*/function () {
25
- function Line(size, data) {
26
- _classCallCheck(this, Line);
27
- _defineProperty(this, "data", []);
28
- _defineProperty(this, "size", TEXT_THEME.fontSizeBase);
29
- _defineProperty(this, "height", this.size);
30
- _defineProperty(this, "width", this.getWidth());
31
- _defineProperty(this, "xScale", void 0);
32
- _defineProperty(this, "yScale", void 0);
33
- _defineProperty(this, "points", []);
34
- this.size = size;
35
- if (data) {
36
- this.data = data;
37
- this.compute();
38
- }
39
- }
40
- _createClass(Line, [{
41
- key: "getWidth",
42
- value: function getWidth() {
43
- var _this$data;
44
- return Math.max(this.size * 2, ((_this$data = this.data) === null || _this$data === void 0 ? void 0 : _this$data.length) * 2);
45
- }
46
- }, {
47
- key: "compute",
48
- value: function compute() {
49
- var _this$data2,
50
- _this = this;
51
- if (!this.data) return;
52
- this.height = this.size;
53
- this.width = this.getWidth();
54
- this.xScale = scaleLinear([0, this.width], [0, ((_this$data2 = this.data) === null || _this$data2 === void 0 ? void 0 : _this$data2.length) - 1]);
55
- var _ref = [Math.min.apply(Math, _toConsumableArray(this.data)), Math.max.apply(Math, _toConsumableArray(this.data))],
56
- min = _ref[0],
57
- max = _ref[1];
58
- this.yScale = scaleLinear([SCALE_ADJUST, this.height - SCALE_ADJUST], [min, max]);
59
- this.points = this.data.map(function (item, index) {
60
- return [_this.xScale(index), _this.height - _this.yScale(item)];
61
- });
62
- }
63
- }, {
64
- key: "getLinePath",
65
- value: function getLinePath() {
66
- var _this$data3;
67
- if (!((_this$data3 = this.data) !== null && _this$data3 !== void 0 && _this$data3.length) || !this.xScale || !this.yScale) return null;
68
- var path = this.points.reduce(function (prev, _ref2, index) {
69
- var _ref3 = _slicedToArray(_ref2, 2),
70
- x = _ref3[0],
71
- y = _ref3[1];
72
- if (index === 0) return "M".concat(x, " ").concat(y);
73
- return "".concat(prev, " L ").concat(x, " ").concat(y);
74
- }, '');
75
- return path;
76
- }
77
- }, {
78
- key: "getPolygonPath",
79
- value: function getPolygonPath() {
80
- var _this$data4;
81
- if (!((_this$data4 = this.data) !== null && _this$data4 !== void 0 && _this$data4.length) || !this.xScale || !this.yScale) return null;
82
- var polygonPoints = _toConsumableArray(this.points);
83
- var last = this.points[this.points.length - 1];
84
- polygonPoints.push([last[0], this.height]);
85
- polygonPoints.push([0, this.height]);
86
- var startPoint = this.points[0];
87
- polygonPoints.push(startPoint);
88
- var path = polygonPoints.reduce(function (prev, _ref4) {
89
- var _ref5 = _slicedToArray(_ref4, 2),
90
- x = _ref5[0],
91
- y = _ref5[1];
92
- return "".concat(prev, " ").concat(x, ",").concat(y);
93
- }, '');
94
- return path;
95
- }
96
- }, {
97
- key: "getContainer",
98
- value: function getContainer() {
99
- return [this.width, this.height];
100
- }
101
- }]);
102
- return Line;
103
- }();
104
- export var useLineCompute = function useLineCompute(size, data) {
105
- var _useState = useState(new Line(size, data)),
106
- _useState2 = _slicedToArray(_useState, 2),
107
- line = _useState2[0],
108
- setLine = _useState2[1];
109
- useEffect(function () {
110
- setLine(new Line(size, data));
111
- }, [size, data]);
112
- return {
113
- width: line.getContainer()[0],
114
- height: line.getContainer()[1],
115
- linePath: line.getLinePath(),
116
- polygonPath: line.getPolygonPath()
117
- };
118
- };
@@ -1 +0,0 @@
1
- export declare function getArcPath(size: number, data: number): string;
@@ -1,19 +0,0 @@
1
- /**
2
- * make data between 0 ~ 1
3
- */
4
- function normalizeProportion(data) {
5
- if (typeof data !== 'number') return 0;
6
- if (data > 1) return 1;
7
- if (data < 0) return 0;
8
- return data;
9
- }
10
- export function getArcPath(size, data) {
11
- var cx = size / 2;
12
- var cy = size / 2;
13
- var r = size / 2;
14
- var angle = normalizeProportion(data) * 2 * Math.PI;
15
- var dx = cx + r * Math.sin(angle);
16
- var dy = cy - r * Math.cos(angle);
17
- var path = "\n M".concat(cx, " ", 0, "\n A ").concat(cx, " ").concat(cy, " 0 ").concat(angle > Math.PI ? 1 : 0, " 1 ").concat(dx, " ").concat(dy, "\n L ").concat(cx, " ").concat(cy, " Z\n ");
18
- return path;
19
- }
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { VisTextProps } from '../../types';
3
- export declare const ProportionChart: React.FC<VisTextProps>;
@@ -1,64 +0,0 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import { isNaN, isString, toNumber } from 'lodash';
8
- import React, { useMemo } from 'react';
9
- import { TEXT_THEME } from "../../theme";
10
- import { useSvgWrapper } from "../hooks/useSvgWrapper";
11
- import { getArcPath } from "./getArcPath";
12
- function getProportionNumber(children,
13
- // markdown 中传入的 children 文本为 string[]
14
- origin) {
15
- var result;
16
- var originNumber = toNumber(origin);
17
- if (!isNaN(originNumber)) {
18
- result = originNumber;
19
- } else {
20
- var _text, _text$endsWith;
21
- var text;
22
- if (isString(children)) {
23
- text = children;
24
- } else if (Array.isArray(children) && isString(children[0])) {
25
- text = children[0];
26
- }
27
- if ((_text = text) !== null && _text !== void 0 && (_text$endsWith = _text.endsWith) !== null && _text$endsWith !== void 0 && _text$endsWith.call(_text, '%')) {
28
- var _text2;
29
- var percentageStr = (_text2 = text) === null || _text2 === void 0 ? void 0 : _text2.replace(/%$/, '');
30
- var proportionNumber = toNumber(percentageStr);
31
- if (!isNaN(proportionNumber)) result = proportionNumber / 100;
32
- }
33
- }
34
- return result;
35
- }
36
- export var ProportionChart = function ProportionChart(_ref) {
37
- var origin = _ref.origin,
38
- children = _ref.children;
39
- var data = useMemo(function () {
40
- return getProportionNumber(children, origin);
41
- }, [children, origin]);
42
- var _useSvgWrapper = useSvgWrapper(),
43
- _useSvgWrapper2 = _slicedToArray(_useSvgWrapper, 2),
44
- Svg = _useSvgWrapper2[0],
45
- fontSize = _useSvgWrapper2[1];
46
- var r = fontSize / 2;
47
- return data && /*#__PURE__*/React.createElement(Svg, {
48
- width: fontSize,
49
- height: fontSize
50
- }, /*#__PURE__*/React.createElement("circle", {
51
- cx: r,
52
- cy: r,
53
- r: r,
54
- fill: TEXT_THEME.chart.proportionShadowColor
55
- }), data >= 1 ? /*#__PURE__*/React.createElement("circle", {
56
- cx: r,
57
- cy: r,
58
- r: r,
59
- fill: TEXT_THEME.chart.proportionFillColor
60
- }) : /*#__PURE__*/React.createElement("path", {
61
- d: getArcPath(fontSize, data),
62
- fill: TEXT_THEME.chart.proportionFillColor
63
- }));
64
- };
@@ -1,24 +0,0 @@
1
- export declare const TEXT_THEME: {
2
- fontSizeBase: number;
3
- chart: {
4
- proportionShadowColor: string;
5
- proportionFillColor: string;
6
- lineStrokeColor: string;
7
- };
8
- light: {
9
- primaryColor: string;
10
- default88Color: string;
11
- default65Color: string;
12
- posColor: string;
13
- negColor: string;
14
- conclusionColor: string;
15
- };
16
- dark: {
17
- primaryColor: string;
18
- default88Color: string;
19
- default65Color: string;
20
- posColor: string;
21
- negColor: string;
22
- conclusionColor: string;
23
- };
24
- };
@@ -1,24 +0,0 @@
1
- export var TEXT_THEME = {
2
- fontSizeBase: 14,
3
- chart: {
4
- proportionShadowColor: '#CDDDFD',
5
- proportionFillColor: '#3471F9',
6
- lineStrokeColor: '#5B8FF9'
7
- },
8
- light: {
9
- primaryColor: '#1677FF',
10
- default88Color: 'rgba(0, 0, 0, 0.88)',
11
- default65Color: 'rgba(0, 0, 0, 0.65)',
12
- posColor: '#FA541C',
13
- negColor: '#13A8A8',
14
- conclusionColor: '#1F0352'
15
- },
16
- dark: {
17
- primaryColor: '#4B91FF',
18
- default88Color: 'rgba(255, 255, 255, 0.88)',
19
- default65Color: 'rgba(255, 255, 255, 0.65)',
20
- posColor: '#FA541C',
21
- negColor: '#13A8A8',
22
- conclusionColor: '#D8C3F3'
23
- }
24
- };
@@ -1,20 +0,0 @@
1
- import type { CSSProperties, PropsWithChildren } from 'react';
2
- import type { TextEntityType } from './config';
3
- /**
4
- * the props for the Text
5
- */
6
- export type VisTextProps = PropsWithChildren<{
7
- style?: CSSProperties;
8
- className?: string;
9
- children: string;
10
- /** 类型,包括内置的类型,以及 string 用于用户自行扩展 */
11
- type?: TextEntityType;
12
- /**
13
- * 原始数值
14
- * 用于传递各种情况的原始数据值,比如:
15
- * 1. metric_value: 未经过格式化的指标值,原始数据;eg 1.234
16
- * 2. proportion: 百分比,eg 0.37
17
- * 3. trend_desc: 趋势值,eg [1, 2, 6, 18, 24, 48]
18
- */
19
- origin?: any;
20
- }>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,11 +0,0 @@
1
- /**
2
- * 自动适配暗黑模式
3
- * @params type 类型
4
- * @params color 当前颜色
5
- * @params theme 当前主题
6
- */
7
- export declare const getThemeColor: ({ type, color, theme, }: {
8
- type?: string | undefined;
9
- color: string | undefined;
10
- theme: 'dark' | 'light';
11
- }) => string | undefined;
@@ -1,29 +0,0 @@
1
- import { findKey, get } from 'lodash';
2
- import { DEFAULT_VIS_TEXT_CONFIG } from "../config";
3
- import { TEXT_THEME } from "../theme";
4
-
5
- /**
6
- * 自动适配暗黑模式
7
- * @params type 类型
8
- * @params color 当前颜色
9
- * @params theme 当前主题
10
- */
11
- export var getThemeColor = function getThemeColor(_ref) {
12
- var type = _ref.type,
13
- color = _ref.color,
14
- theme = _ref.theme;
15
- // 仅暗黑主题才处理
16
- if (type && color && theme === 'dark') {
17
- var defaultLightColor = get(DEFAULT_VIS_TEXT_CONFIG, [type, 'color']);
18
- // 仅当前颜色为默认的浅色主题时才处理
19
- if (color === defaultLightColor) {
20
- // 找到浅色主题的 token
21
- var token = findKey(TEXT_THEME.light, function (i) {
22
- return i === color;
23
- });
24
- // 返回暗黑主题的对应 token 的颜色
25
- if (token) return TEXT_THEME.dark[token];
26
- }
27
- }
28
- return color;
29
- };
@@ -1,2 +0,0 @@
1
- export * from './getThemeColor';
2
- export * from './useAntdDarkAlgorithm';
@@ -1,2 +0,0 @@
1
- export * from "./getThemeColor";
2
- export * from "./useAntdDarkAlgorithm";
@@ -1,2 +0,0 @@
1
- /** 判断是否运用了 antd dark algorithm */
2
- export declare const useAntdDarkAlgorithm: () => boolean;
@@ -1,14 +0,0 @@
1
- import { ConfigProvider, theme as antdTheme } from 'antd';
2
- import { isArray } from 'lodash';
3
- import { useContext } from 'react';
4
-
5
- /** 判断是否运用了 antd dark algorithm */
6
- export var useAntdDarkAlgorithm = function useAntdDarkAlgorithm() {
7
- var _config$theme;
8
- // 放到函数内部,避免用户使用 antd@4,theme 变量不存在情况!!!
9
- var darkAlgorithm = antdTheme === null || antdTheme === void 0 ? void 0 : antdTheme.darkAlgorithm;
10
- var config = useContext(ConfigProvider.ConfigContext);
11
- var currentAlgorithm = (_config$theme = config.theme) === null || _config$theme === void 0 ? void 0 : _config$theme.algorithm;
12
- if (isArray(currentAlgorithm) && currentAlgorithm.includes(darkAlgorithm)) return true;
13
- return !!darkAlgorithm && currentAlgorithm === darkAlgorithm;
14
- };
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import type { BasePlotProps, Style, Theme } from '../types';
3
- type TreeNode = {
4
- name: string;
5
- value: number;
6
- children?: TreeNode[];
7
- };
8
- export type TreemapProps = BasePlotProps<TreeNode> & Theme & Style;
9
- declare const Treemap: (props: TreemapProps) => React.JSX.Element;
10
- export default Treemap;
@@ -1,88 +0,0 @@
1
- var _excluded = ["data"];
2
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
5
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
6
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
8
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
- import { Treemap as ADCTreemap } from '@ant-design/plots';
12
- import React, { useMemo } from 'react';
13
- import { usePlotConfig } from "../ConfigProvider/hooks";
14
- import { THEME_MAP } from "../theme";
15
-
16
- // binNumber和binWidth为互斥属性,选其一即可
17
-
18
- var defaultConfig = function defaultConfig(props) {
19
- var _props$valueField = props.valueField,
20
- valueField = _props$valueField === void 0 ? 'value' : _props$valueField,
21
- _props$style = props.style,
22
- style = _props$style === void 0 ? {} : _props$style;
23
- var backgroundColor = style.backgroundColor,
24
- palette = style.palette;
25
- var hasPalette = !!(palette !== null && palette !== void 0 && palette[0]);
26
- var paletteConfig = {
27
- color: undefined
28
- };
29
- if (hasPalette) {
30
- paletteConfig = {
31
- color: {
32
- range: palette
33
- }
34
- };
35
- }
36
- return _objectSpread(_objectSpread({
37
- legend: false,
38
- layout: {
39
- tile: 'treemapBinary',
40
- paddingInner: 3
41
- },
42
- valueField: valueField,
43
- tooltip: {
44
- items: [function (d) {
45
- var _d$data;
46
- return {
47
- name: (_d$data = d.data) === null || _d$data === void 0 ? void 0 : _d$data.name,
48
- value: d[valueField]
49
- };
50
- }]
51
- },
52
- style: {
53
- fillOpacity: 0.8,
54
- labelFontSize: 12
55
- }
56
- }, backgroundColor ? {
57
- viewStyle: {
58
- viewFill: backgroundColor
59
- }
60
- } : {
61
- viewStyle: undefined
62
- }), {}, {
63
- scale: _objectSpread({}, paletteConfig)
64
- });
65
- };
66
- var transform = function transform(data) {
67
- return {
68
- name: 'root',
69
- children: data
70
- };
71
- };
72
- var Treemap = function Treemap(props) {
73
- var _props$theme;
74
- var themeConfig = THEME_MAP[(_props$theme = props.theme) !== null && _props$theme !== void 0 ? _props$theme : 'default'];
75
- var config = usePlotConfig('Treemap', defaultConfig, _objectSpread(_objectSpread({}, props), {}, {
76
- theme: themeConfig
77
- }));
78
- var data = config.data,
79
- others = _objectWithoutProperties(config, _excluded);
80
- var transformData = useMemo(function () {
81
- return transform(data);
82
- }, [data]);
83
- console.log('treemap config:', config, props);
84
- return /*#__PURE__*/React.createElement(ADCTreemap, _extends({}, others, {
85
- data: transformData
86
- }));
87
- };
88
- export default Treemap;
@@ -1,32 +0,0 @@
1
- import React from 'react';
2
- import type { BasePlotProps, Style, Theme } from '../types';
3
- type VennDatum = {
4
- /**
5
- * Label for the venn chart segment.
6
- * This should be a string that describes the segment.
7
- * For example, "A", "B", or "A ∩ B" for intersections.
8
- * It is used to identify the segment in the chart.
9
- */
10
- label?: string;
11
- /**
12
- * Value for the venn chart segment.
13
- * This should be a number that represents the size or count of the segment.
14
- * For example, if the segment represents a set of items, this could be the number of items in that set.
15
- * It is used to determine the size of the segment in the chart.
16
- * For intersections, this value should represent the count of items that belong to the intersection of sets.
17
- * For example, if "A ∩ B" represents the intersection of sets A and B, this value should be the count of items that are in both sets.
18
- */
19
- value: number;
20
- /**
21
- * Sets that the segment belongs to.
22
- * This should be an array of strings representing the sets that the segment is part of.
23
- * For example, if the segment represents items that belong to both set A and set B, this could be ['A', 'B'].
24
- * It is used to determine how the segment is displayed in the venn chart.
25
- * For intersections, this array should include the sets that contribute to the intersection.
26
- * For example, if "A ∩ B" represents the intersection of sets A and B, this array should be ['A', 'B'].
27
- */
28
- sets: string[] | number[];
29
- };
30
- export type VennProps = BasePlotProps<VennDatum> & Theme & Style;
31
- declare const Venn: (props: VennProps) => React.JSX.Element;
32
- export default Venn;