@visactor/vtable 0.9.3-alpha.7 → 0.10.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 (179) hide show
  1. package/cjs/ListTable.js +6 -5
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotTable.js +2 -2
  4. package/cjs/PivotTable.js.map +1 -1
  5. package/cjs/components/axis/axis.d.ts +1 -0
  6. package/cjs/components/axis/axis.js +10 -1
  7. package/cjs/components/axis/axis.js.map +1 -1
  8. package/cjs/components/legend/legend.js +5 -3
  9. package/cjs/components/legend/legend.js.map +1 -1
  10. package/cjs/core/BaseTable.d.ts +4 -2
  11. package/cjs/core/BaseTable.js +33 -16
  12. package/cjs/core/BaseTable.js.map +1 -1
  13. package/cjs/event/drill.d.ts +2 -0
  14. package/cjs/event/drill.js +15 -2
  15. package/cjs/event/drill.js.map +1 -1
  16. package/cjs/event/event.js +2 -1
  17. package/cjs/event/event.js.map +1 -1
  18. package/cjs/event/pivot-chart/axis-click.js +3 -2
  19. package/cjs/event/pivot-chart/axis-click.js.map +1 -1
  20. package/cjs/index.d.ts +1 -1
  21. package/cjs/index.js +1 -1
  22. package/cjs/index.js.map +1 -1
  23. package/cjs/layout/chart-helper/get-axis-config.js +5 -5
  24. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
  25. package/cjs/layout/chart-helper/get-chart-spec.js +2 -2
  26. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  27. package/cjs/layout/pivot-layout.js +4 -2
  28. package/cjs/layout/pivot-layout.js.map +1 -1
  29. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  30. package/cjs/scenegraph/graphic/contributions/chart-render-helper.d.ts +8 -0
  31. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +66 -0
  32. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -0
  33. package/cjs/scenegraph/graphic/contributions/chart-render.js +9 -35
  34. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  35. package/cjs/scenegraph/group-creater/cell-helper.js +2 -1
  36. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  37. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +1 -1
  38. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  39. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +1 -1
  40. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  41. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -1
  42. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  43. package/cjs/scenegraph/group-creater/cell-type/text-cell.js +1 -1
  44. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  45. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +1 -1
  46. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  47. package/cjs/scenegraph/group-creater/column-helper.js +3 -3
  48. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  49. package/cjs/scenegraph/group-creater/init-scenegraph.d.ts +2 -0
  50. package/cjs/scenegraph/group-creater/init-scenegraph.js +61 -0
  51. package/cjs/scenegraph/group-creater/init-scenegraph.js.map +1 -0
  52. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +7 -2
  53. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  54. package/cjs/scenegraph/group-creater/progress/proxy.d.ts +1 -0
  55. package/cjs/scenegraph/group-creater/progress/proxy.js +9 -5
  56. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  57. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +35 -44
  58. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  59. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +3 -17
  60. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  61. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-column.d.ts +2 -0
  62. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-column.js +37 -0
  63. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-column.js.map +1 -0
  64. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
  65. package/cjs/scenegraph/group-creater/progress/update-position/util.d.ts +8 -0
  66. package/cjs/scenegraph/group-creater/progress/update-position/util.js +70 -0
  67. package/cjs/scenegraph/group-creater/progress/update-position/util.js.map +1 -0
  68. package/cjs/scenegraph/layout/frozen.d.ts +2 -0
  69. package/cjs/scenegraph/layout/frozen.js +139 -6
  70. package/cjs/scenegraph/layout/frozen.js.map +1 -1
  71. package/cjs/scenegraph/layout/update-height.js +2 -1
  72. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  73. package/cjs/scenegraph/layout/update-width.js +39 -64
  74. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  75. package/cjs/scenegraph/refresh-node/update-chart.js +8 -6
  76. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  77. package/cjs/scenegraph/scenegraph.d.ts +9 -4
  78. package/cjs/scenegraph/scenegraph.js +35 -97
  79. package/cjs/scenegraph/scenegraph.js.map +1 -1
  80. package/cjs/scenegraph/style/corner-cell.d.ts +2 -2
  81. package/cjs/scenegraph/style/corner-cell.js +8 -9
  82. package/cjs/scenegraph/style/corner-cell.js.map +1 -1
  83. package/cjs/state/hover/update-position.js +1 -1
  84. package/cjs/state/hover/update-position.js.map +1 -1
  85. package/cjs/ts-types/base-table.d.ts +7 -0
  86. package/cjs/ts-types/base-table.js.map +1 -1
  87. package/cjs/ts-types/table-engine.d.ts +1 -1
  88. package/cjs/ts-types/table-engine.js.map +1 -1
  89. package/dist/vtable.js +1086 -689
  90. package/dist/vtable.min.js +3 -3
  91. package/es/ListTable.js +6 -5
  92. package/es/ListTable.js.map +1 -1
  93. package/es/PivotTable.js +2 -2
  94. package/es/PivotTable.js.map +1 -1
  95. package/es/components/axis/axis.d.ts +1 -0
  96. package/es/components/axis/axis.js +10 -1
  97. package/es/components/axis/axis.js.map +1 -1
  98. package/es/components/legend/legend.js +5 -3
  99. package/es/components/legend/legend.js.map +1 -1
  100. package/es/core/BaseTable.d.ts +4 -2
  101. package/es/core/BaseTable.js +27 -9
  102. package/es/core/BaseTable.js.map +1 -1
  103. package/es/event/drill.d.ts +2 -0
  104. package/es/event/drill.js +13 -0
  105. package/es/event/drill.js.map +1 -1
  106. package/es/event/event.js +3 -3
  107. package/es/event/event.js.map +1 -1
  108. package/es/event/pivot-chart/axis-click.js +3 -2
  109. package/es/event/pivot-chart/axis-click.js.map +1 -1
  110. package/es/index.d.ts +1 -1
  111. package/es/index.js +1 -1
  112. package/es/index.js.map +1 -1
  113. package/es/layout/chart-helper/get-axis-config.js +5 -5
  114. package/es/layout/chart-helper/get-axis-config.js.map +1 -1
  115. package/es/layout/chart-helper/get-chart-spec.js +2 -2
  116. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  117. package/es/layout/pivot-layout.js +4 -2
  118. package/es/layout/pivot-layout.js.map +1 -1
  119. package/es/scenegraph/graphic/chart.js.map +1 -1
  120. package/es/scenegraph/graphic/contributions/chart-render-helper.d.ts +8 -0
  121. package/es/scenegraph/graphic/contributions/chart-render-helper.js +61 -0
  122. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -0
  123. package/es/scenegraph/graphic/contributions/chart-render.js +9 -34
  124. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  125. package/es/scenegraph/group-creater/cell-helper.js +2 -1
  126. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  127. package/es/scenegraph/group-creater/cell-type/chart-cell.js +1 -1
  128. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  129. package/es/scenegraph/group-creater/cell-type/image-cell.js +1 -1
  130. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  131. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -1
  132. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  133. package/es/scenegraph/group-creater/cell-type/text-cell.js +1 -1
  134. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  135. package/es/scenegraph/group-creater/cell-type/video-cell.js +1 -1
  136. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  137. package/es/scenegraph/group-creater/column-helper.js +3 -3
  138. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  139. package/es/scenegraph/group-creater/init-scenegraph.d.ts +2 -0
  140. package/es/scenegraph/group-creater/init-scenegraph.js +55 -0
  141. package/es/scenegraph/group-creater/init-scenegraph.js.map +1 -0
  142. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +6 -2
  143. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  144. package/es/scenegraph/group-creater/progress/proxy.d.ts +1 -0
  145. package/es/scenegraph/group-creater/progress/proxy.js +10 -3
  146. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  147. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +36 -44
  148. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  149. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +2 -17
  150. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  151. package/es/scenegraph/group-creater/progress/update-position/update-auto-column.d.ts +2 -0
  152. package/es/scenegraph/group-creater/progress/update-position/update-auto-column.js +29 -0
  153. package/es/scenegraph/group-creater/progress/update-position/update-auto-column.js.map +1 -0
  154. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
  155. package/es/scenegraph/group-creater/progress/update-position/util.d.ts +8 -0
  156. package/es/scenegraph/group-creater/progress/update-position/util.js +60 -0
  157. package/es/scenegraph/group-creater/progress/update-position/util.js.map +1 -0
  158. package/es/scenegraph/layout/frozen.d.ts +2 -0
  159. package/es/scenegraph/layout/frozen.js +137 -3
  160. package/es/scenegraph/layout/frozen.js.map +1 -1
  161. package/es/scenegraph/layout/update-height.js +2 -1
  162. package/es/scenegraph/layout/update-height.js.map +1 -1
  163. package/es/scenegraph/layout/update-width.js +39 -64
  164. package/es/scenegraph/layout/update-width.js.map +1 -1
  165. package/es/scenegraph/refresh-node/update-chart.js +9 -5
  166. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  167. package/es/scenegraph/scenegraph.d.ts +9 -4
  168. package/es/scenegraph/scenegraph.js +35 -100
  169. package/es/scenegraph/scenegraph.js.map +1 -1
  170. package/es/scenegraph/style/corner-cell.d.ts +2 -2
  171. package/es/scenegraph/style/corner-cell.js +4 -7
  172. package/es/scenegraph/style/corner-cell.js.map +1 -1
  173. package/es/state/hover/update-position.js +1 -1
  174. package/es/state/hover/update-position.js.map +1 -1
  175. package/es/ts-types/base-table.d.ts +7 -0
  176. package/es/ts-types/base-table.js.map +1 -1
  177. package/es/ts-types/table-engine.d.ts +1 -1
  178. package/es/ts-types/table-engine.js.map +1 -1
  179. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/layout/update-height.ts"],"names":[],"mappings":";;;AAEA,oFAAqF;AACrF,gFAAsF;AAEtF,4DAA2D;AAC3D,gDAA4C;AAC5C,8CAAgD;AAChD,gEAAoE;AAEpE,gDAAqD;AACrD,sEAA0F;AAC1F,wDAAuD;AAEvD,SAAgB,eAAe,CAAC,KAAiB,EAAE,GAAW,EAAE,KAAa;IAC3E,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;QACnD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACrC,MAAM,SAAS,GAAG,IAAA,iCAAgB,EAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAC1D,IA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CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YACnD,IAAI,QAAQ,KAAK,MAAM,EAAE;gBACvB,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;gBACrD,YAAY,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,kBAAkB,CAAC;gBAC1C,YAAY,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,kBAAkB,CAAC;aAC3C;iBAAM;gBACL,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;gBACzD,YAAY,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,KAAI,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC;gBAChE,YAAY,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,CAAC;aACrC;YACD,MAAM,YAAY,GAAG,IAAA,uBAAc,EACjC,YAAY,EACZ,YAAY,EACZ,GAAG,EACH,GAAG,EACH,IAAI,CAAC,SAAS,CAAC,KAAK,EACpB,IAAI,CAAC,SAAS,CAAC,MAAM,EACrB,KAAK,EACL,KAAK,EACL,KAAK,CAAC,KAAK,CACZ,CAAC;YACF,IAAI,IAAI,CAAC,aAAa,GAAG,CAAC,EAAE;gBAC1B,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;aAChE;iBAAM;gBACL,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;aAC9C;SACF;KACF;AACH,CAAC;AA9GD,4CA8GC","file":"update-height.js","sourcesContent":["import type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport type { Group } from '../graphic/group';\nimport { createProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentHeight } from '../utils/text-icon-layout';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport { dealWithCustom } from '../component/custom';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport { getStyleTheme } from '../../core/tableHelper';\n\nexport function updateRowHeight(scene: Scenegraph, row: number, detaY: number) {\n for (let col = 0; col < scene.table.colCount; col++) {\n const cell = scene.getCell(col, row);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.start.col !== col) {\n continue;\n }\n const height = cell.attribute.height;\n // cell.setAttribute('height', height);\n // (cell.firstChild as Rect).setAttribute('height', cell.attribute.height);\n updateCellHeightForRow(scene, cell, col, row, height, detaY, scene.table.isHeader(col, row));\n\n scene.updateCellContentWhileResize(col, row);\n }\n\n let rowStart = 0;\n let rowEnd = 0;\n // 更新header 高度\n if (row < scene.table.columnHeaderLevelCount) {\n scene.colHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height + detaY);\n scene.rowHeaderGroup.setAttribute('y', scene.colHeaderGroup.attribute.y + detaY);\n scene.bodyGroup.setAttribute('y', scene.bodyGroup.attribute.y + detaY);\n\n rowStart = row + 1;\n rowEnd = scene.table.columnHeaderLevelCount - 1;\n } else {\n rowStart = row + 1;\n // rowEnd = scene.table.rowCount - 1;\n rowEnd = scene.bodyRowEnd - scene.table.bottomFrozenRowCount;\n }\n\n // 更新以下行位置\n for (let rowIndex = rowStart; rowIndex <= rowEnd; rowIndex++) {\n // if (rowIndex === 2) debugger;\n for (let colIndex = 0; colIndex < scene.table.colCount; colIndex++) {\n const cellGroup = scene.getCell(colIndex, rowIndex);\n const mergeInfo = getCellMergeInfo(scene.table, colIndex, rowIndex);\n if (mergeInfo && (mergeInfo.start.col !== colIndex || mergeInfo.start.row !== rowIndex)) {\n continue;\n }\n\n cellGroup.setAttribute('y', cellGroup.attribute.y + detaY);\n }\n }\n\n // 更新table行高存储\n scene.table.setRowHeight(row, scene.table.getRowHeight(row) + detaY, true);\n}\n\n/**\n * @description: 更新单个单元格高度\n * @return {*}\n */\nexport function updateCellHeightForRow(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n height: number,\n detaY: number,\n isHeader: boolean\n // autoRowHeight: boolean\n) {\n let cellGroup;\n let distHeight;\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n // TO BE FIXED 这里使用横向和纵向来判断单元格merge情况,目前没有横纵都merge的情况,\n // 如果有这里的逻辑要修改\n if (mergeInfo && mergeInfo.end.col - mergeInfo.start.col && mergeInfo.start.col === col) {\n // 更新横向merge cell height,只更新一次\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n const mergeCellheight = mergeCell.attribute.height;\n mergeCell.setAttribute('height', mergeCellheight + detaY);\n\n cellGroup = mergeCell;\n distHeight = mergeCell.attribute.height;\n } else if (mergeInfo) {\n // 更新纵向merge cell width\n cell.setAttribute('height', height + detaY);\n\n cellGroup = cell;\n distHeight = height + detaY;\n } else if (!mergeInfo) {\n cell.setAttribute('height', height + detaY);\n cellGroup = cell;\n distHeight = height + detaY;\n // cell.setTheme({\n // rect: {\n // height: cell.attribute.height,\n // },\n // });\n }\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return;\n }\n\n updateCellHeight(scene, cellGroup, col, row, distHeight, detaY, isHeader);\n}\n\nexport function updateCellHeightForColumn(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n height: number,\n detaY: number,\n isHeader: boolean\n) {\n let cellGroup;\n // let distHeight;\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n cell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n if (row === mergeInfo.start.row) {\n // 初始化高度\n (cell as any)._tempHeight = height;\n return;\n } else if (row === mergeInfo.end.row) {\n cell.setAttribute('height', (cell as any)._tempHeight + height);\n cellGroup = cell;\n height = cell.attribute.height;\n // updateCellHeight(scene, cellGroup, col, row, cell.attribute.height, 0, isHeader);\n } else {\n // 累加高度\n (cell as any)._tempHeight += height;\n return;\n }\n } else if (mergeInfo) {\n cell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n cell.setAttribute('height', height);\n cellGroup = cell;\n\n // const rect = cell.firstChild as Rect;\n // rect.setAttribute('height', cell.attribute.height);\n } else {\n cell.setAttribute('height', height);\n cellGroup = cell;\n }\n updateCellHeight(scene, cellGroup, col, row, height, 0, isHeader);\n}\n\nexport function updateCellHeight(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n distHeight: number,\n detaY: number,\n isHeader: boolean\n) {\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? scene.table._getHeaderLayoutMap(col, row).headerType\n : scene.table.getBodyColumnType(col, row);\n if (type === 'progressbar') {\n // 目前先采用重新生成节点的方案\n const columnDefine = scene.table.getBodyColumnDefine(col, row) as IProgressbarColumnBodyDefine;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const value = scene.table.getCellValue(col, row);\n const dataValue = scene.table.getCellOriginValue(col, row);\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n\n const newBarCell = createProgressBarCell(\n columnDefine,\n style,\n cell.attribute.width,\n // cell.attribute.height,\n value,\n dataValue,\n col,\n row,\n padding,\n scene.table\n );\n\n const oldBarCell = cell.getChildByName('progress-bar') as Group;\n // cell.replaceChild(newBarCell, oldBarCell);\n cell.insertBefore(newBarCell, oldBarCell);\n cell.removeChild(oldBarCell);\n oldBarCell.removeAllChild();\n oldBarCell.release();\n } else if (type === 'sparkline') {\n // 目前先采用重新生成节点的方案\n cell.removeAllChild();\n const headerStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, scene.table));\n createSparkLineCellGroup(\n cell,\n cell.parent,\n cell.attribute.x,\n cell.attribute.y,\n col,\n row,\n cell.attribute.width,\n cell.attribute.height,\n padding,\n scene.table,\n getStyleTheme(headerStyle, scene.table, col, row, getProp).theme\n );\n } else if (type === 'image' || type === 'video') {\n updateImageCellContentWhileResize(cell, col, row, scene.table);\n } else {\n // 处理文字\n const style = scene.table._getCellStyle(col, row);\n updateCellContentHeight(\n cell,\n distHeight,\n detaY,\n // scene.table.internalProps.autoRowHeight,\n scene.table.heightMode === 'autoHeight',\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline\n );\n\n // 处理自定义渲染\n const customContainer = cell.getChildByName('custom-container') as Group;\n if (customContainer) {\n customContainer.clear();\n cell.removeChild(customContainer);\n\n let customRender;\n let customLayout;\n const cellType = scene.table.getCellType(col, row);\n if (cellType !== 'body') {\n const define = scene.table.getHeaderDefine(col, row);\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n const define = scene.table.getBodyColumnDefine(col, row);\n customRender = define?.customRender || scene.table.customRender;\n customLayout = define?.customLayout;\n }\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n cell.attribute.width,\n cell.attribute.height,\n false,\n false,\n scene.table\n );\n if (cell.childrenCount > 0) {\n cell.insertBefore(customResult.elementsGroup, cell.firstChild);\n } else {\n cell.appendChild(customResult.elementsGroup);\n }\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/layout/update-height.ts"],"names":[],"mappings":";;;AAEA,oFAAqF;AACrF,gFAAsF;AAEtF,4DAA2D;AAC3D,gDAA4C;AAC5C,8CAAgD;AAChD,gEAAoE;AAEpE,gDAAqD;AACrD,sEAA0F;AAC1F,wDAAuD;AAEvD,SAAgB,eAAe,CAAC,KAAiB,EAAE,GAAW,EAAE,KAAa;IAC3E,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,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EACL,KAAK,EACL,KAAK,CAAC,KAAK,CACZ,CAAC;YACF,IAAI,IAAI,CAAC,aAAa,GAAG,CAAC,EAAE;gBAC1B,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;aAChE;iBAAM;gBACL,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;aAC9C;SACF;KACF;AACH,CAAC;AAhHD,4CAgHC","file":"update-height.js","sourcesContent":["import type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport type { Group } from '../graphic/group';\nimport { createProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentHeight } from '../utils/text-icon-layout';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport { dealWithCustom } from '../component/custom';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport { getStyleTheme } from '../../core/tableHelper';\n\nexport function updateRowHeight(scene: Scenegraph, row: number, detaY: number) {\n for (let col = 0; col < scene.table.colCount; col++) {\n const cell = scene.getCell(col, row);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.start.col !== col) {\n continue;\n }\n const height = cell.attribute.height;\n // cell.setAttribute('height', height);\n // (cell.firstChild as Rect).setAttribute('height', cell.attribute.height);\n updateCellHeightForRow(scene, cell, col, row, height, detaY, scene.table.isHeader(col, row));\n\n scene.updateCellContentWhileResize(col, row);\n }\n\n let rowStart = 0;\n let rowEnd = 0;\n // 更新header 高度\n if (row < scene.table.columnHeaderLevelCount) {\n scene.colHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height + detaY);\n scene.rowHeaderGroup.setAttribute('y', scene.colHeaderGroup.attribute.y + detaY);\n scene.bodyGroup.setAttribute('y', scene.bodyGroup.attribute.y + detaY);\n\n rowStart = row + 1;\n rowEnd = scene.table.columnHeaderLevelCount - 1;\n } else {\n rowStart = row + 1;\n // rowEnd = scene.table.rowCount - 1;\n rowEnd = scene.bodyRowEnd - scene.table.bottomFrozenRowCount;\n }\n\n // 更新以下行位置\n for (let rowIndex = rowStart; rowIndex <= rowEnd; rowIndex++) {\n // if (rowIndex === 2) debugger;\n for (let colIndex = 0; colIndex < scene.table.colCount; colIndex++) {\n const cellGroup = scene.getCell(colIndex, rowIndex);\n const mergeInfo = getCellMergeInfo(scene.table, colIndex, rowIndex);\n if (mergeInfo && (mergeInfo.start.col !== colIndex || mergeInfo.start.row !== rowIndex)) {\n continue;\n }\n\n cellGroup.setAttribute('y', cellGroup.attribute.y + detaY);\n }\n }\n\n // 更新table行高存储\n scene.table.setRowHeight(row, scene.table.getRowHeight(row) + detaY, true);\n}\n\n/**\n * @description: 更新单个单元格高度\n * @return {*}\n */\nexport function updateCellHeightForRow(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n height: number,\n detaY: number,\n isHeader: boolean\n // autoRowHeight: boolean\n) {\n let cellGroup;\n let distHeight;\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n // TO BE FIXED 这里使用横向和纵向来判断单元格merge情况,目前没有横纵都merge的情况,\n // 如果有这里的逻辑要修改\n if (mergeInfo && mergeInfo.end.col - mergeInfo.start.col && mergeInfo.start.col === col) {\n // 更新横向merge cell height,只更新一次\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n const mergeCellheight = mergeCell.attribute.height;\n mergeCell.setAttribute('height', mergeCellheight + detaY);\n\n cellGroup = mergeCell;\n distHeight = mergeCell.attribute.height;\n } else if (mergeInfo) {\n // 更新纵向merge cell width\n cell.setAttribute('height', height + detaY);\n\n cellGroup = cell;\n distHeight = height + detaY;\n } else if (!mergeInfo) {\n cell.setAttribute('height', height + detaY);\n cellGroup = cell;\n distHeight = height + detaY;\n // cell.setTheme({\n // rect: {\n // height: cell.attribute.height,\n // },\n // });\n }\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return;\n }\n\n updateCellHeight(scene, cellGroup, col, row, distHeight, detaY, isHeader);\n}\n\nexport function updateCellHeightForColumn(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n height: number,\n detaY: number,\n isHeader: boolean\n) {\n let cellGroup;\n // let distHeight;\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n cell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n if (row === mergeInfo.start.row) {\n // 初始化高度\n (cell as any)._tempHeight = height;\n return;\n } else if (row === mergeInfo.end.row) {\n cell.setAttribute('height', (cell as any)._tempHeight + height);\n cellGroup = cell;\n height = cell.attribute.height;\n // updateCellHeight(scene, cellGroup, col, row, cell.attribute.height, 0, isHeader);\n } else {\n // 累加高度\n (cell as any)._tempHeight += height;\n return;\n }\n } else if (mergeInfo) {\n cell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n cell.setAttribute('height', height);\n cellGroup = cell;\n\n // const rect = cell.firstChild as Rect;\n // rect.setAttribute('height', cell.attribute.height);\n } else {\n cell.setAttribute('height', height);\n cellGroup = cell;\n }\n updateCellHeight(scene, cellGroup, col, row, height, 0, isHeader);\n}\n\nexport function updateCellHeight(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n distHeight: number,\n detaY: number,\n isHeader: boolean\n) {\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? scene.table._getHeaderLayoutMap(col, row).headerType\n : scene.table.getBodyColumnType(col, row);\n if (type === 'progressbar') {\n // 目前先采用重新生成节点的方案\n const columnDefine = scene.table.getBodyColumnDefine(col, row) as IProgressbarColumnBodyDefine;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const value = scene.table.getCellValue(col, row);\n const dataValue = scene.table.getCellOriginValue(col, row);\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n\n const newBarCell = createProgressBarCell(\n columnDefine,\n style,\n cell.attribute.width,\n // cell.attribute.height,\n value,\n dataValue,\n col,\n row,\n padding,\n scene.table\n );\n\n const oldBarCell = cell.getChildByName('progress-bar') as Group;\n // cell.replaceChild(newBarCell, oldBarCell);\n cell.insertBefore(newBarCell, oldBarCell);\n cell.removeChild(oldBarCell);\n oldBarCell.removeAllChild();\n oldBarCell.release();\n } else if (type === 'sparkline') {\n // 目前先采用重新生成节点的方案\n cell.removeAllChild();\n const headerStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, scene.table));\n createSparkLineCellGroup(\n cell,\n cell.parent,\n cell.attribute.x,\n cell.attribute.y,\n col,\n row,\n cell.attribute.width,\n cell.attribute.height,\n padding,\n scene.table,\n getStyleTheme(headerStyle, scene.table, col, row, getProp).theme\n );\n } else if (type === 'image' || type === 'video') {\n updateImageCellContentWhileResize(cell, col, row, scene.table);\n } else if (cell.firstChild?.name === 'axis') {\n (cell.firstChild as any)?.originAxis.resize(cell.attribute.width, cell.attribute.height);\n } else {\n // 处理文字\n const style = scene.table._getCellStyle(col, row);\n updateCellContentHeight(\n cell,\n distHeight,\n detaY,\n // scene.table.internalProps.autoRowHeight,\n scene.table.heightMode === 'autoHeight',\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline\n );\n\n // 处理自定义渲染\n const customContainer = cell.getChildByName('custom-container') as Group;\n if (customContainer) {\n customContainer.clear();\n cell.removeChild(customContainer);\n\n let customRender;\n let customLayout;\n const cellType = scene.table.getCellType(col, row);\n if (cellType !== 'body') {\n const define = scene.table.getHeaderDefine(col, row);\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n const define = scene.table.getBodyColumnDefine(col, row);\n customRender = define?.customRender || scene.table.customRender;\n customLayout = define?.customLayout;\n }\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n cell.attribute.width,\n cell.attribute.height,\n false,\n false,\n scene.table\n );\n if (cell.childrenCount > 0) {\n cell.insertBefore(customResult.elementsGroup, cell.firstChild);\n } else {\n cell.appendChild(customResult.elementsGroup);\n }\n }\n }\n}\n"]}
@@ -7,84 +7,59 @@ Object.defineProperty(exports, "__esModule", {
7
7
  const axis_1 = require("../../components/axis/axis"), tableHelper_1 = require("../../core/tableHelper"), image_cell_1 = require("../group-creater/cell-type/image-cell"), progress_bar_cell_1 = require("../group-creater/cell-type/progress-bar-cell"), spark_line_cell_1 = require("../group-creater/cell-type/spark-line-cell"), get_cell_merge_1 = require("../utils/get-cell-merge"), get_prop_1 = require("../utils/get-prop"), padding_1 = require("../utils/padding"), text_icon_layout_1 = require("../utils/text-icon-layout"), update_height_1 = require("./update-height");
8
8
 
9
9
  function updateColWidth(scene, col, detaX) {
10
- const autoRowHeight = "autoHeight" === scene.table.heightMode;
10
+ const autoRowHeight = "autoHeight" === scene.table.heightMode, colOrCornerHeaderColumn = scene.getColGroup(col, !0);
11
+ colOrCornerHeaderColumn && updateColunmWidth(colOrCornerHeaderColumn, detaX, autoRowHeight, "col-corner", scene);
12
+ const rowHeaderOrBodyColumn = scene.getColGroup(col);
13
+ rowHeaderOrBodyColumn && updateColunmWidth(rowHeaderOrBodyColumn, detaX, autoRowHeight, "row-body", scene);
14
+ const leftBottomColumn = scene.getColGroupInLeftBottomCorner(col);
15
+ leftBottomColumn && updateColunmWidth(leftBottomColumn, detaX, autoRowHeight, "left-bottom", scene);
16
+ const bottomColumn = scene.getColGroupInBottom(col);
17
+ bottomColumn && updateColunmWidth(bottomColumn, detaX, autoRowHeight, "bottom", scene),
18
+ col < scene.frozenColCount ? (scene.cornerHeaderGroup.forEachChildrenSkipChild(((column, index) => {
19
+ column.col > col && column.setAttribute("x", column.attribute.x + detaX);
20
+ })), scene.rowHeaderGroup.forEachChildrenSkipChild(((column, index) => {
21
+ column.col > col && column.setAttribute("x", column.attribute.x + detaX);
22
+ }))) : (scene.colHeaderGroup.forEachChildrenSkipChild(((column, index) => {
23
+ column.col > col && column.setAttribute("x", column.attribute.x + detaX);
24
+ })), scene.bodyGroup.forEachChildrenSkipChild(((column, index) => {
25
+ column.col > col && column.setAttribute("x", column.attribute.x + detaX);
26
+ }))), leftBottomColumn && scene.leftBottomCornerGroup.forEachChildrenSkipChild(((column, index) => {
27
+ column.col > col && column.setAttribute("x", column.attribute.x + detaX);
28
+ })), bottomColumn && scene.bottomFrozenGroup.forEachChildrenSkipChild(((column, index) => {
29
+ column.col > col && column.setAttribute("x", column.attribute.x + detaX);
30
+ })), scene.table.setColWidth(col, rowHeaderOrBodyColumn.attribute.width, !0);
31
+ }
32
+
33
+ function updateColunmWidth(columnGroup, detaX, autoRowHeight, mode, scene) {
34
+ var _a, _b, _c, _d, _e;
11
35
  let needRerangeRow = !1;
12
- const colOrCornerHeaderColumn = scene.getColGroup(col, !0), oldColOrCornerHeaderColumnWidth = null == colOrCornerHeaderColumn ? void 0 : colOrCornerHeaderColumn.attribute.width;
13
- if (null == colOrCornerHeaderColumn || colOrCornerHeaderColumn.setAttribute("width", oldColOrCornerHeaderColumnWidth + detaX),
14
- null == colOrCornerHeaderColumn || colOrCornerHeaderColumn.forEachChildren(((cell, index) => {
15
- if (updateCellWidth(scene, cell, col, cell.row, oldColOrCornerHeaderColumnWidth, detaX, index < scene.table.columnHeaderLevelCount, autoRowHeight)) {
16
- const mergeInfo = (0, get_cell_merge_1.getCellMergeInfo)(scene.table, cell.col, cell.row);
17
- if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) resetRowHeight(scene, row); else resetRowHeight(scene, cell.row);
18
- needRerangeRow = !0;
19
- }
20
- })), needRerangeRow) {
21
- let newTotalHeight = 0;
22
- for (let col = 0; col < scene.table.colCount; col++) {
23
- const colGroup = scene.getColGroup(col, !0);
24
- let y = 0;
25
- colGroup.forEachChildren((cellGroup => {
26
- "cell" === cellGroup.role && (cellGroup.setAttribute("y", y), y += cellGroup.attribute.height);
27
- })), newTotalHeight = y;
28
- }
29
- scene.updateContainerHeight(0, newTotalHeight - scene.colHeaderGroup.attribute.height);
30
- }
31
- needRerangeRow = !1;
32
- const rowHeaderOrBodyColumn = scene.getColGroup(col), oldRowHeaderOrBodyColumn = rowHeaderOrBodyColumn.attribute.width;
33
- if (null == rowHeaderOrBodyColumn || rowHeaderOrBodyColumn.setAttribute("width", oldRowHeaderOrBodyColumn + detaX),
34
- null == rowHeaderOrBodyColumn || rowHeaderOrBodyColumn.forEachChildren(((cell, index) => {
35
- if (updateCellWidth(scene, cell, cell.col, cell.row, oldRowHeaderOrBodyColumn, detaX, col < scene.table.rowHeaderLevelCount, autoRowHeight)) {
36
+ const oldColumnWidth = null !== (_a = null == columnGroup ? void 0 : columnGroup.attribute.width) && void 0 !== _a ? _a : 0;
37
+ if (null == columnGroup || columnGroup.setAttribute("width", oldColumnWidth + detaX),
38
+ null == columnGroup || columnGroup.forEachChildren(((cell, index) => {
39
+ if (updateCellWidth(scene, cell, cell.col, cell.row, oldColumnWidth, detaX, "row-body" !== mode || cell.col < scene.table.rowHeaderLevelCount, autoRowHeight)) {
36
40
  const mergeInfo = (0, get_cell_merge_1.getCellMergeInfo)(scene.table, cell.col, cell.row);
37
41
  if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) resetRowHeight(scene, row); else resetRowHeight(scene, cell.row);
38
42
  needRerangeRow = !0;
39
43
  }
40
44
  })), needRerangeRow) {
41
- let newTotalHeight = 0;
45
+ let colGroup, oldContainerHeight, row, newTotalHeight = 0;
42
46
  for (let col = 0; col < scene.table.colCount; col++) {
43
- const colGroup = scene.getColGroup(col, !1);
47
+ "col-corner" === mode ? (row = 0, colGroup = scene.getColGroup(col, !0), oldContainerHeight = null !== (_b = scene.colHeaderGroup.attribute.height) && void 0 !== _b ? _b : 0) : "row-body" === mode ? (row = scene.table.frozenRowCount,
48
+ colGroup = scene.getColGroup(col, !1), oldContainerHeight = null !== (_c = scene.bodyGroup.attribute.height) && void 0 !== _c ? _c : 0) : "bottom" === mode ? (row = scene.table.rowCount - scene.table.bottomFrozenRowCount,
49
+ colGroup = scene.getColGroupInBottom(col), oldContainerHeight = null !== (_d = scene.bottomFrozenGroup.attribute.height) && void 0 !== _d ? _d : 0) : "left-bottom" === mode && (row = scene.table.rowCount - scene.table.bottomFrozenRowCount,
50
+ colGroup = scene.getColGroupInLeftBottomCorner(col), oldContainerHeight = null !== (_e = scene.leftBottomCornerGroup.attribute.height) && void 0 !== _e ? _e : 0);
44
51
  let y = 0;
45
52
  colGroup.forEachChildren((cellGroup => {
46
- "cell" === cellGroup.role && (cellGroup.setAttribute("y", y), y += cellGroup.attribute.height);
53
+ var _a;
54
+ "cell" === cellGroup.role ? (cellGroup.setAttribute("y", y), y += null !== (_a = cellGroup.attribute.height) && void 0 !== _a ? _a : 0) : cellGroup.setAttribute("y", y);
47
55
  })), newTotalHeight = y;
48
56
  }
49
- scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);
57
+ scene.updateContainerHeight(row, newTotalHeight - oldContainerHeight);
50
58
  }
51
- const bottomColumn = scene.getColGroupInBottom(col);
52
- if (bottomColumn) {
53
- const oldBottomColumnWidth = bottomColumn.attribute.width;
54
- if (null == bottomColumn || bottomColumn.setAttribute("width", oldBottomColumnWidth + detaX),
55
- null == bottomColumn || bottomColumn.forEachChildren(((cell, index) => {
56
- if (updateCellWidth(scene, cell, cell.col, cell.row, oldBottomColumnWidth, detaX, col < scene.table.rowHeaderLevelCount, autoRowHeight)) {
57
- const mergeInfo = (0, get_cell_merge_1.getCellMergeInfo)(scene.table, cell.col, cell.row);
58
- if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) resetRowHeight(scene, row); else resetRowHeight(scene, cell.row);
59
- needRerangeRow = !0;
60
- }
61
- })), needRerangeRow) {
62
- let newTotalHeight = 0;
63
- for (let col = 0; col < scene.table.colCount; col++) {
64
- const colGroup = scene.getColGroup(col, !1);
65
- let y = 0;
66
- colGroup.forEachChildren((cellGroup => {
67
- "cell" === cellGroup.role && (cellGroup.setAttribute("y", y), y += cellGroup.attribute.height);
68
- })), newTotalHeight = y;
69
- }
70
- scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);
71
- }
72
- }
73
- col < scene.frozenColCount ? (scene.cornerHeaderGroup.forEachChildrenSkipChild(((column, index) => {
74
- column.col > col && column.setAttribute("x", column.attribute.x + detaX);
75
- })), scene.rowHeaderGroup.forEachChildrenSkipChild(((column, index) => {
76
- column.col > col && column.setAttribute("x", column.attribute.x + detaX);
77
- }))) : (scene.colHeaderGroup.forEachChildrenSkipChild(((column, index) => {
78
- column.col > col && column.setAttribute("x", column.attribute.x + detaX);
79
- })), scene.bodyGroup.forEachChildrenSkipChild(((column, index) => {
80
- column.col > col && column.setAttribute("x", column.attribute.x + detaX);
81
- })), bottomColumn && scene.bottomFrozenGroup.forEachChildrenSkipChild(((column, index) => {
82
- column.col > col && column.setAttribute("x", column.attribute.x + detaX);
83
- }))), scene.table.setColWidth(col, rowHeaderOrBodyColumn.attribute.width, !0);
84
59
  }
85
60
 
86
61
  function updateCellWidth(scene, cell, col, row, width, detaX, isHeader, autoRowHeight) {
87
- var _a;
62
+ var _a, _b, _c;
88
63
  let cellGroup, distWidth;
89
64
  const mergeInfo = (0, get_cell_merge_1.getCellMergeInfo)(scene.table, col, row);
90
65
  if (mergeInfo && mergeInfo.end.col - mergeInfo.start.col) {
@@ -115,7 +90,7 @@ function updateCellWidth(scene, cell, col, row, width, detaX, isHeader, autoRowH
115
90
  const axis = new axis_1.CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, scene.table);
116
91
  cellGroup.clear(), cellGroup.appendChild(axis.component), axis.overlap();
117
92
  }
118
- } else {
93
+ } else if ("axis" === (null === (_b = cell.firstChild) || void 0 === _b ? void 0 : _b.name)) null === (_c = cell.firstChild) || void 0 === _c || _c.originAxis.resize(cell.attribute.width, cell.attribute.height); else {
119
94
  const style = scene.table._getCellStyle(col, row);
120
95
  isHeightChange = (0, text_icon_layout_1.updateCellContentWidth)(cellGroup, distWidth, detaX, autoRowHeight, (0,
121
96
  padding_1.getQuadProps)(style.padding), style.textAlign, style.textBaseline, scene);
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/layout/update-width.ts"],"names":[],"mappings":";;;AACA,qDAA2D;AAC3D,wDAAuD;AAIvD,sEAA0F;AAC1F,oFAAqF;AACrF,gFAAsF;AAEtF,4DAA2D;AAC3D,gDAA4C;AAC5C,8CAAgD;AAChD,gEAAmE;AACnE,mDAAyD;AAUzD,SAAgB,cAAc,CAAC,KAAiB,EAAE,GAAW,EAAE,KAAa;IAC1E,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,KAAK,YAAY,CAAC;IAE9D,IAAI,cAAc,GAAG,KAAK,CAAC;IAC3B,MAAM,uBAAuB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAU,CAAC;IACtE,MAAM,+BAA+B,GAAG,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,SAAS,CAAC,KAAK,CAAC;IACjF,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,YAAY,CAAC,OAAO,EAAE,+BAA+B,GAAG,KAAK,CAAC,CAAC;IAExF,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,eAAe,CAAC,CAAC,IAAW,EAAE,KAAa,EAAE,EAAE;QACtE,MAAM,cAAc,GAAG,eAAe,CACpC,KAAK,EACL,IAAI,EACJ,GAAG,EAEH,IAAI,CAAC,GAAG,EACR,+BAA+B,EAC/B,KAAK,EAEL,KAAK,GAAG,KAAK,CAAC,KAAK,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AE,QAAQ,EAAE,EAAE;gBAClF,IAAI,QAAQ,KAAK,GAAG,EAAE;oBACpB,UAAU,IAAI,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;iBAClD;aACF;SACF;QACD,IAAA,sCAAsB,EAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;KAC9F;IAGD,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAW,EAAE,KAAiB;IACxD,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,CAAC,eAAe,CAAC,CAAC,KAAW,EAAE,EAAE;QACnC,IACE,KAAK,CAAC,IAAI,KAAK,WAAW;YAC1B,KAAK,CAAC,IAAI,KAAK,YAAY;YAC3B,KAAK,CAAC,IAAI,KAAK,MAAM;YACrB,KAAK,CAAC,IAAI,KAAK,SAAS,EACxB;YACA,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;SAC5D;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,IAAA,sBAAY,EAAC,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,OAAiB,CAAC,CAAC;IAC9F,OAAO,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC","file":"update-width.js","sourcesContent":["import type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport { CartesianAxis } from '../../components/axis/axis';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport type { Group } from '../graphic/group';\nimport type { Icon } from '../graphic/icon';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport { createProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentWidth } from '../utils/text-icon-layout';\nimport { updateCellHeightForRow } from './update-height';\n// import { updateAutoRowHeight } from './auto-height';\n\n/**\n * @description: 更新指定列列宽,在拖拽调整列宽中使用\n * @param {Scenegraph} scene\n * @param {number} col\n * @param {number} detaX\n * @return {*}\n */\nexport function updateColWidth(scene: Scenegraph, col: number, detaX: number) {\n const autoRowHeight = scene.table.heightMode === 'autoHeight';\n // deal width corner header or column header\n let needRerangeRow = false;\n const colOrCornerHeaderColumn = scene.getColGroup(col, true) as Group;\n const oldColOrCornerHeaderColumnWidth = colOrCornerHeaderColumn?.attribute.width;\n colOrCornerHeaderColumn?.setAttribute('width', oldColOrCornerHeaderColumnWidth + detaX);\n // 更新单元格宽度\n colOrCornerHeaderColumn?.forEachChildren((cell: Group, index: number) => {\n const isHeightChange = updateCellWidth(\n scene,\n cell,\n col,\n // index,\n cell.row,\n oldColOrCornerHeaderColumnWidth,\n detaX,\n // true\n index < scene.table.columnHeaderLevelCount,\n autoRowHeight\n );\n if (isHeightChange) {\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n resetRowHeight(scene, row);\n }\n } else {\n resetRowHeight(scene, cell.row);\n }\n needRerangeRow = true;\n }\n });\n\n if (needRerangeRow) {\n let newTotalHeight = 0;\n for (let col = 0; col < scene.table.colCount; col++) {\n const colGroup = scene.getColGroup(col, true);\n let y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n if (cellGroup.role !== 'cell') {\n return;\n }\n cellGroup.setAttribute('y', y);\n y += cellGroup.attribute.height;\n });\n newTotalHeight = y;\n }\n scene.updateContainerHeight(0, newTotalHeight - scene.colHeaderGroup.attribute.height);\n }\n // deal width row header or body or right frozen cells\n needRerangeRow = false;\n const rowHeaderOrBodyColumn = scene.getColGroup(col) as Group;\n const oldRowHeaderOrBodyColumn = rowHeaderOrBodyColumn.attribute.width;\n rowHeaderOrBodyColumn?.setAttribute('width', oldRowHeaderOrBodyColumn + detaX);\n rowHeaderOrBodyColumn?.forEachChildren((cell: Group, index: number) => {\n const isHeightChange = updateCellWidth(\n scene,\n cell,\n // col + (!isRowHeader ? scene.table.frozenColCount : 0),\n cell.col,\n // index + scene.table.frozenRowCount,\n cell.row,\n oldRowHeaderOrBodyColumn,\n detaX,\n // isRowHeader\n col < scene.table.rowHeaderLevelCount,\n autoRowHeight\n );\n if (isHeightChange) {\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n resetRowHeight(scene, row);\n }\n } else {\n resetRowHeight(scene, cell.row);\n }\n needRerangeRow = true;\n }\n });\n\n if (needRerangeRow) {\n let newTotalHeight = 0;\n for (let col = 0; col < scene.table.colCount; col++) {\n const colGroup = scene.getColGroup(col, false);\n let y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n if (cellGroup.role !== 'cell') {\n return;\n }\n cellGroup.setAttribute('y', y);\n y += cellGroup.attribute.height;\n });\n newTotalHeight = y;\n }\n scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);\n }\n\n // deal width bottom frozen cells\n const bottomColumn = scene.getColGroupInBottom(col);\n if (bottomColumn) {\n const oldBottomColumnWidth = bottomColumn.attribute.width;\n bottomColumn?.setAttribute('width', oldBottomColumnWidth + detaX);\n bottomColumn?.forEachChildren((cell: Group, index: number) => {\n const isHeightChange = updateCellWidth(\n scene,\n cell,\n // col + (!isRowHeader ? scene.table.frozenColCount : 0),\n cell.col,\n // index + scene.table.frozenRowCount,\n cell.row,\n oldBottomColumnWidth,\n detaX,\n // isRowHeader\n col < scene.table.rowHeaderLevelCount,\n autoRowHeight\n );\n if (isHeightChange) {\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n resetRowHeight(scene, row);\n }\n } else {\n resetRowHeight(scene, cell.row);\n }\n needRerangeRow = true;\n }\n });\n\n if (needRerangeRow) {\n let newTotalHeight = 0;\n for (let col = 0; col < scene.table.colCount; col++) {\n const colGroup = scene.getColGroup(col, false);\n let y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n if (cellGroup.role !== 'cell') {\n return;\n }\n cellGroup.setAttribute('y', y);\n y += cellGroup.attribute.height;\n });\n newTotalHeight = y;\n }\n scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);\n }\n }\n\n // 更新剩余列位置\n if (col < scene.frozenColCount) {\n scene.cornerHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n scene.rowHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n } else {\n scene.colHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n scene.bodyGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n if (bottomColumn) {\n scene.bottomFrozenGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n }\n\n scene.table.setColWidth(col, rowHeaderOrBodyColumn.attribute.width, true);\n}\n\n/**\n * @description: 更新单个单元格宽度\n * @return {*}\n */\nfunction updateCellWidth(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n width: number, // old width, not dist\n detaX: number,\n isHeader: boolean,\n // autoColWidth: boolean,\n autoRowHeight: boolean\n): boolean {\n let cellGroup;\n let distWidth;\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n // TO BE FIXED 这里使用横向和纵向来判断单元格merge情况,目前没有横纵都merge的情况,\n // 如果有这里的逻辑要修改\n if (mergeInfo && mergeInfo.end.col - mergeInfo.start.col) {\n // 更新横向merge cell width\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n const mergeCellWidth = mergeCell.attribute.width;\n mergeCell.setAttribute('width', mergeCellWidth + detaX);\n\n cellGroup = mergeCell;\n distWidth = mergeCell.attribute.width;\n col = cellGroup.col;\n row = cellGroup.row;\n } else if (mergeInfo && mergeInfo.start.row === row) {\n // 更新纵向merge cell width,只更新一次\n cell.setAttribute('width', width + detaX);\n\n cellGroup = cell;\n distWidth = width + detaX;\n col = cellGroup.col;\n row = cellGroup.row;\n } else if (!mergeInfo) {\n cell.setAttribute('width', width + detaX);\n cellGroup = cell;\n distWidth = width + detaX;\n }\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return false;\n }\n\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? scene.table._getHeaderLayoutMap(col, row).headerType\n : scene.table.getBodyColumnType(col, row);\n let isHeightChange = false;\n if (type === 'progressbar') {\n // 目前先采用重新生成节点的方案\n const columnDefine = scene.table.getBodyColumnDefine(col, row) as IProgressbarColumnBodyDefine;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const value = scene.table.getCellValue(col, row);\n const dataValue = scene.table.getCellOriginValue(col, row);\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n\n const newBarCell = createProgressBarCell(\n columnDefine,\n style,\n cellGroup.attribute.width,\n // cellGroup.attribute.height,\n value,\n dataValue,\n col,\n row,\n padding,\n scene.table\n );\n\n const oldBarCell = cellGroup.getChildByName('progress-bar') as Group;\n // cell.replaceChild(newBarCell, oldBarCell);\n cellGroup.insertBefore(newBarCell, oldBarCell);\n cellGroup.removeChild(oldBarCell);\n oldBarCell.removeAllChild();\n oldBarCell.release();\n } else if (type === 'sparkline') {\n // 目前先采用重新生成节点的方案\n cellGroup.removeAllChild();\n const headerStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, scene.table));\n createSparkLineCellGroup(\n cellGroup,\n cellGroup.parent,\n cellGroup.attribute.x,\n cellGroup.attribute.y,\n col,\n row,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n padding,\n scene.table,\n getStyleTheme(headerStyle, scene.table, col, row, getProp).theme\n );\n } else if (type === 'image' || type === 'video') {\n // // 只更新背景边框\n // const rect = cell.firstChild as Rect;\n // rect.setAttribute('width', cell.attribute.width);\n updateImageCellContentWhileResize(cellGroup, col, row, scene.table);\n } else if (cellGroup.firstChild?.name === 'axis') {\n // recreate axis component\n const axisConfig = scene.table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);\n if (axisConfig) {\n const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, scene.table);\n cellGroup.clear();\n cellGroup.appendChild(axis.component);\n axis.overlap();\n }\n } else {\n // 处理文字\n const style = scene.table._getCellStyle(col, row);\n isHeightChange = updateCellContentWidth(\n cellGroup,\n distWidth,\n detaX,\n autoRowHeight,\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline,\n scene\n );\n }\n\n return isHeightChange;\n}\n\n/**\n * @description: 重置指定行行高\n * @param {Scenegraph} scene\n * @param {number} row\n * @return {*}\n */\nfunction resetRowHeight(scene: Scenegraph, row: number) {\n let maxHeight = 0;\n // 获取高度\n for (let col = 0; col < scene.table.colCount; col++) {\n const cell = scene.highPerformanceGetCell(col, row);\n if (cell.role === 'empty') {\n return;\n }\n let cellHeight = getCleanCellHeight(cell, scene);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n cellHeight = cellHeight / (mergeInfo.end.row - mergeInfo.start.row + 1);\n }\n maxHeight = Math.max(maxHeight, cellHeight);\n }\n\n // 更新高度\n for (let col = 0; col < scene.table.colCount; col++) {\n let distHeight = maxHeight;\n const cell = scene.highPerformanceGetCell(col, row);\n if (cell.role === 'empty') {\n return;\n }\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let rowIndex = mergeInfo.start.row; rowIndex <= mergeInfo.end.row; rowIndex++) {\n if (rowIndex !== row) {\n distHeight += scene.table.getRowHeight(rowIndex);\n }\n }\n }\n updateCellHeightForRow(scene, cell, col, row, distHeight, 0, scene.table.isHeader(col, row));\n }\n\n // 更新table行高存储\n scene.table.setRowHeight(row, maxHeight, true);\n}\n\nfunction getCleanCellHeight(cell: Group, scene: Scenegraph) {\n let maxHeight = 0;\n cell.forEachChildren((child: Icon) => {\n if (\n child.role === 'icon-left' ||\n child.role === 'icon-right' ||\n child.name === 'text' ||\n child.name === 'content'\n ) {\n maxHeight = Math.max(maxHeight, child.AABBBounds.height());\n }\n });\n\n const padding = getQuadProps(scene.table._getCellStyle(cell.col, cell.row).padding as number);\n return maxHeight + padding[0] + padding[2];\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/layout/update-width.ts"],"names":[],"mappings":";;;AACA,qDAA2D;AAC3D,wDAAuD;AAIvD,sEAA0F;AAC1F,oFAAqF;AACrF,gFAAsF;AAEtF,4DAA2D;AAC3D,gDAA4C;AAC5C,8CAAgD;AAChD,gEAAmE;AACnE,mDAAyD;AAUzD,SAAgB,cAAc,CAAC,KAAiB,EAA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C,IACE,KAAK,CAAC,IAAI,KAAK,WAAW;YAC1B,KAAK,CAAC,IAAI,KAAK,YAAY;YAC3B,KAAK,CAAC,IAAI,KAAK,MAAM;YACrB,KAAK,CAAC,IAAI,KAAK,SAAS,EACxB;YACA,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;SAC5D;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,IAAA,sBAAY,EAAC,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,OAAiB,CAAC,CAAC;IAC9F,OAAO,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC","file":"update-width.js","sourcesContent":["import type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport { CartesianAxis } from '../../components/axis/axis';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport type { Group } from '../graphic/group';\nimport type { Icon } from '../graphic/icon';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport { createProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentWidth } from '../utils/text-icon-layout';\nimport { updateCellHeightForRow } from './update-height';\n// import { updateAutoRowHeight } from './auto-height';\n\n/**\n * @description: 更新指定列列宽,在拖拽调整列宽中使用\n * @param {Scenegraph} scene\n * @param {number} col\n * @param {number} detaX\n * @return {*}\n */\nexport function updateColWidth(scene: Scenegraph, col: number, detaX: number) {\n const autoRowHeight = scene.table.heightMode === 'autoHeight';\n // deal width corner header or column header\n const colOrCornerHeaderColumn = scene.getColGroup(col, true) as Group;\n if (colOrCornerHeaderColumn) {\n updateColunmWidth(colOrCornerHeaderColumn, detaX, autoRowHeight, 'col-corner', scene);\n }\n // deal width row header or body or right frozen cells\n const rowHeaderOrBodyColumn = scene.getColGroup(col) as Group;\n if (rowHeaderOrBodyColumn) {\n updateColunmWidth(rowHeaderOrBodyColumn, detaX, autoRowHeight, 'row-body', scene);\n }\n\n const leftBottomColumn = scene.getColGroupInLeftBottomCorner(col);\n // deal width left bottom frozen cells\n if (leftBottomColumn) {\n updateColunmWidth(leftBottomColumn, detaX, autoRowHeight, 'left-bottom', scene);\n }\n // deal width bottom frozen cells\n const bottomColumn = scene.getColGroupInBottom(col);\n if (bottomColumn) {\n updateColunmWidth(bottomColumn, detaX, autoRowHeight, 'bottom', scene);\n }\n\n // 更新剩余列位置\n if (col < scene.frozenColCount) {\n scene.cornerHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n scene.rowHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n } else {\n scene.colHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n scene.bodyGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n\n if (leftBottomColumn) {\n scene.leftBottomCornerGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n if (bottomColumn) {\n scene.bottomFrozenGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n\n scene.table.setColWidth(col, rowHeaderOrBodyColumn.attribute.width, true);\n}\n\nfunction updateColunmWidth(\n columnGroup: Group,\n detaX: number,\n autoRowHeight: boolean,\n mode: 'col-corner' | 'row-body' | 'bottom' | 'left-bottom',\n scene: Scenegraph\n) {\n let needRerangeRow = false;\n // const colOrCornerHeaderColumn = scene.getColGroup(col, true) as Group;\n const oldColumnWidth = columnGroup?.attribute.width ?? 0;\n columnGroup?.setAttribute('width', oldColumnWidth + detaX);\n // 更新单元格宽度\n columnGroup?.forEachChildren((cell: Group, index: number) => {\n const isHeightChange = updateCellWidth(\n scene,\n cell,\n cell.col,\n cell.row,\n oldColumnWidth,\n detaX,\n mode === 'row-body' ? cell.col < scene.table.rowHeaderLevelCount : true,\n autoRowHeight\n );\n if (isHeightChange) {\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n resetRowHeight(scene, row);\n }\n } else {\n resetRowHeight(scene, cell.row);\n }\n needRerangeRow = true;\n }\n });\n\n if (needRerangeRow) {\n let newTotalHeight = 0;\n let colGroup;\n let oldContainerHeight;\n let row;\n for (let col = 0; col < scene.table.colCount; col++) {\n // const colGroup = scene.getColGroup(col, true);\n if (mode === 'col-corner') {\n row = 0;\n colGroup = scene.getColGroup(col, true);\n oldContainerHeight = scene.colHeaderGroup.attribute.height ?? 0;\n } else if (mode === 'row-body') {\n row = scene.table.frozenRowCount;\n colGroup = scene.getColGroup(col, false);\n oldContainerHeight = scene.bodyGroup.attribute.height ?? 0;\n } else if (mode === 'bottom') {\n row = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup = scene.getColGroupInBottom(col);\n oldContainerHeight = scene.bottomFrozenGroup.attribute.height ?? 0;\n } else if (mode === 'left-bottom') {\n row = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup = scene.getColGroupInLeftBottomCorner(col);\n oldContainerHeight = scene.leftBottomCornerGroup.attribute.height ?? 0;\n }\n let y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n if (cellGroup.role !== 'cell') {\n cellGroup.setAttribute('y', y);\n return;\n }\n cellGroup.setAttribute('y', y);\n y += cellGroup.attribute.height ?? 0;\n });\n newTotalHeight = y;\n }\n scene.updateContainerHeight(row, newTotalHeight - oldContainerHeight);\n }\n}\n\n/**\n * @description: 更新单个单元格宽度\n * @return {*}\n */\nfunction updateCellWidth(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n width: number, // old width, not dist\n detaX: number,\n isHeader: boolean,\n // autoColWidth: boolean,\n autoRowHeight: boolean\n): boolean {\n let cellGroup;\n let distWidth;\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n // TO BE FIXED 这里使用横向和纵向来判断单元格merge情况,目前没有横纵都merge的情况,\n // 如果有这里的逻辑要修改\n if (mergeInfo && mergeInfo.end.col - mergeInfo.start.col) {\n // 更新横向merge cell width\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n const mergeCellWidth = mergeCell.attribute.width;\n mergeCell.setAttribute('width', mergeCellWidth + detaX);\n\n cellGroup = mergeCell;\n distWidth = mergeCell.attribute.width;\n col = cellGroup.col;\n row = cellGroup.row;\n } else if (mergeInfo && mergeInfo.start.row === row) {\n // 更新纵向merge cell width,只更新一次\n cell.setAttribute('width', width + detaX);\n\n cellGroup = cell;\n distWidth = width + detaX;\n col = cellGroup.col;\n row = cellGroup.row;\n } else if (!mergeInfo) {\n cell.setAttribute('width', width + detaX);\n cellGroup = cell;\n distWidth = width + detaX;\n }\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return false;\n }\n\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? scene.table._getHeaderLayoutMap(col, row).headerType\n : scene.table.getBodyColumnType(col, row);\n let isHeightChange = false;\n if (type === 'progressbar') {\n // 目前先采用重新生成节点的方案\n const columnDefine = scene.table.getBodyColumnDefine(col, row) as IProgressbarColumnBodyDefine;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const value = scene.table.getCellValue(col, row);\n const dataValue = scene.table.getCellOriginValue(col, row);\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n\n const newBarCell = createProgressBarCell(\n columnDefine,\n style,\n cellGroup.attribute.width,\n // cellGroup.attribute.height,\n value,\n dataValue,\n col,\n row,\n padding,\n scene.table\n );\n\n const oldBarCell = cellGroup.getChildByName('progress-bar') as Group;\n // cell.replaceChild(newBarCell, oldBarCell);\n cellGroup.insertBefore(newBarCell, oldBarCell);\n cellGroup.removeChild(oldBarCell);\n oldBarCell.removeAllChild();\n oldBarCell.release();\n } else if (type === 'sparkline') {\n // 目前先采用重新生成节点的方案\n cellGroup.removeAllChild();\n const headerStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, scene.table));\n createSparkLineCellGroup(\n cellGroup,\n cellGroup.parent,\n cellGroup.attribute.x,\n cellGroup.attribute.y,\n col,\n row,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n padding,\n scene.table,\n getStyleTheme(headerStyle, scene.table, col, row, getProp).theme\n );\n } else if (type === 'image' || type === 'video') {\n // // 只更新背景边框\n // const rect = cell.firstChild as Rect;\n // rect.setAttribute('width', cell.attribute.width);\n updateImageCellContentWhileResize(cellGroup, col, row, scene.table);\n } else if (cellGroup.firstChild?.name === 'axis') {\n // recreate axis component\n const axisConfig = scene.table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);\n if (axisConfig) {\n const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, scene.table);\n cellGroup.clear();\n cellGroup.appendChild(axis.component);\n axis.overlap();\n }\n } else if (cell.firstChild?.name === 'axis') {\n (cell.firstChild as any)?.originAxis.resize(cell.attribute.width, cell.attribute.height);\n } else {\n // 处理文字\n const style = scene.table._getCellStyle(col, row);\n isHeightChange = updateCellContentWidth(\n cellGroup,\n distWidth,\n detaX,\n autoRowHeight,\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline,\n scene\n );\n }\n\n return isHeightChange;\n}\n\n/**\n * @description: 重置指定行行高\n * @param {Scenegraph} scene\n * @param {number} row\n * @return {*}\n */\nfunction resetRowHeight(scene: Scenegraph, row: number) {\n let maxHeight = 0;\n // 获取高度\n for (let col = 0; col < scene.table.colCount; col++) {\n const cell = scene.highPerformanceGetCell(col, row);\n if (cell.role === 'empty') {\n return;\n }\n let cellHeight = getCleanCellHeight(cell, scene);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n cellHeight = cellHeight / (mergeInfo.end.row - mergeInfo.start.row + 1);\n }\n maxHeight = Math.max(maxHeight, cellHeight);\n }\n\n // 更新高度\n for (let col = 0; col < scene.table.colCount; col++) {\n let distHeight = maxHeight;\n const cell = scene.highPerformanceGetCell(col, row);\n if (cell.role === 'empty') {\n return;\n }\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let rowIndex = mergeInfo.start.row; rowIndex <= mergeInfo.end.row; rowIndex++) {\n if (rowIndex !== row) {\n distHeight += scene.table.getRowHeight(rowIndex);\n }\n }\n }\n updateCellHeightForRow(scene, cell, col, row, distHeight, 0, scene.table.isHeader(col, row));\n }\n\n // 更新table行高存储\n scene.table.setRowHeight(row, maxHeight, true);\n}\n\nfunction getCleanCellHeight(cell: Group, scene: Scenegraph) {\n let maxHeight = 0;\n cell.forEachChildren((child: Icon) => {\n if (\n child.role === 'icon-left' ||\n child.role === 'icon-right' ||\n child.name === 'text' ||\n child.name === 'content'\n ) {\n maxHeight = Math.max(maxHeight, child.AABBBounds.height());\n }\n });\n\n const padding = getQuadProps(scene.table._getCellStyle(cell.col, cell.row).padding as number);\n return maxHeight + padding[0] + padding[2];\n}\n"]}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.updateChartState = exports.updateChartData = exports.clearChartCacheImage = exports.updateChartSize = void 0;
6
6
 
7
- const axis_1 = require("../../components/axis/axis");
7
+ const vutils_1 = require("@visactor/vutils"), axis_1 = require("../../components/axis/axis");
8
8
 
9
9
  function updateChartSize(scenegraph, col) {
10
10
  for (let c = col; c <= scenegraph.proxy.colEnd; c++) {
@@ -53,19 +53,21 @@ function updateChartState(scenegraph, datum) {
53
53
  if (table.isPivotChart()) {
54
54
  const preSelectItemsCount = table._selectedDataItemsInChart.length;
55
55
  if ((null === datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
56
- if (table._selectedDataItemsInChart = [], Array.isArray(datum)) datum.forEach((dataItem => {
56
+ const newSelectedDataItemsInChart = [];
57
+ if (Array.isArray(datum)) datum.forEach((dataItem => {
57
58
  if (dataItem && 0 !== dataItem.key && Object.keys(dataItem).length > 0) {
58
59
  const selectedState = {};
59
60
  for (const itemKey in dataItem) itemKey.startsWith("VGRAMMAR_") || itemKey.startsWith("__VCHART") || (selectedState[itemKey] = dataItem[itemKey]);
60
- table._selectedDataItemsInChart.push(selectedState);
61
+ newSelectedDataItemsInChart.push(selectedState);
61
62
  }
62
63
  })); else if (datum && 0 !== datum.key && Object.keys(datum).length > 0) {
63
64
  const selectedState = {};
64
65
  for (const itemKey in datum) itemKey.startsWith("VGRAMMAR_") || itemKey.startsWith("__VCHART") || (selectedState[itemKey] = datum[itemKey]);
65
- table._selectedDataItemsInChart.push(selectedState);
66
+ newSelectedDataItemsInChart.push(selectedState);
66
67
  }
67
- if (0 === table._selectedDataItemsInChart.length && 0 === preSelectItemsCount) return;
68
- table.internalProps.layoutMap.updateDataStateToChartInstance(), clearChartCacheImage(scenegraph);
68
+ (0, vutils_1.isEqual)(table._selectedDataItemsInChart, newSelectedDataItemsInChart) || (table._selectedDataItemsInChart = newSelectedDataItemsInChart,
69
+ table.internalProps.layoutMap.updateDataStateToChartInstance(), clearChartCacheImage(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AAC;QAEnF,oBAAoB,CAAC,UAAU,CAAC,CAAC;KAClC;AACH,CAAC;AAzCD,4CAyCC;AAQD,SAAS,eAAe,CAAC,cAAqB,EAAE,KAAmB;IACjE,cAAc,CAAC,eAAe,CAAC,CAAC,MAAa,EAAE,EAAE;QAC/C,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE;YAC5B,MAAM,CAAC,eAAe,CAAC,CAAC,IAAW,EAAE,EAAE;gBACrC,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE;oBACxB,IAAI,eAAe,GAAG,KAAK,CAAC;oBAC5B,IAAI,CAAC,eAAe,CAAC,CAAC,IAAW,EAAE,EAAE;wBACnC,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE;4BACxB,eAAe,GAAG,IAAI,CAAC;4BACvB,OAAO,IAAI,CAAC;yBACb;wBACD,OAAO,KAAK,CAAC;oBACf,CAAC,CAAC,CAAC;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,IAAI,GAAG,IAAI,oBAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;wBAC/F,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 type { PivotChart } from '../../PivotChart';\nimport { CartesianAxis } from '../../components/axis/axis';\nimport type { PivotLayoutMap } from '../../layout/pivot-layout';\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';\n\n/** 供调整列宽后更新chart使用 */\nexport function updateChartSize(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\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 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 (table as PivotChart)._selectedDataItemsInChart.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 (table as PivotChart)._selectedDataItemsInChart.push(selectedState);\n }\n //避免无效的更新\n if ((table as PivotChart)._selectedDataItemsInChart.length === 0 && preSelectItemsCount === 0) {\n return;\n }\n\n (table.internalProps.layoutMap as PivotLayoutMap).updateDataStateToChartInstance();\n // 清楚chart缓存图片\n clearChartCacheImage(scenegraph);\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 axis = new CartesianAxis(axisConfig, cell.attribute.width, cell.attribute.height, table);\n cell.clear();\n cell.appendChild(axis.component);\n axis.overlap();\n }\n }\n });\n }\n });\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/refresh-node/update-chart.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAE3C,qDAA2D;AAQ3D,SAAgB,eAAe,CAAC,UAAsB,EAAE,GAAW;IAEjE,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,WAAW,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,CAAC,QAAe,EAAE,EAAE;YACpD,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,CAAC;YAE3D,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAW,EAAE,EAAE;gBACxC,IAAK,IAAY,CAAC,IAAI,KAAK,OAAO,EAAE;oBAoBlC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;oBACxB,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC7G,IAAI,CAAC,YAAY,CACf,QAAQ,EACR,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,C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art.js","sourcesContent":["import { isEqual } from '@visactor/vutils';\nimport type { PivotChart } from '../../PivotChart';\nimport { CartesianAxis } from '../../components/axis/axis';\nimport type { PivotLayoutMap } from '../../layout/pivot-layout';\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';\n\n/** 供调整列宽后更新chart使用 */\nexport function updateChartSize(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\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 PivotLayoutMap).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 axis = new CartesianAxis(axisConfig, cell.attribute.width, cell.attribute.height, table);\n cell.clear();\n cell.appendChild(axis.component);\n axis.overlap();\n }\n }\n });\n }\n });\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { IStage, IRect } from '@visactor/vrender';
2
2
  import { type CellAddress, type CellType, type ColumnIconOption, type SortOrder, IconFuncTypeEnum } from '../ts-types';
3
- import { Group } from './graphic/group';
3
+ import type { Group } from './graphic/group';
4
4
  import type { Icon } from './graphic/icon';
5
5
  import { TableComponent } from './component/table-component';
6
6
  import { SceneProxy } from './group-creater/progress/proxy';
@@ -20,9 +20,9 @@ export declare class Scenegraph {
20
20
  bodyGroup: Group;
21
21
  rightFrozenGroup: Group;
22
22
  bottomFrozenGroup: Group;
23
- rightTopCellGroup: Group;
24
- leftBottomCellGroup: Group;
25
- rightBottomCellGroup: Group;
23
+ rightTopCornerGroup: Group;
24
+ leftBottomCornerGroup: Group;
25
+ rightBottomCornerGroup: Group;
26
26
  componentGroup: Group;
27
27
  selectedRangeComponents: Map<string, {
28
28
  rect: IRect;
@@ -61,6 +61,9 @@ export declare class Scenegraph {
61
61
  highPerformanceGetCell(col: number, row: number, getShadow?: boolean): Group;
62
62
  getColGroup(col: number, isCornerOrColHeader?: boolean): Group;
63
63
  getColGroupInBottom(col: number): Group | undefined;
64
+ getColGroupInLeftBottomCorner(col: number): Group | undefined;
65
+ getColGroupInRightTopCorner(col: number): Group | undefined;
66
+ getColGroupInRightBottomCorner(col: number): Group | undefined;
64
67
  getCellSize(col: number, row: number): {
65
68
  width: number;
66
69
  height: number;
@@ -116,6 +119,8 @@ export declare class Scenegraph {
116
119
  };
117
120
  updateIcon(icon: Icon, iconConfig: ColumnIconOption): void;
118
121
  updateFrozen(): void;
122
+ dealWidthRightFrozen(rightFrozenColCount: number): void;
123
+ dealWidthBottomFrozen(bottomFrozenRowCount: number): void;
119
124
  updateBorderSizeAndPosition(): void;
120
125
  updateSortIcon(col: number, row: number, iconMark: Icon, order: SortOrder, oldSortCol: number, oldSortRow: number, oldIconMark: Icon | undefined): void;
121
126
  updateFrozenIcon(col: number, oldFrozenCol: number): void;