@visactor/vtable 1.6.0-alpha.4 → 1.6.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 (341) hide show
  1. package/cjs/ListTable-all.js +5 -5
  2. package/cjs/ListTable-all.js.map +1 -1
  3. package/cjs/ListTable.d.ts +3 -0
  4. package/cjs/ListTable.js +42 -285
  5. package/cjs/ListTable.js.map +1 -1
  6. package/cjs/PivotChart.d.ts +1 -0
  7. package/cjs/PivotChart.js +4 -0
  8. package/cjs/PivotChart.js.map +1 -1
  9. package/cjs/PivotTable.js +1 -1
  10. package/cjs/PivotTable.js.map +1 -1
  11. package/cjs/components/axis/axis.js +3 -2
  12. package/cjs/components/axis/axis.js.map +1 -1
  13. package/cjs/components/legend/discrete-legend/discrete-legend.js +2 -1
  14. package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  15. package/cjs/components/title/title.js +3 -1
  16. package/cjs/components/title/title.js.map +1 -1
  17. package/cjs/core/BaseTable.d.ts +8 -5
  18. package/cjs/core/BaseTable.js +57 -111
  19. package/cjs/core/BaseTable.js.map +1 -1
  20. package/cjs/core/FouseInput.d.ts +1 -0
  21. package/cjs/core/FouseInput.js +5 -2
  22. package/cjs/core/FouseInput.js.map +1 -1
  23. package/cjs/core/group-helper.d.ts +6 -0
  24. package/cjs/core/group-helper.js +22 -0
  25. package/cjs/core/group-helper.js.map +1 -0
  26. package/cjs/core/record-helper.d.ts +8 -0
  27. package/cjs/core/record-helper.js +337 -0
  28. package/cjs/core/record-helper.js.map +1 -0
  29. package/cjs/core/style-helper.d.ts +3 -0
  30. package/cjs/core/style-helper.js +110 -0
  31. package/cjs/core/style-helper.js.map +1 -0
  32. package/cjs/core/style.js +1 -1
  33. package/cjs/core/style.js.map +1 -1
  34. package/cjs/core/tableHelper.d.ts +3 -5
  35. package/cjs/core/tableHelper.js +18 -23
  36. package/cjs/core/tableHelper.js.map +1 -1
  37. package/cjs/core/utils/get-cell-position.d.ts +5 -25
  38. package/cjs/core/utils/get-cell-position.js.map +1 -1
  39. package/cjs/data/CachedDataSource.d.ts +10 -1
  40. package/cjs/data/CachedDataSource.js +102 -3
  41. package/cjs/data/CachedDataSource.js.map +1 -1
  42. package/cjs/dataset/dataset-pivot-table.js +0 -1
  43. package/cjs/dataset/dataset-pivot-table.js.map +1 -1
  44. package/cjs/dataset/dataset.js +0 -1
  45. package/cjs/edit/edit-manager.js +2 -1
  46. package/cjs/event/event.js +5 -2
  47. package/cjs/event/event.js.map +1 -1
  48. package/cjs/event/listener/container-dom.js +2 -2
  49. package/cjs/event/listener/container-dom.js.map +1 -1
  50. package/cjs/event/listener/table-group.js +4 -6
  51. package/cjs/event/listener/table-group.js.map +1 -1
  52. package/cjs/event/util.js +2 -2
  53. package/cjs/event/util.js.map +1 -1
  54. package/cjs/index.d.ts +5 -3
  55. package/cjs/index.js +25 -2
  56. package/cjs/index.js.map +1 -1
  57. package/cjs/layout/cell-range/simple-cell-range.d.ts +4 -0
  58. package/cjs/layout/cell-range/simple-cell-range.js +106 -0
  59. package/cjs/layout/cell-range/simple-cell-range.js.map +1 -0
  60. package/cjs/layout/layout-helper.js +2 -2
  61. package/cjs/layout/layout-helper.js.map +1 -1
  62. package/cjs/layout/pivot-header-layout.js +20 -19
  63. package/cjs/layout/pivot-header-layout.js.map +1 -1
  64. package/cjs/layout/row-height-map.js +1 -0
  65. package/cjs/layout/simple-header-layout.d.ts +1 -2
  66. package/cjs/layout/simple-header-layout.js +6 -90
  67. package/cjs/layout/simple-header-layout.js.map +1 -1
  68. package/cjs/plugins/icons.js +1 -1
  69. package/cjs/plugins/list-tree-stick-cell.d.ts +16 -0
  70. package/cjs/plugins/list-tree-stick-cell.js +178 -0
  71. package/cjs/plugins/list-tree-stick-cell.js.map +1 -0
  72. package/cjs/plugins/themes.js +1 -1
  73. package/cjs/scenegraph/component/custom.js +1 -1
  74. package/cjs/scenegraph/component/custom.js.map +1 -1
  75. package/cjs/scenegraph/component/table-component.js +14 -18
  76. package/cjs/scenegraph/component/table-component.js.map +1 -1
  77. package/cjs/scenegraph/debug-tool/debug-tool.js +4 -1
  78. package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -1
  79. package/cjs/scenegraph/graphic/chart.d.ts +1 -0
  80. package/cjs/scenegraph/graphic/chart.js +34 -20
  81. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  82. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +56 -16
  83. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  84. package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +2 -1
  85. package/cjs/scenegraph/graphic/contributions/chart-render.js +40 -24
  86. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  87. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +6 -3
  88. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  89. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.d.ts +1 -0
  90. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +48 -7
  91. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  92. package/cjs/scenegraph/graphic/group.js +1 -1
  93. package/cjs/scenegraph/graphic/group.js.map +1 -1
  94. package/cjs/scenegraph/group-creater/cell-helper.d.ts +2 -1
  95. package/cjs/scenegraph/group-creater/cell-helper.js +29 -10
  96. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  97. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +2 -1
  98. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  99. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +9 -1
  100. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  101. package/cjs/scenegraph/group-creater/column-helper.js +9 -2
  102. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  103. package/cjs/scenegraph/group-creater/init-scenegraph.js +2 -2
  104. package/cjs/scenegraph/group-creater/init-scenegraph.js.map +1 -1
  105. package/cjs/scenegraph/layout/compute-col-width.js +2 -2
  106. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  107. package/cjs/scenegraph/layout/compute-row-height.js +2 -2
  108. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  109. package/cjs/scenegraph/layout/update-height.js +3 -1
  110. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  111. package/cjs/scenegraph/layout/update-width.js +5 -3
  112. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  113. package/cjs/scenegraph/refresh-node/update-chart.d.ts +1 -0
  114. package/cjs/scenegraph/refresh-node/update-chart.js +84 -32
  115. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  116. package/cjs/scenegraph/scenegraph.d.ts +1 -1
  117. package/cjs/scenegraph/scenegraph.js +67 -46
  118. package/cjs/scenegraph/scenegraph.js.map +1 -1
  119. package/cjs/scenegraph/stick-text/index.js +5 -6
  120. package/cjs/scenegraph/stick-text/index.js.map +1 -1
  121. package/cjs/scenegraph/style/frame-border.d.ts +1 -1
  122. package/cjs/scenegraph/style/frame-border.js +27 -12
  123. package/cjs/scenegraph/style/frame-border.js.map +1 -1
  124. package/cjs/scenegraph/utils/cell-border-stroke-width.js +14 -9
  125. package/cjs/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
  126. package/cjs/scenegraph/utils/get-cell-merge.js +1 -1
  127. package/cjs/scenegraph/utils/get-cell-merge.js.map +1 -1
  128. package/cjs/scenegraph/utils/get-hierarchy-offset.js +6 -8
  129. package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
  130. package/cjs/scenegraph/utils/text-icon-layout.js +6 -4
  131. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  132. package/cjs/state/resize/update-resize-row.js +1 -1
  133. package/cjs/state/resize/update-resize-row.js.map +1 -1
  134. package/cjs/state/state.d.ts +2 -2
  135. package/cjs/state/state.js +5 -5
  136. package/cjs/state/state.js.map +1 -1
  137. package/cjs/themes/theme.d.ts +2 -0
  138. package/cjs/themes/theme.js +13 -10
  139. package/cjs/themes/theme.js.map +1 -1
  140. package/cjs/tools/helper.d.ts +1 -1
  141. package/cjs/tools/helper.js +3 -3
  142. package/cjs/tools/helper.js.map +1 -1
  143. package/cjs/tools/style.d.ts +1 -2
  144. package/cjs/tools/style.js +3 -9
  145. package/cjs/tools/style.js.map +1 -1
  146. package/cjs/ts-types/base-table.d.ts +21 -3
  147. package/cjs/ts-types/base-table.js.map +1 -1
  148. package/cjs/ts-types/column/style.d.ts +2 -2
  149. package/cjs/ts-types/column/style.js.map +1 -1
  150. package/cjs/ts-types/component/index.d.ts +1 -0
  151. package/cjs/ts-types/component/index.js +21 -0
  152. package/cjs/ts-types/component/index.js.map +1 -0
  153. package/cjs/ts-types/index.d.ts +1 -0
  154. package/cjs/ts-types/index.js +1 -1
  155. package/cjs/ts-types/index.js.map +1 -1
  156. package/cjs/ts-types/list-table/layout-map/api.d.ts +1 -0
  157. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
  158. package/cjs/ts-types/new-data-set.d.ts +1 -0
  159. package/cjs/ts-types/new-data-set.js.map +1 -1
  160. package/cjs/ts-types/pivot-table/corner.d.ts +1 -0
  161. package/cjs/ts-types/pivot-table/corner.js.map +1 -1
  162. package/cjs/ts-types/table-engine.d.ts +11 -46
  163. package/cjs/ts-types/table-engine.js.map +1 -1
  164. package/cjs/ts-types/theme.d.ts +2 -3
  165. package/cjs/ts-types/theme.js.map +1 -1
  166. package/cjs/vrender.js +2 -1
  167. package/cjs/vrender.js.map +1 -1
  168. package/dist/vtable.js +36370 -32652
  169. package/dist/vtable.min.js +2 -2
  170. package/es/ListTable-all.js +5 -3
  171. package/es/ListTable-all.js.map +1 -1
  172. package/es/ListTable.d.ts +3 -0
  173. package/es/ListTable.js +45 -287
  174. package/es/ListTable.js.map +1 -1
  175. package/es/PivotChart.d.ts +1 -0
  176. package/es/PivotChart.js +5 -2
  177. package/es/PivotChart.js.map +1 -1
  178. package/es/PivotTable.js +1 -1
  179. package/es/PivotTable.js.map +1 -1
  180. package/es/components/axis/axis.js +3 -1
  181. package/es/components/axis/axis.js.map +1 -1
  182. package/es/components/legend/discrete-legend/discrete-legend.js +2 -1
  183. package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  184. package/es/components/title/title.js +3 -1
  185. package/es/components/title/title.js.map +1 -1
  186. package/es/core/BaseTable.d.ts +8 -5
  187. package/es/core/BaseTable.js +61 -115
  188. package/es/core/BaseTable.js.map +1 -1
  189. package/es/core/FouseInput.d.ts +1 -0
  190. package/es/core/FouseInput.js +5 -2
  191. package/es/core/FouseInput.js.map +1 -1
  192. package/es/core/group-helper.d.ts +6 -0
  193. package/es/core/group-helper.js +14 -0
  194. package/es/core/group-helper.js.map +1 -0
  195. package/es/core/record-helper.d.ts +8 -0
  196. package/es/core/record-helper.js +332 -0
  197. package/es/core/record-helper.js.map +1 -0
  198. package/es/core/style-helper.d.ts +3 -0
  199. package/es/core/style-helper.js +86 -0
  200. package/es/core/style-helper.js.map +1 -0
  201. package/es/core/style.js +1 -1
  202. package/es/core/style.js.map +1 -1
  203. package/es/core/tableHelper.d.ts +3 -5
  204. package/es/core/tableHelper.js +15 -22
  205. package/es/core/tableHelper.js.map +1 -1
  206. package/es/core/utils/get-cell-position.d.ts +5 -25
  207. package/es/core/utils/get-cell-position.js.map +1 -1
  208. package/es/data/CachedDataSource.d.ts +10 -1
  209. package/es/data/CachedDataSource.js +103 -0
  210. package/es/data/CachedDataSource.js.map +1 -1
  211. package/es/dataset/dataset-pivot-table.js +0 -1
  212. package/es/dataset/dataset-pivot-table.js.map +1 -1
  213. package/es/dataset/dataset.js +1 -2
  214. package/es/edit/edit-manager.js +2 -1
  215. package/es/event/event.js +5 -2
  216. package/es/event/event.js.map +1 -1
  217. package/es/event/listener/container-dom.js +2 -2
  218. package/es/event/listener/container-dom.js.map +1 -1
  219. package/es/event/listener/table-group.js +4 -6
  220. package/es/event/listener/table-group.js.map +1 -1
  221. package/es/event/util.js +2 -2
  222. package/es/event/util.js.map +1 -1
  223. package/es/index.d.ts +5 -3
  224. package/es/index.js +5 -1
  225. package/es/index.js.map +1 -1
  226. package/es/layout/cell-range/simple-cell-range.d.ts +4 -0
  227. package/es/layout/cell-range/simple-cell-range.js +99 -0
  228. package/es/layout/cell-range/simple-cell-range.js.map +1 -0
  229. package/es/layout/layout-helper.js +2 -2
  230. package/es/layout/layout-helper.js.map +1 -1
  231. package/es/layout/pivot-header-layout.js +20 -19
  232. package/es/layout/pivot-header-layout.js.map +1 -1
  233. package/es/layout/row-height-map.js +2 -1
  234. package/es/layout/simple-header-layout.d.ts +1 -2
  235. package/es/layout/simple-header-layout.js +7 -89
  236. package/es/layout/simple-header-layout.js.map +1 -1
  237. package/es/plugins/icons.js +1 -1
  238. package/es/plugins/list-tree-stick-cell.d.ts +16 -0
  239. package/es/plugins/list-tree-stick-cell.js +176 -0
  240. package/es/plugins/list-tree-stick-cell.js.map +1 -0
  241. package/es/plugins/themes.js +1 -1
  242. package/es/scenegraph/component/custom.js +1 -1
  243. package/es/scenegraph/component/custom.js.map +1 -1
  244. package/es/scenegraph/component/table-component.js +14 -18
  245. package/es/scenegraph/component/table-component.js.map +1 -1
  246. package/es/scenegraph/debug-tool/debug-tool.js +4 -1
  247. package/es/scenegraph/debug-tool/debug-tool.js.map +1 -1
  248. package/es/scenegraph/graphic/chart.d.ts +1 -0
  249. package/es/scenegraph/graphic/chart.js +33 -21
  250. package/es/scenegraph/graphic/chart.js.map +1 -1
  251. package/es/scenegraph/graphic/contributions/chart-render-helper.js +57 -15
  252. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  253. package/es/scenegraph/graphic/contributions/chart-render.d.ts +2 -1
  254. package/es/scenegraph/graphic/contributions/chart-render.js +41 -25
  255. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  256. package/es/scenegraph/graphic/contributions/group-contribution-render.js +8 -3
  257. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  258. package/es/scenegraph/graphic/contributions/rect-contribution-render.d.ts +1 -0
  259. package/es/scenegraph/graphic/contributions/rect-contribution-render.js +49 -5
  260. package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  261. package/es/scenegraph/graphic/group.js +1 -1
  262. package/es/scenegraph/graphic/group.js.map +1 -1
  263. package/es/scenegraph/group-creater/cell-helper.d.ts +2 -1
  264. package/es/scenegraph/group-creater/cell-helper.js +23 -8
  265. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  266. package/es/scenegraph/group-creater/cell-type/chart-cell.js +2 -1
  267. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  268. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +9 -1
  269. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  270. package/es/scenegraph/group-creater/column-helper.js +8 -2
  271. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  272. package/es/scenegraph/group-creater/init-scenegraph.js +2 -2
  273. package/es/scenegraph/group-creater/init-scenegraph.js.map +1 -1
  274. package/es/scenegraph/layout/compute-col-width.js +1 -3
  275. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  276. package/es/scenegraph/layout/compute-row-height.js +2 -2
  277. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  278. package/es/scenegraph/layout/update-height.js +3 -1
  279. package/es/scenegraph/layout/update-height.js.map +1 -1
  280. package/es/scenegraph/layout/update-width.js +5 -3
  281. package/es/scenegraph/layout/update-width.js.map +1 -1
  282. package/es/scenegraph/refresh-node/update-chart.d.ts +1 -0
  283. package/es/scenegraph/refresh-node/update-chart.js +81 -29
  284. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  285. package/es/scenegraph/scenegraph.d.ts +1 -1
  286. package/es/scenegraph/scenegraph.js +67 -46
  287. package/es/scenegraph/scenegraph.js.map +1 -1
  288. package/es/scenegraph/stick-text/index.js +5 -6
  289. package/es/scenegraph/stick-text/index.js.map +1 -1
  290. package/es/scenegraph/style/frame-border.d.ts +1 -1
  291. package/es/scenegraph/style/frame-border.js +27 -10
  292. package/es/scenegraph/style/frame-border.js.map +1 -1
  293. package/es/scenegraph/utils/cell-border-stroke-width.js +9 -6
  294. package/es/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
  295. package/es/scenegraph/utils/get-cell-merge.js +1 -1
  296. package/es/scenegraph/utils/get-cell-merge.js.map +1 -1
  297. package/es/scenegraph/utils/get-hierarchy-offset.js +7 -9
  298. package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
  299. package/es/scenegraph/utils/text-icon-layout.js +6 -4
  300. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  301. package/es/state/resize/update-resize-row.js +1 -1
  302. package/es/state/resize/update-resize-row.js.map +1 -1
  303. package/es/state/state.d.ts +2 -2
  304. package/es/state/state.js +5 -5
  305. package/es/state/state.js.map +1 -1
  306. package/es/themes/theme.d.ts +2 -0
  307. package/es/themes/theme.js +13 -10
  308. package/es/themes/theme.js.map +1 -1
  309. package/es/tools/helper.d.ts +1 -1
  310. package/es/tools/helper.js +1 -1
  311. package/es/tools/helper.js.map +1 -1
  312. package/es/tools/style.d.ts +1 -2
  313. package/es/tools/style.js +2 -7
  314. package/es/tools/style.js.map +1 -1
  315. package/es/ts-types/base-table.d.ts +21 -3
  316. package/es/ts-types/base-table.js.map +1 -1
  317. package/es/ts-types/column/style.d.ts +2 -2
  318. package/es/ts-types/column/style.js.map +1 -1
  319. package/es/ts-types/component/index.d.ts +1 -0
  320. package/es/ts-types/component/index.js +2 -0
  321. package/es/ts-types/component/index.js.map +1 -0
  322. package/es/ts-types/index.d.ts +1 -0
  323. package/es/ts-types/index.js +2 -0
  324. package/es/ts-types/index.js.map +1 -1
  325. package/es/ts-types/list-table/layout-map/api.d.ts +1 -0
  326. package/es/ts-types/list-table/layout-map/api.js.map +1 -1
  327. package/es/ts-types/new-data-set.d.ts +1 -0
  328. package/es/ts-types/new-data-set.js.map +1 -1
  329. package/es/ts-types/pivot-table/corner.d.ts +1 -0
  330. package/es/ts-types/pivot-table/corner.js.map +1 -1
  331. package/es/ts-types/table-engine.d.ts +11 -46
  332. package/es/ts-types/table-engine.js.map +1 -1
  333. package/es/ts-types/theme.d.ts +2 -3
  334. package/es/ts-types/theme.js.map +1 -1
  335. package/es/vrender.js +3 -2
  336. package/es/vrender.js.map +1 -1
  337. package/package.json +8 -8
  338. package/cjs/scenegraph/component/menu.d.ts +0 -41
  339. package/cjs/scenegraph/utils/text-measure.d.ts +0 -33
  340. package/es/scenegraph/component/menu.d.ts +0 -41
  341. package/es/scenegraph/utils/text-measure.d.ts +0 -33
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/refresh-node/update-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAM7C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,MAAM,UAAU,gCAAgC,CAAC,UAAsB,EAAE,GAAW;;IAElF,KAAK,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnD,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAG9C,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,WAAW,EAAE,0CAAE,OAAO,CAAC,CAAC,QAAe,EAAE,EAAE;YACtD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YACzD,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,C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C;oBACH,IAAI,eAAe,EAAE;wBACnB,MAAM,UAAU,GAAG,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,yBAAyB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;wBAC/F,MAAM,SAAS,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;wBAC1D,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;wBACvF,MAAM,aAAa,GAAmB,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;wBACnE,MAAM,IAAI,GAAG,IAAI,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;wBACxG,IAAI,CAAC,KAAK,EAAE,CAAC;wBACb,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;wBACjC,IAAI,CAAC,OAAO,EAAE,CAAC;qBAChB;iBACF;YACH,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC","file":"update-chart.js","sourcesContent":["import { isEqual } from '@visactor/vutils';\nimport type { PivotChart } from '../../PivotChart';\nimport type { ICartesianAxis } from '../../components/axis/axis';\nimport { Factory } from '../../core/factory';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { Chart } from '../graphic/chart';\nimport type { Group } from '../graphic/group';\nimport type { Scenegraph } from '../scenegraph';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { getQuadProps } from '../utils/padding';\nimport { getProp } from '../utils/get-prop';\n\n/** 供调整列宽后更新chart使用 */\nexport function updateChartSizeForResizeColWidth(scenegraph: Scenegraph, col: number) {\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n for (let c = col; c <= scenegraph.proxy.colEnd; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n // const chartInstance = (columnGroup.attribute as any)?.chartInstance;\n // if (chartInstance) {\n columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n const width = scenegraph.table.getColWidth(cellNode.col);\n const height = scenegraph.table.getRowHeight(cellNode.row);\n\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n // 调试问题使用\n // if (columnGroup.col === 2) {\n // columnGroup.AABBBounds.width();\n // node.AABBBounds.width();\n // console.log(\n // 'set viewbox y1',\n // Math.ceil(cellNode.globalAABBBounds.y1 + node.attribute.cellPadding[0] + scenegraph.table.scrollTop),\n // node.globalAABBBounds.height()\n // );\n\n // console.log(\n // 'updateChartSize',\n // columnGroup,\n // columnGroup.globalAABBBounds.y1,\n // cellNode.globalAABBBounds.y1,\n // node.globalAABBBounds.y1\n // );\n // }\n\n node.cacheCanvas = null;\n node.setAttribute('width', Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1]));\n node.setAttribute(\n 'height',\n Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2])\n );\n\n // node.setAttribute('viewBox', {\n // x1: Math.ceil(cellNode.globalAABBBounds.x1 + node.attribute.cellPadding[3] + scenegraph.table.scrollLeft),\n // x2: Math.ceil(\n // cellNode.globalAABBBounds.x1 + width - node.attribute.cellPadding[1] + scenegraph.table.scrollLeft\n // ),\n // y1: Math.ceil(cellNode.globalAABBBounds.y1 + node.attribute.cellPadding[0] + scenegraph.table.scrollTop),\n // y2: Math.ceil(\n // cellNode.globalAABBBounds.y1 + height - node.attribute.cellPadding[2] + scenegraph.table.scrollTop\n // )\n // });\n }\n });\n });\n // }\n }\n // 右侧冻结的单元格也需要调整\n if (!scenegraph.table.isPivotChart() && scenegraph.table.rightFrozenColCount >= 1) {\n for (\n let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount;\n c <= scenegraph.table.colCount - 1;\n c++\n ) {\n const columnGroup = scenegraph.getColGroup(c);\n columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n const width = scenegraph.table.getColWidth(cellNode.col);\n const height = scenegraph.table.getRowHeight(cellNode.row);\n\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.cacheCanvas = null;\n node.setAttribute(\n 'width',\n Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1])\n );\n node.setAttribute(\n 'height',\n Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2])\n );\n }\n });\n });\n }\n }\n}\n/** 供调整列宽后更新chart使用 */\nexport function updateChartSizeForResizeRowHeight(scenegraph: Scenegraph, row: number) {\n const updateCellNode = (c: number, r: number) => {\n const cellNode = scenegraph.getCell(c, r);\n const width = scenegraph.table.getColWidth(cellNode.col);\n const height = scenegraph.table.getRowHeight(cellNode.row);\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.cacheCanvas = null;\n console.log('bf', c, r, node.attribute.width, node.attribute.height);\n\n node.setAttribute('width', Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1]));\n node.setAttribute('height', Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2]));\n console.log('af', c, r, node.attribute.width, node.attribute.height);\n }\n });\n };\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {\n for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {\n updateCellNode(c, r);\n }\n }\n\n // 右侧冻结的单元格也需要调整\n if (scenegraph.table.rightFrozenColCount >= 1) {\n for (\n let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount;\n c <= scenegraph.table.colCount - 1;\n c++\n ) {\n for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {\n updateCellNode(c, r);\n }\n }\n }\n // 左侧冻结的单元格\n if (scenegraph.table.frozenColCount >= 1) {\n for (let c = 0; c <= scenegraph.table.frozenColCount - 1; c++) {\n for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {\n updateCellNode(c, r);\n }\n }\n }\n}\n/** 清理所有chart节点的 图表缓存图片 */\nexport function clearChartCacheImage(scenegraph: Scenegraph) {\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.cacheCanvas = null;\n node.addUpdateBoundTag();\n }\n });\n });\n }\n}\n\n/** 更新所有的图表chart节点上缓存attribute中的data数据 */\nexport function updateChartData(scenegraph: Scenegraph) {\n const table = scenegraph.table;\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n const col = cellNode.col;\n const row = cellNode.row;\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.updateData(table.getCellValue(col, row));\n const newAxes = table.internalProps.layoutMap.getChartAxes(col, row);\n node.setAttribute('axes', newAxes);\n const chartSpec = node.attribute.spec;\n chartSpec.axes = newAxes;\n node.setAttribute('spec', chartSpec);\n // node.addUpdateBoundTag();\n }\n });\n });\n }\n\n // update left axes\n updateTableAxes(scenegraph.rowHeaderGroup, scenegraph.table);\n // update top axes\n updateTableAxes(scenegraph.colHeaderGroup, scenegraph.table);\n // update right axes\n updateTableAxes(scenegraph.rightFrozenGroup, scenegraph.table);\n // update bottom axes\n updateTableAxes(scenegraph.bottomFrozenGroup, scenegraph.table);\n}\n/** 组织图表数据状态_selectedDataItemsInChart 更新选中的图表图元状态 */\nexport function updateChartState(scenegraph: Scenegraph, datum: any) {\n const table = scenegraph.table;\n if (table.isPivotChart()) {\n const preSelectItemsCount = (table as PivotChart)._selectedDataItemsInChart.length;\n if ((datum === null || datum?.length === 0 || Object.keys(datum).length === 0) && preSelectItemsCount === 0) {\n //避免无效的更新\n return;\n }\n // (table as PivotChart)._selectedDataItemsInChart = [];\n const newSelectedDataItemsInChart = [];\n if (Array.isArray(datum)) {\n datum.forEach((dataItem: any) => {\n if (dataItem && dataItem.key !== 0 && Object.keys(dataItem).length > 0) {\n //本以为没有点击到图元上 datum为空 发现是{key:0}或者{}\n const selectedState = {};\n for (const itemKey in dataItem) {\n if (!itemKey.startsWith('VGRAMMAR_') && !itemKey.startsWith('__VCHART')) {\n selectedState[itemKey] = dataItem[itemKey];\n }\n }\n newSelectedDataItemsInChart.push(selectedState);\n }\n });\n } else if (datum && datum.key !== 0 && Object.keys(datum).length > 0) {\n //本以为没有点击到图元上 datum为空 发现是{key:0}或者{}\n const selectedState = {};\n for (const itemKey in datum) {\n if (!itemKey.startsWith('VGRAMMAR_') && !itemKey.startsWith('__VCHART')) {\n selectedState[itemKey] = datum[itemKey];\n }\n }\n newSelectedDataItemsInChart.push(selectedState);\n }\n //避免无效的更新\n if (!isEqual((table as PivotChart)._selectedDataItemsInChart, newSelectedDataItemsInChart)) {\n (table as PivotChart)._selectedDataItemsInChart = newSelectedDataItemsInChart;\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).updateDataStateToChartInstance();\n // 清楚chart缓存图片\n clearChartCacheImage(scenegraph);\n table.scenegraph.updateNextFrame();\n }\n }\n}\n\n/**\n * @description: update table axis component\n * @param {Group} containerGroup\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction updateTableAxes(containerGroup: Group, table: BaseTableAPI) {\n containerGroup.forEachChildren((column: Group) => {\n if (column.role === 'column') {\n column.forEachChildren((cell: Group) => {\n if (cell.role === 'cell') {\n let isAxisComponent = false;\n cell.forEachChildren((mark: Group) => {\n if (mark.name === 'axis') {\n isAxisComponent = true;\n return true;\n }\n return false;\n });\n if (isAxisComponent) {\n const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(cell.col, cell.row);\n const cellStyle = table._getCellStyle(cell.col, cell.row);\n const padding = getQuadProps(getProp('padding', cellStyle, cell.col, cell.row, table));\n const CartesianAxis: ICartesianAxis = Factory.getComponent('axis');\n const axis = new CartesianAxis(axisConfig, cell.attribute.width, cell.attribute.height, padding, table);\n cell.clear();\n cell.appendChild(axis.component);\n axis.overlap();\n }\n }\n });\n }\n });\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/refresh-node/update-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAM7C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,MAAM,UAAU,gCAAgC,CAAC,UAAsB,EAAE,GAAW;IAClF,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC;IAC7B,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,SAAiC,CAAC;IACrE,MAAM,gBAAgB,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC;IAEnF,IAAI,gBAAgB,KAAK,QAAQ,EAAE;QACjC,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAChD,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,eAAe,CAAC,CAAC,QAAe,EAAE,EAAE;YAC/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;wBACb,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;wBACjC,IAAI,CAAC,OAAO,EAAE,CAAC;qBAChB;iBACF;YACH,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,sBAAsB,CAAC,QAAe,EAAE,KAAa,EAAE,MAAc;IAC5E,QAAQ,CAAC,eAAe,CAAC,CAAC,OAAc,EAAE,EAAE;QAC1C,IAAK,OAAe,CAAC,IAAI,KAAK,OAAO,EAAE;YACrC,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;YAC3B,OAAO,CAAC,aAAa,CAAC;gBACpB,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;gBAC7F,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;aAChG,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC","file":"update-chart.js","sourcesContent":["import { isEqual } from '@visactor/vutils';\nimport type { PivotChart } from '../../PivotChart';\nimport type { ICartesianAxis } from '../../components/axis/axis';\nimport { Factory } from '../../core/factory';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { Chart } from '../graphic/chart';\nimport type { Group } from '../graphic/group';\nimport type { Scenegraph } from '../scenegraph';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { getQuadProps } from '../utils/padding';\nimport { getProp } from '../utils/get-prop';\n\n/** 供调整列宽后更新chart使用 */\nexport function updateChartSizeForResizeColWidth(scenegraph: Scenegraph, col: number) {\n const { table } = scenegraph;\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n const columnResizeType = col === -1 ? 'all' : table.internalProps.columnResizeType;\n\n if (columnResizeType === 'column') {\n const columnGroup = scenegraph.getColGroup(col);\n columnGroup?.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n if (table.widthMode === 'adaptive' && col < table.colCount - 1) {\n const columnGroup = scenegraph.getColGroup(col + 1);\n columnGroup?.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n }\n } else {\n let startCol = table.rowHeaderLevelCount;\n let endCol = table.colCount - 1;\n let resizeIndicatorKey;\n let resizeDimensionKey;\n let resizeDimensionValue;\n if (columnResizeType === 'indicator') {\n if (layout.indicatorsAsCol) {\n resizeIndicatorKey = layout.getIndicatorKey(col, table.columnHeaderLevelCount);\n } else {\n const headerPaths = layout.getCellHeaderPaths(col, table.columnHeaderLevelCount - 1);\n const headerPath = headerPaths.colHeaderPaths[headerPaths.colHeaderPaths.length - 1];\n resizeDimensionKey = headerPath.dimensionKey;\n resizeDimensionValue = headerPath.value;\n }\n } else if (columnResizeType === 'indicatorGroup') {\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n //通过getCellHeaderPaths接口获取列表头最后一层指标维度的path\n const headerPaths = layout.getCellHeaderPaths(table.stateManager.columnResize.col, table.columnHeaderLevelCount);\n const node = layout.getHeadNodeByRowOrColDimensions(\n headerPaths.colHeaderPaths.slice(0, headerPaths.colHeaderPaths.length - 1)\n ) as any;\n // 计算宽度受影响列的起止\n startCol = node.startInTotal + table.frozenColCount;\n endCol = node.startInTotal + table.frozenColCount + node.size - 1;\n }\n\n for (let c = startCol; c <= endCol; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n if (columnGroup) {\n if (columnResizeType === 'indicator') {\n const indicatorKey = layout.getIndicatorKey(c, table.columnHeaderLevelCount);\n if (layout.indicatorsAsCol && indicatorKey !== resizeIndicatorKey) {\n continue;\n } else if (!layout.indicatorsAsCol) {\n const headerPaths = layout.getCellHeaderPaths(c, table.columnHeaderLevelCount - 1);\n const headerPath = headerPaths?.colHeaderPaths[headerPaths.colHeaderPaths.length - 1];\n if (\n !headerPath ||\n resizeDimensionKey !== headerPath.dimensionKey ||\n resizeDimensionValue !== headerPath.value\n ) {\n continue;\n }\n }\n }\n columnGroup.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n }\n }\n }\n\n // // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n // for (let c = col; c <= scenegraph.proxy.colEnd; c++) {\n // const columnGroup = scenegraph.getColGroup(c);\n // // const chartInstance = (columnGroup.attribute as any)?.chartInstance;\n // // if (chartInstance) {\n // columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n // const width = scenegraph.table.getColWidth(cellNode.col);\n // const height = scenegraph.table.getRowHeight(cellNode.row);\n\n // cellNode.children.forEach((node: Chart) => {\n // if ((node as any).type === 'chart') {\n // node.cacheCanvas = null;\n // node.setAttribute('width', Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1]));\n // node.setAttribute(\n // 'height',\n // Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2])\n // );\n // }\n // });\n // });\n // // }\n // }\n // // 右侧冻结的单元格也需要调整\n // if (!scenegraph.table.isPivotChart() && scenegraph.table.rightFrozenColCount >= 1) {\n // for (\n // let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount;\n // c <= scenegraph.table.colCount - 1;\n // c++\n // ) {\n // const columnGroup = scenegraph.getColGroup(c);\n // columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n // const width = scenegraph.table.getColWidth(cellNode.col);\n // const height = scenegraph.table.getRowHeight(cellNode.row);\n\n // cellNode.children.forEach((node: Chart) => {\n // if ((node as any).type === 'chart') {\n // node.cacheCanvas = null;\n // node.setAttribute(\n // 'width',\n // Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1])\n // );\n // node.setAttribute(\n // 'height',\n // Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2])\n // );\n // }\n // });\n // });\n // }\n // }\n}\n/** 供调整列宽后更新chart使用 */\nexport function updateChartSizeForResizeRowHeight(scenegraph: Scenegraph, row: number) {\n const { table } = scenegraph;\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n const state = table.stateManager;\n const rowResizeType = row === -1 ? 'all' : table.internalProps.rowResizeType;\n\n let startRow = table.columnHeaderLevelCount;\n let endRow = table.rowCount - 1;\n let resizeIndicatorKey;\n let resizeDimensionKey;\n let resizeDimensionValue;\n if (rowResizeType === 'indicator') {\n if (!layout.indicatorsAsCol) {\n resizeIndicatorKey = layout.getIndicatorKey(table.rowHeaderLevelCount, row);\n } else {\n const headerPaths = layout.getCellHeaderPaths(table.rowHeaderLevelCount - 1, row);\n const headerPath = headerPaths.rowHeaderPaths?.[headerPaths.rowHeaderPaths.length - 1];\n resizeDimensionKey = headerPath?.dimensionKey;\n resizeDimensionValue = headerPath?.value;\n }\n } else if (rowResizeType === 'indicatorGroup') {\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n //通过getCellHeaderPaths接口获取列表头最后一层指标维度的path\n const headerPaths = layout.getCellHeaderPaths(table.rowHeaderLevelCount, row);\n const node = layout.getHeadNodeByRowOrColDimensions(\n headerPaths.rowHeaderPaths.slice(0, headerPaths.rowHeaderPaths.length - 1)\n ) as any;\n // 计算宽度受影响列的起止\n startRow = node.startInTotal + table.frozenRowCount;\n endRow = node.startInTotal + table.frozenRowCount + node.size - 1;\n }\n\n for (let col = scenegraph.proxy.colStart; col <= scenegraph.proxy.colEnd; col++) {\n if (rowResizeType === 'row') {\n const cellNode = scenegraph.highPerformanceGetCell(col, row);\n if (cellNode.role !== 'cell') {\n continue;\n }\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n\n if (table.heightMode === 'adaptive' && row < table.rowCount - 1) {\n const cellNode = scenegraph.highPerformanceGetCell(col, row + 1);\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n }\n } else {\n for (let r = startRow; r <= endRow; r++) {\n if (rowResizeType === 'indicator') {\n const indicatorKey = layout.getIndicatorKey(state.table.rowHeaderLevelCount, r);\n if (!layout.indicatorsAsCol && indicatorKey !== resizeIndicatorKey) {\n continue;\n } else if (layout.indicatorsAsCol) {\n const headerPaths = layout.getCellHeaderPaths(state.table.rowHeaderLevelCount - 1, r);\n const headerPath = headerPaths?.rowHeaderPaths[headerPaths.rowHeaderPaths.length - 1];\n if (\n !headerPath ||\n resizeDimensionKey !== headerPath.dimensionKey ||\n resizeDimensionValue !== headerPath.value\n ) {\n continue;\n }\n }\n }\n const cellNode = scenegraph.highPerformanceGetCell(col, r);\n if (cellNode.role !== 'cell') {\n continue;\n }\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n }\n }\n }\n\n // const updateCellNode = (c: number, r: number) => {\n // const cellNode = scenegraph.getCell(c, r);\n // const width = scenegraph.table.getColWidth(cellNode.col);\n // const height = scenegraph.table.getRowHeight(cellNode.row);\n // cellNode.children.forEach((node: Chart) => {\n // if ((node as any).type === 'chart') {\n // node.cacheCanvas = null;\n // console.log('bf', c, r, node.attribute.width, node.attribute.height);\n\n // node.setAttribute('width', Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1]));\n // node.setAttribute('height', Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2]));\n // console.log('af', c, r, node.attribute.width, node.attribute.height);\n // }\n // });\n // };\n // // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n // for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {\n // for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {\n // updateCellNode(c, r);\n // }\n // }\n\n // // 右侧冻结的单元格也需要调整\n // if (scenegraph.table.rightFrozenColCount >= 1) {\n // for (\n // let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount;\n // c <= scenegraph.table.colCount - 1;\n // c++\n // ) {\n // for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {\n // updateCellNode(c, r);\n // }\n // }\n // }\n // // 左侧冻结的单元格\n // if (scenegraph.table.frozenColCount >= 1) {\n // for (let c = 0; c <= scenegraph.table.frozenColCount - 1; c++) {\n // for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {\n // updateCellNode(c, r);\n // }\n // }\n // }\n}\n/** 清理所有chart节点的 图表缓存图片 */\nexport function clearChartCacheImage(scenegraph: Scenegraph) {\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.cacheCanvas = null;\n node.addUpdateBoundTag();\n }\n });\n });\n }\n}\n\nexport function clearCellChartCacheImage(col: number, row: number, scenegraph: Scenegraph) {\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n const cellGroup = scenegraph.getCell(col, row);\n cellGroup.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.cacheCanvas = null;\n node.addUpdateBoundTag();\n }\n });\n}\n\n/** 更新所有的图表chart节点上缓存attribute中的data数据 */\nexport function updateChartData(scenegraph: Scenegraph) {\n const table = scenegraph.table;\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n const col = cellNode.col;\n const row = cellNode.row;\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.updateData(table.getCellValue(col, row));\n const newAxes = table.internalProps.layoutMap.getChartAxes(col, row);\n node.setAttribute('axes', newAxes);\n const chartSpec = node.attribute.spec;\n chartSpec.axes = newAxes;\n node.setAttribute('spec', chartSpec);\n // node.addUpdateBoundTag();\n }\n });\n });\n }\n\n // update left axes\n updateTableAxes(scenegraph.rowHeaderGroup, scenegraph.table);\n // update top axes\n updateTableAxes(scenegraph.colHeaderGroup, scenegraph.table);\n // update right axes\n updateTableAxes(scenegraph.rightFrozenGroup, scenegraph.table);\n // update bottom axes\n updateTableAxes(scenegraph.bottomFrozenGroup, scenegraph.table);\n}\n/** 组织图表数据状态_selectedDataItemsInChart 更新选中的图表图元状态 */\nexport function updateChartState(scenegraph: Scenegraph, datum: any) {\n const table = scenegraph.table;\n if (table.isPivotChart()) {\n const preSelectItemsCount = (table as PivotChart)._selectedDataItemsInChart.length;\n if ((datum === null || datum?.length === 0 || Object.keys(datum).length === 0) && preSelectItemsCount === 0) {\n //避免无效的更新\n return;\n }\n // (table as PivotChart)._selectedDataItemsInChart = [];\n const newSelectedDataItemsInChart = [];\n if (Array.isArray(datum)) {\n datum.forEach((dataItem: any) => {\n if (dataItem && dataItem.key !== 0 && Object.keys(dataItem).length > 0) {\n //本以为没有点击到图元上 datum为空 发现是{key:0}或者{}\n const selectedState = {} as any;\n for (const itemKey in dataItem) {\n if (!itemKey.startsWith('VGRAMMAR_') && !itemKey.startsWith('__VCHART')) {\n selectedState[itemKey] = dataItem[itemKey];\n }\n }\n newSelectedDataItemsInChart.push(selectedState);\n }\n });\n } else if (datum && datum.key !== 0 && Object.keys(datum).length > 0) {\n //本以为没有点击到图元上 datum为空 发现是{key:0}或者{}\n const selectedState = {} as any;\n for (const itemKey in datum) {\n if (!itemKey.startsWith('VGRAMMAR_') && !itemKey.startsWith('__VCHART')) {\n selectedState[itemKey] = datum[itemKey];\n }\n }\n newSelectedDataItemsInChart.push(selectedState);\n }\n //避免无效的更新\n if (!isEqual((table as PivotChart)._selectedDataItemsInChart, newSelectedDataItemsInChart)) {\n (table as PivotChart)._selectedDataItemsInChart = newSelectedDataItemsInChart;\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).updateDataStateToChartInstance();\n // 清楚chart缓存图片\n clearChartCacheImage(scenegraph);\n table.scenegraph.updateNextFrame();\n }\n }\n}\n\n/**\n * @description: update table axis component\n * @param {Group} containerGroup\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction updateTableAxes(containerGroup: Group, table: BaseTableAPI) {\n containerGroup.forEachChildren((column: Group) => {\n if (column.role === 'column') {\n column.forEachChildren((cell: Group) => {\n if (cell.role === 'cell') {\n let isAxisComponent = false;\n cell.forEachChildren((mark: Group) => {\n if (mark.name === 'axis') {\n isAxisComponent = true;\n return true;\n }\n return false;\n });\n if (isAxisComponent) {\n const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(cell.col, cell.row);\n const cellStyle = table._getCellStyle(cell.col, cell.row);\n const padding = getQuadProps(getProp('padding', cellStyle, cell.col, cell.row, table));\n const CartesianAxis: ICartesianAxis = Factory.getComponent('axis');\n const axis = new CartesianAxis(axisConfig, cell.attribute.width, cell.attribute.height, padding, table);\n cell.clear();\n cell.appendChild(axis.component);\n axis.overlap();\n }\n }\n });\n }\n });\n}\n\nfunction updateChartGraphicSize(cellNode: Group, width: number, height: number) {\n cellNode.forEachChildren((graphic: Chart) => {\n if ((graphic as any).type === 'chart') {\n graphic.cacheCanvas = null;\n graphic.setAttributes({\n width: Math.ceil(width - graphic.attribute.cellPadding[3] - graphic.attribute.cellPadding[1]),\n height: Math.ceil(height - graphic.attribute.cellPadding[0] - graphic.attribute.cellPadding[2])\n });\n }\n });\n}\n"]}
@@ -100,7 +100,7 @@ export declare class Scenegraph {
100
100
  recreateAllSelectRangeComponents(): void;
101
101
  updateColWidth(col: number, detaX: number, skipUpdateContainer?: boolean, skipTableWidthMap?: boolean): void;
102
102
  updateChartSizeForResizeColWidth(col: number): void;
103
- updateChartSizeForResizeRowHeight(col: number): void;
103
+ updateChartSizeForResizeRowHeight(row: number): void;
104
104
  updateChartState(datum: any): void;
105
105
  updateCheckboxCellState(col: number, row: number, checked: boolean): void;
106
106
  updateHeaderCheckboxCellState(col: number, row: number, checked: boolean | 'indeterminate'): void;
@@ -76,7 +76,8 @@ export class Scenegraph {
76
76
  constructor(table) {
77
77
  let width, height;
78
78
  this._needUpdateContainer = !1, this.table = table, this.hasFrozen = !1, this.clear = !0,
79
- this.mergeMap = new Map, setPoptipTheme(this.table.theme.textPopTipStyle), "node" === Env.mode ? (vglobal.setEnv("node", table.options.modeParams),
79
+ this.mergeMap = new Map, setPoptipTheme(this.table.theme.textPopTipStyle), table.options.canvas && table.options.viewBox ? (vglobal.setEnv("browser"),
80
+ width = table.options.viewBox.x2 - table.options.viewBox.x1, height = table.options.viewBox.y2 - table.options.viewBox.y1) : "node" === Env.mode ? (vglobal.setEnv("node", table.options.modeParams),
80
81
  width = table.canvasWidth, height = table.canvasHeight) : (vglobal.setEnv("browser"),
81
82
  width = table.canvas.width, height = table.canvas.height), this.stage = createStage(Object.assign({
82
83
  canvas: table.canvas,
@@ -86,9 +87,14 @@ export class Scenegraph {
86
87
  background: table.theme.underlayBackgroundColor,
87
88
  dpr: table.internalProps.pixelRatio,
88
89
  enableLayout: !0,
89
- afterRender: () => {
90
- this.table.fireListeners("after_render", null);
91
- }
90
+ beforeRender: stage => {
91
+ this.table.options.beforeRender && this.table.options.beforeRender(stage);
92
+ },
93
+ afterRender: stage => {
94
+ this.table.options.afterRender && this.table.options.afterRender(stage), this.table.fireListeners("after_render", null);
95
+ },
96
+ canvasControled: !table.options.canvas,
97
+ viewBox: table.options.viewBox
92
98
  }, table.options.renderOption)), this.stage.defaultLayer.setTheme({
93
99
  group: {
94
100
  boundsPadding: 0,
@@ -353,8 +359,8 @@ export class Scenegraph {
353
359
  updateChartSizeForResizeColWidth(col) {
354
360
  updateChartSizeForResizeColWidth(this, col);
355
361
  }
356
- updateChartSizeForResizeRowHeight(col) {
357
- updateChartSizeForResizeRowHeight(this, col);
362
+ updateChartSizeForResizeRowHeight(row) {
363
+ updateChartSizeForResizeRowHeight(this, row);
358
364
  }
359
365
  updateChartState(datum) {
360
366
  this.table.isPivotChart() && updateChartState(this, datum);
@@ -413,47 +419,59 @@ export class Scenegraph {
413
419
  this.proxy.resize(), ("adaptive" === this.table.widthMode || this.table.autoFillWidth) && (0 === this.table.internalProps._widthResizedColMap.size ? this.recalculateColWidths() : this.dealWidthMode()),
414
420
  "adaptive" === this.table.heightMode ? 0 === this.table.internalProps._heightResizedRowMap.size ? this.recalculateRowHeights() : this.dealHeightMode() : this.table.autoFillHeight && this.dealHeightMode(),
415
421
  this.resetFrozen(), this.updateTableSize(), this.updateBorderSizeAndPosition(),
416
- this.component.updateScrollBar(), ("adaptive" === this.table.widthMode || "adaptive" === this.table.heightMode || this.table.autoFillWidth || this.table.autoFillHeight) && this.updateChartSizeForResizeColWidth(this.table.rowHeaderLevelCount),
422
+ this.component.updateScrollBar(), ("adaptive" === this.table.widthMode || "adaptive" === this.table.heightMode || this.table.autoFillWidth || this.table.autoFillHeight) && this.updateChartSizeForResizeColWidth(-1),
417
423
  this.proxy.progress(), this.updateNextFrame();
418
424
  }
419
425
  updateTableSize() {
420
- var _a, _b, _c, _d;
421
- this.tableGroup.setAttributes({
426
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
427
+ if (this.tableGroup.setAttributes({
422
428
  x: this.table.tableX,
423
429
  y: this.table.tableY,
424
430
  width: Math.min(this.table.tableNoFrameWidth, Math.max(this.colHeaderGroup.attribute.width, this.bodyGroup.attribute.width, this.bottomFrozenGroup.attribute.width, 0) + Math.max(this.cornerHeaderGroup.attribute.width, this.rowHeaderGroup.attribute.width, this.leftBottomCornerGroup.attribute.width, 0) + Math.max(this.rightTopCornerGroup.attribute.width, this.rightFrozenGroup.attribute.width, this.rightBottomCornerGroup.attribute.width, 0)),
425
431
  height: Math.min(this.table.tableNoFrameHeight, Math.max(this.colHeaderGroup.attribute.height, this.cornerHeaderGroup.attribute.height, this.rightTopCornerGroup.attribute.height, 0) + Math.max(this.rowHeaderGroup.attribute.height, this.bodyGroup.attribute.height, this.rightFrozenGroup.attribute.height, 0) + Math.max(this.leftBottomCornerGroup.attribute.height, this.bottomFrozenGroup.attribute.height, this.rightBottomCornerGroup.attribute.height, 0))
426
- }), this.tableGroup.border && "rect" === this.tableGroup.border.type ? (null === (_a = this.table.theme.frameStyle) || void 0 === _a ? void 0 : _a.innerBorder) ? this.tableGroup.border.setAttributes({
427
- x: this.table.tableX + this.tableGroup.border.attribute.lineWidth / 2,
428
- y: this.table.tableY + this.tableGroup.border.attribute.lineWidth / 2,
429
- width: this.tableGroup.attribute.width - this.tableGroup.border.attribute.lineWidth,
430
- height: this.tableGroup.attribute.height - this.tableGroup.border.attribute.lineWidth
431
- }) : this.tableGroup.border.setAttributes({
432
- x: this.table.tableX - this.tableGroup.border.attribute.lineWidth / 2,
433
- y: this.table.tableY - this.tableGroup.border.attribute.lineWidth / 2,
434
- width: this.tableGroup.attribute.width + this.tableGroup.border.attribute.lineWidth,
435
- height: this.tableGroup.attribute.height + this.tableGroup.border.attribute.lineWidth
436
- }) : this.tableGroup.border && "group" === this.tableGroup.border.type && ((null === (_b = this.table.theme.frameStyle) || void 0 === _b ? void 0 : _b.innerBorder) ? (this.tableGroup.border.setAttributes({
437
- x: this.table.tableX + this.tableGroup.border.attribute.lineWidth / 2,
438
- y: this.table.tableY + this.tableGroup.border.attribute.lineWidth / 2,
439
- width: this.tableGroup.attribute.width - this.tableGroup.border.attribute.lineWidth,
440
- height: this.tableGroup.attribute.height - this.tableGroup.border.attribute.lineWidth
441
- }), null === (_c = this.tableGroup.border.firstChild) || void 0 === _c || _c.setAttributes({
442
- x: 0,
443
- y: 0,
444
- width: this.tableGroup.attribute.width - this.tableGroup.border.attribute.lineWidth,
445
- height: this.tableGroup.attribute.height - this.tableGroup.border.attribute.lineWidth
446
- })) : (this.tableGroup.border.setAttributes({
447
- x: this.table.tableX - this.tableGroup.border.attribute.lineWidth / 2,
448
- y: this.table.tableY - this.tableGroup.border.attribute.lineWidth / 2,
449
- width: this.tableGroup.attribute.width + this.tableGroup.border.attribute.lineWidth,
450
- height: this.tableGroup.attribute.height + this.tableGroup.border.attribute.lineWidth
451
- }), null === (_d = this.tableGroup.border.firstChild) || void 0 === _d || _d.setAttributes({
452
- x: this.tableGroup.border.attribute.lineWidth / 2,
453
- y: this.tableGroup.border.attribute.lineWidth / 2,
454
- width: this.tableGroup.attribute.width,
455
- height: this.tableGroup.attribute.height
456
- }))), this.table.bottomFrozenRowCount > 0 && (this.bottomFrozenGroup.setAttribute("y", this.tableGroup.attribute.height - this.table.getBottomFrozenRowsHeight()),
432
+ }), this.tableGroup.border) {
433
+ const rectAttributes = null === (_a = this.tableGroup.border) || void 0 === _a ? void 0 : _a.attribute;
434
+ let borderTop, borderRight, borderBottom, borderLeft;
435
+ (null == rectAttributes ? void 0 : rectAttributes.strokeArrayWidth) ? (borderTop = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[0] : null !== (_b = rectAttributes.lineWidth) && void 0 !== _b ? _b : 0,
436
+ borderRight = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[1] : null !== (_c = rectAttributes.lineWidth) && void 0 !== _c ? _c : 0,
437
+ borderBottom = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[2] : null !== (_d = rectAttributes.lineWidth) && void 0 !== _d ? _d : 0,
438
+ borderLeft = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[3] : null !== (_e = rectAttributes.lineWidth) && void 0 !== _e ? _e : 0) : (borderTop = null !== (_f = null == rectAttributes ? void 0 : rectAttributes.lineWidth) && void 0 !== _f ? _f : 0,
439
+ borderRight = null !== (_g = null == rectAttributes ? void 0 : rectAttributes.lineWidth) && void 0 !== _g ? _g : 0,
440
+ borderBottom = null !== (_h = null == rectAttributes ? void 0 : rectAttributes.lineWidth) && void 0 !== _h ? _h : 0,
441
+ borderLeft = null !== (_j = null == rectAttributes ? void 0 : rectAttributes.lineWidth) && void 0 !== _j ? _j : 0),
442
+ "rect" === this.tableGroup.border.type ? (null === (_k = this.table.theme.frameStyle) || void 0 === _k ? void 0 : _k.innerBorder) ? this.tableGroup.border.setAttributes({
443
+ x: this.table.tableX + borderLeft / 2,
444
+ y: this.table.tableY + borderTop / 2,
445
+ width: this.tableGroup.attribute.width - borderLeft / 2 - borderRight / 2,
446
+ height: this.tableGroup.attribute.height - borderTop / 2 - borderBottom / 2
447
+ }) : this.tableGroup.border.setAttributes({
448
+ x: this.table.tableX - borderLeft / 2,
449
+ y: this.table.tableY - borderTop / 2,
450
+ width: this.tableGroup.attribute.width + borderLeft / 2 + borderRight / 2,
451
+ height: this.tableGroup.attribute.height + borderTop / 2 + borderBottom / 2
452
+ }) : "group" === this.tableGroup.border.type && ((null === (_l = this.table.theme.frameStyle) || void 0 === _l ? void 0 : _l.innerBorder) ? (this.tableGroup.border.setAttributes({
453
+ x: this.table.tableX + borderLeft / 2,
454
+ y: this.table.tableY + borderTop / 2,
455
+ width: this.tableGroup.attribute.width - borderLeft / 2 - borderRight / 2,
456
+ height: this.tableGroup.attribute.height - borderTop / 2 - borderBottom / 2
457
+ }), null === (_m = this.tableGroup.border.firstChild) || void 0 === _m || _m.setAttributes({
458
+ x: 0,
459
+ y: 0,
460
+ width: this.tableGroup.attribute.width - borderLeft / 2 - borderRight / 2,
461
+ height: this.tableGroup.attribute.height - borderTop / 2 - borderBottom / 2
462
+ })) : (this.tableGroup.border.setAttributes({
463
+ x: this.table.tableX - borderLeft / 2,
464
+ y: this.table.tableY - borderTop / 2,
465
+ width: this.tableGroup.attribute.width + borderLeft / 2 + borderRight / 2,
466
+ height: this.tableGroup.attribute.height + borderTop / 2 + borderBottom / 2
467
+ }), null === (_o = this.tableGroup.border.firstChild) || void 0 === _o || _o.setAttributes({
468
+ x: borderLeft / 2,
469
+ y: borderTop / 2,
470
+ width: this.tableGroup.attribute.width,
471
+ height: this.tableGroup.attribute.height
472
+ })));
473
+ }
474
+ this.table.bottomFrozenRowCount > 0 && (this.bottomFrozenGroup.setAttribute("y", this.tableGroup.attribute.height - this.table.getBottomFrozenRowsHeight()),
457
475
  this.leftBottomCornerGroup.setAttributes({
458
476
  visible: !0,
459
477
  y: this.tableGroup.attribute.height - this.table.getBottomFrozenRowsHeight(),
@@ -679,7 +697,7 @@ export class Scenegraph {
679
697
  this.updateNextFrame());
680
698
  }
681
699
  updateCellContentWhileResize(col, row) {
682
- const type = this.table.getBodyColumnType(col, row), cellGroup = this.getCell(col, row);
700
+ const type = this.table.isHeader(col, row) ? this.table._getHeaderLayoutMap(col, row).headerType : this.table.getBodyColumnType(col, row), cellGroup = this.getCell(col, row);
683
701
  "image" !== type && "video" !== type || updateImageCellContentWhileResize(cellGroup, col, row, 0, 0, this.table);
684
702
  }
685
703
  createFrameBorder() {
@@ -815,10 +833,13 @@ export class Scenegraph {
815
833
  updateDomContainer() {
816
834
  var _a, _b, _c, _d, _e, _f;
817
835
  const {headerDomContainer: headerDomContainer, bodyDomContainer: bodyDomContainer} = this.table.internalProps;
818
- headerDomContainer && (headerDomContainer.style.width = `${null !== (_b = null === (_a = headerDomContainer.parentElement) || void 0 === _a ? void 0 : _a.offsetWidth) && void 0 !== _b ? _b : 0}px`,
819
- headerDomContainer.style.height = `${this.table.getFrozenRowsHeight()}px`), bodyDomContainer && (bodyDomContainer.style.width = `${null !== (_d = null === (_c = bodyDomContainer.parentElement) || void 0 === _c ? void 0 : _c.offsetWidth) && void 0 !== _d ? _d : 0}px`,
820
- bodyDomContainer.style.height = `${null !== (_f = null === (_e = bodyDomContainer.parentElement) || void 0 === _e ? void 0 : _e.offsetHeight) && void 0 !== _f ? _f : 0 - this.table.getFrozenRowsHeight()}px`,
821
- bodyDomContainer.style.top = `${this.table.getFrozenRowsHeight()}px`);
836
+ if (headerDomContainer && (headerDomContainer.style.width = (null !== (_b = null === (_a = headerDomContainer.parentElement) || void 0 === _a ? void 0 : _a.offsetWidth) && void 0 !== _b ? _b : 1) - 1 + "px",
837
+ headerDomContainer.style.height = `${this.table.getFrozenRowsHeight()}px`), bodyDomContainer) {
838
+ const totalFrozenRowsHeight = this.table.getFrozenRowsHeight() + this.table.getBottomFrozenRowsHeight();
839
+ bodyDomContainer.style.width = (null !== (_d = null === (_c = bodyDomContainer.parentElement) || void 0 === _c ? void 0 : _c.offsetWidth) && void 0 !== _d ? _d : 1) - 1 + "px",
840
+ bodyDomContainer.style.height = (null !== (_f = null === (_e = bodyDomContainer.parentElement) || void 0 === _e ? void 0 : _e.offsetHeight) && void 0 !== _f ? _f : 1) - 1 - totalFrozenRowsHeight + "px",
841
+ bodyDomContainer.style.top = `${this.table.getFrozenRowsHeight()}px`;
842
+ }
822
843
  }
823
844
  }
824
- //# sourceMappingURL=scenegraph.js.map
845
+ //# sourceMappingURL=scenegraph.js.map