@visactor/vtable 1.4.2-beta.0 → 1.5.0

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 (443) hide show
  1. package/cjs/ListTable-all.d.ts +3 -0
  2. package/cjs/ListTable-all.js +18 -0
  3. package/cjs/ListTable-all.js.map +1 -0
  4. package/cjs/ListTable-simple.d.ts +3 -0
  5. package/cjs/ListTable-simple.js +14 -0
  6. package/cjs/ListTable-simple.js.map +1 -0
  7. package/cjs/ListTable.js +39 -23
  8. package/cjs/ListTable.js.map +1 -1
  9. package/cjs/PivotChart.js +34 -14
  10. package/cjs/PivotChart.js.map +1 -1
  11. package/cjs/PivotTable-all.d.ts +3 -0
  12. package/cjs/PivotTable-all.js +19 -0
  13. package/cjs/PivotTable-all.js.map +1 -0
  14. package/cjs/PivotTable-simple.d.ts +3 -0
  15. package/cjs/PivotTable-simple.js +14 -0
  16. package/cjs/PivotTable-simple.js.map +1 -0
  17. package/cjs/PivotTable.js +51 -36
  18. package/cjs/PivotTable.js.map +1 -1
  19. package/cjs/body-helper/style.js +1 -2
  20. package/cjs/components/axis/axis.d.ts +3 -0
  21. package/cjs/components/axis/axis.js +3 -3
  22. package/cjs/components/axis/axis.js.map +1 -1
  23. package/cjs/components/axis/get-axis-component-size.d.ts +2 -0
  24. package/cjs/components/axis/get-axis-component-size.js.map +1 -1
  25. package/cjs/components/empty-tip/empty-tip.d.ts +3 -0
  26. package/cjs/components/empty-tip/empty-tip.js.map +1 -1
  27. package/cjs/components/index.d.ts +6 -0
  28. package/cjs/components/index.js +44 -0
  29. package/cjs/components/index.js.map +1 -0
  30. package/cjs/components/legend/create-legend.d.ts +1 -0
  31. package/cjs/components/legend/create-legend.js.map +1 -1
  32. package/cjs/components/menu/dom/MenuHandler.d.ts +3 -0
  33. package/cjs/components/menu/dom/MenuHandler.js.map +1 -1
  34. package/cjs/components/title/title.d.ts +3 -0
  35. package/cjs/components/title/title.js.map +1 -1
  36. package/cjs/components/tooltip/TooltipHandler.d.ts +3 -0
  37. package/cjs/components/tooltip/TooltipHandler.js.map +1 -1
  38. package/cjs/components/tooltip/logic/BubbleTooltipElement.js +2 -0
  39. package/cjs/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
  40. package/cjs/core/BaseTable.d.ts +5 -4
  41. package/cjs/core/BaseTable.js +71 -183
  42. package/cjs/core/BaseTable.js.map +1 -1
  43. package/cjs/core/factory.d.ts +11 -0
  44. package/cjs/core/factory.js +29 -0
  45. package/cjs/core/factory.js.map +1 -0
  46. package/cjs/core/row-series-number-helper.js +2 -1
  47. package/cjs/core/utils/get-cell-position.d.ts +42 -0
  48. package/cjs/core/utils/get-cell-position.js +208 -0
  49. package/cjs/core/utils/get-cell-position.js.map +1 -0
  50. package/cjs/edit/edit-manager.d.ts +1 -1
  51. package/cjs/edit/edit-manager.js +8 -8
  52. package/cjs/edit/edit-manager.js.map +1 -1
  53. package/cjs/event/event.js +7 -3
  54. package/cjs/event/event.js.map +1 -1
  55. package/cjs/event/listener/container-dom.js +95 -88
  56. package/cjs/event/listener/container-dom.js.map +1 -1
  57. package/cjs/event/listener/table-group.d.ts +3 -0
  58. package/cjs/event/listener/table-group.js +32 -22
  59. package/cjs/event/listener/table-group.js.map +1 -1
  60. package/cjs/event/media-click.js +3 -1
  61. package/cjs/event/media-click.js.map +1 -1
  62. package/cjs/index.d.ts +8 -4
  63. package/cjs/index.js +26 -7
  64. package/cjs/index.js.map +1 -1
  65. package/cjs/layout/chart-helper/get-axis-config.d.ts +1 -1
  66. package/cjs/layout/chart-helper/get-axis-config.js +4 -4
  67. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
  68. package/cjs/layout/chart-helper/get-axis-domain.d.ts +1 -0
  69. package/cjs/layout/chart-helper/get-axis-domain.js.map +1 -1
  70. package/cjs/layout/chart-helper/get-chart-spec.js +31 -9
  71. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  72. package/cjs/layout/layout-helper.js +2 -2
  73. package/cjs/layout/layout-helper.js.map +1 -1
  74. package/cjs/layout/pivot-header-layout.js +190 -59
  75. package/cjs/layout/pivot-header-layout.js.map +1 -1
  76. package/cjs/layout/row-height-map.js +0 -1
  77. package/cjs/layout/simple-header-layout.d.ts +3 -0
  78. package/cjs/layout/simple-header-layout.js +28 -22
  79. package/cjs/layout/simple-header-layout.js.map +1 -1
  80. package/cjs/plugins/themes.js +2 -1
  81. package/cjs/scenegraph/component/custom.js +4 -2
  82. package/cjs/scenegraph/component/custom.js.map +1 -1
  83. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +62 -58
  84. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  85. package/cjs/scenegraph/group-creater/cell-helper.js +31 -22
  86. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  87. package/cjs/scenegraph/group-creater/cell-type/chart-cell.d.ts +1 -0
  88. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  89. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.d.ts +3 -2
  90. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +21 -4
  91. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  92. package/cjs/scenegraph/group-creater/cell-type/image-cell.d.ts +4 -2
  93. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +34 -14
  94. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  95. package/cjs/scenegraph/group-creater/cell-type/index.d.ts +8 -0
  96. package/cjs/scenegraph/group-creater/cell-type/index.js +55 -0
  97. package/cjs/scenegraph/group-creater/cell-type/index.js.map +1 -0
  98. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.d.ts +1 -0
  99. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  100. package/cjs/scenegraph/group-creater/cell-type/radio-cell.d.ts +1 -0
  101. package/cjs/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -1
  102. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.d.ts +1 -0
  103. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  104. package/cjs/scenegraph/group-creater/cell-type/text-cell.d.ts +1 -0
  105. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  106. package/cjs/scenegraph/group-creater/cell-type/video-cell.d.ts +3 -1
  107. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +21 -5
  108. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  109. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +8 -8
  110. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  111. package/cjs/scenegraph/group-creater/progress/proxy.js +12 -12
  112. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  113. package/cjs/scenegraph/group-creater/progress/update-position/sort-horizontal.js +2 -2
  114. package/cjs/scenegraph/group-creater/progress/update-position/sort-horizontal.js.map +1 -1
  115. package/cjs/scenegraph/group-creater/progress/update-position/sort-vertical.js +7 -8
  116. package/cjs/scenegraph/group-creater/progress/update-position/sort-vertical.js.map +1 -1
  117. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js +3 -3
  118. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
  119. package/cjs/scenegraph/group-creater/progress/update-position/util.js +3 -3
  120. package/cjs/scenegraph/group-creater/progress/update-position/util.js.map +1 -1
  121. package/cjs/scenegraph/layout/compute-col-width.js +4 -4
  122. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  123. package/cjs/scenegraph/layout/compute-row-height.js +3 -3
  124. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  125. package/cjs/scenegraph/layout/update-height.js +5 -6
  126. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  127. package/cjs/scenegraph/layout/update-width.js +5 -6
  128. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  129. package/cjs/scenegraph/refresh-node/update-chart.js +2 -2
  130. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  131. package/cjs/scenegraph/scenegraph.js +5 -5
  132. package/cjs/scenegraph/scenegraph.js.map +1 -1
  133. package/cjs/scenegraph/select/update-select-border.js +72 -49
  134. package/cjs/scenegraph/select/update-select-border.js.map +1 -1
  135. package/cjs/scenegraph/utils/text-icon-layout.d.ts +16 -0
  136. package/cjs/scenegraph/utils/text-icon-layout.js +80 -58
  137. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  138. package/cjs/state/cell-move/index.js +4 -1
  139. package/cjs/state/cell-move/index.js.map +1 -1
  140. package/cjs/state/select/update-position.js +2 -2
  141. package/cjs/state/select/update-position.js.map +1 -1
  142. package/cjs/state/sort/index.js +7 -3
  143. package/cjs/state/sort/index.js.map +1 -1
  144. package/cjs/state/state.d.ts +1 -1
  145. package/cjs/state/state.js +11 -7
  146. package/cjs/state/state.js.map +1 -1
  147. package/cjs/themes/ARCO.js +1 -1
  148. package/cjs/themes/BRIGHT.js +1 -1
  149. package/cjs/themes/DARK.js +1 -1
  150. package/cjs/themes/DEFAULT.js +1 -1
  151. package/cjs/themes/SIMPLIFY.js +1 -1
  152. package/cjs/tools/util.d.ts +1 -0
  153. package/cjs/tools/util.js +11 -2
  154. package/cjs/tools/util.js.map +1 -1
  155. package/cjs/ts-types/base-table.d.ts +7 -3
  156. package/cjs/ts-types/base-table.js.map +1 -1
  157. package/cjs/ts-types/list-table/define/basic-define.d.ts +1 -0
  158. package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
  159. package/cjs/ts-types/table-engine.d.ts +1 -1
  160. package/cjs/ts-types/table-engine.js.map +1 -1
  161. package/cjs/ts-types/theme.js.map +1 -1
  162. package/cjs/vrender.js +7 -7
  163. package/cjs/vrender.js.map +1 -1
  164. package/dist/vtable.js +31005 -30762
  165. package/dist/vtable.min.js +2 -2
  166. package/es/ListTable-all.d.ts +3 -0
  167. package/es/ListTable-all.js +12 -0
  168. package/es/ListTable-all.js.map +1 -0
  169. package/es/ListTable-simple.d.ts +3 -0
  170. package/es/ListTable-simple.js +8 -0
  171. package/es/ListTable-simple.js.map +1 -0
  172. package/es/ListTable.js +35 -20
  173. package/es/ListTable.js.map +1 -1
  174. package/es/PivotChart.js +35 -15
  175. package/es/PivotChart.js.map +1 -1
  176. package/es/PivotTable-all.d.ts +3 -0
  177. package/es/PivotTable-all.js +13 -0
  178. package/es/PivotTable-all.js.map +1 -0
  179. package/es/PivotTable-simple.d.ts +3 -0
  180. package/es/PivotTable-simple.js +8 -0
  181. package/es/PivotTable-simple.js.map +1 -0
  182. package/es/PivotTable.js +50 -37
  183. package/es/PivotTable.js.map +1 -1
  184. package/es/body-helper/style.js +1 -2
  185. package/es/components/axis/axis.d.ts +3 -0
  186. package/es/components/axis/axis.js +4 -3
  187. package/es/components/axis/axis.js.map +1 -1
  188. package/es/components/axis/get-axis-component-size.d.ts +2 -0
  189. package/es/components/axis/get-axis-component-size.js.map +1 -1
  190. package/es/components/empty-tip/empty-tip.d.ts +3 -0
  191. package/es/components/empty-tip/empty-tip.js.map +1 -1
  192. package/es/components/index.d.ts +6 -0
  193. package/es/components/index.js +44 -0
  194. package/es/components/index.js.map +1 -0
  195. package/es/components/legend/create-legend.d.ts +1 -0
  196. package/es/components/legend/create-legend.js.map +1 -1
  197. package/es/components/menu/dom/MenuHandler.d.ts +3 -0
  198. package/es/components/menu/dom/MenuHandler.js.map +1 -1
  199. package/es/components/title/title.d.ts +3 -0
  200. package/es/components/title/title.js.map +1 -1
  201. package/es/components/tooltip/TooltipHandler.d.ts +3 -0
  202. package/es/components/tooltip/TooltipHandler.js.map +1 -1
  203. package/es/components/tooltip/logic/BubbleTooltipElement.js +3 -1
  204. package/es/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
  205. package/es/core/BaseTable.d.ts +5 -4
  206. package/es/core/BaseTable.js +75 -187
  207. package/es/core/BaseTable.js.map +1 -1
  208. package/es/core/factory.d.ts +11 -0
  209. package/es/core/factory.js +23 -0
  210. package/es/core/factory.js.map +1 -0
  211. package/es/core/row-series-number-helper.js +2 -1
  212. package/es/core/utils/get-cell-position.d.ts +42 -0
  213. package/es/core/utils/get-cell-position.js +196 -0
  214. package/es/core/utils/get-cell-position.js.map +1 -0
  215. package/es/edit/edit-manager.d.ts +1 -1
  216. package/es/edit/edit-manager.js +8 -8
  217. package/es/edit/edit-manager.js.map +1 -1
  218. package/es/event/event.js +6 -2
  219. package/es/event/event.js.map +1 -1
  220. package/es/event/listener/container-dom.js +95 -87
  221. package/es/event/listener/container-dom.js.map +1 -1
  222. package/es/event/listener/table-group.d.ts +3 -0
  223. package/es/event/listener/table-group.js +31 -22
  224. package/es/event/listener/table-group.js.map +1 -1
  225. package/es/event/media-click.js +3 -1
  226. package/es/event/media-click.js.map +1 -1
  227. package/es/index.d.ts +8 -4
  228. package/es/index.js +12 -4
  229. package/es/index.js.map +1 -1
  230. package/es/layout/chart-helper/get-axis-config.d.ts +1 -1
  231. package/es/layout/chart-helper/get-axis-config.js +4 -4
  232. package/es/layout/chart-helper/get-axis-config.js.map +1 -1
  233. package/es/layout/chart-helper/get-axis-domain.d.ts +1 -0
  234. package/es/layout/chart-helper/get-axis-domain.js.map +1 -1
  235. package/es/layout/chart-helper/get-chart-spec.js +34 -10
  236. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  237. package/es/layout/layout-helper.js +2 -2
  238. package/es/layout/layout-helper.js.map +1 -1
  239. package/es/layout/pivot-header-layout.js +190 -59
  240. package/es/layout/pivot-header-layout.js.map +1 -1
  241. package/es/layout/row-height-map.js +1 -2
  242. package/es/layout/simple-header-layout.d.ts +3 -0
  243. package/es/layout/simple-header-layout.js +28 -22
  244. package/es/layout/simple-header-layout.js.map +1 -1
  245. package/es/plugins/themes.js +2 -1
  246. package/es/scenegraph/component/custom.js +4 -2
  247. package/es/scenegraph/component/custom.js.map +1 -1
  248. package/es/scenegraph/graphic/contributions/group-contribution-render.js +62 -58
  249. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  250. package/es/scenegraph/group-creater/cell-helper.js +31 -35
  251. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  252. package/es/scenegraph/group-creater/cell-type/chart-cell.d.ts +1 -0
  253. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  254. package/es/scenegraph/group-creater/cell-type/checkbox-cell.d.ts +3 -2
  255. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +21 -3
  256. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  257. package/es/scenegraph/group-creater/cell-type/image-cell.d.ts +4 -2
  258. package/es/scenegraph/group-creater/cell-type/image-cell.js +34 -13
  259. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  260. package/es/scenegraph/group-creater/cell-type/index.d.ts +8 -0
  261. package/es/scenegraph/group-creater/cell-type/index.js +52 -0
  262. package/es/scenegraph/group-creater/cell-type/index.js.map +1 -0
  263. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.d.ts +1 -0
  264. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  265. package/es/scenegraph/group-creater/cell-type/radio-cell.d.ts +1 -0
  266. package/es/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -1
  267. package/es/scenegraph/group-creater/cell-type/spark-line-cell.d.ts +1 -0
  268. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  269. package/es/scenegraph/group-creater/cell-type/text-cell.d.ts +1 -0
  270. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  271. package/es/scenegraph/group-creater/cell-type/video-cell.d.ts +3 -1
  272. package/es/scenegraph/group-creater/cell-type/video-cell.js +21 -4
  273. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  274. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +8 -8
  275. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  276. package/es/scenegraph/group-creater/progress/proxy.js +12 -12
  277. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  278. package/es/scenegraph/group-creater/progress/update-position/sort-horizontal.js +4 -3
  279. package/es/scenegraph/group-creater/progress/update-position/sort-horizontal.js.map +1 -1
  280. package/es/scenegraph/group-creater/progress/update-position/sort-vertical.js +7 -8
  281. package/es/scenegraph/group-creater/progress/update-position/sort-vertical.js.map +1 -1
  282. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js +3 -3
  283. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
  284. package/es/scenegraph/group-creater/progress/update-position/util.js +3 -3
  285. package/es/scenegraph/group-creater/progress/update-position/util.js.map +1 -1
  286. package/es/scenegraph/layout/compute-col-width.js +4 -6
  287. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  288. package/es/scenegraph/layout/compute-row-height.js +3 -5
  289. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  290. package/es/scenegraph/layout/update-height.js +6 -8
  291. package/es/scenegraph/layout/update-height.js.map +1 -1
  292. package/es/scenegraph/layout/update-width.js +5 -9
  293. package/es/scenegraph/layout/update-width.js.map +1 -1
  294. package/es/scenegraph/refresh-node/update-chart.js +2 -2
  295. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  296. package/es/scenegraph/scenegraph.js +6 -6
  297. package/es/scenegraph/scenegraph.js.map +1 -1
  298. package/es/scenegraph/select/update-select-border.js +72 -49
  299. package/es/scenegraph/select/update-select-border.js.map +1 -1
  300. package/es/scenegraph/utils/text-icon-layout.d.ts +16 -0
  301. package/es/scenegraph/utils/text-icon-layout.js +78 -56
  302. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  303. package/es/state/cell-move/index.js +4 -1
  304. package/es/state/cell-move/index.js.map +1 -1
  305. package/es/state/select/update-position.js +2 -2
  306. package/es/state/select/update-position.js.map +1 -1
  307. package/es/state/sort/index.js +7 -3
  308. package/es/state/sort/index.js.map +1 -1
  309. package/es/state/state.d.ts +1 -1
  310. package/es/state/state.js +11 -7
  311. package/es/state/state.js.map +1 -1
  312. package/es/themes/ARCO.js +1 -1
  313. package/es/themes/BRIGHT.js +1 -1
  314. package/es/themes/DARK.js +1 -1
  315. package/es/themes/DEFAULT.js +1 -1
  316. package/es/themes/SIMPLIFY.js +1 -1
  317. package/es/tools/util.d.ts +1 -0
  318. package/es/tools/util.js +9 -0
  319. package/es/tools/util.js.map +1 -1
  320. package/es/ts-types/base-table.d.ts +7 -3
  321. package/es/ts-types/base-table.js.map +1 -1
  322. package/es/ts-types/list-table/define/basic-define.d.ts +1 -0
  323. package/es/ts-types/list-table/define/basic-define.js.map +1 -1
  324. package/es/ts-types/table-engine.d.ts +1 -1
  325. package/es/ts-types/table-engine.js.map +1 -1
  326. package/es/ts-types/theme.js.map +1 -1
  327. package/es/vrender.js +5 -5
  328. package/es/vrender.js.map +1 -1
  329. package/package.json +15 -6
  330. package/cjs/vutil-extension-temp/algorithm/binary-search.d.ts +0 -2
  331. package/cjs/vutil-extension-temp/algorithm/binary-search.js +0 -21
  332. package/cjs/vutil-extension-temp/algorithm/binary-search.js.map +0 -1
  333. package/cjs/vutil-extension-temp/algorithm/index.d.ts +0 -1
  334. package/cjs/vutil-extension-temp/algorithm/index.js +0 -21
  335. package/cjs/vutil-extension-temp/algorithm/index.js.map +0 -1
  336. package/cjs/vutil-extension-temp/index.d.ts +0 -4
  337. package/cjs/vutil-extension-temp/index.js +0 -22
  338. package/cjs/vutil-extension-temp/index.js.map +0 -1
  339. package/cjs/vutil-extension-temp/spec/clone-deep.d.ts +0 -1
  340. package/cjs/vutil-extension-temp/spec/clone-deep.js +0 -27
  341. package/cjs/vutil-extension-temp/spec/clone-deep.js.map +0 -1
  342. package/cjs/vutil-extension-temp/spec/common.d.ts +0 -3
  343. package/cjs/vutil-extension-temp/spec/common.js +0 -23
  344. package/cjs/vutil-extension-temp/spec/common.js.map +0 -1
  345. package/cjs/vutil-extension-temp/spec/index.d.ts +0 -3
  346. package/cjs/vutil-extension-temp/spec/index.js +0 -22
  347. package/cjs/vutil-extension-temp/spec/index.js.map +0 -1
  348. package/cjs/vutil-extension-temp/spec/merge-spec.d.ts +0 -5
  349. package/cjs/vutil-extension-temp/spec/merge-spec.js +0 -69
  350. package/cjs/vutil-extension-temp/spec/merge-spec.js.map +0 -1
  351. package/cjs/vutil-extension-temp/transform/tick-data/config.d.ts +0 -1
  352. package/cjs/vutil-extension-temp/transform/tick-data/config.js +0 -6
  353. package/cjs/vutil-extension-temp/transform/tick-data/config.js.map +0 -1
  354. package/cjs/vutil-extension-temp/transform/tick-data/continuous.d.ts +0 -3
  355. package/cjs/vutil-extension-temp/transform/tick-data/continuous.js +0 -57
  356. package/cjs/vutil-extension-temp/transform/tick-data/continuous.js.map +0 -1
  357. package/cjs/vutil-extension-temp/transform/tick-data/discrete/linear.d.ts +0 -6
  358. package/cjs/vutil-extension-temp/transform/tick-data/discrete/linear.js +0 -101
  359. package/cjs/vutil-extension-temp/transform/tick-data/discrete/linear.js.map +0 -1
  360. package/cjs/vutil-extension-temp/transform/tick-data/discrete/polar-angle.d.ts +0 -3
  361. package/cjs/vutil-extension-temp/transform/tick-data/discrete/polar-angle.js +0 -53
  362. package/cjs/vutil-extension-temp/transform/tick-data/discrete/polar-angle.js.map +0 -1
  363. package/cjs/vutil-extension-temp/transform/tick-data/index.d.ts +0 -6
  364. package/cjs/vutil-extension-temp/transform/tick-data/index.js +0 -41
  365. package/cjs/vutil-extension-temp/transform/tick-data/index.js.map +0 -1
  366. package/cjs/vutil-extension-temp/transform/tick-data/interface.d.ts +0 -38
  367. package/cjs/vutil-extension-temp/transform/tick-data/interface.js +0 -6
  368. package/cjs/vutil-extension-temp/transform/tick-data/interface.js.map +0 -1
  369. package/cjs/vutil-extension-temp/transform/tick-data/util.d.ts +0 -17
  370. package/cjs/vutil-extension-temp/transform/tick-data/util.js +0 -91
  371. package/cjs/vutil-extension-temp/transform/tick-data/util.js.map +0 -1
  372. package/cjs/vutil-extension-temp/transform/tick-data/utils/polar-label-position.d.ts +0 -8
  373. package/cjs/vutil-extension-temp/transform/tick-data/utils/polar-label-position.js +0 -20
  374. package/cjs/vutil-extension-temp/transform/tick-data/utils/polar-label-position.js.map +0 -1
  375. package/cjs/vutil-extension-temp/utils/index.d.ts +0 -3
  376. package/cjs/vutil-extension-temp/utils/index.js +0 -22
  377. package/cjs/vutil-extension-temp/utils/index.js.map +0 -1
  378. package/cjs/vutil-extension-temp/utils/object.d.ts +0 -3
  379. package/cjs/vutil-extension-temp/utils/object.js +0 -30
  380. package/cjs/vutil-extension-temp/utils/object.js.map +0 -1
  381. package/cjs/vutil-extension-temp/utils/polar.d.ts +0 -5
  382. package/cjs/vutil-extension-temp/utils/polar.js +0 -23
  383. package/cjs/vutil-extension-temp/utils/polar.js.map +0 -1
  384. package/cjs/vutil-extension-temp/utils/text.d.ts +0 -4
  385. package/cjs/vutil-extension-temp/utils/text.js +0 -17
  386. package/cjs/vutil-extension-temp/utils/text.js.map +0 -1
  387. package/es/vutil-extension-temp/algorithm/binary-search.d.ts +0 -2
  388. package/es/vutil-extension-temp/algorithm/binary-search.js +0 -11
  389. package/es/vutil-extension-temp/algorithm/binary-search.js.map +0 -1
  390. package/es/vutil-extension-temp/algorithm/index.d.ts +0 -1
  391. package/es/vutil-extension-temp/algorithm/index.js +0 -2
  392. package/es/vutil-extension-temp/algorithm/index.js.map +0 -1
  393. package/es/vutil-extension-temp/index.d.ts +0 -4
  394. package/es/vutil-extension-temp/index.js +0 -8
  395. package/es/vutil-extension-temp/index.js.map +0 -1
  396. package/es/vutil-extension-temp/spec/clone-deep.d.ts +0 -1
  397. package/es/vutil-extension-temp/spec/clone-deep.js +0 -20
  398. package/es/vutil-extension-temp/spec/clone-deep.js.map +0 -1
  399. package/es/vutil-extension-temp/spec/common.d.ts +0 -3
  400. package/es/vutil-extension-temp/spec/common.js +0 -15
  401. package/es/vutil-extension-temp/spec/common.js.map +0 -1
  402. package/es/vutil-extension-temp/spec/index.d.ts +0 -3
  403. package/es/vutil-extension-temp/spec/index.js +0 -6
  404. package/es/vutil-extension-temp/spec/index.js.map +0 -1
  405. package/es/vutil-extension-temp/spec/merge-spec.d.ts +0 -5
  406. package/es/vutil-extension-temp/spec/merge-spec.js +0 -57
  407. package/es/vutil-extension-temp/spec/merge-spec.js.map +0 -1
  408. package/es/vutil-extension-temp/transform/tick-data/config.d.ts +0 -1
  409. package/es/vutil-extension-temp/transform/tick-data/config.js +0 -2
  410. package/es/vutil-extension-temp/transform/tick-data/config.js.map +0 -1
  411. package/es/vutil-extension-temp/transform/tick-data/continuous.d.ts +0 -3
  412. package/es/vutil-extension-temp/transform/tick-data/continuous.js +0 -56
  413. package/es/vutil-extension-temp/transform/tick-data/continuous.js.map +0 -1
  414. package/es/vutil-extension-temp/transform/tick-data/discrete/linear.d.ts +0 -6
  415. package/es/vutil-extension-temp/transform/tick-data/discrete/linear.js +0 -92
  416. package/es/vutil-extension-temp/transform/tick-data/discrete/linear.js.map +0 -1
  417. package/es/vutil-extension-temp/transform/tick-data/discrete/polar-angle.d.ts +0 -3
  418. package/es/vutil-extension-temp/transform/tick-data/discrete/polar-angle.js +0 -45
  419. package/es/vutil-extension-temp/transform/tick-data/discrete/polar-angle.js.map +0 -1
  420. package/es/vutil-extension-temp/transform/tick-data/index.d.ts +0 -6
  421. package/es/vutil-extension-temp/transform/tick-data/index.js +0 -23
  422. package/es/vutil-extension-temp/transform/tick-data/index.js.map +0 -1
  423. package/es/vutil-extension-temp/transform/tick-data/interface.d.ts +0 -38
  424. package/es/vutil-extension-temp/transform/tick-data/interface.js +0 -2
  425. package/es/vutil-extension-temp/transform/tick-data/interface.js.map +0 -1
  426. package/es/vutil-extension-temp/transform/tick-data/util.d.ts +0 -17
  427. package/es/vutil-extension-temp/transform/tick-data/util.js +0 -78
  428. package/es/vutil-extension-temp/transform/tick-data/util.js.map +0 -1
  429. package/es/vutil-extension-temp/transform/tick-data/utils/polar-label-position.d.ts +0 -8
  430. package/es/vutil-extension-temp/transform/tick-data/utils/polar-label-position.js +0 -12
  431. package/es/vutil-extension-temp/transform/tick-data/utils/polar-label-position.js.map +0 -1
  432. package/es/vutil-extension-temp/utils/index.d.ts +0 -3
  433. package/es/vutil-extension-temp/utils/index.js +0 -6
  434. package/es/vutil-extension-temp/utils/index.js.map +0 -1
  435. package/es/vutil-extension-temp/utils/object.d.ts +0 -3
  436. package/es/vutil-extension-temp/utils/object.js +0 -15
  437. package/es/vutil-extension-temp/utils/object.js.map +0 -1
  438. package/es/vutil-extension-temp/utils/polar.d.ts +0 -5
  439. package/es/vutil-extension-temp/utils/polar.js +0 -16
  440. package/es/vutil-extension-temp/utils/polar.js.map +0 -1
  441. package/es/vutil-extension-temp/utils/text.d.ts +0 -4
  442. package/es/vutil-extension-temp/utils/text.js +0 -13
  443. package/es/vutil-extension-temp/utils/text.js.map +0 -1
@@ -49,5 +49,4 @@ function of(columnStyle, bodyStyle, styleArg, StyleClassDef = Style_1.Style, glo
49
49
  StyleClassDef === CheckboxStyle_1.CheckboxStyle ? new CheckboxStyle_1.CheckboxStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_a = theme.checkboxStyle) && void 0 !== _a ? _a : {}) : StyleClassDef === RadioStyle_1.RadioStyle ? new RadioStyle_1.RadioStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_b = theme.radioStyle) && void 0 !== _b ? _b : {}) : new StyleClassDef(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {})) : StyleClassDef.DEFAULT;
50
50
  }
51
51
 
52
- exports.EVENT_TYPE = EVENT_TYPE, exports.of = of;
53
- //# sourceMappingURL=style.js.map
52
+ exports.EVENT_TYPE = EVENT_TYPE, exports.of = of;
@@ -5,6 +5,9 @@ import type { IOrientType } from '../../ts-types/component/util';
5
5
  import { BandAxisScale } from './band-scale';
6
6
  import { DataView } from '@visactor/vdataset';
7
7
  import { LinearAxisScale } from './linear-scale';
8
+ export interface ICartesianAxis {
9
+ new (option: ICellAxisOption, width: number, height: number, padding: [number, number, number, number], table: BaseTableAPI): CartesianAxis;
10
+ }
8
11
  export declare class CartesianAxis {
9
12
  width: number;
10
13
  height: number;
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.CartesianAxis = void 0;
6
6
 
7
- const vutils_1 = require("@visactor/vutils"), vrender_components_1 = require("@visactor/vrender-components"), get_axis_attributes_1 = require("./get-axis-attributes"), orient_1 = require("../util/orient"), band_scale_1 = require("./band-scale"), register_1 = require("../util/register"), vdataset_1 = require("@visactor/vdataset"), vutil_extension_temp_1 = require("./../../vutil-extension-temp"), linear_scale_1 = require("./linear-scale"), label_overlap_1 = require("./label-overlap"), DEFAULT_BAND_INNER_PADDING = .1, DEFAULT_BAND_OUTER_PADDING = .3, scaleParser = scale => scale;
7
+ const vutils_1 = require("@visactor/vutils"), vrender_components_1 = require("@visactor/vrender-components"), get_axis_attributes_1 = require("./get-axis-attributes"), orient_1 = require("../util/orient"), band_scale_1 = require("./band-scale"), register_1 = require("../util/register"), vdataset_1 = require("@visactor/vdataset"), vrender_1 = require("./../../vrender"), linear_scale_1 = require("./linear-scale"), label_overlap_1 = require("./label-overlap"), DEFAULT_BAND_INNER_PADDING = .1, DEFAULT_BAND_OUTER_PADDING = .3, scaleParser = scale => scale;
8
8
 
9
9
  class CartesianAxis {
10
10
  constructor(option, width, height, padding, table) {
@@ -33,8 +33,8 @@ class CartesianAxis {
33
33
  this.scale.transformScaleDomain(), this.scale.updateScaleDomain(), this.updateScaleRange());
34
34
  }
35
35
  initData() {
36
- (0, register_1.registerDataSetInstanceParser)(this.table._vDataSet, "scale", scaleParser),
37
- (0, register_1.registerDataSetInstanceTransform)(this.table._vDataSet, "ticks", vutil_extension_temp_1.ticks);
36
+ this.table._vDataSet || (this.table._vDataSet = new vdataset_1.DataSet), (0, register_1.registerDataSetInstanceParser)(this.table._vDataSet, "scale", scaleParser),
37
+ (0, register_1.registerDataSetInstanceTransform)(this.table._vDataSet, "ticks", vrender_1.ticks);
38
38
  const label = this.option.label || {}, tick = this.option.tick || {}, tickData = new vdataset_1.DataView(this.table._vDataSet).parse(this.scale._scale, {
39
39
  type: "scale"
40
40
  }).transform({
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/axis/axis.ts"],"names":[],"mappings":";;;AAAA,6CAA+E;AAG/E,qEAAiF;AACjF,+DAAqF;AACrF,2CAAkD;AAElD,6CAA6C;AAC7C,+CAAmG;AAEnG,iDAA8C;AAE9C,uEAAqD;AACrD,iDAAiD;AACjD,mDAA4C;AAG5C,MAAM,0BAA0B,GAAG,GAAG,CAAC;AACvC,MAAM,0BAA0B,GAAG,GAAG,CAAC;AACvC,MAAM,WAAW,GAAW,CAAC,KAAiB,EAAE,EAAE;IAChD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAa,aAAa;IAgBxB,YACE,MAAuB,EACvB,KAAa,EACb,MAAc,EACd,OAAyC,EACzC,KAAmB;;QAlBrB,MAAC,GAAW,CAAC,CAAC;QACd,MAAC,GAAW,CAAC,CAAC;QAmBZ,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAA,MAAM,CAAC,MAAM,mCAAI,MAAM,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,MAAA,MAAM,CAAC,IAAI,mCAAI,MAAM,CAAC;QAClC,IAAI,CAAC,MAAM,GAAG,IAAA,cAAK,EACjB,EAAE,EAEF,IAAA,mCAAa,EAAC,MAAM,CAAC,kBAAkB,CAAC,EACxC,iBAAiB,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,EAC3C,qBAAqB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,kBAAkB,CAAC,EACxE,MAAM,CACP,CAAC;QAEF,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,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;IAClB,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,QAAQ,EAAE;QAC5D,aAAa,GAAG,cAAc,CAAC,UAAU,CAAC;KAC3C;SAAM,IAAI,IAAI,KAAK,MAAM,EAAE;QAC1B,aAAa,GAAG,cAAc,CAAC,QAAQ,CAAC;KACzC;IAED,IAAI,eAAe,CAAC;IACpB,IAAI,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,QAAQ,EAAE;QAC3C,eAAe,GAAG,cAAc,CAAC,KAAK,CAAC;KACxC;SAAM,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,OAAO,EAAE;QAClD,eAAe,GAAG,cAAc,CAAC,KAAK,CAAC;KACxC;IACD,OAAO,IAAA,cAAK,EAAC,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;AAC9D,CAAC","file":"axis.js","sourcesContent":["import { degreeToRadian, isNil, isValidNumber, merge } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { ICellAxisOption } from '../../ts-types/component/axis';\nimport { LineAxis, type LineAxisAttributes } from '@visactor/vrender-components';\nimport { commonAxis, getAxisAttributes, getCommonAxis } from './get-axis-attributes';\nimport { isXAxis, isYAxis } from '../util/orient';\nimport type { IOrientType } from '../../ts-types/component/util';\nimport { BandAxisScale } from './band-scale';\nimport { registerDataSetInstanceParser, registerDataSetInstanceTransform } from '../util/register';\nimport type { Parser } from '@visactor/vdataset';\nimport { DataView } from '@visactor/vdataset';\nimport type { IBaseScale } from '@visactor/vscale';\nimport { ticks } from './../../vutil-extension-temp';\nimport { LinearAxisScale } from './linear-scale';\nimport { doOverlap } from './label-overlap';\nimport type { TableTheme } from '../../themes/theme';\n\nconst DEFAULT_BAND_INNER_PADDING = 0.1;\nconst DEFAULT_BAND_OUTER_PADDING = 0.3;\nconst scaleParser: Parser = (scale: IBaseScale) => {\n return scale;\n};\n\nexport class CartesianAxis {\n width: number;\n height: number;\n x: number = 0;\n y: number = 0;\n table: BaseTableAPI;\n option: ICellAxisOption;\n orient: IOrientType;\n visible: boolean;\n type: 'linear' | 'band' | 'point' | 'time' | 'log' | 'symlog';\n inverse: boolean;\n data?: any[];\n tickData: DataView;\n scale: BandAxisScale | LinearAxisScale;\n component: LineAxis;\n\n constructor(\n option: ICellAxisOption,\n width: number,\n height: number,\n padding: [number, number, number, number],\n table: BaseTableAPI\n ) {\n this.table = table;\n this.orient = option.orient ?? 'left';\n this.type = option.type ?? 'band';\n this.option = merge(\n {},\n // commonAxis,\n getCommonAxis(option.__vtableChartTheme),\n getTableAxisTheme(this.orient, table.theme),\n getChartSpecAxisTheme(this.orient, this.type, option.__vtableChartTheme),\n option\n );\n\n if (this.orient === 'left' || this.orient === 'right') {\n // const innerOffsetTop = this.option.innerOffset?.top ?? 0;\n // const innerOffsetBottom = this.option.innerOffset?.bottom ?? 0;\n const innerOffsetTop = 0;\n const innerOffsetBottom = 0;\n this.width = width;\n this.height = height - padding[2] - innerOffsetBottom;\n this.y = padding[0] + innerOffsetTop;\n } else if (this.orient === 'top' || this.orient === 'bottom') {\n // const innerOffsetLeft = this.option.innerOffset?.left ?? 0;\n // const innerOffsetRight = this.option.innerOffset?.right ?? 0;\n const innerOffsetLeft = 0;\n const innerOffsetRight = 0;\n this.width = width - padding[1] - innerOffsetRight;\n this.height = height;\n this.x = padding[3] + innerOffsetLeft;\n }\n\n this.visible = option.visible ?? true;\n this.inverse = 'inverse' in option ? !!option.inverse : false;\n if (option.type === 'band') {\n this.data = option.domain;\n }\n\n this.initScale();\n this.initData();\n this.createComponent();\n this.initEvent();\n }\n\n initScale() {\n const option = this.option as any;\n if (this.type === 'band' || this.type === 'point') {\n this.scale = new BandAxisScale();\n this.scale.bandPadding = option.bandPadding;\n this.scale.paddingInner = option.paddingInner;\n this.scale.paddingOuter = option.paddingOuter;\n this.scale.calcScales(DEFAULT_BAND_INNER_PADDING, DEFAULT_BAND_OUTER_PADDING); // 0.1 0.3\n this.scale.updateScaleDomain(this.data);\n this.updateScaleRange();\n } else if (this.type === 'linear' || this.type === 'time' || this.type === 'log' || this.type === 'symlog') {\n this.scale = new LinearAxisScale(this.type);\n this.scale.setExtraAttrFromSpec(\n option.nice,\n option.zero,\n option.range,\n option.expand,\n option.base,\n option.constant\n );\n this.scale.transformScaleDomain();\n this.scale.updateScaleDomain();\n this.updateScaleRange();\n }\n }\n\n initData() {\n registerDataSetInstanceParser(this.table._vDataSet, 'scale', scaleParser);\n registerDataSetInstanceTransform(this.table._vDataSet, 'ticks', ticks);\n\n const label = this.option.label || {};\n const tick = this.option.tick || {};\n const tickData = new DataView(this.table._vDataSet)\n .parse(this.scale._scale, {\n type: 'scale'\n })\n .transform(\n {\n type: 'ticks',\n options: {\n sampling: this.option.sampling !== false, // default do sampling\n tickCount: tick.tickCount,\n forceTickCount: tick.forceTickCount,\n tickStep: tick.tickStep,\n tickMode: tick.tickMode,\n noDecimals: tick.noDecimals,\n\n axisOrientType: this.orient,\n coordinateType: 'cartesian',\n\n labelStyle: label.style,\n labelFormatter: label.formatMethod,\n labelGap: label.minGap,\n\n labelLastVisible: label.lastVisible,\n labelFlush: label.flush\n }\n },\n false\n );\n this.tickData = tickData;\n\n this.computeData();\n }\n\n computeData(): void {\n this.tickData.reRunAllTransform();\n }\n\n initEvent() {\n // to be added\n }\n\n createComponent() {\n const axisStylrAttrs = getAxisAttributes(this.option);\n const attrs = this.getUpdateAttribute();\n attrs.verticalFactor = this.orient === 'top' || this.orient === 'right' ? -1 : 1;\n this.component = new LineAxis(merge({}, axisStylrAttrs, attrs));\n this.component.setAttributes(this.setLayoutStartPosition({ x: 0, y: 0 }));\n (this.component as any).originAxis = this;\n }\n\n resize(width: number, height: number) {\n this.width = width;\n this.height = height;\n this.updateScaleRange();\n this.computeData();\n const axisStylrAttrs = getAxisAttributes(this.option);\n const attrs = this.getUpdateAttribute();\n attrs.verticalFactor = this.orient === 'top' || this.orient === 'right' ? -1 : 1;\n this.component.setAttributes(merge({}, axisStylrAttrs, attrs));\n this.component.setAttributes(this.setLayoutStartPosition({ x: 0, y: 0 }));\n this.overlap();\n }\n\n overlap() {\n doOverlap(this.component, this);\n }\n\n getLayoutRect() {\n // const padding = getQuadProps(this.table.theme.bodyStyle.padding as number);\n return {\n // width: this.width - (this.orient === 'top' || this.orient === 'bottom' ? padding[3] + padding[1] : 0),\n // height: this.height - (this.orient === 'left' || this.orient === 'right' ? padding[0] + padding[2] : 0)\n width: this.width,\n height: this.height\n };\n }\n\n getUpdateAttribute() {\n // 获取更新的坐标轴属性\n const regionHeight = this.table.tableNoFrameHeight;\n const regionWidth = this.table.tableNoFrameWidth;\n\n const { width, height } = this.getLayoutRect();\n const isX = isXAxis(this.orient);\n const isY = isYAxis(this.orient);\n let end = { x: 0, y: 0 };\n let gridLength = 0;\n let axisLength = 0;\n if (isX) {\n end = { x: width, y: 0 };\n gridLength = regionHeight;\n axisLength = width;\n } else if (isY) {\n end = { x: 0, y: height };\n gridLength = regionWidth;\n axisLength = height;\n }\n const size = this.orient === 'top' || this.orient === 'bottom' ? height : width;\n const attrs: LineAxisAttributes = {\n start: { x: this.x, y: this.y },\n end,\n // grid: {\n // type: 'line',\n // length: gridLength,\n // visible: this.option.grid.visible\n // },\n title: {\n text: this.option.title.text as string,\n maxWidth: this._getTitleLimit(isX)\n },\n items: this.getLabelItems(axisLength),\n verticalLimitSize: size,\n verticalMinSize: size\n };\n return attrs;\n }\n\n getLabelItems(length: number) {\n return [\n this.tickData.latestData\n .map((obj: any) => {\n return {\n id: obj.value,\n label: obj.value,\n value: length === 0 ? 0 : this.scale.dataToPosition([obj.value]) / length,\n rawValue: obj.value\n };\n })\n .filter((entry: any) => entry.value >= 0 && entry.value <= 1)\n ];\n }\n\n updateScaleRange() {\n const right = this.option.innerOffset?.right ?? 0;\n const left = this.option.innerOffset?.left ?? 0;\n const top = this.option.innerOffset?.top ?? 0;\n const bottom = this.option.innerOffset?.bottom ?? 0;\n\n const { width, height } = this.getLayoutRect();\n const inverse = (this.option as any).inverse || false;\n let newRange: [number, number] = [0, 0];\n if (isXAxis(this.orient)) {\n if (isValidNumber(width)) {\n // newRange = inverse ? [width, 0] : [0, width];\n newRange = inverse ? [width - right, left] : [left, width - right];\n }\n } else {\n if (isValidNumber(height)) {\n // newRange = inverse ? [0, height] : [height, 0];\n newRange = inverse ? [top, height - bottom] : [height - bottom, top];\n }\n }\n\n this.scale.updateRange(newRange);\n }\n\n setLayoutStartPosition(pos: any) {\n let { x, y } = pos;\n\n if (isValidNumber(x)) {\n x += Number(this.orient === 'left') * this.getLayoutRect().width;\n }\n if (isValidNumber(y)) {\n y += Number(this.orient === 'top') * this.getLayoutRect().height;\n }\n\n return { x, y };\n // super.setLayoutStartPosition({ x, y });\n }\n\n private _getTitleLimit(isX: boolean) {\n if (this.option.title.visible && isNil(this.option.title.style?.maxLineWidth)) {\n let angle = this.option.title.style?.angle || 0;\n if (this.option.title?.autoRotate && isNil(this.option.title.angle)) {\n angle = this.option.orient === 'left' ? -90 : 90;\n }\n if (isX) {\n const width = this.getLayoutRect().width;\n const cosValue = Math.abs(Math.cos(degreeToRadian(angle)));\n // VRender 接收到的limit是考虑角度计算后的宽度\n // TODO:还需要考虑angle后,高度是否太高,综合计算一个limit,比如高度不能超过图表整体高度的1/4\n return cosValue < 1e-6 ? Infinity : width / cosValue;\n }\n const height = this.getLayoutRect().height;\n const sinValue = Math.abs(Math.sin(degreeToRadian(angle)));\n\n // TODO:还需要考虑angle后,宽度是否太宽,综合计算一个limit,比如宽度度不能超过图表整体宽度的1/4\n return sinValue < 1e-6 ? Infinity : height / sinValue;\n }\n\n return null;\n }\n\n getScale() {\n return this.scale._scale;\n }\n\n getDomainSpec() {\n return (this.scale as LinearAxisScale).domain;\n }\n}\n\nfunction getTableAxisTheme(orient: IOrientType, theme: TableTheme) {\n let directionStyle;\n if (orient === 'left') {\n directionStyle = theme.axisStyle.leftAxisStyle;\n } else if (orient === 'right') {\n directionStyle = theme.axisStyle.rightAxisStyle;\n } else if (orient === 'top') {\n directionStyle = theme.axisStyle.topAxisStyle;\n } else if (orient === 'bottom') {\n directionStyle = theme.axisStyle.bottomAxisStyle;\n }\n return merge({}, theme.axisStyle.defaultAxisStyle, directionStyle);\n}\n\nfunction getChartSpecAxisTheme(\n orient: IOrientType,\n type: 'linear' | 'band' | 'point' | 'time' | 'log' | 'symlog',\n chartSpecTheme?: any\n) {\n if (!chartSpecTheme) {\n return {};\n }\n const axisTheme = chartSpecTheme.axis;\n let axisTypeTheme;\n if (type === 'linear' || type === 'log' || type === 'symlog') {\n axisTypeTheme = chartSpecTheme.axisLinear;\n } else if (type === 'band') {\n axisTypeTheme = chartSpecTheme.axisBand;\n }\n\n let axisOrientTheme;\n if (orient === 'top' || orient === 'bottom') {\n axisOrientTheme = chartSpecTheme.axisX;\n } else if (orient === 'left' || orient === 'right') {\n axisOrientTheme = chartSpecTheme.axisY;\n }\n return merge({}, axisTheme, axisTypeTheme, axisOrientTheme);\n}\n"]}
1
+ {"version":3,"sources":["../src/components/axis/axis.ts"],"names":[],"mappings":";;;AAAA,6CAA+E;AAG/E,qEAAiF;AACjF,+DAAyE;AACzE,2CAAkD;AAElD,6CAA6C;AAC7C,+CAAmG;AAEnG,iDAAuD;AAEvD,6CAAwC;AACxC,iDAAiD;AACjD,mDAA4C;AAG5C,MAAM,0BAA0B,GAAG,GAAG,CAAC;AACvC,MAAM,0BAA0B,GAAG,GAAG,CAAC;AACvC,MAAM,WAAW,GAAW,CAAC,KAAiB,EAAE,EAAE;IAChD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAYF,MAAa,aAAa;IAgBxB,YACE,MAAuB,EACvB,KAAa,EACb,MAAc,EACd,OAAyC,EACzC,KAAmB;;QAlBrB,MAAC,GAAW,CAAC,CAAC;QACd,MAAC,GAAW,CAAC,CAAC;QAmBZ,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAA,MAA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AAO,EAAE;QAC7B,cAAc,GAAG,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;KACjD;SAAM,IAAI,MAAM,KAAK,KAAK,EAAE;QAC3B,cAAc,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC;KAC/C;SAAM,IAAI,MAAM,KAAK,QAAQ,EAAE;QAC9B,cAAc,GAAG,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC;KAClD;IACD,OAAO,IAAA,cAAK,EAAC,EAAE,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,qBAAqB,CAC5B,MAAmB,EACnB,IAA6D,EAC7D,cAAoB;IAEpB,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,EAAE,CAAC;KACX;IACD,MAAM,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC;IACtC,IAAI,aAAa,CAAC;IAClB,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,QAAQ,EAAE;QAC5D,aAAa,GAAG,cAAc,CAAC,UAAU,CAAC;KAC3C;SAAM,IAAI,IAAI,KAAK,MAAM,EAAE;QAC1B,aAAa,GAAG,cAAc,CAAC,QAAQ,CAAC;KACzC;IAED,IAAI,eAAe,CAAC;IACpB,IAAI,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,QAAQ,EAAE;QAC3C,eAAe,GAAG,cAAc,CAAC,KAAK,CAAC;KACxC;SAAM,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,OAAO,EAAE;QAClD,eAAe,GAAG,cAAc,CAAC,KAAK,CAAC;KACxC;IACD,OAAO,IAAA,cAAK,EAAC,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;AAC9D,CAAC","file":"axis.js","sourcesContent":["import { degreeToRadian, isNil, isValidNumber, merge } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { ICellAxisOption } from '../../ts-types/component/axis';\nimport { LineAxis, type LineAxisAttributes } from '@visactor/vrender-components';\nimport { getAxisAttributes, getCommonAxis } from './get-axis-attributes';\nimport { isXAxis, isYAxis } from '../util/orient';\nimport type { IOrientType } from '../../ts-types/component/util';\nimport { BandAxisScale } from './band-scale';\nimport { registerDataSetInstanceParser, registerDataSetInstanceTransform } from '../util/register';\nimport type { Parser } from '@visactor/vdataset';\nimport { DataSet, DataView } from '@visactor/vdataset';\nimport type { IBaseScale } from '@visactor/vscale';\nimport { ticks } from './../../vrender';\nimport { LinearAxisScale } from './linear-scale';\nimport { doOverlap } from './label-overlap';\nimport type { TableTheme } from '../../themes/theme';\n\nconst DEFAULT_BAND_INNER_PADDING = 0.1;\nconst DEFAULT_BAND_OUTER_PADDING = 0.3;\nconst scaleParser: Parser = (scale: IBaseScale) => {\n return scale;\n};\n\nexport interface ICartesianAxis {\n new (\n option: ICellAxisOption,\n width: number,\n height: number,\n padding: [number, number, number, number],\n table: BaseTableAPI\n ): CartesianAxis;\n}\n\nexport class CartesianAxis {\n width: number;\n height: number;\n x: number = 0;\n y: number = 0;\n table: BaseTableAPI;\n option: ICellAxisOption;\n orient: IOrientType;\n visible: boolean;\n type: 'linear' | 'band' | 'point' | 'time' | 'log' | 'symlog';\n inverse: boolean;\n data?: any[];\n tickData: DataView;\n scale: BandAxisScale | LinearAxisScale;\n component: LineAxis;\n\n constructor(\n option: ICellAxisOption,\n width: number,\n height: number,\n padding: [number, number, number, number],\n table: BaseTableAPI\n ) {\n this.table = table;\n this.orient = option.orient ?? 'left';\n this.type = option.type ?? 'band';\n this.option = merge(\n {},\n // commonAxis,\n getCommonAxis(option.__vtableChartTheme),\n getTableAxisTheme(this.orient, table.theme),\n getChartSpecAxisTheme(this.orient, this.type, option.__vtableChartTheme),\n option\n );\n\n if (this.orient === 'left' || this.orient === 'right') {\n // const innerOffsetTop = this.option.innerOffset?.top ?? 0;\n // const innerOffsetBottom = this.option.innerOffset?.bottom ?? 0;\n const innerOffsetTop = 0;\n const innerOffsetBottom = 0;\n this.width = width;\n this.height = height - padding[2] - innerOffsetBottom;\n this.y = padding[0] + innerOffsetTop;\n } else if (this.orient === 'top' || this.orient === 'bottom') {\n // const innerOffsetLeft = this.option.innerOffset?.left ?? 0;\n // const innerOffsetRight = this.option.innerOffset?.right ?? 0;\n const innerOffsetLeft = 0;\n const innerOffsetRight = 0;\n this.width = width - padding[1] - innerOffsetRight;\n this.height = height;\n this.x = padding[3] + innerOffsetLeft;\n }\n\n this.visible = option.visible ?? true;\n this.inverse = 'inverse' in option ? !!option.inverse : false;\n if (option.type === 'band') {\n this.data = option.domain;\n }\n\n this.initScale();\n this.initData();\n this.createComponent();\n this.initEvent();\n }\n\n initScale() {\n const option = this.option as any;\n if (this.type === 'band' || this.type === 'point') {\n this.scale = new BandAxisScale();\n this.scale.bandPadding = option.bandPadding;\n this.scale.paddingInner = option.paddingInner;\n this.scale.paddingOuter = option.paddingOuter;\n this.scale.calcScales(DEFAULT_BAND_INNER_PADDING, DEFAULT_BAND_OUTER_PADDING); // 0.1 0.3\n this.scale.updateScaleDomain(this.data);\n this.updateScaleRange();\n } else if (this.type === 'linear' || this.type === 'time' || this.type === 'log' || this.type === 'symlog') {\n this.scale = new LinearAxisScale(this.type);\n this.scale.setExtraAttrFromSpec(\n option.nice,\n option.zero,\n option.range,\n option.expand,\n option.base,\n option.constant\n );\n this.scale.transformScaleDomain();\n this.scale.updateScaleDomain();\n this.updateScaleRange();\n }\n }\n\n initData() {\n if (!this.table._vDataSet) {\n this.table._vDataSet = new DataSet();\n }\n\n registerDataSetInstanceParser(this.table._vDataSet, 'scale', scaleParser);\n registerDataSetInstanceTransform(this.table._vDataSet, 'ticks', ticks);\n\n const label = this.option.label || {};\n const tick = this.option.tick || {};\n\n const tickData = new DataView(this.table._vDataSet)\n .parse(this.scale._scale, {\n type: 'scale'\n })\n .transform(\n {\n type: 'ticks',\n options: {\n sampling: this.option.sampling !== false, // default do sampling\n tickCount: tick.tickCount,\n forceTickCount: tick.forceTickCount,\n tickStep: tick.tickStep,\n tickMode: tick.tickMode,\n noDecimals: tick.noDecimals,\n\n axisOrientType: this.orient,\n coordinateType: 'cartesian',\n\n labelStyle: label.style,\n labelFormatter: label.formatMethod,\n labelGap: label.minGap,\n\n labelLastVisible: label.lastVisible,\n labelFlush: label.flush\n }\n },\n false\n );\n this.tickData = tickData;\n\n this.computeData();\n }\n\n computeData(): void {\n this.tickData.reRunAllTransform();\n }\n\n initEvent() {\n // to be added\n }\n\n createComponent() {\n const axisStylrAttrs = getAxisAttributes(this.option);\n const attrs = this.getUpdateAttribute();\n attrs.verticalFactor = this.orient === 'top' || this.orient === 'right' ? -1 : 1;\n this.component = new LineAxis(merge({}, axisStylrAttrs, attrs));\n this.component.setAttributes(this.setLayoutStartPosition({ x: 0, y: 0 }));\n (this.component as any).originAxis = this;\n }\n\n resize(width: number, height: number) {\n this.width = width;\n this.height = height;\n this.updateScaleRange();\n this.computeData();\n const axisStylrAttrs = getAxisAttributes(this.option);\n const attrs = this.getUpdateAttribute();\n attrs.verticalFactor = this.orient === 'top' || this.orient === 'right' ? -1 : 1;\n this.component.setAttributes(merge({}, axisStylrAttrs, attrs));\n this.component.setAttributes(this.setLayoutStartPosition({ x: 0, y: 0 }));\n this.overlap();\n }\n\n overlap() {\n doOverlap(this.component, this);\n }\n\n getLayoutRect() {\n // const padding = getQuadProps(this.table.theme.bodyStyle.padding as number);\n return {\n // width: this.width - (this.orient === 'top' || this.orient === 'bottom' ? padding[3] + padding[1] : 0),\n // height: this.height - (this.orient === 'left' || this.orient === 'right' ? padding[0] + padding[2] : 0)\n width: this.width,\n height: this.height\n };\n }\n\n getUpdateAttribute() {\n // 获取更新的坐标轴属性\n const regionHeight = this.table.tableNoFrameHeight;\n const regionWidth = this.table.tableNoFrameWidth;\n\n const { width, height } = this.getLayoutRect();\n const isX = isXAxis(this.orient);\n const isY = isYAxis(this.orient);\n let end = { x: 0, y: 0 };\n let gridLength = 0;\n let axisLength = 0;\n if (isX) {\n end = { x: width, y: 0 };\n gridLength = regionHeight;\n axisLength = width;\n } else if (isY) {\n end = { x: 0, y: height };\n gridLength = regionWidth;\n axisLength = height;\n }\n const size = this.orient === 'top' || this.orient === 'bottom' ? height : width;\n const attrs: LineAxisAttributes = {\n start: { x: this.x, y: this.y },\n end,\n // grid: {\n // type: 'line',\n // length: gridLength,\n // visible: this.option.grid.visible\n // },\n title: {\n text: this.option.title.text as string,\n maxWidth: this._getTitleLimit(isX)\n },\n items: this.getLabelItems(axisLength),\n verticalLimitSize: size,\n verticalMinSize: size\n };\n return attrs;\n }\n\n getLabelItems(length: number) {\n return [\n this.tickData.latestData\n .map((obj: any) => {\n return {\n id: obj.value,\n label: obj.value,\n value: length === 0 ? 0 : this.scale.dataToPosition([obj.value]) / length,\n rawValue: obj.value\n };\n })\n .filter((entry: any) => entry.value >= 0 && entry.value <= 1)\n ];\n }\n\n updateScaleRange() {\n const right = this.option.innerOffset?.right ?? 0;\n const left = this.option.innerOffset?.left ?? 0;\n const top = this.option.innerOffset?.top ?? 0;\n const bottom = this.option.innerOffset?.bottom ?? 0;\n\n const { width, height } = this.getLayoutRect();\n const inverse = (this.option as any).inverse || false;\n let newRange: [number, number] = [0, 0];\n if (isXAxis(this.orient)) {\n if (isValidNumber(width)) {\n // newRange = inverse ? [width, 0] : [0, width];\n newRange = inverse ? [width - right, left] : [left, width - right];\n }\n } else {\n if (isValidNumber(height)) {\n // newRange = inverse ? [0, height] : [height, 0];\n newRange = inverse ? [top, height - bottom] : [height - bottom, top];\n }\n }\n\n this.scale.updateRange(newRange);\n }\n\n setLayoutStartPosition(pos: any) {\n let { x, y } = pos;\n\n if (isValidNumber(x)) {\n x += Number(this.orient === 'left') * this.getLayoutRect().width;\n }\n if (isValidNumber(y)) {\n y += Number(this.orient === 'top') * this.getLayoutRect().height;\n }\n\n return { x, y };\n // super.setLayoutStartPosition({ x, y });\n }\n\n private _getTitleLimit(isX: boolean) {\n if (this.option.title.visible && isNil(this.option.title.style?.maxLineWidth)) {\n let angle = this.option.title.style?.angle || 0;\n if (this.option.title?.autoRotate && isNil(this.option.title.angle)) {\n angle = this.option.orient === 'left' ? -90 : 90;\n }\n if (isX) {\n const width = this.getLayoutRect().width;\n const cosValue = Math.abs(Math.cos(degreeToRadian(angle)));\n // VRender 接收到的limit是考虑角度计算后的宽度\n // TODO:还需要考虑angle后,高度是否太高,综合计算一个limit,比如高度不能超过图表整体高度的1/4\n return cosValue < 1e-6 ? Infinity : width / cosValue;\n }\n const height = this.getLayoutRect().height;\n const sinValue = Math.abs(Math.sin(degreeToRadian(angle)));\n\n // TODO:还需要考虑angle后,宽度是否太宽,综合计算一个limit,比如宽度度不能超过图表整体宽度的1/4\n return sinValue < 1e-6 ? Infinity : height / sinValue;\n }\n\n return null;\n }\n\n getScale() {\n return this.scale._scale;\n }\n\n getDomainSpec() {\n return (this.scale as LinearAxisScale).domain;\n }\n}\n\nfunction getTableAxisTheme(orient: IOrientType, theme: TableTheme) {\n let directionStyle;\n if (orient === 'left') {\n directionStyle = theme.axisStyle.leftAxisStyle;\n } else if (orient === 'right') {\n directionStyle = theme.axisStyle.rightAxisStyle;\n } else if (orient === 'top') {\n directionStyle = theme.axisStyle.topAxisStyle;\n } else if (orient === 'bottom') {\n directionStyle = theme.axisStyle.bottomAxisStyle;\n }\n return merge({}, theme.axisStyle.defaultAxisStyle, directionStyle);\n}\n\nfunction getChartSpecAxisTheme(\n orient: IOrientType,\n type: 'linear' | 'band' | 'point' | 'time' | 'log' | 'symlog',\n chartSpecTheme?: any\n) {\n if (!chartSpecTheme) {\n return {};\n }\n const axisTheme = chartSpecTheme.axis;\n let axisTypeTheme;\n if (type === 'linear' || type === 'log' || type === 'symlog') {\n axisTypeTheme = chartSpecTheme.axisLinear;\n } else if (type === 'band') {\n axisTypeTheme = chartSpecTheme.axisBand;\n }\n\n let axisOrientTheme;\n if (orient === 'top' || orient === 'bottom') {\n axisOrientTheme = chartSpecTheme.axisX;\n } else if (orient === 'left' || orient === 'right') {\n axisOrientTheme = chartSpecTheme.axisY;\n }\n return merge({}, axisTheme, axisTypeTheme, axisOrientTheme);\n}\n"]}
@@ -1,4 +1,6 @@
1
1
  import type { BaseTableAPI } from '../../ts-types/base-table';
2
2
  import type { ICellAxisOption } from '../../ts-types/component/axis';
3
+ export type ComputeAxisComponentWidth = (config: ICellAxisOption, table: BaseTableAPI) => number;
4
+ export type ComputeAxisComponentHeight = (config: ICellAxisOption, table: BaseTableAPI) => number;
3
5
  export declare function computeAxisComponentWidth(config: ICellAxisOption, table: BaseTableAPI): number;
4
6
  export declare function computeAxisComponentHeight(config: ICellAxisOption, table: BaseTableAPI): number;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/axis/get-axis-component-size.ts"],"names":[],"mappings":";;;AAAA,6CAA4D;AAG5D,+DAAqG;AAOrG,SAAgB,yBAAyB,CAAC,MAAuB,EAAE,KAAmB;;IACpF,MAAM,SAAS,GAAG,IAAA,cAAK,EAAC,EAAE,EAAE,gCAAU,EAAE,MAAM,CAAC,CAAC;IAEhD,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,SAAS,CAAC,IAAI,CAAC,OAAO,KAAK,KAAK,EAAE;QACpC,SAAS,GAAG,MAAA,SAAS,CAAC,IAAI,CAAC,KAAK,mCAAI,CAAC,CAAC;KACvC;IAGD,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,IAAI,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE;QAC3B,IAAI,SAAS,CAAC,IAAI,KAAK,MAAM,EAAE;YAC7B,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;YAChC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAY,EAAE,EAAE;;gBAC9B,IAAI,SAAS,CAAC,KAAK,CAAC,YAAY,EAAE;oBAChC,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;iBAC3C;gBACD,MAAM,EA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,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;KACnD,CAAC;IAEF,MAAM,MAAM,GAAG;QACb,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;QAClE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;QAClE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;QAClE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;KACnE,CAAC;IAEF,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI;QAChC,MAAM,EAAE,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI;KAClC,CAAC;AACJ,CAAC","file":"get-axis-component-size.js","sourcesContent":["import { isArray, isString, merge } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { ICellAxisOption } from '../../ts-types/component/axis';\nimport { DEFAULT_TEXT_FONT_FAMILY, DEFAULT_TEXT_FONT_SIZE, commonAxis } from './get-axis-attributes';\n\n/**\n * @description: compuational vertical axis width\n * @param {ICellAxisOption} config\n * @return {*}\n */\nexport function computeAxisComponentWidth(config: ICellAxisOption, table: BaseTableAPI) {\n const attribute = merge({}, commonAxis, config);\n // tick\n let tickWidth = 0;\n if (attribute.tick.visible !== false) {\n tickWidth = attribute.tick.width ?? 4;\n }\n\n // text\n let labelWidth = 0;\n if (attribute.label.visible) {\n if (attribute.type === 'band') {\n const domain = attribute.domain;\n domain.forEach((text: string) => {\n if (attribute.label.formatMethod) {\n text = attribute.label.formatMethod(text);\n }\n const { width, height } = table.measureText(text, {\n fontSize: attribute.label?.style?.fontSize ?? DEFAULT_TEXT_FONT_SIZE,\n fontWeight: attribute.label?.style?.fontWeight ?? 'normal',\n fontFamily: attribute.label?.style?.fontFamily ?? DEFAULT_TEXT_FONT_FAMILY\n });\n const widthLimit = attribute.label?.style?.maxLineWidth || Infinity;\n const angel =\n (attribute.label?.style?.angle ?? 0) + (attribute.label?.style?.direction === 'vertical' ? 90 : 0);\n labelWidth = Math.max(labelWidth, getSizeAfterResize(Math.min(width, widthLimit), height, angel).width);\n });\n } else {\n let ticks: string[];\n if (isArray((config as any).__ticksForVTable)) {\n ticks = (config as any).__ticksForVTable;\n } else {\n const range = attribute.range;\n const minNumber = Math.abs(range.min) > 1 ? Math.round(range.min) : range.min;\n const maxNumber = Math.abs(range.max) > 1 ? Math.round(range.max) : range.max;\n // abs>1取整保留两位有效数字,abs<1保留一位有效数字\n const minString = formatDecimal(minNumber);\n const maxString = formatDecimal(maxNumber);\n // 这里测量的是预估的最大最小range,与实际现实的label可能不同\n ticks = [minString, maxString];\n }\n ticks.forEach(text => {\n if (attribute.label.formatMethod) {\n text = attribute.label.formatMethod(text);\n }\n const { width, height } = table.measureText(text, {\n fontSize: attribute.label?.style?.fontSize ?? DEFAULT_TEXT_FONT_SIZE,\n fontWeight: attribute.label?.style?.fontWeight ?? 'normal',\n fontFamily: attribute.label?.style?.fontFamily ?? DEFAULT_TEXT_FONT_FAMILY\n });\n const widthLimit = attribute.label?.style?.maxLineWidth || Infinity;\n const angle =\n (attribute.label?.style?.angle ?? 0) + (attribute.label?.style?.direction === 'vertical' ? 90 : 0);\n labelWidth = Math.max(labelWidth, getSizeAfterResize(Math.min(width, widthLimit), height, angle).width);\n });\n }\n labelWidth += attribute.label.space ?? 4;\n }\n\n // title\n let titleWidth = 0;\n // align with vrender-component, use isString()\n if (attribute.title.visible && isString(attribute.title.text)) {\n const { width, height } = table.measureText(attribute.title.text, {\n fontSize: attribute.title?.style?.fontSize ?? DEFAULT_TEXT_FONT_SIZE,\n fontWeight: attribute.title?.style?.fontWeight ?? 'normal',\n fontFamily: attribute.title?.style?.fontFamily ?? DEFAULT_TEXT_FONT_FAMILY\n });\n const widthLimit = attribute.label?.style?.maxLineWidth || Infinity;\n const size = getSizeAfterResize(Math.min(width, widthLimit), height, attribute.title?.style?.angle);\n if ((config.orient === 'left' || config.orient === 'right') && attribute.title.autoRotate) {\n titleWidth = size.height;\n } else {\n titleWidth = size.width;\n }\n titleWidth += attribute.title.space ?? 4;\n }\n\n return tickWidth + labelWidth + titleWidth + 1; // 2 is buffer\n}\n\n/**\n * @description: compuational horizontal axis height\n * @param {ICellAxisOption} config\n * @return {*}\n */\nexport function computeAxisComponentHeight(config: ICellAxisOption, table: BaseTableAPI) {\n const attribute = merge({}, commonAxis, config);\n // tick\n let tickHeight = 0;\n if (attribute.tick.visible !== false) {\n tickHeight = attribute.tick.width ?? 4;\n }\n\n // text\n let labelHeight = 0;\n if (attribute.label.visible) {\n if (attribute.type === 'band') {\n const domain = attribute.domain;\n domain.forEach((text: string) => {\n if (attribute.label.formatMethod) {\n text = attribute.label.formatMethod(text);\n }\n const { width, height } = table.measureText(text, {\n fontSize: attribute.label?.style?.fontSize ?? DEFAULT_TEXT_FONT_SIZE,\n fontWeight: attribute.label?.style?.fontWeight ?? 'normal',\n fontFamily: attribute.label?.style?.fontFamily ?? DEFAULT_TEXT_FONT_FAMILY\n });\n const widthLimit = attribute.label?.style?.maxLineWidth || Infinity;\n const angle =\n (attribute.label?.style?.angle ?? 0) + (attribute.label?.style?.direction === 'vertical' ? 90 : 0);\n labelHeight = Math.max(labelHeight, getSizeAfterResize(Math.min(width, widthLimit), height, angle).height);\n });\n } else {\n let ticks: string[];\n if (isArray((config as any).__ticksForVTable)) {\n ticks = (config as any).__ticksForVTable;\n } else {\n const range = attribute.range;\n const minNumber = Math.abs(range.min) > 1 ? Math.round(range.min) : range.min;\n const maxNumber = Math.abs(range.max) > 1 ? Math.round(range.max) : range.max;\n // abs>1取整保留两位有效数字,abs<1保留一位有效数字\n const minString = formatDecimal(minNumber);\n const maxString = formatDecimal(maxNumber);\n // 这里测量的是预估的最大最小range,与实际现实的label可能不同\n ticks = [minString, maxString];\n }\n ticks.forEach(text => {\n if (attribute.label.formatMethod) {\n text = attribute.label.formatMethod(text);\n }\n const { width, height } = table.measureText(text, {\n fontSize: attribute.label?.style?.fontSize ?? DEFAULT_TEXT_FONT_SIZE,\n fontWeight: attribute.label?.style?.fontWeight ?? 'normal',\n fontFamily: attribute.label?.style?.fontFamily ?? DEFAULT_TEXT_FONT_FAMILY\n });\n const widthLimit = attribute.label?.style?.maxLineWidth || Infinity;\n const angle =\n (attribute.label?.style?.angle ?? 0) + (attribute.label?.style?.direction === 'vertical' ? 90 : 0);\n labelHeight = Math.max(labelHeight, getSizeAfterResize(Math.min(width, widthLimit), height, angle).height);\n });\n }\n labelHeight += attribute.label.space ?? 4;\n }\n\n // title\n let titleHeight = 0;\n if (attribute.title.visible && attribute.title.text) {\n const { width, height } = table.measureText(attribute.title.text, {\n fontSize: attribute.title?.style?.fontSize ?? DEFAULT_TEXT_FONT_SIZE,\n fontWeight: attribute.title?.style?.fontWeight ?? 'normal',\n fontFamily: attribute.title?.style?.fontFamily ?? DEFAULT_TEXT_FONT_FAMILY\n });\n const widthLimit = attribute.label?.style?.maxLineWidth || Infinity;\n const size = getSizeAfterResize(Math.min(width, widthLimit), height, attribute.title?.style?.angle);\n if ((config.orient === 'bottom' || config.orient === 'top') && attribute.title.autoRotate) {\n titleHeight = size.width;\n } else {\n titleHeight = size.height;\n }\n titleHeight += attribute.title.space ?? 4;\n }\n\n return tickHeight + labelHeight + titleHeight + 1; // 2 is buffer\n}\n\n// 保留一位有效数字\nfunction formatDecimal(number: number) {\n if (typeof number !== 'number') {\n number = Number(number);\n }\n\n return Number(number.toPrecision(1)).toString(); // 避免科学计数法\n}\n\n// 计算旋转后的size\nfunction getSizeAfterResize(width: number, height: number, angle = 0) {\n const theta = (angle * Math.PI) / 180; // 角度转为弧度\n const p1 = { x: -width / 2, y: -height / 2 };\n const p2 = { x: width / 2, y: -height / 2 };\n const p3 = { x: width / 2, y: height / 2 };\n const p4 = { x: -width / 2, y: height / 2 };\n\n const p1Rotated = {\n x: p1.x * Math.cos(theta) - p1.y * Math.sin(theta),\n y: p1.x * Math.sin(theta) + p1.y * Math.cos(theta)\n };\n const p2Rotated = {\n x: p2.x * Math.cos(theta) - p2.y * Math.sin(theta),\n y: p2.x * Math.sin(theta) + p2.y * Math.cos(theta)\n };\n const p3Rotated = {\n x: p3.x * Math.cos(theta) - p3.y * Math.sin(theta),\n y: p3.x * Math.sin(theta) + p3.y * Math.cos(theta)\n };\n const p4Rotated = {\n x: p4.x * Math.cos(theta) - p4.y * Math.sin(theta),\n y: p4.x * Math.sin(theta) + p4.y * Math.cos(theta)\n };\n\n const bounds = {\n minX: Math.min(p1Rotated.x, p2Rotated.x, p3Rotated.x, p4Rotated.x),\n maxX: Math.max(p1Rotated.x, p2Rotated.x, p3Rotated.x, p4Rotated.x),\n minY: Math.min(p1Rotated.y, p2Rotated.y, p3Rotated.y, p4Rotated.y),\n maxY: Math.max(p1Rotated.y, p2Rotated.y, p3Rotated.y, p4Rotated.y)\n };\n\n return {\n width: bounds.maxX - bounds.minX,\n height: bounds.maxY - bounds.minY\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/components/axis/get-axis-component-size.ts"],"names":[],"mappings":";;;AAAA,6CAA4D;AAG5D,+DAAqG;AASrG,SAAgB,yBAAyB,CAAC,MAAuB,EAAE,KAAmB;;IACpF,MAAM,SAAS,GAAG,IAAA,cAAK,EAAC,EAAE,EAAE,gCAAU,EAAE,MAAM,CAAC,CAAC;IAEhD,IAAI,SAAS,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E,CAAC;IAEF,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI;QAChC,MAAM,EAAE,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI;KAClC,CAAC;AACJ,CAAC","file":"get-axis-component-size.js","sourcesContent":["import { isArray, isString, merge } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { ICellAxisOption } from '../../ts-types/component/axis';\nimport { DEFAULT_TEXT_FONT_FAMILY, DEFAULT_TEXT_FONT_SIZE, commonAxis } from './get-axis-attributes';\n\nexport type ComputeAxisComponentWidth = (config: ICellAxisOption, table: BaseTableAPI) => number;\nexport type ComputeAxisComponentHeight = (config: ICellAxisOption, table: BaseTableAPI) => number;\n/**\n * @description: compuational vertical axis width\n * @param {ICellAxisOption} config\n * @return {*}\n */\nexport function computeAxisComponentWidth(config: ICellAxisOption, table: BaseTableAPI) {\n const attribute = merge({}, commonAxis, config);\n // tick\n let tickWidth = 0;\n if (attribute.tick.visible !== false) {\n tickWidth = attribute.tick.width ?? 4;\n }\n\n // text\n let labelWidth = 0;\n if (attribute.label.visible) {\n if (attribute.type === 'band') {\n const domain = attribute.domain;\n domain.forEach((text: string) => {\n if (attribute.label.formatMethod) {\n text = attribute.label.formatMethod(text);\n }\n const { width, height } = table.measureText(text, {\n fontSize: attribute.label?.style?.fontSize ?? DEFAULT_TEXT_FONT_SIZE,\n fontWeight: attribute.label?.style?.fontWeight ?? 'normal',\n fontFamily: attribute.label?.style?.fontFamily ?? DEFAULT_TEXT_FONT_FAMILY\n });\n const widthLimit = attribute.label?.style?.maxLineWidth || Infinity;\n const angel =\n (attribute.label?.style?.angle ?? 0) + (attribute.label?.style?.direction === 'vertical' ? 90 : 0);\n labelWidth = Math.max(labelWidth, getSizeAfterResize(Math.min(width, widthLimit), height, angel).width);\n });\n } else {\n let ticks: string[];\n if (isArray((config as any).__ticksForVTable)) {\n ticks = (config as any).__ticksForVTable;\n } else {\n const range = attribute.range;\n const minNumber = Math.abs(range.min) > 1 ? Math.round(range.min) : range.min;\n const maxNumber = Math.abs(range.max) > 1 ? Math.round(range.max) : range.max;\n // abs>1取整保留两位有效数字,abs<1保留一位有效数字\n const minString = formatDecimal(minNumber);\n const maxString = formatDecimal(maxNumber);\n // 这里测量的是预估的最大最小range,与实际现实的label可能不同\n ticks = [minString, maxString];\n }\n ticks.forEach(text => {\n if (attribute.label.formatMethod) {\n text = attribute.label.formatMethod(text);\n }\n const { width, height } = table.measureText(text, {\n fontSize: attribute.label?.style?.fontSize ?? DEFAULT_TEXT_FONT_SIZE,\n fontWeight: attribute.label?.style?.fontWeight ?? 'normal',\n fontFamily: attribute.label?.style?.fontFamily ?? DEFAULT_TEXT_FONT_FAMILY\n });\n const widthLimit = attribute.label?.style?.maxLineWidth || Infinity;\n const angle =\n (attribute.label?.style?.angle ?? 0) + (attribute.label?.style?.direction === 'vertical' ? 90 : 0);\n labelWidth = Math.max(labelWidth, getSizeAfterResize(Math.min(width, widthLimit), height, angle).width);\n });\n }\n labelWidth += attribute.label.space ?? 4;\n }\n\n // title\n let titleWidth = 0;\n // align with vrender-component, use isString()\n if (attribute.title.visible && isString(attribute.title.text)) {\n const { width, height } = table.measureText(attribute.title.text, {\n fontSize: attribute.title?.style?.fontSize ?? DEFAULT_TEXT_FONT_SIZE,\n fontWeight: attribute.title?.style?.fontWeight ?? 'normal',\n fontFamily: attribute.title?.style?.fontFamily ?? DEFAULT_TEXT_FONT_FAMILY\n });\n const widthLimit = attribute.label?.style?.maxLineWidth || Infinity;\n const size = getSizeAfterResize(Math.min(width, widthLimit), height, attribute.title?.style?.angle);\n if ((config.orient === 'left' || config.orient === 'right') && attribute.title.autoRotate) {\n titleWidth = size.height;\n } else {\n titleWidth = size.width;\n }\n titleWidth += attribute.title.space ?? 4;\n }\n\n return tickWidth + labelWidth + titleWidth + 1; // 2 is buffer\n}\n\n/**\n * @description: compuational horizontal axis height\n * @param {ICellAxisOption} config\n * @return {*}\n */\nexport function computeAxisComponentHeight(config: ICellAxisOption, table: BaseTableAPI) {\n const attribute = merge({}, commonAxis, config);\n // tick\n let tickHeight = 0;\n if (attribute.tick.visible !== false) {\n tickHeight = attribute.tick.width ?? 4;\n }\n\n // text\n let labelHeight = 0;\n if (attribute.label.visible) {\n if (attribute.type === 'band') {\n const domain = attribute.domain;\n domain.forEach((text: string) => {\n if (attribute.label.formatMethod) {\n text = attribute.label.formatMethod(text);\n }\n const { width, height } = table.measureText(text, {\n fontSize: attribute.label?.style?.fontSize ?? DEFAULT_TEXT_FONT_SIZE,\n fontWeight: attribute.label?.style?.fontWeight ?? 'normal',\n fontFamily: attribute.label?.style?.fontFamily ?? DEFAULT_TEXT_FONT_FAMILY\n });\n const widthLimit = attribute.label?.style?.maxLineWidth || Infinity;\n const angle =\n (attribute.label?.style?.angle ?? 0) + (attribute.label?.style?.direction === 'vertical' ? 90 : 0);\n labelHeight = Math.max(labelHeight, getSizeAfterResize(Math.min(width, widthLimit), height, angle).height);\n });\n } else {\n let ticks: string[];\n if (isArray((config as any).__ticksForVTable)) {\n ticks = (config as any).__ticksForVTable;\n } else {\n const range = attribute.range;\n const minNumber = Math.abs(range.min) > 1 ? Math.round(range.min) : range.min;\n const maxNumber = Math.abs(range.max) > 1 ? Math.round(range.max) : range.max;\n // abs>1取整保留两位有效数字,abs<1保留一位有效数字\n const minString = formatDecimal(minNumber);\n const maxString = formatDecimal(maxNumber);\n // 这里测量的是预估的最大最小range,与实际现实的label可能不同\n ticks = [minString, maxString];\n }\n ticks.forEach(text => {\n if (attribute.label.formatMethod) {\n text = attribute.label.formatMethod(text);\n }\n const { width, height } = table.measureText(text, {\n fontSize: attribute.label?.style?.fontSize ?? DEFAULT_TEXT_FONT_SIZE,\n fontWeight: attribute.label?.style?.fontWeight ?? 'normal',\n fontFamily: attribute.label?.style?.fontFamily ?? DEFAULT_TEXT_FONT_FAMILY\n });\n const widthLimit = attribute.label?.style?.maxLineWidth || Infinity;\n const angle =\n (attribute.label?.style?.angle ?? 0) + (attribute.label?.style?.direction === 'vertical' ? 90 : 0);\n labelHeight = Math.max(labelHeight, getSizeAfterResize(Math.min(width, widthLimit), height, angle).height);\n });\n }\n labelHeight += attribute.label.space ?? 4;\n }\n\n // title\n let titleHeight = 0;\n if (attribute.title.visible && attribute.title.text) {\n const { width, height } = table.measureText(attribute.title.text, {\n fontSize: attribute.title?.style?.fontSize ?? DEFAULT_TEXT_FONT_SIZE,\n fontWeight: attribute.title?.style?.fontWeight ?? 'normal',\n fontFamily: attribute.title?.style?.fontFamily ?? DEFAULT_TEXT_FONT_FAMILY\n });\n const widthLimit = attribute.label?.style?.maxLineWidth || Infinity;\n const size = getSizeAfterResize(Math.min(width, widthLimit), height, attribute.title?.style?.angle);\n if ((config.orient === 'bottom' || config.orient === 'top') && attribute.title.autoRotate) {\n titleHeight = size.width;\n } else {\n titleHeight = size.height;\n }\n titleHeight += attribute.title.space ?? 4;\n }\n\n return tickHeight + labelHeight + titleHeight + 1; // 2 is buffer\n}\n\n// 保留一位有效数字\nfunction formatDecimal(number: number) {\n if (typeof number !== 'number') {\n number = Number(number);\n }\n\n return Number(number.toPrecision(1)).toString(); // 避免科学计数法\n}\n\n// 计算旋转后的size\nfunction getSizeAfterResize(width: number, height: number, angle = 0) {\n const theta = (angle * Math.PI) / 180; // 角度转为弧度\n const p1 = { x: -width / 2, y: -height / 2 };\n const p2 = { x: width / 2, y: -height / 2 };\n const p3 = { x: width / 2, y: height / 2 };\n const p4 = { x: -width / 2, y: height / 2 };\n\n const p1Rotated = {\n x: p1.x * Math.cos(theta) - p1.y * Math.sin(theta),\n y: p1.x * Math.sin(theta) + p1.y * Math.cos(theta)\n };\n const p2Rotated = {\n x: p2.x * Math.cos(theta) - p2.y * Math.sin(theta),\n y: p2.x * Math.sin(theta) + p2.y * Math.cos(theta)\n };\n const p3Rotated = {\n x: p3.x * Math.cos(theta) - p3.y * Math.sin(theta),\n y: p3.x * Math.sin(theta) + p3.y * Math.cos(theta)\n };\n const p4Rotated = {\n x: p4.x * Math.cos(theta) - p4.y * Math.sin(theta),\n y: p4.x * Math.sin(theta) + p4.y * Math.cos(theta)\n };\n\n const bounds = {\n minX: Math.min(p1Rotated.x, p2Rotated.x, p3Rotated.x, p4Rotated.x),\n maxX: Math.max(p1Rotated.x, p2Rotated.x, p3Rotated.x, p4Rotated.x),\n minY: Math.min(p1Rotated.y, p2Rotated.y, p3Rotated.y, p4Rotated.y),\n maxY: Math.max(p1Rotated.y, p2Rotated.y, p3Rotated.y, p4Rotated.y)\n };\n\n return {\n width: bounds.maxX - bounds.minX,\n height: bounds.maxY - bounds.minY\n };\n}\n"]}
@@ -1,5 +1,8 @@
1
1
  import type { IEmptyTip } from '../../ts-types/component/empty-tip';
2
2
  import type { BaseTableAPI } from '../../ts-types/base-table';
3
+ export interface IEmptyTipComponent {
4
+ new (emptyTipOption: IEmptyTip | true, table: BaseTableAPI): EmptyTip;
5
+ }
3
6
  export declare class EmptyTip {
4
7
  table: BaseTableAPI;
5
8
  _emptyTipOption: IEmptyTip;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/empty-tip/empty-tip.ts"],"names":[],"mappings":";;;AAAA,qEAA8E;AAK9E,6CAA2C;AAG3C,MAAM,WAAW,GACf,4pDAA4pD,CAAC;AAE/pD,MAAa,QAAQ;IAkBnB,YAAY,cAAgC,EAAE,KAAmB;QAhBjE,oBAAe,GAAc;YAC3B,uBAAuB,EAAE,EAAE;YAC3B,IAAI,EAAE,SAAS;YACf,SAAS,EAAE;gBACT,QAAQ,EAAE,EAAE;gBACZ,KAAK,EAAE,MAAM;aACd;YACD,IAAI,EAAE;gBACJ,KAAK,EAAE,WAAW;gBAClB,KAAK,EAAE,GAAG;gBACV,MAAM,EAAE,GAAG;aACZ;SACF,CAAC;QACF,eAAU,GAAY,KAAK,CAAC;QAI1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,MAAM,C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,KAAoB,CAAC,OAAO,CAAC,eAAe;YACxF,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE;YAClC,CAAC,CAAC,CAAC,CAAC;QACR,MAAM,KAAK,GACT,CAAC,IAAI,CAAC,KAAK,CAAC,sBAAsB,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YAChE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,KAAK;YACjC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG,eAAe,CAAC;QACtD,MAAM,MAAM,GACV,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YAC7D,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,MAAM;YAClC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,GAAG,eAAe,CAAC;QAEvD,OAAO;YACL,uBAAuB,EAAE,IAAI,CAAC,eAAe,CAAC,uBAAuB;YACrE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,eAAe;YACtC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,eAAe;YACtC,KAAK;YACL,MAAM;YACN,IAAI,gCACF,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,IAC5B,IAAI,CAAC,eAAe,CAAC,SAAS,KACjC,IAAI,EAAE,MAAA,IAAI,CAAC,eAAe,CAAC,SAAS,0CAAE,KAAK,GAC5C;YACD,IAAI,oBACC,IAAI,CAAC,eAAe,CAAC,IAAI,CAC7B;SAEoB,CAAC;IAC1B,CAAC;CACF;AA7ID,4BA6IC","file":"empty-tip.js","sourcesContent":["import { EmptyTip as EmptyTipComponents } from '@visactor/vrender-components';\n// eslint-disable-next-line no-duplicate-imports\nimport type { EmptyTipAttributes } from '@visactor/vrender-components';\nimport type { IEmptyTip } from '../../ts-types/component/empty-tip';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { isEqual } from '@visactor/vutils';\nimport type { ListTable } from '../../ListTable';\nimport type { PivotTable } from '../../PivotTable';\nconst emptyTipSvg =\n '<svg t=\"1716726614852\" class=\"icon\" viewBox=\"0 0 1194 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2621\" width=\"200\" height=\"200\"><path d=\"M1038.694079 367.237067c13.265507 23.342857-16.633865-40.004445-63.05621-40.004446H219.018794c-26.558738 0-46.46393 13.334815-63.05621 40.004446S0.006238 607.277601 0.006238 650.608819V940.647979a82.351494 82.351494 0 0 0 82.961402 83.349526H1111.702885a82.337632 82.337632 0 0 0 82.975264-83.349526V650.608819c0-43.331218-155.970208-283.371753-155.970208-283.371752zM730.066575 667.284269a136.328386 136.328386 0 0 1-132.738243 133.33429 133.417459 133.417459 0 0 1-132.738243-133.33429v-6.681269a40.6698 40.6698 0 0 0-36.497473-26.66963H73.015044l119.458874-220.02445s23.231965-40.004445 53.103614-40.004446h713.481918c26.544876 0 29.871649 10.008042 46.436207 40.004446L1128.33675 633.947231H769.904682c-26.184476 0-39.838107 7.623855-39.838107 33.337038zM338.505391 210.559919l-89.601086-86.69016a22.178487 22.178487 0 0 1 0-33.26773 21.984425 21.984425 0 0 1 33.170699 0l89.601087 86.676299a22.317102 22.317102 0 0 1 0 33.26773 24.950798 24.950798 0 0 1-33.1707 0z m252.197118-40.059891a25.532983 25.532983 0 0 1-6.639685-16.633865l-3.326773-126.694606A28.263709 28.263709 0 0 1 603.995739 0.515788c13.251646-3.326773 23.204242 10.021904 26.544877 23.342858V153.866163a28.249847 28.249847 0 0 1-23.259688 26.66963c-6.611961-3.312911-13.279369-3.312911-16.578419-10.035765z m235.646421 33.337038a22.372548 22.372548 0 0 1 0-33.337038l86.288175-90.030795a22.039871 22.039871 0 0 1 33.170699 0 22.289379 22.289379 0 0 1 0 33.364761l-82.961401 90.003072a25.962691 25.962691 0 0 1-36.483611 0z\" fill=\"#8a8a8a\" p-id=\"2622\"></path></svg>';\n\nexport class EmptyTip {\n table: BaseTableAPI;\n _emptyTipOption: IEmptyTip = {\n spaceBetweenTextAndIcon: 20,\n text: 'no data',\n textStyle: {\n fontSize: 14,\n color: '#000'\n },\n icon: {\n image: emptyTipSvg,\n width: 100,\n height: 100\n }\n };\n isReleased: boolean = false;\n private _emptyTipComponent: EmptyTipComponents;\n private _cacheAttrs: EmptyTipAttributes;\n constructor(emptyTipOption: IEmptyTip | true, table: BaseTableAPI) {\n this.table = table;\n this._emptyTipOption = Object.assign(this._emptyTipOption, emptyTipOption === true ? {} : emptyTipOption);\n this._emptyTipComponent = this._createOrUpdateEmptyTipComponent(this._getEmptyTipAttrs());\n }\n\n private _createOrUpdateEmptyTipComponent(attrs: EmptyTipAttributes): EmptyTipComponents {\n if (this._emptyTipComponent) {\n if (!isEqual(attrs, this._cacheAttrs)) {\n this._emptyTipComponent.setAttributes(attrs);\n }\n } else {\n const emptyTip = new EmptyTipComponents(attrs);\n emptyTip.name = 'emptyTip';\n this.table.scenegraph.stage.defaultLayer.appendChild(emptyTip);\n this._emptyTipComponent = emptyTip;\n }\n // update table size\n // this._adjustTableSize(this._emptyTipComponent.attribute);\n return this._emptyTipComponent;\n }\n\n resize() {\n if (!this._emptyTipComponent) {\n return;\n }\n const leftHeaderWidth =\n (this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol === false\n ? this.table.getFrozenColsWidth()\n : 0;\n const topHeaderHeight =\n !(this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol\n ? this.table.getFrozenRowsHeight()\n : 0;\n const width =\n (this.table.columnHeaderLevelCount > 0 && this.table.isListTable()\n ? this.table.getDrawRange().width\n : this.table.tableNoFrameWidth) - leftHeaderWidth;\n const height =\n (this.table.rowHeaderLevelCount > 0 && this.table.isListTable()\n ? this.table.getDrawRange().height\n : this.table.tableNoFrameHeight) - topHeaderHeight;\n this._emptyTipComponent.setAttributes({\n spaceBetweenTextAndIcon: this._emptyTipOption.spaceBetweenTextAndIcon,\n x: this.table.tableX + leftHeaderWidth,\n y: this.table.tableY + topHeaderHeight,\n width,\n height,\n text: {\n text: this._emptyTipOption.text,\n ...this._emptyTipOption.textStyle,\n fill: this._emptyTipOption.textStyle?.color\n },\n icon: {\n ...this._emptyTipOption.icon\n }\n });\n }\n\n release(): void {\n this._emptyTipComponent && this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent);\n this._emptyTipComponent = null;\n this.isReleased = true;\n }\n resetVisible() {\n if (\n ((!this.table.recordsCount || this.table.recordsCount === 0) &&\n this.table.internalProps.layoutMap.rowCount === this.table.internalProps.layoutMap.columnHeaderLevelCount) ||\n this.table.internalProps.layoutMap.colCount === this.table.internalProps.layoutMap.rowHeaderLevelCount\n ) {\n // this._emptyTipComponent.setAttributes({\n // visible: true\n // });\n // this._emptyTipComponent.showAll();\n if (!this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent)) {\n this.table.scenegraph.stage.defaultLayer.appendChild(this._emptyTipComponent);\n }\n } else {\n // this._emptyTipComponent.setAttributes({\n // visible: false\n // });\n // this._emptyTipComponent.hideAll();\n if (this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent)) {\n this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent);\n }\n }\n }\n\n private _getEmptyTipAttrs() {\n const leftHeaderWidth =\n (this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol === false\n ? this.table.getFrozenColsWidth()\n : 0;\n const topHeaderHeight =\n !(this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol\n ? this.table.getFrozenRowsHeight()\n : 0;\n const width =\n (this.table.columnHeaderLevelCount > 0 && this.table.isListTable()\n ? this.table.getDrawRange().width\n : this.table.tableNoFrameWidth) - leftHeaderWidth;\n const height =\n (this.table.rowHeaderLevelCount > 0 && this.table.isListTable()\n ? this.table.getDrawRange().height\n : this.table.tableNoFrameHeight) - topHeaderHeight;\n\n return {\n spaceBetweenTextAndIcon: this._emptyTipOption.spaceBetweenTextAndIcon,\n x: this.table.tableX + leftHeaderWidth,\n y: this.table.tableY + topHeaderHeight,\n width,\n height,\n text: {\n text: this._emptyTipOption.text,\n ...this._emptyTipOption.textStyle,\n fill: this._emptyTipOption.textStyle?.color\n },\n icon: {\n ...this._emptyTipOption.icon\n }\n // visible:this.table.recordsCount === 0?true:false\n } as EmptyTipAttributes;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/components/empty-tip/empty-tip.ts"],"names":[],"mappings":";;;AAAA,qEAA8E;AAK9E,6CAA2C;AAG3C,MAAM,WAAW,GACf,4pDAA4pD,CAAC;AAM/pD,MAAa,QAAQ;IAkBnB,YAAY,cAAgC,EAAE,KAAmB;QAhBjE,oBAAe,GAAc;YAC3B,uBAAuB,EAAE,EAAE;YAC3B,IAAI,EAAE,SAAS;YACf,SAAS,EAAE;gBACT,QAAQ,EAAE,EAAE;gBACZ,KAAK,EAAE,MAAM;aACd;YACD,IAAI,EAAE;gBACJ,KAAK,EAAE,WAAW;gBAClB,KAAK,EAAE,GAAG;gBACV,MAAM,EAAE,GAAG;aACZ;SACF,CAAC;QACF,eAAU,GAAY,KAAK,CAAC;QAI1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,EAAE,cAAc,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;QAC1G,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,gCAAgC,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAC5F,CAAC;IAEO,gCAAgC,CAAC,KAAyB;QAChE,IAAI,IAAI,CAAC,kBAAkB,EAAE;YAC3B,IAAI,CAAC,IAAA,gBAAO,EAAC,KAAK,EAAE,IAAI,C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BAAiB,CAAC,GAAG,eAAe,CAAC;QACtD,MAAM,MAAM,GACV,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YAC7D,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,MAAM;YAClC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,GAAG,eAAe,CAAC;QAEvD,OAAO;YACL,uBAAuB,EAAE,IAAI,CAAC,eAAe,CAAC,uBAAuB;YACrE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,eAAe;YACtC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,eAAe;YACtC,KAAK;YACL,MAAM;YACN,IAAI,gCACF,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,IAC5B,IAAI,CAAC,eAAe,CAAC,SAAS,KACjC,IAAI,EAAE,MAAA,IAAI,CAAC,eAAe,CAAC,SAAS,0CAAE,KAAK,GAC5C;YACD,IAAI,oBACC,IAAI,CAAC,eAAe,CAAC,IAAI,CAC7B;SAEoB,CAAC;IAC1B,CAAC;CACF;AA7ID,4BA6IC","file":"empty-tip.js","sourcesContent":["import { EmptyTip as EmptyTipComponents } from '@visactor/vrender-components';\n// eslint-disable-next-line no-duplicate-imports\nimport type { EmptyTipAttributes } from '@visactor/vrender-components';\nimport type { IEmptyTip } from '../../ts-types/component/empty-tip';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { isEqual } from '@visactor/vutils';\nimport type { ListTable } from '../../ListTable';\nimport type { PivotTable } from '../../PivotTable';\nconst emptyTipSvg =\n '<svg t=\"1716726614852\" class=\"icon\" viewBox=\"0 0 1194 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2621\" width=\"200\" height=\"200\"><path d=\"M1038.694079 367.237067c13.265507 23.342857-16.633865-40.004445-63.05621-40.004446H219.018794c-26.558738 0-46.46393 13.334815-63.05621 40.004446S0.006238 607.277601 0.006238 650.608819V940.647979a82.351494 82.351494 0 0 0 82.961402 83.349526H1111.702885a82.337632 82.337632 0 0 0 82.975264-83.349526V650.608819c0-43.331218-155.970208-283.371753-155.970208-283.371752zM730.066575 667.284269a136.328386 136.328386 0 0 1-132.738243 133.33429 133.417459 133.417459 0 0 1-132.738243-133.33429v-6.681269a40.6698 40.6698 0 0 0-36.497473-26.66963H73.015044l119.458874-220.02445s23.231965-40.004445 53.103614-40.004446h713.481918c26.544876 0 29.871649 10.008042 46.436207 40.004446L1128.33675 633.947231H769.904682c-26.184476 0-39.838107 7.623855-39.838107 33.337038zM338.505391 210.559919l-89.601086-86.69016a22.178487 22.178487 0 0 1 0-33.26773 21.984425 21.984425 0 0 1 33.170699 0l89.601087 86.676299a22.317102 22.317102 0 0 1 0 33.26773 24.950798 24.950798 0 0 1-33.1707 0z m252.197118-40.059891a25.532983 25.532983 0 0 1-6.639685-16.633865l-3.326773-126.694606A28.263709 28.263709 0 0 1 603.995739 0.515788c13.251646-3.326773 23.204242 10.021904 26.544877 23.342858V153.866163a28.249847 28.249847 0 0 1-23.259688 26.66963c-6.611961-3.312911-13.279369-3.312911-16.578419-10.035765z m235.646421 33.337038a22.372548 22.372548 0 0 1 0-33.337038l86.288175-90.030795a22.039871 22.039871 0 0 1 33.170699 0 22.289379 22.289379 0 0 1 0 33.364761l-82.961401 90.003072a25.962691 25.962691 0 0 1-36.483611 0z\" fill=\"#8a8a8a\" p-id=\"2622\"></path></svg>';\n\nexport interface IEmptyTipComponent {\n new (emptyTipOption: IEmptyTip | true, table: BaseTableAPI): EmptyTip;\n}\n\nexport class EmptyTip {\n table: BaseTableAPI;\n _emptyTipOption: IEmptyTip = {\n spaceBetweenTextAndIcon: 20,\n text: 'no data',\n textStyle: {\n fontSize: 14,\n color: '#000'\n },\n icon: {\n image: emptyTipSvg,\n width: 100,\n height: 100\n }\n };\n isReleased: boolean = false;\n private _emptyTipComponent: EmptyTipComponents;\n private _cacheAttrs: EmptyTipAttributes;\n constructor(emptyTipOption: IEmptyTip | true, table: BaseTableAPI) {\n this.table = table;\n this._emptyTipOption = Object.assign(this._emptyTipOption, emptyTipOption === true ? {} : emptyTipOption);\n this._emptyTipComponent = this._createOrUpdateEmptyTipComponent(this._getEmptyTipAttrs());\n }\n\n private _createOrUpdateEmptyTipComponent(attrs: EmptyTipAttributes): EmptyTipComponents {\n if (this._emptyTipComponent) {\n if (!isEqual(attrs, this._cacheAttrs)) {\n this._emptyTipComponent.setAttributes(attrs);\n }\n } else {\n const emptyTip = new EmptyTipComponents(attrs);\n emptyTip.name = 'emptyTip';\n this.table.scenegraph.stage.defaultLayer.appendChild(emptyTip);\n this._emptyTipComponent = emptyTip;\n }\n // update table size\n // this._adjustTableSize(this._emptyTipComponent.attribute);\n return this._emptyTipComponent;\n }\n\n resize() {\n if (!this._emptyTipComponent) {\n return;\n }\n const leftHeaderWidth =\n (this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol === false\n ? this.table.getFrozenColsWidth()\n : 0;\n const topHeaderHeight =\n !(this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol\n ? this.table.getFrozenRowsHeight()\n : 0;\n const width =\n (this.table.columnHeaderLevelCount > 0 && this.table.isListTable()\n ? this.table.getDrawRange().width\n : this.table.tableNoFrameWidth) - leftHeaderWidth;\n const height =\n (this.table.rowHeaderLevelCount > 0 && this.table.isListTable()\n ? this.table.getDrawRange().height\n : this.table.tableNoFrameHeight) - topHeaderHeight;\n this._emptyTipComponent.setAttributes({\n spaceBetweenTextAndIcon: this._emptyTipOption.spaceBetweenTextAndIcon,\n x: this.table.tableX + leftHeaderWidth,\n y: this.table.tableY + topHeaderHeight,\n width,\n height,\n text: {\n text: this._emptyTipOption.text,\n ...this._emptyTipOption.textStyle,\n fill: this._emptyTipOption.textStyle?.color\n },\n icon: {\n ...this._emptyTipOption.icon\n }\n });\n }\n\n release(): void {\n this._emptyTipComponent && this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent);\n this._emptyTipComponent = null;\n this.isReleased = true;\n }\n resetVisible() {\n if (\n ((!this.table.recordsCount || this.table.recordsCount === 0) &&\n this.table.internalProps.layoutMap.rowCount === this.table.internalProps.layoutMap.columnHeaderLevelCount) ||\n this.table.internalProps.layoutMap.colCount === this.table.internalProps.layoutMap.rowHeaderLevelCount\n ) {\n // this._emptyTipComponent.setAttributes({\n // visible: true\n // });\n // this._emptyTipComponent.showAll();\n if (!this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent)) {\n this.table.scenegraph.stage.defaultLayer.appendChild(this._emptyTipComponent);\n }\n } else {\n // this._emptyTipComponent.setAttributes({\n // visible: false\n // });\n // this._emptyTipComponent.hideAll();\n if (this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent)) {\n this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent);\n }\n }\n }\n\n private _getEmptyTipAttrs() {\n const leftHeaderWidth =\n (this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol === false\n ? this.table.getFrozenColsWidth()\n : 0;\n const topHeaderHeight =\n !(this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol\n ? this.table.getFrozenRowsHeight()\n : 0;\n const width =\n (this.table.columnHeaderLevelCount > 0 && this.table.isListTable()\n ? this.table.getDrawRange().width\n : this.table.tableNoFrameWidth) - leftHeaderWidth;\n const height =\n (this.table.rowHeaderLevelCount > 0 && this.table.isListTable()\n ? this.table.getDrawRange().height\n : this.table.tableNoFrameHeight) - topHeaderHeight;\n\n return {\n spaceBetweenTextAndIcon: this._emptyTipOption.spaceBetweenTextAndIcon,\n x: this.table.tableX + leftHeaderWidth,\n y: this.table.tableY + topHeaderHeight,\n width,\n height,\n text: {\n text: this._emptyTipOption.text,\n ...this._emptyTipOption.textStyle,\n fill: this._emptyTipOption.textStyle?.color\n },\n icon: {\n ...this._emptyTipOption.icon\n }\n // visible:this.table.recordsCount === 0?true:false\n } as EmptyTipAttributes;\n }\n}\n"]}
@@ -0,0 +1,6 @@
1
+ export declare const registerAxis: () => void;
2
+ export declare const registerEmptyTip: () => void;
3
+ export declare const registerLegend: () => void;
4
+ export declare const registerMenu: () => void;
5
+ export declare const registerTitle: () => void;
6
+ export declare const registerTooltip: () => void;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.registerTooltip = exports.registerTitle = exports.registerMenu = exports.registerLegend = exports.registerEmptyTip = exports.registerAxis = void 0;
6
+
7
+ const factory_1 = require("../core/factory"), get_axis_config_1 = require("../layout/chart-helper/get-axis-config"), axis_1 = require("./axis/axis"), get_axis_component_size_1 = require("./axis/get-axis-component-size"), empty_tip_1 = require("./empty-tip/empty-tip"), create_legend_1 = require("./legend/create-legend"), MenuHandler_1 = require("./menu/dom/MenuHandler"), title_1 = require("./title/title"), TooltipHandler_1 = require("./tooltip/TooltipHandler"), registerAxis = () => {
8
+ factory_1.Factory.registerComponent("axis", axis_1.CartesianAxis), factory_1.Factory.registerFunction("computeAxisComponentWidth", get_axis_component_size_1.computeAxisComponentWidth),
9
+ factory_1.Factory.registerFunction("computeAxisComponentHeight", get_axis_component_size_1.computeAxisComponentHeight),
10
+ factory_1.Factory.registerFunction("getAxisConfigInPivotChart", get_axis_config_1.getAxisConfigInPivotChart);
11
+ };
12
+
13
+ exports.registerAxis = registerAxis;
14
+
15
+ const registerEmptyTip = () => {
16
+ factory_1.Factory.registerComponent("emptyTip", empty_tip_1.EmptyTip);
17
+ };
18
+
19
+ exports.registerEmptyTip = registerEmptyTip;
20
+
21
+ const registerLegend = () => {
22
+ factory_1.Factory.registerFunction("createLegend", create_legend_1.createLegend);
23
+ };
24
+
25
+ exports.registerLegend = registerLegend;
26
+
27
+ const registerMenu = () => {
28
+ factory_1.Factory.registerComponent("menuHandler", MenuHandler_1.MenuHandler);
29
+ };
30
+
31
+ exports.registerMenu = registerMenu;
32
+
33
+ const registerTitle = () => {
34
+ factory_1.Factory.registerComponent("title", title_1.Title);
35
+ };
36
+
37
+ exports.registerTitle = registerTitle;
38
+
39
+ const registerTooltip = () => {
40
+ factory_1.Factory.registerComponent("tooltipHandler", TooltipHandler_1.TooltipHandler);
41
+ };
42
+
43
+ exports.registerTooltip = registerTooltip;
44
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/index.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAC1C,4EAAmF;AACnF,sCAA4C;AAC5C,4EAAuG;AACvG,qDAAiD;AACjD,0DAAsD;AACtD,wDAAqD;AACrD,yCAAsC;AACtC,6DAA0D;AAEnD,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,iBAAO,CAAC,iBAAiB,CAAC,MAAM,EAAE,oBAAa,CAAC,CAAC;IACjD,iBAAO,CAAC,gBAAgB,CAAC,2BAA2B,EAAE,mDAAyB,CAAC,CAAC;IACjF,iBAAO,CAAC,gBAAgB,CAAC,4BAA4B,EAAE,oDAA0B,CAAC,CAAC;IACnF,iBAAO,CAAC,gBAAgB,CAAC,2BAA2B,EAAE,2CAAyB,CAAC,CAAC;AACnF,CAAC,CAAC;AALW,QAAA,YAAY,gBAKvB;AAEK,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,iBAAO,CAAC,iBAAiB,CAAC,UAAU,EAAE,oBAAQ,CAAC,CAAC;AAClD,CAAC,CAAC;AAFW,QAAA,gBAAgB,oBAE3B;AAEK,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,iBAAO,CAAC,gBAAgB,CAAC,cAAc,EAAE,4BAAY,CAAC,CAAC;AACzD,CAAC,CAAC;AAFW,QAAA,cAAc,kBAEzB;AAEK,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,iBAAO,CAAC,iBAAiB,CAAC,aAAa,EAAE,yBAAW,CAAC,CAAC;AACxD,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB;AAEK,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,iBAAO,CAAC,iBAAiB,CAAC,OAAO,EAAE,aAAK,CAAC,CAAC;AAC5C,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB;AAEK,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,iBAAO,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,+BAAc,CAAC,CAAC;AAC9D,CAAC,CAAC;AAFW,QAAA,eAAe,mBAE1B","file":"index.js","sourcesContent":["import { Factory } from '../core/factory';\nimport { getAxisConfigInPivotChart } from '../layout/chart-helper/get-axis-config';\nimport { CartesianAxis } from './axis/axis';\nimport { computeAxisComponentHeight, computeAxisComponentWidth } from './axis/get-axis-component-size';\nimport { EmptyTip } from './empty-tip/empty-tip';\nimport { createLegend } from './legend/create-legend';\nimport { MenuHandler } from './menu/dom/MenuHandler';\nimport { Title } from './title/title';\nimport { TooltipHandler } from './tooltip/TooltipHandler';\n\nexport const registerAxis = () => {\n Factory.registerComponent('axis', CartesianAxis);\n Factory.registerFunction('computeAxisComponentWidth', computeAxisComponentWidth);\n Factory.registerFunction('computeAxisComponentHeight', computeAxisComponentHeight);\n Factory.registerFunction('getAxisConfigInPivotChart', getAxisConfigInPivotChart);\n};\n\nexport const registerEmptyTip = () => {\n Factory.registerComponent('emptyTip', EmptyTip);\n};\n\nexport const registerLegend = () => {\n Factory.registerFunction('createLegend', createLegend);\n};\n\nexport const registerMenu = () => {\n Factory.registerComponent('menuHandler', MenuHandler);\n};\n\nexport const registerTitle = () => {\n Factory.registerComponent('title', Title);\n};\n\nexport const registerTooltip = () => {\n Factory.registerComponent('tooltipHandler', TooltipHandler);\n};\n"]}
@@ -2,4 +2,5 @@ import type { ITableLegendOption } from '../../ts-types/component/legend';
2
2
  import { DiscreteTableLegend } from './discrete-legend/discrete-legend';
3
3
  import type { BaseTableAPI } from '../../ts-types/base-table';
4
4
  import { ContinueTableLegend } from './continue-legend/continue-legend';
5
+ export type CreateLegend = (option: ITableLegendOption, table: BaseTableAPI) => DiscreteTableLegend | ContinueTableLegend;
5
6
  export declare function createLegend(option: ITableLegendOption, table: BaseTableAPI): DiscreteTableLegend | ContinueTableLegend;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/legend/create-legend.ts"],"names":[],"mappings":";;;AACA,uEAAwE;AAExE,uEAAwE;AAExE,SAAgB,YAAY,CAAC,MAA0B,EAAE,KAAmB;IAC1E,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE;QACrD,OAAO,IAAI,qCAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;KAC/C;IACD,OAAO,IAAI,qCAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAChD,CAAC;AALD,oCAKC","file":"create-legend.js","sourcesContent":["import type { ITableLegendOption } from '../../ts-types/component/legend';\nimport { DiscreteTableLegend } from './discrete-legend/discrete-legend';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { ContinueTableLegend } from './continue-legend/continue-legend';\n\nexport function createLegend(option: ITableLegendOption, table: BaseTableAPI) {\n if (option.type === 'color' || option.type === 'size') {\n return new ContinueTableLegend(option, table);\n }\n return new DiscreteTableLegend(option, table);\n}\n"]}
1
+ {"version":3,"sources":["../src/components/legend/create-legend.ts"],"names":[],"mappings":";;;AACA,uEAAwE;AAExE,uEAAwE;AAMxE,SAAgB,YAAY,CAAC,MAA0B,EAAE,KAAmB;IAC1E,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE;QACrD,OAAO,IAAI,qCAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;KAC/C;IACD,OAAO,IAAI,qCAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAChD,CAAC;AALD,oCAKC","file":"create-legend.js","sourcesContent":["import type { ITableLegendOption } from '../../ts-types/component/legend';\nimport { DiscreteTableLegend } from './discrete-legend/discrete-legend';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { ContinueTableLegend } from './continue-legend/continue-legend';\n\nexport type CreateLegend = (\n option: ITableLegendOption,\n table: BaseTableAPI\n) => DiscreteTableLegend | ContinueTableLegend;\nexport function createLegend(option: ITableLegendOption, table: BaseTableAPI) {\n if (option.type === 'color' || option.type === 'size') {\n return new ContinueTableLegend(option, table);\n }\n return new DiscreteTableLegend(option, table);\n}\n"]}
@@ -1,6 +1,9 @@
1
1
  import type { DropDownMenuOptions, MenuInstanceInfo, MenuInstanceType } from '../../../ts-types';
2
2
  import type { BaseMenu } from './BaseMenu';
3
3
  import type { BaseTableAPI } from '../../../ts-types/base-table';
4
+ export interface IMenuHandler {
5
+ new (table: BaseTableAPI): MenuHandler;
6
+ }
4
7
  export declare class MenuHandler {
5
8
  private _table;
6
9
  private _menuInstances?;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/menu/dom/MenuHandler.ts"],"names":[],"mappings":";;;AAEA,iCAAyC;AACzC,kDAAoD;AACpD,qEAAkE;AAKlE,MAAM,qBAAqB,GAAG;IAC5B,eAAe,EAAE,UAAU,KAAmB;QAC5C,OAAO,IAAI,WAAI,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IACD,cAAc,EAAE,UAAU,KAAmB;QAC3C,OAAO,IAAI,WAAI,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IACD,SAAS,CAAC,KAAmB;QAC3B,OAAO,IAAI,gBAAS,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;CACF,CAAC;AAGF,SAAS,mBAAmB,CAC1B,KAAmB,EACnB,GAAW,EACX,GAAW,EACX,IAAsB,EACtB,mBAAyC;;IAEzC,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAG9E,IAAI,IAAI,GAAG,KAAK,CAAC,wBAA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,CAAC;iBACnD;gBACD,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,cAAc,EAAE;oBAC7C,OAAO,EAAE,IAAI;oBACb,QAAQ,EAAE,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE;iBACjD,CAAC,CAAC;aACJ;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACD,oBAAoB,CAClB,GAAW,EACX,GAAW,EACX,IAAsB,EACtB,mBAAyC;QAMzC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC;QAE1C,MAAM,IAAI,GAAG,mBAAmB,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,mBAAmB,CAAC,CAAC;QAC7E,IAAI,CAAC,IAAI,EAAE;YACT,OAAO,IAAI,CAAC;SACb;QAGD,MAAM,QAAQ,GACZ,CAAC,aAAa,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;YACtC,CAAC,aAAa,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAEhF,OAAO;YACL,QAAQ;YACR,IAAI;YACJ,IAAI;SACL,CAAC;IACJ,CAAC;CACF;AAhID,kCAgIC","file":"MenuHandler.js","sourcesContent":["import type { CellRange, DropDownMenuOptions, MenuInstanceInfo, MenuInstanceType } from '../../../ts-types';\nimport type { BaseMenu } from './BaseMenu';\nimport { Container, Menu } from './Menu';\nimport { cellInRange } from '../../../tools/helper';\nimport { TABLE_EVENT_TYPE } from '../../../core/TABLE_EVENT_TYPE';\nimport type { BaseTableAPI, HeaderData } from '../../../ts-types/base-table';\n// import { DEFAULTFONT } from '../../tools/global';\n// import { getFontSize } from '../../tools/canvases';\n\nconst MENU_INSTANCE_FACTORY = {\n 'dropdown-menu': function (table: BaseTableAPI): BaseMenu {\n return new Menu(table);\n },\n 'context-menu': function (table: BaseTableAPI): BaseMenu {\n return new Menu(table);\n },\n container(table: BaseTableAPI): BaseMenu {\n return new Container(table);\n }\n};\n\n/** 获取下拉菜单展示内容及坐标位置 */\nfunction getMenuInstanceInfo(\n table: BaseTableAPI,\n col: number,\n row: number,\n type: MenuInstanceType,\n dropDownMenuOptions?: DropDownMenuOptions\n): MenuInstanceInfo | null {\n const { lineHeight, textBaseline, textStick } = table._getCellStyle(col, row);\n // table.internalProps.layoutMap.getHeader(col, row).style ?? {};\n // const lineHeight = getFontSize(table.getContext(), font).height;\n let rect = table.getCellRangeRelativeRect(table.getCellRange(col, row));\n if (textStick) {\n rect = table.getVisibleCellRangeRelativeRect({ col, row });\n }\n\n let { left, right, bottom, top, width, height } = rect;\n if (table.isHeader(col, row)) {\n ({ left, right, bottom, top, width, height } = table.internalProps.headerHelper.getDropDownIconRect(\n rect,\n // paddingArray[1]\n lineHeight as number,\n textBaseline || 'middle'\n ));\n }\n if (dropDownMenuOptions?.content) {\n //如果有指定的下拉菜单内容\n return {\n type,\n position: dropDownMenuOptions.position,\n referencePosition: dropDownMenuOptions.referencePosition ?? {\n rect: {\n left,\n right,\n top,\n bottom,\n width,\n height\n }\n },\n content: dropDownMenuOptions.content\n };\n } // 没有指定的下拉菜单 从headerLayout中获取下拉菜单内容\n else if (type === 'dropdown-menu') {\n // 获取下拉菜单信息及位置 注:这里逻辑特指内置的下拉菜单\n const { dropDownMenu = table.globalDropDownMenu, pivotInfo } = table._getHeaderLayoutMap(col, row) as HeaderData;\n\n // const x = (left + right) / 2;\n // const y = bottom;\n\n return {\n type,\n // position: {\n // x,\n // y,\n // },\n referencePosition: {\n rect: {\n left,\n right,\n top,\n bottom,\n width,\n height\n }\n },\n content: dropDownMenu,\n pivotInfo\n };\n }\n // else if (type === 'context-menu') {\n // // 获取右键菜单信息及位置\n // const abstractPos = table._getMouseAbstractPoint(event, false);\n // let menu = null;\n // if (abstractPos && typeof table.options.contextmenu === 'function') {\n // menu = table.options.contextmenu(table.getHeaderField(col, row) as string, row);\n // } else if (abstractPos && Array.isArray(table.options.contextmenu)) {\n // menu = table.options.contextmenu;\n // }\n // return {\n // position: {\n // x: abstractPos.x,\n // y: abstractPos.y,\n // },\n // type,\n // content: menu,\n // };\n // }\n return null;\n}\n\ntype AttachInfo = {\n instance?: BaseMenu;\n range: CellRange;\n};\n\nexport class MenuHandler {\n private _table: BaseTableAPI;\n private _menuInstances?: { [type: string]: BaseMenu };\n private _attachInfo?: AttachInfo | null;\n constructor(table: BaseTableAPI) {\n this._table = table;\n this._menuInstances = {};\n this._bindTableEvent(table);\n }\n release(): void {\n const menuInstances = this._menuInstances;\n for (const k in menuInstances) {\n menuInstances[k].release();\n }\n delete this._menuInstances;\n this._attachInfo = null;\n }\n _bindToCell(col: number, row: number, type: MenuInstanceType, dropDownMenuOptions?: DropDownMenuOptions): void {\n const info = this._attachInfo;\n const instanceInfo = this._getMenuInstanceInfo(col, row, type, dropDownMenuOptions);\n if (info && (!instanceInfo || info.instance !== instanceInfo.instance)) {\n info.instance?.unbindMenuElement();\n this._attachInfo = null;\n }\n if (!instanceInfo) {\n return;\n }\n const { instance, info: menuInstanceInfo } = instanceInfo;\n const attach = instance && instance.bindMenuElement(col, row, menuInstanceInfo);\n if (attach) {\n const range = this._table.getCellRange(col, row);\n this._attachInfo = { range, instance };\n }\n }\n _unbindFromCell(): void {\n const info = this._attachInfo;\n if (!info) {\n return;\n }\n const { instance } = info;\n instance?.unbindMenuElement();\n this._attachInfo = null;\n // this._table.showHoverIcon = undefined;\n }\n _isBindToCell(col: number, row: number): boolean {\n const info = this._attachInfo;\n if (!info) {\n return false;\n }\n return cellInRange(info.range, col, row);\n }\n /** 鼠标坐标位置 是否位于下拉菜单内 */\n pointInMenuElement(x: number, y: number) {\n if (!this._attachInfo) {\n return false;\n }\n const info = this._attachInfo;\n const { instance } = info;\n return instance.pointInMenuElement(x, y);\n }\n _bindTableEvent(table: BaseTableAPI): void {\n // 监听按钮点击事件\n // 三种情况:\n // 1. 没有菜单,点击弹出菜单\n // 2. 已显示菜单,点击关闭菜单\n // 3. 已显示菜单,点击其他菜单按钮,关闭当前菜单,显示另一菜单\n table.on(TABLE_EVENT_TYPE.DROPDOWN_ICON_CLICK, e => {\n if (this._attachInfo) {\n if (this._isBindToCell(e.col, e.row)) {\n this._unbindFromCell();\n } else {\n this._bindToCell(e.col, e.row, 'dropdown-menu');\n }\n } else {\n this._bindToCell(e.col, e.row, 'dropdown-menu');\n }\n });\n // 监听菜单清除事件\n table.on(TABLE_EVENT_TYPE.DROPDOWN_MENU_CLEAR, e => {\n this._unbindFromCell();\n });\n // 监听右键菜单\n table.on(TABLE_EVENT_TYPE.CONTEXTMENU_CELL, e => {\n if (table.internalProps.menu?.renderMode === 'html') {\n // 获取右键菜单信息及位置\n const abstractPos = table._getMouseAbstractPoint(e.event, false);\n let menu = null;\n if (abstractPos.inTable && typeof table.internalProps.menu?.contextMenuItems === 'function') {\n menu = table.internalProps.menu.contextMenuItems(table.getHeaderField(e.col, e.row) as string, e.row, e.col);\n } else if (abstractPos.inTable && Array.isArray(table.internalProps.menu?.contextMenuItems)) {\n menu = table.internalProps.menu?.contextMenuItems;\n }\n this._bindToCell(e.col, e.row, 'context-menu', {\n content: menu,\n position: { x: abstractPos.x, y: abstractPos.y }\n });\n }\n });\n }\n _getMenuInstanceInfo(\n col: number,\n row: number,\n type: MenuInstanceType,\n dropDownMenuOptions?: DropDownMenuOptions\n ): {\n instance?: BaseMenu;\n type: MenuInstanceType;\n info: MenuInstanceInfo;\n } | null {\n const table = this._table;\n const menuInstances = this._menuInstances;\n\n const info = getMenuInstanceInfo(table, col, row, type, dropDownMenuOptions);\n if (!info) {\n return null;\n }\n\n // const { type } = info;\n const instance =\n (menuInstances && menuInstances[type]) ||\n (menuInstances && (menuInstances[type] = MENU_INSTANCE_FACTORY[type](table)));\n\n return {\n instance,\n type,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AAC;QAC7E,IAAI,CAAC,IAAI,EAAE;YACT,OAAO,IAAI,CAAC;SACb;QAGD,MAAM,QAAQ,GACZ,CAAC,aAAa,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;YACtC,CAAC,aAAa,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAEhF,OAAO;YACL,QAAQ;YACR,IAAI;YACJ,IAAI;SACL,CAAC;IACJ,CAAC;CACF;AAhID,kCAgIC","file":"MenuHandler.js","sourcesContent":["import type { CellRange, DropDownMenuOptions, MenuInstanceInfo, MenuInstanceType } from '../../../ts-types';\nimport type { BaseMenu } from './BaseMenu';\nimport { Container, Menu } from './Menu';\nimport { cellInRange } from '../../../tools/helper';\nimport { TABLE_EVENT_TYPE } from '../../../core/TABLE_EVENT_TYPE';\nimport type { BaseTableAPI, HeaderData } from '../../../ts-types/base-table';\n// import { DEFAULTFONT } from '../../tools/global';\n// import { getFontSize } from '../../tools/canvases';\n\nconst MENU_INSTANCE_FACTORY = {\n 'dropdown-menu': function (table: BaseTableAPI): BaseMenu {\n return new Menu(table);\n },\n 'context-menu': function (table: BaseTableAPI): BaseMenu {\n return new Menu(table);\n },\n container(table: BaseTableAPI): BaseMenu {\n return new Container(table);\n }\n};\n\n/** 获取下拉菜单展示内容及坐标位置 */\nfunction getMenuInstanceInfo(\n table: BaseTableAPI,\n col: number,\n row: number,\n type: MenuInstanceType,\n dropDownMenuOptions?: DropDownMenuOptions\n): MenuInstanceInfo | null {\n const { lineHeight, textBaseline, textStick } = table._getCellStyle(col, row);\n // table.internalProps.layoutMap.getHeader(col, row).style ?? {};\n // const lineHeight = getFontSize(table.getContext(), font).height;\n let rect = table.getCellRangeRelativeRect(table.getCellRange(col, row));\n if (textStick) {\n rect = table.getVisibleCellRangeRelativeRect({ col, row });\n }\n\n let { left, right, bottom, top, width, height } = rect;\n if (table.isHeader(col, row)) {\n ({ left, right, bottom, top, width, height } = table.internalProps.headerHelper.getDropDownIconRect(\n rect,\n // paddingArray[1]\n lineHeight as number,\n textBaseline || 'middle'\n ));\n }\n if (dropDownMenuOptions?.content) {\n //如果有指定的下拉菜单内容\n return {\n type,\n position: dropDownMenuOptions.position,\n referencePosition: dropDownMenuOptions.referencePosition ?? {\n rect: {\n left,\n right,\n top,\n bottom,\n width,\n height\n }\n },\n content: dropDownMenuOptions.content\n };\n } // 没有指定的下拉菜单 从headerLayout中获取下拉菜单内容\n else if (type === 'dropdown-menu') {\n // 获取下拉菜单信息及位置 注:这里逻辑特指内置的下拉菜单\n const { dropDownMenu = table.globalDropDownMenu, pivotInfo } = table._getHeaderLayoutMap(col, row) as HeaderData;\n\n // const x = (left + right) / 2;\n // const y = bottom;\n\n return {\n type,\n // position: {\n // x,\n // y,\n // },\n referencePosition: {\n rect: {\n left,\n right,\n top,\n bottom,\n width,\n height\n }\n },\n content: dropDownMenu,\n pivotInfo\n };\n }\n // else if (type === 'context-menu') {\n // // 获取右键菜单信息及位置\n // const abstractPos = table._getMouseAbstractPoint(event, false);\n // let menu = null;\n // if (abstractPos && typeof table.options.contextmenu === 'function') {\n // menu = table.options.contextmenu(table.getHeaderField(col, row) as string, row);\n // } else if (abstractPos && Array.isArray(table.options.contextmenu)) {\n // menu = table.options.contextmenu;\n // }\n // return {\n // position: {\n // x: abstractPos.x,\n // y: abstractPos.y,\n // },\n // type,\n // content: menu,\n // };\n // }\n return null;\n}\n\ntype AttachInfo = {\n instance?: BaseMenu;\n range: CellRange;\n};\n\nexport interface IMenuHandler {\n new (table: BaseTableAPI): MenuHandler;\n}\nexport class MenuHandler {\n private _table: BaseTableAPI;\n private _menuInstances?: { [type: string]: BaseMenu };\n private _attachInfo?: AttachInfo | null;\n constructor(table: BaseTableAPI) {\n this._table = table;\n this._menuInstances = {};\n this._bindTableEvent(table);\n }\n release(): void {\n const menuInstances = this._menuInstances;\n for (const k in menuInstances) {\n menuInstances[k].release();\n }\n delete this._menuInstances;\n this._attachInfo = null;\n }\n _bindToCell(col: number, row: number, type: MenuInstanceType, dropDownMenuOptions?: DropDownMenuOptions): void {\n const info = this._attachInfo;\n const instanceInfo = this._getMenuInstanceInfo(col, row, type, dropDownMenuOptions);\n if (info && (!instanceInfo || info.instance !== instanceInfo.instance)) {\n info.instance?.unbindMenuElement();\n this._attachInfo = null;\n }\n if (!instanceInfo) {\n return;\n }\n const { instance, info: menuInstanceInfo } = instanceInfo;\n const attach = instance && instance.bindMenuElement(col, row, menuInstanceInfo);\n if (attach) {\n const range = this._table.getCellRange(col, row);\n this._attachInfo = { range, instance };\n }\n }\n _unbindFromCell(): void {\n const info = this._attachInfo;\n if (!info) {\n return;\n }\n const { instance } = info;\n instance?.unbindMenuElement();\n this._attachInfo = null;\n // this._table.showHoverIcon = undefined;\n }\n _isBindToCell(col: number, row: number): boolean {\n const info = this._attachInfo;\n if (!info) {\n return false;\n }\n return cellInRange(info.range, col, row);\n }\n /** 鼠标坐标位置 是否位于下拉菜单内 */\n pointInMenuElement(x: number, y: number) {\n if (!this._attachInfo) {\n return false;\n }\n const info = this._attachInfo;\n const { instance } = info;\n return instance.pointInMenuElement(x, y);\n }\n _bindTableEvent(table: BaseTableAPI): void {\n // 监听按钮点击事件\n // 三种情况:\n // 1. 没有菜单,点击弹出菜单\n // 2. 已显示菜单,点击关闭菜单\n // 3. 已显示菜单,点击其他菜单按钮,关闭当前菜单,显示另一菜单\n table.on(TABLE_EVENT_TYPE.DROPDOWN_ICON_CLICK, e => {\n if (this._attachInfo) {\n if (this._isBindToCell(e.col, e.row)) {\n this._unbindFromCell();\n } else {\n this._bindToCell(e.col, e.row, 'dropdown-menu');\n }\n } else {\n this._bindToCell(e.col, e.row, 'dropdown-menu');\n }\n });\n // 监听菜单清除事件\n table.on(TABLE_EVENT_TYPE.DROPDOWN_MENU_CLEAR, e => {\n this._unbindFromCell();\n });\n // 监听右键菜单\n table.on(TABLE_EVENT_TYPE.CONTEXTMENU_CELL, e => {\n if (table.internalProps.menu?.renderMode === 'html') {\n // 获取右键菜单信息及位置\n const abstractPos = table._getMouseAbstractPoint(e.event, false);\n let menu = null;\n if (abstractPos.inTable && typeof table.internalProps.menu?.contextMenuItems === 'function') {\n menu = table.internalProps.menu.contextMenuItems(table.getHeaderField(e.col, e.row) as string, e.row, e.col);\n } else if (abstractPos.inTable && Array.isArray(table.internalProps.menu?.contextMenuItems)) {\n menu = table.internalProps.menu?.contextMenuItems;\n }\n this._bindToCell(e.col, e.row, 'context-menu', {\n content: menu,\n position: { x: abstractPos.x, y: abstractPos.y }\n });\n }\n });\n }\n _getMenuInstanceInfo(\n col: number,\n row: number,\n type: MenuInstanceType,\n dropDownMenuOptions?: DropDownMenuOptions\n ): {\n instance?: BaseMenu;\n type: MenuInstanceType;\n info: MenuInstanceInfo;\n } | null {\n const table = this._table;\n const menuInstances = this._menuInstances;\n\n const info = getMenuInstanceInfo(table, col, row, type, dropDownMenuOptions);\n if (!info) {\n return null;\n }\n\n // const { type } = info;\n const instance =\n (menuInstances && menuInstances[type]) ||\n (menuInstances && (menuInstances[type] = MENU_INSTANCE_FACTORY[type](table)));\n\n return {\n instance,\n type,\n info\n };\n }\n}\n"]}
@@ -1,6 +1,9 @@
1
1
  import type { TitleAttrs } from '@visactor/vrender-components';
2
2
  import type { ITitle } from '../../ts-types/component/title';
3
3
  import type { BaseTableAPI } from '../../ts-types/base-table';
4
+ export interface ITitleComponent {
5
+ new (titleOption: ITitle, table: BaseTableAPI): Title;
6
+ }
4
7
  export declare class Title {
5
8
  table: BaseTableAPI;
6
9
  _titleOption: ITitle;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/title/title.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AAIxE,4DAA8D;AAE9D,6CAA2C;AAC3C,MAAa,KAAK;IAMhB,YAAY,WAAmB,EAAE,KAAmB;QAHpD,eAAU,GAAY,KAAK,CAAC;QAI1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAC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AC,YAAY,CAAC,YAAY,CAClC;YACD,EAAE,EAAE,MAAA,IAAI,CAAC,YAAY,CAAC,EAAE,mCAAI,CAAC;YAC7B,EAAE,EAAE,MAAA,IAAI,CAAC,YAAY,CAAC,EAAE,mCAAI,CAAC;SAChB,CAAC;IAClB,CAAC;CACF;AAlLD,sBAkLC","file":"title.js","sourcesContent":["import { Title as TitleComponents } from '@visactor/vrender-components';\n// eslint-disable-next-line no-duplicate-imports\nimport type { TitleAttrs } from '@visactor/vrender-components';\nimport type { ITitle } from '../../ts-types/component/title';\nimport { getQuadProps } from '../../scenegraph/utils/padding';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { isEqual } from '@visactor/vutils';\nexport class Title {\n table: BaseTableAPI;\n _titleOption: ITitle;\n isReleased: boolean = false;\n private _titleComponent: TitleComponents;\n private _cacheAttrs: TitleAttrs;\n constructor(titleOption: ITitle, table: BaseTableAPI) {\n this.table = table;\n this._titleOption = titleOption;\n if (titleOption.visible !== false) {\n this._titleComponent = this._createOrUpdateTitleComponent(this._getTitleAttrs());\n }\n }\n\n private _createOrUpdateTitleComponent(attrs: TitleAttrs): TitleComponents {\n if (this._titleComponent) {\n if (!isEqual(attrs, this._cacheAttrs)) {\n this._titleComponent.setAttributes(attrs);\n }\n } else {\n const title = new TitleComponents(attrs);\n title.name = 'title';\n this.table.scenegraph.stage.defaultLayer.appendChild(title);\n this._titleComponent = title;\n // 代理 title 组件上的事件\n // title.on('*', (event: any, type: string) => this._delegateEvent(title as unknown as INode, event, type));\n }\n // update table size\n this._adjustTableSize(this._titleComponent.attribute);\n return this._titleComponent;\n }\n\n resize() {\n if (!this._titleComponent) {\n return;\n }\n const padding = getQuadProps(this._titleOption.padding ?? 10);\n const realWidth =\n this._titleOption.width ??\n Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width) - padding[1] - padding[3];\n const realHeight =\n this._titleOption.height ??\n Math.min(this.table.tableNoFrameHeight, this.table.getDrawRange().height) - padding[0] - padding[2];\n this._titleComponent.setAttributes({\n x:\n this._titleOption.x ?? this._titleOption.orient === 'right'\n ? this.table.tableX + Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width)\n : this.table.tableX,\n y:\n this._titleOption.y ?? this._titleOption.orient === 'bottom'\n ? this.table.tableY + this.table.tableNoFrameHeight\n : this.table.tableY,\n // width: realWidth,\n width:\n this._titleOption.orient === 'top' || this._titleOption.orient === 'bottom'\n ? realWidth\n : this._titleOption.width,\n height:\n this._titleOption.orient === 'left' || this._titleOption.orient === 'right'\n ? realHeight\n : this._titleOption.height,\n textStyle: {\n width: realWidth,\n ...this._titleOption.textStyle\n },\n subtextStyle: {\n width: realWidth,\n ...this._titleOption.subtextStyle\n }\n });\n this._adjustTableSize(this._titleComponent.attribute);\n }\n\n _adjustTableSize(attrs: TitleAttrs) {\n // 调整位置\n const width = isFinite(this._titleComponent?.AABBBounds.width()) ? this._titleComponent.AABBBounds.width() : 0;\n const height = isFinite(this._titleComponent?.AABBBounds.height()) ? this._titleComponent.AABBBounds.height() : 0;\n // const rectWidth = this.table.tableNoFrameWidth;\n // const rectHeight = this.table.tableNoFrameHeight;\n // const padding = getQuadProps((attrs.padding as number | number[]) ?? this._titleOption.padding ?? 10);\n\n // let x = 0;\n // let y = 0;\n // if (this._titleOption.orient === 'left') {\n // x = padding[3];\n // y = 0;\n // // width += padding[1] + padding[3];\n // } else if (this._titleOption.orient === 'top') {\n // x = 0;\n // y = padding[0];\n // // height += padding[0] + padding[2];\n // } else if (this._titleOption.orient === 'right') {\n // x = rectWidth - width - padding[1];\n // y = 0;\n // width += padding[1] + padding[3];\n // } else if (this._titleOption.orient === 'bottom') {\n // x = 0;\n // y = rectHeight - height - padding[2];\n // // height += padding[0] + padding[2];\n // }\n if (this._titleOption.orient === 'left') {\n this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width);\n this.table.tableX += Math.ceil(width);\n } else if (this._titleOption.orient === 'top') {\n this.table.tableNoFrameHeight = this.table.tableNoFrameHeight - Math.ceil(height);\n this.table.tableY += Math.ceil(height);\n } else if (this._titleOption.orient === 'right') {\n this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width);\n } else if (this._titleOption.orient === 'bottom') {\n this.table.tableNoFrameHeight = this.table.tableNoFrameHeight - Math.ceil(height);\n }\n this._cacheAttrs = attrs;\n if (this._titleOption.orient === 'right' || this._titleOption.orient === 'bottom') {\n this._titleComponent.setAttributes({\n x:\n this._titleOption.x ?? this._titleOption.orient === 'right'\n ? this.table.tableX + this.table.tableNoFrameWidth\n : this.table.tableX,\n y:\n this._titleOption.y ?? this._titleOption.orient === 'bottom'\n ? this.table.tableY + this.table.tableNoFrameHeight\n : this.table.tableY\n });\n }\n }\n\n release(): void {\n this._titleComponent && this.table.scenegraph.stage.defaultLayer.removeChild(this._titleComponent);\n this._titleComponent = null;\n this.isReleased = true;\n }\n private _getTitleAttrs() {\n const defaultPadding = this._titleOption.text || this._titleOption.subtext ? 10 : 0;\n const padding = getQuadProps(this._titleOption.padding ?? defaultPadding);\n const realWidth =\n this._titleOption.width ??\n Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width) - padding[1] - padding[3];\n const realHeight =\n this._titleOption.height ??\n Math.min(this.table.tableNoFrameHeight, this.table.getDrawRange().height) - padding[0] - padding[2];\n return {\n text: this._titleOption.text ?? '',\n subtext: this._titleOption.subtext ?? '',\n x:\n this._titleOption.x ?? this._titleOption.orient === 'right'\n ? this.table.tableX + Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width)\n : this.table.tableX,\n y:\n this._titleOption.y ?? this._titleOption.orient === 'bottom'\n ? this.table.tableY + this.table.tableNoFrameHeight\n : this.table.tableY,\n width:\n this._titleOption.orient === 'top' || this._titleOption.orient === 'bottom'\n ? realWidth\n : this._titleOption.width,\n height:\n this._titleOption.orient === 'left' || this._titleOption.orient === 'right'\n ? realHeight\n : this._titleOption.height,\n minWidth: this._titleOption.minWidth,\n maxWidth: this._titleOption.maxWidth,\n minHeight: this._titleOption.minHeight,\n maxHeight: this._titleOption.maxHeight,\n padding: this._titleOption.padding,\n align: this._titleOption.align ?? 'left',\n verticalAlign: this._titleOption.verticalAlign ?? 'top',\n textStyle: {\n width: realWidth,\n ...this._titleOption.textStyle\n },\n subtextStyle: {\n width: realWidth,\n ...this._titleOption.subtextStyle\n },\n dx: this._titleOption.dx ?? 0,\n dy: this._titleOption.dy ?? 0\n } as TitleAttrs;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/components/title/title.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AAIxE,4DAA8D;AAE9D,6CAA2C;AAK3C,MAAa,KAAK;IAMhB,YAAY,WAAmB,EAAE,KAAmB;QAHpD,eAAU,GAAY,KAAK,CAAC;QAI1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,WAAW,CAAC,OAAO,KAAK,KAAK,EAAE;YACjC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,6BAA6B,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;SAClF;IACH,CAAC;IAEO,6BAA6B,CAAC,KAAiB;QACrD,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,IAAI,CAAC,IAAA,gBAAO,EAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,EAAE;gBACrC,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;aAC3C;SACF;aAAM;YACL,MAAM,KAAK,GAAG,IAAI,0BAAe,CAAC,KAAK,CAAC,CAAC;YACzC,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC;YACrB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YAC5D,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;SAG9B;QAED,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,eAAe,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MAAM;YAC9B,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ;YACpC,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ;YACpC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,SAAS;YACtC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,SAAS;YACtC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,OAAO;YAClC,KAAK,EAAE,MAAA,IAAI,CAAC,YAAY,CAAC,KAAK,mCAAI,MAAM;YACxC,aAAa,EAAE,MAAA,IAAI,CAAC,YAAY,CAAC,aAAa,mCAAI,KAAK;YACvD,SAAS,kBACP,KAAK,EAAE,SAAS,IACb,IAAI,CAAC,YAAY,CAAC,SAAS,CAC/B;YACD,YAAY,kBACV,KAAK,EAAE,SAAS,IACb,IAAI,CAAC,YAAY,CAAC,YAAY,CAClC;YACD,EAAE,EAAE,MAAA,IAAI,CAAC,YAAY,CAAC,EAAE,mCAAI,CAAC;YAC7B,EAAE,EAAE,MAAA,IAAI,CAAC,YAAY,CAAC,EAAE,mCAAI,CAAC;SAChB,CAAC;IAClB,CAAC;CACF;AAlLD,sBAkLC","file":"title.js","sourcesContent":["import { Title as TitleComponents } from '@visactor/vrender-components';\n// eslint-disable-next-line no-duplicate-imports\nimport type { TitleAttrs } from '@visactor/vrender-components';\nimport type { ITitle } from '../../ts-types/component/title';\nimport { getQuadProps } from '../../scenegraph/utils/padding';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { isEqual } from '@visactor/vutils';\n\nexport interface ITitleComponent {\n new (titleOption: ITitle, table: BaseTableAPI): Title;\n}\nexport class Title {\n table: BaseTableAPI;\n _titleOption: ITitle;\n isReleased: boolean = false;\n private _titleComponent: TitleComponents;\n private _cacheAttrs: TitleAttrs;\n constructor(titleOption: ITitle, table: BaseTableAPI) {\n this.table = table;\n this._titleOption = titleOption;\n if (titleOption.visible !== false) {\n this._titleComponent = this._createOrUpdateTitleComponent(this._getTitleAttrs());\n }\n }\n\n private _createOrUpdateTitleComponent(attrs: TitleAttrs): TitleComponents {\n if (this._titleComponent) {\n if (!isEqual(attrs, this._cacheAttrs)) {\n this._titleComponent.setAttributes(attrs);\n }\n } else {\n const title = new TitleComponents(attrs);\n title.name = 'title';\n this.table.scenegraph.stage.defaultLayer.appendChild(title);\n this._titleComponent = title;\n // 代理 title 组件上的事件\n // title.on('*', (event: any, type: string) => this._delegateEvent(title as unknown as INode, event, type));\n }\n // update table size\n this._adjustTableSize(this._titleComponent.attribute);\n return this._titleComponent;\n }\n\n resize() {\n if (!this._titleComponent) {\n return;\n }\n const padding = getQuadProps(this._titleOption.padding ?? 10);\n const realWidth =\n this._titleOption.width ??\n Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width) - padding[1] - padding[3];\n const realHeight =\n this._titleOption.height ??\n Math.min(this.table.tableNoFrameHeight, this.table.getDrawRange().height) - padding[0] - padding[2];\n this._titleComponent.setAttributes({\n x:\n this._titleOption.x ?? this._titleOption.orient === 'right'\n ? this.table.tableX + Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width)\n : this.table.tableX,\n y:\n this._titleOption.y ?? this._titleOption.orient === 'bottom'\n ? this.table.tableY + this.table.tableNoFrameHeight\n : this.table.tableY,\n // width: realWidth,\n width:\n this._titleOption.orient === 'top' || this._titleOption.orient === 'bottom'\n ? realWidth\n : this._titleOption.width,\n height:\n this._titleOption.orient === 'left' || this._titleOption.orient === 'right'\n ? realHeight\n : this._titleOption.height,\n textStyle: {\n width: realWidth,\n ...this._titleOption.textStyle\n },\n subtextStyle: {\n width: realWidth,\n ...this._titleOption.subtextStyle\n }\n });\n this._adjustTableSize(this._titleComponent.attribute);\n }\n\n _adjustTableSize(attrs: TitleAttrs) {\n // 调整位置\n const width = isFinite(this._titleComponent?.AABBBounds.width()) ? this._titleComponent.AABBBounds.width() : 0;\n const height = isFinite(this._titleComponent?.AABBBounds.height()) ? this._titleComponent.AABBBounds.height() : 0;\n // const rectWidth = this.table.tableNoFrameWidth;\n // const rectHeight = this.table.tableNoFrameHeight;\n // const padding = getQuadProps((attrs.padding as number | number[]) ?? this._titleOption.padding ?? 10);\n\n // let x = 0;\n // let y = 0;\n // if (this._titleOption.orient === 'left') {\n // x = padding[3];\n // y = 0;\n // // width += padding[1] + padding[3];\n // } else if (this._titleOption.orient === 'top') {\n // x = 0;\n // y = padding[0];\n // // height += padding[0] + padding[2];\n // } else if (this._titleOption.orient === 'right') {\n // x = rectWidth - width - padding[1];\n // y = 0;\n // width += padding[1] + padding[3];\n // } else if (this._titleOption.orient === 'bottom') {\n // x = 0;\n // y = rectHeight - height - padding[2];\n // // height += padding[0] + padding[2];\n // }\n if (this._titleOption.orient === 'left') {\n this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width);\n this.table.tableX += Math.ceil(width);\n } else if (this._titleOption.orient === 'top') {\n this.table.tableNoFrameHeight = this.table.tableNoFrameHeight - Math.ceil(height);\n this.table.tableY += Math.ceil(height);\n } else if (this._titleOption.orient === 'right') {\n this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width);\n } else if (this._titleOption.orient === 'bottom') {\n this.table.tableNoFrameHeight = this.table.tableNoFrameHeight - Math.ceil(height);\n }\n this._cacheAttrs = attrs;\n if (this._titleOption.orient === 'right' || this._titleOption.orient === 'bottom') {\n this._titleComponent.setAttributes({\n x:\n this._titleOption.x ?? this._titleOption.orient === 'right'\n ? this.table.tableX + this.table.tableNoFrameWidth\n : this.table.tableX,\n y:\n this._titleOption.y ?? this._titleOption.orient === 'bottom'\n ? this.table.tableY + this.table.tableNoFrameHeight\n : this.table.tableY\n });\n }\n }\n\n release(): void {\n this._titleComponent && this.table.scenegraph.stage.defaultLayer.removeChild(this._titleComponent);\n this._titleComponent = null;\n this.isReleased = true;\n }\n private _getTitleAttrs() {\n const defaultPadding = this._titleOption.text || this._titleOption.subtext ? 10 : 0;\n const padding = getQuadProps(this._titleOption.padding ?? defaultPadding);\n const realWidth =\n this._titleOption.width ??\n Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width) - padding[1] - padding[3];\n const realHeight =\n this._titleOption.height ??\n Math.min(this.table.tableNoFrameHeight, this.table.getDrawRange().height) - padding[0] - padding[2];\n return {\n text: this._titleOption.text ?? '',\n subtext: this._titleOption.subtext ?? '',\n x:\n this._titleOption.x ?? this._titleOption.orient === 'right'\n ? this.table.tableX + Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width)\n : this.table.tableX,\n y:\n this._titleOption.y ?? this._titleOption.orient === 'bottom'\n ? this.table.tableY + this.table.tableNoFrameHeight\n : this.table.tableY,\n width:\n this._titleOption.orient === 'top' || this._titleOption.orient === 'bottom'\n ? realWidth\n : this._titleOption.width,\n height:\n this._titleOption.orient === 'left' || this._titleOption.orient === 'right'\n ? realHeight\n : this._titleOption.height,\n minWidth: this._titleOption.minWidth,\n maxWidth: this._titleOption.maxWidth,\n minHeight: this._titleOption.minHeight,\n maxHeight: this._titleOption.maxHeight,\n padding: this._titleOption.padding,\n align: this._titleOption.align ?? 'left',\n verticalAlign: this._titleOption.verticalAlign ?? 'top',\n textStyle: {\n width: realWidth,\n ...this._titleOption.textStyle\n },\n subtextStyle: {\n width: realWidth,\n ...this._titleOption.subtextStyle\n },\n dx: this._titleOption.dx ?? 0,\n dy: this._titleOption.dy ?? 0\n } as TitleAttrs;\n }\n}\n"]}
@@ -3,6 +3,9 @@ import { Placement } from '../../ts-types';
3
3
  import type { BaseTooltip } from './BaseTooltip';
4
4
  import type { TooltipOptions } from '../../ts-types/tooltip';
5
5
  import type { BaseTableAPI } from '../../ts-types/base-table';
6
+ export interface ITooltipHandler {
7
+ new (table: BaseTableAPI, confine: boolean): TooltipHandler;
8
+ }
6
9
  export declare class TooltipHandler {
7
10
  private _table;
8
11
  private _tooltipInstances?;